| | |
| | | * 查询捐献基础列表 |
| | | */ |
| | | @ApiOperation("潜在捐献信息列表") |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:list')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:donatebaseinfo:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | log.info("潜在捐献信息列表:{}", serviceDonatebaseinfo); |
| | |
| | | * 导出捐献基础列表 |
| | | */ |
| | | @ApiOperation("导出潜在捐献信息列表") |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:export')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:donatebaseinfo:export')") |
| | | @Log(title = "捐献基础", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | |
| | | * 获取捐献基础详细信息 |
| | | */ |
| | | @ApiOperation("通过id获得潜在捐献信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:query')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:donatebaseinfo:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | log.info("通过id获得潜在捐献信息:{}", id); |
| | |
| | | * 新增捐献基础 |
| | | */ |
| | | @ApiOperation("新增潜在捐献信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:add')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:donatebaseinfo:add')") |
| | | @Log(title = "捐献基础", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @RepeatSubmit |
| | |
| | | log.info("新增潜在捐献信息:{}", serviceDonatebaseinfo); |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | |
| | | String bh = ""; |
| | | bh = serviceDonatebaseinfoService.getDonateNumber(serviceDonatebaseinfo); |
| | | if (bh == "") { |
| | | return AjaxResult.error("新增时生成的编号为空,创建失败!"); |
| | | } else { |
| | | ServiceDonatebaseinfo serviceDonatebaseinfo1 = new ServiceDonatebaseinfo(); |
| | | serviceDonatebaseinfo1.setDonorno(bh); |
| | | List<ServiceDonatebaseinfo> listrecord = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo1); |
| | | if (listrecord.size() > 0) { |
| | | return AjaxResult.error("新增时生成的编号" + bh + "已存在,无法保存!"); |
| | | } |
| | | |
| | | } |
| | | // String bh = ""; |
| | | // bh = serviceDonatebaseinfoService.getDonateNumber(serviceDonatebaseinfo); |
| | | // if (bh == "") { |
| | | // return AjaxResult.error("新增时生成的编号为空,创建失败!"); |
| | | // } else { |
| | | // ServiceDonatebaseinfo serviceDonatebaseinfo1 = new ServiceDonatebaseinfo(); |
| | | // serviceDonatebaseinfo1.setDonorno(bh); |
| | | // List<ServiceDonatebaseinfo> listrecord = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo1); |
| | | // if (listrecord.size() > 0) { |
| | | // return AjaxResult.error("新增时生成的编号" + bh + "已存在,无法保存!"); |
| | | // } |
| | | // |
| | | // } |
| | | String idcardno = serviceDonatebaseinfo.getIdcardno(); |
| | | ServiceDonatebaseinfo serviceDonatebaseinfo2 = new ServiceDonatebaseinfo(); |
| | | serviceDonatebaseinfo2.setIdcardno(idcardno); |
| | |
| | | return AjaxResult.error("新增时身份证" + idcardno + "已存在,无法保存!"); |
| | | } |
| | | |
| | | serviceDonatebaseinfo.setDonorno(bh); |
| | | // serviceDonatebaseinfo.setDonorno(bh); |
| | | serviceDonatebaseinfo.setDeptid(user.getDeptId()); |
| | | serviceDonatebaseinfo.setDeptname(sysDeptMapper.getDeptNameByDeptId(user.getDeptId())); |
| | | serviceDonatebaseinfoService.save(serviceDonatebaseinfo); |
| | |
| | | * 修改捐献基础 |
| | | */ |
| | | @ApiOperation("修改潜在捐献信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:edit')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:donatebaseinfo:edit')") |
| | | @Log(title = "捐献基础", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @RepeatSubmit |
| | |
| | | * 删除捐献基础 |
| | | */ |
| | | @ApiOperation("删除潜在捐献信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:remove')") |
| | | //// @PreAuthorize("@ss.hasPermi('project:donatebaseinfo:remove')") |
| | | @Log(title = "捐献基础", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | |
| | | } |
| | | |
| | | @ApiOperation("获取捐献编号") |
| | | @GetMapping("/donatenumber") |
| | | public AjaxResult getDonateNumber(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | @PostMapping("/donatenumber") |
| | | public AjaxResult getDonateNumber(@RequestBody ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | log.info("获取捐献编号:{}", serviceDonatebaseinfo); |
| | | return AjaxResult.success(serviceDonatebaseinfoService.getDonateNumber(serviceDonatebaseinfo)); |
| | | } |
| | |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc"); |
| | | map.put("downloadName", name + ".doc"); |
| | | map.put("downloadName", name + ".doc"); |
| | | return map; |
| | | } |
| | | |