|
@@ -1,6 +1,6 @@
|
|
package com.fjhx.purchase.service.impl;
|
|
package com.fjhx.purchase.service.impl;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.fjhx.activiti.ProcessTaskReferBuilder;
|
|
import com.fjhx.activiti.ProcessTaskReferBuilder;
|
|
import com.fjhx.activiti.ProcessTaskResult;
|
|
import com.fjhx.activiti.ProcessTaskResult;
|
|
import com.fjhx.activiti.SubmitFlowCondition;
|
|
import com.fjhx.activiti.SubmitFlowCondition;
|
|
@@ -229,14 +229,17 @@ public class PurchaseContractFlowServiceImpl implements IPurchaseContractFlowSer
|
|
throw new ServiceException("参数缺失");
|
|
throw new ServiceException("参数缺失");
|
|
}
|
|
}
|
|
// 查询采购合同信息
|
|
// 查询采购合同信息
|
|
- QueryWrapper<PurchaseContract> wrapper = new QueryWrapper<>();
|
|
|
|
- wrapper.lambda().eq(PurchaseContract::getId, condition.getId()).or().eq(PurchaseContract::getProcessInstanceId, condition.getId());
|
|
|
|
|
|
+ LambdaQueryWrapper<PurchaseContract> wrapper = new LambdaQueryWrapper<PurchaseContract>()
|
|
|
|
+ .eq(PurchaseContract::getId, condition.getId())
|
|
|
|
+ .or().eq(PurchaseContract::getProcessInstanceId, condition.getId());
|
|
|
|
+
|
|
PurchaseContract purchaseContract = iPurchaseContractService.getOne(wrapper);
|
|
PurchaseContract purchaseContract = iPurchaseContractService.getOne(wrapper);
|
|
if (Func.isEmpty(purchaseContract)) {
|
|
if (Func.isEmpty(purchaseContract)) {
|
|
throw new ServiceException("采购合同不存在");
|
|
throw new ServiceException("采购合同不存在");
|
|
} else if (purchaseContract.getPurchaseStatus() == PurchaseStatusEnum.INVALID.getKey()) {
|
|
} else if (purchaseContract.getPurchaseStatus() == PurchaseStatusEnum.INVALID.getKey()) {
|
|
throw new ServiceException("采购合同已作废");
|
|
throw new ServiceException("采购合同已作废");
|
|
}
|
|
}
|
|
|
|
+
|
|
// 业务总监审批(只有该节点status有值),0:不通过(走总经理审批节点)、1:通过(走结束节点)
|
|
// 业务总监审批(只有该节点status有值),0:不通过(走总经理审批节点)、1:通过(走结束节点)
|
|
String withFixedValue = null;
|
|
String withFixedValue = null;
|
|
if (condition.getStatus() != null) {
|
|
if (condition.getStatus() != null) {
|
|
@@ -300,10 +303,10 @@ public class PurchaseContractFlowServiceImpl implements IPurchaseContractFlowSer
|
|
due.setDueMoney(BigDecimal.ZERO);
|
|
due.setDueMoney(BigDecimal.ZERO);
|
|
}
|
|
}
|
|
iWmsDueApi.saveDue(due);
|
|
iWmsDueApi.saveDue(due);
|
|
- if (purchaseContract.getPaymentFull().compareTo(BigDecimal.ZERO) == 1 &&
|
|
|
|
|
|
+ if (purchaseContract.getPaymentFull().compareTo(BigDecimal.ZERO) > 0 &&
|
|
purchaseContract.getPaymentCycleType() != PurchaseCycleEnum.FULL_PREPAYMENT.getKey()) {
|
|
purchaseContract.getPaymentCycleType() != PurchaseCycleEnum.FULL_PREPAYMENT.getKey()) {
|
|
String promptDate = DateUtil.dateAddASub(purchaseContract.getCreateTime(), purchaseContract.getPaymentCyclePrescribe());
|
|
String promptDate = DateUtil.dateAddASub(purchaseContract.getCreateTime(), purchaseContract.getPaymentCyclePrescribe());
|
|
- //添加一条预付款得账单数据
|
|
|
|
|
|
+ // 添加一条预付款得账单数据
|
|
due.setId(IdUtils.fastSimpleUUID());
|
|
due.setId(IdUtils.fastSimpleUUID());
|
|
due.setPromptDate(promptDate);
|
|
due.setPromptDate(promptDate);
|
|
due.setPaymentItemsType(DuePaymentItemsEnum.ADVANCE.getKey());
|
|
due.setPaymentItemsType(DuePaymentItemsEnum.ADVANCE.getKey());
|