From c538b2a9d00c7dc9de72cecbdc858aa74c7f3c86 Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Thu, 22 Aug 2024 09:32:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=9F=A5=E8=AF=A2=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../count/SysPropertynumController.java | 63 ++++++++++++------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java index 5bdb00e..427d0be 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java @@ -7,6 +7,7 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.TdPropertyEment; import com.ruoyi.system.domain.TdPropertyInfo; import com.ruoyi.system.domain.TdPropertyManager; import com.ruoyi.system.domain.count.PropertyDesCountDTO; @@ -16,12 +17,14 @@ import com.ruoyi.system.domain.count.UserSmCountDTO; import com.ruoyi.system.service.ISysDictDataService; import com.ruoyi.system.service.ITdPropertyInfoService; import com.ruoyi.system.service.ITdPropertyManagerService; +import com.ruoyi.system.service.TdPropertyEmentService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -37,10 +40,12 @@ public class SysPropertynumController extends BaseController { @Autowired private ITdPropertyInfoService tdPropertyInfoService; + @Resource + private TdPropertyEmentService tdPropertyEmentService; + @RequiresPermissions("system:propertynum:view") @GetMapping() - public String property() - { + public String property() { return prefix + "/propertynum"; } @@ -50,8 +55,7 @@ public class SysPropertynumController extends BaseController { @RequiresPermissions("system:propertynum:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(TdPropertyManager tdPropertyManager) - { + public TableDataInfo list(TdPropertyManager tdPropertyManager) { startPage(); List list = tdPropertyManagerService.selectTdPropertyManagerList(tdPropertyManager); return getDataTable(list); @@ -62,9 +66,8 @@ public class SysPropertynumController extends BaseController { */ @RequiresPermissions("system:propertynum:print") @GetMapping("/print/{useId}") - @Log(title = "密品设备统计", businessType = BusinessType.PRINT) - public String print(@PathVariable("useId") String useId, ModelMap mmap) - { + @Log(title = "涉密信息设备统计", businessType = BusinessType.PRINT) + public String print(@PathVariable("useId") String useId, ModelMap mmap) { List tdPropertyInfos = tdPropertyInfoService.selectTdPropertyInfoByUseId(useId); TdPropertyManager tdPropertyManager = tdPropertyManagerService.selectTdPropertyManagerByUseId(useId); mmap.put("tdPropertyInfos", tdPropertyInfos); @@ -73,28 +76,45 @@ public class SysPropertynumController extends BaseController { return prefix + "/print"; } + /** + * 打印界面 + */ + @RequiresPermissions("system:propertynum:print") + @GetMapping("/printEment/{useId}") + @Log(title = "涉密设备统计", businessType = BusinessType.PRINT) + public String printEment(@PathVariable("useId") String useId, ModelMap mmap) { + TdPropertyManager tdPropertyManager = tdPropertyManagerService.selectTdPropertyManagerByUseId(useId); + List tdPropertyEments = tdPropertyEmentService.lambdaQuery() + .eq(TdPropertyEment::getUseId, useId).list(); + mmap.put("tdPropertyEments", tdPropertyEments); + mmap.put("tdPropertyManager", tdPropertyManager); + mmap.put("sysuser", getSysUser()); + return prefix + "/printEment"; + } + + @Autowired private ISysDictDataService dictDataService; - + /** - * - * 密品统计 + * 密品统计 + * * @return com.ruoyi.common.core.domain.AjaxResult */ - + @PostMapping("/countInfo") @ResponseBody public AjaxResult countInfo() { - SysDictData sysDictData = new SysDictData(); + SysDictData sysDictData = new SysDictData(); sysDictData.setDictType("sys_sm_property"); List smType = dictDataService.selectDictDataList(sysDictData); List list = smType.stream().map(SysDictData::getDictLabel).collect(Collectors.toList()); List yAxisData = new ArrayList<>(); smType.forEach(xAxis -> { AtomicReference yAxis = new AtomicReference<>(0L); - Integer count = tdPropertyInfoService.lambdaQuery() - .eq(TdPropertyInfo::getPropertyType, xAxis.getDictValue()) - .count(); + Integer count = tdPropertyInfoService.lambdaQuery() + .eq(TdPropertyInfo::getPropertyType, xAxis.getDictValue()) + .count(); yAxis.set(Long.valueOf(count)); yAxisData.add(yAxis.get()); @@ -110,8 +130,8 @@ public class SysPropertynumController extends BaseController { private List xh = Arrays.asList("未销毁", "已销毁"); /** + * 统计密品报废统计 * - * 统计密品报废统计 * @return com.ruoyi.common.core.domain.AjaxResult */ @PostMapping("/countBF") @@ -121,9 +141,9 @@ public class SysPropertynumController extends BaseController { List datas = bf.stream() .map(name -> { AtomicReference value = new AtomicReference<>(0L); - if("未报废".equals(name)){ + if ("未报废".equals(name)) { value.set(propertyStateCountDTO.getWbf()); - }else{ + } else { value.set(propertyStateCountDTO.getYbf()); } JSONObject jsonObject = new JSONObject(); @@ -134,9 +154,10 @@ public class SysPropertynumController extends BaseController { .collect(Collectors.toList()); return AjaxResult.success(datas); } + /** + * 统计密品销毁统计 * - * 统计密品销毁统计 * @return com.ruoyi.common.core.domain.AjaxResult */ @PostMapping("/countXH") @@ -146,9 +167,9 @@ public class SysPropertynumController extends BaseController { List datas = xh.stream() .map(name -> { AtomicReference value = new AtomicReference<>(0L); - if("未销毁".equals(name)){ + if ("未销毁".equals(name)) { value.set(propertyDesCountDTO.getWxh()); - }else{ + } else { value.set(propertyDesCountDTO.getYxh()); } JSONObject jsonObject = new JSONObject();