caifc 3 gadi atpakaļ
vecāks
revīzija
b56e3a20a2

+ 90 - 52
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehousebillsfees.java

@@ -1,5 +1,6 @@
 package com.ruoyi.warehouseBusiness.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
@@ -37,6 +38,12 @@ public class TWarehousebillsfees extends BaseEntity {
     private Long fLineno;
 
     /**
+     * 仓库id
+     */
+    @Excel(name = "仓库id")
+    private Long fWarehouseid;
+
+    /**
      * 客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name
      */
     @Excel(name = "客户名称,t_corps 中的no或 name,模糊查找选择后,存储id,显示name")
@@ -250,11 +257,15 @@ public class TWarehousebillsfees extends BaseEntity {
     @Excel(name = "单据类型(数据字典)SJRK", readConverterExp = "入=库")
     private String fBilltype;
 
-    /** 入(出)库日期 */
+    /**
+     * 入(出)库日期
+     */
     @Excel(name = "入", readConverterExp = "出=")
     private Date fBsdate;
 
-    /** 入库日期(原始) */
+    /**
+     * 入库日期(原始)
+     */
     @Excel(name = "入库日期", readConverterExp = "原=始")
     private Date fOriginalbilldate;
 
@@ -270,7 +281,9 @@ public class TWarehousebillsfees extends BaseEntity {
     @Excel(name = "结算方式,默认提取corps中stltypeid	也可以从表t_stltypes中下拉选择,存储id,显示name")
     private Long fStltypeid;
 
-    /** 业务类型(存汉字的,用来区别 如: 来车提货,出库装箱  区别) */
+    /**
+     * 业务类型(存汉字的,用来区别 如: 来车提货,出库装箱  区别)
+     */
     @Excel(name = "业务类型(存汉字的,用来区别 如: 来车提货,出库装箱  区别)")
     private String fBusinessType;
 
@@ -298,6 +311,18 @@ public class TWarehousebillsfees extends BaseEntity {
     //状态中文
     private String fBillstatusName;
 
+    // 仓库名称
+    @TableField(exist = false)
+    private String warehouseName;
+
+    public String getWarehouseName() {
+        return warehouseName;
+    }
+
+    public void setWarehouseName(String warehouseName) {
+        this.warehouseName = warehouseName;
+    }
+
     public String getfBillstatusName() {
         return fBillstatusName;
     }
@@ -312,7 +337,7 @@ public class TWarehousebillsfees extends BaseEntity {
     private String fYears;
 
     /**
-     *  月份
+     * 月份
      */
     private List<String> fMonth;
 
@@ -701,55 +726,68 @@ public class TWarehousebillsfees extends BaseEntity {
         this.fBusinessType = fBusinessType;
     }
 
+    public Long getfWarehouseid() {
+        return fWarehouseid;
+    }
+
+    public void setfWarehouseid(Long fWarehouseid) {
+        this.fWarehouseid = fWarehouseid;
+    }
+
     @Override
     public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                .append("fId", getfId())
-                .append("fPid", getfPid())
-                .append("fLineno", getfLineno())
-                .append("fCorpid", getfCorpid())
-                .append("fFeeid", getfFeeid())
-                .append("fFeeunitid", getfFeeunitid())
-                .append("fQty", getfQty())
-                .append("fUnitprice", getfUnitprice())
-                .append("fAmount", getfAmount())
-                .append("fCurrency", getfCurrency())
-                .append("fExrate", getfExrate())
-                .append("fTaxrate", getfTaxrate())
-                .append("fDc", getfDc())
-                .append("fBillstatus", getfBillstatus())
-                .append("fReviewDate", getfReviewDate())
-                .append("fAccamount", getfAccamount())
-                .append("fStatementNo", getfStatementNo())
-                .append("fStlamount", getfStlamount())
-                .append("fInvnos", getfInvnos())
-                .append("fAccamountDate", getfAccamountDate())
-                .append("fInvamount", getfInvamount())
-                .append("fStlamountNo", getfStlamountNo())
-                .append("fAskamount", getfAskamount())
-                .append("fStatus", getfStatus())
-                .append("fStlamountDate", getfStlamountDate())
-                .append("delFlag", getDelFlag())
-                .append("createBy", getCreateBy())
-                .append("createTime", getCreateTime())
-                .append("updateBy", getUpdateBy())
-                .append("updateTime", getUpdateTime())
-                .append("remark", getRemark())
-                .append("srcId", getSrcId())
-                .append("srcBillNo", getSrcBillNo())
-                .append("fMblno", getfMblno())
-                .append("fProductName", getfProductName())
-                .append("fOriginalbilldate", getfOriginalbilldate())
-                .append("fBsdate", getfBsdate())
-                .append("fMarks", getfMarks())
-                .append("fChargedate", getfChargedate())
-                .append("fBillingDeadline", getfBillingDeadline())
-                .append("fInventoryDays", getfInventoryDays())
-                .append("fAmt", getfAmt())
-                .append("fBillingDays", getfBillingDays())
-                .append("fBillingQty", getfBillingQty())
-                .append("fBilltype", getfBilltype())
-                .append("fBillingway", getfBillingway())
-                .toString();
+        return "TWarehousebillsfees{" +
+                "fId=" + fId +
+                ", fPid=" + fPid +
+                ", fLineno=" + fLineno +
+                ", fWarehouseid=" + fWarehouseid +
+                ", fCorpid=" + fCorpid +
+                ", fFeeid=" + fFeeid +
+                ", fFeeunitid=" + fFeeunitid +
+                ", fQty=" + fQty +
+                ", fUnitprice=" + fUnitprice +
+                ", fAmount=" + fAmount +
+                ", fCurrency='" + fCurrency + '\'' +
+                ", fExrate=" + fExrate +
+                ", fTaxrate=" + fTaxrate +
+                ", fDc='" + fDc + '\'' +
+                ", fBillstatus=" + fBillstatus +
+                ", fReviewDate=" + fReviewDate +
+                ", fAccamount=" + fAccamount +
+                ", fStatementNo='" + fStatementNo + '\'' +
+                ", fStlamount=" + fStlamount +
+                ", fInvnos='" + fInvnos + '\'' +
+                ", fAccamountDate=" + fAccamountDate +
+                ", fInvamount=" + fInvamount +
+                ", fStlamountNo='" + fStlamountNo + '\'' +
+                ", fAskamount=" + fAskamount +
+                ", fStatus='" + fStatus + '\'' +
+                ", fStlamountDate=" + fStlamountDate +
+                ", delFlag='" + delFlag + '\'' +
+                ", srcId=" + srcId +
+                ", srcBillNo='" + srcBillNo + '\'' +
+                ", fMblno='" + fMblno + '\'' +
+                ", fProductName='" + fProductName + '\'' +
+                ", fMarks='" + fMarks + '\'' +
+                ", fChargedate=" + fChargedate +
+                ", fBillingDeadline=" + fBillingDeadline +
+                ", fInventoryDays=" + fInventoryDays +
+                ", fAmt=" + fAmt +
+                ", fBillingDays=" + fBillingDays +
+                ", fBillingQty=" + fBillingQty +
+                ", fBilltype='" + fBilltype + '\'' +
+                ", fBsdate=" + fBsdate +
+                ", fOriginalbilldate=" + fOriginalbilldate +
+                ", fBillingway=" + fBillingway +
+                ", fStltypeid=" + fStltypeid +
+                ", fBusinessType='" + fBusinessType + '\'' +
+                ", fBsdateList=" + fBsdateList +
+                ", fSrcTypeId=" + fSrcTypeId +
+                ", corpName='" + corpName + '\'' +
+                ", feeName='" + feeName + '\'' +
+                ", fBillstatusName='" + fBillstatusName + '\'' +
+                ", fYears='" + fYears + '\'' +
+                ", fMonth=" + fMonth +
+                '}';
     }
 }

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

@@ -452,7 +452,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
                                                BigDecimal itemNums,
                                                Long earlySumDays,
                                                String cangKey,
-                                               String warehouseId) {
+                                               Long warehouseId) {
         Map<String, Object> map = new HashMap<>();
         if (null == fCorpid ||
                 null == fGoodsid ||
@@ -464,7 +464,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
             return null;
         }
         List<TWarehouseAgreementitems> itemList =
-                this.tWarehouseAgreementitemsMapper.getItemsBytWarehouseAgreementMsg(fCorpid, fGoodsid, feeUnitid, warehouseId, cangKey);
+                this.tWarehouseAgreementitemsMapper.getItemsBytWarehouseAgreementMsg(fCorpid, fGoodsid, feeUnitid, String.valueOf(warehouseId), cangKey);
         if (CollUtil.isEmpty(itemList)) {
             return null;
         }

+ 21 - 10
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -3988,7 +3988,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             Date fBsdate = (Date) item.get("fBsdate");
             long fCorpid = warehouseBills.getfCorpid();
             String fBilltype = (String) item.get("fBilltype");
-            String warehouseId = item.get("warehouse").toString();
+            Long warehouseId = Long.parseLong(String.valueOf(item.get("warehouse")));
             String fGoodsid = (String) item.get("fTypeid");
             if (StringUtils.isNotEmpty(fGoodsid)) {
                 fGoodsid = "\"" + fGoodsid + "\"";
@@ -4030,7 +4030,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 mblno = item.get("fMblno").toString();
             }
             String remark = objectMap.get("remark").toString();
-            feeId = Long.valueOf(String.valueOf(objectMap.get("feeId"))).longValue();
+            feeId = Long.parseLong(String.valueOf(objectMap.get("feeId")));
             BigDecimal amt = (BigDecimal) objectMap.get("amt");
             map.put("feeId", feeId);
             map.put("itemFeeId", objectMap.get("feeId"));
@@ -4050,8 +4050,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             fees.setfBillingQty(fQty);
             fees.setfUnitprice(sumAmt);
             fees.setfBilltype(fBilltype);
-            fees.setfBillingDays(fBillingDays);
             fees.setCreateTime(new Date());
+            fees.setfWarehouseid(warehouseId);
+            fees.setfBillingDays(fBillingDays);
             fees.setfQty(new BigDecimal(1));
             fees.setfPid(warehouseBills.getfId());
             fees.setfInventoryDays(fInventoryDays);
@@ -4069,7 +4070,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             }
             fees.setfTaxrate(new BigDecimal(taxRate.get(0).getDictValue()));
             fees.setfOriginalbilldate((Date) item.get("fOriginalbilldate"));
-            fees.setfBillingway(Long.valueOf(String.valueOf(item.get("fBillingway"))).longValue());
+            fees.setfBillingway(Long.parseLong(String.valueOf(item.get("fBillingway"))));
             tWarehousebillsfeesMapper.insertTWarehousebillsfees(fees);
             itemsList.add(fees);
         }
@@ -4101,7 +4102,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             long fCorpid = warehouseBills.getfCorpid();
             String fBilltype = (String) item.get("fBilltype");
             String fGoodsid = (String) item.get("fTypeid");
-            String warehouseId = (String) item.get("warehouse");
+            Long warehouseId = Long.parseLong(String.valueOf(item.get("warehouse")));
             if (StringUtils.isNotEmpty(fGoodsid)) {
                 fGoodsid = "\"" + fGoodsid + "\"";
             }
@@ -4164,6 +4165,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             fees.setfBilltype(fBilltype);
             fees.setfBillingDays(fBillingDays);
             fees.setCreateTime(new Date());
+            fees.setfWarehouseid(warehouseId);
             fees.setfQty(new BigDecimal(1));
             fees.setfPid(warehouseBills.getfId());
             fees.setfInventoryDays(fInventoryDays);
@@ -4233,7 +4235,6 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         }
         // 计划物资明细
         List<TWarehousebillsfees> itemsList = new ArrayList<>();
-        BigDecimal bigDecimal = new BigDecimal(0);
         Map<String, Object> map = new HashMap<>();
         //调一次公共方法,获取字符类型的true或者false传
         String cangKey = sysConfigServiceImpl.selectConfigByKey("agreement.warehouse");
@@ -4241,6 +4242,8 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         long whgenlegFeeId = 0;
         // 计费单位
         long feeUnitid = 1;
+        // 查出所有仓库 给后续匹配仓库名字使用
+        List<TWarehouse> warehouseList = tWarehouseMapper.selectTWarehouseList(new TWarehouse());
         // 查询 出库 货转的库存明细
         List<Map<String, Object>> warehousebillsitemsList = tWarehousebillsitemsMapper.selectStorageFeeItemList(tWarehouseBills);
         if (warehousebillsitemsList.size() != 0) {
@@ -4250,6 +4253,12 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 return AjaxResult.error((String) mapItem.get("error"));
             }
             itemsList = (List<TWarehousebillsfees>) mapItem.get("itemsList");
+            // 给仓库信息赋值
+            itemsList.forEach(li -> {
+                TWarehouse tWarehouse = warehouseList.stream().filter(warehouse -> Objects.equals(warehouse.getfId(), li.getfWarehouseid()))
+                        .findFirst().orElseThrow(() -> new WarehouseException("找不到仓库信息"));
+                li.setWarehouseName(tWarehouse.getfName());
+            });
         }
         List<Map<String, Object>> tWhgenlegs = tWhgenlegMapper.selectStorageFeeItemList(tWarehouseBills);
         if (tWhgenlegs.size() != 0) {
@@ -4259,10 +4268,12 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 return AjaxResult.error((String) mapItem.get("error"));
             }
             List<TWarehousebillsfees> itemList = (List<TWarehousebillsfees>) mapItem.get("itemsList");
-            if (itemList.size() != 0) {
-                for (TWarehousebillsfees ite : itemList) {
-                    itemsList.add(ite);
-                }
+            // 给仓库信息赋值
+            for (TWarehousebillsfees li : itemList) {
+                TWarehouse tWarehouse = warehouseList.stream().filter(warehouse -> Objects.equals(warehouse.getfId(), li.getfWarehouseid()))
+                        .findFirst().orElseThrow(() -> new WarehouseException("找不到仓库信息"));
+                li.setWarehouseName(tWarehouse.getfName());
+                itemsList.add(li);
             }
         }
         TFees tFees = new TFees();

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

@@ -106,8 +106,8 @@
             t_warehouse_agreement AS agreement
             LEFT JOIN t_warehouse_agreementitems AS items ON agreement.f_id = items.f_pid
         <where>
-            <if test="cangKey == '0'">AND JSON_CONTAINS( agreement.f_warehouseid -> '$[*]', #{cangKuZhi}, '$')</if>
             AND agreement.f_corpid = #{fCorpid}
+            <if test="cangKey == 0"> AND JSON_CONTAINS( agreement.f_warehouseid -> '$[*]', #{cangKuZhi}, '$')</if>
             AND JSON_CONTAINS( agreement.t_packages -> '$[*]', #{fGoodsid}, '$')
             AND items.f_feeUnitid = #{feeUnitid}
             AND agreement.f_status = '0'

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

@@ -11,6 +11,7 @@
         <result property="fCorpid" column="f_corpid"/>
         <result property="fFeeid" column="f_feeid"/>
         <result property="fFeeunitid" column="f_feeUnitid"/>
+        <result property="fWarehouseid" column="f_warehouseid"/>
         <result property="fQty" column="f_qty"/>
         <result property="fUnitprice" column="f_unitprice"/>
         <result property="fAmount" column="f_amount"/>