Bladeren bron

集群管理po、vo日期加格式设置;个人信息管理-场景资源计算数量修改

zhaoyan 2 jaren geleden
bovenliggende
commit
2534c2ee57

+ 3 - 0
api-common/src/main/java/api/common/pojo/po/system/ClusterPO.java

@@ -1,6 +1,7 @@
 package api.common.pojo.po.system;
 
 import api.common.pojo.common.CommonPO;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.util.Date;
@@ -12,7 +13,9 @@ public class ClusterPO extends CommonPO {
     private String userId;        // 账户id
     private String userName;      //账户名称
     private int numSimulationLicense;        // 仿真软件license数量
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
     private Date dateSimulationLicense;       // 仿真软件license到期时间
     private int numDynamicLicense;        // 动力学软件license数量
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
     private Date dateDynamicLicense;       // 动力学软件license到期时间
 }

+ 3 - 0
api-common/src/main/java/api/common/pojo/vo/system/ClusterVO.java

@@ -1,5 +1,6 @@
 package api.common.pojo.vo.system;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.util.Date;
@@ -12,8 +13,10 @@ public class ClusterVO {
     private String useType;        // 占用类型
     private String userId;        // 账户id
     private int numSimulationLicense;        // 仿真软件license数量
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
     private Date dateSimulationLicense;       // 仿真软件license到期时间
     private int numDynamicLicense;        // 动力学软件license数量
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
     private Date dateDynamicLicense;       // 动力学软件license到期时间
     private Date modifyTime;        // 操作时间
 

+ 26 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/UserInfoCtrl.java

@@ -3,6 +3,7 @@ package com.css.simulation.resource.system.ctrl;
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.param.scene.SystemScenePackageParam;
+import api.common.pojo.po.scene.SystemScenePackageSublistPO;
 import api.common.pojo.po.system.UserPO;
 import api.common.pojo.vo.scene.SystemScenePackageVO;
 import api.common.pojo.vo.system.ClusterVO;
@@ -10,6 +11,7 @@ import api.common.pojo.vo.system.ParameterVO;
 import api.common.pojo.vo.system.UserVO;
 import api.common.util.ObjectUtil;
 import com.css.simulation.resource.common.utils.AuthUtil;
+import com.css.simulation.resource.scene.mapper.SystemScenePackageSublistMapper;
 import com.css.simulation.resource.scene.service.SystemScenePackageService;
 import com.css.simulation.resource.system.service.ClusterService;
 import com.css.simulation.resource.system.service.ParameterService;
@@ -42,6 +44,9 @@ public class UserInfoCtrl {
     @Resource
     SystemScenePackageService systemScenePackageService;
 
+    @Resource
+    SystemScenePackageSublistMapper systemScenePackageSublistMapper;
+
 
     /**
      * 获取当前登录人详情
@@ -96,6 +101,27 @@ public class UserInfoCtrl {
         SystemScenePackageParam param = new SystemScenePackageParam();
         param.setUserId(userId);
         List<SystemScenePackageVO> list = systemScenePackageService.querySystemScenePackageList(param);
+
+        for (SystemScenePackageVO vo:list) {
+
+            SystemScenePackageSublistPO sublistPo=new SystemScenePackageSublistPO();
+            sublistPo.setSceneAndPackage(vo.getId());
+            sublistPo.setSceneType("1");
+            List<String>  zrList=systemScenePackageSublistMapper.querySceneNaturalList(sublistPo);
+            sublistPo.setSceneType("2");
+            List<String>  bzList=systemScenePackageSublistMapper.querySceneStandardsRegulationsList(sublistPo);
+            sublistPo.setSceneType("3");
+            List<String>  jtList=systemScenePackageSublistMapper.querySceneAccidentList(sublistPo);
+            sublistPo.setSceneType("4");
+            List<String>  fhList=systemScenePackageSublistMapper.querySceneGeneralTemplateList(sublistPo);
+            vo.setZrCount(zrList.size());
+            vo.setBzCount(bzList.size());
+            vo.setJtCount(jtList.size());
+            vo.setFhCount(fhList.size());
+            vo.setTotalCount(zrList.size() + bzList.size() + jtList.size() + fhList.size());
+        }
+
+
         long zrTotalCount = list.stream().mapToLong(SystemScenePackageVO::getZrCount).sum();
         long bzTotalCount = list.stream().mapToLong(SystemScenePackageVO::getBzCount).sum();
         long jtTotalCount = list.stream().mapToLong(SystemScenePackageVO::getJtCount).sum();