caifc 3 роки тому
батько
коміт
1bf1f8454a

+ 4 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWhgenlegController.java

@@ -11,6 +11,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.reportManagement.domain.SingleAnalysisExcel;
 import com.ruoyi.reportManagement.domain.SingleAnalysisFeesExcel;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
+import com.ruoyi.reportManagement.domain.vo.WhgenlegVO;
 import com.ruoyi.reportManagement.dto.TWarehousebill;
 import com.ruoyi.reportManagement.excel.Whgenleg;
 import com.ruoyi.reportManagement.service.ITWhgenlegService;
@@ -50,10 +51,10 @@ public class TWhgenlegController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('warehouseBusiness:whgenleg:list')")
     @DataScope(deptAlias = "d", userAlias = "u")
-    @GetMapping("/whgenlegList")
-    public TableDataInfo whgenlegList(TWhgenleg tWhgenleg) {
+    @GetMapping("/detailsList")
+    public TableDataInfo detailsList(TWhgenleg tWhgenleg) {
         startPage();
-        List<Map<String, Object>> list = tWhgenlegService.selectInventoryMapList(tWhgenleg);
+        List<WhgenlegVO> list = tWhgenlegService.selectWhgenlegDetailsList(tWhgenleg);
         return getDataTable(list);
     }
 

+ 22 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/domain/vo/WhgenlegVO.java

@@ -3,6 +3,8 @@ package com.ruoyi.reportManagement.domain.vo;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 /**
  * @author caifc
  * @date 2021-11-15 11:20
@@ -11,5 +13,25 @@ import lombok.Data;
 public class WhgenlegVO extends TWhgenleg {
     private static final long serialVersionUID = 1L;
 
+    // 客户名称
+    private String corpName;
+
+    // 货物属性
+    private String businessTypeName;
+
+    // 业务类型
+    private String billType;
+
+    // 贸易方式
+    private String trademodeName;
+
+    // 数量
+    private BigDecimal qty;
+
+    // 数量
+    private BigDecimal grossweight;
+
+    // 净重
+    private BigDecimal netweight;
 
 }

+ 8 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java

@@ -2,6 +2,7 @@ package com.ruoyi.reportManagement.mapper;
 
 
 import com.ruoyi.reportManagement.domain.TWhgenleg;
+import com.ruoyi.reportManagement.domain.vo.WhgenlegVO;
 import com.ruoyi.reportManagement.excel.Whgenleg;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
 import com.ruoyi.warehouseBusiness.domain.vo.CalculateStorageFeesInfoVO;
@@ -142,4 +143,11 @@ public interface TWhgenlegMapper {
      * @return
      */
     int queryChangedByFchargedate(@Param("ids") List<Long> ids, @Param("time")Date chargedate);
+
+    /**
+     *  库存总帐查询来源明细
+     * @param tWhgenleg
+     * @return
+     */
+    List<WhgenlegVO> selectWhgenlegDetailsList(TWhgenleg tWhgenleg);
 }

+ 8 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/ITWhgenlegService.java

@@ -4,6 +4,7 @@ package com.ruoyi.reportManagement.service;
 import com.ruoyi.reportManagement.domain.SingleAnalysisExcel;
 import com.ruoyi.reportManagement.domain.SingleAnalysisFeesExcel;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
+import com.ruoyi.reportManagement.domain.vo.WhgenlegVO;
 import com.ruoyi.reportManagement.dto.TWarehousebill;
 import com.ruoyi.reportManagement.excel.Whgenleg;
 
@@ -139,4 +140,11 @@ public interface ITWhgenlegService {
      * @return
      */
     public  List<Map<String, Object>> appWhGenLegList(TWhgenleg tWhgenleg);
+
+    /**
+     *  查询库存总帐详细信息
+     * @param tWhgenleg
+     * @return
+     */
+    List<WhgenlegVO> selectWhgenlegDetailsList(TWhgenleg tWhgenleg);
 }

+ 45 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java

@@ -7,24 +7,29 @@ import com.ruoyi.basicData.mapper.TCustomerContactMapper;
 import com.ruoyi.basicData.mapper.TWarehouseMapper;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
+import com.ruoyi.common.exception.WarehouseException;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.DictUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.reportManagement.domain.SingleAnalysisExcel;
 import com.ruoyi.reportManagement.domain.SingleAnalysisFeesExcel;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
+import com.ruoyi.reportManagement.domain.vo.WhgenlegVO;
 import com.ruoyi.reportManagement.dto.TWarehousebill;
 import com.ruoyi.reportManagement.excel.Whgenleg;
 import com.ruoyi.reportManagement.mapper.TWhgenlegMapper;
 import com.ruoyi.reportManagement.service.ITWhgenlegService;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
 import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 库存总账Service业务层处理
@@ -102,6 +107,46 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
      * @return 库存总账集合
      */
     @Override
+    public List<WhgenlegVO> selectWhgenlegDetailsList(TWhgenleg tWhgenleg) {
+        if (StringUtils.isNotNull(tWhgenleg.getfWarehouseLocationid())) {
+            // 获取仓库信息
+            TWarehouse tWarehouse = tWarehouseMapper.selectTWarehouseById(tWhgenleg.getfWarehouseLocationid());
+            if (tWarehouse.getfLocation() == 1) {
+                tWhgenleg.setfLocation(1L);
+            } else {
+                tWhgenleg.setfLocation(0L);
+            }
+        }
+        List<WhgenlegVO> whgenlegVOList = tWhgenlegMapper.selectWhgenlegDetailsList(tWhgenleg);
+        if (CollectionUtils.isNotEmpty(whgenlegVOList)) {
+            List<WhgenlegVO> legVoList = new ArrayList<>();
+            Map<Long, List<WhgenlegVO>> mapById = whgenlegVOList.stream().collect(Collectors.groupingBy(WhgenlegVO::getfId));
+            mapById.forEach((key, value) -> {
+                WhgenlegVO whgenlegVO = new WhgenlegVO();
+                WhgenlegVO vo = value.stream().findFirst().orElseThrow(() -> new WarehouseException("缺少明细信息"));
+                BeanUtils.copyProperties(vo, whgenlegVO);
+                // 赋值字典表
+                whgenlegVO.setTrademodeName(DictUtils.getDictLabel("data_trademodes", whgenlegVO.getfTrademodeid().toString()));
+                // 数量
+                whgenlegVO.setQty(value.stream().map(WhgenlegVO::getQty).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
+                // 净重
+                whgenlegVO.setNetweight(value.stream().map(WhgenlegVO::getNetweight).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
+                // 毛重
+                whgenlegVO.setGrossweight(value.stream().map(WhgenlegVO::getGrossweight).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
+                legVoList.add(whgenlegVO);
+            });
+            return legVoList;
+        }
+        return whgenlegVOList;
+    }
+
+    /**
+     * app查询列表
+     *
+     * @param tWhgenleg 库存总账
+     * @return 库存总账集合
+     */
+    @Override
     public List<Map<String, Object>> selectInventoryMapList(TWhgenleg tWhgenleg) {
         if (StringUtils.isNotNull(tWhgenleg.getfWarehouseLocationid())) {
             // 获取仓库信息

+ 56 - 44
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/enums/WarehouseTypeEnum.java

@@ -18,98 +18,101 @@ public enum WarehouseTypeEnum {
     // 仓储业务类型
 
 
-    KCZZ("KCZZ", "库存总帐"),
+    KCZZ("KCZZ", "库存总帐", "storageType"),
 
-    SJRK("SJRK", "入库"),
+    SJRK("SJRK", "入库", "storageType"),
 
-    SJCK("SJCK", "出库"),
+    SJCK("SJCK", "出库", "storageType"),
 
-    HQZY("HQZY", "货转"),
+    HQZY("HQZY", "货转", "storageType"),
 
-    CKDB("CKDB", "调拨"),
+    CKDB("CKDB", "调拨", "storageType"),
 
-    HWTG("HWTG", "货物通关"),
+    HWTG("HWTG", "货物通关", "storageType"),
 
-    SJRK_REVOKE("SJRKRevoke", "撤销入库"),
+    SJRK_REVOKE("SJRKRevoke", "撤销入库", "storageType"),
 
-    SJCK_REVOKE("SJCKRevoke", "撤销出库"),
+    SJCK_REVOKE("SJCKRevoke", "撤销出库", "storageType"),
 
-    CKDB_REVOKE("CKDBRevoke", "撤销调拨"),
+    CKDB_REVOKE("CKDBRevoke", "撤销调拨", "storageType"),
 
-    HWTG_REVOKE("HWTGRevoke", "撤销通关"),
+    HWTG_REVOKE("HWTGRevoke", "撤销通关", "storageType"),
 
-    HQZY_REVOKE("HQZYRevoke", "撤销货权转移"),
+    HQZY_REVOKE("HQZYRevoke", "撤销货权转移", "storageType"),
 
 
     //是否已计算仓储费
 
-    CALCULATE("T", "已计算"),
+    CALCULATE("T", "已计算", "storageFee"),
 
-    NOT_CALCULATE("F", "未计算"),
+    NOT_CALCULATE("F", "未计算", "storageFee"),
 
-    JSCCF("JSCCF", "计算仓储费"),
+    JSCCF("JSCCF", "计算仓储费", "storageFee"),
 
 
     // 状态
-    INIT("1", "新建"),
-    SAVE("2", "保存"),
-    DISMISS("3", "请核驳回"),
-    SUBMIT("4", "请核"),
-    UNDER_REVIEW("5", "请核中"),
-    APPROVE("6", "请核完成"),
+    INIT("1", "新建", "storageStatus"),
+    SAVE("2", "保存", "storageStatus"),
+    DISMISS("3", "请核驳回", "storageStatus"),
+    SUBMIT("4", "请核", "storageStatus"),
+    UNDER_REVIEW("5", "请核中", "storageStatus"),
+    APPROVE("6", "请核完成", "storageStatus"),
 
 
     // 仓库主表明细状态
-    DETAILED_STATUS_PLAN("1", "计划"),
-    DETAILED_STATUS_WAITING("2", "待xx"),
-    DETAILED_STATUS_PROCESSING("3", "xx中"),
-    DETAILED_STATUS_PROCESSED("4", "已xx"),
+    DETAILED_STATUS_PLAN("1", "计划", "itemStatus"),
+    DETAILED_STATUS_WAITING("2", "待xx", "itemStatus"),
+    DETAILED_STATUS_PROCESSING("3", "xx中", "itemStatus"),
+    DETAILED_STATUS_PROCESSED("4", "已xx", "itemStatus"),
 
 
     // 编号生成简写
 
-    SJRK_NO("RK", "费用变更"),
-    SJCK_NO("CK", "入库"),
-    CKDB_NO("DB", "出库"),
-    HQZY_NO("HZ", "货转"),
+    SJRK_NO("RK", "费用变更", "warehouseAbbreviation"),
+    SJCK_NO("CK", "入库", "warehouseAbbreviation"),
+    CKDB_NO("DB", "出库", "warehouseAbbreviation"),
+    HQZY_NO("HZ", "货转", "warehouseAbbreviation"),
 
-    FYBG_NO("FYBG", "费用变更"),
+    FYBG_NO("FYBG", "费用变更", "warehouseAbbreviation"),
 
 
     // 件数
-    BOX_NUM("1", "件"),
+    BOX_NUM("1", "件", "warehouseUnit"),
     // 毛重
-    GROSS_WEIGHT("2", "吨"),
+    GROSS_WEIGHT("2", "吨", "warehouseUnit"),
     // 净重
-    NET_WEIGHT("3", "吨"),
+    NET_WEIGHT("3", "吨", "warehouseUnit"),
     // 尺码
-    MEASURE("4", "吨"),
+    MEASURE("4", "吨", "warehouseUnit"),
     // 统一
-    FIXED("5", "吨"),
+    FIXED("5", "吨", "warehouseUnit"),
 
     // 是否计入库存总帐
-    INVENTORY("0", "计入库存总帐"),
-    NOT_INVENTORY("1", "计入库存总帐"),
+    INVENTORY("0", "计入库存总帐", "generalLedger"),
+    NOT_INVENTORY("1", "计入库存总帐", "generalLedger"),
 
     // 根据提单号、客户、仓库查询商品信息类型
-    BY_MBLNO("mblno", "根据提单号查询"),
-    BY_CPRP("corp", "根据客户查询"),
-    BY_WAREHOUSE("warehouse", "根据仓库查询"),
+    BY_MBLNO("mblno", "根据提单号查询", "queryType"),
+    BY_CPRP("corp", "根据客户查询", "queryType"),
+    BY_WAREHOUSE("warehouse", "根据仓库查询", "queryType"),
 
 
     // 查询库存帐操作
-    CONFIRM_OPERATION("0", "确认入库、出库、货转、调拨"),
-    UNDO_OPERATION("1", "撤回入库、出库、货转、调拨"),
+    CONFIRM_OPERATION("0", "确认入库、出库、货转、调拨", "queryType"),
+    UNDO_OPERATION("1", "撤回入库、出库、货转、调拨", "queryType"),
 
     // 是否判断箱型
-    JUDGE_BOX("1", "判断箱型"),
-    NOT_JUDGE_BOX("0", "非判断箱型"),
+    JUDGE_BOX("1", "判断箱型", "judge"),
+    NOT_JUDGE_BOX("0", "非判断箱型", "judge"),
 
 
     ;
-
+    // 值
     private final String type;
+    // 名称
     private final String name;
+    // 业务
+    private final String businessType;
 
     public static WarehouseTypeEnum fromType(String tp) {
         for (WarehouseTypeEnum type : WarehouseTypeEnum.values()) {
@@ -120,6 +123,15 @@ public enum WarehouseTypeEnum {
         throw new IllegalArgumentException("warehouse type not exist");
     }
 
+    public static WarehouseTypeEnum fromTypeAndBusinessType(String tp, String businessTyoe) {
+        for (WarehouseTypeEnum type : WarehouseTypeEnum.values()) {
+            if (Objects.equals(type.getType(), tp) && businessTyoe.equals(type.getBusinessType())) {
+                return type;
+            }
+        }
+        throw new IllegalArgumentException("warehouse type not exist");
+    }
+
     // 获取业务类型集合
     public static List<String> getWarehousingType() {
         List<String> typList = new ArrayList<>();

+ 6 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehouseBillsMapper.java

@@ -279,4 +279,10 @@ public interface TWarehouseBillsMapper extends BaseMapper<TWarehouseBills> {
      */
     List<WarehouseBillsVO> selectWhgenlegDetailById(Long id);
 
+    /**
+     *  计算仓储费列表
+     * @param tWarehousebills
+     * @return
+     */
+    List<Map<String, Object>> selecStorageFeeList(TWarehouseBills tWarehousebills);
 }

+ 2 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseAgreementServiceImpl.java

@@ -457,6 +457,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
                 this.tWarehouseAgreementitemsMapper.getItemsBytWarehouseAgreementMsg(storageFeesDto.getfCorpid(),
                         storageFeesDto.getfGoodsid(),
                         String.valueOf(storageFeesDto.getWarehouseId()), storageFeesDto.getCangKey());
+        // 如果未找到计费规则 则抛出异常
         if (CollUtil.isEmpty(itemList)) {
             throw new WarehouseException("编号" + storageFeesDto.getfMblno() + "未找到计费规则");
         }
@@ -496,7 +497,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
                 dayLength -= storageFeesDto.getEarlySumDays();
                 storageFeesDto.setEarlySumDays(0L);
                 feeId = tWarehouseAgreementitems.getfFeeid();
-                // 数量 * 单价 * 天数
+                // 获取最终金额:数量 * 单价 * 天数
                 BigDecimal calculate = this.getCalculate(qty, tWarehouseAgreementitems.getfPrice(), dayLength);
                 money = money.add(calculate);
 

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

@@ -409,7 +409,15 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
      */
     @Override
     public List<Map<String, Object>> selectWarehouseBusinessList(TWarehouseBills tWarehousebills) {
-        if (tWarehousebills.getfBilltype().equals(WarehouseTypeEnum.JSCCF.getType()) || tWarehousebills.getfBilltype().equals(WarehouseTypeEnum.HQZY.getType())) {
+        if (tWarehousebills.getfBilltype().equals(WarehouseTypeEnum.JSCCF.getType())) {
+            List<Map<String, Object>> mapList = tWarehouseBillsMapper.selecStorageFeeList(tWarehousebills);
+            if (CollectionUtils.isNotEmpty(mapList)) {
+                mapList.forEach(li -> {
+                    li.put("fBillstatus", WarehouseTypeEnum.fromTypeAndBusinessType(li.get("fBillstatus").toString(), "storageStatus").getName());
+                });
+            }
+            return mapList;
+        } else if (tWarehousebills.getfBilltype().equals(WarehouseTypeEnum.HQZY.getType())) {
             return tWarehouseBillsMapper.selectWarehouseBusinessList1(tWarehousebills);
         } else {
             return tWarehouseBillsMapper.selectWarehouseBusinessList(tWarehousebills);
@@ -3632,7 +3640,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             if (Objects.isNull(tWhgenle)) {
                 throw new WarehouseException("库存明细第" + i + "行找不到库存信息");
             }
-            if (wbItem.getfBsdate().before(tWarehouseBills.getfChargedate())) {
+            if (wbItem.getfBsdate().before(tWhgenle.getfChargedate())) {
                 throw new WarehouseException("业务日期不得超出库存总帐日期");
             }
             //  入库数特殊不判断入账
@@ -7122,7 +7130,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         }
         // 查询总账是否存在
         TWhgenleg tWhgenle = queryTWhgenleg(warehousebillsDTO, item, goods.getIfCntrno());
-        if (Objects.nonNull(tWhgenle) && item.getfBsdate().before(item.getfChargedate())) {
+        if (Objects.nonNull(tWhgenle) && item.getfBsdate().before(tWhgenle.getfChargedate())) {
             throw new WarehouseException("出库明细第" + line + "行业务日期不得超出库存总帐日期");
         }
         if (Objects.isNull(tWhgenle)) {

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

@@ -46,7 +46,7 @@
         <result property="fCustomno" column="f_customno"/>
     </resultMap>
 
-    <resultMap type="com.ruoyi.warehouseBusiness.domain.vo.CalculateStorageFeesInfoVO" id="StorageFeesInfoResult">
+    <resultMap type="CalculateStorageFeesInfoVO" id="StorageFeesInfoResult">
         <result property="fId" column="f_id"/>
         <result property="warehouse" column="f_warehouseid"/>
         <result property="fBillno" column="f_billno"/>
@@ -73,6 +73,19 @@
         <result property="goodsName" column="goods_name"/>
     </resultMap>
 
+    <resultMap type="whgenlegVO" id="WhgenlegInfoResult">
+        <result property="fId" column="f_id"/>
+        <result property="corpName" column="corp_name"/>
+        <result property="fMblno" column="f_mblno"/>
+        <result property="fBusinessType" column="f_business_type"/>
+        <result property="fMarks" column="f_marks"/>
+        <result property="fBsdate" column="f_bsdate"/>
+        <result property="fTrademodeid" column="f_trademodeid"/>
+        <result property="qty" column="f_qty"/>
+        <result property="grossweight" column="f_netweight"/>
+        <result property="netweight" column="f_grossweight"/>
+    </resultMap>
+
     <sql id="selectTWhgenlegVo">
         select f_id, f_accyear, f_accmonth, f_corpid, f_mblno, f_originalbillno, f_warehouse_locationid, f_goodsid, f_trademodeid, f_preqty,
          f_pregrossweight, f_warehouseid, f_prenetweight, f_bsdate, f_chargedate, f_volumnD, f_qtyD, f_billingway, f_grossweightD, f_netweightD, f_volumnC,
@@ -1003,5 +1016,25 @@
         </foreach>
     </select>
 
+    <select id="selectWhgenlegDetailsList" resultMap="WhgenlegInfoResult">
+        SELECT
+            w.f_id,
+            c.f_name corp_name,
+            item.f_mblno,
+            item.f_business_type,
+            item.f_marks,
+            item.f_bsdate,
+            w.f_trademodeid,
+            item.f_qty,
+            item.f_grossweight,
+            item.f_netweight
+        FROM
+            t_warehousebills w
+                LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
+                LEFT JOIN t_corps c ON c.f_id = w.f_corpid
+        WHERE
+            item.f_srcid = #{fId}
+    </select>
+
 
 </mapper>

+ 102 - 79
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -405,89 +405,89 @@
             <if test="fNewTrademodeid != null ">and bill.f_new_trademodeid = #{fNewTrademodeid}</if>
         </where>
         ${params.dataScope}
-        ORDER BY bill.f_id DESC, bill.f_bstime DESC,bill.f_id DESC,bill.f_billstatus
+        ORDER BY bill.f_bsdate DESC, bill.f_bstime DESC,bill.f_id DESC,bill.f_billstatus
     </select>
 
     <select id="selectWarehouseBusinessList1" parameterType="TWarehousebills" resultType="Map">
         SELECT
-        DISTINCT
-        bill.f_id AS fId,
-        corp.f_name AS fCorpid,
-        corpTo.f_name AS fTocorpid,
-        bill.f_mblno AS fMblno,
-        corpSub.f_name AS fSbu,
-        bill.f_marks AS fMarks,
-        bill.remark AS remark,
-        bill.f_planqty AS fPlanqty,
-        bill.f_plangrossweight AS fPlangrossweight,
-        bill.f_plannetweight AS fPlannetweight,
-        bill.f_planvolumn AS fPlanvolumn,
-        bill.f_bsdate AS fBsdate,
-        dict.dict_label AS fTrademodeid,
-        bill.f_truckno AS fTruckno,
-        bill.f_driver_name AS fDriverName,
-        bill.f_driver_tel AS fDriverTel,
-        bill.f_driver_id_car AS fDriverIdCar,
-        ware.f_name AS fWarehouseid,
-        bill.f_qty AS fQty,
-        bill.f_cntval AS fCntval,
-        bill.f_chargetype AS fChargetype,
-        bill.f_netweight AS fNetweight,
-        bill.create_time AS createTime,
-        ware1.f_name AS fInwarehouseid,
-        bill.create_by AS createBy,
-        bill.f_grossweight AS fGrossweight,
-        bill.f_product_name AS fProductName,
-        bill.f_billing_deadline AS fBillingDeadline,
-        bill.free_container_date AS freeContainerDate,
-        CASE
-        WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '1' THEN '录入'
-        WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '2' THEN '暂存'
-        WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '3' THEN '驳回'
-        WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '4' THEN '请核'
-        WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '5' THEN '审核中'
-        WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '6' THEN '全部入账'
-        WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '1' THEN '新建'
-        WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '2' THEN '暂存'
-        WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '3' THEN '审核驳回'
-        WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '4' THEN '提交审核'
-        WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '5' THEN '审核中'
-        WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '6' THEN '审核通过'
-        END
-        AS fBillstatus,
-        CASE
-        WHEN bill.f_billtype = 'HQZY'
-        AND bill.f_items_status = '1' THEN
-        '计划'
-        WHEN bill.f_billtype = 'HQZY'
-        AND bill.f_items_status = '2' THEN
-        '待货转'
-        WHEN bill.f_billtype = 'HQZY'
-        AND bill.f_items_status = '3' THEN
-        '货转中'
-        WHEN bill.f_billtype = 'HQZY'
-        AND bill.f_items_status = '4' THEN
-        '已货转'
-        END
-        AS fItemsStatus,
-        bill.f_billno AS fBillno,
-        g.f_name AS fGoodsid,
-        bill.f_storekeeper AS fStorekeeper,
-        bill.f_remarks_fees AS fRemarksFees
+            DISTINCT
+            bill.f_id AS fId,
+            corp.f_name AS fCorpid,
+            corpTo.f_name AS fTocorpid,
+            bill.f_mblno AS fMblno,
+            corpSub.f_name AS fSbu,
+            bill.f_marks AS fMarks,
+            bill.remark AS remark,
+            bill.f_planqty AS fPlanqty,
+            bill.f_plangrossweight AS fPlangrossweight,
+            bill.f_plannetweight AS fPlannetweight,
+            bill.f_planvolumn AS fPlanvolumn,
+            bill.f_bsdate AS fBsdate,
+            dict.dict_label AS fTrademodeid,
+            bill.f_truckno AS fTruckno,
+            bill.f_driver_name AS fDriverName,
+            bill.f_driver_tel AS fDriverTel,
+            bill.f_driver_id_car AS fDriverIdCar,
+            ware.f_name AS fWarehouseid,
+            bill.f_qty AS fQty,
+            bill.f_cntval AS fCntval,
+            bill.f_chargetype AS fChargetype,
+            bill.f_netweight AS fNetweight,
+            bill.create_time AS createTime,
+            ware1.f_name AS fInwarehouseid,
+            bill.create_by AS createBy,
+            bill.f_grossweight AS fGrossweight,
+            bill.f_product_name AS fProductName,
+            bill.f_billing_deadline AS fBillingDeadline,
+            bill.free_container_date AS freeContainerDate,
+            CASE
+            WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '1' THEN '录入'
+            WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '2' THEN '暂存'
+            WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '3' THEN '驳回'
+            WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '4' THEN '请核'
+            WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '5' THEN '审核中'
+            WHEN bill.f_billtype = 'HQZY' AND bill.f_billstatus = '6' THEN '全部入账'
+            WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '1' THEN '新建'
+            WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '2' THEN '暂存'
+            WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '3' THEN '审核驳回'
+            WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '4' THEN '提交审核'
+            WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '5' THEN '审核中'
+            WHEN bill.f_billtype = 'JSCCF' AND bill.f_billstatus = '6' THEN '审核通过'
+            END
+            AS fBillstatus,
+            CASE
+            WHEN bill.f_billtype = 'HQZY'
+            AND bill.f_items_status = '1' THEN
+            '计划'
+            WHEN bill.f_billtype = 'HQZY'
+            AND bill.f_items_status = '2' THEN
+            '待货转'
+            WHEN bill.f_billtype = 'HQZY'
+            AND bill.f_items_status = '3' THEN
+            '货转中'
+            WHEN bill.f_billtype = 'HQZY'
+            AND bill.f_items_status = '4' THEN
+            '已货转'
+            END
+            AS fItemsStatus,
+            bill.f_billno AS fBillno,
+            g.f_name AS fGoodsid,
+            bill.f_storekeeper AS fStorekeeper,
+            bill.f_remarks_fees AS fRemarksFees
         FROM
-        t_warehousebills bill
-        LEFT JOIN t_goods g ON g.f_id = bill.f_goodsid
-        left join sys_user u on bill.create_by = u.user_name
-        left join sys_user u1 on bill.f_storekeeper = u1.user_name
-        left join sys_dept d on bill.f_bsdeptid = d.dept_id
-        LEFT JOIN t_corps corp ON corp.f_id = bill.f_corpid
-        LEFT JOIN t_corps corpTo ON corpTo.f_id = bill.f_tocorpid
-        LEFT JOIN t_corps corpSub ON corpSub.f_id = bill.f_sbu
-        LEFT JOIN t_warehouse ware ON ware.f_id = bill.f_warehouseid
-        LEFT JOIN t_warehouse ware1 ON ware1.f_id = bill.f_inwarehouseid
-        LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
-        LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
-        LEFT JOIN sys_dict_data dict ON dict.dict_value = bill.f_trademodeid
+            t_warehousebills bill
+            LEFT JOIN t_goods g ON g.f_id = bill.f_goodsid
+            left join sys_user u on bill.create_by = u.user_name
+            left join sys_user u1 on bill.f_storekeeper = u1.user_name
+            left join sys_dept d on bill.f_bsdeptid = d.dept_id
+            LEFT JOIN t_corps corp ON corp.f_id = bill.f_corpid
+            LEFT JOIN t_corps corpTo ON corpTo.f_id = bill.f_tocorpid
+            LEFT JOIN t_corps corpSub ON corpSub.f_id = bill.f_sbu
+            LEFT JOIN t_warehouse ware ON ware.f_id = bill.f_warehouseid
+            LEFT JOIN t_warehouse ware1 ON ware1.f_id = bill.f_inwarehouseid
+            LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
+            LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
+            LEFT JOIN sys_dict_data dict ON dict.dict_value = bill.f_trademodeid
         <where>
             dict.status = '0'
             AND dict.dict_type = 'data_trademodes'
@@ -564,7 +564,7 @@
             <if test="fNewTrademodeid != null ">and bill.f_new_trademodeid = #{fNewTrademodeid}</if>
         </where>
         ${params.dataScope}
-        ORDER BY bill.f_id DESC, bill.f_bstime DESC,bill.f_id DESC,bill.f_billstatus
+        ORDER BY bill.f_bsdate DESC, bill.f_bstime DESC,bill.f_id DESC,bill.f_billstatus
     </select>
 
     <select id="selectTWarehousebillsById" parameterType="Long" resultMap="TWarehousebillsResult">
@@ -2729,4 +2729,27 @@
             w.f_id
     </select>
 
+    <select id="selecStorageFeeList" resultType="Map">
+        SELECT DISTINCT w.f_id AS fId, w.f_billno AS fBillno, corp.f_name AS fCorpid, w.f_billing_deadline AS fBillingDeadline, w.remark,
+                        w.f_billstatus AS fBillstatus, w.create_by AS createBy, w.create_time AS createTime
+        FROM t_warehousebills w LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
+            LEFT JOIN t_corps corp ON corp.f_id = w.f_corpid
+            left join sys_user u on w.create_by = u.user_name
+            left join sys_user u1 on w.f_storekeeper = u1.user_name
+            left join sys_dept d on w.f_bsdeptid = d.dept_id
+        <where>
+            w.f_billtype = 'JSCCF'
+            <if test="fBillstatus != null and fBillstatus != ''">and w.f_billstatus = #{fBillstatus}</if>
+            <if test="fMarks != null and fMarks != ''">and w.f_marks = #{fMarks}</if>
+            <if test="createBy != null and createBy != ''">and w.create_by = #{createBy}</if>
+            <if test='timeInterval2 != null and timeInterval2[0] != null and timeInterval2[1]!= ""'>
+                and w.f_billing_deadline BETWEEN #{timeInterval2[0]} AND #{timeInterval2[1]}
+            </if>
+            <if test="fBillno != null and fBillno != ''">and w.f_billno like concat('%', #{fBillno}, '%')</if>
+            <if test="fMblno != null and fMblno != ''">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
+        </where>
+            ${params.dataScope}
+            ORDER BY w.f_bsdate DESC, w.f_bstime DESC,w.f_id DESC,w.f_billstatus
+    </select>
+
 </mapper>