Browse Source

sz 人员绑定所属单位信息

xiao547607 5 năm trước cách đây
mục cha
commit
596dc7b33f

+ 2 - 0
common/src/main/java/com/jpsoft/smart/modules/base/dto/PersonInfoDTO.java

@@ -67,4 +67,6 @@ public class PersonInfoDTO {
     private String popedom;
     @ApiModelProperty(value="设备")
     private String deviceName;
+    @ApiModelProperty(value="单位性质")
+    private String companyType;
 }

+ 3 - 0
common/src/main/java/com/jpsoft/smart/modules/base/entity/PersonInfo.java

@@ -164,4 +164,7 @@ public class PersonInfo {
             return allowViewLocal;
         }
     }
+
+    @ApiModelProperty(value="单位性质")
+    private String companyType;
 }

+ 11 - 0
web/src/main/java/com/jpsoft/smart/modules/base/controller/PersonInfoController.java

@@ -2,6 +2,7 @@ package com.jpsoft.smart.modules.base.controller;
 
 import com.github.pagehelper.Page;
 import com.jpsoft.smart.config.OSSConfig;
+import com.jpsoft.smart.modules.base.dto.CompanyInfoDTO;
 import com.jpsoft.smart.modules.base.dto.PersonInfoDTO;
 import com.jpsoft.smart.modules.base.entity.*;
 import com.jpsoft.smart.modules.base.service.*;
@@ -15,6 +16,7 @@ import com.jpsoft.smart.modules.lapi.service.ILapiService;
 import com.jpsoft.smart.modules.lapi.vo.LapiMsgResult;
 import com.jpsoft.smart.modules.lapi.vo.LapiResult;
 import com.jpsoft.smart.modules.sys.entity.User;
+import com.jpsoft.smart.modules.sys.service.DataDictionaryService;
 import com.jpsoft.smart.modules.sys.service.UserService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -68,6 +70,9 @@ public class PersonInfoController {
     @Autowired
     private CompanyPositionService companyPositionService;
 
+    @Autowired
+    private DataDictionaryService dataDictionaryService;
+
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
     public MessageResult<PersonInfo> create(){
@@ -193,6 +198,9 @@ public class PersonInfoController {
                     pc = pc.substring(0, pc.length() - 1);
                 }
                 personInfo.setPersonCompany(pc);
+
+                CompanyInfo companyInfo = companyInfoService.get(personInfo.getCompanyId());
+                personInfo.setCompanyType(companyInfo.getType());
                 msgResult.setResult(true);
                 msgResult.setData(personInfo);
             } else {
@@ -571,6 +579,9 @@ public class PersonInfoController {
                                 .collect(Collectors.joining(","));
 
             dto.setDeviceName(deviceName);
+
+            CompanyInfo personCompany = companyInfoService.get(dto.getCompanyId());
+            dto.setCompanyType(personCompany.getType());
         }
 
         msgResult.setResult(true);