Jelajahi Sumber

[CODE]: 仓储

maxianghua 4 tahun lalu
induk
melakukan
0cba7a87c3
20 mengubah file dengan 308 tambahan dan 11 penghapusan
  1. 12 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/agreement/TWarehouseAgreementitemsController.java
  2. 28 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/basicData/TWarehouseController.java
  3. 17 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TWarehouseMapper.java
  4. 18 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITWarehouseService.java
  5. 18 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseServiceImpl.java
  6. 26 0
      ruoyi-warehouse/src/main/java/com/ruoyi/finance/domain/TWareHouseFees.java
  7. 20 0
      ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java
  8. 11 0
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/domain/TWhgenleg.java
  9. 10 0
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java
  10. 12 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehousebillsfees.java
  11. 2 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehouseAgreementitemsMapper.java
  12. 2 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseAgreementitemsService.java
  13. 6 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseAgreementitemsServiceImpl.java
  14. 10 1
      ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml
  15. 63 2
      ruoyi-warehouse/src/main/resources/mapper/finance/TFeeMapper.xml
  16. 9 3
      ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml
  17. 37 0
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehouseAgreementitemsMapper.xml
  18. 2 1
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml
  19. 4 1
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml
  20. 1 1
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsitemsMapper.xml

+ 12 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/agreement/TWarehouseAgreementitemsController.java

@@ -7,6 +7,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseAgreementitems;
+import com.ruoyi.warehouseBusiness.dto.TWarehouseAgreementitem;
 import com.ruoyi.warehouseBusiness.service.ITWarehouseAgreementitemsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -39,6 +40,17 @@ public class TWarehouseAgreementitemsController extends BaseController {
     }
 
     /**
+     * 查询仓储费明细表列表
+     */
+    @GetMapping("/warehousebills/list")
+    public TableDataInfo list(TWarehouseAgreementitem tWarehouseAgreementitem) {
+        startPage();
+        List<Map<String, Object>> list = tWarehouseAgreementitemsService.selectTWarehouseAgreementitemList(tWarehouseAgreementitem);
+        return getDataTable(list);
+    }
+
+
+    /**
      * 导出仓储费明细表列表
      */
     @PreAuthorize("@ss.hasPermi('warehouseBusiness:agreementitems:export')")

+ 28 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/basicData/TWarehouseController.java

@@ -151,7 +151,7 @@ public class TWarehouseController extends BaseController {
         return tWarehouseService.updateTWarehouse(tWarehouse);
     }*/
 
-    @PreAuthorize("@ss.hasPermi('system:dept:edit')")
+    @PreAuthorize("@ss.hasPermi('basicdata:warehouse:edit')")
     @PutMapping
     @RepeatSubmit
     public AjaxResult edit(@Validated @RequestBody TWarehouse tWarehouse) {
@@ -166,14 +166,40 @@ public class TWarehouseController extends BaseController {
     /**
      * 删除仓库
      */
-    @PreAuthorize("@ss.hasPermi('basicdata:warehouse:remove')")
+    /*@PreAuthorize("@ss.hasPermi('basicdata:warehouse:remove')")
     @Log(title = "仓库", businessType = BusinessType.DELETE)
     @DeleteMapping("/{fIds}")
     @RepeatSubmit
     public AjaxResult remove(@PathVariable Long[] fIds) {
         return tWarehouseService.deleteTWarehouseByIds(fIds);
+    }*/
+
+    /**
+     * 删除仓库
+     */
+    @PreAuthorize("@ss.hasPermi('basicdata:warehouse:remove')")
+    @Log(title = "部门管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{fId}")
+    @RepeatSubmit
+    public AjaxResult removeWarehouse(@PathVariable Long fId) {
+        if (tWarehouseService.hasChildByfId(fId)) {
+            return AjaxResult.error("存在下级,不允许删除");
+        }
+        // 获取仓库信息
+        TWarehouse tWarehouse = tWarehouseService.selectTWarehouseById(fId);
+        if(tWarehouse.getfLocation()==1){ // 库位
+            if (tWarehouseService.checkDeptExistWarehouseItems(fId)) {
+                return AjaxResult.error("库位存在货物,不允许删除");
+            }
+        } else if (tWarehouse.getParentId() == 100){ //  仓库
+            if (tWarehouseService.checkDeptExistWarehouse(fId)) {
+                return AjaxResult.error("仓库存在货物,不允许删除");
+            }
+        }
+        return toAjax(tWarehouseService.deleteTWarehouseById(fId));
     }
 
+
     /**
      * 获取部门下拉树列表
      */

+ 17 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TWarehouseMapper.java

@@ -134,4 +134,21 @@ public interface TWarehouseMapper {
     public BigDecimal selectTWarehouseFTotalgross(Long fId);
 
     public TWarehouse checkDeptNameUnique(@Param("fName") String deptName, @Param("parentId") Long parentId);
+
+    /**
+     * 是否存在子节点
+     *
+     * @param fId 部门ID
+     * @return 结果
+     */
+    public int hasChildByfId(Long fId);
+
+    /**
+     * 查询部门是否存在用户
+     *
+     * @param fId 部门ID
+     * @return 结果
+     */
+    public int checkDeptExistarehouse(Long fId);
+    public int checkDeptExistWarehouseItems(Long fId);
 }

+ 18 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITWarehouseService.java

@@ -132,4 +132,22 @@ public interface ITWarehouseService {
 
     public String checkNameUnique(TWarehouse tWarehouse);
 
+    /**
+     * 是否存在部门子节点
+     *
+     * @param fId 部门ID
+     * @return 结果
+     */
+    public boolean hasChildByfId(Long fId);
+
+    /**
+     * 查询部门是否存在用户
+     *
+     * @param deptId 部门ID
+     * @return 结果 true 存在 false 不存在
+     */
+    public boolean checkDeptExistWarehouse(Long deptId);
+    public boolean checkDeptExistWarehouseItems(Long deptId);
+
+
 }

+ 18 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseServiceImpl.java

@@ -305,6 +305,24 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
     }
 
     @Override
+    public boolean hasChildByfId(Long fId) {
+        int result = tWarehouseMapper.hasChildByfId(fId);
+        return result > 0 ? true : false;
+    }
+
+    @Override
+    public boolean checkDeptExistWarehouse(Long deptId) {
+        int result = tWarehouseMapper.checkDeptExistarehouse(deptId);
+        return result > 0 ? true : false;
+    }
+
+    @Override
+    public boolean checkDeptExistWarehouseItems(Long deptId) {
+        int result = tWarehouseMapper.checkDeptExistWarehouseItems(deptId);
+        return result > 0 ? true : false;
+    }
+
+    @Override
     public String checkUFNoUnique(TWarehouse tWarehouse) {
         TWarehouse tWarehouse1 = tWarehouseMapper.checkFNoUnique(tWarehouse.getfNo());
         if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId()!=tWarehouse.getfId()) {

+ 26 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/domain/TWareHouseFees.java

@@ -80,6 +80,16 @@ public class TWareHouseFees {
     @Excel(name = "明细品名合计")
     private String fProductName;
 
+    /** 业务类型(存汉字的,用来区别 如: 来车提货,出库装箱  区别) */
+    @Excel(name = "业务类型(存汉字的,用来区别 如: 来车提货,出库装箱  区别)")
+    private Long []  fBusinessType;
+
+    /**
+     * 单据类型(数据字典)SJRK(入库) SJCK(实际出库) CKDB(调拨) HQZY(货权转移)
+     */
+    @Excel(name = "单据类型(数据字典)SJRK", readConverterExp = "入=库")
+    private String fBilltype;
+
     /**
      * 查询时间区间 审核日期
      */
@@ -214,4 +224,20 @@ public class TWareHouseFees {
     public void setfReconciliation(String fReconciliation) {
         this.fReconciliation = fReconciliation;
     }
+
+    public Long[] getfBusinessType() {
+        return fBusinessType;
+    }
+
+    public void setfBusinessType(Long[] fBusinessType) {
+        this.fBusinessType = fBusinessType;
+    }
+
+    public String getfBilltype() {
+        return fBilltype;
+    }
+
+    public void setfBilltype(String fBilltype) {
+        this.fBilltype = fBilltype;
+    }
 }

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

@@ -119,6 +119,25 @@ public class TFeeServiceImpl implements ITFeeService {
                 sysDictData.setDictValue(String.valueOf(tWarehousebillsfees.getfFeeunitid()));
                 sysDictData.setStatus("0");
                 List<SysDictData> sysDictDataList = iSysDictDataService.selectDictDataList(sysDictData);
+
+                List<SysDictData> sysDictDataListIn = new ArrayList<>();
+                SysDictData sysDictDataIn =new SysDictData();
+                if(tWarehousebillsfees.getfBilltype().equals("SJRK")){
+                    sysDictData.setDictType("st_in_type");
+                    sysDictData.setDictValue(String.valueOf(tWarehousebillsfees.getfFeeunitid()));
+                    sysDictData.setStatus("0");
+                    sysDictDataListIn = iSysDictDataService.selectDictDataList(sysDictData);
+                } else if (tWarehousebillsfees.getfBilltype().equals("SJCK")){
+                    sysDictData.setDictType("st_out_type");
+                    sysDictData.setDictValue(String.valueOf(tWarehousebillsfees.getfFeeunitid()));
+                    sysDictData.setStatus("0");
+                    sysDictDataListIn = iSysDictDataService.selectDictDataList(sysDictData);
+                } else if (tWarehousebillsfees.getfBilltype().equals("HQZY")){
+                    sysDictData.setDictType("st_trans_type");
+                    sysDictData.setDictValue(String.valueOf(tWarehousebillsfees.getfFeeunitid()));
+                    sysDictData.setStatus("0");
+                    sysDictDataListIn = iSysDictDataService.selectDictDataList(sysDictData);
+                }
                 map1.put("fId",fees.getfId());
                 map1.put("fSrcid",fees.getfSrcid());
                 map1.put("fSrcpid",fees.getfSrcpid());
@@ -141,6 +160,7 @@ public class TFeeServiceImpl implements ITFeeService {
                 map1.put("fFeeunitid",sysDictDataList.get(0).getDictLabel());
                 map1.put("fQty",tWarehousebillsfees.getfQty());
                 map1.put("fUnitprice",tWarehousebillsfees.getfUnitprice());
+                map1.put("fBusinessType",sysDictDataListIn.get(0).getDictLabel());
                 if(tWarehousebills.getfBilltype().equals("SJRK")){
                     map1.put("fBilltype","入库");
                 } else if(tWarehousebills.getfBilltype().equals("SJCK")){

+ 11 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/domain/TWhgenleg.java

@@ -216,6 +216,10 @@ public class TWhgenleg extends BaseEntity {
      */
     private List<String> orgStorageDate;
 
+    /** 仓库 */
+    @Excel(name = "仓库")
+    private Long fLocation;
+
     public void setorgStorageDate(List<String> orgStorageDate) {
         this.orgStorageDate = orgStorageDate;
     }
@@ -629,6 +633,13 @@ public class TWhgenleg extends BaseEntity {
 
     }
 
+    public Long getfLocation() {
+        return fLocation;
+    }
+
+    public void setfLocation(Long fLocation) {
+        this.fLocation = fLocation;
+    }
 
     @Override
 

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

@@ -5,6 +5,7 @@ package com.ruoyi.reportManagement.service.impl;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.basicData.mapper.TWarehouseMapper;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
 import com.ruoyi.reportManagement.mapper.TWhgenlegMapper;
 import com.ruoyi.reportManagement.service.ITWhgenlegService;
@@ -72,6 +73,15 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
      */
     @Override
     public List<Map<String, Object>> selectInventoryList(TWhgenleg tWhgenleg) {
+        if(StringUtils.isNotNull(tWhgenleg.getfWarehouseLocationid())){
+            // 获取仓库信息
+            TWarehouse tWarehouse =  tWarehouseMapper.selectTWarehouseById(tWhgenleg.getfWarehouseLocationid());
+            if(tWarehouse.getfLocation()==1){
+                tWhgenleg.setfLocation(1L);
+            }else {
+                tWhgenleg.setfLocation(0L);
+            }
+        }
         return tWhgenlegMapper.selectInventoryList(tWhgenleg);
     }
 

+ 12 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehousebillsfees.java

@@ -269,6 +269,10 @@ public class TWarehousebillsfees extends BaseEntity {
     @Excel(name = "结算方式,默认提取corps中stltypeid	也可以从表t_stltypes中下拉选择,存储id,显示name")
     private Long fStltypeid;
 
+    /** 业务类型(存汉字的,用来区别 如: 来车提货,出库装箱  区别) */
+    @Excel(name = "业务类型(存汉字的,用来区别 如: 来车提货,出库装箱  区别)")
+    private String fBusinessType;
+
     public void setfId(Long fId) {
         this.fId = fId;
     }
@@ -605,6 +609,14 @@ public class TWarehousebillsfees extends BaseEntity {
         this.fStltypeid = fStltypeid;
     }
 
+    public String getfBusinessType() {
+        return fBusinessType;
+    }
+
+    public void setfBusinessType(String fBusinessType) {
+        this.fBusinessType = fBusinessType;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 2 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehouseAgreementitemsMapper.java

@@ -2,6 +2,7 @@ package com.ruoyi.warehouseBusiness.mapper;
 
 
 import com.ruoyi.warehouseBusiness.domain.TWarehouseAgreementitems;
+import com.ruoyi.warehouseBusiness.dto.TWarehouseAgreementitem;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -32,6 +33,7 @@ public interface TWarehouseAgreementitemsMapper {
 
     public List<Map<String, Object>> selectTWarehouseAgreementitemsList1(TWarehouseAgreementitems tWarehouseAgreementitems);
 
+    public List<Map<String, Object>> selectTWarehouseAgreementitemList(TWarehouseAgreementitem tWarehouseAgreementitem);
     /**
      * 新增仓储费明细表
      *

+ 2 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseAgreementitemsService.java

@@ -2,6 +2,7 @@ package com.ruoyi.warehouseBusiness.service;
 
 
 import com.ruoyi.warehouseBusiness.domain.TWarehouseAgreementitems;
+import com.ruoyi.warehouseBusiness.dto.TWarehouseAgreementitem;
 
 import java.util.List;
 import java.util.Map;
@@ -29,6 +30,7 @@ public interface ITWarehouseAgreementitemsService {
      */
     public List<TWarehouseAgreementitems> selectTWarehouseAgreementitemsList(TWarehouseAgreementitems tWarehouseAgreementitems);
     public List<Map<String, Object>> selectTWarehouseAgreementitemsList1(TWarehouseAgreementitems tWarehouseAgreementitems);
+    public List<Map<String, Object>> selectTWarehouseAgreementitemList(TWarehouseAgreementitem tWarehouseAgreementitem);
 
     /**
      * 新增仓储费明细表

+ 6 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseAgreementitemsServiceImpl.java

@@ -3,6 +3,7 @@ package com.ruoyi.warehouseBusiness.service.impl;
 
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseAgreementitems;
+import com.ruoyi.warehouseBusiness.dto.TWarehouseAgreementitem;
 import com.ruoyi.warehouseBusiness.mapper.TWarehouseAgreementitemsMapper;
 import com.ruoyi.warehouseBusiness.service.ITWarehouseAgreementitemsService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,6 +50,11 @@ public class TWarehouseAgreementitemsServiceImpl implements ITWarehouseAgreement
         return tWarehouseAgreementitemsMapper.selectTWarehouseAgreementitemsList1(tWarehouseAgreementitems);
     }
 
+    @Override
+    public List<Map<String, Object>> selectTWarehouseAgreementitemList(TWarehouseAgreementitem tWarehouseAgreementitem) {
+        return tWarehouseAgreementitemsMapper.selectTWarehouseAgreementitemList(tWarehouseAgreementitem);
+    }
+
     /**
      * 新增仓储费明细表
      *

+ 10 - 1
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -211,5 +211,14 @@
         <include refid="selectTWarehouseVo"/>
         where f_name=#{fName} and parent_id = #{parentId} limit 1
     </select>
-
+    <select id="hasChildByfId" parameterType="Long" resultType="int">
+        select count(1) from t_warehouse
+        where del_flag = '0' and parent_id = #{fId} limit 1
+    </select>
+    <select id="checkDeptExistarehouse" parameterType="Long" resultType="int">
+        select count(1) from t_warehousebills where f_warehouseid = #{fId} and del_flag = '0'
+    </select>
+    <select id="checkDeptExistWarehouseItems" parameterType="Long" resultType="int">
+        select count(1) from t_warehousebillsitems where f_warehouselocid = #{fId} and del_flag = '0'
+    </select>
 </mapper>

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

@@ -217,7 +217,8 @@
             f.f_name AS fFeeName,
             w.f_dc AS fSrcdc,
             ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr,
-            ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt
+            ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt,
+            dictIn.dict_label AS fBusinessType
         FROM
             t_warehousebills t
             LEFT JOIN t_corps c ON c.f_id = t.f_corpid
@@ -257,6 +258,8 @@
                 f.f_marks,
                 f.f_billing_deadline,
                 f.f_originalbilldate,
+                f.f_billtype,
+                f.f_business_type,
                 c.f_id AS fId,
                 c.f_name AS fName
             FROM
@@ -264,6 +267,7 @@
                 LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
             ) w ON w.f_pid = t.f_id
             LEFT JOIN t_fees f ON w.f_feeid = f.f_id
+            LEFT JOIN sys_dict_data dictIn ON dictIn.dict_value = w.f_business_type
         <where>
             <if test="map.tWareHouseFees.fCorpid != null  and map.tWareHouseFees.fCorpid != ''">and t.f_corpid = #{map.tWareHouseFees.fCorpid} </if>
             <if test="map.tWareHouseFees.fToCorpid != null  and map.tWareHouseFees.fToCorpid != ''">and w.f_corpid = #{map.tWareHouseFees.fToCorpid} </if>
@@ -307,6 +311,34 @@
             <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[1] != null and map.tWareHouseFees.timeReconci[1]!= ""'>
                 and w.f_accamount_date &lt;= #{map.tWareHouseFees.timeReconci[1]}
             </if>
+
+            <if test="map.tWareHouseFees.fBilltype != null  and map.tWareHouseFees.fBilltype == 'SJRK'">
+                and w.f_billtype = #{map.tWareHouseFees.fBilltype}
+                AND dictIn.dict_type = 'st_in_type'
+                AND dictIn.status = '0'
+            </if>
+
+            <if test="map.tWareHouseFees.fBilltype != null  and map.tWareHouseFees.fBilltype == 'SJCK'">
+                and w.f_billtype = #{map.tWareHouseFees.fBilltype}
+                AND dictIn.dict_type = 'st_out_type'
+                AND dictIn.status = '0'
+            </if>
+
+            <if test="map.tWareHouseFees.fBilltype != null  and map.tWareHouseFees.fBilltype == 'HQZY'">
+                and w.f_billtype = #{map.tWareHouseFees.fBilltype}
+                AND dictIn.dict_type = 'st_trans_type'
+                AND dictIn.status = '0'
+            </if>
+
+            <if test="map.tWareHouseFees.fBusinessType != null  and map.tWareHouseFees.fBusinessType != '' ">
+                and  w.f_business_type in
+                <foreach collection="map.tWareHouseFees.fBusinessType" item="id" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
+            </if>
+
+
+
             and  t.f_review_date IS NOT NULL
             and  ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) > 0
         </where>
@@ -339,7 +371,8 @@
             ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt,
             dict.dict_label AS fFeeunitid,
             w.f_qty AS fQty ,
-            w.f_unitprice AS  fUnitprice
+            w.f_unitprice AS  fUnitprice ,
+            dictIn.dict_label AS fBusinessType
         FROM
             t_warehousebills t
             LEFT JOIN t_corps c ON c.f_id = t.f_corpid
@@ -380,6 +413,7 @@
                     f.src_bill_no,
                     f.f_billtype,
                     f.f_marks,
+                    f.f_business_type,
                     c.f_id AS fId,
                     c.f_name AS fName
                 FROM
@@ -388,6 +422,7 @@
                 ) w ON w.f_pid = t.f_id
             LEFT JOIN t_fees f ON w.f_feeid = f.f_id
             LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_feeUnitid
+            LEFT JOIN sys_dict_data dictIn ON dictIn.dict_value = w.f_business_type
         <where>
             dict.status = '0'
             AND dict.dict_type = 'data_unitfees'
@@ -433,6 +468,32 @@
             <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[1] != null and map.tWareHouseFees.timeReconci[1]!= ""'>
                 and w.f_accamount_date &lt;= #{map.tWareHouseFees.timeReconci[1]}
             </if>
+
+            <if test="map.tWareHouseFees.fBilltype != null  and map.tWareHouseFees.fBilltype == 'SJRK'">
+                and w.f_billtype = #{map.tWareHouseFees.fBilltype}
+                AND dictIn.dict_type = 'st_in_type'
+                AND dictIn.status = '0'
+             </if>
+
+            <if test="map.tWareHouseFees.fBilltype != null  and map.tWareHouseFees.fBilltype == 'SJCK'">
+                and w.f_billtype = #{map.tWareHouseFees.fBilltype}
+                AND dictIn.dict_type = 'st_out_type'
+                AND dictIn.status = '0'
+            </if>
+
+            <if test="map.tWareHouseFees.fBilltype != null  and map.tWareHouseFees.fBilltype == 'HQZY'">
+                and w.f_billtype = #{map.tWareHouseFees.fBilltype}
+                AND dictIn.dict_type = 'st_trans_type'
+                AND dictIn.status = '0'
+            </if>
+
+            <if test="map.tWareHouseFees.fBusinessType != null  and map.tWareHouseFees.fBusinessType != '' ">
+                and  w.f_business_type in
+                <foreach collection="map.tWareHouseFees.fBusinessType" item="id" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
+            </if>
+
             and  t.f_review_date IS NOT NULL
             and  ifnull(w.f_amount, 0) - ifnull(w.f_accamount, 0) > 0
         </where>

+ 9 - 3
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -136,7 +136,6 @@
             <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
             <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
             <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
-            <if test="fWarehouseLocationid != null ">and leg.f_warehouse_locationid = #{fWarehouseLocationid}</if>
             <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
             <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
             <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
@@ -151,8 +150,15 @@
             <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
             <if test="fCntrno != null  and fCntrno != ''">and leg.f_cntrno = #{fCntrno}</if>
             <if test="fStatus != null  and fStatus != ''">and leg.f_status = #{fStatus}</if>
-            <if test="fWarehouseid != null ">and ware.ancestors  LIKE  concat('%', #{fWarehouseid}, '%') </if>
-            <if test="fWarehouseLocationid != null ">and ware.f_id  #{fWarehouseLocationid} </if>
+            <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
+
+            <if test="fLocation != null  and fLocation ==1 ">
+                and leg.f_warehouse_locationid = #{fWarehouseLocationid}
+            </if>
+            <if test="fLocation != null  and fLocation ==0 ">
+                and ware.ancestors  LIKE  concat('%', #{fWarehouseLocationid}, '%')
+            </if>
+
         </where>
     </select>
 

+ 37 - 0
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehouseAgreementitemsMapper.xml

@@ -140,6 +140,43 @@
         </where>
     </select>
 
+    <select id="selectTWarehouseAgreementitemList" resultType="java.util.Map">
+        SELECT DISTINCT
+        agre.f_id AS fId,
+        corp.f_name AS fCorpname,
+        corp.f_id AS fCorpid,
+        fee.f_name AS  fName,
+        fee.f_id AS feeFId,
+        itme.f_feeUnitid AS fFeeUnitid,
+        f_price AS fPrice
+        FROM
+        t_warehouse_agreement agre
+        LEFT JOIN t_corps corp ON corp.f_id = agre.f_corpid
+        LEFT JOIN t_warehouse_agreementitems itme ON itme.f_pid = agre.f_id
+        LEFT JOIN t_fees fee ON fee.f_id = itme.f_feeid
+        Left JOIN t_goods goods ON goods.f_typeid = agre.t_packages
+        <where>
+            <if test="fCorpid != null  and fCorpid != ''">
+                and corp.f_id = #{fCorpid}
+                and agre.f_dc = 'D'
+            </if>
+            <if test="fFeeid != null  and fFeeid != ''">and goods.f_id = #{fFeeid}</if>
+            <if test="fFleet != null  and fFleet != ''">
+                 and corp.f_id = #{fFleet}
+                 and agre.f_dc = 'C'
+            </if>
+            <if test="fLabour != null  and fLabour != ''">
+                and corp.f_id = #{fLabour}
+                and agre.f_dc = 'C'
+            </if>
+            <if test="fTaskType != null  and fTaskType != ''">
+                and agre.f_task_type = #{fTaskType}
+            </if>
+            and agre.f_billstatus = 6
+            and agre.f_status = 0
+            and agre.f_feetypeid = 1
+        </where>
+    </select>
 
     <insert id="insertTWarehouseAgreementitems" parameterType="TWarehouseAgreementitems" useGeneratedKeys="true"
             keyProperty="fId">

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

@@ -161,7 +161,7 @@
             bill.f_qty AS fQty,
             bill.f_netweight AS fNetweight,
             bill.create_time AS createTime,
-            bill.f_inwarehouseid AS fInwarehouseid,
+            ware1.f_name AS fInwarehouseid,
             bill.create_by AS createBy,
             bill.f_grossweight AS fGrossweight,
             bill.f_product_name AS fProductName,
@@ -177,6 +177,7 @@
             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
         <where>

+ 4 - 1
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

@@ -52,10 +52,11 @@
         <result property="fBsdate" column="f_bsdate"/>
         <result property="fOriginalbilldate" column="f_originalbilldate"/>
         <result property="fStltypeid"    column="f_stltypeid"    />
+        <result property="fBusinessType"    column="f_business_type"    />
     </resultMap>
 
     <sql id="selectTWarehousebillsfeesVo">
-        select f_id, f_pid, f_lineno, f_corpid, f_feeid, f_feeUnitid, f_qty, f_unitprice, f_amount, f_currency, f_exrate, f_taxrate, f_dc, f_billstatus, f_review_date, f_statement_no, f_accamount, f_stlamount, f_accamount_date, f_invnos, f_invamount, f_stlamount_no, f_askamount, f_status, f_stlamount_date, del_flag, create_by, create_time, update_by, update_time, remark, src_id, src_bill_no, f_mblno, f_product_name, f_marks, f_chargedate, f_billing_deadline, f_inventory_days, f_amt, f_billing_days, f_billing_qty, f_billtype, f_billingway, f_bsdate, f_originalbilldate, f_stltypeid from t_warehousebillsfees
+        select f_id, f_pid, f_lineno, f_corpid, f_feeid, f_feeUnitid, f_qty, f_unitprice, f_amount, f_currency, f_exrate, f_taxrate, f_dc, f_billstatus, f_review_date, f_statement_no, f_accamount, f_stlamount, f_accamount_date, f_invnos, f_invamount, f_stlamount_no, f_askamount, f_status, f_stlamount_date, del_flag, create_by, create_time, update_by, update_time, remark, src_id, src_bill_no, f_mblno, f_product_name, f_marks, f_chargedate, f_billing_deadline, f_inventory_days, f_amt, f_billing_days, f_billing_qty, f_billtype, f_billingway, f_bsdate, f_originalbilldate, f_stltypeid , f_business_type from t_warehousebillsfees
     </sql>
 
     <select id="selectTWarehousebillsfeesList" parameterType="TWarehousebillsfees" resultMap="TWarehousebillsfeesResult">
@@ -169,6 +170,7 @@
             <if test="fBsdate != null">f_bsdate,</if>
             <if test="fOriginalbilldate != null">f_originalbilldate,</if>
             <if test="fStltypeid != null">f_stltypeid,</if>
+            <if test="fBusinessType != null">f_business_type,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fPid != null">#{fPid},</if>
@@ -217,6 +219,7 @@
             <if test="fBsdate != null">#{fBsdate},</if>
             <if test="fOriginalbilldate != null">#{fOriginalbilldate},</if>
             <if test="fStltypeid != null">#{fStltypeid},</if>
+            <if test="fBusinessType != null">#{fBusinessType},</if>
         </trim>
     </insert>
 

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

@@ -57,7 +57,7 @@
         <result property="fBusinessType" column="f_business_type"/>
         <result property="fBillingDeadline" column="f_billing_deadline"/>
         <result property="fWarehouseInformation"    column="f_warehouse_information"/>
-        <result property="fOrgWarehouseInformation"    column="f_orgwarehouse_information"/>
+        <result property="fOrgwarehouseInformation"    column="f_orgwarehouse_information"/>
     </resultMap>
 
     <sql id="selectTWarehousebillsitemsVo">