From b6dd47b05107fc36d8ff4f7f29a4446521f95503 Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期四, 02 一月 2025 18:44:28 +0800 Subject: [PATCH] 代码提交 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceRelativesconfirmationController.java | 39 ++++++++++++++++++++------------------- 1 files changed, 20 insertions(+), 19 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceRelativesconfirmationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceRelativesconfirmationController.java index 1091173..9b321ae 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceRelativesconfirmationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceRelativesconfirmationController.java @@ -9,6 +9,7 @@ import com.ruoyi.common.enums.Education; import com.ruoyi.common.enums.NationalityEnum; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.project.domain.vo.RelativeConfirmationVO; import com.ruoyi.project.mapper.ServiceDonatebaseinfoMapper; import com.ruoyi.project.mapper.ServiceRelativesconfirmationMapper; @@ -70,7 +71,7 @@ * 鏌ヨ鎹愮尞浜插睘纭鍒楄〃 */ @ApiOperation("鑾峰彇浜插睘纭鍒楄〃") - //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:list')") + //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:list')") @GetMapping("/list") public TableDataInfo list(ServiceRelativesconfirmation serviceRelativesconfirmation) { startPage(); @@ -90,7 +91,7 @@ * 瀵煎嚭鎹愮尞浜插睘纭鍒楄〃 */ @ApiOperation("瀵煎嚭浜插睘纭鍒楄〃") - //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:export')") + //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:export')") @Log(title = "鎹愮尞浜插睘纭", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(ServiceRelativesconfirmation serviceRelativesconfirmation) { @@ -103,7 +104,7 @@ * 鑾峰彇鎹愮尞浜插睘纭璇︾粏淇℃伅 */ @ApiOperation("閫氳繃id鑾峰彇浜插睘纭淇℃伅") - //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:query')") + //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(serviceRelativesconfirmationService.getById(id)); @@ -113,30 +114,34 @@ * 鏂板鎹愮尞浜插睘纭 */ @ApiOperation("鏂板浜插睘纭") - //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:add')") + //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:add')") @Log(title = "鎹愮尞浜插睘纭", businessType = BusinessType.INSERT) - @PostMapping + @PostMapping("/add") @RepeatSubmit public AjaxResult add(@RequestBody ServiceRelativesconfirmation serviceRelativesconfirmation) { - return toAjax(serviceRelativesconfirmationService.save(serviceRelativesconfirmation)); + boolean save = serviceRelativesconfirmationService.save(serviceRelativesconfirmation); + return AjaxResult.success(serviceRelativesconfirmation); } /** * 淇敼鎹愮尞浜插睘纭 */ @ApiOperation("淇敼浜插睘纭") - //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:edit')") + //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:edit')") @Log(title = "鎹愮尞浜插睘纭", businessType = BusinessType.UPDATE) @PostMapping("/edit") @RepeatSubmit 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("鎹愮尞浜插睘纭鏁版嵁涓嶅瓨鍦�,璇锋鏌ュ悗鍐嶆淇敼"); + if (serviceRelativesconfirmation.getInfoid() == null || serviceRelativesconfirmation.getId() == null) { + throw new BaseException("璇疯仈绯诲伐绋嬪笀妫�鏌D鏄惁涓虹┖"); } - serviceRelativesconfirmation.setId(list.get(0).getId()); +// 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)); } @@ -144,7 +149,7 @@ * 鍒犻櫎鎹愮尞浜插睘纭 */ @ApiOperation("鍒犻櫎浜插睘纭") - //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:remove')") + //// @PreAuthorize("@ss.hasPermi('project:relativesconfirmation:remove')") @Log(title = "鎹愮尞浜插睘纭", businessType = BusinessType.DELETE) @GetMapping("/remove/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { @@ -184,17 +189,13 @@ try { out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8")); - - } catch (FileNotFoundException e1) { - e1.printStackTrace(); - } - try { t.process(dataMap, out); } catch (TemplateException e) { e.printStackTrace(); } Map<String, Object> map = new HashMap<>(); map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc"); + map.put("downloadName", name + ".doc"); return map; } -- Gitblit v1.9.3