浏览代码

凯和转船功能

lazhaoqian 3 年之前
父节点
当前提交
3b99299a2f

+ 7 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/TVoyageController.java

@@ -205,4 +205,11 @@ public class TVoyageController extends BaseController
         }
         return tVoyageService.insertMessage(tVoyage,tCtnpriceItems);
     }
+
+    @GetMapping("/selectTVoyageListNew")
+    public AjaxResult selectTVoyageListNew(TVoyage tVoyage)
+    {
+        return AjaxResult.success(tVoyageService.selectTVoyageListNew(tVoyage));
+    }
+
 }

+ 46 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/transship/Transhipment.java

@@ -0,0 +1,46 @@
+package com.ruoyi.web.controller.shipping.transship;
+
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
+import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 凯和转配船功能
+ *
+ * @author ruoyi
+ * @date 2021-04-08
+ */
+@Slf4j
+@RestController
+@RequestMapping("/transhipment")
+public class Transhipment extends BaseController {
+    @Autowired
+    private ITWarehouseBillsService tWarehousebillsService;
+
+    @PostMapping("/transship")
+    public AjaxResult transship(@RequestBody TWarehouseBills tWarehouseBills) {
+        if (CollectionUtils.isEmpty(tWarehouseBills.getOrderList())){
+            throw new RuntimeException("请选择要转船的订单");
+        }
+        if (tWarehouseBills.getfVslid() == null){
+            throw new RuntimeException("请选择要转的船名");
+        }
+        if (tWarehouseBills.getfVoyid() == null){
+            throw new RuntimeException("请选择要转的航次");
+        }
+        LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
+        return tWarehousebillsService.transship(tWarehouseBills,loginUser);
+    }
+}

+ 7 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITVoyageService.java

@@ -113,4 +113,11 @@ public interface ITVoyageService
      * @return
      */
     public List<Map<String,Object>>shipDynamic();
+
+    /**
+     * 获取为开船的航次信息
+     * @param tVoyage
+     * @return
+     */
+    List<TVoyage> selectTVoyageListNew (TVoyage tVoyage);
 }

+ 5 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TVoyageServiceImpl.java

@@ -402,4 +402,9 @@ public class TVoyageServiceImpl implements ITVoyageService
     public List<Map<String, Object>> shipDynamic() {
         return tVoyageMapper.shipDynamic();
     }
+
+    @Override
+    public List<TVoyage> selectTVoyageListNew(TVoyage tVoyage) {
+        return tVoyageMapper.selectTVoyageListNew(tVoyage);
+    }
 }

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

@@ -678,6 +678,53 @@ public class TWarehouseBills extends BaseEntity {
      * 离港出运或到港卸货的提单号
      */
     private List<String> billList;
+    /**
+     * 第二次转船船名
+     */
+    private Long fShipTwo;
+    /**
+     * 第二次转船航次
+     */
+    private Long fVoyTwo;
+    /**
+     * 第二次转船船名中文
+     */
+    private String fShipTwoName;
+    /**
+     * 第二次转船航次中文
+     */
+    private String fVoyTwoName;
+
+    public Long getfShipTwo() {
+        return fShipTwo;
+    }
+
+    public void setfShipTwo(Long fShipTwo) {
+        this.fShipTwo = fShipTwo;
+    }
+
+    public Long getfVoyTwo() {
+        return fVoyTwo;
+    }
+
+    public void setfVoyTwo(Long fVoyTwo) {
+        this.fVoyTwo = fVoyTwo;
+    }
+    public String getfShipTwoName() {
+        return fShipTwoName;
+    }
+
+    public void setfShipTwoName(String fShipTwoName) {
+        this.fShipTwoName = fShipTwoName;
+    }
+
+    public String getfVoyTwoName() {
+        return fVoyTwoName;
+    }
+
+    public void setfVoyTwoName(String fVoyTwoName) {
+        this.fVoyTwoName = fVoyTwoName;
+    }
 
     public Integer getfArrivalStatus() {
         return fArrivalStatus;
@@ -2140,6 +2187,10 @@ public class TWarehouseBills extends BaseEntity {
                 ", fDue=" + fDue +
                 ", fPay=" + fPay +
                 ", fCaregoStatus=" + fCaregoStatus +
+                ", fShipTwo=" + fShipTwo +
+                ", fShipTwoName=" + fShipTwoName +
+                ", fVoyTwo=" + fVoyTwo +
+                ", fVoyTwoName=" + fVoyTwoName +
                 '}';
     }
 }

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

@@ -441,6 +441,30 @@ public class TWarehousebillsfees extends BaseEntity {
      * 传递前台搜索审核日期范围,用来做 excel 表的统计范围
      */
     private String dateRange;
+    /**
+     * 付费地点id
+     */
+    private Long  fAddress;
+    /**
+     * 付费地点中文名
+     */
+    private String  fAddressName;
+
+    public Long getfAddress() {
+        return fAddress;
+    }
+
+    public void setfAddress(Long fAddress) {
+        this.fAddress = fAddress;
+    }
+
+    public String getfAddressName() {
+        return fAddressName;
+    }
+
+    public void setfAddressName(String fAddressName) {
+        this.fAddressName = fAddressName;
+    }
 
     public String getfTaxrateStr() {
         return fTaxrateStr;
@@ -905,6 +929,8 @@ public class TWarehousebillsfees extends BaseEntity {
                 ", feeName='" + feeName + '\'' +
                 ", fBillstatusName='" + fBillstatusName + '\'' +
                 ", fYears='" + fYears + '\'' +
+                ", fAddress='" + fAddress + '\'' +
+                ", fAddressName='" + fAddressName + '\'' +
                 ", fMonth=" + fMonth +
                 '}';
     }

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

@@ -854,4 +854,12 @@ public interface ITWarehouseBillsService {
      */
     List<CorpAnalysis> inactiveCorpList(Integer type);
 
+    /**
+     * 凯和转配船
+     * @param tWarehouseBills
+     * @param loginUser
+     * @return
+     */
+    AjaxResult transship(TWarehouseBills tWarehouseBills,LoginUser loginUser);
+
 }

+ 122 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -8509,5 +8509,127 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         return tWarehouseBillsMapper.getInactiveCorpList(beginTime, endTime);
     }
 
+    @Override
+    @Transactional
+    public AjaxResult transship(TWarehouseBills tWarehouseBills, LoginUser loginUser) {
+        for (Long aLong : tWarehouseBills.getOrderList()) {
+            // 1.查询原订单信息
+            // 2.判断原订单是否卸船 否不能转船
+            TWarehouseBills warehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(aLong);
+            if (warehouseBills.getfArrivalStatus().longValue() != 2L){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                throw  new RuntimeException("提单号"+warehouseBills.getfMblno()+"的订单状态未到港卸货不能转船");
+            }
+            // 3.复制原订单数据生成新的订单 系统编号重新生成 新订单提单号为转配船+原提单号 船名航次为选择转船的船名航次 配船状态回复默认值 未配船 离港出运状态回复默认值
+            TWarehouseBills bills = new TWarehouseBills();
+            BeanUtils.copyProperties(warehouseBills,bills);
+            String billNo = billnoSerialServiceImpl.getBillNo("SE", DateUtils.getNowDate());
+            bills.setfBillno(billNo);
+            bills.setfId(null);
+            bills.setfMblno("转配船"+ bills.getfMblno());
+            bills.setCreateBy(loginUser.getUsername());
+            bills.setCreateTime(new Date());
+            bills.setUpdateBy(null);
+            bills.setUpdateTime(null);
+            bills.setfVslid(tWarehouseBills.getfVslid());
+            bills.setfVoyid(tWarehouseBills.getfVoyid());
+            bills.setfItemstatus(null);
+            bills.setfItemsStatus(null);
+            bills.setfUpdeteStatus(null);
+            bills.setfSubmitUpdate(null);
+            bills.setfDeleteStatus(null);
+            bills.setfCargoPlanning(null);
+            bills.setfArrivalStatus(null);
+            bills.setfDismountStatus(null);
+            bills.setfDue(BigDecimal.ZERO);
+            bills.setfPay(BigDecimal.ZERO);
+            bills.setfCaregoStatus(null);
+            bills.setfShipTwo(null);
+            bills.setfVoyTwo(null);
+            tWarehouseBillsMapper.insertTWarehousebills(bills);
+            // 4.复制原订单货物信息 和箱信息到新的订单信息上
+            //货物信息
+            TWarehousebillsCntr warehousebillsCntr = new TWarehousebillsCntr();
+            warehousebillsCntr.setfPid(aLong);
+            List<TWarehousebillsCntr> tWarehousebillsCntrs = tWarehousebillsCntrMapper.selectTWarehousebillsCntrList(warehousebillsCntr);
+            if (CollectionUtils.isNotEmpty(tWarehousebillsCntrs)) {
+                for (TWarehousebillsCntr tWarehousebillsCntr : tWarehousebillsCntrs) {
+                    tWarehousebillsCntr.setfId(null);
+                    tWarehousebillsCntr.setfPid(bills.getfId());
+                    tWarehousebillsCntr.setCreateBy(loginUser.getUsername());
+                    tWarehousebillsCntr.setCreateTime(new Date());
+                    tWarehousebillsCntr.setUpdateBy(null);
+                    tWarehousebillsCntr.setUpdateTime(null);
+                    tWarehousebillsCntrMapper.insertTWarehousebillsCntr(tWarehousebillsCntr);
+                }
+            }
+            //配箱信息
+            TWarehousebillsCntritems warehousebillsCntritems = new TWarehousebillsCntritems();
+            warehousebillsCntritems.setfPid(aLong);
+            List<TWarehousebillsCntritems> tWarehousebillsCntritems = tWarehousebillsCntritemsMapper.selectTWarehousebillsCntritemsList(warehousebillsCntritems);
+            if (CollectionUtils.isNotEmpty(tWarehousebillsCntritems)) {
+                for (TWarehousebillsCntritems tWarehousebillsCntritem : tWarehousebillsCntritems) {
+                    tWarehousebillsCntritem.setfId(null);
+                    tWarehousebillsCntritem.setfPid(bills.getfId());
+                    tWarehousebillsCntritem.setCreateBy(loginUser.getUsername());
+                    tWarehousebillsCntritem.setCreateTime(new Date());
+                    tWarehousebillsCntritem.setUpdateBy(null);
+                    tWarehousebillsCntritem.setUpdateTime(null);
+                    tWarehousebillsCntritemsMapper.insertTWarehousebillsCntritems(tWarehousebillsCntritem);
+                }
+            }
+            // 5.复制原订单的中付费的付费地点为原订单目的港的应付费用 费用状态为录入
+            //应付信息
+            TWarehousebillsfees tWarehousebillsfees = new TWarehousebillsfees();
+            tWarehousebillsfees.setfPid(aLong);
+            tWarehousebillsfees.setfDc("C");
+            tWarehousebillsfees.setfAddress(warehouseBills.getfDestportid());
+            List<TWarehousebillsfees> warehousebillsfeesList = tWarehousebillsfeesMapper.selectTWarehousebillsfeesList(tWarehousebillsfees);
+            if (CollectionUtils.isNotEmpty(warehousebillsfeesList)){
+                for (TWarehousebillsfees warehousebillsfees : warehousebillsfeesList) {
+                    warehousebillsfees.setfId(null);
+                    warehousebillsfees.setfPid(bills.getfId());
+                    warehousebillsfees.setCreateBy(loginUser.getUsername());
+                    warehousebillsfees.setCreateTime(new Date());
+                    warehousebillsfees.setUpdateBy(null);
+                    warehousebillsfees.setUpdateTime(null);
+                    warehousebillsfees.setfReviewDate(null);
+                    warehousebillsfees.setfBillstatus(null);
+                    warehousebillsfees.setfStatementNo(null);
+                    warehousebillsfees.setfAccamount(BigDecimal.ZERO);
+                    warehousebillsfees.setfAccamountDate(null);
+                    warehousebillsfees.setfStlamountNo(null);
+                    warehousebillsfees.setfStlamountDate(null);
+                    warehousebillsfees.setfStlamount(BigDecimal.ZERO);
+                    warehousebillsfees.setfInvnos(null);
+                    warehousebillsfees.setfInvamount(BigDecimal.ZERO);
+                    warehousebillsfees.setfAskamount(BigDecimal.ZERO);
+                    warehousebillsfees.setfMblno(bills.getfMblno());
+                    tWarehousebillsfeesMapper.insertTWarehousebillsfees(warehousebillsfees);
+                }
+            }
+            // 6.修改原订单的信息将本次转船的船名航次赋值到原订单的第二次转船的船名航次或者第三次转船的船名航次上
+            warehouseBills.setfShipTwo(tWarehouseBills.getfVslid());
+            warehouseBills.setfVoyTwo(tWarehouseBills.getfVoyid());
+            warehouseBills.setUpdateTime(new Date());
+            warehouseBills.setUpdateBy(loginUser.getUsername());
+            tWarehouseBillsMapper.updateKaHeOrder(warehouseBills);
+            // 7.获取原订单的应付费用中目的港的费用将单价和金额转为负数然后保存到原订单的应付费用上
+            List<TWarehousebillsfees> warehousebillsfees = tWarehousebillsfeesMapper.selectTWarehousebillsfeesList(tWarehousebillsfees);
+            if (CollectionUtils.isNotEmpty(warehousebillsfees)){
+                for (TWarehousebillsfees warehousebillsfee : warehousebillsfees) {
+                    warehousebillsfee.setfId(null);
+                    warehousebillsfee.setfUnitprice(warehousebillsfee.getfUnitprice().subtract(warehousebillsfee.getfUnitprice().multiply(new BigDecimal(2))));
+                    warehousebillsfee.setfAmount(warehousebillsfee.getfAmount().subtract(warehousebillsfee.getfAmount().multiply(new BigDecimal(2))));
+                    warehousebillsfee.setUpdateBy(loginUser.getUsername());
+                    warehousebillsfee.setUpdateTime(new Date());
+                    tWarehousebillsfeesMapper.insertTWarehousebillsfees(warehousebillsfee);
+                }
+            }
+
+        }
+        return AjaxResult.success("转船成功");
+    }
+
 
 }

+ 27 - 3
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -128,6 +128,8 @@
         <result property="fDue"    column="f_due"    />
         <result property="fPay"    column="f_pay"    />
         <result property="fCaregoStatus"    column="f_carego_status"    />
+        <result property="fShipTwo"    column="f_ship_two"    />
+        <result property="fVoyTwo"    column="f_voy_two"    />
     </resultMap>
 
     <resultMap type="WarehouseBillsVO" id="WarehousebillsVOResult">
@@ -152,7 +154,7 @@
         free_container_date, f_business_attribution, f_fee_status, f_supervision_unit, f_declaration_elements, f_part_number, f_ifinspection, f_value, f_weighing_date,
         f_ifsampling, send_sample_date, f_ifweight_recovery, weight_recovery_date, warehouse_status, f_times ,f_date_changed, f_chargetype,f_weigh_weight,
         f_predict_branch,f_grade,f_delivery_details,f_salesman_id,f_itemstatus,f_updete_status, f_submit_update, f_delete_status,f_remarks_fees,f_cargo_planning,
-        f_arrival_status,f_dismount_status,f_serviceitems_new,f_receivable,f_recycle,f_due,f_pay,f_carego_status from t_warehousebills
+        f_arrival_status,f_dismount_status,f_serviceitems_new,f_receivable,f_recycle,f_due,f_pay,f_carego_status, f_ship_two, f_voy_two from t_warehousebills
     </sql>
 
     <select id="selectTWarehousebillsList" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
@@ -1151,6 +1153,8 @@
             <if test="fDue != null">f_due,</if>
             <if test="fPay != null">f_pay,</if>
             <if test="fCaregoStatus != null">f_carego_status,</if>
+            <if test="fShipTwo != null">f_ship_two,</if>
+            <if test="fVoyTwo != null">f_voy_two,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fBillno != null">#{fBillno},</if>
@@ -1275,6 +1279,8 @@
             <if test="fDue != null">#{fDue},</if>
             <if test="fPay != null">#{fPay},</if>
             <if test="fCaregoStatus != null">#{fCaregoStatus},</if>
+            <if test="fShipTwo != null">#{fShipTwo},</if>
+            <if test="fVoyTwo != null">#{fVoyTwo},</if>
         </trim>
     </insert>
 
@@ -1403,6 +1409,8 @@
             <if test="fDue != null">f_due = #{fDue},</if>
             <if test="fPay != null">f_pay = #{fPay},</if>
             <if test="fCaregoStatus != null">f_carego_status = #{fCaregoStatus},</if>
+            <if test="fShipTwo != null">f_ship_two = #{fShipTwo},</if>
+            <if test="fVoyTwo != null">f_voy_two = #{fVoyTwo},</if>
         </trim>
         where f_id = #{fId}
     </update>
@@ -1533,6 +1541,8 @@
             <if test="fDue != null">f_due = #{fDue},</if>
             <if test="fPay != null">f_pay = #{fPay},</if>
             <if test="fCaregoStatus != null">f_carego_status = #{fCaregoStatus},</if>
+            <if test="fShipTwo != null">f_ship_two = #{fShipTwo},</if>
+            <if test="fVoyTwo != null">f_voy_two = #{fVoyTwo},</if>
         </trim>
         where f_id = #{fId}
     </update>
@@ -2052,7 +2062,9 @@
         WHEN tw.f_carego_status = '1' THEN '未放货'
         WHEN tw.f_carego_status = '2' THEN '放货'
         WHEN tw.f_carego_status = '3' THEN '扣货'
-        END AS fCaregoStatus
+        END AS fCaregoStatus,
+        tv1.f_name fShipTwoName,
+        ty1.f_no fVoyTwoName
         FROM
         t_warehousebills tw
         LEFT JOIN t_address ta ON ta.f_id = tw.f_laneid
@@ -2065,6 +2077,8 @@
         </if>
         LEFT JOIN t_vessel tv ON tw.f_vslid = tv.f_id
         LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
+        LEFT JOIN t_vessel tv1 ON tw.f_ship_two = tv1.f_id
+        LEFT JOIN t_voyage ty1 ON tw.f_voy_two = ty1.f_id
         LEFT JOIN t_corps tp ON tw.f_corpid = tp.f_id
         LEFT JOIN (
         SELECT
@@ -2231,6 +2245,8 @@
             <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
             <if test="fArrivalStatus != null and fArrivalStatus != 3"> and tw.f_arrival_status = #{fArrivalStatus}</if>
             <if test="fArrivalStatus != null and fArrivalStatus == 3"> and tw.f_arrival_status != '2'</if>
+            <if test="fShipTwo != null "> and tw.f_ship_two = #{fShipTwo}</if>
+            <if test="fVoyTwo != null "> and tw.f_voy_two = #{fVoyTwo}</if>
         </where>
         ORDER BY tw.create_time DESC, tw.f_id DESC
     </select>
@@ -2497,6 +2513,8 @@
             </if>
             <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
             <if test="fArrivalStatus != null "> and tw.f_arrival_status = #{fArrivalStatus}</if>
+            <if test="fShipTwo != null "> and tw.f_ship_two = #{fShipTwo}</if>
+            <if test="fVoyTwo != null "> and tw.f_voy_two = #{fVoyTwo}</if>
         </where>
         ORDER BY tw.create_time DESC, tw.f_id DESC
     </select>
@@ -2614,7 +2632,11 @@
                WHEN tw.f_carego_status = '1' THEN '未放货'
                WHEN tw.f_carego_status = '2' THEN '放货'
                WHEN tw.f_carego_status = '3' THEN '扣货'
-               END AS fCaregoStatus
+               END AS fCaregoStatus,
+               tv1.f_name fShipTwoName,
+               ty1.f_no fVoyTwoName,
+               tw.f_ship_two,
+               tw.f_voy_two
         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
@@ -2634,6 +2656,8 @@
             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_vessel tv1 ON tv1.f_id = tw.f_ship_two
+                 LEFT JOIN t_voyage ty1 ON ty1.f_id = tw.f_voy_two
         where 1= 1
         <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno} </if>
         <if test="fId != null ">and tw.f_id = #{fId} </if>

+ 16 - 2
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

@@ -58,6 +58,8 @@
         <result property="fStltypeid" column="f_stltypeid"/>
         <result property="fBusinessType" column="f_business_type"/>
         <result property="fSrcTypeId" column="f_src_type_id"/>
+        <result property="fAddress" column="f_address"/>
+        <result property="fAddressName" column="f_address_name"/>
     </resultMap>
 
     <sql id="selectTWarehousebillsfeesVo">
@@ -115,7 +117,9 @@
                f_stltypeid,
                f_business_type,
                f_src_type_id,
-               price_date_remarks
+               price_date_remarks,
+               f_address_name,
+               f_address
         from t_warehousebillsfees
     </sql>
 
@@ -166,6 +170,8 @@
             <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
             <if test="fStltypeid != null">and f_stltypeid = #{fStltypeid},</if>
             <if test="fSrcTypeId != null">and f_src_type_id = #{fSrcTypeId},</if>
+            <if test="fAddress != null">and f_address = #{fAddress}</if>
+            <if test="fAddressName != null  and fAddressName != ''">and f_address_name = #{fAddressName}</if>
         </where>
     </select>
 
@@ -328,6 +334,8 @@
             <if test="fBusinessType != null">f_business_type,</if>
             <if test="fSrcTypeId != null">f_src_type_id,</if>
             <if test="priceDateRemarks != null">price_date_remarks,</if>
+            <if test="fAddress != null">f_address,</if>
+            <if test="fAddressName != null">f_address_name,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fId != null">#{fId},</if>
@@ -381,6 +389,8 @@
             <if test="fBusinessType != null">#{fBusinessType},</if>
             <if test="fSrcTypeId != null">#{fSrcTypeId},</if>
             <if test="priceDateRemarks != null">#{priceDateRemarks},</if>
+            <if test="fAddress != null">#{fAddress},</if>
+            <if test="fAddressName != null">#{fAddressName},</if>
         </trim>
     </insert>
 
@@ -436,6 +446,8 @@
             <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
             <if test="priceDateRemarks != null">price_date_remarks = #{priceDateRemarks},</if>
             <if test="fSrcTypeId != null">f_src_type_id = #{fSrcTypeId},</if>
+            <if test="fAddress != null">f_address = #{fAddress},</if>
+            <if test="fAddressName != null">f_address_name = #{fAddressName},</if>
         </trim>
         where f_id = #{fId}
     </update>
@@ -619,7 +631,9 @@
         tw.f_originalbilldate,
         tw.f_stltypeid,
         tw.f_business_type,
-        tw.f_src_type_id
+        tw.f_src_type_id,
+        tw.f_address,
+        tw.f_address_name
         FROM
         t_warehousebillsfees tw
         LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id