jz.kai 4 роки тому
батько
коміт
3ac018f775

+ 4 - 0
common/src/main/java/com/jpsoft/enterprise/modules/base/entity/WhisperingWall.java

@@ -23,6 +23,8 @@ public class WhisperingWall {
     private String question;
     @ApiModelProperty(value = "提问人")
     private String questionBy;
+    private String questionByN;
+    private String questionByCompany;
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
     @ApiModelProperty(value = "提问时间")
@@ -31,6 +33,8 @@ public class WhisperingWall {
     private String answer;
     @ApiModelProperty(value = "回答人")
     private String answerBy;
+    private String answerByN;
+    private String answerByCompany;
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
     @ApiModelProperty(value = "回答时间")

+ 23 - 0
web/src/main/java/com/jpsoft/enterprise/modules/base/controller/WhisperingWallController.java

@@ -1,6 +1,10 @@
 package com.jpsoft.enterprise.modules.base.controller;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.enterprise.modules.base.entity.CompanyInfo;
+import com.jpsoft.enterprise.modules.base.entity.PersonInfo;
+import com.jpsoft.enterprise.modules.base.service.CompanyInfoService;
+import com.jpsoft.enterprise.modules.base.service.PersonInfoService;
 import com.jpsoft.enterprise.modules.common.utils.PojoUtils;
 import com.jpsoft.enterprise.modules.common.dto.Sort;
 import com.jpsoft.enterprise.modules.common.dto.MessageResult;
@@ -30,6 +34,10 @@ public class WhisperingWallController {
     private WhisperingWallService whisperingWallService;
     @Autowired
     private UserService userService;
+    @Autowired
+    private PersonInfoService personInfoService;
+    @Autowired
+    private CompanyInfoService companyInfoService;
 
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
@@ -224,6 +232,21 @@ public class WhisperingWallController {
         }
 
         Page<WhisperingWall> page = whisperingWallService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+        for(WhisperingWall whisperingWall : page.getResult()){
+            PersonInfo personInfoQuestion = personInfoService.get(whisperingWall.getQuestionBy());
+            if(personInfoQuestion != null) {
+//            CompanyInfo companyInfoQuestion = companyInfoService.get(personInfoQuestion.getCompanyId());
+                whisperingWall.setQuestionByN(personInfoQuestion.getPersonName());
+//            whisperingWall.setQuestionByCompany(companyInfoQuestion.getCompanyName());
+            }
+
+            PersonInfo personInfoAnswer = personInfoService.get(whisperingWall.getAnswerBy());
+            if(personInfoAnswer != null) {
+//            CompanyInfo companyInfoAnswer = companyInfoService.get(personInfoAnswer.getCompanyId());
+                whisperingWall.setAnswerByN(personInfoAnswer.getPersonName());
+//            whisperingWall.setAnswerByCompany(companyInfoAnswer.getCompanyName());
+            }
+        }
 
         msgResult.setResult(true);
         msgResult.setData(PojoUtils.pageWrapper(page));