Commit 76ab24a5 authored by wangqiang's avatar wangqiang

在ExtPlan中增加“生成计划分发记录对象方法”接口

parent 881f6eae
......@@ -77,4 +77,12 @@ public interface ExtPlanService<V extends ExtPlanVO> extends ExtPlanServiceShado
*/
void searchFileType(String fileType, DxDocumentVO doc);
/**
* 生成计划分发记录对象方法
*
* @param extPlanVO
*/
void generatePlanDistributeRecord(ExtPlanVO extPlanVO);
}
......@@ -21,6 +21,7 @@ import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basedata.utils.obj.DxEntityUtils;
import com.yonde.dex.bmodel.common.entity.vo.ModelDefinitionVO;
import com.yonde.dex.bmodel.feign.api.ModelDefinitionFeignService;
import com.yonde.dex.dao.service.util.DxPageUtils;
......@@ -28,6 +29,7 @@ import com.yonde.dex.dict.feign.DictDataFeignService;
import com.yonde.dex.dict.service.vo.DictDataVO;
import com.yonde.dex.user.common.vo.DxOrganizationVO;
import com.yonde.dex.user.common.vo.DxUserInfoVO;
import com.yonde.dex.user.feign.DxOrganizationFeign;
import com.yonde.dex.user.feign.DxUserInfoFeign;
import com.yonde.dex.version.plugin.core.deleteType.IterationDeleteVO;
import dm.jdbc.util.StringUtil;
......@@ -41,6 +43,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
......@@ -77,6 +80,10 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
@Autowired
ExtPlanRepository<ExtPlan> extPlanRepository;
@Autowired
private ExtDistributeRecordService distributeRecordService;
@Autowired
private DictDataFeignService dictDataService;
......@@ -883,6 +890,62 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
return modelDefinitionVOS.get(0);
}
@Autowired
DxOrganizationFeign organizationFeign;
/**
* 生成计划分发记录对象方法
*
* @param extPlanVO
*/
@Override
public void generatePlanDistributeRecord(ExtPlanVO extPlanVO) {
List<ExtDisReocredLinkVO> list = new ArrayList<>();
//创建分发记录对象
ExtDistributeRecordVO recordVO = new ExtDistributeRecordVO();
//分发类型
recordVO.setDistributeType("planFeedback");
//名称
recordVO.setBoTitle("完成计划反馈任务");
//分发时间
recordVO.setDistributTime(LocalDateTime.now());
recordVO.setDistributDepart(null);
//发送者
//todo wq:recordVO 中没有setSenderId和setHandlerId属性,暂时注释。
// recordVO.setSenderId(extPlanVO.getCreatorId());
//todo wq:获取用户id暂时返回null
// Long userId = this.searchUserId(extPlanVO.getPlanExecutor());
Long userId = null;
//接收者(计划执行人)
// recordVO.setHandlerId(userId);
//接收时间
recordVO.setReceiveTime(LocalDateTime.now());
List<DxOrganizationVO> organizationVOS = this.searchOrgNameByUserId(userId, "002");
//接收单位
if (CollectionUtils.isEmpty(organizationVOS)) {
recordVO.setReceiver(null);
} else {
for (DxOrganizationVO org : organizationVOS) {
org.getName();
}
recordVO.setReceiver(organizationVOS.get(0).getName());
}
//是否需回复
recordVO.setReplyDistribute("是");
recordVO.setReceiveType("planFeedback");
ExtDisReocredLinkVO disReocredLinkVO = new ExtDisReocredLinkVO();
//disReocredLinkVO.setTarget(DxObjectVo.class.cast(extPlanVO));
disReocredLinkVO.setTargetId(extPlanVO.getId());
disReocredLinkVO.setTargetIdType(DxEntityUtils.getModelName(ExtPlanVO.class));
disReocredLinkVO.setOperator(OperatorType.ADD);
list.add(disReocredLinkVO);
// recordVO.setSourceDisReocredLink(list);
recordVO.setExtDisReocredLink(list);
recordVO.setOperator(OperatorType.ADD);
distributeRecordService.saveRecursion(recordVO);
}
}
......@@ -75,4 +75,10 @@ public interface ExtPlanServiceFeign<V extends ExtPlanVO> extends ExtPlanService
@ApiOperation(value = "通过文件分类查询", notes = "通过文件分类查询", httpMethod = "post")
@GetMapping(value = "/searchFileType")
void searchFileType(@RequestParam("fileType")String fileType, DxDocumentVO doc);
@ApiOperation(value = "生成计划分发记录对象方法", notes = "生成计划分发记录对象方法", httpMethod = "post")
@GetMapping(value = "/generatePlanDistributeRecord")
void generatePlanDistributeRecord(@RequestBody ExtPlanVO extPlanVO);
}
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