Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

lazhaoqian před 4 roky
rodič
revize
31f7a903f7
17 změnil soubory, kde provedl 567 přidání a 597 odebrání
  1. 13 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWhgenlegController.java
  2. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TStorageFeeCalculationController.java
  3. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehouseGoodsTransferController.java
  4. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehouseInStockController.java
  5. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehouseOutStockController.java
  6. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehouseStockTransferController.java
  7. 1 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/WechatService.java
  8. 154 282
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/domain/TWhgenleg.java
  9. 8 1
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java
  10. 10 2
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/ITWhgenlegService.java
  11. 25 3
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java
  12. 7 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsitemsMapper.java
  13. 1 1
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseBillsService.java
  14. 74 33
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java
  15. 55 47
      ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml
  16. 201 217
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml
  17. 12 2
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsitemsMapper.xml

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

@@ -36,9 +36,8 @@ public class TWhgenlegController extends BaseController {
     private ITWhgenlegService tWhgenlegService;
 
     /**
-     * 查询库存总账列表
+     * 出库、调拨、货转查询库存总账列表
      */
-    @PreAuthorize("@ss.hasPermi('warehouseBusiness:whgenleg:list')")
     @DataScope(deptAlias = "d", userAlias = "u")
     @GetMapping("/list")
     public TableDataInfo list(TWhgenleg tWhgenleg) {
@@ -48,6 +47,18 @@ public class TWhgenlegController extends BaseController {
     }
 
     /**
+     * 查询库存总账列表
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:whgenleg:list')")
+    @DataScope(deptAlias = "d", userAlias = "u")
+    @GetMapping("/whgenlegList")
+    public TableDataInfo whgenlegList(TWhgenleg tWhgenleg) {
+        startPage();
+        List<Map<String, Object>> list = tWhgenlegService.selectInventoryMapList(tWhgenleg);
+        return getDataTable(list);
+    }
+
+    /**
      * 导出库存总账列表
      */
     @PreAuthorize("@ss.hasPermi('warehouseBusiness:whgenleg:export')")

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TStorageFeeCalculationController.java

@@ -127,7 +127,7 @@ public class TStorageFeeCalculationController extends BaseController {
     @Log(title = "详情主表", businessType = BusinessType.DELETE)
     @DeleteMapping("/{fIds}")
     public AjaxResult remove(@PathVariable Long[] fIds) {
-        return toAjax(itWarehouseBillsService.deleteTWarehousebillsByIds(fIds));
+        return itWarehouseBillsService.deleteTWarehousebillsByIds(fIds);
     }
 
     @PreAuthorize("@ss.hasPermi('warehouseBusiness:storageFeeCalculation:remove')")

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

@@ -144,7 +144,7 @@ public class TWarehouseGoodsTransferController extends BaseController {
     }
 
     /**
-     * 新增出库详情入账
+     * 货转确认
      */
     @PreAuthorize("@ss.hasPermi('warehouseBusiness:inStock:add')")
     @Log(title = "详情主表", businessType = BusinessType.INSERT)
@@ -188,7 +188,7 @@ public class TWarehouseGoodsTransferController extends BaseController {
     @DeleteMapping("/{fIds}")
     @RepeatSubmit
     public AjaxResult remove(@PathVariable Long[] fIds) {
-        return toAjax(itWarehouseBillsService.deleteTWarehousebillsByIds(fIds));
+        return itWarehouseBillsService.deleteTWarehousebillsByIds(fIds);
     }
 
     @PreAuthorize("@ss.hasPermi('warehouseBusiness:goodsTransfer:remove')")

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehouseInStockController.java

@@ -156,7 +156,7 @@ public class TWarehouseInStockController extends BaseController {
     @DeleteMapping("/{fIds}")
     @RepeatSubmit
     public AjaxResult remove(@PathVariable Long[] fIds) {
-        return toAjax(itWarehouseBillsService.deleteTWarehousebillsByIds(fIds));
+        return itWarehouseBillsService.deleteTWarehousebillsByIds(fIds);
     }
 
     @PreAuthorize("@ss.hasPermi('warehouseBusiness:inStock:remove')")

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehouseOutStockController.java

@@ -159,7 +159,7 @@ public class TWarehouseOutStockController extends BaseController {
     @DeleteMapping("/{fIds}")
     @RepeatSubmit
     public AjaxResult remove(@PathVariable Long[] fIds) {
-        return toAjax(itWarehouseBillsService.deleteTWarehousebillsByIds(fIds));
+        return itWarehouseBillsService.deleteTWarehousebillsByIds(fIds);
     }
 
     @PreAuthorize("@ss.hasPermi('warehouseBusiness:outStock:remove')")

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehouseStockTransferController.java

@@ -232,7 +232,7 @@ public class TWarehouseStockTransferController extends BaseController {
     @DeleteMapping("/{fIds}")
     @RepeatSubmit
     public AjaxResult remove(@PathVariable Long[] fIds) {
-        return toAjax(itWarehouseBillsService.deleteTWarehousebillsByIds(fIds));
+        return itWarehouseBillsService.deleteTWarehousebillsByIds(fIds);
     }
 
     @PreAuthorize("@ss.hasPermi('warehouseBusiness:stockTransfer:remove')")

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/WechatService.java

@@ -245,7 +245,7 @@ public class WechatService {
                 "    \"remark\": {\n" +
                 "      \"value\": \"" + mblno + "\",\n" +
                 "      \"color\": \"#173177\"\n" +
-                "    },\n" +
+                "    }\n" +
                 "  }\n" +
                 "}";
         try {

+ 154 - 282
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/domain/TWhgenleg.java

@@ -220,436 +220,286 @@ public class TWhgenleg extends BaseEntity {
     @Excel(name = "仓库")
     private Long fLocation;
 
+    /** 是否按照箱号 */
+    private Long isCntrno;
+
     private String timeStartBsdate;
     private String timeEndBsdate;
 
-    public String getTimeStartBsdate() {
-        return timeStartBsdate;
-    }
-
-    public void setTimeStartBsdate(String timeStartBsdate) {
-        this.timeStartBsdate = timeStartBsdate;
-    }
-
-    public String getTimeEndBsdate() {
-        return timeEndBsdate;
-    }
-
-    public void setTimeEndBsdate(String timeEndBsdate) {
-        this.timeEndBsdate = timeEndBsdate;
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
     }
 
-    public void setorgStorageDate(List<String> orgStorageDate) {
-        this.orgStorageDate = orgStorageDate;
-    }
-
-    public List<String> getorgStorageDate() {
-        return orgStorageDate;
-    }
-
-    public void setfId(Long fId) {
-        this.fId = fId;
-    }
-
-
     public Long getfId() {
         return fId;
     }
 
-    public void setfAccyear(Long fAccyear) {
-
-        this.fAccyear = fAccyear;
-
+    public void setfId(Long fId) {
+        this.fId = fId;
     }
 
-
     public Long getfAccyear() {
-
         return fAccyear;
-
     }
 
-    public void setfAccmonth(Long fAccmonth) {
-
-        this.fAccmonth = fAccmonth;
-
+    public void setfAccyear(Long fAccyear) {
+        this.fAccyear = fAccyear;
     }
 
-
     public Long getfAccmonth() {
-
         return fAccmonth;
-
     }
 
-    public void setfCorpid(Long fCorpid) {
-
-        this.fCorpid = fCorpid;
-
+    public void setfAccmonth(Long fAccmonth) {
+        this.fAccmonth = fAccmonth;
     }
 
-
     public Long getfCorpid() {
-
         return fCorpid;
-
-    }
-
-    public void setfChargedate(Date fChargedate) {
-        this.fChargedate = fChargedate;
     }
 
-    public Date getfChargedate() {
-        return fChargedate;
-    }
-
-    public void setfMblno(String fMblno) {
-
-        this.fMblno = fMblno;
-
+    public void setfCorpid(Long fCorpid) {
+        this.fCorpid = fCorpid;
     }
 
     public String getfMblno() {
-
         return fMblno;
-
     }
 
-    public void setfBillingway(Long fBillingway) {
-        this.fBillingway = fBillingway;
+    public void setfMblno(String fMblno) {
+        this.fMblno = fMblno;
     }
 
-    public Long getfBillingway() {
-        return fBillingway;
+    public String getfOriginalbillno() {
+        return fOriginalbillno;
     }
 
-
     public void setfOriginalbillno(String fOriginalbillno) {
-
         this.fOriginalbillno = fOriginalbillno;
-
     }
 
-
-    public String getfOriginalbillno() {
-
-        return fOriginalbillno;
-
+    public Long getfWarehouseLocationid() {
+        return fWarehouseLocationid;
     }
 
     public void setfWarehouseLocationid(Long fWarehouseLocationid) {
-
         this.fWarehouseLocationid = fWarehouseLocationid;
-
     }
 
-
-    public Long getfWarehouseLocationid() {
-
-        return fWarehouseLocationid;
-
+    public Long getfGoodsid() {
+        return fGoodsid;
     }
 
     public void setfGoodsid(Long fGoodsid) {
-
         this.fGoodsid = fGoodsid;
-
     }
 
-
-    public Long getfGoodsid() {
-
-        return fGoodsid;
-
+    public Date getfChargedate() {
+        return fChargedate;
     }
 
-    public void setfTrademodeid(Long fTrademodeid) {
-
-        this.fTrademodeid = fTrademodeid;
-
+    public void setfChargedate(Date fChargedate) {
+        this.fChargedate = fChargedate;
     }
 
-
     public Long getfTrademodeid() {
-
         return fTrademodeid;
-
     }
 
-    public void setfPreqty(Long fPreqty) {
-
-        this.fPreqty = fPreqty;
-
+    public void setfTrademodeid(Long fTrademodeid) {
+        this.fTrademodeid = fTrademodeid;
     }
 
-
     public Long getfPreqty() {
-
         return fPreqty;
-
     }
 
-    public void setfPregrossweight(BigDecimal fPregrossweight) {
-
-        this.fPregrossweight = fPregrossweight;
-
+    public void setfPreqty(Long fPreqty) {
+        this.fPreqty = fPreqty;
     }
 
-
-    public BigDecimal getfPregrossweight() {
-
-        return fPregrossweight;
-
+    public Long getfWarehouseid() {
+        return fWarehouseid;
     }
 
     public void setfWarehouseid(Long fWarehouseid) {
-
         this.fWarehouseid = fWarehouseid;
-
     }
 
-
-    public Long getfWarehouseid() {
-
-        return fWarehouseid;
-
+    public BigDecimal getfPregrossweight() {
+        return fPregrossweight;
     }
 
-    public void setfPrenetweight(BigDecimal fPrenetweight) {
-
-        this.fPrenetweight = fPrenetweight;
-
+    public void setfPregrossweight(BigDecimal fPregrossweight) {
+        this.fPregrossweight = fPregrossweight;
     }
 
-
     public BigDecimal getfPrenetweight() {
-
         return fPrenetweight;
-
     }
 
-    public void setfQtyd(Long fQtyd) {
-
-        this.fQtyd = fQtyd;
-
+    public void setfPrenetweight(BigDecimal fPrenetweight) {
+        this.fPrenetweight = fPrenetweight;
     }
 
-
     public Long getfQtyd() {
-
         return fQtyd;
-
     }
 
-    public void setfVolumnd(BigDecimal fVolumnd) {
-
-        this.fVolumnd = fVolumnd;
-
+    public void setfQtyd(Long fQtyd) {
+        this.fQtyd = fQtyd;
     }
 
-
     public BigDecimal getfVolumnd() {
-
         return fVolumnd;
-
     }
 
-    public void setfGrossweightd(BigDecimal fGrossweightd) {
-
-        this.fGrossweightd = fGrossweightd;
+    public void setfVolumnd(BigDecimal fVolumnd) {
+        this.fVolumnd = fVolumnd;
+    }
 
+    public Long getfBillingway() {
+        return fBillingway;
     }
 
+    public void setfBillingway(Long fBillingway) {
+        this.fBillingway = fBillingway;
+    }
 
     public BigDecimal getfGrossweightd() {
-
         return fGrossweightd;
-
     }
 
-    public void setfNetweightd(BigDecimal fNetweightd) {
-
-        this.fNetweightd = fNetweightd;
-
+    public void setfGrossweightd(BigDecimal fGrossweightd) {
+        this.fGrossweightd = fGrossweightd;
     }
 
-
     public BigDecimal getfNetweightd() {
-
         return fNetweightd;
-
     }
 
-    public void setfVolumnc(BigDecimal fVolumnc) {
-
-        this.fVolumnc = fVolumnc;
-
+    public void setfNetweightd(BigDecimal fNetweightd) {
+        this.fNetweightd = fNetweightd;
     }
 
-
     public BigDecimal getfVolumnc() {
-
         return fVolumnc;
-
     }
 
-    public void setfQtyc(Long fQtyc) {
-
-        this.fQtyc = fQtyc;
-
+    public void setfVolumnc(BigDecimal fVolumnc) {
+        this.fVolumnc = fVolumnc;
     }
 
-
     public Long getfQtyc() {
-
         return fQtyc;
-
     }
 
-    public void setfQtyblc(Long fQtyblc) {
-
-        this.fQtyblc = fQtyblc;
-
+    public void setfQtyc(Long fQtyc) {
+        this.fQtyc = fQtyc;
     }
 
-
-    public Long getfQtyblc() {
-
-        return fQtyblc;
-
+    public BigDecimal getfGrossweightc() {
+        return fGrossweightc;
     }
 
     public void setfGrossweightc(BigDecimal fGrossweightc) {
-
         this.fGrossweightc = fGrossweightc;
-
     }
 
+    public Long getfQtyblc() {
+        return fQtyblc;
+    }
 
-    public BigDecimal getfGrossweightc() {
-
-        return fGrossweightc;
+    public void setfQtyblc(Long fQtyblc) {
+        this.fQtyblc = fQtyblc;
+    }
 
+    public BigDecimal getfGrossweightblc() {
+        return fGrossweightblc;
     }
 
     public void setfGrossweightblc(BigDecimal fGrossweightblc) {
-
         this.fGrossweightblc = fGrossweightblc;
-
     }
 
-
-    public BigDecimal getfGrossweightblc() {
-
-        return fGrossweightblc;
-
+    public BigDecimal getfNetweightc() {
+        return fNetweightc;
     }
 
     public void setfNetweightc(BigDecimal fNetweightc) {
-
         this.fNetweightc = fNetweightc;
-
     }
 
-
-    public BigDecimal getfNetweightc() {
-
-        return fNetweightc;
-
+    public BigDecimal getfNetweightblc() {
+        return fNetweightblc;
     }
 
     public void setfNetweightblc(BigDecimal fNetweightblc) {
-
         this.fNetweightblc = fNetweightblc;
-
     }
 
-
-    public BigDecimal getfNetweightblc() {
-
-        return fNetweightblc;
-
+    public BigDecimal getfVolumnblc() {
+        return fVolumnblc;
     }
 
     public void setfVolumnblc(BigDecimal fVolumnblc) {
-
         this.fVolumnblc = fVolumnblc;
-
     }
 
-
-    public BigDecimal getfVolumnblc() {
-
-        return fVolumnblc;
-
+    public String getfCntrno() {
+        return fCntrno;
     }
 
     public void setfCntrno(String fCntrno) {
-
         this.fCntrno = fCntrno;
-
     }
 
-
-    public String getfCntrno() {
-
-        return fCntrno;
-
+    public String getfStatus() {
+        return fStatus;
     }
 
     public void setfStatus(String fStatus) {
-
         this.fStatus = fStatus;
-
     }
 
-
-    public String getfStatus() {
-
-        return fStatus;
-
+    public String getDelFlag() {
+        return delFlag;
     }
 
     public void setDelFlag(String delFlag) {
-
         this.delFlag = delFlag;
-
     }
 
-
-    public String getDelFlag() {
-
-        return delFlag;
-
+    public Long getfBusinessType() {
+        return fBusinessType;
     }
 
-    public void setfMarks(String fMarks) {
-        this.fMarks = fMarks;
+    public void setfBusinessType(Long fBusinessType) {
+        this.fBusinessType = fBusinessType;
     }
 
     public String getfMarks() {
         return fMarks;
     }
 
-    public void setfBusinessType(Long fBusinessType) {
-        this.fBusinessType = fBusinessType;
+    public void setfMarks(String fMarks) {
+        this.fMarks = fMarks;
     }
 
-    public Long getfBusinessType() {
-        return fBusinessType;
+    public Date getfOriginalbilldate() {
+        return fOriginalbilldate;
     }
 
     public void setfOriginalbilldate(Date fOriginalbilldate) {
-
         this.fOriginalbilldate = fOriginalbilldate;
-
     }
 
+    public List<String> getOrgStorageDate() {
+        return orgStorageDate;
+    }
 
-    public Date getfOriginalbilldate() {
-
-        return fOriginalbilldate;
-
+    public void setOrgStorageDate(List<String> orgStorageDate) {
+        this.orgStorageDate = orgStorageDate;
     }
 
     public Long getfLocation() {
@@ -660,50 +510,72 @@ public class TWhgenleg extends BaseEntity {
         this.fLocation = fLocation;
     }
 
-    @Override
+    public Long getIsCntrno() {
+        return isCntrno;
+    }
 
-    public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                .append("fId", getfId())
-                .append("fAccyear", getfAccyear())
-                .append("fAccmonth", getfAccmonth())
-                .append("fCorpid", getfCorpid())
-                .append("fMblno", getfMblno())
-                .append("fOriginalbillno", getfOriginalbillno())
-                .append("fWarehouseLocationid", getfWarehouseLocationid())
-                .append("fGoodsid", getfGoodsid())
-                .append("fChargedate", getfChargedate())
-                .append("fTrademodeid", getfTrademodeid())
-                .append("fPreqty", getfPreqty())
-                .append("fWarehouseid", getfWarehouseid())
-                .append("fPregrossweight", getfPregrossweight())
-                .append("fPrenetweight", getfPrenetweight())
-                .append("fQtyd", getfQtyd())
-                .append("fVolumnd", getfVolumnd())
-                .append("fBillingway", getfBillingway())
-                .append("fGrossweightd", getfGrossweightd())
-                .append("fNetweightd", getfNetweightd())
-                .append("fVolumnc", getfVolumnc())
-                .append("fQtyc", getfQtyc())
-                .append("fGrossweightc", getfGrossweightc())
-                .append("fQtyblc", getfQtyblc())
-                .append("fGrossweightblc", getfGrossweightblc())
-                .append("fNetweightc", getfNetweightc())
-                .append("fNetweightblc", getfNetweightblc())
-                .append("fVolumnblc", getfVolumnblc())
-                .append("fCntrno", getfCntrno())
-                .append("fStatus", getfStatus())
-                .append("delFlag", getDelFlag())
-                .append("createBy", getCreateBy())
-                .append("fMarks", getfMarks())
-                .append("fBusinessType", getfBusinessType())
-                .append("createTime", getCreateTime())
-                .append("updateBy", getUpdateBy())
-                .append("updateTime", getUpdateTime())
-                .append("remark", getRemark())
-                .append("fOriginalbilldate", getfOriginalbilldate())
-                .toString();
+    public void setIsCntrno(Long isCntrno) {
+        this.isCntrno = isCntrno;
+    }
+
+    public String getTimeStartBsdate() {
+        return timeStartBsdate;
     }
 
+    public void setTimeStartBsdate(String timeStartBsdate) {
+        this.timeStartBsdate = timeStartBsdate;
+    }
+
+    public String getTimeEndBsdate() {
+        return timeEndBsdate;
+    }
+
+    public void setTimeEndBsdate(String timeEndBsdate) {
+        this.timeEndBsdate = timeEndBsdate;
+    }
+
+    @Override
+    public String toString() {
+        return "TWhgenleg{" +
+                "fId=" + fId +
+                ", fAccyear=" + fAccyear +
+                ", fAccmonth=" + fAccmonth +
+                ", fCorpid=" + fCorpid +
+                ", fMblno='" + fMblno + '\'' +
+                ", fOriginalbillno='" + fOriginalbillno + '\'' +
+                ", fWarehouseLocationid=" + fWarehouseLocationid +
+                ", fGoodsid=" + fGoodsid +
+                ", fChargedate=" + fChargedate +
+                ", fTrademodeid=" + fTrademodeid +
+                ", fPreqty=" + fPreqty +
+                ", fWarehouseid=" + fWarehouseid +
+                ", fPregrossweight=" + fPregrossweight +
+                ", fPrenetweight=" + fPrenetweight +
+                ", fQtyd=" + fQtyd +
+                ", fVolumnd=" + fVolumnd +
+                ", fBillingway=" + fBillingway +
+                ", fGrossweightd=" + fGrossweightd +
+                ", fNetweightd=" + fNetweightd +
+                ", fVolumnc=" + fVolumnc +
+                ", fQtyc=" + fQtyc +
+                ", fGrossweightc=" + fGrossweightc +
+                ", fQtyblc=" + fQtyblc +
+                ", fGrossweightblc=" + fGrossweightblc +
+                ", fNetweightc=" + fNetweightc +
+                ", fNetweightblc=" + fNetweightblc +
+                ", fVolumnblc=" + fVolumnblc +
+                ", fCntrno='" + fCntrno + '\'' +
+                ", fStatus='" + fStatus + '\'' +
+                ", delFlag='" + delFlag + '\'' +
+                ", fBusinessType=" + fBusinessType +
+                ", fMarks='" + fMarks + '\'' +
+                ", fOriginalbilldate=" + fOriginalbilldate +
+                ", orgStorageDate=" + orgStorageDate +
+                ", fLocation=" + fLocation +
+                ", isCntrno=" + isCntrno +
+                ", timeStartBsdate='" + timeStartBsdate + '\'' +
+                ", timeEndBsdate='" + timeEndBsdate + '\'' +
+                '}';
+    }
 }
 

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

@@ -99,5 +99,12 @@ public interface TWhgenlegMapper {
      * @param tWarehouseBills
      * @return
      */
-    List<Map<String, Object>> selectStorageFeeItemList(@Param("warehouse") TWarehouseBills tWarehouseBills);
+    public List<Map<String, Object>> selectStorageFeeItemList(@Param("warehouse") TWarehouseBills tWarehouseBills);
+
+    /**
+     * 查询库存总账列表
+     * @param tWhgenleg 库存总账
+     * @return 库存总账集合
+     */
+    public List<Map<String, Object>> selectInventoryMapList(TWhgenleg tWhgenleg);
 }

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

@@ -34,14 +34,22 @@ public interface ITWhgenlegService {
     public List<TWhgenleg> selectTWhgenlegList(TWhgenleg tWhgenleg);
 
     /**
-     * 查询库存总账列表
+     * 出库、调拨、货转查询库存总账列表
      *
      * @param tWhgenleg 库存总账
-     *      * @return 库存总账集合
+     * @return 库存总账集合
      */
     List<Map<String, Object>> selectInventoryList(TWhgenleg tWhgenleg);
 
     /**
+     * 查询库存总账列表
+     *
+     * @param tWhgenleg 库存总账
+     * @return 库存总账集合
+     */
+    List<Map<String, Object>> selectInventoryMapList(TWhgenleg tWhgenleg);
+
+    /**
      * 新增库存总账
      *
      * @param tWhgenleg 库存总账

+ 25 - 3
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java

@@ -70,10 +70,10 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
     }
 
     /**
-     * 查询库存总账列表
+     * 出库、调拨、货转查询库存总账列表
      *
      * @param tWhgenleg 库存总账
-     * @return 库存总账
+     *      * @return 库存总账集合
      */
     @Override
     public List<Map<String, Object>> selectInventoryList(TWhgenleg tWhgenleg) {
@@ -89,6 +89,26 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
         return tWhgenlegMapper.selectInventoryList(tWhgenleg);
     }
 
+    /**
+     * 查询库存总账列表
+     *
+     * @param tWhgenleg 库存总账
+     * @return 库存总账集合
+     */
+    @Override
+    public List<Map<String, Object>> selectInventoryMapList(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.selectInventoryMapList(tWhgenleg);
+    }
+
     @Override
     public List<Map<String, Object>> selectWhgenlegList(TWhgenleg tWhgenleg) {
         if(StringUtils.isNotNull(tWhgenleg.getfWarehouseLocationid())){
@@ -367,7 +387,9 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
 
     @Override
     public List<Map<String, Object>> selectdetailedList(TWarehousebill tWarehousebill) {
-        return tWarehouseBillsMapper.selectDetailedList(tWarehousebill);
+        List<Map<String, Object>> mapList = tWarehouseBillsMapper.selectDetailedList(tWarehousebill);
+        System.out.println(mapList);
+        return mapList;
     }
 
     /**

+ 7 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsitemsMapper.java

@@ -121,4 +121,11 @@ public interface TWarehousebillsitemsMapper extends BaseMapper<TWarehousebillsit
      * @return
      */
     public Map<String, Object> selectWarehouseItemsByPId(Long fId);
+
+    /**
+     *  根据主表id查询明细是否存在已入库、出库、货转、调拨的明细
+     * @param fId    主表id
+     * @return  结果
+     */
+    public int selectItemFStatusByFPid(Long fId);
 }

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

@@ -118,7 +118,7 @@ public interface ITWarehouseBillsService {
      * @param fIds 需要删除的详情主表ID
      * @return 结果
      */
-    public int deleteTWarehousebillsByIds(Long[] fIds);
+    public AjaxResult deleteTWarehousebillsByIds(Long[] fIds);
     /**
      * 批量删除凯和订单主表
      *

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

@@ -23,7 +23,6 @@ import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.finance.domain.TWareHouseFees;
 import com.ruoyi.reportManagement.domain.TWareHouseItemsExcel;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
 import com.ruoyi.reportManagement.mapper.TWhgenlegMapper;
@@ -45,8 +44,6 @@ import com.ruoyi.warehouseBusiness.domain.*;
 import com.ruoyi.warehouseBusiness.excel.*;
 import com.ruoyi.warehouseBusiness.mapper.*;
 import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.SpreadsheetVersion;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellReference;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -173,6 +170,8 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         List<Long> goodsId = new ArrayList<>();
         // 费用
         List<Long> feesId = new ArrayList<>();
+        // 车队
+        List<Long> fleetId = new ArrayList<>();
         // 库区
         List<Long> warehouseAreaId = new ArrayList<>();
         if (!StringUtils.isNull(tWarehousebills)) {
@@ -236,6 +235,10 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     Integer fGoodsid = (Integer) wb.get("fGoodsid");
                     goodsId.add(fGoodsid.longValue());
                 }
+                if (StringUtils.isNotNull(wb.get("fFleet"))) {
+                    Integer fFleetid = (Integer) wb.get("fFleet");
+                    fleetId.add(fFleetid.longValue());
+                }
                 if (StringUtils.isNotNull(wb.get("fWarehouselocid"))) {
                     Long fWarehouselocid = Long.valueOf(String.valueOf(wb.get("fWarehouselocid")));
                     if (wb.get("fTransferWarehouselocid") != null) {
@@ -295,6 +298,14 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 goodsList.add(tGoods);
             }
         }
+        List<TCorps> fleetList = new ArrayList<>();
+        List<Long> fleetIdList = StringUtils.integerDeduplication(fleetId);
+        for (Long goods : fleetIdList) {
+            TCorps fleet = tCorpsMapper.selectTCorpsById(goods);
+            if (StringUtils.isNotNull(fleet)) {
+                fleetList.add(fleet);
+            }
+        }
         List<TFees> feesList = new ArrayList<>();
         List<Long> longList = StringUtils.integerDeduplication(feesId);
         for (Long fees : longList) {
@@ -306,6 +317,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         map.put("corps", corpsList);
         map.put("goodsList", goodsList);
         map.put("feesList", feesList);
+        map.put("fleetList", fleetList);
         map.put("sysUser", sysUserList);
         map.put("warehouse", warehouseList);
         map.put("warehouseAreas", warehouseAreaList);
@@ -362,9 +374,10 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
      *
      * @param warehouseBills      仓库主表
      * @param warehousebillsitems 仓库明细表
+     * @param ifCntrno
      * @return 库存总账
      */
-    public TWhgenleg queryTWhgenleg(TWarehouseBills warehouseBills, TWarehousebillsitems warehousebillsitems) {
+    public TWhgenleg queryTWhgenleg(TWarehouseBills warehouseBills, TWarehousebillsitems warehousebillsitems, String ifCntrno) {
         TWhgenleg tWhgenleg = new TWhgenleg();
         // 客户
         tWhgenleg.setfCorpid(warehouseBills.getfCorpid());
@@ -388,7 +401,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             e.printStackTrace();
         }
         // 箱号
-        if (StringUtils.isNotEmpty(warehousebillsitems.getfCntrno())) {
+        if ("1".equals(ifCntrno)) {
             tWhgenleg.setfCntrno(warehousebillsitems.getfCntrno());
         }
         // 库区
@@ -1741,6 +1754,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 warehouseBills.setfMblno(warehouseBills.getfMblno() + "/" + warehousebillsitems.getfMblno());
             }
         }
+        warehouseBills.setfItemsStatus(1L);
         warehouseBills.setUpdateTime(new Date());
         warehouseBills.setUpdateBy(SecurityUtils.getUsername());
         tWarehouseBillsMapper.updateTWarehousebills(warehouseBills);
@@ -2252,6 +2266,10 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             return AjaxResult.error("请确认是该明细数据是否存在,或该明细数据状态异常");
         }
         String billsType = warehousebillsitems.getfBilltype();
+        TGoods goods = tGoodsMapper.selectTGoodsById(warehousebillsitems.getfGoodsid());
+        if ("1".equals(goods.getIfCntrno()) && StringUtils.isNull(warehousebillsitems.getfCntrno())) {
+            return AjaxResult.error("仓库明细第未找到箱号");
+        }
         if ("SJRK".equals(billsType)) {
             // 查询库容量  是否可入库
             int m = calculation(warehouseBills.getfWarehouseid(), warehousebillsitems.getfGrossweight());
@@ -2259,7 +2277,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("更新库存总账失败-->入库毛重大于库容");
             }
-            TWhgenleg tWhgenle = queryTWhgenleg(warehouseBills, warehousebillsitems);
+            TWhgenleg tWhgenle = queryTWhgenleg(warehouseBills, warehousebillsitems, goods.getIfCntrno());
             if (StringUtils.isNotNull(tWhgenle)) {
                 int i = updateTWhgenlegData(tWarehousebillsitems, tWhgenle.getfId(), billsType);
                 if (i <= 0) {
@@ -2287,7 +2305,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             }
         } else if ("SJCK".equals(billsType)) {
             // 查询总账是否存在
-            TWhgenleg tWhgenle = queryTWhgenleg(warehouseBills, warehousebillsitems);
+            TWhgenleg tWhgenle = queryTWhgenleg(warehouseBills, warehousebillsitems, goods.getIfCntrno());
             if (StringUtils.isNull(tWhgenle)) { // 为空 提示没有库存
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("库存明细库存为空");
@@ -2311,6 +2329,10 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             // 添加状态log
             insertTWarehousebillsLog(tWarehousebillsitems, 40L, loginUser);
         }
+        warehouseBills.setfItemsStatus(4L);
+        warehouseBills.setUpdateTime(new Date());
+        warehouseBills.setUpdateBy(SecurityUtils.getUsername());
+        tWarehouseBillsMapper.updateTWarehousebills(warehouseBills);
         tEnclosureMapper.deleteByFPid(warehouseBills.getfId());
         //  附件添加
         if (StringUtils.isNotEmpty(attachs) && !"[]".equals(attachs)) {
@@ -2525,7 +2547,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
 
 
     /**
-     * 入库详情入账
+     * 入库确认
      *
      * @param warehouseBills      主表
      * @param warehousebillsitems 明细
@@ -2574,7 +2596,11 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 item.setfOriginalbilldate(item.getfBsdate());
                 item.setfBillingway(tWarehouseBills.getfBillingway());
                 item.setfChargedate(item.getfBsdate());
-                TWhgenleg tWhgenle = queryTWhgenleg(tWarehouseBills, item);
+                TGoods goods = tGoodsMapper.selectTGoodsById(item.getfGoodsid());
+                if ("1".equals(goods.getIfCntrno()) && StringUtils.isNull(item.getfCntrno())) {
+                    return AjaxResult.error("仓库明细第"+i+"行未找到箱号");
+                }
+                TWhgenleg tWhgenle = queryTWhgenleg(tWarehouseBills, item, goods.getIfCntrno());
                 if (StringUtils.isNotNull(tWhgenle)) {
                     int i1 = updateTWhgenlegData(item, tWhgenle.getfId(), billsType);
                     if (i1 <= 0) {
@@ -2720,6 +2746,10 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("更新库存明细第" + i + "行失败,已处理,请刷新网页");
             }
+            TGoods goods = tGoodsMapper.selectTGoodsById(wbItem.getfGoodsid());
+            if ("1".equals(goods.getIfCntrno()) && StringUtils.isNull(wbItem.getfCntrno())) {
+                return AjaxResult.error("仓库明细第"+i+"行未找到箱号");
+            }
             long warehouselocId = 0L;
             long transferWarehouselocid = 0L;
             if ("CKDB".equals(billsType) | "HWTG".equals(billsType)) {
@@ -2728,7 +2758,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
 //                wbItem.setfWarehouselocid(transferWarehouselocid);
             }
             // 查询总账是否存在
-            TWhgenleg tWhgenle = queryTWhgenleg(tWarehouseBills, wbItem);
+            TWhgenleg tWhgenle = queryTWhgenleg(tWarehouseBills, wbItem, goods.getIfCntrno());
             //  入库数特殊不判断入账
             if ("SJCK".equals(billsType)) { // 出库 查询
                 if (StringUtils.isNull(tWhgenle)) { // 为空 提示没有库存
@@ -2797,7 +2827,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     }
                     // 3、 进行入库操作 查询是否存在库存
                     wbItem.setfWarehouselocid(transferWarehouselocid); // 新库区
-                    TWhgenleg tWhgenle1 = queryTWhgenleg(tWarehouseBills, wbItem);
+                    TWhgenleg tWhgenle1 = queryTWhgenleg(tWarehouseBills, wbItem, goods.getIfCntrno());
                     if (StringUtils.isNull(tWhgenle1)) {   // 5、 不存在 进行新增库存
                         instalTWhgenleg(tWarehouseBills, wbItem, loginUser.getUser());
                     } else { // 4、 存在 进行跟新库存
@@ -2823,7 +2853,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     long corpId = tWarehouseBills.getfCorpid();
                     tWarehouseBills.setfCorpid(tWarehouseBills.getfTocorpid());
                     // 3、 进行入库操作 查询是否存在库存
-                    TWhgenleg tWhgenle1 = queryTWhgenleg(tWarehouseBills, wbItem);
+                    TWhgenleg tWhgenle1 = queryTWhgenleg(tWarehouseBills, wbItem, goods.getIfCntrno());
                     if (StringUtils.isNull(tWhgenle1)) {   // 5、 不存在 进行新增库存
                         instalTWhgenleg(tWarehouseBills, wbItem, loginUser.getUser());
                     } else { // 4、 存在 进行跟新库存
@@ -3495,18 +3525,23 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
      * @return 结果
      */
     @Override
-    public int deleteTWarehousebillsByIds(Long[] fIds) {
+    public AjaxResult deleteTWarehousebillsByIds(Long[] fIds) {
         // 取出业务编号、 放入 billno_del
         for (Long id : fIds) {
             // 1、查询主表信息
             TWarehouseBills tWarehousebills = tWarehouseBillsMapper.selectTWarehousebillsById(id);
+            // 查询对应库存明细是否允许删除
+            if (tWarehousebillsitemsMapper.selectItemFStatusByFPid(id) != 0) {
+                return AjaxResult.error("删除失败,该单据库存明细已入账");
+            }
             // 2、业务编号、客存编号 放入 billno_del
             BillnoDel billnoDel = new BillnoDel();
             billnoDel.setBillType(tWarehousebills.getfBilltype());
             billnoDel.setBillNo(tWarehousebills.getfBillno());
             billnoDelMapper.insertBillnoDel(billnoDel);
         }
-        return tWarehouseBillsMapper.deleteTWarehousebillsByIds(fIds);
+        tWarehouseBillsMapper.deleteTWarehousebillsByIds(fIds);
+        return AjaxResult.success();
     }
 
     @Override
@@ -3666,9 +3701,13 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         if (StringUtils.isNotEmpty(warehousebillsitemsList)) {
             int i = 1;
             for (TWarehousebillsitems wb : warehousebillsitemsList) {
+                TGoods goods = tGoodsMapper.selectTGoodsById(wb.getfGoodsid());
+                if ("1".equals(goods.getIfCntrno()) && StringUtils.isNull(wb.getfCntrno())) {
+                    return AjaxResult.error("仓库明细第"+i+"行未找到箱号");
+                }
                 SerialNumberList.add(wb.getfSerialNumber()); // 流水号回收
                 // 查询库存总账
-                TWhgenleg tWhgenle = queryTWhgenleg(tWarehousebills, wb);
+                TWhgenleg tWhgenle = queryTWhgenleg(tWarehousebills, wb, goods.getIfCntrno());
                 if ("SJRKRevoke".equals(billsType)) { // 撤销 入库
                     if (wb.getfIsInventory().equals(0L)) {
                         if (StringUtils.isNotNull(tWhgenle) && (wb.getfQty() <= tWhgenle.getfQtyblc())) { // 非空 且 撤销数 <= 结余数
@@ -3693,7 +3732,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     //  1、新货权方撤销入库
                     // 查询库存总账
                     wb.setfWarehouselocid(transferWarehouselocid);
-                    TWhgenleg tWhgenle1 = queryTWhgenleg(tWarehousebills, wb);
+                    TWhgenleg tWhgenle1 = queryTWhgenleg(tWarehousebills, wb, goods.getIfCntrno());
                     if (StringUtils.isNotNull(tWhgenle1) && (wb.getfQty() <= tWhgenle1.getfQtyblc())) {
                         updateTWhgenlegData(wb, tWhgenle1.getfId(), "SJRKRevoke");
                     } else {
@@ -3703,7 +3742,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     //  2、原货权方撤销出库
                     // 查询库存总账
                     wb.setfWarehouselocid(warehouselocid);
-                    TWhgenleg tWhgenle2 = queryTWhgenleg(tWarehousebills, wb);
+                    TWhgenleg tWhgenle2 = queryTWhgenleg(tWarehousebills, wb, goods.getIfCntrno());
                     updateTWhgenlegData(wb, tWhgenle2.getfId(), "SJCKRevoke");
                     wb.setfBillstatus(10L);
                 } else if ("HWTGRevoke".equals(billsType)) { // 调拨 撤销
@@ -3717,7 +3756,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     // 查询库存总账
                     wb.setfWarehouselocid(transferWarehouselocid);
                     tWarehousebills.setfTrademodeid(newfTrademodeid); // 查询用新的
-                    TWhgenleg tWhgenle1 = queryTWhgenleg(tWarehousebills, wb);
+                    TWhgenleg tWhgenle1 = queryTWhgenleg(tWarehousebills, wb, goods.getIfCntrno());
                     if (StringUtils.isNotNull(tWhgenle1) && (wb.getfQty() <= tWhgenle1.getfQtyblc())) {
                         updateTWhgenlegData(wb, tWhgenle1.getfId(), "SJRKRevoke");
                     } else {
@@ -3728,7 +3767,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     // 查询库存总账
                     wb.setfWarehouselocid(warehouselocid);
                     tWarehousebills.setfTrademodeid(oldfTrademodeid); // 撤销回到旧的
-                    TWhgenleg tWhgenle2 = queryTWhgenleg(tWarehousebills, wb);
+                    TWhgenleg tWhgenle2 = queryTWhgenleg(tWarehousebills, wb, goods.getIfCntrno());
                     updateTWhgenlegData(wb, tWhgenle2.getfId(), "SJCKRevoke");
                     wb.setfBillstatus(10L);
                 } else if ("HQZYRevoke".equals(billsType)) { // 货转撤销
@@ -3737,7 +3776,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     //  1、新货权方撤销入库
                     // 查询库存总账
                     tWarehousebills.setfCorpid(fTocorpid);
-                    TWhgenleg tWhgenle1 = queryTWhgenleg(tWarehousebills, wb);
+                    TWhgenleg tWhgenle1 = queryTWhgenleg(tWarehousebills, wb, goods.getIfCntrno());
                     if (StringUtils.isNotNull(tWhgenle1) && (wb.getfQty() <= tWhgenle1.getfQtyblc())) {
                         updateTWhgenlegData(wb, tWhgenle1.getfId(), "SJRKRevoke");
                     } else {
@@ -3747,7 +3786,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     //  2、原货权方撤销出库
                     // 查询库存总账
                     tWarehousebills.setfCorpid(fCorpid);
-                    TWhgenleg tWhgenle2 = queryTWhgenleg(tWarehousebills, wb);
+                    TWhgenleg tWhgenle2 = queryTWhgenleg(tWarehousebills, wb, goods.getIfCntrno());
                     updateTWhgenlegData(wb, tWhgenle2.getfId(), "SJCKRevoke");
                     wb.setfBillstatus(1L);
                 }
@@ -3761,18 +3800,20 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 }
             }
         }
-        /**
-         * 流水号回收
-         *  2、 流水号去重
-         *  3、 添加到 billno_del
-         */
-        List<String> serialNumberNewList = delRepeat(SerialNumberList);
-        serialNumberNewList.forEach(item -> {
-            BillnoDel billnoDel = new BillnoDel();
-            billnoDel.setBillType(item.substring(0, 2));
-            billnoDel.setBillNo(item);
-            billnoDelMapper.insertBillnoDel(billnoDel);
-        });
+        if (!"HQZYRevoke".equals(billsType)) {
+            /**
+             * 流水号回收
+             *  2、 流水号去重
+             *  3、 添加到 billno_del
+             */
+            List<String> serialNumberNewList = delRepeat(SerialNumberList);
+            serialNumberNewList.forEach(item -> {
+                BillnoDel billnoDel = new BillnoDel();
+                billnoDel.setBillType(item.substring(0, 2));
+                billnoDel.setBillNo(item);
+                billnoDelMapper.insertBillnoDel(billnoDel);
+            });
+        }
         //  箱型数据
         if (StringUtils.isNotNull(tCntr) && !"[]".equals(tCntr)) {
             JSONArray jsonDrArray = JSONArray.parseArray(tCntr);

+ 55 - 47
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -510,6 +510,8 @@
             AND dict1.status = '0'
             AND dict.dict_type = 'storage_type'
             AND dict1.dict_type = 'data_trademodes'
+            AND leg.f_qtyD != 0
+            AND leg.f_qtyblc != 0
             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
@@ -549,54 +551,56 @@
         </where>
         ${params.dataScope}
     </select>
-    <!--<select id="selectInventoryList" parameterType="TWhgenleg" resultType="Map">
+
+    <select id="selectInventoryMapList" parameterType="TWhgenleg" resultType="Map">
         select
-        leg.f_id AS fId,
-        leg.f_corpid AS fCorpIds,
-        corp.f_name AS fCorpid,
-        ware.f_warehouse_information AS fWarehouseids,
-        area.f_name AS fWarehouseLocationids,
-        leg.f_originalbillno AS fOriginalbillno,
-        leg.f_warehouse_locationid AS fWarehouseLocationid,
-        dict1.dict_label AS fTrademodeid,
-        goods.f_name AS fGoodsids,
-        leg.f_trademodeid AS fTrademodeids,
-        goods.f_packagespecs AS fPackagespecs,
-        leg.f_goodsid AS fGoodsid,
-        SUM(leg.f_volumnD) AS fVolumnD,
-        SUM(leg.f_qtyD) AS fQtyD,
-        leg.f_mblno AS fMblno,
-        SUM(leg.f_grossweightD) AS fGrossweightD,
-        SUM(leg.f_netweightD) AS fNetweightD,
-        SUM(leg.f_volumnC) AS fVolumnC,
-        SUM(leg.f_volumnblc) AS fVolumnblc,
-        SUM(leg.f_qtyC) AS fQtyC,
-        leg.f_business_type AS fBusinessType,
-        SUM(leg.f_grossweightC) AS fGrossweightC,
-        SUM(leg.f_netweightC) AS fNetweightC,
-        SUM(leg.f_qtyblc) AS fQtyblc,
-        leg.f_billingway AS fBillingway,
-        leg.f_chargedate AS fChargedate,
-        SUM(leg.f_grossweightblc) AS fGrossweightblc,
-        SUM(leg.f_netweightblc) AS fNetweightblc,
-        dict.dict_label AS fBusinessTypes,
-        leg.f_marks AS fMarks,
-        DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
-        DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
-        leg.f_cntrno AS fCntrno
+            leg.f_id AS fId,
+            leg.f_corpid AS fCorpIds,
+            corp.f_name AS fCorpid,
+            ware.f_warehouse_information AS fWarehouseids,
+            area.f_name AS fWarehouseLocationids,
+            leg.f_originalbillno AS fOriginalbillno,
+            leg.f_warehouse_locationid AS fWarehouseLocationid,
+            dict1.dict_label AS fTrademodeid,
+            goods.f_name AS fGoodsids,
+            leg.f_trademodeid AS fTrademodeids,
+            goods.f_packagespecs AS fPackagespecs,
+            leg.f_goodsid AS fGoodsid,
+            SUM(leg.f_volumnD) AS fVolumnD,
+            SUM(leg.f_qtyD) AS fQtyD,
+            leg.f_mblno AS fMblno,
+            SUM(leg.f_grossweightD) AS fGrossweightD,
+            SUM(leg.f_netweightD) AS fNetweightD,
+            SUM(leg.f_volumnC) AS fVolumnC,
+            SUM(leg.f_volumnblc) AS fVolumnblc,
+            SUM(leg.f_qtyC) AS fQtyC,
+            leg.f_business_type AS fBusinessType,
+            SUM(leg.f_grossweightC) AS fGrossweightC,
+            SUM(leg.f_netweightC) AS fNetweightC,
+            SUM(leg.f_qtyblc) AS fQtyblc,
+            leg.f_billingway AS fBillingway,
+            leg.f_chargedate AS fChargedate,
+            SUM(leg.f_grossweightblc) AS fGrossweightblc,
+            SUM(leg.f_netweightblc) AS fNetweightblc,
+            dict.dict_label AS fBusinessTypes,
+            leg.f_marks AS fMarks,
+            DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
+            DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
+            leg.f_cntrno AS fCntrno
         FROM
-        t_whgenleg leg
-        left join sys_user u on leg.create_by = u.user_name
-        left join sys_dept d on u.dept_id = d.dept_id
-        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_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
-        LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
+            t_whgenleg leg
+            left join sys_user u on leg.create_by = u.user_name
+            left join sys_dept d on u.dept_id = d.dept_id
+            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_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
+            LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
         <where>
             dict.status = '0'
             AND dict1.status = '0'
+            AND leg.f_qtyD != 0
             AND dict.dict_type = 'storage_type'
             AND dict1.dict_type = 'data_trademodes'
             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
@@ -629,17 +633,21 @@
             <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 leg.f_warehouseid = #{fWarehouseid} </if>
-
-            <if test="fLocation != null  and fLocation ==1 ">
+            <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>
+            <if test="isCntrno == null or isCntrno ==0 ">
+                GROUP BY leg.f_corpid, leg.f_mblno, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid
+            </if>
+            <if test="isCntrno != null and isCntrno ==1 ">
+                GROUP BY leg.f_corpid, leg.f_mblno, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid, f_cntrno
+            </if>
         </where>
-        GROUP BY leg.f_corpid, leg.f_mblno, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid
         ${params.dataScope}
-    </select>-->
+    </select>
 
     <select id="selectWhgenlegList" resultType="java.util.Map">
         select

+ 201 - 217
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -1137,103 +1137,89 @@
     </update>
 
     <select id="selectDetailedList" resultType="java.util.Map">
-        SELECT t.f_id                       AS fId,
-               item.f_id                    AS fItemsId,
-               C.f_name                     AS fcorpid,
-               t.f_mblno                    AS fMblno,
-               g.f_name                     AS fGoodsid,
-               dict.dict_label              AS fBusinessType,
-               t.f_marks                    AS fMarks,
-               CASE
-                   WHEN t.f_billtype = 'SJRK' THEN
-                       '入库'
-                   WHEN t.f_billtype = 'SJCK' THEN
-                       '出库'
-                   WHEN t.f_billtype = 'CKDB' THEN
-                       '调拨'
-                   WHEN t.f_billtype = 'HQZY' THEN
-                       '货权转移'
-                   WHEN t.f_billtype = 'HWTG' THEN
-                       '货物通关'
-                   END                      AS fBilltype,
-               item.f_bsdate                AS fBsdate,
-               item.f_warehouse_information AS fWarehouseInformation,
-               dictTra.dict_label           AS fTrademodeid,
-               CASE
-                   WHEN t.f_billtype = 'SJRK' THEN
-                       item.f_qty
-                   else '0'
-                   END                      AS fQtyRK,
-               CASE
-                   WHEN t.f_billtype = 'SJRK' THEN
-                       item.f_grossweight
-                   else '0'
-                   END                      AS fGrossweightRK,
-               CASE
-                   WHEN t.f_billtype = 'SJRK' THEN
-                       item.f_netweight
-                   else '0'
-                   END                      AS fNetweightRK,
-               CASE
-                   WHEN t.f_billtype = 'SJCK' THEN
-                       item.f_qty
-                   else '0'
-                   END                      AS fQtyCK,
-               CASE
-                   WHEN t.f_billtype = 'SJCK' THEN
-                       item.f_grossweight
-                   else '0'
-                   END                      AS fGrossweightCK,
-               CASE
-                   WHEN t.f_billtype = 'SJCK' THEN
-                       item.f_netweight
-                   else '0'
-                   END                      AS fNetweightCK,
-               CASE
-                   WHEN t.f_billtype = 'CKDB' THEN
-                       item.f_qty
-                   else '0'
-                   END                      AS fQtyDB,
-               CASE
-                   WHEN t.f_billtype = 'CKDB' THEN
-                       item.f_grossweight
-                   else '0'
-                   END                      AS fGrossweightDB,
-               CASE
-                   WHEN t.f_billtype = 'CKDB' THEN
-                       item.f_netweight
-                   else '0'
-                   END                      AS fNetweightDB,
-               CASE
-                   WHEN t.f_billtype = 'HQZY' THEN
-                       item.f_qty
-                   else '0'
-                   END                      AS fQtyHZ,
-               CASE
-                   WHEN t.f_billtype = 'HQZY' THEN
-                       item.f_grossweight
-                   else '0'
-                   END                      AS fGrossweightHZ,
-               CASE
-                   WHEN t.f_billtype = 'HQZY' THEN
-                       item.f_netweight
-                   else '0'
-                   END                      AS fNetweightHZ,
-               CASE
-                   WHEN t.f_billtype = 'HWTG' THEN
-                       item.f_qty
-                   else '0'
-                   END                      AS fQtyTG,
-               CASE
-                   WHEN t.f_billtype = 'HWTG' THEN
-                       item.f_grossweight
-                   else '0'
-                   END                      AS fGrossweightTG,
-               CASE
-                   WHEN t.f_billtype = 'HWTG' THEN
-                       item.f_netweight
-                   else '0'
-                   END                      AS fNetweightTG
+        SELECT
+            t.f_id AS fId,
+            item.f_id AS fItemsId,
+            C.f_name AS fcorpid,
+            t.f_mblno AS fMblno,
+            g.f_name AS fGoodsid,
+            dict.dict_label AS fBusinessType,
+            t.f_marks AS fMarks,
+        CASE
+                WHEN t.f_billtype = 'SJRK' THEN
+                '入库'
+                WHEN t.f_billtype = 'SJCK' THEN
+                '出库'
+                WHEN t.f_billtype = 'CKDB' THEN
+                '调拨'
+                WHEN t.f_billtype = 'HQZY' THEN
+                '货权转移'
+                WHEN t.f_billtype = 'HWTG' THEN
+                '货物通关'
+            END AS fBilltype,
+            item.f_bsdate AS fBsdate,
+            item.f_warehouse_information AS fWarehouseInformation,
+            dictTra.dict_label AS fTrademodeid,
+        CASE
+                WHEN t.f_billtype = 'SJRK' THEN
+                ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fQtyRK,
+        CASE
+                WHEN t.f_billtype = 'SJRK' THEN
+                ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fGrossweightRK,
+        CASE
+                WHEN t.f_billtype = 'SJRK' THEN
+                ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fNetweightRK,
+        CASE
+                WHEN t.f_billtype = 'SJCK' THEN
+                ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fQtyCK,
+        CASE
+                WHEN t.f_billtype = 'SJCK' THEN
+                ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fGrossweightCK,
+        CASE
+                WHEN t.f_billtype = 'SJCK' THEN
+                ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fNetweightCK,
+        CASE
+                WHEN t.f_billtype = 'CKDB' THEN
+                ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fQtyDB,
+        CASE
+                WHEN t.f_billtype = 'CKDB' THEN
+                ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fGrossweightDB,
+        CASE
+                WHEN t.f_billtype = 'CKDB' THEN
+                ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fNetweightDB,
+        CASE
+                WHEN t.f_billtype = 'HQZY' THEN
+                ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fQtyHZ,
+        CASE
+                WHEN t.f_billtype = 'HQZY' THEN
+                ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fGrossweightHZ,
+        CASE
+                WHEN t.f_billtype = 'HQZY' THEN
+                ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fNetweightHZ,
+        CASE
+                WHEN t.f_billtype = 'HWTG' THEN
+                ( SELECT SUM( it.f_qty ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fQtyTG,
+        CASE
+                WHEN t.f_billtype = 'HWTG' THEN
+                ( SELECT SUM( it.f_grossweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fGrossweightTG,
+        CASE
+                WHEN t.f_billtype = 'HWTG' THEN
+                ( SELECT SUM( it.f_netweight ) FROM t_warehousebillsitems it WHERE it.f_pid = item.f_pid ) ELSE 0
+            END AS fNetweightTG
         FROM t_warehousebills t
                  LEFT JOIN t_warehousebillsitems item ON item.f_pid = t.f_id
                  LEFT JOIN t_goods g ON item.f_goodsid = g.f_id
@@ -1254,133 +1240,131 @@
           AND item.f_goodsid = #{fGoodsid}
           AND item.f_marks = #{fMarks}
           AND t.f_corpid = #{fCorpIds}
-
+        GROUP BY t.f_id
     </select>
 
     <select id="webVersionOrderList" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
-        SELECT tw.f_id,
-        tw.f_billno,
-        tw.f_customsdeclartion,
-        tw.f_originalbillno,
-        tw.f_deptid,
-        tw.f_bsdeptid,
-        tw.f_contacts,
-        tw.f_tel,
-        tw.f_corpid,
-        tc.f_name corpName,
-        tw.f_tocorpid,
-        tw.f_stltypeid,
-        tw.f_bscorpno,
-        tw.f_warehouseid,
-        tw.f_storekeeper,
-        tw.f_chargedate,
-        tw.f_bsdate,
-        tw.f_planqty,
-        tw.f_plangrossweight,
-        tw.f_plannetweight,
-        tw.f_planvolumn,
-        tw.f_qty,
-        tw.f_grossweight,
-        tw.f_netweight,
-        tw.f_volumn,
-        tw.f_billingway,
-        tw.f_trademodeid,
-        tw.f_sbu,
-        tw.f_feetunit,
-        tw.f_mblno,
-        tw.f_marks,
-        tw.f_vslvoy,
-        tw.f_eta,
-        tw.f_customno,
-        tw.f_ifweigh,
-        tw.f_ifpledge,
-        tw.f_ifdamage,
-        tw.f_bankcorpid,
-        tw.f_billtype,
-        tw.f_billstatus,
-        tw.f_items_status,
-        tw.del_flag,
-        tw.create_by,
-        tw.create_time,
-        tw.update_by,
-        tw.update_time,
-        tw.remark,
-        tw.f_billing_deadline,
-        tw.f_product_name,
-        tw.f_review_date,
-        tw.f_truckno,
-        tw.f_driver_name,
-        tw.f_driver_tel,
-        tw.f_driver_id_car,
-        tw.f_business_type,
-        tw.f_labour,
-        tw.f_fleet,
-        tw.f_inwarehouseid,
-        tw.f_bstime,
-        tw.f_cartype,
-        tw.f_goodsid,
-        tw.f_new_trademodeid,
-        tw.f_loadportid,
-        address.f_name loadportidName,
-        tw.f_destportid,
-        ta.f_name destportidName,
-        tw.f_serviceitems,
-        sd.dict_label serviceitemsName,
-        tw.f_invoceobj,
-        sdi.dict_label invoceobjName,
-        tw.f_sign,
-        sdc.dict_label signName,
-        tw.f_detentioncargo,
-        sdt.dict_label detentioncargoName,
-        tw.f_booksmarks,
-        tw.f_shippername,
-        tw.f_shipperattn,
-        tw.f_shippertel,
-        tw.f_consigneername,
-        tw.f_consigneeattn,
-        tw.f_consigneetel,
-        tw.f_insurance,
-        sdd.dict_label insuranceName,
-        tw.f_insuranceamt,
-        tw.f_closedate,
-        tw.f_docmentdate,
-        tw.f_vslid,
-        tv.f_name vslidName,
-        tw.f_voyid,
-        ty.f_no voyidName,
-        tw.f_typeid,
-        tw.f_paymode,
-        sda.dict_label paymodeName,
-        tw.f_laneid,
-        tr.f_name laneidName
+        SELECT
+            tw.f_id,
+            tw.f_billno,
+            tw.f_customsdeclartion,
+            tw.f_originalbillno,
+            tw.f_deptid,
+            tw.f_bsdeptid,
+            tw.f_contacts,
+            tw.f_tel,
+            tw.f_corpid,
+            tc.f_name corpName,
+            tw.f_tocorpid,
+            tw.f_stltypeid,
+            tw.f_bscorpno,
+            tw.f_warehouseid,
+            tw.f_storekeeper,
+            tw.f_chargedate,
+            tw.f_bsdate,
+            tw.f_planqty,
+            tw.f_plangrossweight,
+            tw.f_plannetweight,
+            tw.f_planvolumn,
+            tw.f_qty,
+            tw.f_grossweight,
+            tw.f_netweight,
+            tw.f_volumn,
+            tw.f_billingway,
+            tw.f_trademodeid,
+            tw.f_sbu,
+            tw.f_feetunit,
+            tw.f_mblno,
+            tw.f_marks,
+            tw.f_vslvoy,
+            tw.f_eta,
+            tw.f_customno,
+            tw.f_ifweigh,
+            tw.f_ifpledge,
+            tw.f_ifdamage,
+            tw.f_bankcorpid,
+            tw.f_billtype,
+            tw.f_billstatus,
+            tw.f_items_status,
+            tw.del_flag,
+            tw.create_by,
+            tw.create_time,
+            tw.update_by,
+            tw.update_time,
+            tw.remark,
+            tw.f_billing_deadline,
+            tw.f_product_name,
+            tw.f_review_date,
+            tw.f_truckno,
+            tw.f_driver_name,
+            tw.f_driver_tel,
+            tw.f_driver_id_car,
+            tw.f_business_type,
+            tw.f_labour,
+            tw.f_fleet,
+            tw.f_inwarehouseid,
+            tw.f_bstime,
+            tw.f_cartype,
+            tw.f_goodsid,
+            tw.f_new_trademodeid,
+            tw.f_loadportid,
+            address.f_name loadportidName,
+            tw.f_destportid,
+            ta.f_name destportidName,
+            tw.f_serviceitems,
+            sd.dict_label serviceitemsName,
+            tw.f_invoceobj,
+            sdi.dict_label invoceobjName,
+            tw.f_sign,
+            sdc.dict_label signName,
+            tw.f_detentioncargo,
+            sdt.dict_label detentioncargoName,
+            tw.f_booksmarks,
+            tw.f_shippername,
+            tw.f_shipperattn,
+            tw.f_shippertel,
+            tw.f_consigneername,
+            tw.f_consigneeattn,
+            tw.f_consigneetel,
+            tw.f_insurance,
+            sdd.dict_label insuranceName,
+            tw.f_insuranceamt,
+            tw.f_closedate,
+            tw.f_docmentdate,
+            tw.f_vslid,
+            tv.f_name vslidName,
+            tw.f_voyid,
+            ty.f_no voyidName,
+            tw.f_typeid,
+            tw.f_paymode,
+            sda.dict_label paymodeName,
+            tw.f_laneid,
+            tr.f_name laneidName
         FROM t_warehousebills tw
-        LEFT JOIN t_address address ON address.f_id = tw.f_loadportid
-        LEFT JOIN t_address ta ON ta.f_id = tw.f_loadportid
-        LEFT JOIN t_address tr ON tr.f_id = tw.f_laneid
-        LEFT JOIN t_corps tc ON tc.f_id = tw.f_corpid
-        LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems
-        AND sd.dict_type = 'f_serviceitems'
-        LEFT JOIN sys_dict_data sdi ON sdi.dict_value = tw.f_invoceobj
-        AND sdi.dict_type = 'f_invoceobj'
-        LEFT JOIN sys_dict_data sdc ON sdc.dict_value = tw.f_sign
-        AND sdc.dict_type = 'f_sign'
-        LEFT JOIN sys_dict_data sdt ON sdt.dict_value = tw.f_detentioncargo
-        AND sdt.dict_type = 'f_detentioncargo'
-        LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tw.f_insurance
-        AND sdd.dict_type = 'f_insurance'
-        LEFT JOIN sys_dict_data sda ON sda.dict_value = tw.f_paymode
-        AND sda.dict_type = 'f_paymode'
-        LEFT JOIN t_vessel tv ON tv.f_id = tw.f_vslid
-        LEFT JOIN t_voyage ty ON ty.f_id = tw.f_voyid
+            LEFT JOIN t_address address ON address.f_id = tw.f_loadportid
+            LEFT JOIN t_address ta ON ta.f_id = tw.f_loadportid
+            LEFT JOIN t_address tr ON tr.f_id = tw.f_laneid
+            LEFT JOIN t_corps tc ON tc.f_id = tw.f_corpid
+            LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems
+            AND sd.dict_type = 'f_serviceitems'
+            LEFT JOIN sys_dict_data sdi ON sdi.dict_value = tw.f_invoceobj
+            AND sdi.dict_type = 'f_invoceobj'
+            LEFT JOIN sys_dict_data sdc ON sdc.dict_value = tw.f_sign
+            AND sdc.dict_type = 'f_sign'
+            LEFT JOIN sys_dict_data sdt ON sdt.dict_value = tw.f_detentioncargo
+            AND sdt.dict_type = 'f_detentioncargo'
+            LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tw.f_insurance
+            AND sdd.dict_type = 'f_insurance'
+            LEFT JOIN sys_dict_data sda ON sda.dict_value = tw.f_paymode
+            AND sda.dict_type = 'f_paymode'
+            LEFT JOIN t_vessel tv ON tv.f_id = tw.f_vslid
+            LEFT JOIN t_voyage ty ON ty.f_id = tw.f_voyid
         <where>
             tw.f_typeid = '1'
             <if test="fId != null">and tw.f_id = #{fId}</if>
             <if test="fBillno != null  and fBillno != ''">and tw.f_billno = #{fBillno}</if>
-            <if test="fCustomsdeclartion != null  and fCustomsdeclartion != ''">and tw.f_customsdeclartion =
-                #{fCustomsdeclartion}
-            </if>
-            <if test="fOriginalbillno != null  and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}
-            </if>
+            <if test="fCustomsdeclartion != null  and fCustomsdeclartion != ''">and tw.f_customsdeclartion =#{fCustomsdeclartion}</if>
+            <if test="fOriginalbillno != null  and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}</if>
             <if test="fDeptid != null ">and tw.f_deptid = #{fDeptid}</if>
             <if test="fBsdeptid != null ">and tw.f_bsdeptid = #{fBsdeptid}</if>
             <if test="fContacts != null  and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
@@ -1972,7 +1956,7 @@
             LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
             LEFT JOIN t_corps c ON c.f_id = w.f_corpid
             LEFT JOIN t_warehouse ware ON IF(item.f_billtype = 'CKDB', ware.f_id = item.f_transfer_warehouselocid, ware.f_id = item.f_warehouselocid)
-            LEFT JOIN sys_dict_data d ON d.dict_value = item.f_business_type
+            LEFT JOIN sys_dict_data d ON d.dict_value = w.f_business_type
         WHERE
             w.f_corpid = #{fCorpid}
             AND item.f_mblno = #{fMblno}

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

@@ -182,8 +182,8 @@
             item.f_stevedore AS fStevedore,
             item.f_forkliftman AS fForkliftman,
             item.f_localcntrno AS fLocalcntrno,
-            l.dict_label AS lntypes,
-            item.f_lntype AS lntype,
+            l.dict_label AS fLntypes,
+            item.f_lntype AS fLntype,
             item.f_sealno AS fSealno,
             item.f_warehouse_information AS fWarehouseInformation,
             item.f_orgwarehouse_information AS fOrgwarehouseInformation
@@ -639,6 +639,16 @@
             t.f_id = #{fId}
     </select>
 
+    <select id="selectItemFStatusByFPid" resultType="java.lang.Integer">
+        SELECT
+            IFNULL( COUNT( w.f_id ), 0 )
+        FROM
+            t_warehousebills w
+            LEFT JOIN t_warehousebillsitems i ON i.f_pid = w.f_id
+        WHERE
+            w.f_id = #{fId}
+            AND i.f_billstatus = 40
+    </select>
 
     <update id="warehouseItemFollowUpdate" parameterType="Long">
         update