|
@@ -316,6 +316,34 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
|
workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
|
}
|
|
|
|
|
|
+ }
|
|
|
+ //收购合同
|
|
|
+ else if("3".equals(contractManagementInfo.getContractType())){
|
|
|
+ boolean isStartWorkflow = StringUtils.isBlank(contractManagementInfo.getWorkflowId());
|
|
|
+ // 不是退回的单子
|
|
|
+ if (isStartWorkflow) {
|
|
|
+ Workflow workflow = workflowService
|
|
|
+ .findLatestWorkflowByBusinessCodeByApp(contractManagementInfo.getCompId(), "SHOU-CONTRACT-APPROVE");
|
|
|
+ // 没配置审核流程,直接结束并处理信息
|
|
|
+ if (workflow == null) {
|
|
|
+ throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
+ }
|
|
|
+ // 开启审核流
|
|
|
+ else {
|
|
|
+
|
|
|
+ // 设置状态 已提交审核
|
|
|
+ contractManagementInfo.setWorkflowId(workflow.getId());
|
|
|
+ this.updateById(contractManagementInfo);
|
|
|
+ workflowService.startInstance(workflow.getId(), contractManagementInfo.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 退回的单子 再启用
|
|
|
+ else {
|
|
|
+
|
|
|
+ this.updateById(contractManagementInfo);
|
|
|
+ workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
//代收合同
|
|
|
else {
|
|
@@ -386,6 +414,20 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
|
warehouseBaseInfo.setOtherPersonPhone(contractManagementInfo.getPersonPhone());
|
|
|
warehouseBaseInfoService.updateById(warehouseBaseInfo);
|
|
|
}
|
|
|
+ //收购任务重量随合同重量变化
|
|
|
+ if("3".equals(contractManagementInfo.getContractType())){
|
|
|
+ //一个收购合同只能选一次
|
|
|
+ InOutWarehouseTask inOutWarehouseTask=inOutWarehouseTaskService.selectOne(new EntityWrapper<InOutWarehouseTask>()
|
|
|
+ .eq("comp_id", contractManagementInfo.getCompId())
|
|
|
+ .eq("contract_no", contractManagementInfo.getContractNo())
|
|
|
+ .eq("delete_flag", "0")
|
|
|
+ .eq("task_type_key", "3")
|
|
|
+ .orderBy("update_date", false));
|
|
|
+ if (inOutWarehouseTask!=null){
|
|
|
+ inOutWarehouseTask.setWeight(contractManagementInfo.getWeight());
|
|
|
+ inOutWarehouseTaskService.updateById(inOutWarehouseTask);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 根据类型进入审核
|
|
|
// if ("1".equals(contractManagementInfo.getGoodsType())) {
|
|
|
// if ("1".equals(contractManagementInfo.getContractType())) {
|