|
|
@ -6,16 +6,16 @@ import com.qs.serve.modules.seeyon.service.SeeYonRequestService; |
|
|
|
import com.qs.serve.modules.sys.entity.SysSyncLog; |
|
|
|
import com.qs.serve.modules.sys.service.SysSyncLogService; |
|
|
|
import com.qs.serve.modules.tbs.common.TbsSeeYonConst; |
|
|
|
import com.qs.serve.modules.tbs.entity.bo.TbsAffairCommitBo; |
|
|
|
import com.qs.serve.modules.tbs.service.impl.*; |
|
|
|
import com.qs.serve.modules.tzc.service.impl.TzcPolicyOperationServiceImpl; |
|
|
|
import com.qs.serve.modules.vtb.service.VtbVerificationBatchOperationService; |
|
|
|
import com.qs.serve.modules.vtb.service.impl.VtbVerificationOperationServiceImpl; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author YenHex |
|
|
@ -39,22 +39,96 @@ public class PortalFlowController { |
|
|
|
private final VtbVerificationBatchOperationService vtbVerificationBatchOperationService; |
|
|
|
private final OmsOrderOptionsService omsOrderOptionsService; |
|
|
|
|
|
|
|
@GetMapping("/compenstate/{flowCode}/{formId}") |
|
|
|
public R<?> compenstate(@PathVariable("flowCode")String flowCode, |
|
|
|
/** |
|
|
|
* 跳过流程审批,特定节点触发该接口,使CMS单据为完成状态 |
|
|
|
* @param flowCode |
|
|
|
* @param formId |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("/success/{flowCode}/{formId}") |
|
|
|
public R<?> doSuccess(@PathVariable("flowCode")String flowCode, |
|
|
|
@PathVariable("formId") String formId ){ |
|
|
|
log.info("开始补偿流程:{}",flowCode); |
|
|
|
SysSyncLog syncLog = new SysSyncLog(); |
|
|
|
syncLog.setFromPlat("flow:"+flowCode); |
|
|
|
syncLog.setFromPlat("flow-success:"+flowCode+":"+formId); |
|
|
|
syncLog.setUrl(formId); |
|
|
|
//请求转换ID
|
|
|
|
String targetId = seeYonRequestService.getTargetIdByFormId(flowCode,formId).getData(); |
|
|
|
if(targetId==null){ |
|
|
|
syncLog.setFailReason("targetIdNull"); |
|
|
|
syncLog.setFailReason("formTableId或templateCode无效"); |
|
|
|
} |
|
|
|
syncLog.setRemark(targetId); |
|
|
|
sysSyncLogService.save(syncLog); |
|
|
|
if(targetId==null){ |
|
|
|
return R.error("formTableId或templateCode无效"); |
|
|
|
} |
|
|
|
TbsAffairCommitBo param = new TbsAffairCommitBo(targetId); |
|
|
|
if(TbsSeeYonConst.PolicyConf.Code().equals(flowCode)){ |
|
|
|
//政策申请模板
|
|
|
|
tzcPolicyOperationService.doFinished(param); |
|
|
|
}else if(TbsSeeYonConst.CostApplyConf.Code().equals(flowCode)){ |
|
|
|
//费用申请
|
|
|
|
tbsCostApplyOperationService.doFinished(param); |
|
|
|
}else if(TbsSeeYonConst.CostApplyContractConf.Code().equals(flowCode)){ |
|
|
|
//费用申请2-协议类
|
|
|
|
tbsCostApplyOperationService.doFinished(param); |
|
|
|
}else if(TbsSeeYonConst.CostCheckConf.Code().equals(flowCode)){ |
|
|
|
//核销
|
|
|
|
verificationOperationService.doFinished(param); |
|
|
|
}else if(TbsSeeYonConst.BudgetApplyConf.Code().equals(flowCode)){ |
|
|
|
//预算申请
|
|
|
|
tbsBudgetApplyOperationService.doFinished(param); |
|
|
|
}else if(TbsSeeYonConst.CheckCostAgreeConf.Code().equals(flowCode)){ |
|
|
|
//协议条款申请
|
|
|
|
tbsCostTodoOperationService.doFinished(param); |
|
|
|
}else if(TbsSeeYonConst.BudgetChangeConf.Code().equals(flowCode)){ |
|
|
|
//预算 变更申请
|
|
|
|
tbsBudgetChangeOperationService.doFinished(param); |
|
|
|
}else if(TbsSeeYonConst.BudgetBatchApplyConf.Code().equals(flowCode)){ |
|
|
|
//预算 批量变更申请
|
|
|
|
tbsBudgetBatchOperationService.doFinished(param); |
|
|
|
}else if(TbsSeeYonConst.BatchCostCheckConf.Code().equals(flowCode)){ |
|
|
|
//核销 批量申请
|
|
|
|
vtbVerificationBatchOperationService.doFinished(param); |
|
|
|
}else if(TbsSeeYonConst.ExpiredOrderConf.Code().equals(flowCode)){ |
|
|
|
//核销 批量申请
|
|
|
|
omsOrderOptionsService.doFinished(param); |
|
|
|
}else { |
|
|
|
syncLog.setRemark("业务["+flowCode+"]未被收录"); |
|
|
|
sysSyncLogService.updateById(syncLog); |
|
|
|
return R.error("业务["+flowCode+"]未被收录"); |
|
|
|
} |
|
|
|
|
|
|
|
syncLog.setSuccessStatus(1); |
|
|
|
syncLog.setRemark("调用成功"); |
|
|
|
sysSyncLogService.updateById(syncLog); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* OA流程审批完成后触发该接口,避免CMS单据状态不更新 |
|
|
|
* @param flowCode |
|
|
|
* @param formId |
|
|
|
* @param request |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@GetMapping("/compenstate/{flowCode}/{formId}") |
|
|
|
public R<?> compenstate(@PathVariable("flowCode")String flowCode, |
|
|
|
@PathVariable("formId") String formId, HttpServletRequest request){ |
|
|
|
log.info("开始补偿流程:{}",flowCode); |
|
|
|
SysSyncLog syncLog = new SysSyncLog(); |
|
|
|
syncLog.setFromPlat("flow-compenstate:"+flowCode+":"+formId); |
|
|
|
syncLog.setUrl(request.getRequestURI()); |
|
|
|
syncLog.setEntityClass(PortalFlowController.class.getName()); |
|
|
|
//请求转换ID
|
|
|
|
String targetId = seeYonRequestService.getTargetIdByFormId(flowCode,formId).getData(); |
|
|
|
if(targetId==null){ |
|
|
|
syncLog.setFailReason("formTableId或templateCode无效"); |
|
|
|
} |
|
|
|
syncLog.setRemark(targetId); |
|
|
|
sysSyncLogService.save(syncLog); |
|
|
|
if(targetId==null){ |
|
|
|
return R.error("formId无效"); |
|
|
|
return R.error("formTableId或templateCode无效"); |
|
|
|
} |
|
|
|
|
|
|
|
if(TbsSeeYonConst.PolicyConf.Code().equals(flowCode)){ |
|
|
@ -88,9 +162,14 @@ public class PortalFlowController { |
|
|
|
//核销 批量申请
|
|
|
|
omsOrderOptionsService.runCompensate(targetId); |
|
|
|
}else { |
|
|
|
syncLog.setRemark("业务["+flowCode+"]未被收录"); |
|
|
|
sysSyncLogService.updateById(syncLog); |
|
|
|
return R.error("业务["+flowCode+"]未被收录"); |
|
|
|
} |
|
|
|
return R.ok(flowCode); |
|
|
|
syncLog.setSuccessStatus(1); |
|
|
|
syncLog.setRemark("调用成功"); |
|
|
|
sysSyncLogService.updateById(syncLog); |
|
|
|
return R.ok(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|