Commit c53c3d19 authored by wangyangyang's avatar wangyangyang

文档 图册:回写ied计划状态

parent 335fcf12
...@@ -142,6 +142,10 @@ public class Constants { ...@@ -142,6 +142,10 @@ public class Constants {
* 已发放 * 已发放
*/ */
public static final String RELEASED = "released"; public static final String RELEASED = "released";
/**
* 文档-图纸-已发布
*/
public static final String DOC_RELEASE = "release";
/** /**
* 驳回 * 驳回
*/ */
......
...@@ -69,6 +69,12 @@ public class ExtAutoTaskController { ...@@ -69,6 +69,12 @@ public class ExtAutoTaskController {
autoTaskService.generateCatalog(docId); autoTaskService.generateCatalog(docId);
} }
@ApiOperation("客制化修改IED计划状态")
@PostMapping({"/ied/change"})
public void changeIEDStatus(@RequestParam String iedStatus, @RequestBody DxDocumentVO documentVO) {
autoTaskService.changeIEDStatus(iedStatus, documentVO);
}
@ApiOperation("电子签名") @ApiOperation("电子签名")
@PostMapping({"/esign"}) @PostMapping({"/esign"})
...@@ -89,7 +95,7 @@ public class ExtAutoTaskController { ...@@ -89,7 +95,7 @@ public class ExtAutoTaskController {
} }
// TODO: WfcSignMessageBuilder不存在,根据2.1代码 new TaskMessage(); // TODO: WfcSignMessageBuilder不存在,根据2.1代码 new TaskMessage();
// WfTaskContext wfTaskContext = new WfTaskContext(wfProcessInstVO.getBusinessKey(), wfProcessInstVO.getId(), wfProcessInstVO.getProcessDef().getId(), signNode, null, (Map) null); // WfTaskContext wfTaskContext = new WfTaskContext(wfProcessInstVO.getBusinessKey(), wfProcessInstVO.getId(), wfProcessInstVO.getProcessDef().getId(), signNode, null, (Map) null);
// WfcSignMessage wfcSignMessage = new WfcSignMessage(new HashMap()); // WfcSignMessage wfcSignMessage = new WfcSignMessage(new HashMap());
// wfcSignMessage.setWfTaskContext(wfTaskContext); // wfcSignMessage.setWfTaskContext(wfTaskContext);
// wfcSignMessage.setSignType(pboKey); // wfcSignMessage.setSignType(pboKey);
...@@ -97,7 +103,7 @@ public class ExtAutoTaskController { ...@@ -97,7 +103,7 @@ public class ExtAutoTaskController {
DxWfTaskContext dxWfTaskContext = new DxWfTaskContext(); DxWfTaskContext dxWfTaskContext = new DxWfTaskContext();
dxWfTaskContext.setPboKey(dxWfProcessVO.getBusinessKey()); dxWfTaskContext.setPboKey(dxWfProcessVO.getBusinessKey());
dxWfTaskContext.setProcessId(dxWfProcessVO.getId()); dxWfTaskContext.setProcessId(dxWfProcessVO.getId());
dxWfTaskContext.setProcessDefId( dxWfProcessVO.getProcDefId()); dxWfTaskContext.setProcessDefId(dxWfProcessVO.getProcDefId());
dxWfTaskContext.setCurrentActivityId(signNode); dxWfTaskContext.setCurrentActivityId(signNode);
WfcSignMessage wfcSignMessage = new WfcSignMessage(new HashMap<>()); WfcSignMessage wfcSignMessage = new WfcSignMessage(new HashMap<>());
wfcSignMessage.setWfTaskContext(dxWfTaskContext); wfcSignMessage.setWfTaskContext(dxWfTaskContext);
......
...@@ -213,4 +213,12 @@ public interface ExtAutoTaskService extends ExtAutoTaskServiceFeign { ...@@ -213,4 +213,12 @@ public interface ExtAutoTaskService extends ExtAutoTaskServiceFeign {
*/ */
@SneakyThrows @SneakyThrows
void autoSetTzri(ExtInterfaceVO interfaceVO); void autoSetTzri(ExtInterfaceVO interfaceVO);
/**
* 客制化修改IED计划状态
*
* @param iedStatus 为 已完成 Complete
* @param documentVO
*/
void changeIEDStatus(String iedStatus, DxDocumentVO documentVO);
} }
...@@ -22,13 +22,10 @@ import com.yonde.dcs.document.core.constants.Constants; ...@@ -22,13 +22,10 @@ import com.yonde.dcs.document.core.constants.Constants;
import com.yonde.dcs.document.core.constants.SignConstants; import com.yonde.dcs.document.core.constants.SignConstants;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO; import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.plan.common.vo.ExtDisReocredLinkVO; import com.yonde.dcs.plan.common.vo.ExtIEDPlanDocLinkVO;
import com.yonde.dcs.plan.common.vo.ExtDistributeRecordVO;
import com.yonde.dcs.plan.common.vo.ExtPlanDocLinkVO; import com.yonde.dcs.plan.common.vo.ExtPlanDocLinkVO;
import com.yonde.dcs.plan.common.vo.ExtPlanVO; import com.yonde.dcs.plan.common.vo.ExtPlanVO;
import com.yonde.dcs.plan.feign.ExtDistributeRecordServiceFeign; import com.yonde.dcs.plan.feign.*;
import com.yonde.dcs.plan.feign.ExtPlanDocLinkServiceFeign;
import com.yonde.dcs.plan.feign.ExtPlanServiceFeign;
import com.yonde.dex.basedata.data.search.SearchItem; import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems; import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition; import com.yonde.dex.basedata.data.search.SearchQueryCondition;
...@@ -37,7 +34,6 @@ import com.yonde.dex.basedata.entity.data.DxPageImpl; ...@@ -37,7 +34,6 @@ import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType; import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.entity.jackson.JsonUtils; import com.yonde.dex.basedata.entity.jackson.JsonUtils;
import com.yonde.dex.basedata.exception.DxBusinessException; import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basedata.utils.obj.DxEntityUtils;
import com.yonde.dex.dao.service.util.DxPageUtils; import com.yonde.dex.dao.service.util.DxPageUtils;
import com.yonde.dex.dfs.feign.FileManagerFeignService; import com.yonde.dex.dfs.feign.FileManagerFeignService;
import com.yonde.dex.dfs.objfilelink.service.ObjFileLinkService; import com.yonde.dex.dfs.objfilelink.service.ObjFileLinkService;
...@@ -122,6 +118,9 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -122,6 +118,9 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Resource @Resource
private ExtPlanDocLinkServiceFeign planDocLinkService; private ExtPlanDocLinkServiceFeign planDocLinkService;
@Autowired
private ExtIEDPlanDocLinkServiceFeign extIEDPlanDocLinkServiceFeign;
@Autowired @Autowired
private ExtPlanServiceFeign extPlanService; private ExtPlanServiceFeign extPlanService;
@Autowired @Autowired
...@@ -156,6 +155,33 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -156,6 +155,33 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Autowired @Autowired
ExtAuditInterfLinkService extAuditInterfLinkService; ExtAuditInterfLinkService extAuditInterfLinkService;
@Autowired
ExtIEDPlanServiceFeign extIEDPlanServiceFeign;
@Override
@Transactional(rollbackFor = Exception.class)
public void changeIEDStatus(String iedStatus, DxDocumentVO documentVO) {
//关联的是文档的小版本
SearchQueryCondition queryCondition = SearchUtil.buildQuery("targetId", SearchItem.Operator.EQ, documentVO.getId());
DxPageImpl recursion = extIEDPlanDocLinkServiceFeign.findRecursion(queryCondition);
ExtIEDPlanDocLinkVO extIEDPlanDocLinkVO = (ExtIEDPlanDocLinkVO) recursion.getContent().get(0);
Long iedPlanId = extIEDPlanDocLinkVO.getSourceId();
SearchQueryCondition iedQuery = SearchUtil.buildQueryWithOpenAttr("sourceId", SearchItem.Operator.EQ, iedPlanId, "target");
DxPageImpl targetDocPage = extIEDPlanDocLinkServiceFeign.findRecursion(iedQuery);
List<ExtIEDPlanDocLinkVO> content = targetDocPage.getContent();
Boolean isChageIEDStatus = true;
for (ExtIEDPlanDocLinkVO iedPlanDocLinkVO : content) {
String state = iedPlanDocLinkVO.getTarget().getState();
if (!Constants.DOC_RELEASE.equalsIgnoreCase(state)){
isChageIEDStatus = false;
}
}
if (isChageIEDStatus){
extIEDPlanServiceFeign.changeStatus(iedPlanId, iedStatus, true);
}
}
@SneakyThrows @SneakyThrows
@Override @Override
public void generateCatalog(Long docId) { public void generateCatalog(Long docId) {
...@@ -1628,6 +1654,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1628,6 +1654,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
interfaceVO = (ExtInterfaceVO) extInterfaceService.update(interfaceVO); interfaceVO = (ExtInterfaceVO) extInterfaceService.update(interfaceVO);
} }
/** /**
* TODO 获取组织下面 岗位为主设人 的用户 * TODO 获取组织下面 岗位为主设人 的用户
* *
......
...@@ -24,9 +24,13 @@ import java.util.Map; ...@@ -24,9 +24,13 @@ import java.util.Map;
**/ **/
@Api(tags = "ExtAutoTask-FEIGN") @Api(tags = "ExtAutoTask-FEIGN")
@FeignClient(value = "${dcs.feign.DCS-DOC}", path = "/task") @FeignClient(value = "${dcs.feign.DCS-DOC}", path = "/task")
public interface ExtAutoTaskServiceFeign{ public interface ExtAutoTaskServiceFeign {
@ApiOperation("客制化修改IED计划状态")
@PostMapping({"/ied/change"})
void changeIEDStatus(@RequestParam(name = "iedStatus") String iedStatus, @RequestBody DxDocumentVO documentVO);
@ApiOperation(value = "生成图册目录", notes = "生成图册目录", httpMethod = "GET") @ApiOperation(value = "生成图册目录", notes = "生成图册目录", httpMethod = "GET")
@GetMapping({"/catalog"}) @GetMapping({"/catalog"})
void generateCatalog(@RequestParam(name = "docId") Long docId); void generateCatalog(@RequestParam(name = "docId") Long docId);
......
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