4 changed files with 108 additions and 1 deletions
@ -0,0 +1,86 @@ |
|||||
|
package com.qs.serve.modules.third; |
||||
|
|
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
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.service.impl.*; |
||||
|
import com.qs.serve.modules.tzc.service.impl.TzcPolicyOperationServiceImpl; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2024/5/20 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("thirty/flow") |
||||
|
public class PortalFlowController { |
||||
|
|
||||
|
private final TbsCostApplyOperationServiceImpl tbsCostApplyOperationService; |
||||
|
private final TbsCostTodoOperationServiceImpl tbsCostTodoOperationService; |
||||
|
private final VtbVerificationOperationServiceImpl verificationOperationService; |
||||
|
private final TzcPolicyOperationServiceImpl tzcPolicyOperationService; |
||||
|
private final TbsBudgetApplyOperationServiceImpl tbsBudgetApplyOperationService; |
||||
|
private final TbsBudgetChangeOperationServiceImpl tbsBudgetChangeOperationService; |
||||
|
private final TbsBudgetBatchOperationServiceImpl tbsBudgetBatchOperationService; |
||||
|
private final SysSyncLogService sysSyncLogService; |
||||
|
private final SeeYonRequestService seeYonRequestService; |
||||
|
|
||||
|
@GetMapping("/compenstate/{flowCode}/{formId}") |
||||
|
public R<?> compenstate(@PathVariable("flowCode")String flowCode, |
||||
|
@PathVariable("formId") String formId ){ |
||||
|
SysSyncLog syncLog = new SysSyncLog(); |
||||
|
syncLog.setFromPlat("flow:"+flowCode); |
||||
|
syncLog.setUrl(formId); |
||||
|
//请求转换ID
|
||||
|
String targetId = seeYonRequestService.getTargetIdByFormId(flowCode,formId).getData(); |
||||
|
if(targetId==null){ |
||||
|
syncLog.setFailReason("targetIdNull"); |
||||
|
} |
||||
|
syncLog.setRemark(targetId); |
||||
|
sysSyncLogService.save(syncLog); |
||||
|
|
||||
|
if(targetId==null){ |
||||
|
return R.error("formId无效"); |
||||
|
} |
||||
|
|
||||
|
if(TbsSeeYonConst.PolicyConf.Code().equals(flowCode)){ |
||||
|
//政策申请模板
|
||||
|
tzcPolicyOperationService.runCompensate(targetId); |
||||
|
}else if(TbsSeeYonConst.CostApplyConf.Code().equals(flowCode)){ |
||||
|
//费用申请
|
||||
|
tbsCostApplyOperationService.runCompensate(targetId); |
||||
|
}else if(TbsSeeYonConst.CostApplyContractConf.Code().equals(flowCode)){ |
||||
|
//费用申请2-协议类
|
||||
|
tbsCostApplyOperationService.runCompensate(targetId); |
||||
|
}else if(TbsSeeYonConst.CostCheckConf.Code().equals(flowCode)){ |
||||
|
//核销
|
||||
|
verificationOperationService.runCompensate(targetId); |
||||
|
}else if(TbsSeeYonConst.BudgetApplyConf.Code().equals(flowCode)){ |
||||
|
//预算申请
|
||||
|
tbsBudgetApplyOperationService.runCompensate(targetId); |
||||
|
}else if(TbsSeeYonConst.CheckCostAgreeConf.Code().equals(flowCode)){ |
||||
|
//协议条款申请
|
||||
|
tbsCostTodoOperationService.runCompensate(targetId); |
||||
|
}else if(TbsSeeYonConst.BudgetChangeConf.Code().equals(flowCode)){ |
||||
|
//预算变更申请
|
||||
|
tbsBudgetChangeOperationService.runCompensate(targetId); |
||||
|
}else if(TbsSeeYonConst.BudgetBatchApplyConf.Code().equals(flowCode)){ |
||||
|
//预算变更申请
|
||||
|
tbsBudgetBatchOperationService.runCompensate(targetId); |
||||
|
}else { |
||||
|
return R.error("业务["+flowCode+"]未被收录"); |
||||
|
} |
||||
|
return R.ok(flowCode); |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue