Przeglądaj źródła

fix:pdsc,字典翻译

zhangkai 3 miesięcy temu
rodzic
commit
6e93dc0236

+ 10 - 0
nationrel-module-pdsc-api/src/main/java/com/nationrel/modules/pdsc/vo/ProjectInfoVo.java

@@ -21,4 +21,14 @@ public class ProjectInfoVo extends ProjectInfo {
      * 按钮操作,0:编辑,1:查看
      */
     private Integer btnOperation;
+
+    /**
+     * owner字典翻译
+     */
+    private String owner_dictText;
+
+    /**
+     * 部门字典翻译
+     */
+    private String sysOrgCode_dictText;
 }

+ 6 - 0
nationrel-module-pdsc-biz/src/main/java/com/nationrel/modules/pdsc/service/impl/ProjectInfoServiceImpl.java

@@ -220,6 +220,10 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
     public ProjectInfoVo queryById(String id) {
         ProjectInfo projectInfo = getById(id);
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        Map<String, String> ownerMap = commonApi.translateDictFromTableByKeys("sys_user", "realname", "id", projectInfo.getOwner(), "master")
+                .stream().collect(Collectors.toMap(DictModel::getValue, DictModel::getText));
+        Map<String, String> sysOrgCodeMap = commonApi.translateDictFromTableByKeys("sys_depart", "depart_name", "org_code", projectInfo.getSysOrgCode(), "master")
+                .stream().collect(Collectors.toMap(DictModel::getValue, DictModel::getText));
         //按钮操作,0:编辑,1:查看
         int btnOperation = ObjectUtil.equals(ProjectStatuseEnum.UNDER_PREPARATION.getType(), projectInfo.getStatus()) ? 0 : 1;
         if (ObjectUtil.notEqual(projectInfo.getOwner(), user.getId())) {
@@ -235,6 +239,8 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
         }
         ProjectInfoVo vo = new ProjectInfoVo();
         BeanUtil.copyProperties(projectInfo, vo);
+        vo.setOwner_dictText(ownerMap.getOrDefault(projectInfo.getOwner(), StrUtil.EMPTY));
+        vo.setSysOrgCode_dictText(sysOrgCodeMap.getOrDefault(projectInfo.getSysOrgCode(), StrUtil.EMPTY));
         vo.setBtnOperation(btnOperation);
         return vo;
     }