Przeglądaj źródła

[CODE]: 基础资料-->仓库管理修改;仓库、明细、费用、协议 添加字段

maxianghua 4 lat temu
rodzic
commit
cd63ddb3f0
19 zmienionych plików z 324 dodań i 24 usunięć
  1. 15 13
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/basicData/TWarehouseController.java
  2. 2 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWhgenlegController.java
  3. 11 0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java
  4. 24 0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/TWarehouse.java
  5. 9 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TWarehouseMapper.java
  6. 4 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITWarehouseService.java
  7. 86 1
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseServiceImpl.java
  8. 2 0
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/ITWhgenlegService.java
  9. 16 0
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java
  10. 28 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehouseAgreement.java
  11. 28 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehouseBills.java
  12. 14 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehousebillsfees.java
  13. 12 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehousebillsitems.java
  14. 31 1
      ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml
  15. 4 3
      ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml
  16. 9 1
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehouseAgreementMapper.xml
  17. 16 1
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml
  18. 6 1
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml
  19. 7 2
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsitemsMapper.xml

+ 15 - 13
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/basicData/TWarehouseController.java

@@ -8,6 +8,7 @@ import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -46,6 +47,16 @@ public class TWarehouseController extends BaseController {
     }
 
     /**
+     * 查询仓库列表
+     */
+    @GetMapping("/lists")
+    public TableDataInfo lists(TWarehouse tWarehouse) {
+        startPage();
+        List<TWarehouse> list = tWarehouseService.selectTWarehouseLists(tWarehouse);
+        return  getDataTable(list);
+    }
+
+    /**
      * 导出仓库列表
      */
     @PreAuthorize("@ss.hasPermi('basicdata:warehouse:export')")
@@ -123,12 +134,8 @@ public class TWarehouseController extends BaseController {
     @PostMapping
     @RepeatSubmit
     public AjaxResult add(@Validated @RequestBody TWarehouse tWarehouse) {
-        if (UserConstants.NOT_UNIQUE.equals(tWarehouseService.checkUFNoUnique(tWarehouse))) {
-            return AjaxResult.error("新增仓库'" + tWarehouse.getfNo() + "'失败,编号已存在");
-        } else if (UserConstants.NOT_UNIQUE.equals(tWarehouseService.checkUFNnameUnique(tWarehouse))) {
-            return AjaxResult.error("新增仓库'" + tWarehouse.getfName() + "'失败,名称已存在");
-        } else if (UserConstants.NOT_UNIQUE.equals(tWarehouseService.checkUFAreUnique(tWarehouse))){
-            return AjaxResult.error("新增仓库库区'" + tWarehouse.getfName() + "'失败,已有库位存在");
+        if (UserConstants.NOT_UNIQUE.equals(tWarehouseService.checkNameUnique(tWarehouse))) {
+            return AjaxResult.error("新增仓库'" + tWarehouse.getfNo() + "'失败,仓库已存在");
         }
         tWarehouse.setCreateBy(SecurityUtils.getUsername());
         return toAjax(tWarehouseService.insertTWarehouse(tWarehouse));
@@ -148,13 +155,8 @@ public class TWarehouseController extends BaseController {
     @PutMapping
     @RepeatSubmit
     public AjaxResult edit(@Validated @RequestBody TWarehouse tWarehouse) {
-        if (UserConstants.NOT_UNIQUE.equals(tWarehouseService.checkUFNoUnique(tWarehouse))) {
-            return AjaxResult.error("新增仓库'" + tWarehouse.getfNo() + "'失败,编号已存在");
-        } else if (UserConstants.NOT_UNIQUE.equals(tWarehouseService.checkUFNnameUnique(tWarehouse))) {
-            return AjaxResult.error("新增仓库'" + tWarehouse.getfName() + "'失败,名称已存在");
-        } else if (StringUtils.equals(UserConstants.DEPT_DISABLE, tWarehouse.getfStatus())
-                && tWarehouseService.selectNormalChildrenDeptById(tWarehouse.getfId()) > 0) {
-            return AjaxResult.error("该仓库包含未停用的库区!");
+        if (UserConstants.NOT_UNIQUE.equals(tWarehouseService.checkNameUnique(tWarehouse))) {
+            return AjaxResult.error("新增仓库'" + tWarehouse.getfNo() + "'失败,仓库已存在");
         }
         tWarehouse.setUpdateBy(SecurityUtils.getUsername());
         return toAjax(tWarehouseService.updateTWarehouses(tWarehouse));

+ 2 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWhgenlegController.java

@@ -109,7 +109,8 @@ public class TWhgenlegController extends BaseController {
     @GetMapping("/wareHouseList")
     public TableDataInfo wareHouseList() {
         startPage();
-        List<Map<String, Object>> list = tWhgenlegService.selectWareHouseList();
+       // List<Map<String, Object>> list = tWhgenlegService.selectWareHouseList();
+        List<Map<String, Object>> list = tWhgenlegService.selectWareHouseLists();
         return getDataTable(list);
     }
 

+ 11 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java

@@ -27,6 +27,8 @@ public class TreeSelect implements Serializable
     @JsonInclude(JsonInclude.Include.NON_EMPTY)
     private List<TreeSelect> children;
 
+    private String fWarehouseInformation;
+
     public TreeSelect()
     {
 
@@ -50,6 +52,7 @@ public class TreeSelect implements Serializable
     {
         this.id = tWarehouse.getfId();
         this.label = tWarehouse.getfName();
+        this.fWarehouseInformation = tWarehouse.getfWarehouseInformation();
         this.children = tWarehouse.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
     }
 
@@ -82,4 +85,12 @@ public class TreeSelect implements Serializable
     {
         this.children = children;
     }
+
+    public String getfWarehouseInformation() {
+        return fWarehouseInformation;
+    }
+
+    public void setfWarehouseInformation(String fWarehouseInformation) {
+        this.fWarehouseInformation = fWarehouseInformation;
+    }
 }

+ 24 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/TWarehouse.java

@@ -75,6 +75,14 @@ public class TWarehouse extends BaseEntity
     /** 删除状态 */
     private String delFlag;
 
+    /** 仓库 */
+    @Excel(name = "仓库")
+    private Long fLocation;
+
+    /** 仓库/库区/库位 */
+    @Excel(name = "仓库/库区/库位")
+    private String fWarehouseInformation;
+
     /**
      * 子部门
      */
@@ -196,6 +204,22 @@ public class TWarehouse extends BaseEntity
         this.fCharg = fCharg;
     }
 
+    public Long getfLocation() {
+        return fLocation;
+    }
+
+    public void setfLocation(Long fLocation) {
+        this.fLocation = fLocation;
+    }
+
+    public String getfWarehouseInformation() {
+        return fWarehouseInformation;
+    }
+
+    public void setfWarehouseInformation(String fWarehouseInformation) {
+        this.fWarehouseInformation = fWarehouseInformation;
+    }
+
     public List<TWarehouse> getChildren() {
         return children;
     }

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

@@ -2,9 +2,11 @@ package com.ruoyi.basicData.mapper;
 
 
 import com.ruoyi.basicData.domain.TWarehouseArea;
+import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import org.apache.ibatis.annotations.Param;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -30,6 +32,8 @@ public interface TWarehouseMapper {
      */
     public List<TWarehouse> selectTWarehouseList(TWarehouse tWarehouse);
 
+    public List<TWarehouse> selectTWarehouseLists(TWarehouse tWarehouse);
+
     /**
      * 新增仓库
      *
@@ -125,4 +129,9 @@ public interface TWarehouseMapper {
      * @return 库区
      */
     public TWarehouse selectTWarehousById(Long fId);
+
+
+    public BigDecimal selectTWarehouseFTotalgross(Long fId);
+
+    public TWarehouse checkDeptNameUnique(@Param("fName") String deptName, @Param("parentId") Long parentId);
 }

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

@@ -4,6 +4,7 @@ package com.ruoyi.basicData.service;
 import com.ruoyi.basicData.domain.TWarehouseArea;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.TreeSelect;
+import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.core.domain.model.LoginUser;
 
@@ -34,6 +35,7 @@ public interface ITWarehouseService {
      */
     public List<TWarehouse> selectTWarehouseList(TWarehouse tWarehouse);
 
+    public List<TWarehouse> selectTWarehouseLists(TWarehouse tWarehouse);
     /**
      * 新增仓库
      *
@@ -128,4 +130,6 @@ public interface ITWarehouseService {
      */
     public String checkUFAreUnique(TWarehouse tWarehouse);
 
+    public String checkNameUnique(TWarehouse tWarehouse);
+
 }

+ 86 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseServiceImpl.java

@@ -2,6 +2,7 @@ package com.ruoyi.basicData.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.basicData.domain.TWarehouseArea;
 import com.ruoyi.basicData.mapper.TWarehouseAreaMapper;
@@ -21,6 +22,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -80,6 +82,11 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
         return tWarehouseMapper.selectTWarehouseList(tWarehouse);
     }
 
+    @Override
+    public List<TWarehouse> selectTWarehouseLists(TWarehouse tWarehouse) {
+        return tWarehouseMapper.selectTWarehouseLists(tWarehouse);
+    }
+
     /**
      * 新增仓库
      *
@@ -96,7 +103,20 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
             throw new CustomException("部门停用,不允许新增");
         }
         tWarehouse.setAncestors(info.getAncestors() + "," + tWarehouse.getParentId());
-        return tWarehouseMapper.insertTWarehouse(tWarehouse);
+        // 所有节点转换成中文拼接
+        String  fWarehouseInformation = warehouseName(info.getAncestors() + "," + tWarehouse.getParentId(),tWarehouse.getfName());
+        tWarehouse.setfWarehouseInformation(fWarehouseInformation);
+        tWarehouseMapper.insertTWarehouse(tWarehouse);
+        // 更新库容
+        if (tWarehouse.getfLocation()==1){
+            int i = updateWarehousefTotalgross(tWarehouse.getAncestors());
+            if (i <= 0) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return 0;
+            }
+        }
+        return 1;
+
     }
 
     @Override
@@ -187,12 +207,23 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
             String oldAncestors = oldTWarehouse.getAncestors();
             tWarehouse.setAncestors(newAncestors);
             updateDeptChildren(tWarehouse.getfId(), newAncestors, oldAncestors);
+            // 修改仓库信息
+            String  fWarehouseInformation = warehouseName(newAncestors,tWarehouse.getfName());
+            tWarehouse.setfWarehouseInformation(fWarehouseInformation);
         }
         int result = tWarehouseMapper.updateTWarehouse(tWarehouse);
         if (UserConstants.DEPT_NORMAL.equals(tWarehouse.getfStatus())) {
             // 如果该部门是启用状态,则启用该部门的所有上级部门
             updateParentDeptStatus(tWarehouse);
         }
+        // 更新库容
+        if (tWarehouse.getfLocation()==1){
+            int i = updateWarehousefTotalgross(tWarehouse.getAncestors());
+            if (i <= 0) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return 0;
+            }
+        }
         return result;
     }
 
@@ -264,6 +295,16 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
     }
 
     @Override
+    public String checkNameUnique(TWarehouse tWarehouse) {
+        Long fId = StringUtils.isNull(tWarehouse.getfId()) ? -1L : tWarehouse.getfId();
+        TWarehouse info = tWarehouseMapper.checkDeptNameUnique(tWarehouse.getfName(), tWarehouse.getParentId());
+        if (StringUtils.isNotNull(info) && info.getfId().longValue() != fId.longValue()) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+    @Override
     public String checkUFNoUnique(TWarehouse tWarehouse) {
         TWarehouse tWarehouse1 = tWarehouseMapper.checkFNoUnique(tWarehouse.getfNo());
         if (StringUtils.isNotNull(tWarehouse1) && tWarehouse1.getfId()!=tWarehouse.getfId()) {
@@ -391,4 +432,48 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
         return getChildList(list, t).size() > 0 ? true : false;
     }
 
+    public  String warehouseName(String ancestors,String oldName){
+        String str[] = ancestors.split(",");
+        String fWarehouseInformation = "";
+        for (String id: str){
+            if(!(id.equals("0")) && !(id.equals("100"))){
+                // 查询仓库名称
+                TWarehouse tWarehouse=tWarehouseMapper.selectTWarehouseById(Long.valueOf(id));
+                fWarehouseInformation += tWarehouse.getfName() + "/";
+            }
+        }
+        if(StringUtils.isNull(fWarehouseInformation) && !fWarehouseInformation.equals("") ){
+            fWarehouseInformation = oldName;
+        } else {
+            fWarehouseInformation +=  oldName;
+        }
+        return fWarehouseInformation;
+    }
+
+    /**
+     *  修改仓库库容
+     * @param ancestors
+     * @return
+     */
+    public  int updateWarehousefTotalgross(String  ancestors){
+        String str[] = ancestors.split(",");
+        Long warehouseId =0L;
+        for (String id: str){
+            if(!(id.equals("0")) && !(id.equals("100"))){
+                warehouseId = Long.valueOf(id);
+                break;
+            }
+        }
+        if(warehouseId!=0){
+            // 所有库容
+            BigDecimal fTotalgross = tWarehouseMapper.selectTWarehouseFTotalgross(warehouseId);
+            TWarehouse tWarehouseNew = new TWarehouse();
+            tWarehouseNew.setfId(warehouseId);
+            tWarehouseNew.setfTotalgross(fTotalgross);
+            return  tWarehouseMapper.updatefTotalgross(tWarehouseNew);
+        }else {
+            return 0;
+        }
+    }
+
 }

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

@@ -81,6 +81,8 @@ public interface ITWhgenlegService {
      */
     List<Map<String, Object>> selectWareHouseList();
 
+    List<Map<String, Object>> selectWareHouseLists();
+
     /**
      *  客户 库存总量
      * @return

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

@@ -225,6 +225,22 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
     }
 
     @Override
+    public List<Map<String, Object>> selectWareHouseLists() {
+        List<Map<String, Object>> list = new ArrayList<>();
+        List<TWarehouse> tWarehouses= tWarehouseMapper.selectTWarehouseLists(new TWarehouse());
+        for (TWarehouse tWarehouse : tWarehouses) {
+            Map<String, Object> maps = new HashMap<>();
+            maps.put("fName", tWarehouse.getfName());
+            maps.put("fWarehouseid", tWarehouse.getfId());
+            maps.put("fTotalgross", tWarehouse.getfTotalgross());
+            maps.put("fGrossweightD", "0");
+            maps.put("percentage", "");
+            list.add(maps);
+        }
+        return list;
+    }
+
+    @Override
     public Map<String, Object> selectCorpsList(Long fId) {
         Map<String, Object> map = new HashMap<>();
         // 查询所有 客户

+ 28 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehouseAgreement.java

@@ -114,6 +114,18 @@ public class TWarehouseAgreement extends BaseEntity {
     @TableLogic
     private String delFlag;
 
+    /**
+     * 作业费类型
+     */
+    @Excel(name = "作业费类型")
+    private Long fTaskType;
+
+    /**
+     * 费用类型
+     */
+    @Excel(name = "费用类型")
+    private String fDc;
+
     public String getfContractno() {
         return fContractno;
     }
@@ -242,6 +254,22 @@ public class TWarehouseAgreement extends BaseEntity {
         this.fStatus = fStatus;
     }
 
+    public Long getfTaskType() {
+        return fTaskType;
+    }
+
+    public void setfTaskType(Long fTaskType) {
+        this.fTaskType = fTaskType;
+    }
+
+    public String getfDc() {
+        return fDc;
+    }
+
+    public void setfDc(String fDc) {
+        this.fDc = fDc;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 28 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehouseBills.java

@@ -298,6 +298,18 @@ public class TWarehouseBills extends BaseEntity {
     private String fBusinessType;
 
     /**
+     * 货转客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name,自有在货权转移是该字段有效
+     */
+    @Excel(name = "车队")
+    private Long fFleet;
+
+    /**
+     * 货转客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name,自有在货权转移是该字段有效
+     */
+    @Excel(name = "劳务")
+    private Long fLabour ;
+
+    /**
      * 查询时间区间
      */
     private List<String> timeInterval;
@@ -716,6 +728,22 @@ public class TWarehouseBills extends BaseEntity {
         this.fBusinessType = fBusinessType;
     }
 
+    public Long getfFleet() {
+        return fFleet;
+    }
+
+    public void setfFleet(Long fFleet) {
+        this.fFleet = fFleet;
+    }
+
+    public Long getfLabour() {
+        return fLabour;
+    }
+
+    public void setfLabour(Long fLabour) {
+        this.fLabour = fLabour;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

@@ -263,6 +263,12 @@ public class TWarehousebillsfees extends BaseEntity {
     @Excel(name = "计费方式")
     private Long fBillingway;
 
+    /**
+     * 结算方式,默认提取corps中stltypeid	也可以从表t_stltypes中下拉选择,存储id,显示name
+     */
+    @Excel(name = "结算方式,默认提取corps中stltypeid	也可以从表t_stltypes中下拉选择,存储id,显示name")
+    private Long fStltypeid;
+
     public void setfId(Long fId) {
         this.fId = fId;
     }
@@ -591,6 +597,14 @@ public class TWarehousebillsfees extends BaseEntity {
         return fBillingway;
     }
 
+    public Long getfStltypeid() {
+        return fStltypeid;
+    }
+
+    public void setfStltypeid(Long fStltypeid) {
+        this.fStltypeid = fStltypeid;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

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

@@ -286,6 +286,10 @@ public class TWarehousebillsitems extends BaseEntity {
     @Excel(name = "是否入库")
     private Long fIsInventory;
 
+    /** 仓库/库区/库位 */
+    @Excel(name = "仓库/库区/库位")
+    private String fWarehouseInformation;
+
     public void setfId(Long fId) {
         this.fId = fId;
     }
@@ -654,6 +658,14 @@ public class TWarehousebillsitems extends BaseEntity {
         return fIsInventory;
     }
 
+    public String getfWarehouseInformation() {
+        return fWarehouseInformation;
+    }
+
+    public void setfWarehouseInformation(String fWarehouseInformation) {
+        this.fWarehouseInformation = fWarehouseInformation;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

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

@@ -23,15 +23,18 @@
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
         <result property="remark"    column="remark"    />
+        <result property="fLocation"    column="f_location"    />
+        <result property="fWarehouseInformation"    column="f_warehouse_information"    />
     </resultMap>
 
     <sql id="selectTWarehouseVo">
-        select f_id, parent_id, ancestors,  order_num, f_no, f_name, f_addr, f_totalgross,f_contacts, f_tel, f_charg, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_warehouse
+        select f_id, parent_id, ancestors,  order_num, f_no, f_name, f_addr, f_totalgross,f_contacts, f_tel, f_charg, f_status, del_flag, create_by, create_time, update_by, update_time, remark,f_location, f_warehouse_information from t_warehouse
     </sql>
 
     <select id="selectTWarehouseList" parameterType="TWarehouse" resultMap="TWarehouseResult">
         <include refid="selectTWarehouseVo"/>
         <where>
+            <if test="ancestors != null  and ancestors != ''"> and ancestors like concat('%', #{ancestors}, '%')</if>
             <if test="fNo != null  and fNo != ''"> and f_no like concat('%', #{fNo}, '%')</if>
             <if test="fName != null  and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
             <if test="fAddr != null  and fAddr != ''"> and f_addr like concat('%', #{fAddr}, '%')</if>
@@ -46,6 +49,13 @@
         order by parent_id, order_num
     </select>
 
+    <select id="selectTWarehouseLists" parameterType="TWarehouse" resultMap="TWarehouseResult">
+        <include refid="selectTWarehouseVo"/>
+        <where>
+            parent_id = 100
+        </where>
+    </select>
+
     <select id="selectTWarehouseById" parameterType="Long" resultMap="TWarehouseResult">
         <include refid="selectTWarehouseVo"/>
         where f_id = #{fId}
@@ -71,6 +81,8 @@
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
+            <if test="fLocation != null">f_location,</if>
+            <if test="fWarehouseInformation != null">f_warehouse_information,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="parentId != null and parentId != 0">#{parentId},</if>
@@ -90,6 +102,8 @@
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
+            <if test="fLocation != null">#{fLocation},</if>
+            <if test="fWarehouseInformation != null">#{fWarehouseInformation},</if>
         </trim>
     </insert>
 
@@ -113,6 +127,8 @@
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remark != null">remark = #{remark},</if>
+            <if test="fLocation != null">f_location = #{fLocation},</if>
+            <if test="fWarehouseInformation != null">f_warehouse_information = #{fWarehouseInformation},</if>
         </trim>
         where f_id = #{fId}
     </update>
@@ -182,4 +198,18 @@
         where f_id =  #{fId}
     </update>
 
+    <select id="selectTWarehouseFTotalgross" resultType="java.math.BigDecimal">
+        SELECT
+            sum( f_totalgross ) AS fTotalgross
+        FROM
+            t_warehouse
+        WHERE
+            ancestors LIKE  concat('%',#{fId}, '%')
+    </select>
+
+    <select id="checkDeptNameUnique" resultMap="TWarehouseResult">
+        <include refid="selectTWarehouseVo"/>
+        where f_name=#{fName} and parent_id = #{parentId} limit 1
+    </select>
+
 </mapper>

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

@@ -82,7 +82,7 @@
         DISTINCT
             leg.f_id AS fId,
             corp.f_name AS fCorpid,
-            ware.f_name AS fWarehouseids,
+            ware.f_warehouse_information AS fWarehouseids,
             area.f_name AS fWarehouseLocationids,
             leg.f_originalbillno AS fOriginalbillno,
             leg.f_warehouse_locationid AS fWarehouseLocationid,
@@ -115,7 +115,7 @@
             t_whgenleg leg
             LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
             LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
-            LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouseid
+            LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
             LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
             LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
         <where>
@@ -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="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid}</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>
@@ -152,6 +151,8 @@
             <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>
         </where>
     </select>
 

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

@@ -26,10 +26,12 @@
         <result property="updateBy" column="update_by"/>
         <result property="updateTime" column="update_time"/>
         <result property="remark" column="remark"/>
+        <result property="fTaskType" column="f_task_type"/>
+        <result property="fDc" column="f_dc"/>
     </resultMap>
 
     <sql id="selectTWarehouseAgreementVo">
-        select f_id, f_billno,f_contractno, f_deptid, f_corpid,f_goodsid, f_stltypeid, f_feetypeid, t_packages, f_trademodeid, f_freedays, f_begindate, f_enddate, f_billstatus,f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_warehouse_agreement
+        select f_id, f_billno,f_contractno, f_deptid, f_corpid,f_goodsid, f_stltypeid, f_feetypeid, t_packages, f_trademodeid, f_freedays, f_begindate, f_enddate, f_billstatus,f_status, del_flag, create_by, create_time, update_by, update_time, remark,f_task_type,f_dc  from t_warehouse_agreement
     </sql>
 
     <select id="selectTWarehouseAgreementList" parameterType="TWarehouseAgreement"
@@ -118,6 +120,8 @@
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
+            <if test="fTaskType != null">f_task_type,</if>
+            <if test="fDc != null">f_dc,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fBillno != null and fBillno != ''">#{fBillno},</if>
@@ -140,6 +144,8 @@
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
+            <if test="fTaskType != null">#{fTaskType},</if>
+            <if test="fDc != null">#{fDc},</if>
         </trim>
     </insert>
 
@@ -166,6 +172,8 @@
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remark != null">remark = #{remark},</if>
+            <if test="fTaskType != null">f_task_type = #{fTaskType},</if>
+            <if test="fDc != null">f_dc = #{fDc},</if>
         </trim>
         where f_id = #{fId}
     </update>

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

@@ -59,10 +59,19 @@
         <result property="fDriverTel"    column="f_driver_tel"    />
         <result property="fDriverIdCar"    column="f_driver_id_car"    />
         <result property="fBusinessType"    column="f_business_type"    />
+        <result property="fLabour"    column="f_labour"    />
+        <result property="fFleet"    column="f_fleet"    />
     </resultMap>
 
     <sql id="selectTWarehousebillsVo">
-        select f_id, f_billno, f_customsdeclartion, f_originalbillno, f_deptid, f_bsdeptid, f_contacts, f_tel, f_corpid, f_tocorpid, f_stltypeid, f_bscorpno, f_warehouseid, f_storekeeper, f_chargedate, f_bsdate, f_planqty, f_plangrossweight, f_plannetweight, f_planvolumn, f_qty, f_grossweight, f_netweight, f_volumn, f_trademodeid, f_billingway, f_sbu, f_feetunit, f_mblno, f_vslvoy, f_marks, f_eta, f_customno, f_ifweigh, f_ifpledge, f_ifdamage, f_bankcorpid, f_billtype, f_billstatus, del_flag, create_by, create_time, f_items_status, update_by, update_time, remark, f_billing_deadline, f_product_name, f_review_date, f_truckno, f_driver_name, f_driver_tel, f_driver_id_car, f_business_type from t_warehousebills
+        select f_id, f_billno, f_customsdeclartion, f_originalbillno, f_deptid, f_bsdeptid,
+               f_contacts, f_tel, f_corpid, f_tocorpid, f_stltypeid, f_bscorpno, f_warehouseid,
+               f_storekeeper, f_chargedate, f_bsdate, f_planqty, f_plangrossweight, f_plannetweight,
+               f_planvolumn, f_qty, f_grossweight, f_netweight, f_volumn, f_trademodeid, f_billingway,
+               f_sbu, f_feetunit, f_mblno, f_vslvoy, f_marks, f_eta, f_customno, f_ifweigh, f_ifpledge,
+               f_ifdamage, f_bankcorpid, f_billtype, f_billstatus, del_flag, create_by, create_time,
+               f_items_status, update_by, update_time, remark, f_billing_deadline, f_product_name,
+               f_review_date, f_truckno, f_driver_name, f_driver_tel, f_driver_id_car, f_business_type,f_labour,f_fleet  from t_warehousebills
     </sql>
 
     <select id="selectTWarehousebillsList" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
@@ -360,6 +369,8 @@
             <if test="fDriverTel != null">f_driver_tel,</if>
             <if test="fDriverIdCar != null">f_driver_id_car,</if>
             <if test="fBusinessType != null">f_business_type,</if>
+            <if test="fLabour != null">f_labour,</if>
+            <if test="fFleet != null">f_fleet,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fBillno != null">#{fBillno},</if>
@@ -415,6 +426,8 @@
             <if test="fDriverTel != null">#{fDriverTel},</if>
             <if test="fDriverIdCar != null">#{fDriverIdCar},</if>
             <if test="fBusinessType != null">#{fBusinessType},</if>
+            <if test="fLabour != null">#{fLabour},</if>
+            <if test="fFleet != null">#{fFleet},</if>
         </trim>
     </insert>
 
@@ -475,6 +488,8 @@
             <if test="fDriverIdCar != null">f_driver_id_car = #{fDriverIdCar},</if>
             <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
             <if test="fReviewDate == null">f_review_date = null,</if>
+            <if test="fLabour  != null">f_labour  = #{fLabour },</if>
+            <if test="fFleet != null">f_fleet = #{fFleet},</if>
         </trim>
         where f_id = #{fId}
     </update>

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

@@ -51,10 +51,11 @@
         <result property="fBillingway" column="f_billingway"/>
         <result property="fBsdate" column="f_bsdate"/>
         <result property="fOriginalbilldate" column="f_originalbilldate"/>
+        <result property="fStltypeid"    column="f_stltypeid"    />
     </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 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 from t_warehousebillsfees
     </sql>
 
     <select id="selectTWarehousebillsfeesList" parameterType="TWarehousebillsfees" resultMap="TWarehousebillsfeesResult">
@@ -99,6 +100,7 @@
             <if test="fBillingway != null "> and f_billingway = #{fBillingway}</if>
             <if test="fBsdate != null "> and f_bsdate = #{fBsdate}</if>
             <if test="fOriginalbilldate != null "> and f_originalbilldate = #{fOriginalbilldate}</if>
+            <if test="fStltypeid != null"> and f_stltypeid = #{fStltypeid},</if>
         </where>
     </select>
 
@@ -156,6 +158,7 @@
             <if test="fBillingway != null">f_billingway,</if>
             <if test="fBsdate != null">f_bsdate,</if>
             <if test="fOriginalbilldate != null">f_originalbilldate,</if>
+            <if test="fStltypeid != null">f_stltypeid,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fPid != null">#{fPid},</if>
@@ -203,6 +206,7 @@
             <if test="fBillingway != null">#{fBillingway},</if>
             <if test="fBsdate != null">#{fBsdate},</if>
             <if test="fOriginalbilldate != null">#{fOriginalbilldate},</if>
+            <if test="fStltypeid != null">#{fStltypeid},</if>
         </trim>
     </insert>
 
@@ -254,6 +258,7 @@
             <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
             <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
             <if test="fOriginalbilldate != null">f_originalbilldate = #{fOriginalbilldate},</if>
+            <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
         </trim>
         where f_id = #{fId}
     </update>

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

@@ -56,10 +56,11 @@
         <result property="fIsInventory" column="f_is_inventory"/>
         <result property="fBusinessType" column="f_business_type"/>
         <result property="fBillingDeadline" column="f_billing_deadline"/>
+        <result property="fWarehouseInformation"    column="f_warehouse_information"    />
     </resultMap>
 
     <sql id="selectTWarehousebillsitemsVo">
-        select f_id, f_pid, f_lineno, f_srcid, f_goodsid, f_billno, f_warehouselocid, f_mblno, f_originalbillno, f_bsdate, f_boxno, f_cntqty, f_goodsval, f_cntrtype, f_planvolumn, f_originalbilldate, f_transfer_warehouselocid, f_planqty, f_billingway, f_plangrossweight, f_packagespecs, f_chargedate, f_plannetweight, f_qty, f_grossweight, f_volumn, f_netweight, f_cntrno, f_truckno, f_billstatus, del_flag, create_by, create_time, update_by, update_time, remark, f_marks, f_inventory_days, f_storage_fee_deadline, f_amt, f_billing_days, f_driver_name, f_driver_tel, f_driver_id_car, f_serial_number, f_is_pass, f_billtype, f_billing_qty, f_billing_deadline, f_business_type, f_is_inventory from t_warehousebillsitems
+        select f_id, f_pid, f_lineno, f_srcid, f_goodsid, f_billno, f_warehouselocid, f_mblno, f_originalbillno, f_bsdate, f_boxno, f_cntqty, f_goodsval, f_cntrtype, f_planvolumn, f_originalbilldate, f_transfer_warehouselocid, f_planqty, f_billingway, f_plangrossweight, f_packagespecs, f_chargedate, f_plannetweight, f_qty, f_grossweight, f_volumn, f_netweight, f_cntrno, f_truckno, f_billstatus, del_flag, create_by, create_time, update_by, update_time, remark, f_marks, f_inventory_days, f_storage_fee_deadline, f_amt, f_billing_days, f_driver_name, f_driver_tel, f_driver_id_car, f_serial_number, f_is_pass, f_billtype, f_billing_qty, f_billing_deadline, f_business_type, f_is_inventory , f_warehouse_information from t_warehousebillsitems
     </sql>
 
     <select id="selectTWarehousebillsitemsList" parameterType="TWarehousebillsitems"
@@ -154,7 +155,8 @@
             item.f_cntrno AS fCntrno,
             item.f_truckno AS fTruckno,
             item.f_billstatus AS fBillstatus,
-            item.remark
+            item.remark ,
+            item.f_warehouse_information AS fWarehouseInformation
         from
             t_warehousebillsitems item
             LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
@@ -224,6 +226,7 @@
             <if test="fBillingDeadline != null">f_billing_deadline,</if>
             <if test="fBusinessType != null">f_business_type,</if>
             <if test="fIsInventory != null">f_is_inventory,</if>
+            <if test="fWarehouseInformation != null">f_warehouse_information,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fPid != null">#{fPid},</if>
@@ -276,6 +279,7 @@
             <if test="fBillingDeadline != null">#{fBillingDeadline},</if>
             <if test="fBusinessType != null">#{fBusinessType},</if>
             <if test="fIsInventory != null">#{fIsInventory},</if>
+            <if test="fWarehouseInformation != null">#{fWarehouseInformation},</if>
         </trim>
     </insert>
 
@@ -332,6 +336,7 @@
             <if test="fIsInventory != null">f_is_inventory = #{fIsInventory},</if>
             <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
             <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
+            <if test="fWarehouseInformation != null">f_warehouse_information = #{fWarehouseInformation},</if>
         </trim>
         where f_id = #{fId}
     </update>