浏览代码

修改入库修改查询信息,入库表、库存总账表添加字段

阿伏兔 4 年之前
父节点
当前提交
f9444e06a5

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

@@ -193,6 +193,10 @@ public class TWarehouseBills extends BaseEntity {
     @Excel(name = "船名航次,CMA/A0001")
     private String fVslvoy;
 
+    /** 唛头 */
+    @Excel(name = "唛头")
+    private String fMarks;
+
     /**
      * 到港日期
      */
@@ -479,6 +483,16 @@ public class TWarehouseBills extends BaseEntity {
         return fVslvoy;
     }
 
+    public void setfMarks(String fMarks)
+    {
+        this.fMarks = fMarks;
+    }
+
+    public String getfMarks()
+    {
+        return fMarks;
+    }
+
     public void setfEta(Date fEta) {
         this.fEta = fEta;
     }
@@ -583,6 +597,7 @@ public class TWarehouseBills extends BaseEntity {
                 .append("fFeetunit", getfFeetunit())
                 .append("fMblno", getfMblno())
                 .append("fVslvoy", getfVslvoy())
+                .append("fMarks", getfMarks())
                 .append("fEta", getfEta())
                 .append("fCustomno", getfCustomno())
                 .append("fIfweigh", getfIfweigh())

+ 15 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWhgenleg.java

@@ -42,6 +42,12 @@ public class TWhgenleg extends BaseEntity {
     private String fMblno;
 
     /**
+     * 唛头
+     */
+    @Excel(name = "唛头")
+    private String fMarks;
+
+    /**
      * 原始入库业务编号
      */
     @Excel(name = "原始入库业务编号")
@@ -211,6 +217,14 @@ public class TWhgenleg extends BaseEntity {
         return fOriginalbillno;
     }
 
+    public void setfMarks(String fMarks) {
+        this.fMarks = fMarks;
+    }
+
+    public String getfMarks() {
+        return fMarks;
+    }
+
     public void setfWarehouseLocationid(Long fWarehouseLocationid) {
         this.fWarehouseLocationid = fWarehouseLocationid;
     }
@@ -388,6 +402,7 @@ public class TWhgenleg extends BaseEntity {
                 .append("fPrenetweight", getfPrenetweight())
                 .append("fQtyd", getfQtyd())
                 .append("fVolumnd", getfVolumnd())
+                .append("fMarks", getfMarks())
                 .append("fGrossweightd", getfGrossweightd())
                 .append("fNetweightd", getfNetweightd())
                 .append("fVolumnc", getfVolumnc())

+ 4 - 8
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWhgenlegMapper.java

@@ -1,11 +1,11 @@
 package com.ruoyi.warehouseBusiness.mapper;
 
 
-import com.ruoyi.warehouseBusiness.domain.TWarehousebillsitems;
 import com.ruoyi.warehouseBusiness.domain.TWhgenleg;
-import io.lettuce.core.dynamic.annotation.Param;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 库存总账Mapper接口
@@ -73,12 +73,8 @@ public interface TWhgenlegMapper {
     /**
      * 修改库存总账表
      *
-     * @param whgenlegId           库存总账id
-     * @param billType            状态标识
-     * @param warehousebillsitems 仓库明细表
+     * @param map
      * @return 结果
      */
-    public int updateTWhgenlegData(@Param("whgenlegId") long whgenlegId,
-                               @Param("billType") String billType,
-                               @Param("warehousebillsitems") TWarehousebillsitems warehousebillsitems);
+    public int updateTWhgenlegData(@Param("map") Map<String, Object> map);
 }

+ 94 - 50
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -3,10 +3,8 @@ package com.ruoyi.warehouseBusiness.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.ruoyi.basicData.domain.TGoods;
-import com.ruoyi.basicData.mapper.TCorpsMapper;
-import com.ruoyi.basicData.mapper.TGoodsMapper;
-import com.ruoyi.basicData.mapper.TWarehouseMapper;
+import com.ruoyi.basicData.domain.*;
+import com.ruoyi.basicData.mapper.*;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
@@ -50,9 +48,15 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     private TCorpsMapper tCorpsMapper;
 
     @Autowired
+    private TFeesMapper tFeesMapper;
+
+    @Autowired
     private TWarehouseMapper tWarehouseMapper;
 
     @Autowired
+    private TWarehouseAreaMapper tWarehouseAreaMapper;
+
+    @Autowired
     private TEnclosureMapper tEnclosureMapper;
 
     @Autowired
@@ -80,56 +84,91 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         Map<String, Object> map = new HashMap<>();
         // 查询仓库主表数据
         TWarehouseBills tWarehousebills = tWarehouseBillsMapper.selectTWarehousebillsById(fId);
+        // 客户表
+        List<TCorps> corpsList = new ArrayList<>();
+        // 用户表
+        List<SysUser> sysUserList = new ArrayList<>();
+        // 仓库表
+        List<TWarehouse> warehouseList = new ArrayList<>();
+        // 商品
+        List<TGoods> goodsList = new ArrayList<>();
+        // 费用
+        List<TFees> feesList = new ArrayList<>();
+        // 库区
+        List<TWarehouseArea> warehouseAreaList = new ArrayList<>();
+
         if (!StringUtils.isNull(tWarehousebills)) {
-            // 查询货权方 以及 经营单位
-            map.put("warehouse", tWarehouseMapper.selectTWarehouseById(tWarehousebills.getfWarehouseid()));
-            // 查询联系人
-            map.put("sysUser", sysUserMapper.selectUserByUserName(tWarehousebills.getfContacts()));
             // 查询货权方
-            map.put("fCorps", tCorpsMapper.selectTCorpsById(tWarehousebills.getfCorpid()));
-            // 查询 经营单位
-            map.put("fSbu", tCorpsMapper.selectTCorpsById(tWarehousebills.getfSbu()));
-            // 查询所属部门
-            map.put("dept", sysDeptMapper.selectDeptById(tWarehousebills.getfDeptid()));
+            TCorps corps = tCorpsMapper.selectTCorpsById(tWarehousebills.getfCorpid());
+            if (StringUtils.isNotNull(corps)) {
+                corpsList.add(corps);
+            }
+            // 查询联系人
+            SysUser sysUser = sysUserMapper.selectUserByUserName(tWarehousebills.getfContacts());
+            if (StringUtils.isNotNull(sysUser)) {
+                sysUserList.add(sysUser);
+            }
+            // 查询仓库
+            TWarehouse tWarehouse = tWarehouseMapper.selectTWarehouseById(tWarehousebills.getfWarehouseid());
+            if (StringUtils.isNotNull(tWarehouse)) {
+                warehouseList.add(tWarehouse);
+            }
+            // 查询经营单位
+            TCorps corp = tCorpsMapper.selectTCorpsById(tWarehousebills.getfSbu());
+            if (StringUtils.isNotNull(corp)) {
+                corpsList.add(corp);
+            }
             map.put("warehousebills", tWarehousebills);
         }
         // 查询仓库明细从表数据
         TWarehousebillsitems tWarehousebillsitems = new TWarehousebillsitems();
         tWarehousebillsitems.setfPid(fId);
-
-
-
-
-
         List<TWarehousebillsitems> warehousebillsitems = tWarehousebillsitemsMapper.selectTWarehousebillsitemsList(tWarehousebillsitems);
-//        List<TWarehousebillsitems> warehousebillsitems = tWarehousebillsitemsMapper.selectList(new EntityWrapper<TWarehousebillsitems>().eq("f_pid", ));
-        if (!StringUtils.isEmpty(warehousebillsitems)) {
-            List<TGoods> goodsList = new ArrayList<>();
+        if (StringUtils.isNotEmpty(warehousebillsitems)) {
             for (TWarehousebillsitems wb : warehousebillsitems) {
                 TGoods tGoods = tGoodsMapper.selectTGoodsById(wb.getfGoodsid());
-                if (!StringUtils.isNull(tGoods)) {
+                if (StringUtils.isNotNull(tGoods)) {
                     goodsList.add(tGoods);
                 }
+                TWarehouseArea warehouseArea = tWarehouseAreaMapper.selectTWarehouseAreaById(wb.getfWarehouselocid());
+                if (StringUtils.isNotNull(warehouseArea)) {
+                    warehouseAreaList.add(warehouseArea);
+                }
             }
-            map.put("goodsList", goodsList);
             map.put("warehouseBillsItem", warehousebillsitems);
         }
+
         // 查询仓库费用明细表数据
         TWarehousebillsfees tWarehousebillsfees = new TWarehousebillsfees();
         tWarehousebillsfees.setfPid(fId);
         List<TWarehousebillsfees> warehousebillsfees = tWarehousebillsfeesMapper.selectTWarehousebillsfeesList(tWarehousebillsfees);
-//        List<TWarehousebillsfees> warehousebillsfees = tWarehousebillsfeesMapper.selectList(new EntityWrapper<TWarehousebillsfees>().eq("f_pid", fId));
-        if (!StringUtils.isEmpty(warehousebillsfees)) {
+        if (StringUtils.isNotEmpty(warehousebillsfees)) {
+            for (TWarehousebillsfees fees : warehousebillsfees) {
+                TCorps corps = tCorpsMapper.selectTCorpsById(fees.getfCorpid());
+                if (StringUtils.isNotNull(corps)) {
+                    corpsList.add(corps);
+                }
+                TFees tFees = tFeesMapper.selectTFeesById(fees.getfFeeid());
+                if (StringUtils.isNotNull(tFees)) {
+                    feesList.add(tFees);
+                }
+            }
             map.put("warehousebillsfees", warehousebillsfees);
         }
         // 查询附件表数据
         TEnclosure enclosure = new TEnclosure();
         enclosure.setfPid(fId);
         List<TEnclosure> enclosures = tEnclosureMapper.selectTEnclosureList(enclosure);
-//        List<TEnclosure> enclosures = tEnclosureMapper.selectList(new EntityWrapper<TEnclosure>().eq("f_pid", fId));
-        if (!StringUtils.isEmpty(enclosures)) {
+        if (StringUtils.isNotEmpty(enclosures)) {
             map.put("enclosures", enclosures);
         }
+        map.put("corps", corpsList);
+        map.put("goodsList", goodsList);
+        map.put("feesList", feesList);
+        map.put("sysUser", sysUserList);
+        map.put("warehouse", warehouseList);
+        map.put("warehouseAreas", warehouseAreaList);
+        map.put("dept", sysDeptMapper.selectDeptById(tWarehousebills.getfDeptid()));
         return map;
     }
 
@@ -219,7 +258,12 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
 
     @Transactional
     public int updateTWhgenlegData(TWarehousebillsitems warehousebillsitems, long whgenlegId, String billtype) {
-        return tWhgenlegMapper.updateTWhgenlegData(whgenlegId, billtype, warehousebillsitems);
+        Map<String, Object> map = new HashMap<>();
+        System.out.println(warehousebillsitems.toString());
+        map.put("whgenlegId", whgenlegId);
+        map.put("billType", billtype);
+        map.put("warehousebillsitems", warehousebillsitems);
+        return tWhgenlegMapper.updateTWhgenlegData(map);
     }
 
     /**
@@ -241,23 +285,24 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         Long fPid = null;
         TWarehouseBills warehouseBills = JSONArray.parseObject(tWarehouseBills, TWarehouseBills.class);
         if (StringUtils.isNull(warehouseBills.getfId())) {
+            // 如果是新数据
             warehouseBills.setCreateBy(loginUser.getUser().getUserName());
             warehouseBills.setfBilltype(billsType);
             warehouseBills.setfBsdeptid(loginUser.getUser().getDeptId());
             // 提交时:  生流水号
-            if(warehouseBills.getfBillstatus().equals("1")){
+            if (warehouseBills.getfBillstatus().equals("6")) {
                 // 业务编码
-                String billNo= billnoSerialServiceImpl.getBillNo("SJRK",warehouseBills.getfBsdate());
+                String billNo = billnoSerialServiceImpl.getBillNo("SJRK", warehouseBills.getfBsdate());
                 warehouseBills.setfBillno(billNo);
                 // 存货编码
                 Date time = new Date();
-                String bscorpno= billnoSerialServiceImpl.getCorpNo(warehouseBills.getfCorpid(),time);
+                String bscorpno = billnoSerialServiceImpl.getCorpNo(warehouseBills.getfCorpid(), time);
                 warehouseBills.setfBscorpno(bscorpno);
             }
             tWarehouseBillsMapper.insertTWarehousebills(warehouseBills);
-            fPid=warehouseBills.getfId();
+            fPid = warehouseBills.getfId();
         } else {
-            fPid=warehouseBills.getfId();
+            fPid = warehouseBills.getfId();
             warehouseBills.setUpdateBy(loginUser.getUser().getUserName());
             warehouseBills.setUpdateTime(new Date());
             tWarehouseBillsMapper.updateTWarehousebills(warehouseBills);
@@ -278,7 +323,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             }
         }
         //  附件添加
-        if (tWhgenleg != null) {
+        if (StringUtils.isNotNull(tWhgenleg)) {
             JSONArray jsonDrArray = JSONArray.parseArray(tWhgenleg);
             List<TEnclosure> tEnclosureList = JSONObject.parseArray(jsonDrArray.toJSONString(), TEnclosure.class);
             for (TEnclosure tEnclosure : tEnclosureList) {
@@ -294,11 +339,11 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             List<TWarehousebillsfees> warehousebillsfeesDrList = JSONObject.parseArray(jsonDrArray.toJSONString(), TWarehousebillsfees.class);
             for (TWarehousebillsfees wbDr : warehousebillsfeesDrList) {
                 // 检验  数量*单价=金额
-                if(wbDr.getfQty()!=null && ! wbDr.getfQty().equals("")
-                        && wbDr.getfUnitprice()!=null && ! wbDr.getfUnitprice().equals("")  ){
+                if (wbDr.getfQty() != null && !wbDr.getfQty().equals("")
+                        && wbDr.getfUnitprice() != null && !wbDr.getfUnitprice().equals("")) {
                     BigDecimal fqty = wbDr.getfQty();
                     BigDecimal funitprice = wbDr.getfUnitprice();
-                    Long result=check(fqty,funitprice);
+                    Long result = check(fqty, funitprice);
                     wbDr.setfAmount(result);
                 }
                 wbDr.setfPid(fPid);
@@ -314,11 +359,11 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             List<TWarehousebillsfees> warehousebillsfeesCrList = JSONObject.parseArray(jsonCrArray.toJSONString(), TWarehousebillsfees.class);
             for (TWarehousebillsfees wbCr : warehousebillsfeesCrList) {
                 // 检验  数量*单价=金额
-                if(wbCr.getfQty()!=null && ! wbCr.getfQty().equals("")
-                        && wbCr.getfUnitprice()!=null && ! wbCr.getfUnitprice().equals("")  ){
+                if (wbCr.getfQty() != null && !wbCr.getfQty().equals("")
+                        && wbCr.getfUnitprice() != null && !wbCr.getfUnitprice().equals("")) {
                     BigDecimal fqty = wbCr.getfQty();
                     BigDecimal funitprice = wbCr.getfUnitprice();
-                    Long result=check(fqty,funitprice);
+                    Long result = check(fqty, funitprice);
                     wbCr.setfAmount(result);
                 }
                 wbCr.setfPid(fPid);
@@ -334,16 +379,16 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             JSONArray warehouseJSON = JSONArray.parseArray(tWarehousebillsitems);
             List<TWarehousebillsitems> warehousebillsitemsList = JSONObject.parseArray(warehouseJSON.toJSONString(), TWarehousebillsitems.class);
             for (TWarehousebillsitems wbItem : warehousebillsitemsList) {
-                TWhgenleg tWhgenle=queryTWhgenleg(warehouseBills,wbItem);
-                if(StringUtils.isNull(tWhgenle)){ // 为空添加库存总账
-                    SysUser sysUser=new SysUser();
+                TWhgenleg tWhgenle = queryTWhgenleg(warehouseBills, wbItem);
+                if (StringUtils.isNull(tWhgenle)) { // 为空添加库存总账
+                    SysUser sysUser = new SysUser();
                     sysUser.setUserName(loginUser.getUser().getUserName());
-                    instalTWhgenleg(warehouseBills,wbItem,sysUser);
-                }else { // 非空修改库存总账  fBillstatus : 1 入库提交、 3 撤销入库 ; billtype : SJRK 入库 、SJRKRevoke 撤销入库
-                    if(warehouseBills.getfBillstatus().equals("1")){
-                        updateTWhgenlegData(wbItem,tWhgenle.getfId(),"SJRK");
-                    } else if (warehouseBills.getfBillstatus().equals("3")){
-                        updateTWhgenlegData(wbItem,tWhgenle.getfId(),"SJRKRevoke");
+                    instalTWhgenleg(warehouseBills, wbItem, sysUser);
+                } else { // 非空修改库存总账  fBillstatus : 6 入库提交、 3 撤销入库 ; billtype : SJRK 入库 、SJRKRevoke 撤销入库
+                    if (warehouseBills.getfBillstatus().equals("6")) {
+                        updateTWhgenlegData(wbItem, tWhgenle.getfId(), "SJRK");
+                    } else if (warehouseBills.getfBillstatus().equals("3")) {
+                        updateTWhgenlegData(wbItem, tWhgenle.getfId(), "SJRKRevoke");
                     }
                 }
             }
@@ -363,7 +408,6 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     }
 
 
-
     /**
      * 修改详情主表
      *

+ 41 - 21
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -34,6 +34,7 @@
         <result property="fFeetunit" column="f_feetunit"/>
         <result property="fMblno" column="f_mblno"/>
         <result property="fVslvoy" column="f_vslvoy"/>
+        <result property="fMarks" column="f_marks"/>
         <result property="fEta" column="f_eta"/>
         <result property="fCustomno" column="f_customno"/>
         <result property="fIfweigh" column="f_ifweigh"/>
@@ -51,7 +52,7 @@
     </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_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_eta, f_customno, f_ifweigh, f_ifpledge, f_ifdamage, f_bankcorpid, f_billtype, f_billstatus, del_flag, create_by, create_time, update_by, update_time, remark from t_warehousebills
+        select f_id, f_billno, f_customsdeclartion, f_originalbillno, f_deptid, f_bsdeptid, f_contacts, f_marks, f_tel, f_corpid, f_tocorpid, f_stltypeid, f_bscorpno, f_warehouseid, f_storekeeper, 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_eta, f_customno, f_ifweigh, f_ifpledge, f_ifdamage, f_bankcorpid, f_billtype, f_billstatus, del_flag, create_by, create_time, update_by, update_time, remark from t_warehousebills
     </sql>
 
     <select id="selectTWarehousebillsList" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
@@ -78,6 +79,7 @@
             <if test="fPlannetweight != null ">and f_plannetweight = #{fPlannetweight}</if>
             <if test="fPlanvolumn != null ">and f_planvolumn = #{fPlanvolumn}</if>
             <if test="fQty != null ">and f_qty = #{fQty}</if>
+            <if test="fMarks != null  and fMarks != ''">and f_marks = #{fMarks}</if>
             <if test="fGrossweight != null ">and f_grossweight = #{fGrossweight}</if>
             <if test="fNetweight != null ">and f_netweight = #{fNetweight}</if>
             <if test="fVolumn != null ">and f_volumn = #{fVolumn}</if>
@@ -100,31 +102,36 @@
 
     <select id="selectWarehouseBusinessList" parameterType="TWarehousebills" resultType="Map">
         SELECT
-            bill.f_id AS fId,
-            corp.f_name AS fCorpid,
-            bill.f_mblno AS fMblno,
-            corpSub.f_name AS fSbu,
-            bill.f_bsdate AS fBsdate,
-            bill.f_trademodeid AS fTrademodeid,
-            bill.f_warehouseid AS fWarehouseid,
-            bill.f_qty AS fQty,
-            bill.f_grossweight AS fGrossweight,
-            bill.f_netweight AS fNetweight
+        bill.f_id AS fId,
+        corp.f_name AS fCorpid,
+        bill.f_mblno AS fMblno,
+        corpSub.f_name AS fSbu,
+        bill.f_bsdate AS fBsdate,
+        bill.f_trademodeid AS fTrademodeid,
+        bill.f_warehouseid AS fWarehouseid,
+        bill.f_qty AS fQty,
+        bill.f_grossweight AS fGrossweight,
+        bill.f_netweight AS fNetweight
         FROM
-            t_warehousebills bill
-            LEFT JOIN t_corps corp ON corp.f_id = bill.f_corpid
-            LEFT JOIN t_corps corpSub ON corpSub.f_id = bill.f_sbu
-            LEFT JOIN t_warehouse ware ON ware.f_id = bill.f_warehouseid
+        t_warehousebills bill
+        LEFT JOIN t_corps corp ON corp.f_id = bill.f_corpid
+        LEFT JOIN t_corps corpSub ON corpSub.f_id = bill.f_sbu
+        LEFT JOIN t_warehouse ware ON ware.f_id = bill.f_warehouseid
         <where>
             <if test="fBillno != null  and fBillno != ''">and bill.f_billno = #{fBillno}</if>
-            <if test="fCustomsdeclartion != null  and fCustomsdeclartion != ''">and bill.f_customsdeclartion = #{fCustomsdeclartion}</if>
-            <if test="fOriginalbillno != null  and fOriginalbillno != ''">and bill.f_originalbillno = #{fOriginalbillno}</if>
+            <if test="fCustomsdeclartion != null  and fCustomsdeclartion != ''">and bill.f_customsdeclartion =
+                #{fCustomsdeclartion}
+            </if>
+            <if test="fOriginalbillno != null  and fOriginalbillno != ''">and bill.f_originalbillno =
+                #{fOriginalbillno}
+            </if>
             <if test="fDeptid != null ">and bill.f_deptid = #{fDeptid}</if>
             <if test="fBsdeptid != null ">and bill.f_bsdeptid = #{fBsdeptid}</if>
             <if test="fContacts != null  and fContacts != ''">and bill.f_contacts = #{fContacts}</if>
             <if test="fTel != null  and fTel != ''">and bill.f_tel = #{fTel}</if>
             <if test="fCorpid != null ">and bill.f_corpid = #{fCorpid}</if>
             <if test="fTocorpid != null ">and bill.f_tocorpid = #{fTocorpid}</if>
+            <if test="fMarks != null  and fMarks != ''">and f_marks = #{fMarks}</if>
             <if test="fStltypeid != null ">and bill.f_stltypeid = #{fStltypeid}</if>
             <if test="fBscorpno != null  and fBscorpno != ''">and bill.f_bscorpno = #{fBscorpno}</if>
             <if test="fWarehouseid != null ">and bill.f_warehouseid = #{fWarehouseid}</if>
@@ -178,6 +185,7 @@
             <if test="fStorekeeper != null">f_storekeeper,</if>
             <if test="fBsdate != null">f_bsdate,</if>
             <if test="fPlanqty != null">f_planqty,</if>
+            <if test="fMarks != null and fMarks != ''">f_marks,</if>
             <if test="fPlangrossweight != null">f_plangrossweight,</if>
             <if test="fPlannetweight != null">f_plannetweight,</if>
             <if test="fPlanvolumn != null">f_planvolumn,</if>
@@ -234,6 +242,7 @@
             <if test="fSbu != null">#{fSbu},</if>
             <if test="fFeetunit != null">#{fFeetunit},</if>
             <if test="fMblno != null">#{fMblno},</if>
+            <if test="fMarks != null and fMarks != ''">#{fMarks},</if>
             <if test="fVslvoy != null">#{fVslvoy},</if>
             <if test="fEta != null">#{fEta},</if>
             <if test="fCustomno != null">#{fCustomno},</if>
@@ -272,6 +281,7 @@
             <if test="fPlanqty != null">f_planqty = #{fPlanqty},</if>
             <if test="fPlangrossweight != null">f_plangrossweight = #{fPlangrossweight},</if>
             <if test="fPlannetweight != null">f_plannetweight = #{fPlannetweight},</if>
+            <if test="fMarks != null and fMarks != ''">f_marks = #{fMarks},</if>
             <if test="fPlanvolumn != null">f_planvolumn = #{fPlanvolumn},</if>
             <if test="fQty != null">f_qty = #{fQty},</if>
             <if test="fGrossweight != null">f_grossweight = #{fGrossweight},</if>
@@ -306,10 +316,20 @@
     </delete>
 
     <delete id="deleteTWarehousebillsByIds" parameterType="String">
-        delete from t_warehousebills where f_id in
-        <foreach item="fId" collection="array" open="(" separator="," close=")">
-            #{fId}
-        </foreach>
+        delete
+            item.*,
+            bill.*,
+            enclosure.*
+        from
+            t_warehousebills bill
+            LEFT t_warehousebillsfees fess ON fess.f_pid = bill.f_id
+            LEFT t_enclosure enclosure ON enclosure.f_pid = bill.f_id
+            LEFT t_warehousebillsitems item ON item.f_pid = bill.f_id
+        where
+             item.f_id in
+            <foreach item="fId" collection="array" open="(" separator="," close=")">
+                #{fId}
+            </foreach>
     </delete>
 
 </mapper>

+ 30 - 25
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWhgenlegMapper.xml

@@ -29,6 +29,7 @@
         <result property="fGrossweightblc" column="f_grossweightblc"/>
         <result property="fNetweightblc" column="f_netweightblc"/>
         <result property="fCntrno" column="f_cntrno"/>
+        <result property="fMarks" column="f_marks"/>
         <result property="fStatus" column="f_status"/>
         <result property="delFlag" column="del_flag"/>
         <result property="createBy" column="create_by"/>
@@ -39,7 +40,7 @@
     </resultMap>
 
     <sql id="selectTWhgenlegVo">
-        select f_accyear, f_id, f_accmonth, f_corpid, f_mblno, f_originalbillno, f_warehouse_locationid, f_goodsid, f_trademodeid, f_preqty, f_pregrossweight, f_prenetweight, f_qtyD, f_volumnD, f_grossweightD, f_netweightD, f_volumnC, f_qtyC, f_qtyblc, f_grossweightC, f_netweightC, f_grossweightblc, f_netweightblc, f_cntrno, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_whgenleg
+        select f_accyear, f_id, f_accmonth, f_corpid, f_mblno, f_originalbillno, f_marks, f_warehouse_locationid, f_goodsid, f_trademodeid, f_preqty, f_pregrossweight, f_prenetweight, f_qtyD, f_volumnD, f_grossweightD, f_netweightD, f_volumnC, f_qtyC, f_qtyblc, f_grossweightC, f_netweightC, f_grossweightblc, f_netweightblc, f_cntrno, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_whgenleg
     </sql>
 
     <select id="selectTWhgenlegList" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
@@ -55,6 +56,7 @@
             <if test="fNetweightd != null ">and f_netweightD = #{fNetweightd}</if>
             <if test="fVolumnc != null ">and f_volumnC = #{fVolumnc}</if>
             <if test="fQtyc != null ">and f_qtyC = #{fQtyc}</if>
+            <if test="fMarks != null  and fMarks != ''">and f_marks = #{fMarks}</if>
             <if test="fQtyblc != null ">and f_qtyblc = #{fQtyblc}</if>
             <if test="fGrossweightc != null ">and f_grossweightC = #{fGrossweightc}</if>
             <if test="fNetweightc != null ">and f_netweightC = #{fNetweightc}</if>
@@ -72,7 +74,7 @@
             <if test="fMblno != null ">and f_mblno = #{fMblno}</if>
             <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
             <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
-            <if test="fWarehouseLocationid != null ">and f_warehouseLocationid = #{fWarehouseLocationid}</if>
+            <if test="fWarehouseLocationid != null ">and f_warehouse_locationid = #{fWarehouseLocationid}</if>
         </where>
     </select>
 
@@ -102,6 +104,7 @@
             <if test="fNetweightd != null">f_netweightD,</if>
             <if test="fVolumnc != null">f_volumnC,</if>
             <if test="fQtyc != null">f_qtyC,</if>
+            <if test="fMarks != null and fMarks != ''">f_marks,</if>
             <if test="fQtyblc != null">f_qtyblc,</if>
             <if test="fGrossweightc != null">f_grossweightC,</if>
             <if test="fNetweightc != null">f_netweightC,</if>
@@ -133,6 +136,7 @@
             <if test="fVolumnd != null">#{fVolumnd},</if>
             <if test="fGrossweightd != null">#{fGrossweightd},</if>
             <if test="fNetweightd != null">#{fNetweightd},</if>
+            <if test="fMarks != null and fMarks != ''">#{fMarks},</if>
             <if test="fVolumnc != null">#{fVolumnc},</if>
             <if test="fQtyc != null">#{fQtyc},</if>
             <if test="fQtyblc != null">#{fQtyblc},</if>
@@ -172,6 +176,7 @@
             <if test="fVolumnc != null">f_volumnC = #{fVolumnc},</if>
             <if test="fQtyc != null">f_qtyC = #{fQtyc},</if>
             <if test="fQtyblc != null">f_qtyblc = #{fQtyblc},</if>
+            <if test="fMarks != null and fMarks != ''">f_marks = #{fMarks},</if>
             <if test="fGrossweightc != null">f_grossweightC = #{fGrossweightc},</if>
             <if test="fNetweightc != null">f_netweightC = #{fNetweightc},</if>
             <if test="fGrossweightblc != null">f_grossweightblc = #{fGrossweightblc},</if>
@@ -188,40 +193,40 @@
         where f_accyear = #{fAccyear}
     </update>
 
-    <update id="updateTWhgenlegData">
+    <update id="updateTWhgenlegData" parameterType="Map">
         update t_whgenleg
         <trim prefix="SET" suffixOverrides=",">
             /*判断是否入库*/
-            <if test="billType = 'SJRK'">
-                f_qtyD = f_qtyD + #{warehousebillsitems.fQty},
-                f_volumnD = f_volumnD + #{warehousebillsitems.fVolumn},
-                f_netweightD = f_netweightD + #{warehousebillsitems.fNetweight},
-                f_grossweightD = f_grossweightD + #{warehousebillsitems.fGrossweight},
+            <if test="map.billType == 'SJRK'">
+                f_qtyD = f_qtyD + #{map.warehousebillsitems.fQty},
+                f_volumnD = f_volumnD + #{map.warehousebillsitems.fVolumn},
+                f_netweightD = f_netweightD + #{map.warehousebillsitems.fNetweight},
+                f_grossweightD = f_grossweightD + #{map.warehousebillsitems.fGrossweight}
             </if>
             /*判断是否撤销入库*/
-            <if test="billType = 'SJRKRevoke'">
-                f_qtyD = f_qtyD - #{warehousebillsitems.fQty},
-                f_volumnD = f_volumnD - #{warehousebillsitems.fVolumn},
-                f_netweightD = f_netweightD - #{warehousebillsitems.fNetweight},
-                f_grossweightD = f_grossweightD - #{warehousebillsitems.fGrossweight},
+            <if test="map.billType == 'SJRKRevoke'">
+                f_qtyD = f_qtyD - #{map.warehousebillsitems.fQty},
+                f_volumnD = f_volumnD - #{map.warehousebillsitems.fVolumn},
+                f_netweightD = f_netweightD - #{map.warehousebillsitems.fNetweight},
+                f_grossweightD = f_grossweightD - #{map.warehousebillsitems.fGrossweight}
             </if>
             /*判断是否出库*/
-            <if test="billType = 'SJCK'">
-                f_qtyC = f_qtyC + #{warehousebillsitems.fQty},
-                f_volumnC = f_volumnC + #{warehousebillsitems.fVolumn},
-                f_netweightC = f_netweightC + #{warehousebillsitems.fNetweight},
-                f_grossweightC = f_grossweightC + #{warehousebillsitems.fGrossweight},
+            <if test="map.billType == 'SJCK'">
+                f_qtyC = f_qtyC + #{map.warehousebillsitems.fQty},
+                f_volumnC = f_volumnC + #{map.warehousebillsitems.fVolumn},
+                f_netweightC = f_netweightC + #{map.warehousebillsitems.fNetweight},
+                f_grossweightC = f_grossweightC + #{map.warehousebillsitems.fGrossweight}
             </if>
             /*判断是否撤销出库*/
-            <if test="billType = 'SJCKRevoke'">
-                f_qtyC = f_qtyC - #{warehousebillsitems.fQty},
-                f_volumnC = f_volumnC - #{warehousebillsitems.fVolumn},
-                f_netweightC = f_netweightC - #{warehousebillsitems.fNetweight},
-                f_grossweightC = f_grossweightC - #{warehousebillsitems.fGrossweight},
+            <if test="map.billType == 'SJCKRevoke'">
+                f_qtyC = f_qtyC - #{map.warehousebillsitems.fQty},
+                f_volumnC = f_volumnC - #{map.warehousebillsitems.fVolumn},
+                f_netweightC = f_netweightC - #{map.warehousebillsitems.fNetweight},
+                f_grossweightC = f_grossweightC - #{map.warehousebillsitems.fGrossweight}
             </if>
-            update_by = NOW()
+--             update_by = NOW()
         </trim>
-        where f_id = #{whgenlegId}
+        where f_id = #{map.whgenlegId}
     </update>
 
     <delete id="deleteTWhgenlegById" parameterType="Long">