wangzhuo před 2 roky
rodič
revize
e2ef5ca015

+ 11 - 9
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/impl/AuditPathsServiceImpl.java

@@ -404,24 +404,26 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                                 }
 
                                 SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("tFeesStatus");
+                                TFees ccf = feesMapper.seletFeesByCCF();
                                 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());
-                                        }
                                     }
                                 }
+                                // 过滤出费用类型等于仓储费并且有商机id,并取出来进行更新仓储费计费日期
+                                TFees finalCcf = ccf;
+                                long count = feesList.stream().filter(li -> Objects.equals(li.getfFeeid(), finalCcf.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());
                             }

+ 5 - 5
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -737,7 +737,8 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             }
         }
         if (WarehouseTypeEnum.HQZY.getType().equals(warehouseBills.getfBilltype()) || WarehouseTypeEnum.CKDB.getType().equals(warehouseBills.getfBilltype()) ||
-                WarehouseTypeEnum.HWTG.getType().equals(warehouseBills.getfBilltype())) {
+                WarehouseTypeEnum.HWTG.getType().equals(warehouseBills.getfBilltype()))
+        {
             tWhgenleg.setfOriginalbilldate(warehousebillsitems.getfOriginalbilldate());
             if (WarehouseTypeEnum.CKDB.getType().equals(warehouseBills.getfBilltype()) || WarehouseTypeEnum.HWTG.getType().equals(warehouseBills.getfBilltype())) {
                 tWhgenleg.setfCorpid(warehouseBills.getfCorpid());
@@ -761,11 +762,10 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         if (StringUtils.isNotEmpty(warehousebillsitems.getfLocalcntrno())) {
             tWhgenleg.setfLocalcntrno(warehousebillsitems.getfLocalcntrno());
         }
-        if (WarehouseTypeEnum.HQZY.getType().equals(warehouseBills.getfBilltype()) || WarehouseTypeEnum.CKDB.getType().equals(warehouseBills.getfBilltype()) ||
-                WarehouseTypeEnum.HWTG.getType().equals(warehouseBills.getfBilltype())) {
+        if (WarehouseTypeEnum.HQZY.getType().equals(warehouseBills.getfBilltype()) || WarehouseTypeEnum.HWTG.getType().equals(warehouseBills.getfBilltype())) {
             // 仓储计费日期
             tWhgenleg.setfChargedate(warehousebillsitems.getfBsdate());
-        } else {
+        }else {
             // 仓储计费日期
             tWhgenleg.setfChargedate(warehousebillsitems.getfChargedate());
         }
@@ -5678,7 +5678,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             long fInventoryDays;
             // 要计费天数
             long fBillingDays;
-            if ("SJCK".equals(fBilltype)) {
+            if ("SJCK".equals(fBilltype) || WarehouseTypeEnum.CKDB.getType().equals(fBilltype)) {
                 fInventoryDays = DateUtils.getDateDay(fBsdate, (Date) item.get("fOriginalbilldate"));
                 fBillingDays = DateUtils.getDateDay(fBsdate, (Date) item.get("fChargedate"));
                 storageFeesDto.setStartTime((Date) item.get("fChargedate"));

+ 2 - 2
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsitemsMapper.xml

@@ -544,7 +544,7 @@
         <where>
             ware.f_corpid = #{warehouse.fCorpid}
             <if test="warehouse.fId != null">and item.f_id = #{warehouse.fId}</if>
-            and ware.f_billtype in ('HQZY', 'SJCK')
+            and ware.f_billtype in ('HQZY', 'SJCK', 'CKDB')
             and wa.f_charg = 1
             and item.f_storage_fee_deadline IS NULL
             and item.f_bsdate &lt;= #{warehouse.fBillingDeadline}
@@ -883,7 +883,7 @@
         t_warehousebillsitems
         SET f_storage_fee_deadline = null
         WHERE
-        f_pid = #{fPid}
+        f_id = #{fPid}
     </update>
 
     <select id="selectStorageFeeItemfTruckNo" parameterType="string" resultType="Map">