Commit 4bf541c5 authored by wangqiang's avatar wangqiang

修改todo

parent 1399d312
......@@ -42,13 +42,24 @@
</dependency>
<dependency>
<groupId>com.yonde.dcs</groupId>
<artifactId>dcs-doc-common</artifactId>
<artifactId>dcs-doc-expand-common</artifactId>
<version>4.1-RELEASE</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.yonde.dcs</groupId>-->
<!-- <artifactId>dcs-doc-common</artifactId>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>com.yonde.dcs</groupId>-->
<!-- <artifactId>dcs-doc-expand</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<dependency>
<groupId>com.yonde.dex</groupId>
<artifactId>dex-basic-service-common</artifactId>
<version>4.1-RELEASE</version>
</dependency>
<dependency>
<groupId>com.jacob</groupId>
......@@ -78,5 +89,4 @@
</dependencies>
</project>
package com.yonde.dcs.plan.core.service.impl;
import com.yonde.dcs.plan.common.vo.ExtDisReocredLinkVO;
import com.yonde.dcs.plan.common.vo.ExtIncomeContractVO;
import com.yonde.dcs.plan.common.vo.ExtPlanVO;
import com.yonde.dcs.plan.core.service.AutoTaskService;
import com.yonde.dcs.plan.core.service.ExtDisReocredLinkService;
......@@ -10,7 +11,11 @@ import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.utils.obj.DxEntityUtils;
import com.yonde.dex.dao.service.util.DxPageUtils;
import com.yonde.dex.user.common.vo.DxOrganizationVO;
import com.yonde.dex.user.common.vo.DxUserInfoVO;
import com.yonde.dex.user.feign.DxUserInfoFeign;
import lombok.val;
import org.springframework.stereotype.Service;
import io.swagger.annotations.ApiOperation;
......@@ -50,6 +55,8 @@ public class ExtDistributeRecordServiceImpl<V extends ExtDistributeRecordVO> imp
@Autowired
private AutoTaskService autoTaskService;
@Autowired
private DxUserInfoFeign<DxUserInfoVO> dxUserInfoFeign;
@Override
public List<ExtDistributeRecordVO> getDisRecord(Long id) {
......@@ -107,22 +114,20 @@ public class ExtDistributeRecordServiceImpl<V extends ExtDistributeRecordVO> imp
recordVO.setDistributTime(LocalDateTime.now());
recordVO.setDistributDepart(null);
//发送者
//todo wq: 暂时将获取用户信息代码注释,后续讨论后更改
Long userId = null;
// Long userId = this.searchUserId(extPlanVO.getPlanExecutor());
// recordVO.setSenderId(extPlanVO.getCreatorId());
// //接收者(计划执行人)
// recordVO.setHandlerId(userId);
//todo wq: 暂时将获取用户信息形式修改为深度查询的方式。原获取方法:Long userId = this.searchUserId(extPlanVO.getPlanExecutor());
DxUserInfoVO dxUserInfoVO = getUserInfoByAccount(extPlanVO.getPlanExecutor());
recordVO.setSenderId(extPlanVO.getCreatorId());
//接收者(计划执行人)
recordVO.setHandleId(dxUserInfoVO == null ? null : dxUserInfoVO.getUserId());
//接收时间
recordVO.setReceiveTime(LocalDateTime.now());
List<DxOrganizationVO> organizationVOS = this.searchOrgNameByUserId(userId, "002");
List<DxOrganizationVO> organizationVOS = this.searchOrgNameByUserId(dxUserInfoVO == null ? null : dxUserInfoVO.getUserId(), "002");
//接收单位
if (CollectionUtils.isEmpty(organizationVOS)) {
recordVO.setReceiver(null);
} else {
for (DxOrganizationVO org : organizationVOS) {
//todo wq:将org.getOrgName() 修改为 org.getName();
//org.getOrgName();
org.getName();
}
......@@ -141,6 +146,24 @@ public class ExtDistributeRecordServiceImpl<V extends ExtDistributeRecordVO> imp
recordVO.setOperator(OperatorType.ADD);
this.saveRecursion((V) recordVO);
}
/**
* 根据用户账户查询用户
* @param userAccount
* @return
*/
public DxUserInfoVO getUserInfoByAccount(String userAccount) {
SearchQueryCondition queryUserByAccount = SearchQueryCondition.builder()
.searchItems(SearchItems.builder().item(
new SearchItem("userAccount", SearchItem.Operator.EQ, userAccount, null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
DxPageImpl<DxUserInfoVO> dexPage = dxUserInfoFeign.findRecursion(queryUserByAccount);
if (!CollectionUtils.isEmpty(dexPage.getContent())) {
DxUserInfoVO DxUserInfoVO = DxPageUtils.getFirst(dexPage);
return DxUserInfoVO;
}
return null;
}
}
......@@ -6,6 +6,7 @@ import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import cn.hutool.poi.excel.StyleSet;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.document.expand.entity.DxDocumentVOExpand;
import com.yonde.dcs.document.feign.DocCenterFeignService;
import com.yonde.dcs.plan.common.constants.Constants;
import com.yonde.dcs.plan.common.utils.ExcelUtils;
......@@ -99,6 +100,9 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
@Autowired
private DocCenterFeignService docCenterFeignService;
@Autowired
private DxUserInfoFeign<DxUserInfoVO> dxUserInfoFeign;
/**
* 通过userId获取组织名
*
......@@ -246,8 +250,7 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
// int dayDiffer = DateUtils.getDayDiffer(extPlanVO.getStartTime(), extPlanVO.getCompleteTime());
// extPlanVO.setConstructPeriod(String.valueOf(dayDiffer) + "天");
extPlanVO.setState(Constants.PLAN_STATE_UNOPENED);
//todo wq:setDxContextId暂时注释,在2.0中DxContextId 属性在DxObjectVo类中,但在4.1中未找到
//extPlanVO.setDxContextId(projectId);
extPlanVO.setDxContextId(projectId);
this.saveRecursion((V) extPlanVO);
}
});
......@@ -454,8 +457,6 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
.searchItems(SearchItems.builder().item(
new SearchItem("number", SearchItem.Operator.EQ, number, null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
//todo wq:在4.1中找到类似的方法,将2.0代码注释。
//DxPageImpl<DxDocumentVO> recursion = documentService.findRecursion(query);
DxPageImpl<DxDocumentVO> recursion = docCenterFeignService.findRecursion(query);
if (org.springframework.util.CollectionUtils.isEmpty(recursion.getContent())) {
return null;
......@@ -833,17 +834,16 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
String stabledIds = stableId.substring(37);
String substring = stabledIds.substring(stabledIds.lastIndexOf("-", stabledIds.lastIndexOf("-", stabledIds.lastIndexOf("-") - 1) - 1) + 1);
String[] split = substring.split("-");
DxDocumentVOExpand<DxDocumentVO> dxDocumentExpand = doc.getDxDocumentExpand();
if (split.length == 2) {
//todo wq:在4.1中DxDocumentVO对象无下面注释属性
// doc.setOneLevCategory(this.searchModelName(split[0]));
// doc.setTwoLevCategory(this.searchModelName(split[1]));
// doc.setThreeLevCategory(null);
dxDocumentExpand.setOneLevCategory(this.searchModelName(split[0]));
dxDocumentExpand.setTwoLevCategory(this.searchModelName(split[1]));
dxDocumentExpand.setThreeLevCategory(null);
}
if (split.length == 3) {
//todo wq:在4.1中DxDocumentVO对象无下面注释属性
// doc.setOneLevCategory(this.searchModelName(split[0]));
// doc.setTwoLevCategory(this.searchModelName(split[1]));
// doc.setThreeLevCategory(this.searchModelName(split[2]));
dxDocumentExpand.setOneLevCategory(this.searchModelName(split[0]));
dxDocumentExpand.setTwoLevCategory(this.searchModelName(split[1]));
dxDocumentExpand.setThreeLevCategory(this.searchModelName(split[2]));
}
}
......@@ -909,13 +909,13 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
recordVO.setDistributTime(LocalDateTime.now());
recordVO.setDistributDepart(null);
//发送者
//todo wq:recordVO 中没有setSenderId和setHandlerId属性,暂时注释。
// recordVO.setSenderId(extPlanVO.getCreatorId());
//todo wq:获取用户id暂时返回null
recordVO.setSenderId(extPlanVO.getCreatorId());
//todo wq:获取用户方式修改未深度查询方式,原2.0:this.searchUserId(extPlanVO.getPlanExecutor())
DxUserInfoVO dxUserInfoVO = getUserInfoByAccount(extPlanVO.getPlanExecutor());
// Long userId = this.searchUserId(extPlanVO.getPlanExecutor());
Long userId = null;
Long userId = dxUserInfoVO == null ? null:dxUserInfoVO.getUserId();
//接收者(计划执行人)
// recordVO.setHandlerId(userId);
recordVO.setHandleId(userId);
//接收时间
recordVO.setReceiveTime(LocalDateTime.now());
List<DxOrganizationVO> organizationVOS = this.searchOrgNameByUserId(userId, "002");
......@@ -944,6 +944,34 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
distributeRecordService.saveRecursion(recordVO);
}
/**
* 通过id查询模型名称
*/
private String searchModelName(String id) {
ModelDefinitionVO definitionVO = modelDefinitionService.get(Long.valueOf(id));
if (StringUtils.isEmpty(definitionVO)) {
return null;
}
return definitionVO.getName();
}
/**
* 根据用户账户查询用户
* @param userAccount
* @return
*/
public DxUserInfoVO getUserInfoByAccount(String userAccount) {
SearchQueryCondition queryUserByAccount = SearchQueryCondition.builder()
.searchItems(SearchItems.builder().item(
new SearchItem("userAccount", SearchItem.Operator.EQ, userAccount, null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
DxPageImpl<DxUserInfoVO> dexPage = dxUserInfoFeign.findRecursion(queryUserByAccount);
if (!CollectionUtils.isEmpty(dexPage.getContent())) {
DxUserInfoVO DxUserInfoVO = DxPageUtils.getFirst(dexPage);
return DxUserInfoVO;
}
return null;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment