| | |
| | | @ApiOperation("新增潜在捐献信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:add')") |
| | | @Log(title = "捐献基础", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @PostMapping("/add") |
| | | @RepeatSubmit |
| | | public AjaxResult add(@RequestBody ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | 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); |
| | |
| | | } |
| | | 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; |
| | | } |
| | | |