|
@@ -22,6 +22,8 @@ import com.jeeplus.logging.annotation.ApiLog;
|
|
|
import com.jeeplus.logging.constant.enums.LogTypeEnum;
|
|
|
//import com.jeeplus.sys.utils.DictUtils;
|
|
|
import com.jeeplus.sys.feign.IDictApi;
|
|
|
+import com.jeeplus.sys.feign.IUserApi;
|
|
|
+import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -68,6 +70,7 @@ public class CwWorkClientController {
|
|
|
public ResponseEntity<IPage<CwWorkClientBaseDTO>> data(CwWorkClientBaseDTO cwWorkClientBaseDTO, Page<CwWorkClientBaseDTO> page) throws Exception {
|
|
|
IPage<CwWorkClientBaseDTO> result = new Page<CwWorkClientBaseDTO>();
|
|
|
result = cwWorkClientService.findList (page,cwWorkClientBaseDTO);
|
|
|
+ List<UserDTO> allUserInfo = SpringUtil.getBean(IUserApi.class).getAllUserInfo();
|
|
|
result.getRecords().stream().forEach(i -> {
|
|
|
if (StringUtils.isNotBlank(i.getTaskId()) && StringUtils.isNotBlank(i.getStatus())) {
|
|
|
if ("2".equals(i.getStatus())) { // “审核中”的数据要获取数据审核人
|
|
@@ -75,6 +78,40 @@ public class CwWorkClientController {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ result.getRecords().forEach(li -> {
|
|
|
+ if (StringUtils.isBlank(li.getCreateBy().getName())){
|
|
|
+ //根据项目经理1的id去查项目经理去名称
|
|
|
+ UserDTO createBy = li.getCreateBy();
|
|
|
+ if (StringUtils.isNotBlank(li.getCreateBy().getId())){
|
|
|
+ UserDTO matchingUser = null;
|
|
|
+ for (UserDTO user : allUserInfo) {
|
|
|
+ if (createBy.getId().equals(user.getId())) {
|
|
|
+ matchingUser = user;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (matchingUser != null) {
|
|
|
+ String name = matchingUser.getName(); // Assuming the property name is "userName"
|
|
|
+ createBy.setName(name);
|
|
|
+ li.setCreateBy(createBy);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (StringUtils.isBlank(li.getUpdateUserName())) {
|
|
|
+ if (StringUtils.isNotBlank(li.getUpdateUser())){
|
|
|
+ UserDTO matchingUser = null;
|
|
|
+ for (UserDTO user : allUserInfo) {
|
|
|
+ if (li.getUpdateUser().equals(user.getId())) {
|
|
|
+ matchingUser = user;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (matchingUser != null) {
|
|
|
+ String projectMasterName = matchingUser.getName(); // Assuming the property name is "userName"
|
|
|
+ li.setUpdateUserName(projectMasterName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
return ResponseEntity.ok (result);
|
|
|
}
|
|
|
|