From e23e00d964f096a4abc6a8d89da6cfeee486ce77 Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Tue, 20 Aug 2024 11:20:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AF=86=E5=93=81=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=BB=B4=E4=BF=AE=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../property/TdPropertyManagerController.java | 49 +++++++++---------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyManagerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyManagerController.java index 333e725..9c99644 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyManagerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/property/TdPropertyManagerController.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.common.utils.uuid.Seq; import com.ruoyi.system.domain.TdPropertyInfo; import com.ruoyi.system.service.ITdPropertyInfoService; +import com.ruoyi.system.service.TdPropertyEmentService; import com.ruoyi.web.controller.manager.SysAreaManager; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -30,14 +31,13 @@ import javax.annotation.Resource; /** * 密品登记Controller - * + * * @author ruoyi * @date 2024-04-26 */ @Controller @RequestMapping("/system/property") -public class TdPropertyManagerController extends BaseController -{ +public class TdPropertyManagerController extends BaseController { private String prefix = "system/property/property"; @Autowired @@ -45,13 +45,15 @@ public class TdPropertyManagerController extends BaseController @Autowired private ITdPropertyInfoService tdPropertyInfoService; + @Resource + private TdPropertyEmentService tdPropertyEmentService; + @Resource private SysAreaManager sysAreaManager; @RequiresPermissions("system:property:view") @GetMapping() - public String property() - { + public String property() { return prefix + "/property"; } @@ -61,8 +63,7 @@ public class TdPropertyManagerController extends BaseController @RequiresPermissions("system:property:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(TdPropertyManager tdPropertyManager) - { + public TableDataInfo list(TdPropertyManager tdPropertyManager) { startPage(); List list = tdPropertyManagerService.selectTdPropertyManagerList(tdPropertyManager); return getDataTable(list); @@ -75,8 +76,7 @@ public class TdPropertyManagerController extends BaseController @Log(title = "密品登记", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(TdPropertyManager tdPropertyManager) - { + public AjaxResult export(TdPropertyManager tdPropertyManager) { List list = tdPropertyManagerService.selectTdPropertyManagerList(tdPropertyManager); list.forEach(tdPropertyManager1 -> { tdPropertyManager1.setPart(sysAreaManager.getAreaName(tdPropertyManager1.getPart())); @@ -90,9 +90,8 @@ public class TdPropertyManagerController extends BaseController * 新增密品登记 */ @GetMapping("/add") - public String add(ModelMap mmap) - { - mmap.put("sysuser",getSysUser()); + public String add(ModelMap mmap) { + mmap.put("sysuser", getSysUser()); return prefix + "/add"; } @@ -103,9 +102,8 @@ public class TdPropertyManagerController extends BaseController @Log(title = "密品登记", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(TdPropertyManager tdPropertyManager) - { - tdPropertyManager.setUseId("Property_"+ Seq.getId(Seq.commSeqType)); + public AjaxResult addSave(TdPropertyManager tdPropertyManager) { + tdPropertyManager.setUseId("Property_" + Seq.getId(Seq.commSeqType)); return toAjax(tdPropertyManagerService.insertTdPropertyManager(tdPropertyManager)); } @@ -114,8 +112,7 @@ public class TdPropertyManagerController extends BaseController */ @RequiresPermissions("system:property:edit") @GetMapping("/edit/{useId}") - public String edit(@PathVariable("useId") String useId, ModelMap mmap) - { + public String edit(@PathVariable("useId") String useId, ModelMap mmap) { TdPropertyManager tdPropertyManager = tdPropertyManagerService.selectTdPropertyManagerByUseId(useId); mmap.put("tdPropertyManager", tdPropertyManager); return prefix + "/edit"; @@ -128,8 +125,7 @@ public class TdPropertyManagerController extends BaseController @Log(title = "密品登记", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody - public AjaxResult editSave(TdPropertyManager tdPropertyManager) - { + public AjaxResult editSave(TdPropertyManager tdPropertyManager) { return toAjax(tdPropertyManagerService.updateTdPropertyManager(tdPropertyManager)); } @@ -138,13 +134,13 @@ public class TdPropertyManagerController extends BaseController */ @RequiresPermissions("system:property:remove") @Log(title = "密品登记", businessType = BusinessType.DELETE) - @PostMapping( "/remove") + @PostMapping("/remove") @ResponseBody - public AjaxResult remove(String ids) - { - QueryWrapper queryWrapper= new QueryWrapper(); - queryWrapper.in("use_id",ids.split(",")); + public AjaxResult remove(String ids) { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.in("use_id", ids.split(",")); tdPropertyInfoService.remove(queryWrapper); + tdPropertyEmentService.remove(queryWrapper); return toAjax(tdPropertyManagerService.deleteTdPropertyManagerByUseIds(ids)); } @@ -153,9 +149,8 @@ public class TdPropertyManagerController extends BaseController */ @RequiresPermissions("system:property:list") @GetMapping("/detail/{useId}") - public String detail(@PathVariable("useId") String useId, ModelMap mmap) - { - mmap.put("useId",useId); + public String detail(@PathVariable("useId") String useId, ModelMap mmap) { + mmap.put("useId", useId); return "system/property/data/propertyinfo"; }