|
@@ -11,6 +11,7 @@ import com.winsea.svc.base.workflow.entity.Workflow;
|
|
import com.winsea.svc.notice.entity.base.BaseNotice;
|
|
import com.winsea.svc.notice.entity.base.BaseNotice;
|
|
import com.winsea.svc.notice.service.INoticeService;
|
|
import com.winsea.svc.notice.service.INoticeService;
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
|
|
+import com.yh.saas.plugin.base.entity.CommonBillOperateHis;
|
|
import com.yh.saas.plugin.base.service.ICommonBillOperateHisService;
|
|
import com.yh.saas.plugin.base.service.ICommonBillOperateHisService;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
@@ -86,6 +87,8 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
@Autowired
|
|
@Autowired
|
|
private INewWorkflowService workflowService;
|
|
private INewWorkflowService workflowService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private ICommonBillOperateHisService commonBillOperateHisService;
|
|
|
|
+ @Autowired
|
|
private INoticeService noticeService;
|
|
private INoticeService noticeService;
|
|
@Autowired
|
|
@Autowired
|
|
private IPriceConfirmationSheetService priceConfirmationSheetService;
|
|
private IPriceConfirmationSheetService priceConfirmationSheetService;
|
|
@@ -279,6 +282,19 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
this.updateById(contractManagementInfo);
|
|
this.updateById(contractManagementInfo);
|
|
workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 添加提交历史
|
|
|
|
+ CommonBillOperateHis commonBillOperateHis = new CommonBillOperateHis();
|
|
|
|
+ commonBillOperateHis.setBillId(contractManagementInfo.getId());
|
|
|
|
+ commonBillOperateHis.setId(IdGenerator.generateUUID());
|
|
|
|
+ commonBillOperateHis.setBillType("SALE-CONTRACT-APPROVE");
|
|
|
|
+ commonBillOperateHis.setOperateDate(new Date());
|
|
|
|
+ commonBillOperateHis.setOperateUser(contractManagementInfo.getCreateUserId());
|
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.toJSON(contractManagementInfo);
|
|
|
|
+ commonBillOperateHis.setBusinessHistory(jsonObject.toJSONString());
|
|
|
|
+ commonBillOperateHisService.create(commonBillOperateHis);
|
|
|
|
+
|
|
}
|
|
}
|
|
//代储合同
|
|
//代储合同
|
|
else if ("1".equals(contractManagementInfo.getContractType())&&"代储合同".equals(contractManagementInfo.getAgreementType())) {
|
|
else if ("1".equals(contractManagementInfo.getContractType())&&"代储合同".equals(contractManagementInfo.getAgreementType())) {
|
|
@@ -286,7 +302,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
// 不是退回的单子
|
|
// 不是退回的单子
|
|
if (isStartWorkflow) {
|
|
if (isStartWorkflow) {
|
|
Workflow workflow = workflowService
|
|
Workflow workflow = workflowService
|
|
- .findLatestWorkflowByBusinessCodeByApp(contractManagementInfo.getCompId(), "DAICHU-CONTRACT-APPROVE ");
|
|
|
|
|
|
+ .findLatestWorkflowByBusinessCodeByApp(contractManagementInfo.getCompId(), "DAICHU-CONTRACT-APPROVE");
|
|
// 没配置审核流程,直接结束并处理信息
|
|
// 没配置审核流程,直接结束并处理信息
|
|
if (workflow == null) {
|
|
if (workflow == null) {
|
|
throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
@@ -306,6 +322,17 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
this.updateById(contractManagementInfo);
|
|
this.updateById(contractManagementInfo);
|
|
workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
}
|
|
}
|
|
|
|
+ // 添加提交历史
|
|
|
|
+ CommonBillOperateHis commonBillOperateHis = new CommonBillOperateHis();
|
|
|
|
+ commonBillOperateHis.setBillId(contractManagementInfo.getId());
|
|
|
|
+ commonBillOperateHis.setId(IdGenerator.generateUUID());
|
|
|
|
+ commonBillOperateHis.setBillType("DAICHU-CONTRACT-APPROVE");
|
|
|
|
+ commonBillOperateHis.setOperateDate(new Date());
|
|
|
|
+ commonBillOperateHis.setOperateUser(contractManagementInfo.getCreateUserId());
|
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.toJSON(contractManagementInfo);
|
|
|
|
+ commonBillOperateHis.setBusinessHistory(jsonObject.toJSONString());
|
|
|
|
+ commonBillOperateHisService.create(commonBillOperateHis);
|
|
|
|
+
|
|
}
|
|
}
|
|
//采购合同
|
|
//采购合同
|
|
else if("2".equals(contractManagementInfo.getContractType())){
|
|
else if("2".equals(contractManagementInfo.getContractType())){
|
|
@@ -333,6 +360,17 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
this.updateById(contractManagementInfo);
|
|
this.updateById(contractManagementInfo);
|
|
workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
}
|
|
}
|
|
|
|
+ // 添加提交历史
|
|
|
|
+ CommonBillOperateHis commonBillOperateHis = new CommonBillOperateHis();
|
|
|
|
+ commonBillOperateHis.setBillId(contractManagementInfo.getId());
|
|
|
|
+ commonBillOperateHis.setId(IdGenerator.generateUUID());
|
|
|
|
+ commonBillOperateHis.setBillType("BUY-CONTRACT-APPROVE");
|
|
|
|
+ commonBillOperateHis.setOperateDate(new Date());
|
|
|
|
+ commonBillOperateHis.setOperateUser(contractManagementInfo.getCreateUserId());
|
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.toJSON(contractManagementInfo);
|
|
|
|
+ commonBillOperateHis.setBusinessHistory(jsonObject.toJSONString());
|
|
|
|
+ commonBillOperateHisService.create(commonBillOperateHis);
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
//收购合同
|
|
//收购合同
|
|
@@ -362,6 +400,17 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 添加提交历史
|
|
|
|
+ CommonBillOperateHis commonBillOperateHis = new CommonBillOperateHis();
|
|
|
|
+ commonBillOperateHis.setBillId(contractManagementInfo.getId());
|
|
|
|
+ commonBillOperateHis.setId(IdGenerator.generateUUID());
|
|
|
|
+ commonBillOperateHis.setBillType("SHOU-CONTRACT-APPROVE");
|
|
|
|
+ commonBillOperateHis.setOperateDate(new Date());
|
|
|
|
+ commonBillOperateHis.setOperateUser(contractManagementInfo.getCreateUserId());
|
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.toJSON(contractManagementInfo);
|
|
|
|
+ commonBillOperateHis.setBusinessHistory(jsonObject.toJSONString());
|
|
|
|
+ commonBillOperateHisService.create(commonBillOperateHis);
|
|
|
|
+
|
|
}
|
|
}
|
|
//代收合同
|
|
//代收合同
|
|
else {
|
|
else {
|
|
@@ -390,6 +439,17 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
workflowService.activateInstance(contractManagementInfo.getWorkflowId(), contractManagementInfo.getId());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 添加提交历史
|
|
|
|
+ CommonBillOperateHis commonBillOperateHis = new CommonBillOperateHis();
|
|
|
|
+ commonBillOperateHis.setBillId(contractManagementInfo.getId());
|
|
|
|
+ commonBillOperateHis.setId(IdGenerator.generateUUID());
|
|
|
|
+ commonBillOperateHis.setBillType("DAISHOU-CONTRACT-APPROVE");
|
|
|
|
+ commonBillOperateHis.setOperateDate(new Date());
|
|
|
|
+ commonBillOperateHis.setOperateUser(contractManagementInfo.getCreateUserId());
|
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.toJSON(contractManagementInfo);
|
|
|
|
+ commonBillOperateHis.setBusinessHistory(jsonObject.toJSONString());
|
|
|
|
+ commonBillOperateHisService.create(commonBillOperateHis);
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -474,6 +534,17 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
this.updateById(contractManagementInfo1);
|
|
this.updateById(contractManagementInfo1);
|
|
workflowService.activateInstance(contractManagementInfo1.getWorkflowId(), contractManagementInfo1.getId());
|
|
workflowService.activateInstance(contractManagementInfo1.getWorkflowId(), contractManagementInfo1.getId());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 添加提交历史
|
|
|
|
+ CommonBillOperateHis commonBillOperateHis = new CommonBillOperateHis();
|
|
|
|
+ commonBillOperateHis.setBillId(contractManagementInfo1.getId());
|
|
|
|
+ commonBillOperateHis.setId(IdGenerator.generateUUID());
|
|
|
|
+ commonBillOperateHis.setBillType("SALE-CONTRACT-APPROVE");
|
|
|
|
+ commonBillOperateHis.setOperateDate(new Date());
|
|
|
|
+ commonBillOperateHis.setOperateUser(contractManagementInfo1.getCreateUserId());
|
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.toJSON(contractManagementInfo1);
|
|
|
|
+ commonBillOperateHis.setBusinessHistory(jsonObject.toJSONString());
|
|
|
|
+ commonBillOperateHisService.create(commonBillOperateHis);
|
|
}
|
|
}
|
|
//代储合同
|
|
//代储合同
|
|
else if ("1".equals(contractManagementInfo1.getContractType())&&"代储合同".equals(contractManagementInfo1.getAgreementType())) {
|
|
else if ("1".equals(contractManagementInfo1.getContractType())&&"代储合同".equals(contractManagementInfo1.getAgreementType())) {
|
|
@@ -481,7 +552,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
// 不是退回的单子
|
|
// 不是退回的单子
|
|
if (isStartWorkflow) {
|
|
if (isStartWorkflow) {
|
|
Workflow workflow = workflowService
|
|
Workflow workflow = workflowService
|
|
- .findLatestWorkflowByBusinessCodeByApp(contractManagementInfo1.getCompId(), "DAICHU-CONTRACT-APPROVE ");
|
|
|
|
|
|
+ .findLatestWorkflowByBusinessCodeByApp(contractManagementInfo1.getCompId(), "DAICHU-CONTRACT-APPROVE");
|
|
// 没配置审核流程,直接结束并处理信息
|
|
// 没配置审核流程,直接结束并处理信息
|
|
if (workflow == null) {
|
|
if (workflow == null) {
|
|
throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
@@ -501,6 +572,18 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
this.updateById(contractManagementInfo1);
|
|
this.updateById(contractManagementInfo1);
|
|
workflowService.activateInstance(contractManagementInfo1.getWorkflowId(), contractManagementInfo1.getId());
|
|
workflowService.activateInstance(contractManagementInfo1.getWorkflowId(), contractManagementInfo1.getId());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 添加提交历史
|
|
|
|
+ CommonBillOperateHis commonBillOperateHis = new CommonBillOperateHis();
|
|
|
|
+ commonBillOperateHis.setBillId(contractManagementInfo1.getId());
|
|
|
|
+ commonBillOperateHis.setId(IdGenerator.generateUUID());
|
|
|
|
+ commonBillOperateHis.setBillType("DAICHU-CONTRACT-APPROVE");
|
|
|
|
+ commonBillOperateHis.setOperateDate(new Date());
|
|
|
|
+ commonBillOperateHis.setOperateUser(contractManagementInfo1.getCreateUserId());
|
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.toJSON(contractManagementInfo1);
|
|
|
|
+ commonBillOperateHis.setBusinessHistory(jsonObject.toJSONString());
|
|
|
|
+ commonBillOperateHisService.create(commonBillOperateHis);
|
|
}
|
|
}
|
|
//采购合同
|
|
//采购合同
|
|
else if("2".equals(contractManagementInfo1.getContractType())){
|
|
else if("2".equals(contractManagementInfo1.getContractType())){
|
|
@@ -529,6 +612,17 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
workflowService.activateInstance(contractManagementInfo1.getWorkflowId(), contractManagementInfo1.getId());
|
|
workflowService.activateInstance(contractManagementInfo1.getWorkflowId(), contractManagementInfo1.getId());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 添加提交历史
|
|
|
|
+ CommonBillOperateHis commonBillOperateHis = new CommonBillOperateHis();
|
|
|
|
+ commonBillOperateHis.setBillId(contractManagementInfo1.getId());
|
|
|
|
+ commonBillOperateHis.setId(IdGenerator.generateUUID());
|
|
|
|
+ commonBillOperateHis.setBillType("BUY-CONTRACT-APPROVE");
|
|
|
|
+ commonBillOperateHis.setOperateDate(new Date());
|
|
|
|
+ commonBillOperateHis.setOperateUser(contractManagementInfo1.getCreateUserId());
|
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.toJSON(contractManagementInfo1);
|
|
|
|
+ commonBillOperateHis.setBusinessHistory(jsonObject.toJSONString());
|
|
|
|
+ commonBillOperateHisService.create(commonBillOperateHis);
|
|
|
|
+
|
|
}
|
|
}
|
|
//收购合同
|
|
//收购合同
|
|
else if("3".equals(contractManagementInfo1.getContractType())&&"收购合同".equals(contractManagementInfo1.getAgreementType())){
|
|
else if("3".equals(contractManagementInfo1.getContractType())&&"收购合同".equals(contractManagementInfo1.getAgreementType())){
|
|
@@ -557,6 +651,17 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
workflowService.activateInstance(contractManagementInfo1.getWorkflowId(), contractManagementInfo1.getId());
|
|
workflowService.activateInstance(contractManagementInfo1.getWorkflowId(), contractManagementInfo1.getId());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 添加提交历史
|
|
|
|
+ CommonBillOperateHis commonBillOperateHis = new CommonBillOperateHis();
|
|
|
|
+ commonBillOperateHis.setBillId(contractManagementInfo1.getId());
|
|
|
|
+ commonBillOperateHis.setId(IdGenerator.generateUUID());
|
|
|
|
+ commonBillOperateHis.setBillType("SHOU-CONTRACT-APPROVE");
|
|
|
|
+ commonBillOperateHis.setOperateDate(new Date());
|
|
|
|
+ commonBillOperateHis.setOperateUser(contractManagementInfo1.getCreateUserId());
|
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.toJSON(contractManagementInfo1);
|
|
|
|
+ commonBillOperateHis.setBusinessHistory(jsonObject.toJSONString());
|
|
|
|
+ commonBillOperateHisService.create(commonBillOperateHis);
|
|
|
|
+
|
|
}
|
|
}
|
|
//代收合同
|
|
//代收合同
|
|
else {
|
|
else {
|
|
@@ -585,6 +690,17 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
|
|
workflowService.activateInstance(contractManagementInfo1.getWorkflowId(), contractManagementInfo1.getId());
|
|
workflowService.activateInstance(contractManagementInfo1.getWorkflowId(), contractManagementInfo1.getId());
|
|
}
|
|
}
|
|
this.updateById(contractManagementInfo1);
|
|
this.updateById(contractManagementInfo1);
|
|
|
|
+
|
|
|
|
+ // 添加提交历史
|
|
|
|
+ CommonBillOperateHis commonBillOperateHis = new CommonBillOperateHis();
|
|
|
|
+ commonBillOperateHis.setBillId(contractManagementInfo1.getId());
|
|
|
|
+ commonBillOperateHis.setId(IdGenerator.generateUUID());
|
|
|
|
+ commonBillOperateHis.setBillType("DAISHOU-CONTRACT-APPROVE");
|
|
|
|
+ commonBillOperateHis.setOperateDate(new Date());
|
|
|
|
+ commonBillOperateHis.setOperateUser(contractManagementInfo1.getCreateUserId());
|
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.toJSON(contractManagementInfo1);
|
|
|
|
+ commonBillOperateHis.setBusinessHistory(jsonObject.toJSONString());
|
|
|
|
+ commonBillOperateHisService.create(commonBillOperateHis);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
contractGoodsInfoService.updateById(contractManagementInfo.getContractGoodsInfo());
|
|
contractGoodsInfoService.updateById(contractManagementInfo.getContractGoodsInfo());
|