From 98f6e6652d700fe99b146531c81e7cd069d85985 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Tue, 24 Sep 2024 11:21:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=BD=BD=E4=BD=93=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E7=99=BB=E8=AE=B0=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../issued/CarrierIssuedController.java | 2 +- .../carrier/issued/SaveIssuedController.java | 70 ++++++++++++++++ .../carrier/issued/UseIssuedController.java | 83 +++++++++++++++++++ .../manager/CarrierIssuedManager.java | 10 ++- .../mapper/system/TdCarrierIssuedMapper.xml | 4 +- 5 files changed, 165 insertions(+), 4 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/SaveIssuedController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/UseIssuedController.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/CarrierIssuedController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/CarrierIssuedController.java index 7075a3f..f7788e2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/CarrierIssuedController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/CarrierIssuedController.java @@ -45,7 +45,7 @@ public class CarrierIssuedController extends BaseController { /** * 载体列表 */ - @RequiresPermissions("system:carrierIssued:list") + // @RequiresPermissions("system:carrierIssued:list") @PostMapping("/list") @ResponseBody public TableDataInfo list(TdCarrierIssued tdCarrierIssued) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/SaveIssuedController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/SaveIssuedController.java new file mode 100644 index 0000000..d03d673 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/SaveIssuedController.java @@ -0,0 +1,70 @@ +package com.ruoyi.web.controller.carrier.issued; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.carrier.TdCarrierIssued; +import com.ruoyi.web.controller.manager.CarrierIssuedManager; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + + +/** + * 保存Controller + * @author Administrator + */ +@Controller +@RequestMapping("system/saveIssued") +public class SaveIssuedController extends BaseController { + private String prefix = "system/saveIssued"; + + @Resource + private CarrierIssuedManager carrierIssuedManager; + + @RequiresPermissions("system:saveIssued:view") + @GetMapping() + public String saveIssued() { + return prefix + "/saveIssued"; + } + + /** + * 载体列表 + */ + @RequiresPermissions("system:saveIssued:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(TdCarrierIssued tdCarrierIssued) { + startPage(); + List carriers = carrierIssuedManager.selectTdCarrierList(tdCarrierIssued); + return getDataTable(carriers); + } + + /** + * 国家秘密载体保存 + */ + @RequiresPermissions("system:saveIssued:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") String id, ModelMap mmap) { + TdCarrierIssued tdCarrierIssued = carrierIssuedManager.selectTdCarrier(id); + mmap.put("tdCarrierIssued", tdCarrierIssued); + return prefix + "/edit"; + } + + /** + * 国家秘密载体保存 + */ + @RequiresPermissions("system:saveIssued:edit") + @Log(title = "国家秘密载体保存", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(TdCarrierIssued tdCarrierIssued) { + return toAjax(carrierIssuedManager.saveOrUpdate(tdCarrierIssued)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/UseIssuedController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/UseIssuedController.java new file mode 100644 index 0000000..ccb865b --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/carrier/issued/UseIssuedController.java @@ -0,0 +1,83 @@ +package com.ruoyi.web.controller.carrier.issued; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.carrier.TdCarrierIssued; +import com.ruoyi.web.controller.manager.CarrierIssuedManager; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + + +/** + * 使用Controller + */ +@Controller +@RequestMapping("/system/useIssued") +public class UseIssuedController extends BaseController { + private String prefix = "system/useIssued"; + + @Resource + private CarrierIssuedManager carrierIssuedManager; + + @RequiresPermissions("system:useIssued:view") + @GetMapping() + public String useIssued() { + return prefix + "/useIssued"; + } + + /** + * 载体列表 + */ + @RequiresPermissions("system:useIssued:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(TdCarrierIssued tdCarrierIssued) { + startPage(); + List carriers = carrierIssuedManager.selectTdCarrierList(tdCarrierIssued); + return getDataTable(carriers); + } + + /** + * 国家秘密载体使用 + */ + @RequiresPermissions("system:useIssued:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") String id, ModelMap mmap) { + TdCarrierIssued tdCarrierIssued = carrierIssuedManager.selectTdCarrier(id); + mmap.put("tdCarrierIssued", tdCarrierIssued); + return prefix + "/edit"; + } + + /** + * 国家秘密载体使用 + */ + @RequiresPermissions("system:useIssued:edit") + @Log(title = "国家秘密载体使用", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(TdCarrierIssued tdCarrierIssued) { + return toAjax(carrierIssuedManager.saveOrUpdate(tdCarrierIssued)); + } + + + /** + * 回收 + */ + @GetMapping("/updateStatus/{id}") + @ResponseBody + public AjaxResult updateStatus(@PathVariable("id") String id) { + return toAjax(carrierIssuedManager.updateStatus(id)); + } + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CarrierIssuedManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CarrierIssuedManager.java index 8967cc9..623d241 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CarrierIssuedManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CarrierIssuedManager.java @@ -3,7 +3,6 @@ package com.ruoyi.web.controller.manager; import cn.hutool.core.convert.Convert; import cn.hutool.core.text.CharSequenceUtil; import com.ruoyi.common.utils.ShiroUtils; -import com.ruoyi.system.domain.carrier.TdCarrier; import com.ruoyi.system.domain.carrier.TdCarrierIssued; import com.ruoyi.system.service.carrier.TdCarrierIssuedService; import org.springframework.stereotype.Component; @@ -55,4 +54,13 @@ public class CarrierIssuedManager { return carrierIssuedService.removeByIds(list); } + + public boolean updateStatus(String id) { + return carrierIssuedService.lambdaUpdate() + .eq(TdCarrierIssued::getId,id) + .set(TdCarrierIssued::getStatus,"3") + .set(TdCarrierIssued::getReclaimTime,new Date()) + .update(); + } + } diff --git a/ruoyi-system/src/main/resources/mapper/system/TdCarrierIssuedMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdCarrierIssuedMapper.xml index 68afba5..293ed3a 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdCarrierIssuedMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdCarrierIssuedMapper.xml @@ -57,7 +57,7 @@ mentSend_time,reclaim_time