| | |
| | | package com.ruoyi.web.controller.project; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.annotation.NotRepeatCommit; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | |
| | | import freemarker.template.TemplateException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | * @author ruoyi |
| | | * @date 2021-11-10 |
| | | */ |
| | | @Slf4j |
| | | @Api("潜在捐献信息管理") |
| | | @RestController |
| | | @RequestMapping("/project/donatebaseinfo") |
| | |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | log.info("潜在捐献信息列表:{}", serviceDonatebaseinfo); |
| | | startPage(); |
| | | //List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo); |
| | | List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.selectServiceDonatebaseinfoList(serviceDonatebaseinfo); |
| | |
| | | @ApiOperation("小程序端潜在捐献信息列表") |
| | | @GetMapping("/listForSearch") |
| | | public TableDataInfo listForSearch(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | log.info("小程序端潜在捐献信息列表:{}", serviceDonatebaseinfo); |
| | | startPage(); |
| | | List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.listForSearch(serviceDonatebaseinfo); |
| | | return getDataTable(list); |
| | |
| | | @Log(title = "捐献基础", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | log.info("导出潜在捐献信息列表:{}", serviceDonatebaseinfo); |
| | | List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo); |
| | | ExcelUtil<ServiceDonatebaseinfo> util = new ExcelUtil<ServiceDonatebaseinfo>(ServiceDonatebaseinfo.class); |
| | | return util.exportExcel(list, "捐献基础数据"); |
| | |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | log.info("通过id获得潜在捐献信息:{}", id); |
| | | return AjaxResult.success(serviceDonatebaseinfoService.getById(id)); |
| | | } |
| | | |
| | |
| | | @PostMapping |
| | | @RepeatSubmit |
| | | public AjaxResult add(@RequestBody ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | log.info("新增潜在捐献信息:{}", serviceDonatebaseinfo); |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | |
| | | String bh = ""; |
| | |
| | | return AjaxResult.error("新增时身份证" + idcardno + "已存在,无法保存!"); |
| | | } |
| | | |
| | | |
| | | serviceDonatebaseinfo.setDonorno(bh); |
| | | serviceDonatebaseinfo.setDeptid(user.getDeptId()); |
| | | serviceDonatebaseinfo.setDeptname(sysDeptMapper.getDeptNameByDeptId(user.getDeptId())); |
| | | |
| | | return toAjax(serviceDonatebaseinfoService.save(serviceDonatebaseinfo)); |
| | | serviceDonatebaseinfoService.save(serviceDonatebaseinfo); |
| | | Map<String, Long> map = new HashMap<>(); |
| | | map.put("id", serviceDonatebaseinfo.getId()); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("修改潜在捐献信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:edit')") |
| | | @Log(title = "捐献基础", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @PostMapping("/edit") |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | log.info("修改潜在捐献信息:{}", serviceDonatebaseinfo); |
| | | return toAjax(serviceDonatebaseinfoService.updateById(serviceDonatebaseinfo)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("删除潜在捐献信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:remove')") |
| | | @Log(title = "捐献基础", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | log.info("删除潜在捐献信息:{}", ids); |
| | | return toAjax(serviceDonatebaseinfoService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @ApiOperation("获取捐献编号") |
| | | @GetMapping("/donatenumber") |
| | | public AjaxResult getDonateNumber(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | log.info("获取捐献编号:{}", serviceDonatebaseinfo); |
| | | return AjaxResult.success(serviceDonatebaseinfoService.getDonateNumber(serviceDonatebaseinfo)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("获取捐献报告人") |
| | | @GetMapping("/reportName/{usertype}") |
| | | public AjaxResult getReportName(@PathVariable("usertype") String usertype) { |
| | | log.info("获取捐献报告人:{}", usertype); |
| | | return AjaxResult.success(serviceExternalpersonService.getReportName(usertype)); |
| | | } |
| | | |
| | | @GetMapping(value = "/updateS1S2S3S4/{id}") |
| | | public AjaxResult updateS1S2S3S4(@PathVariable Long id) { |
| | | log.info("updateS1S2S3S4的入参:{}", id); |
| | | return AjaxResult.success(serviceDonatebaseinfoService.updateS1S2S3S4(id)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("通过id下载人体器官潜在捐献者登记表") |
| | | @GetMapping(value = "/download/{id}") |
| | | public Map downloadInfo(@PathVariable("id") Long id) throws IOException { |
| | | log.info("通过id下载人体器官潜在捐献者登记表:{}", id); |
| | | Map dataMap = new HashMap(); |
| | | getData(dataMap, id); |
| | | String filePath = getClass().getResource("/template/").getPath(); |
| | |
| | | @ApiOperation("获取状态获取计数") |
| | | @GetMapping("/countByRecordState") |
| | | public AjaxResult countByRecordState(TimeVO timeVO) { |
| | | log.info("获取状态获取计数:{}", timeVO); |
| | | return AjaxResult.success(serviceDonatebaseinfoService.countByRecordState(timeVO)); |
| | | } |
| | | |
| | | /** |
| | | * 获取捐献工作流 |
| | | */ |
| | | @ApiOperation("获取捐献工作流") |
| | | @GetMapping(value = "/getWorkFlow/{id}") |
| | | public AjaxResult getWorkFlow(@PathVariable("id") Long id) { |
| | | log.info("获取捐献工作流:{}", id); |
| | | return AjaxResult.success(serviceDonatebaseinfoService.getWorkFlow(id)); |
| | | } |
| | | |
| | | } |