Prechádzať zdrojové kódy

Merge branch 'master' into test

yzc 1 rok pred
rodič
commit
74dab62936

+ 3 - 2
hx-account/src/main/java/com/fjhx/account/flow/AccountRequestFundsFlow.java

@@ -88,13 +88,13 @@ public class AccountRequestFundsFlow extends FlowDelegate {
      */
     @Override
     public void end(Long flowId, Long businessId, JSONObject submitData) {
-        // 通过业务ID查询申购数据
+        // 通过业务ID查询请款数据
         AccountRequestFunds accountRequestFunds = accountRequestFundsService.getById(businessId);
         if (ObjectUtils.isEmpty(accountRequestFunds)) {
             throw new ServiceException("请款表的数据不存在");
         }
 
-        // 修改申购状态为审批通过
+        // 修改请款状态为审批通过
         accountRequestFunds.setStatus(AccountRequestFundsStatusEnum.PASS.getKey());
 
         // 修改核销状态以及预支单核销状态为已核销
@@ -135,6 +135,7 @@ public class AccountRequestFundsFlow extends FlowDelegate {
         accountPayment.setOpeningBank(accountRequestFunds.getOpeningBank());
         accountPayment.setAccountOpening(accountRequestFunds.getAccountOpening());
         accountPayment.setInterbankNumber(accountRequestFunds.getInterbankNumber());
+        accountPayment.setCreateUser(accountRequestFunds.getCreateUser());
 
         // 如果是核销 核销数据审批通过后,根据“核销总额 - 预支总额”生成“待打款”数据
         if ("3".equals(accountRequestFunds.getType())) {

+ 7 - 1
hx-purchase/src/main/java/com/fjhx/purchase/service/pay/impl/PayServiceImpl.java

@@ -187,7 +187,13 @@ public class PayServiceImpl extends ServiceImpl<PayMapper, Pay> implements PaySe
         ));
         payDetailVoList.forEach(item -> item.setInvoiceAmount(invoiceAmountMap.getOrDefault(item.getPurchaseId(), BigDecimal.ZERO)));
 
-        return result;
+        //赋值流程ID
+        DynamicDataSourceContextHolder.push(SourceConstant.BASE);
+        FlowExample flowExample = flowExampleService.getOne(Wrappers.<FlowExample>query().lambda().eq(FlowExample::getBusinessId,id));
+        // 赋值流程id
+        result.setFlowExampleId(flowExample.getId());
+
+        return  result;
     }
 
     @Override

+ 3 - 0
hx-sale/src/main/java/com/fjhx/sale/service/purchase/impl/SalePurchaseServiceImpl.java

@@ -103,6 +103,9 @@ public class SalePurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchas
         if(purchaseDto.getPurchaseStatus()==PurchaseStatusEnum.CENCELLATION.getKey()){//如果采购合同=作废//归还交接单的数量
             //查询出当前采购的明细
             Purchase purchase = purchaseService.getById(purchaseDto.getId());
+            if(purchase.getPurchaseStatus()==PurchaseStatusEnum.CENCELLATION.getKey()){
+                throw new ServiceException("采购合同已作废");
+            }
             List<ContractProduct> upContractProductList = new ArrayList<>();
             List<SampleProduct> upSampleProductList = new ArrayList<>();
             if(ObjectUtils.isNotEmpty(purchase)){