Explorar o código

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

lazhaoqian %!s(int64=3) %!d(string=hai) anos
pai
achega
95c20692be

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehouseGoodsTransferController.java

@@ -234,6 +234,19 @@ public class TWarehouseGoodsTransferController extends BaseController {
     }
 
     /**
+     * 货转根据提单号查询可用客户、仓库信息
+     */
+    @DataScope(deptAlias = "d", userAlias = "u")
+    @GetMapping(value = "/corpOrWarehouseByMblno")
+    public AjaxResult corpOrWarehouseByMblno(@RequestParam("mblno") String fMblno) {
+        // 判断是否传入值
+        if (StringUtils.isEmpty(fMblno)) {
+            return AjaxResult.error("未找到提单号");
+        }
+        return itWarehouseBillsService.corpOrWarehouseByMblno(fMblno);
+    }
+
+    /**
      * 根据id更新费用审核状态
      *
      * @param id

+ 1 - 63
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/impl/AuditPathsServiceImpl.java

@@ -378,21 +378,8 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                                 tWarehousebillsitemsMapper.updateItemStorageFeeDeadlineByPId(warehousebillsfees.getfPid(), warehousebillsfees.getfBillingDeadline());
                             }
                         } else if (Objects.equals(auditItems.getActId(), 150L)) {
-                            List<TWarehousebillsfees> feesList = tWarehousebillsfeesMapper.selectWarehousebillsfeesByPId(auditItems.getBillId());
-                            if (CollectionUtils.isNotEmpty(feesList)) {
-                                // 过滤出明细信息查询是否存在已计算仓储费
-                                List<Long> ids = feesList.stream().map(TWarehousebillsfees::getSrcId).distinct().collect(toList());
-                                if (tWarehousebillsitemsMapper.selectIsCalculateStorageFeesByIds(ids) > 0) {
-                                    throw new WarehouseException("计算费用中存在已计算仓储费信息");
-                                }
-                                // 查出主表数据
-                                TWarehouseBills warehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(auditItems.getBillId());
-                                for (TWarehousebillsfees fees : feesList) {
-                                    storageFeeUpdateItem(warehouseBills, fees);
-                                }
-                            }
+                            tWarehouseBillsService.approvedStorageFee(auditItems.getBillId(), fettle, at.getAuditItem());
                         }
-
                     } else if (auditItems.getActId() >= 210 && auditItems.getActId() <= 230) {
                         // 财务模块
                         if ("T".equals(at.getIffinalItem())) {
@@ -670,52 +657,6 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
     }
 
     /**
-     * 计算仓储费计算更新出库货转信息
-     *
-     * @param warehouseBills 主表信息
-     * @param fees           仓储费信息
-     */
-    private void storageFeeUpdateItem(TWarehouseBills warehouseBills, TWarehousebillsfees fees) {
-        Date chargeDate = DateUtils.addDays(fees.getfBillingDeadline(), 1);
-        // 如果是库存总帐
-        if (WarehouseTypeEnum.KCZZ.getType().equals(fees.getfBilltype())) {
-            TWhgenleg whgenleg = new TWhgenleg();
-            whgenleg.setfId(fees.getSrcId());
-            whgenleg.setfChargedate(chargeDate);
-            tWhgenlegMapper.updateTWhgenleg(whgenleg);
-            // 如果计算之前信息
-            if (!fees.getfBillingDeadline().after(warehouseBills.getUpdateTime())) {
-                // 查询时间区间内的仓储业务明细信息
-                List<String> timeList = new ArrayList<>();
-                timeList.add(DateUtils.dateToString(DateUtils.dateConversionMin(fees.getfBillingDeadline())));
-                timeList.add(DateUtils.dateToString(DateUtils.dateConversionMax(warehouseBills.getUpdateTime())));
-                warehouseBills.setItemBsDateList(timeList);
-                List<TWarehousebillsitems> warehousebillsitemsList = tWarehousebillsitemsMapper.selectListByCorpId(warehouseBills);
-                // 过滤出出库、货转,更新对应仓储费计费日期
-                List<TWarehousebillsitems> itemList = warehousebillsitemsList.stream().filter(li ->
-                        li.getfBilltype().equals(WarehouseTypeEnum.SJCK.getType()) ||
-                                li.getfBilltype().equals(WarehouseTypeEnum.HQZY.getType())).collect(toList());
-                if (CollectionUtils.isNotEmpty(itemList)) {
-                    itemList.forEach(li -> {
-                        li.setfChargedate(chargeDate);
-                        li.setUpdateTime(new Date());
-                        tWarehousebillsitemsMapper.updateTWarehousebillsitems(li);
-                    });
-                }
-            }
-        } else {
-            TWarehousebillsitems billsItem = new TWarehousebillsitems();
-            billsItem.setfId(fees.getSrcId());
-            billsItem.setfChargedate(chargeDate);
-            if ("SJCK".equals(fees.getfBilltype())) {
-                billsItem.setfStorageFeeDeadline(fees.getfBillingDeadline());
-                billsItem.setIsCalculateStorageFees(WarehouseTypeEnum.CALCULATE.getType());
-            }
-            tWarehousebillsitemsMapper.updateTWarehousebillsitems(billsItem);
-        }
-    }
-
-    /**
      * 审批驳回
      *
      * @param auditItems 审核人、单据信息
@@ -735,9 +676,6 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             tWarehousebillsfeesMapper.warehouseFeesFollowUpdate(auditItems.getBillId(), fettle, auditItems.getAuditItem());
             if (Objects.equals(auditItems.getActId(), 150L)) {
                 List<TWarehousebillsfees> feesList = tWarehousebillsfeesMapper.selectWarehousebillsfeesByPId(auditItems.getBillId());
-                // 查询仓储费计算主表
-                TWarehouseBills warehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(auditItems.getBillId());
-
                 for (TWarehousebillsfees wareItem : feesList) {
                     if (StringUtils.isNull(wareItem.getSrcId())) {
                         continue;

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

@@ -184,17 +184,17 @@ public class TFeeServiceImpl implements ITFeeService {
                 List<SysDictData> sysDictDataList = iSysDictDataService.selectDictDataList(sysDictData);
 
                 List<SysDictData> sysDictDataListIn = new ArrayList<>();
-                if (tWarehousebillsfees.getfBilltype().equals("SJRK")) {
+                if (StringUtils.isNotEmpty(tWarehousebillsfees.getfBilltype()) && tWarehousebillsfees.getfBilltype().equals("SJRK")) {
                     sysDictData.setDictType(ST_IN_TYPE);
                     sysDictData.setDictValue(String.valueOf(tWarehousebillsfees.getfBusinessType()));
                     sysDictData.setStatus("0");
                     sysDictDataListIn = iSysDictDataService.selectDictDataList(sysDictData);
-                } else if (tWarehousebillsfees.getfBilltype().equals("SJCK")) {
+                } else if (StringUtils.isNotEmpty(tWarehousebillsfees.getfBilltype()) && tWarehousebillsfees.getfBilltype().equals("SJCK")) {
                     sysDictData.setDictType(ST_OUT_TYPE);
                     sysDictData.setDictValue(String.valueOf(tWarehousebillsfees.getfBusinessType()));
                     sysDictData.setStatus("0");
                     sysDictDataListIn = iSysDictDataService.selectDictDataList(sysDictData);
-                } else if (tWarehousebillsfees.getfBilltype().equals("CKDB") | tWarehousebillsfees.getfBilltype().equals("HWTG")) {
+                } else if (StringUtils.isNotEmpty(tWarehousebillsfees.getfBilltype()) && tWarehousebillsfees.getfBilltype().equals("CKDB") | tWarehousebillsfees.getfBilltype().equals("HWTG")) {
                     sysDictData.setDictType(ST_TRANS_TYPE);
                     sysDictData.setDictValue(String.valueOf(tWarehousebillsfees.getfBusinessType()));
                     sysDictData.setStatus("0");
@@ -232,22 +232,22 @@ public class TFeeServiceImpl implements ITFeeService {
                 map1.put("fFeeunitid", sysDictDataList.get(0).getDictLabel());
                 map1.put("fQty", tWarehousebillsfees.getfQty());
                 map1.put("fUnitprice", tWarehousebillsfees.getfUnitprice());
-                if (tWarehousebillsfees.getfBilltype().equals("KHDD")) {
+                if (StringUtils.isNotEmpty(tWarehousebillsfees.getfBilltype()) && tWarehousebillsfees.getfBilltype().equals("KHDD")) {
                     map1.put("fBusinessType", "船运订单");
                 } else if (CollectionUtils.isNotEmpty(sysDictDataListIn)) {
                     map1.put("fBusinessType", sysDictDataListIn.get(0).getDictLabel());
                 }
-                if (tWarehousebills.getfBilltype().equals("SJRK")) {
+                if (StringUtils.isNotEmpty(tWarehousebills.getfBilltype()) && tWarehousebills.getfBilltype().equals("SJRK")) {
                     map1.put("fBilltype", "入库");
-                } else if (tWarehousebills.getfBilltype().equals("SJCK")) {
+                } else if (StringUtils.isNotEmpty(tWarehousebills.getfBilltype()) && tWarehousebills.getfBilltype().equals("SJCK")) {
                     map1.put("fBilltype", "出库");
-                } else if (tWarehousebills.getfBilltype().equals("CKDB")) {
+                } else if (StringUtils.isNotEmpty(tWarehousebills.getfBilltype()) && tWarehousebills.getfBilltype().equals("CKDB")) {
                     map1.put("fBilltype", "调拨");
-                } else if (tWarehousebills.getfBilltype().equals("HWTG")) {
+                } else if (StringUtils.isNotEmpty(tWarehousebills.getfBilltype()) && tWarehousebills.getfBilltype().equals("HWTG")) {
                     map1.put("fBilltype", "货物通关");
-                } else if (tWarehousebills.getfBilltype().equals("HQZY")) {
+                } else if (StringUtils.isNotEmpty(tWarehousebills.getfBilltype()) && tWarehousebills.getfBilltype().equals("HQZY")) {
                     map1.put("fBilltype", "货权转移");
-                } else if (tWarehousebills.getfBilltype().equals("KHDD")) {
+                } else if (StringUtils.isNotEmpty(tWarehousebills.getfBilltype()) && tWarehousebills.getfBilltype().equals("KHDD")) {
                     map1.put("fBilltype", "船运订单");
                 }
                 feeDoList.add(map1);
@@ -409,7 +409,7 @@ public class TFeeServiceImpl implements ITFeeService {
         }
         List<FinancialTFeeDoExcel> list = tFeeDoMapper.selectFinancialTFeeDo(fPid);
         map.put("tFee", tFee);
-        map.put("tFeeDo",list);
+        map.put("tFeeDo", list);
         return AjaxResult.success("成功", map);
     }
 
@@ -1539,7 +1539,7 @@ public class TFeeServiceImpl implements ITFeeService {
 
     @Override
     public Map<String, Object> selectFinancialTFeeId(Long fId) {
-        Map<String,Object> map = new HashMap<>();
+        Map<String, Object> map = new HashMap<>();
         FinancialTFee financialTFee = tFeeMapper.selectFinancialTFeeId(fId);
         List<FinancialTFeeDoExcel> financialTFeeDoExcels = tFeeDoMapper.selectFinancialTFeeDo(fId);
         map.put("tFee", financialTFee);

+ 31 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/vo/WarehouseBillsVO.java

@@ -0,0 +1,31 @@
+package com.ruoyi.warehouseBusiness.domain.vo;
+
+import com.ruoyi.basicData.domain.TCorps;
+import com.ruoyi.common.core.domain.entity.TWarehouse;
+import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ *
+ *
+ * @author  caifc
+ * @date 2021-11-10 9:28
+*/
+@Data
+public class WarehouseBillsVO extends TWarehouseBills {
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     *  客户集合
+     */
+    private List<TCorps> corpsList;
+
+    /**
+     *  仓库集合
+     */
+    private List<TWarehouse> warehouseList;
+
+}

+ 8 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseBillsService.java

@@ -680,4 +680,12 @@ public interface ITWarehouseBillsService {
      * @return
      */
     AjaxResult appQueryInit(Long id, String typeEnum);
+
+    /**
+     * 货转根据提单号查询可用客户、仓库信息
+     *
+     * @param fMblno 提单号
+     * @return
+     */
+    AjaxResult corpOrWarehouseByMblno(String fMblno);
 }

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

@@ -49,9 +49,7 @@ import com.ruoyi.warehouseBusiness.domain.dto.CalculateStorageFeesDTO;
 import com.ruoyi.warehouseBusiness.domain.enums.FeesTypeEnum;
 import com.ruoyi.warehouseBusiness.domain.enums.WarehouseActIdEnum;
 import com.ruoyi.warehouseBusiness.domain.enums.WarehouseTypeEnum;
-import com.ruoyi.warehouseBusiness.domain.vo.AppWarehouseInfoVO;
-import com.ruoyi.warehouseBusiness.domain.vo.CalculateStorageFeesInfoVO;
-import com.ruoyi.warehouseBusiness.domain.vo.StorageFeeCalculationResultVO;
+import com.ruoyi.warehouseBusiness.domain.vo.*;
 import com.ruoyi.warehouseBusiness.excel.*;
 import com.ruoyi.warehouseBusiness.mapper.*;
 import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
@@ -3244,55 +3242,6 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     }
 
     /**
-     * 根据仓库主表id 更新对应明细表状态
-     *
-     * @param fPid 仓库主表id
-     * @return 结果
-     */
-    @Transactional
-    public AjaxResult storageFeeFollow(Long fPid, long fettle) {
-        if (StringUtils.isNull(fPid)) {
-            return AjaxResult.error("仓库更新状态未找到主表信息,请与管理员联系");
-        }
-        int warehouseUpdateResult = tWarehouseBillsMapper.warehouseFollowUpdate(fPid, fettle, new Date());
-        if (warehouseUpdateResult <= 0) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            return AjaxResult.error("更新库存明细状态失败,请联系管理员");
-        }
-        TWarehousebillsfees warehousebillsfees = new TWarehousebillsfees();
-        warehousebillsfees.setfPid(fPid);
-        List<TWarehousebillsfees> warehousebillsfeesList = tWarehousebillsfeesMapper.selectTWarehousebillsfeesList(warehousebillsfees);
-        for (TWarehousebillsfees wareItem : warehousebillsfeesList) {
-            if (StringUtils.isNull(wareItem.getSrcId())) {
-                continue;
-            }
-            if ("KCZZ".equals(wareItem.getfBilltype())) {
-                TWhgenleg tWhgenleg = tWhgenlegMapper.selectTWhgenlegById(wareItem.getSrcId());
-                tWhgenleg.setfChargedate(DateUtils.dateAdd(wareItem.getfBillingDeadline(), 1));
-                int i = tWhgenlegMapper.updateTWhgenleg(tWhgenleg);
-                if (i <= 0) {
-                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                    return AjaxResult.error("更新库存费用状态失败,请联系管理员");
-                }
-            } else {
-                TWarehousebillsitems tWarehousebillsitems = tWarehousebillsitemsMapper.selectTWarehousebillsitemsById(wareItem.getSrcId());
-                tWarehousebillsitems.setfChargedate(DateUtils.dateAdd(wareItem.getfBillingDeadline(), 1));
-                if ("SJCK".equals(wareItem.getfBilltype())) {
-                    tWarehousebillsitems.setfStorageFeeDeadline(wareItem.getfBillingDeadline());
-                }
-                tWarehousebillsitemsMapper.updateTWarehousebillsitems(tWarehousebillsitems);
-            }
-        }
-        int feesUpdateResult = tWarehousebillsfeesMapper.warehouseFeesFollowUpdate(fPid, fettle, new Date());
-        if (feesUpdateResult <= 0) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            return AjaxResult.error("更新库存费用状态失败,请联系管理员");
-        }
-        return AjaxResult.success();
-    }
-
-
-    /**
      * 入库确认
      *
      * @param warehouseBills      主表
@@ -4436,6 +4385,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             tWhgenleg.setfMarks((String) whgenleg.get("fMarks"));
             tWhgenleg.setfMblno((String) whgenleg.get("fMblno"));
             tWhgenleg.setfCntrno((String) whgenleg.get("fCntrno"));
+            tWhgenleg.setfOriginalbilldate((Date) whgenleg.get("fOriginalbilldate"));
             tWhgenleg.setfGoodsid(Long.parseLong(whgenleg.get("fGoodsid").toString()));
             tWhgenleg.setfNetweightblc(new BigDecimal(whgenleg.get("fNetweight").toString()));
             tWhgenleg.setfGrossweightblc(new BigDecimal(whgenleg.get("fGrossweight").toString()));
@@ -4449,6 +4399,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 if ((!Objects.equals(li.getfGoodsid(), tWhgenleg.getfGoodsid())) ||
                         (!Objects.equals(li.getfWarehouselocid(), tWhgenleg.getfWarehouseid()) || Objects.equals(li.getfTransferWarehouselocid(), tWhgenleg.getfWarehouseid())) ||
                         !li.getfMblno().equals(tWhgenleg.getfMblno()) ||
+                        !Objects.equals(li.getfOriginalbilldate(), tWhgenleg.getfOriginalbilldate()) ||
                         (!li.getfMarks().equals(tWhgenleg.getfMarks())) ||
                         (ifCntrno && !li.getfCntrno().equals(tWhgenleg.getfCntrno()))
                 ) {
@@ -4905,24 +4856,92 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 auditItems.setTimes(tWarehousebills.getfTimes());
                 AjaxResult approvalFlow = auditItemsService.createApprovalFlow(auditItems);
                 String code = approvalFlow.get("code").toString();
-//                Long code = Long.valueOf(String.valueOf(ajaxResult.get("code"))).longValue();
                 if ("500".equals(code)) {
                     TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 }
                 return approvalFlow;
             } else {
-                AjaxResult ajaxResult = storageFeeFollow(fPid, 6L);
-                String code = ajaxResult.get("code").toString();
-//                Long code = Long.valueOf(String.valueOf(ajaxResult.get("code"))).longValue();
-                if ("500".equals(code)) {
-                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                }
-                return ajaxResult;
+                approvedStorageFee(fPid, 6L, new Date());
+                return AjaxResult.success();
             }
         }
         return AjaxResult.success(tWarehousebills);
     }
 
+    /**
+     *  计算仓储费审核通过
+     * @param warehouseId   主表id
+     * @param fettle   状态
+     * @param date   审核时间
+     */
+    public void approvedStorageFee(Long warehouseId, Long fettle, Date date) {
+        tWarehousebillsfeesMapper.warehouseFeesFollowUpdate(warehouseId, fettle, date);
+        // 查出主表数据
+        TWarehouseBills warehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(warehouseId);
+        if (Objects.isNull(warehouseBills)) {
+            throw new WarehouseException("未找到仓储信息");
+        }
+        List<TWarehousebillsfees> feesList = tWarehousebillsfeesMapper.selectWarehousebillsfeesByPId(warehouseBills.getfId());
+        if (CollectionUtils.isEmpty(feesList)) {
+            throw new WarehouseException("未找到需要跟新的费用信息");
+        }
+        // 过滤出明细信息查询是否存在已计算仓储费
+        List<Long> ids = feesList.stream().map(TWarehousebillsfees::getSrcId).distinct().collect(toList());
+        if (tWarehousebillsitemsMapper.selectIsCalculateStorageFeesByIds(ids) > 0) {
+            throw new WarehouseException("计算费用中存在已计算仓储费信息");
+        }
+
+        for (TWarehousebillsfees fees : feesList) {
+            storageFeeUpdateItem(warehouseBills, fees);
+        }
+    }
+
+    /**
+     * 计算仓储费计算更新出库货转信息
+     *
+     * @param warehouseBills 主表信息
+     * @param fees           仓储费信息
+     */
+    private void storageFeeUpdateItem(TWarehouseBills warehouseBills, TWarehousebillsfees fees) {
+        Date chargeDate = DateUtils.addDays(fees.getfBillingDeadline(), 1);
+        // 如果是库存总帐
+        if (WarehouseTypeEnum.KCZZ.getType().equals(fees.getfBilltype())) {
+            TWhgenleg whgenleg = new TWhgenleg();
+            whgenleg.setfId(fees.getSrcId());
+            whgenleg.setfChargedate(chargeDate);
+            tWhgenlegMapper.updateTWhgenleg(whgenleg);
+            // 如果计算之前信息
+            if (!fees.getfBillingDeadline().after(warehouseBills.getUpdateTime())) {
+                // 查询时间区间内的仓储业务明细信息
+                List<String> timeList = new ArrayList<>();
+                timeList.add(DateUtils.dateToString(DateUtils.dateConversionMin(fees.getfBillingDeadline())));
+                timeList.add(DateUtils.dateToString(DateUtils.dateConversionMax(warehouseBills.getUpdateTime())));
+                warehouseBills.setItemBsDateList(timeList);
+                List<TWarehousebillsitems> warehousebillsitemsList = tWarehousebillsitemsMapper.selectListByCorpId(warehouseBills);
+                // 过滤出出库、货转,更新对应仓储费计费日期
+                List<TWarehousebillsitems> itemList = warehousebillsitemsList.stream().filter(li ->
+                        li.getfBilltype().equals(WarehouseTypeEnum.SJCK.getType()) ||
+                                li.getfBilltype().equals(WarehouseTypeEnum.HQZY.getType())).collect(toList());
+                if (CollectionUtils.isNotEmpty(itemList)) {
+                    itemList.forEach(li -> {
+                        li.setfChargedate(chargeDate);
+                        li.setUpdateTime(new Date());
+                        tWarehousebillsitemsMapper.updateTWarehousebillsitems(li);
+                    });
+                }
+            }
+        } else {
+            TWarehousebillsitems billsItem = new TWarehousebillsitems();
+            billsItem.setfId(fees.getSrcId());
+            billsItem.setfChargedate(chargeDate);
+            if ("SJCK".equals(fees.getfBilltype())) {
+                billsItem.setfStorageFeeDeadline(fees.getfBillingDeadline());
+                billsItem.setIsCalculateStorageFees(WarehouseTypeEnum.CALCULATE.getType());
+            }
+            tWarehousebillsitemsMapper.updateTWarehousebillsitems(billsItem);
+        }
+    }
+
     @Override
     public AjaxResult insertStorageFeeList(List<StorageChargeInsert> storageChargeInsert, LoginUser loginUser, String billsType) {
         if (CollectionUtils.isEmpty(storageChargeInsert)) {
@@ -5023,13 +5042,8 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     }
                     return approvalFlow;
                 } else {
-                    AjaxResult ajaxResult = storageFeeFollow(fPid, 6L);
-                    String code = ajaxResult.get("code").toString();
-//                Long code = Long.valueOf(String.valueOf(ajaxResult.get("code"))).longValue();
-                    if ("500".equals(code)) {
-                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                    }
-                    return ajaxResult;
+                    approvedStorageFee(fPid, 6L, new Date());
+                    return AjaxResult.success();
                 }
             }
         }
@@ -7109,6 +7123,38 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     }
 
     /**
+     * 货转根据提单号查询可用客户、仓库信息
+     *
+     * @param fMblno 提单号
+     * @return
+     */
+    @Override
+    public AjaxResult corpOrWarehouseByMblno(String fMblno) {
+        WarehouseBillsVO billsVO = new WarehouseBillsVO();
+        // 查询符合条件的库存总帐
+        TWhgenleg tWhgenleg = new TWhgenleg();
+        tWhgenleg.setfMblno(fMblno);
+        List<TWhgenleg> tWhgenlegs = tWhgenlegMapper.selectTWhgenlegList(tWhgenleg);
+        if (CollectionUtils.isNotEmpty(tWhgenlegs)) {
+            // 查询仓库信息
+            List<Long> warehouseIds = tWhgenlegs.stream().filter(leg -> Objects.nonNull(leg.getfWarehouseid())).map(TWhgenleg::getfWarehouseid)
+                    .distinct().collect(toList());
+            if (CollectionUtils.isNotEmpty(warehouseIds)) {
+                List<TWarehouse> warehouseList = tWarehouseMapper.selectByIds(warehouseIds);
+                billsVO.setWarehouseList(warehouseList);
+            }
+            // 查询客户
+            List<Long> corpIds = tWhgenlegs.stream().filter(leg -> Objects.nonNull(leg.getfCorpid())).map(TWhgenleg::getfCorpid)
+                    .distinct().collect(toList());
+            if (CollectionUtils.isNotEmpty(corpIds)) {
+                List<TCorps> corpsList = tCorpsMapper.selectByIds(corpIds);
+                billsVO.setCorpsList(corpsList);
+            }
+        }
+        return AjaxResult.success(billsVO);
+    }
+
+    /**
      * 如果是入库
      *
      * @param infoVO

+ 23 - 23
ruoyi-warehouse/src/main/resources/mapper/finance/TFeeMapper.xml

@@ -1682,29 +1682,29 @@
 
     <select id="warehouseBillsFeesList1" resultType="java.util.Map">
         SELECT
-        w.f_id AS fSrcid,
-        t.f_id AS fSrcpid,
-        t.f_corpid AS fCorpid,
-        c.f_name AS fName,
-        w.f_corpid AS fCorpids,
-        c1.f_name AS fFeesName,
-        w.f_mblno AS fMblno,
-        w.f_product_name AS fProductName,
-        w.f_marks AS fMarks,
-        t.f_billtype AS fBilltype,
-        t.f_review_date AS fReviewDate,
-        w.f_dc AS fSrcdc,
-        SUM(w.f_amount) AS fAmount,
-        SUM(w.f_stlamount) AS fStlamount,
-        ifnull(SUM( w.f_amount ) , 0 ) - ifnull( SUM( w.f_stlamount ) , 0 ) AS nnfinished
+            w.f_id AS fSrcid,
+            t.f_id AS fSrcpid,
+            t.f_corpid AS fCorpid,
+            c.f_name AS fName,
+            w.f_corpid AS fCorpids,
+            c1.f_name AS fFeesName,
+            w.f_mblno AS fMblno,
+            w.f_product_name AS fProductName,
+            w.f_marks AS fMarks,
+            t.f_billtype AS fBilltype,
+            t.f_review_date AS fReviewDate,
+            w.f_dc AS fSrcdc,
+            SUM(w.f_amount) AS fAmount,
+            SUM(w.f_stlamount) AS fStlamount,
+            ifnull(SUM( w.f_amount ) , 0 ) - ifnull( SUM( w.f_stlamount ) , 0 ) AS nnfinished
         FROM
-        t_warehousebills t
-        left join sys_user u on t.create_by = u.user_name
-        left join sys_dept d on t.f_bsdeptid = d.dept_id
-        LEFT JOIN t_corps c ON c.f_id = t.f_corpid
-        LEFT JOIN t_warehousebillsfees w ON w.f_pid = t.f_id
-        LEFT JOIN t_corps c1 ON w.f_corpid = c1.f_id
-        LEFT JOIN t_fees f ON w.f_feeid = f.f_id
+            t_warehousebills t
+            left join sys_user u on t.create_by = u.user_name
+            left join sys_dept d on t.f_bsdeptid = d.dept_id
+            LEFT JOIN t_corps c ON c.f_id = t.f_corpid
+            LEFT JOIN t_warehousebillsfees w ON w.f_pid = t.f_id
+            LEFT JOIN t_corps c1 ON w.f_corpid = c1.f_id
+            LEFT JOIN t_fees f ON w.f_feeid = f.f_id
         <where>
             <if test="fCorpid != null  and fCorpid != ''">and t.f_corpid = #{fCorpid}</if>
             <if test="fToCorpid != null  and fToCorpid != ''">and w.f_corpid = #{fToCorpid}</if>
@@ -1734,7 +1734,7 @@
             <if test='fReconciliation!= null and fReconciliation != "" and fReconciliation == "0" '>
                 and ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) != 0
             </if>
-            and t.f_review_date IS NOT NULL
+            and w.f_review_date IS NOT NULL
             ${params.dataScope}
             GROUP BY
             w.f_pid,

+ 1 - 0
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -108,6 +108,7 @@
             <if test="fStatus != null  and fStatus != ''">and f_status = #{fStatus}</if>
             <if test="fMarks != null  and fMarks != ''">and f_marks = #{fMarks}</if>
             <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
+            <if test="fMblno != null and fMblno != ''">and f_mblno like concat('%',#{fMblno},'%')</if>
         </where>
         ${params.dataScope}
     </select>