Jelajahi Sumber

凯和业务

lazhaoqian 4 tahun lalu
induk
melakukan
106aad6393
15 mengubah file dengan 354 tambahan dan 100 penghapusan
  1. 7 6
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/KHTWarehousebillsController.java
  2. 4 3
      ruoyi-admin/src/main/resources/application-druid.yml
  3. 10 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TWarehousebillsCntritems.java
  4. 4 1
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TVoyageServiceImpl.java
  5. 7 2
      ruoyi-shipping/src/main/resources/mapper/shipping/TWarehousebillsCntritemsMapper.xml
  6. 8 0
      ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/impl/AuditPathsServiceImpl.java
  7. 7 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TCorpsMapper.java
  8. 30 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehouseBills.java
  9. 20 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehousebillsfees.java
  10. 7 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehouseBillsMapper.java
  11. 5 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsfeesMapper.java
  12. 33 11
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java
  13. 9 0
      ruoyi-warehouse/src/main/resources/mapper/basicData/TCorpsMapper.xml
  14. 13 1
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml
  15. 190 76
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

+ 7 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/KHTWarehousebillsController.java

@@ -3,6 +3,7 @@ package com.ruoyi.web.controller.shipping.controller;
 import java.util.List;
 import java.util.Map;
 
+import com.ruoyi.basicData.domain.TCorps;
 import com.ruoyi.basicData.service.ITCorpsService;
 import com.ruoyi.basicData.service.ITGoodsService;
 import com.ruoyi.common.core.domain.model.LoginUser;
@@ -205,9 +206,9 @@ public class KHTWarehousebillsController extends BaseController
     }
     @Log(title = "凯和订单查询客户名称", businessType = BusinessType.DELETE)
     @PostMapping("/getClientName")
-    public AjaxResult getClientName(){
-        LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        List<Map<String, Object>> clientName = itCorpsService.getClientName(loginUser.getUser().getPhonenumber());
+    public AjaxResult getClientName(TCorps tCorps){
+        /*LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());*/
+        List<Map<String, Object>> clientName = itCorpsService.selectFleetDriverMsgListMap(tCorps);
         return AjaxResult.success(clientName);
     }
     @Log(title = "凯和订单查询商品名称", businessType = BusinessType.DELETE)
@@ -231,7 +232,7 @@ public class KHTWarehousebillsController extends BaseController
         List<Map<String,Object>> warehouseBills = tWarehousebillsService.ruoYiVersionOrderList(loginUser,tWarehouseBills);
         return getDataTable(warehouseBills);
     }
-    //@PreAuthorize("@ss.hasPermi('warehouse:warehousebills:ruoYiVersionOrderList')")
+    @PreAuthorize("@ss.hasPermi('warehouse:warehousebills:ruoYiVersionOrderList')")
     @Log(title = "凯和若依订单查询", businessType = BusinessType.DELETE)
     @PostMapping("/ruoYiVersionOrderList")
     public TableDataInfo ruoYiVersionOrderList(@RequestBody(required = false) TWarehouseBills tWarehouseBills){
@@ -240,7 +241,7 @@ public class KHTWarehousebillsController extends BaseController
         List<Map<String,Object>> warehouseBills = tWarehousebillsService.ruoYiVersionOrderList(loginUser,tWarehouseBills);
         return getDataTable(warehouseBills);
     }
-    //@PreAuthorize("@ss.hasPermi('warehouse:warehousebills:webVersionOrderDetails')")
+    @PreAuthorize("@ss.hasPermi('warehouse:warehousebills:webVersionOrderDetails')")
     @Log(title = "凯和若依订单详情", businessType = BusinessType.DELETE)
     @PostMapping("/webVersionOrderDetails")
     public TableDataInfo webVersionOrderDetails(@RequestBody TWarehouseBills tWarehouseBills){
@@ -248,7 +249,7 @@ public class KHTWarehousebillsController extends BaseController
         List<TWarehouseBills> warehouseBills = tWarehousebillsService.webVersionOrderDetails(tWarehouseBills);
         return getDataTable(warehouseBills);
     }
-    //@PreAuthorize("@ss.hasPermi('warehouse:warehousebills:ruoYiUpdateOrderMessage')")
+    @PreAuthorize("@ss.hasPermi('warehouse:warehousebills:ruoYiUpdateOrderMessage')")
     @Log(title = "凯和若依订单维护", businessType = BusinessType.DELETE)
     @PostMapping("/ruoYiUpdateOrderMessage")
     public AjaxResult ruoYiUpdateOrderMessage(@RequestParam(value = "tWarehousebills") String tWarehousebills,

+ 4 - 3
ruoyi-admin/src/main/resources/application-druid.yml

@@ -8,9 +8,10 @@ spring:
       master:
 #        url: jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
  #       url: jdbc:mysql://115.29.151.39:3306/sys?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
-        url: jdbc:mysql://115.29.151.39:3306/Test?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
-        username: taidongerp
-        password: liyuan@erp
+        url: jdbc:mysql://124.70.179.5:3306/Test?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
+        #url: jdbc:mysql://124.70.179.5:3306/LinuxServer?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
+        username: root
+        password: daasan7ujm^YHN
 
       # 从库数据源
       slave:

+ 10 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TWarehousebillsCntritems.java

@@ -94,6 +94,16 @@ public class TWarehousebillsCntritems extends BaseEntity
     private String precoolingName;
     //是否危险品
     private String ifdangerName;
+    @Excel(name = "是否人工")
+    private Long fManual;
+
+    public Long getfManual() {
+        return fManual;
+    }
+
+    public void setfManual(Long fManual) {
+        this.fManual = fManual;
+    }
 
     public String getGoodsName() {
         return goodsName;

+ 4 - 1
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TVoyageServiceImpl.java

@@ -63,7 +63,10 @@ public class TVoyageServiceImpl implements ITVoyageService
                 voyage.setTwenty(tCtnpriceItemsMapper.selectMoney(voyage.getfPortofloadid(), voyage.getfDistinationid(), "20GP"));
                 voyage.setFortyHc(tCtnpriceItemsMapper.selectMoney(voyage.getfPortofloadid(), voyage.getfDistinationid(), "40HC"));
                 voyage.setFortyRh(tCtnpriceItemsMapper.selectMoney(voyage.getfPortofloadid(), voyage.getfDistinationid(), "40RH"));
-                List<TVoyage> freightselect = this.freightselect(tVoyage);
+                TVoyage yage = new TVoyage();
+                yage.setfPortofloadid(voyage.getfPortofloadid());
+                yage.setfDistinationid(voyage.getfDistinationid());
+                List<TVoyage> freightselect = this.freightselect(yage);
                 if (CollectionUtils.isNotEmpty(freightselect)){
                     voyage.setFreight(freightselect);
                 }

+ 7 - 2
ruoyi-shipping/src/main/resources/mapper/shipping/TWarehousebillsCntritemsMapper.xml

@@ -22,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="fPrecooling"    column="f_precooling"    />
         <result property="fPlantakecntr"    column="f_plantakecntr"    />
         <result property="fIfdanger"    column="f_IFDANGER"    />
+        <result property="fManual"    column="f_manual"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
@@ -30,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTWarehousebillsCntritemsVo">
-        select f_id, f_pid, f_cntrno, f_sealno, f_goodsid, f_packageid, f_cntrid, f_cntrcount, f_cntrweight, f_cntrstatus, f_soc, f_temperature, f_Draught, f_Humidity, f_precooling, f_plantakecntr, f_IFDANGER, create_by, create_time, update_by, update_time, remark from t_warehousebills_cntritems
+        select f_id, f_pid, f_cntrno, f_sealno, f_goodsid, f_packageid, f_cntrid, f_cntrcount, f_cntrweight, f_cntrstatus, f_soc, f_temperature, f_Draught, f_Humidity, f_precooling, f_plantakecntr, f_IFDANGER,f_manual, create_by, create_time, update_by, update_time, remark from t_warehousebills_cntritems
     </sql>
 
     <select id="selectTWarehousebillsCntritemsList" parameterType="TWarehousebillsCntritems" resultMap="TWarehousebillsCntritemsResult">
@@ -61,7 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         tw.create_time,
         tw.update_by,
         tw.update_time,
-        tw.remark
+        tw.remark,
+        tw.f_manual
         FROM
         t_warehousebills_cntritems tw
         LEFT JOIN t_goods tg ON tg.f_id = tw.f_goodsid
@@ -113,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="fPrecooling != null">f_precooling,</if>
             <if test="fPlantakecntr != null">f_plantakecntr,</if>
             <if test="fIfdanger != null">f_IFDANGER,</if>
+            <if test="fManual != null">f_manual,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -136,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="fPrecooling != null">#{fPrecooling},</if>
             <if test="fPlantakecntr != null">#{fPlantakecntr},</if>
             <if test="fIfdanger != null">#{fIfdanger},</if>
+            <if test="fManual != null">#{fManual},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -163,6 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="fPrecooling != null">f_precooling = #{fPrecooling},</if>
             <if test="fPlantakecntr != null">f_plantakecntr = #{fPlantakecntr},</if>
             <if test="fIfdanger != null">f_IFDANGER = #{fIfdanger},</if>
+            <if test="fManual != null">f_manual = #{fManual},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>

+ 8 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/impl/AuditPathsServiceImpl.java

@@ -261,6 +261,14 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             // 协议审批
             List<Map<String, Object>> mapList = auditItemsMapper.selectWarehouseApprover(auditItems);
             return AjaxResult.success(mapList);
+        } else if (auditItems.getActId() == 410 ) {
+            // 协议审批
+            List<Map<String, Object>> mapList = auditItemsMapper.selectWarehouseApprover(auditItems);
+            return AjaxResult.success(mapList);
+        } else if (auditItems.getActId() == 420 ) {
+            // 协议审批
+            List<Map<String, Object>> mapList = auditItemsMapper.selectWarehouseApprover(auditItems);
+            return AjaxResult.success(mapList);
         }
         return AjaxResult.success();
     }

+ 7 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TCorpsMapper.java

@@ -126,4 +126,11 @@ public interface TCorpsMapper extends BaseMapper<TCorps> {
      * @return
      */
     public List<Map<String,Object>> getClientName (@Param("tel") String tel);
+
+    /**
+     * 获取客户单位id
+     * @param tel
+     * @return
+     */
+    public Long getClientFid(@Param("tel") String tel);
 }

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

@@ -456,6 +456,36 @@ public class TWarehouseBills extends BaseEntity {
     private Date endTime;
     //箱号
     private String boxNumber;
+    //客户名称
+    private String corpName;
+    //应收款信息
+    private List<TWarehousebillsfees> tWarehousebillsfeesDr;
+    //应付款信息
+    List<TWarehousebillsfees> warehousebillsfeesCr;
+
+    public String getCorpName() {
+        return corpName;
+    }
+
+    public void setCorpName(String corpName) {
+        this.corpName = corpName;
+    }
+
+    public List<TWarehousebillsfees> gettWarehousebillsfeesDr() {
+        return tWarehousebillsfeesDr;
+    }
+
+    public void settWarehousebillsfeesDr(List<TWarehousebillsfees> tWarehousebillsfeesDr) {
+        this.tWarehousebillsfeesDr = tWarehousebillsfeesDr;
+    }
+
+    public List<TWarehousebillsfees> getWarehousebillsfeesCr() {
+        return warehousebillsfeesCr;
+    }
+
+    public void setWarehousebillsfeesCr(List<TWarehousebillsfees> warehousebillsfeesCr) {
+        this.warehousebillsfeesCr = warehousebillsfeesCr;
+    }
 
     public String getBoxNumber() {
         return boxNumber;

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

@@ -277,6 +277,26 @@ public class TWarehousebillsfees extends BaseEntity {
      * 是否可修改 0 手动录入
      */
     private Long fSrcTypeId;
+    //客户中文名
+    private String corpName;
+    //费用中文名
+    private String feeName;
+
+    public String getCorpName() {
+        return corpName;
+    }
+
+    public void setCorpName(String corpName) {
+        this.corpName = corpName;
+    }
+
+    public String getFeeName() {
+        return feeName;
+    }
+
+    public void setFeeName(String feeName) {
+        this.feeName = feeName;
+    }
 
     public Long getfSrcTypeId() {
         return fSrcTypeId;

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

@@ -135,4 +135,11 @@ public interface TWarehouseBillsMapper extends BaseMapper<TWarehouseBills> {
      * @return
      */
     public List<TWarehouseBills> webVersionOrderById(TWarehouseBills tWarehouseBills);
+
+    /**
+     * 查询提单号的唯一性
+     * @param tWarehouseBills
+     * @return
+     */
+    public TWarehouseBills selectTWarehousebillsfMblno(TWarehouseBills tWarehouseBills);
 }

+ 5 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsfeesMapper.java

@@ -93,4 +93,9 @@ public interface TWarehousebillsfeesMapper extends BaseMapper<TWarehousebillsfee
     public int selectCharge(Long fId);
 
     public int selectPay(Long fId);
+
+    public List<TWarehousebillsfees> selectFeesByPId(@Param("fPid") Long fPid,
+                                                     @Param("fDc") String fDc);
+    int deleteFessByFPid(@Param("fPid") Long fPid,
+                         @Param("fDc") String fDc);
 }

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

@@ -12,6 +12,7 @@ import com.ruoyi.basicData.domain.TFees;
 import com.ruoyi.basicData.domain.TGoods;
 import com.ruoyi.basicData.domain.TWarehouseArea;
 import com.ruoyi.basicData.mapper.*;
+import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysDictData;
@@ -684,6 +685,8 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         TWarehouseBills warehouseBills = JSONArray.parseObject(tWarehousebills, TWarehouseBills.class);
         JSONArray jsonCrArray = JSONArray.parseArray(tWarehousebillsCntr);
         List<TWarehousebillsCntr> tWarehousebillsCntrs = JSONObject.parseArray(jsonCrArray.toJSONString(), TWarehousebillsCntr.class);
+        //获取客户单位
+        Long clientFid = tCorpsMapper.getClientFid(loginUser.getUser().getPhonenumber());
         if (warehouseBills.getfId() == null) {
             String billNo = billnoSerialServiceImpl.getBillNo("SE", DateUtils.getNowDate());
             warehouseBills.setfBillno(billNo);
@@ -693,6 +696,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             warehouseBills.setfTypeid(1);
             warehouseBills.setfDeptid(loginUser.getUser().getDeptId());
             warehouseBills.setfBsdeptid(loginUser.getUser().getDeptId());
+            warehouseBills.setfCorpid(clientFid);
             if (isApprove) {
                 warehouseBills.setfBillstatus(4L);
             } else {
@@ -870,11 +874,11 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             auditItems.setBillId(fPid);
             auditItems.setActId(actId);
             auditItems.setIffinalItem("F");
-            auditItems.setBillNo(warehouseBills.getfBillno());
+            auditItems.setBillNo(tWarehouseBills.getfBillno());
             // 存储委托方(货权方)
-            auditItems.setRefno1(warehouseBills.getfCorpid() + "");
+            auditItems.setRefno1(tWarehouseBills.getfCorpid() + "");
             // 存储业务类型(业务类型)
-            auditItems.setRefno2(warehouseBills.getfBilltype());
+            auditItems.setRefno2(tWarehouseBills.getfBilltype());
             // 存储提单号(提单号)
             //auditItems.setRefno3(warehouseBills.getfMblno());
             auditItems.setSendUserId(loginUser.getUser().getUserId());
@@ -1354,20 +1358,29 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         List<TWarehouseBills> warehouseBills = tWarehouseBillsMapper.webVersionOrderById(tWarehouseBills);
         if (CollectionUtils.isNotEmpty(warehouseBills)){
             for (TWarehouseBills warehouseBill : warehouseBills) {
+                //货物信息
                 TWarehousebillsCntr warehousebillsCntr = new TWarehousebillsCntr();
                 warehousebillsCntr.setfPid(warehouseBill.getfId());
                 List<TWarehousebillsCntr> tWarehousebillsCntrs = tWarehousebillsCntrMapper.selectTWarehousebillsCntrList(warehousebillsCntr);
                 if (CollectionUtils.isNotEmpty(tWarehousebillsCntrs)){
                     warehouseBill.settWarehousebillsCntrList(tWarehousebillsCntrs);
                 }
+                //配箱信息
                 TWarehousebillsCntritems warehousebillsCntritems = new TWarehousebillsCntritems();
                 warehousebillsCntritems.setfPid(warehouseBill.getfId());
                 List<TWarehousebillsCntritems> tWarehousebillsCntritems = tWarehousebillsCntritemsMapper.selectTWarehousebillsCntritemsList(warehousebillsCntritems);
                 if (CollectionUtils.isNotEmpty(tWarehousebillsCntritems)){
                     warehouseBill.settWarehousebillsCntritemsList(tWarehousebillsCntritems);
                 }
+                //航次信息
                 TVoyage tVoyage = tVoyageMapper.selectTVoyageById(warehouseBill.getfVoyid());
                 warehouseBill.settVoyageL(tVoyage);
+                //应收信息
+                List<TWarehousebillsfees> tWarehousebillsfeesDr = tWarehousebillsfeesMapper.selectFeesByPId(warehouseBill.getfId(), "D");
+                warehouseBill.settWarehousebillsfeesDr(tWarehousebillsfeesDr);
+                //应付信息
+                List<TWarehousebillsfees> warehousebillsfeesCr = tWarehousebillsfeesMapper.selectFeesByPId(warehouseBill.getfId(), "C");
+                warehouseBill.setWarehousebillsfeesCr(warehousebillsfeesCr);
             }
         }
         return warehouseBills;
@@ -1378,17 +1391,23 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     public AjaxResult ruoYiUpdateOrderMessage(String tWarehousebills,String tWarehousebillsCntritems,String tWarehousebillsfeesCr,
                                               String tWarehousebillsfeesDr,LoginUser loginUser,String billsType) {
         TWarehouseBills warehouseBills = JSONArray.parseObject(tWarehousebills, TWarehouseBills.class);
+        Map<String ,Object> map = new HashMap<>();
         if (StringUtils.isEmpty(warehouseBills.getfMblno())){
             return AjaxResult.error("提单号不能为空");
         }
+        TWarehouseBills mblno = tWarehouseBillsMapper.selectTWarehousebillsfMblno(warehouseBills);
+        if (StringUtils.isNotNull(mblno) && !mblno.getfId().equals(mblno.getfId())) {
+            return AjaxResult.error("提单号已存在,请重新提交");
+        }
         TWarehouseBills tWarehouseBills = tWarehouseBillsMapper.selectTWarehousebillsById(warehouseBills.getfId());
-        if (!"11".equals(tWarehouseBills.getfBillstatus())){
+        if (tWarehouseBills.getfBillstatus() != 11L){
             return AjaxResult.error("订单未审核完成,暂不支持维护提单号");
         }
         TWarehouseBills bills = new TWarehouseBills();
         bills.setfId(warehouseBills.getfId());
         bills.setfMblno(warehouseBills.getfMblno());
-        Integer integer = tWarehouseBillsMapper.updateById(bills);
+        Integer integer = tWarehouseBillsMapper.updateTWarehousebills(bills);
+        map.put("tWarehouseBills",tWarehouseBills);
         if (StringUtils.isNotEmpty(tWarehousebillsCntritems)){
             JSONArray jsonCrArray = JSONArray.parseArray(tWarehousebillsCntritems);
             List<TWarehousebillsCntritems> tWarehousebillsCntritemsList = JSONObject.parseArray(jsonCrArray.toJSONString(), TWarehousebillsCntritems.class);
@@ -1402,7 +1421,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
 
                 }
             }
+            map.put("tWarehousebillsCntritemsList",tWarehousebillsCntritemsList);
         }
+        int c = tWarehousebillsfeesMapper.deleteFessByFPid(warehouseBills.getfId(), "C");
         if (StringUtils.isNotNull(tWarehousebillsfeesCr) && !"[]".equals(tWarehousebillsfeesCr)) {
             JSONArray jsonCrArray = JSONArray.parseArray(tWarehousebillsfeesCr);
             List<TWarehousebillsfees> warehousebillsfeesCrList = JSONObject.parseArray(jsonCrArray.toJSONString(), TWarehousebillsfees.class);
@@ -1411,7 +1432,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 wbCr.setfDc("C");
                 wbCr.setfBilltype(billsType);
                 wbCr.setCreateTime(new Date());
-                wbCr.setSrcBillNo(warehouseBills.getfBillno());
+                wbCr.setSrcBillNo(tWarehouseBills.getfBillno());
                 wbCr.setCreateBy(loginUser.getUser().getUserName());
                 //wbCr.setfChargedate(warehouseBills.getfChargedate());
                 //wbCr.setfBillingDeadline(warehouseBills.getfChargedate());
@@ -1420,7 +1441,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 }
                 tWarehousebillsfeesMapper.insertTWarehousebillsfees(wbCr);
             }
+            map.put("warehousebillsfeesCrList",warehousebillsfeesCrList);
         }
+        int d = tWarehousebillsfeesMapper.deleteFessByFPid(warehouseBills.getfId(), "D");
         if (StringUtils.isNotNull(tWarehousebillsfeesDr) && !"[]".equals(tWarehousebillsfeesDr)) {
             JSONArray jsonCrArray = JSONArray.parseArray(tWarehousebillsfeesDr);
             List<TWarehousebillsfees> warehousebillsfeesDrList = JSONObject.parseArray(jsonCrArray.toJSONString(), TWarehousebillsfees.class);
@@ -1430,7 +1453,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 wbDr.setfBillstatus(4L);
                 wbDr.setfBilltype(billsType);
                 wbDr.setCreateTime(new Date());
-                wbDr.setSrcBillNo(warehouseBills.getfBillno());
+                wbDr.setSrcBillNo(tWarehouseBills.getfBillno());
                 wbDr.setCreateBy(loginUser.getUser().getUserName());
                 //wbDr.setfChargedate(warehouseBills.getfChargedate());
                 //wbDr.setfBillingDeadline(warehouseBills.getfChargedate());
@@ -1439,10 +1462,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 }
                 tWarehousebillsfeesMapper.insertTWarehousebillsfees(wbDr);
             }
+            map.put("warehousebillsfeesDrList",warehousebillsfeesDrList);
         }
-
-
-        return AjaxResult.success();
+        return AjaxResult.success("success",map);
     }
 
     @Override
@@ -3041,7 +3063,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         TWarehouseBills tWarehouseBills = new TWarehouseBills();
         tWarehouseBills.setfId(fPid);
         tWarehouseBills.setfBillstatus(fettle);
-        int tFeeUpdateResult = tWarehouseBillsMapper.updateAllColumnById(tWarehouseBills);
+        int tFeeUpdateResult = tWarehouseBillsMapper.updateTWarehousebills(tWarehouseBills);
         if (tFeeUpdateResult <= 0) {
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return AjaxResult.error("更新订单主表状态失败,请联系管理员");

+ 9 - 0
ruoyi-warehouse/src/main/resources/mapper/basicData/TCorpsMapper.xml

@@ -408,5 +408,14 @@
 	    ON tc.f_id = ta.f_pid
 	    WHERE ta.f_tel = #{tel}
     </select>
+    <select id="getClientFid" parameterType="string" resultType="long">
+        SELECT
+            tc.f_id
+        FROM
+            t_corps tc
+                LEFT JOIN t_customer_contact ta
+                          ON tc.f_id = ta.f_pid
+        WHERE ta.f_tel = #{tel}
+    </select>
 
 </mapper>

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

@@ -1354,6 +1354,7 @@
         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}
@@ -1469,7 +1470,7 @@
         tw.f_loadportid,
         tre.f_name loadportName,
         tw.f_destportid,
-        ts.f_name  ,
+        ts.f_name  destportName,
         tc.f_name goodsName,
         CASE
 
@@ -1522,6 +1523,7 @@
         ) tc ON tc.f_pid = tw.f_id
         <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}
@@ -1746,4 +1748,14 @@
                  LEFT JOIN t_voyage ty ON ty.f_id = tw.f_voyid
         where tw.f_id = #{fId}
     </select>
+    <select id="selectTWarehousebillsfMblno" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
+        SELECT
+            f_id,
+            f_mblno
+        FROM
+            t_warehousebills
+        WHERE
+            f_typeid = '1'
+          and f_mblno = #{fMblno}
+    </select>
 </mapper>

+ 190 - 76
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

@@ -51,59 +51,111 @@
         <result property="fBillingway" column="f_billingway"/>
         <result property="fBsdate" column="f_bsdate"/>
         <result property="fOriginalbilldate" column="f_originalbilldate"/>
-        <result property="fStltypeid"    column="f_stltypeid"    />
-        <result property="fBusinessType"    column="f_business_type"    />
-        <result property="fSrcTypeId"    column="f_src_type_id"    />
+        <result property="fStltypeid" column="f_stltypeid"/>
+        <result property="fBusinessType" column="f_business_type"/>
+        <result property="fSrcTypeId" column="f_src_type_id"/>
     </resultMap>
 
     <sql id="selectTWarehousebillsfeesVo">
-        select f_id, f_pid, f_lineno, f_corpid, f_feeid, f_feeUnitid, f_qty, f_unitprice, f_amount, f_currency, f_exrate, f_taxrate, f_dc, f_billstatus, f_review_date, f_statement_no, f_accamount, f_stlamount, f_accamount_date, f_invnos, f_invamount, f_stlamount_no, f_askamount, f_status, f_stlamount_date, del_flag, create_by, create_time, update_by, update_time, remark, src_id, src_bill_no, f_mblno, f_product_name, f_marks, f_chargedate, f_billing_deadline, f_inventory_days, f_amt, f_billing_days, f_billing_qty, f_billtype, f_billingway, f_bsdate, f_originalbilldate, f_stltypeid , f_business_type , f_src_type_id  from t_warehousebillsfees
+        select f_id,
+               f_pid,
+               f_lineno,
+               f_corpid,
+               f_feeid,
+               f_feeUnitid,
+               f_qty,
+               f_unitprice,
+               f_amount,
+               f_currency,
+               f_exrate,
+               f_taxrate,
+               f_dc,
+               f_billstatus,
+               f_review_date,
+               f_statement_no,
+               f_accamount,
+               f_stlamount,
+               f_accamount_date,
+               f_invnos,
+               f_invamount,
+               f_stlamount_no,
+               f_askamount,
+               f_status,
+               f_stlamount_date,
+               del_flag,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark,
+               src_id,
+               src_bill_no,
+               f_mblno,
+               f_product_name,
+               f_marks,
+               f_chargedate,
+               f_billing_deadline,
+               f_inventory_days,
+               f_amt,
+               f_billing_days,
+               f_billing_qty,
+               f_billtype,
+               f_billingway,
+               f_bsdate,
+               f_originalbilldate,
+               f_stltypeid,
+               f_business_type,
+               f_src_type_id
+        from t_warehousebillsfees
     </sql>
 
-    <select id="selectTWarehousebillsfeesList" parameterType="TWarehousebillsfees" resultMap="TWarehousebillsfeesResult">
+    <select id="selectTWarehousebillsfeesList" parameterType="TWarehousebillsfees"
+            resultMap="TWarehousebillsfeesResult">
         <include refid="selectTWarehousebillsfeesVo"/>
         <where>
-            <if test="fPid != null "> and f_pid = #{fPid}</if>
-            <if test="fLineno != null "> and f_lineno = #{fLineno}</if>
-            <if test="fCorpid != null "> and f_corpid = #{fCorpid}</if>
-            <if test="fFeeid != null "> and f_feeid = #{fFeeid}</if>
-            <if test="fFeeunitid != null "> and f_feeUnitid = #{fFeeunitid}</if>
-            <if test="fQty != null "> and f_qty = #{fQty}</if>
-            <if test="fUnitprice != null "> and f_unitprice = #{fUnitprice}</if>
-            <if test="fAmount != null "> and f_amount = #{fAmount}</if>
-            <if test="fCurrency != null  and fCurrency != ''"> and f_currency = #{fCurrency}</if>
-            <if test="fExrate != null "> and f_exrate = #{fExrate}</if>
-            <if test="fTaxrate != null "> and f_taxrate = #{fTaxrate}</if>
-            <if test="fDc != null  and fDc != ''"> and f_dc = #{fDc}</if>
-            <if test="fBillstatus != null  and fBillstatus != ''"> and f_billstatus = #{fBillstatus}</if>
-            <if test="fReviewDate != null "> and f_review_date = #{fReviewDate}</if>
-            <if test="fStatementNo != null  and fStatementNo != ''"> and f_statement_no = #{fStatementNo}</if>
-            <if test="fAccamount != null "> and f_accamount = #{fAccamount}</if>
-            <if test="fStlamount != null "> and f_stlamount = #{fStlamount}</if>
-            <if test="fAccamountDate != null "> and f_accamount_date = #{fAccamountDate}</if>
-            <if test="fInvnos != null  and fInvnos != ''"> and f_invnos = #{fInvnos}</if>
-            <if test="fInvamount != null "> and f_invamount = #{fInvamount}</if>
-            <if test="fStlamountNo != null  and fStlamountNo != ''"> and f_stlamount_no = #{fStlamountNo}</if>
-            <if test="fAskamount != null "> and f_askamount = #{fAskamount}</if>
-            <if test="fStatus != null  and fStatus != ''"> and f_status = #{fStatus}</if>
-            <if test="fStlamountDate != null "> and f_stlamount_date = #{fStlamountDate}</if>
-            <if test="srcId != null "> and src_id = #{srcId}</if>
-            <if test="srcBillNo != null  and srcBillNo != ''"> and src_bill_no = #{srcBillNo}</if>
-            <if test="fMblno != null  and fMblno != ''"> and f_mblno = #{fMblno}</if>
-            <if test="fProductName != null  and fProductName != ''"> and f_product_name like concat('%', #{fProductName}, '%')</if>
-            <if test="fMarks != null  and fMarks != ''"> and f_marks = #{fMarks}</if>
-            <if test="fChargedate != null "> and f_chargedate = #{fChargedate}</if>
-            <if test="fBillingDeadline != null "> and f_billing_deadline = #{fBillingDeadline}</if>
-            <if test="fInventoryDays != null "> and f_inventory_days = #{fInventoryDays}</if>
-            <if test="fAmt != null "> and f_amt = #{fAmt}</if>
-            <if test="fBillingDays != null "> and f_billing_days = #{fBillingDays}</if>
-            <if test="fBillingQty != null "> and f_billing_qty = #{fBillingQty}</if>
-            <if test="fBilltype != null  and fBilltype != ''"> and f_billtype = #{fBilltype}</if>
-            <if test="fBillingway != null "> and f_billingway = #{fBillingway}</if>
-            <if test="fBsdate != null "> and f_bsdate = #{fBsdate}</if>
-            <if test="fOriginalbilldate != null "> and f_originalbilldate = #{fOriginalbilldate}</if>
-            <if test="fStltypeid != null"> and f_stltypeid = #{fStltypeid},</if>
-            <if test="fSrcTypeId != null"> and f_src_type_id = #{fSrcTypeId},</if>
+            <if test="fPid != null ">and f_pid = #{fPid}</if>
+            <if test="fLineno != null ">and f_lineno = #{fLineno}</if>
+            <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
+            <if test="fFeeid != null ">and f_feeid = #{fFeeid}</if>
+            <if test="fFeeunitid != null ">and f_feeUnitid = #{fFeeunitid}</if>
+            <if test="fQty != null ">and f_qty = #{fQty}</if>
+            <if test="fUnitprice != null ">and f_unitprice = #{fUnitprice}</if>
+            <if test="fAmount != null ">and f_amount = #{fAmount}</if>
+            <if test="fCurrency != null  and fCurrency != ''">and f_currency = #{fCurrency}</if>
+            <if test="fExrate != null ">and f_exrate = #{fExrate}</if>
+            <if test="fTaxrate != null ">and f_taxrate = #{fTaxrate}</if>
+            <if test="fDc != null  and fDc != ''">and f_dc = #{fDc}</if>
+            <if test="fBillstatus != null  and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
+            <if test="fReviewDate != null ">and f_review_date = #{fReviewDate}</if>
+            <if test="fStatementNo != null  and fStatementNo != ''">and f_statement_no = #{fStatementNo}</if>
+            <if test="fAccamount != null ">and f_accamount = #{fAccamount}</if>
+            <if test="fStlamount != null ">and f_stlamount = #{fStlamount}</if>
+            <if test="fAccamountDate != null ">and f_accamount_date = #{fAccamountDate}</if>
+            <if test="fInvnos != null  and fInvnos != ''">and f_invnos = #{fInvnos}</if>
+            <if test="fInvamount != null ">and f_invamount = #{fInvamount}</if>
+            <if test="fStlamountNo != null  and fStlamountNo != ''">and f_stlamount_no = #{fStlamountNo}</if>
+            <if test="fAskamount != null ">and f_askamount = #{fAskamount}</if>
+            <if test="fStatus != null  and fStatus != ''">and f_status = #{fStatus}</if>
+            <if test="fStlamountDate != null ">and f_stlamount_date = #{fStlamountDate}</if>
+            <if test="srcId != null ">and src_id = #{srcId}</if>
+            <if test="srcBillNo != null  and srcBillNo != ''">and src_bill_no = #{srcBillNo}</if>
+            <if test="fMblno != null  and fMblno != ''">and f_mblno = #{fMblno}</if>
+            <if test="fProductName != null  and fProductName != ''">and f_product_name like concat('%', #{fProductName},
+                '%')
+            </if>
+            <if test="fMarks != null  and fMarks != ''">and f_marks = #{fMarks}</if>
+            <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
+            <if test="fBillingDeadline != null ">and f_billing_deadline = #{fBillingDeadline}</if>
+            <if test="fInventoryDays != null ">and f_inventory_days = #{fInventoryDays}</if>
+            <if test="fAmt != null ">and f_amt = #{fAmt}</if>
+            <if test="fBillingDays != null ">and f_billing_days = #{fBillingDays}</if>
+            <if test="fBillingQty != null ">and f_billing_qty = #{fBillingQty}</if>
+            <if test="fBilltype != null  and fBilltype != ''">and f_billtype = #{fBilltype}</if>
+            <if test="fBillingway != null ">and f_billingway = #{fBillingway}</if>
+            <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if>
+            <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
+            <if test="fStltypeid != null">and f_stltypeid = #{fStltypeid},</if>
+            <if test="fSrcTypeId != null">and f_src_type_id = #{fSrcTypeId},</if>
         </where>
     </select>
 
@@ -114,7 +166,8 @@
 
     <select id="selectTWarehousebillsfeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
         select f_id, f_pid, f_billing_deadline
-        where f_pid = #{fId} and f_billtype = 'SJCK'
+        where f_pid = #{fId}
+          and f_billtype = 'SJCK'
     </select>
 
     <select id="selectWarehousebillsfeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
@@ -122,33 +175,24 @@
         where f_pid = #{fId}
     </select>
     <select id="selectReconciliation" resultType="java.lang.Integer">
-        SELECT
-            COUNT(d.f_id)
-        FROM
-            t_fee_do  d
-                LEFT JOIN t_fee f ON  d.f_pid = f.f_id
-        WHERE
-            d.f_srcpid = #{fId}
+        SELECT COUNT(d.f_id)
+        FROM t_fee_do d
+                 LEFT JOIN t_fee f ON d.f_pid = f.f_id
+        WHERE d.f_srcpid = #{fId}
           AND f.f_billtype = 'DZ'
     </select>
     <select id="selectCharge" resultType="java.lang.Integer">
-        SELECT
-            COUNT(d.f_id)
-        FROM
-            t_fee_do  d
-            LEFT JOIN t_fee f ON  d.f_pid = f.f_id
-        WHERE
-            d.f_srcpid = #{fId}
+        SELECT COUNT(d.f_id)
+        FROM t_fee_do d
+                 LEFT JOIN t_fee f ON d.f_pid = f.f_id
+        WHERE d.f_srcpid = #{fId}
           AND f.f_billtype = 'SF'
     </select>
     <select id="selectPay" resultType="java.lang.Integer">
-        SELECT
-            COUNT(d.f_id)
-        FROM
-            t_fee_do  d
-                LEFT JOIN t_fee f ON  d.f_pid = f.f_id
-        WHERE
-            d.f_srcpid = #{fId}
+        SELECT COUNT(d.f_id)
+        FROM t_fee_do d
+                 LEFT JOIN t_fee f ON d.f_pid = f.f_id
+        WHERE d.f_srcpid = #{fId}
           AND f.f_billtype = 'FF'
     </select>
 
@@ -313,11 +357,15 @@
     </update>
 
     <delete id="deleteTWarehousebillsfeesById" parameterType="Long">
-        delete from t_warehousebillsfees where f_id = #{fId}
+        delete
+        from t_warehousebillsfees
+        where f_id = #{fId}
     </delete>
 
     <delete id="deleteByFPid" parameterType="Long">
-        delete from t_warehousebillsfees where f_pid = #{fId}
+        delete
+        from t_warehousebillsfees
+        where f_pid = #{fId}
     </delete>
 
     <delete id="deleteTWarehousebillsfeesByIds" parameterType="String">
@@ -329,7 +377,7 @@
 
     <update id="warehouseFeesFollowUpdate">
         update
-            t_warehousebillsfees
+        t_warehousebillsfees
         <trim prefix="SET" suffixOverrides=",">
             <if test="fettle != null">f_billstatus = #{fettle},</if>
             <if test="auditItem != null and fettle == 6">f_review_date = #{auditItem},</if>
@@ -345,28 +393,94 @@
             <if test="map.billType == 'DZ'">
                 f_statement_no = #{map.tFee.fBillno},
                 f_accamount = f_accamount + #{map.tFeeDo.fAmt},
-                f_accamount_date =  #{map.tFee.fAccbilldate}
+                f_accamount_date = #{map.tFee.fAccbilldate}
             </if>
             /*判断撤销对账*/
             <if test="map.billType == 'DZRevoke'">
-                f_statement_no =  #{map.tFee.fBillno},
+                f_statement_no = #{map.tFee.fBillno},
                 f_accamount = f_accamount - #{map.tFeeDo.fAmt},
                 f_accamount_date = #{map.tFee.fAccbilldate}
             </if>
             /*判断收付款*/
             <if test="map.billType == 'DC'">
                 f_stlamount_no = #{map.tFee.fBillno},
-                f_stlamount = f_stlamount +  #{map.tFeeDo.fAmt},
+                f_stlamount = f_stlamount + #{map.tFeeDo.fAmt},
                 f_stlamount_date =#{map.tFee.fAccbilldate}
             </if>
             /*判断撤销收付款*/
             <if test="map.billType == 'DCRevoke'">
                 f_stlamount_no = #{map.tFee.fBillno},
-                f_stlamount = f_stlamount -  #{map.tFeeDo.fAmt},
+                f_stlamount = f_stlamount - #{map.tFeeDo.fAmt},
                 f_stlamount_date =#{map.tFee.fAccbilldate}
             </if>
         </trim>
         where f_id = #{map.tFeeDo.fSrcid}
     </update>
-
+    <select id="selectFeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
+        SELECT
+        tw.f_id,
+        tw.f_pid,
+        tw.f_lineno,
+        tw.f_corpid,
+        tc.f_name corpName,
+        tw.f_feeid,
+        tf.f_name feeName,
+        tw.f_feeUnitid,
+        tw.f_qty,
+        tw.f_unitprice,
+        tw.f_amount,
+        tw.f_currency,
+        tw.f_exrate,
+        tw.f_taxrate,
+        tw.f_dc,
+        tw.f_billstatus,
+        tw.f_review_date,
+        tw.f_statement_no,
+        tw.f_accamount,
+        tw.f_stlamount,
+        tw.f_accamount_date,
+        tw.f_invnos,
+        tw.f_invamount,
+        tw.f_stlamount_no,
+        tw.f_askamount,
+        tw.f_status,
+        tw.f_stlamount_date,
+        tw.del_flag,
+        tw.create_by,
+        tw.create_time,
+        tw.update_by,
+        tw.update_time,
+        tw.remark,
+        tw.src_id,
+        tw.src_bill_no,
+        tw.f_mblno,
+        tw.f_product_name,
+        tw.f_marks,
+        tw.f_chargedate,
+        tw.f_billing_deadline,
+        tw.f_inventory_days,
+        tw.f_amt,
+        tw.f_billing_days,
+        tw.f_billing_qty,
+        tw.f_billtype,
+        tw.f_billingway,
+        tw.f_bsdate,
+        tw.f_originalbilldate,
+        tw.f_stltypeid,
+        tw.f_business_type,
+        tw.f_src_type_id
+        FROM
+        t_warehousebillsfees tw
+        LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
+        LEFT JOIN t_corps tc ON tw.f_corpid = tc.f_id
+        where tw.f_pid = #{fPid}
+          and tw.f_billtype = 'KHDD'
+        <if test="fDc != null  and fDc != ''">and tw.f_dc = #{fDc}</if>
+    </select>
+    <delete id="deleteFessByFPid" parameterType="object">
+        delete
+        from t_warehousebillsfees
+        where f_pid = #{fPid}
+        <if test="fDc != null  and fDc != ''">and f_dc = #{fDc}</if>
+    </delete>
 </mapper>