Selaa lähdekoodia

Merge remote-tracking branch 'origin/dev' into dev

纪新园 2 vuotta sitten
vanhempi
commit
e62a797a05

+ 24 - 12
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/impl/AuditPathsServiceImpl.java

@@ -24,6 +24,8 @@ import com.ruoyi.finance.mapper.TFeeMapper;
 import com.ruoyi.finance.service.impl.TFeeServiceImpl;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
 import com.ruoyi.reportManagement.mapper.TWhgenlegMapper;
+import com.ruoyi.system.domain.SysConfig;
+import com.ruoyi.system.mapper.SysConfigMapper;
 import com.ruoyi.warehouseBusiness.component.CalculationWarehouseService;
 import com.ruoyi.warehouseBusiness.domain.*;
 import com.ruoyi.warehouseBusiness.domain.dto.TWarehouseBillsR;
@@ -114,6 +116,9 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
     @Autowired
     private TEnclosureMapper tEnclosureMapper;
 
+    @Autowired
+    private SysConfigMapper sysConfigMapper;
+
     /**
      * 查询审批流配置主
      *
@@ -395,18 +400,25 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                                 if (CollectionUtils.isNotEmpty(ids) && tWarehousebillsitemsMapper.selectIsCalculateStorageFeesByIds(ids) > 0) {
                                     throw new WarehouseException("计算费用中存在已计算仓储费信息");
                                 }
-                                // 获取仓储费,并判断费用中是否存在仓储费
-                                TFees ccf = feesMapper.seletFeesByCCF();
-                                if (Objects.isNull(ccf)) {
-                                    throw new WarehouseException("未找到仓储费费用信息");
-                                }
-                                // 过滤出费用类型等于仓储费并且有商机id,并取出来进行更新仓储费计费日期
-                                long count = feesList.stream().filter(li -> Objects.equals(li.getfFeeid(), ccf.getfId()) && Objects.nonNull(li.getSrcId()))
-                                        .count();
-                                if (count > 0) {
-                                    TWarehousebillsfees warehousebillsfees = feesList.stream().findFirst().orElseThrow(() -> new WarehouseException("未找到费用明细"));
-                                    // 更新子表仓储费截止日期
-                                    tWarehousebillsitemsMapper.updateItemStorageFeeDeadlineByPId(warehousebillsfees.getfPid(), warehousebillsfees.getfBillingDeadline());
+
+                                SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("tFeesStatus");
+                                if (!Objects.isNull(sysConfig)){
+                                    String configValue = sysConfig.getConfigValue();
+                                    if ("0".equals(configValue)){
+                                        // 获取仓储费,并判断费用中是否存在仓储费
+                                        TFees ccf = feesMapper.seletFeesByCCF();
+                                        if (Objects.isNull(ccf)) {
+                                            throw new WarehouseException("未找到仓储费费用信息");
+                                        }
+                                        // 过滤出费用类型等于仓储费并且有商机id,并取出来进行更新仓储费计费日期
+                                        long count = feesList.stream().filter(li -> Objects.equals(li.getfFeeid(), ccf.getfId()) && Objects.nonNull(li.getSrcId()))
+                                                .count();
+                                        if (count > 0) {
+                                            TWarehousebillsfees warehousebillsfees = feesList.stream().findFirst().orElseThrow(() -> new WarehouseException("未找到费用明细"));
+                                            // 更新子表仓储费截止日期
+                                            tWarehousebillsitemsMapper.updateItemStorageFeeDeadlineByPId(warehousebillsfees.getfPid(), warehousebillsfees.getfBillingDeadline());
+                                        }
+                                    }
                                 }
                             } else if (Objects.equals(auditItems.getActId(), 150L)) {
                                 tWarehouseBillsService.approvedStorageFee(auditItems.getBillId(), fettle, at.getAuditItem());

+ 2 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -2250,11 +2250,11 @@ public class TFeeServiceImpl implements ITFeeService {
      */
     @Override
     public AjaxResult financialLedgerDetails(FeeDTO feeDTO) {
-        TFees ccf = tFeesMapper.seletFeesByCCF();
+        /*TFees ccf = tFeesMapper.seletFeesByCCF();
         if (Objects.isNull(ccf)) {
             throw new WarehouseException("未找到仓储费费用信息");
         }
-        feeDTO.setFeesId(ccf.getfId());
+        feeDTO.setFeesId(ccf.getfId());*/
         List<FeeVO> feeVOList = tFeeMapper.selectFinancialLedgerDetails(feeDTO);
 
         if (CollectionUtils.isNotEmpty(feeVOList)) {