|
|
|
@ -17,6 +17,7 @@ import com.spring.modules.change.entity.ParamData; |
|
|
|
import com.spring.modules.change.entity.ProcessFormEntity; |
|
|
|
import com.spring.modules.change.mapper.ChangeManagementMapper; |
|
|
|
import com.spring.modules.change.service.impl.ChangeManagementServiceImpl; |
|
|
|
import com.spring.modules.change.vo.ChangeRequestVo; |
|
|
|
import com.spring.modules.change.vo.ProcessFormVo; |
|
|
|
import com.spring.modules.request.vo.PlmRequestDetailVo; |
|
|
|
import com.spring.modules.rohs.entity.RohsEntity; |
|
|
|
@ -437,6 +438,58 @@ public class RohsServiceImpl extends ServiceImpl<RohsMapper, RohsEntity> impleme |
|
|
|
rohsMaterialService.remove(removeWrapper); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 流程干预提交(节点更新/流程干预) |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void submitRohsToFlow(ChangeRequestVo data) { |
|
|
|
if (data == null || StringUtils.isBlank(data.getSite()) || StringUtils.isBlank(data.getDocumentNo()) || StringUtils.isBlank(data.getUserName())) { |
|
|
|
throw new RuntimeException("流程干预参数不完整,无法提交RoHs流程"); |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, String> baseData = changeManagementService.getSubmitBaseData(data.getSite(), data.getUserName(), data.getDocumentNo()); |
|
|
|
RohsEntity rohs = this.getDetail(data.getSite(), data.getDocumentNo()); |
|
|
|
if (rohs == null) { |
|
|
|
throw new RuntimeException("未找到对应RoHs单据"); |
|
|
|
} |
|
|
|
|
|
|
|
ParamData paramData = new ParamData(data.getSite(), baseData.get("nodeId"), baseData.get("nodeName"), data.getDocumentNo(), data.getUserName(), baseData.get("classificationNo"), |
|
|
|
baseData.get("userId"), baseData.get("workflowId"), baseData.get("workflowname"), baseData.get("requestName"), baseData.get("path"), baseData.get("requestId"), |
|
|
|
"plm_rohs", "reference_no", "status", rohs.getStepId(), data.getBu() == null ? "" : data.getBu(), |
|
|
|
baseData.get("domainControlAccount"), baseData.get("menuId"), baseData.get("menuName"), data.getNodeConclusion(), data.getRejectOpinion() == null ? "" : data.getRejectOpinion(), data.getNodeId()); |
|
|
|
|
|
|
|
if ("update".equals(data.getProcessFlag())) { |
|
|
|
List<MainData> mainData = getSubmitMainData(data.getSite(), baseData, rohs); |
|
|
|
paramData.setMainData(mainData); |
|
|
|
SubmitRequestParam submitRequestParam = new SubmitRequestParam(); |
|
|
|
submitRequestParam.setUserId(data.getUpdateBy()); |
|
|
|
submitRequestParam.setRequestId(paramData.getRequestId()); |
|
|
|
submitRequestParam.setMainData(paramData.getMainData()); |
|
|
|
String submitRequestURL = apiUrlOa + "/oa/interface/submitRequest"; |
|
|
|
ResponseData submitRequestResponses = HttpClientUtil.doPostByRawWithOA(submitRequestURL, submitRequestParam); |
|
|
|
if (!"0".equals(submitRequestResponses.getCode())) { |
|
|
|
throw new RuntimeException("OA提交流程异常信息:" + submitRequestResponses.getMsg()); |
|
|
|
} |
|
|
|
// 节点更新时后续OA流转操作人使用上一节点审批人 |
|
|
|
paramData.setUserId(data.getUpdateBy()); |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
changeManagementService.agreeFunction(paramData, Constant.ROHS); |
|
|
|
} catch (Exception e) { |
|
|
|
DoForceDrawBackParam doForceDrawBackParam = new DoForceDrawBackParam(); |
|
|
|
doForceDrawBackParam.setUserId(paramData.getUserId()); |
|
|
|
doForceDrawBackParam.setRequestId(paramData.getRequestId()); |
|
|
|
String doForceDrawBackURL = apiUrlOa + "/oa/interface/doForceDrawBack"; |
|
|
|
ResponseData doForceDrawBackResponses = HttpClientUtil.doPostByRawWithOA(doForceDrawBackURL, doForceDrawBackParam); |
|
|
|
if (!"0".equals(doForceDrawBackResponses.getCode())) { |
|
|
|
throw new RuntimeException("OA撤回流程异常信息:" + doForceDrawBackResponses.getMsg()); |
|
|
|
} |
|
|
|
throw new RuntimeException(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private List<MainData> getSubmitMainData(String site, Map<String, String> baseData, RohsEntity rohs) { |
|
|
|
List<MainData> mainData = new ArrayList<>(); |
|
|
|
List<PlmRequestDetailVo> nodeDetails = changeManagementMapper.queryNodeDetails(site, baseData.get("workflowId"), baseData.get("nodeId"), baseData.get("classificationNo")); |
|
|
|
|