| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | |
| | | @Api("亲属确认管理") |
| | | @RestController |
| | | @RequestMapping("/project/relativesconfirmation") |
| | | public class ServiceRelativesconfirmationController extends BaseController |
| | | { |
| | | public class ServiceRelativesconfirmationController extends BaseController { |
| | | @Autowired |
| | | private IServiceRelativesconfirmationService serviceRelativesconfirmationService; |
| | | |
| | |
| | | @ApiOperation("获取亲属确认列表") |
| | | //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ServiceRelativesconfirmation serviceRelativesconfirmation) |
| | | { |
| | | public TableDataInfo list(ServiceRelativesconfirmation serviceRelativesconfirmation) { |
| | | startPage(); |
| | | List<ServiceRelativesconfirmation> list = serviceRelativesconfirmationService.queryList(serviceRelativesconfirmation); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @GetMapping("/listnew") |
| | | public TableDataInfo listnew (RelativeConfirmationVO relativeConfirmationVO) |
| | | { |
| | | public TableDataInfo listnew(RelativeConfirmationVO relativeConfirmationVO) { |
| | | startPage(); |
| | | List<RelativeConfirmationVO> list = serviceRelativesconfirmationService.selectVOList(relativeConfirmationVO); |
| | | return getDataTable(list); |
| | |
| | | //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:export')") |
| | | @Log(title = "捐献亲属确认", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(ServiceRelativesconfirmation serviceRelativesconfirmation) |
| | | { |
| | | public AjaxResult export(ServiceRelativesconfirmation serviceRelativesconfirmation) { |
| | | List<ServiceRelativesconfirmation> list = serviceRelativesconfirmationService.queryList(serviceRelativesconfirmation); |
| | | ExcelUtil<ServiceRelativesconfirmation> util = new ExcelUtil<ServiceRelativesconfirmation>(ServiceRelativesconfirmation.class); |
| | | return util.exportExcel(list, "捐献亲属确认数据"); |
| | |
| | | @ApiOperation("通过id获取亲属确认信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(serviceRelativesconfirmationService.getById(id)); |
| | | } |
| | | |
| | |
| | | @Log(title = "捐献亲属确认", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @RepeatSubmit |
| | | public AjaxResult add(@RequestBody ServiceRelativesconfirmation serviceRelativesconfirmation) |
| | | { |
| | | public AjaxResult add(@RequestBody ServiceRelativesconfirmation serviceRelativesconfirmation) { |
| | | return toAjax(serviceRelativesconfirmationService.save(serviceRelativesconfirmation)); |
| | | } |
| | | |
| | |
| | | @Log(title = "捐献亲属确认", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody ServiceRelativesconfirmation serviceRelativesconfirmation) |
| | | { |
| | | public AjaxResult edit(@RequestBody ServiceRelativesconfirmation serviceRelativesconfirmation) { |
| | | ServiceRelativesconfirmation serviceRelativesconfirmation1 = new ServiceRelativesconfirmation(); |
| | | serviceRelativesconfirmation1.setInfoid(serviceRelativesconfirmation.getInfoid()); |
| | | List<ServiceRelativesconfirmation> list = serviceRelativesconfirmationService.queryList(serviceRelativesconfirmation1); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return error("捐献亲属确认数据不存在,请检查后再次修改"); |
| | | } |
| | | serviceRelativesconfirmation.setId(list.get(0).getId()); |
| | | return toAjax(serviceRelativesconfirmationService.updateById(serviceRelativesconfirmation)); |
| | | } |
| | | |
| | |
| | | //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:remove')") |
| | | @Log(title = "捐献亲属确认", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | return toAjax(serviceRelativesconfirmationService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | |
| | | map.put("downloadUrl","/profile/download/wordtemplate/"+name+".doc"); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 注意dataMap里存放的数据Key值要与模板中的参数相对应 |
| | | * |
| | | * @param dataMap |
| | | */ |
| | | private void getData(Map dataMap,Long id){ |