| | |
| | | @Api("潜在捐献信息管理") |
| | | @RestController |
| | | @RequestMapping("/project/donatebaseinfo") |
| | | public class ServiceDonatebaseinfoController extends BaseController |
| | | { |
| | | public class ServiceDonatebaseinfoController extends BaseController { |
| | | @Autowired |
| | | private IServiceDonatebaseinfoService serviceDonatebaseinfoService; |
| | | |
| | |
| | | @ApiOperation("潜在捐献信息列表") |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ServiceDonatebaseinfo serviceDonatebaseinfo) |
| | | { |
| | | public TableDataInfo list(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | startPage(); |
| | | //List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo); |
| | | List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.selectServiceDonatebaseinfoList(serviceDonatebaseinfo); |
| | |
| | | |
| | | @ApiOperation("小程序端潜在捐献信息列表") |
| | | @GetMapping("/listForSearch") |
| | | public TableDataInfo listForSearch(ServiceDonatebaseinfo serviceDonatebaseinfo) |
| | | { |
| | | public TableDataInfo listForSearch(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | startPage(); |
| | | List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.listForSearch(serviceDonatebaseinfo); |
| | | return getDataTable(list); |
| | |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:export')") |
| | | @Log(title = "捐献基础", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(ServiceDonatebaseinfo serviceDonatebaseinfo) |
| | | { |
| | | public AjaxResult export(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo); |
| | | ExcelUtil<ServiceDonatebaseinfo> util = new ExcelUtil<ServiceDonatebaseinfo>(ServiceDonatebaseinfo.class); |
| | | return util.exportExcel(list, "捐献基础数据"); |
| | |
| | | @ApiOperation("通过id获得潜在捐献信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(serviceDonatebaseinfoService.getById(id)); |
| | | } |
| | | |
| | |
| | | @Log(title = "捐献基础", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @RepeatSubmit |
| | | public AjaxResult add(@RequestBody ServiceDonatebaseinfo serviceDonatebaseinfo) |
| | | { |
| | | public AjaxResult add(@RequestBody ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | |
| | | String bh= ""; |
| | | bh = serviceDonatebaseinfoService.getDonateNumber(serviceDonatebaseinfo); |
| | | if (bh == "") |
| | | { |
| | | if (bh == "") { |
| | | return AjaxResult.error("新增时生成的编号为空,创建失败!"); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | ServiceDonatebaseinfo serviceDonatebaseinfo1 = new ServiceDonatebaseinfo(); |
| | | serviceDonatebaseinfo1.setDonorno(bh); |
| | | List<ServiceDonatebaseinfo> listrecord = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo1); |
| | | if (listrecord.size()>0) |
| | | { |
| | | if (listrecord.size() > 0) { |
| | | return AjaxResult.error("新增时生成的编号"+bh+"已存在,无法保存!"); |
| | | } |
| | | |
| | |
| | | ServiceDonatebaseinfo serviceDonatebaseinfo2 = new ServiceDonatebaseinfo(); |
| | | serviceDonatebaseinfo2.setIdcardno(idcardno); |
| | | List<ServiceDonatebaseinfo> listrecord2 = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo2); |
| | | if (listrecord2.size()>0) |
| | | { |
| | | if (listrecord2.size() > 0) { |
| | | return AjaxResult.error("新增时身份证"+idcardno+"已存在,无法保存!"); |
| | | } |
| | | |
| | | |
| | | serviceDonatebaseinfo.setDonorno(bh); |
| | | //serviceDonatebaseinfo.setDeptid(user.getDeptId()); |
| | | //serviceDonatebaseinfo.setDeptname(sysDeptMapper.getDeptNameByDeptId(user.getDeptId())); |
| | | serviceDonatebaseinfo.setDeptid(user.getDeptId()); |
| | | serviceDonatebaseinfo.setDeptname(sysDeptMapper.getDeptNameByDeptId(user.getDeptId())); |
| | | |
| | | return toAjax(serviceDonatebaseinfoService.save(serviceDonatebaseinfo)); |
| | | } |
| | |
| | | @Log(title = "捐献基础", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody ServiceDonatebaseinfo serviceDonatebaseinfo) |
| | | { |
| | | public AjaxResult edit(@RequestBody ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | return toAjax(serviceDonatebaseinfoService.updateById(serviceDonatebaseinfo)); |
| | | } |
| | | |
| | |
| | | //@PreAuthorize("@ss.hasPermi('project:donatebaseinfo:remove')") |
| | | @Log(title = "捐献基础", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | return toAjax(serviceDonatebaseinfoService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 注意dataMap里存放的数据Key值要与模板中的参数相对应 |
| | | * |
| | | * @param dataMap |
| | | */ |
| | | private void getData(Map dataMap,Long id) |
| | | { |
| | | private void getData(Map dataMap, Long id) { |
| | | ServiceDonatebaseinfo serviceDonatebaseinfo = serviceDonatebaseinfoService.getById(id); |
| | | if(serviceDonatebaseinfo == null){ |
| | | throw new ServiceException("下载失败,用户信息出错", HttpStatus.NO_CONTENT); |
| | |
| | | |
| | | if(serviceDonatebaseinfo.getFamilyrelations() == null){ |
| | | dataMap.put("YJXZGX",""); |
| | | } |
| | | else if(serviceDonatebaseinfo.getFamilyrelations().equals("0")){ |
| | | } else if (serviceDonatebaseinfo.getFamilyrelations().equals("0")) { |
| | | dataMap.put("YJXZGX","本人"); |
| | | }else if(serviceDonatebaseinfo.getFamilyrelations().equals("1")){ |
| | | dataMap.put("YJXZGX","配偶"); |