Selaa lähdekoodia

凯和商务端修改订单

lazhaoqian 4 vuotta sitten
vanhempi
commit
b844fa0cab

+ 2 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/KHUpdateOrderMessage.java

@@ -46,16 +46,13 @@ public class KHUpdateOrderMessage {
     @PostMapping("/waybillChanges")
     @PostMapping("/waybillChanges")
     public AjaxResult waybillChanges(@RequestParam(value = "tWarehousebills") String tWarehousebills,
     public AjaxResult waybillChanges(@RequestParam(value = "tWarehousebills") String tWarehousebills,
                                               @RequestParam(value = "tWarehousebillsCntr",required = false) String tWarehousebillsCntr,
                                               @RequestParam(value = "tWarehousebillsCntr",required = false) String tWarehousebillsCntr,
-                                              @RequestParam(value = "tWarehousebillsCntritems",required = false) String tWarehousebillsCntritems,
-                                              @RequestParam(value = "tWarehousebillsfeesCr",required = false) String tWarehousebillsfeesCr,
-                                              @RequestParam(value = "tWarehousebillsfeesDr",required = false) String tWarehousebillsfeesDr){
+                                              @RequestParam(value = "tWarehousebillsCntritems",required = false) String tWarehousebillsCntritems){
         if (StringUtils.isEmpty(tWarehousebills)){
         if (StringUtils.isEmpty(tWarehousebills)){
             return AjaxResult.error("未找到订单主表信息,请确认");
             return AjaxResult.error("未找到订单主表信息,请确认");
         }
         }
         String billsType = "KHDD";
         String billsType = "KHDD";
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        return tWarehousebillsService.waybillChanges(tWarehousebills,tWarehousebillsCntr,tWarehousebillsCntritems,
-                tWarehousebillsfeesCr,tWarehousebillsfeesDr,loginUser,billsType);
+        return tWarehousebillsService.waybillChanges(tWarehousebills,tWarehousebillsCntr,tWarehousebillsCntritems, loginUser,billsType);
 
 
     }
     }
 
 

+ 1 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TFeesServiceImpl.java

@@ -72,6 +72,7 @@ public class TFeesServiceImpl implements ITFeesService {
      * @return 结果
      * @return 结果
      */
      */
     @Override
     @Override
+    @Transactional
     public AjaxResult updateTFees(TFees tFees) {
     public AjaxResult updateTFees(TFees tFees) {
         String modify = tFeesMapper.selectTFeesModify(tFees);
         String modify = tFeesMapper.selectTFeesModify(tFees);
         if ("F".equals(modify)) {
         if ("F".equals(modify)) {

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

@@ -501,12 +501,10 @@ public interface ITWarehouseBillsService {
      * 凯和商务端运单变更
      * 凯和商务端运单变更
      * @param tWarehousebills
      * @param tWarehousebills
      * @param tWarehousebillsCntritems
      * @param tWarehousebillsCntritems
-     * @param tWarehousebillsfeesCr
-     * @param tWarehousebillsfeesDr
      * @return
      * @return
      */
      */
     public AjaxResult waybillChanges(String tWarehousebills,String tWarehousebillsCntr,String tWarehousebillsCntritems,
     public AjaxResult waybillChanges(String tWarehousebills,String tWarehousebillsCntr,String tWarehousebillsCntritems,
-                                              String tWarehousebillsfeesCr,String tWarehousebillsfeesDr,LoginUser loginUser,
+                                              LoginUser loginUser,
                                               String billsType);
                                               String billsType);
 
 
     /**
     /**

+ 16 - 39
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -4894,13 +4894,22 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             }
             }
             return approvalFlow;
             return approvalFlow;
+        }else {
+            TWarehouseBills tWarehousebillsById = tWarehouseBillsMapper.selectTWarehousebillsById(fPid);
+            if (tWarehousebillsById.getfSubmitUpdate().longValue() == 6L){
+                TWarehouseBills bills = new TWarehouseBills();
+                bills.setfId(tWarehousebillsById.getfId());
+                bills.setfSubmitUpdate(2L);
+                bills.setfUpdeteStatus(2L);
+                tWarehouseBillsMapper.updateKaHeOrder(bills);
+            }
         }
         }
         return AjaxResult.success();
         return AjaxResult.success();
     }
     }
 
 
     @Override
     @Override
     @Transactional
     @Transactional
-    public AjaxResult waybillChanges(String tWarehousebills, String tWarehousebillsCntr, String tWarehousebillsCntritems, String tWarehousebillsfeesCr, String tWarehousebillsfeesDr, LoginUser loginUser, String billsType) {
+    public AjaxResult waybillChanges(String tWarehousebills, String tWarehousebillsCntr, String tWarehousebillsCntritems, LoginUser loginUser, String billsType) {
         Date date = new Date();//修改时间
         Date date = new Date();//修改时间
         String userName = loginUser.getUser().getUserName();//修改人
         String userName = loginUser.getUser().getUserName();//修改人
         //修改主表信息
         //修改主表信息
@@ -4927,6 +4936,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             JSONArray jsonCrArray = JSONArray.parseArray(tWarehousebillsCntr);
             JSONArray jsonCrArray = JSONArray.parseArray(tWarehousebillsCntr);
             List<TWarehousebillsCntr> tWarehousebillsCntrList = JSONObject.parseArray(jsonCrArray.toJSONString(), TWarehousebillsCntr.class);
             List<TWarehousebillsCntr> tWarehousebillsCntrList = JSONObject.parseArray(jsonCrArray.toJSONString(), TWarehousebillsCntr.class);
             for (TWarehousebillsCntr warehousebillsCntr : tWarehousebillsCntrList) {
             for (TWarehousebillsCntr warehousebillsCntr : tWarehousebillsCntrList) {
+                if(warehousebillsCntr.getfId() == null){
+                    warehousebillsCntr.setfPid(warehouseBills.getfId());
+                }
                 if (warehousebillsCntr.getCreateTime() == null){
                 if (warehousebillsCntr.getCreateTime() == null){
                     warehousebillsCntr.setCreateTime(date);
                     warehousebillsCntr.setCreateTime(date);
                 }else {
                 }else {
@@ -4946,6 +4958,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             JSONArray objects = JSONArray.parseArray(tWarehousebillsCntritems);
             JSONArray objects = JSONArray.parseArray(tWarehousebillsCntritems);
             List<TWarehousebillsCntritems> tWarehousebillsCntritemsList = JSONObject.parseArray(objects.toJSONString(), TWarehousebillsCntritems.class);
             List<TWarehousebillsCntritems> tWarehousebillsCntritemsList = JSONObject.parseArray(objects.toJSONString(), TWarehousebillsCntritems.class);
             for (TWarehousebillsCntritems warehousebillsCntritems : tWarehousebillsCntritemsList) {
             for (TWarehousebillsCntritems warehousebillsCntritems : tWarehousebillsCntritemsList) {
+                if(warehousebillsCntritems.getfId() == null){
+                    warehousebillsCntritems.setfPid(warehouseBills.getfId());
+                }
                 if (warehousebillsCntritems.getCreateTime() == null){
                 if (warehousebillsCntritems.getCreateTime() == null){
                     warehousebillsCntritems.setCreateTime(date);
                     warehousebillsCntritems.setCreateTime(date);
                 }else {
                 }else {
@@ -4959,44 +4974,6 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 tWarehousebillsCntritemsMapper.insertTWarehousebillsCntritems(warehousebillsCntritems);
                 tWarehousebillsCntritemsMapper.insertTWarehousebillsCntritems(warehousebillsCntritems);
             }
             }
         }
         }
-        //修改付费信息
-        if (StringUtils.isNotEmpty(tWarehousebillsfeesCr) && !"[]".equals(tWarehousebillsfeesCr)){
-            tWarehousebillsfeesMapper.deleteFessByFPid(warehouseBills.getfId(),"C");
-            JSONArray jsonArray = JSONArray.parseArray(tWarehousebillsfeesCr);
-            List<TWarehousebillsfees> warehousebillsfeesCrList = JSONObject.parseArray(jsonArray.toJSONString(), TWarehousebillsfees.class);
-            for (TWarehousebillsfees tWarehousebillsfees : warehousebillsfeesCrList) {
-                if (tWarehousebillsfees.getCreateTime() == null){
-                    tWarehousebillsfees.setCreateTime(date);
-                }else {
-                    tWarehousebillsfees.setUpdateTime(date);
-                }
-                if (StringUtils.isNull(tWarehousebillsfees.getCreateBy())){
-                    tWarehousebillsfees.setCreateBy(userName);
-                }else {
-                    tWarehousebillsfees.setUpdateBy(userName);
-                }
-                tWarehousebillsfeesMapper.insertTWarehousebillsfees(tWarehousebillsfees);
-            }
-        }
-        //修改收费费信息
-        if (StringUtils.isNotEmpty(tWarehousebillsCntritems) && !"[]".equals(tWarehousebillsCntritems)){
-            tWarehousebillsfeesMapper.deleteFessByFPid(warehouseBills.getfId(),"D");
-            JSONArray parseArray = JSONArray.parseArray(tWarehousebillsfeesDr);
-            List<TWarehousebillsfees> warehousebillsfeesDrList = JSONObject.parseArray(parseArray.toJSONString(), TWarehousebillsfees.class);
-            for (TWarehousebillsfees tWarehousebillsfees : warehousebillsfeesDrList) {
-                if (tWarehousebillsfees.getCreateTime() == null){
-                    tWarehousebillsfees.setCreateTime(date);
-                }else {
-                    tWarehousebillsfees.setUpdateTime(date);
-                }
-                if (StringUtils.isNull(tWarehousebillsfees.getCreateBy())){
-                    tWarehousebillsfees.setCreateBy(userName);
-                }else {
-                    tWarehousebillsfees.setUpdateBy(userName);
-                }
-                tWarehousebillsfeesMapper.insertTWarehousebillsfees(tWarehousebillsfees);
-            }
-        }
         return AjaxResult.success();
         return AjaxResult.success();
     }
     }
 
 

+ 68 - 26
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -1660,29 +1660,29 @@
         WHEN tw.f_billstatus = '12' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         WHEN tw.f_billstatus = '12' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         '运单变更'
         '运单变更'
         WHEN  tw.f_updete_status = '3'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_updete_status = '3'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
-        '运单修改驳回'
+        '申请变更驳回'
         WHEN  tw.f_updete_status = '4'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_updete_status = '4'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
-        '运单修改提交'
+        '申请变更提交'
         WHEN  tw.f_updete_status = '5'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_updete_status = '5'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
-        '运单修改审批中'
+        '申请变更审批中'
         WHEN  tw.f_updete_status = '6'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_updete_status = '6'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
-        '运单修改通过'
+        '申请变更通过'
         WHEN  tw.f_submit_update = '3' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_submit_update = '3' and tw.f_delete_status = '2' THEN
-        '修改提交驳回'
+        '提交变更驳回'
         WHEN  tw.f_submit_update = '4' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_submit_update = '4' and tw.f_delete_status = '2' THEN
-        '修改提交审批'
+        '提交变更审批'
         WHEN  tw.f_submit_update = '5' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_submit_update = '5' and tw.f_delete_status = '2' THEN
-        '修改提交审批中'
+        '提交变更审批中'
         WHEN  tw.f_submit_update = '6' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_submit_update = '6' and tw.f_delete_status = '2' THEN
-        '修改提交通过'
+        '提交变更通过'
         WHEN  tw.f_delete_status = '3' THEN
         WHEN  tw.f_delete_status = '3' THEN
-        '运单删除驳回'
+        '申请删单驳回'
         WHEN  tw.f_delete_status = '4' THEN
         WHEN  tw.f_delete_status = '4' THEN
-        '运单删除提交'
+        '申请删单提交'
         WHEN  tw.f_delete_status = '5' THEN
         WHEN  tw.f_delete_status = '5' THEN
-        '运单删除审批中'
+        '申请删单审批中'
         WHEN  tw.f_delete_status = '6' THEN
         WHEN  tw.f_delete_status = '6' THEN
-        '运单删除通过'
+        '申请删单通过'
         END AS fBillstatus,
         END AS fBillstatus,
         CASE
         CASE
         WHEN tf.f_billstatus = '1' THEN
         WHEN tf.f_billstatus = '1' THEN
@@ -1768,7 +1768,28 @@
             <if test="fIfdamage != null  and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
             <if test="fIfdamage != null  and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
             <if test="fBankcorpid != null  and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
             <if test="fBankcorpid != null  and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
             <if test="fBilltype != null  and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
             <if test="fBilltype != null  and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
-            <if test="fBillstatus != null ">and tw.f_billstatus = #{fBillstatus}</if>
+            <if test="fBillstatus == null">
+                and tw.f_updete_status = 2
+                and tw.f_submit_update = 2
+                and tw.f_delete_status = 2
+            </if>
+            <if test="fBillstatus != null and (fBillstatus == 4 or fBillstatus == 6 or fBillstatus == 9 or fBillstatus == 11)">
+                and tw.f_billstatus = #{fBillstatus}
+                and tw.f_updete_status = 2
+                and tw.f_submit_update = 2
+                and tw.f_delete_status = 2
+            </if>
+            <if test="fBillstatus != null and fBillstatus == 10">
+                and tw.f_billstatus in ('3','8')
+                and tw.f_updete_status in ('2','3')
+                and tw.f_submit_update in ('2','3')
+                and tw.f_delete_status in ('2','3')
+            </if>
+            <if test="fBillstatus != null and fBillstatus == 12">
+                AND (tw.f_updete_status != 2
+                OR tw.f_submit_update != 2
+                OR tw.f_delete_status != 2 )
+            </if>
             <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
             <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
             <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
             <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
             <if test="fProductName != null  and fProductName != ''">and tw.f_product_name like concat('%',
             <if test="fProductName != null  and fProductName != ''">and tw.f_product_name like concat('%',
@@ -1892,29 +1913,29 @@
         WHEN tw.f_billstatus = '12' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         WHEN tw.f_billstatus = '12' and tw.f_updete_status = '2'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         '运单变更'
         '运单变更'
         WHEN  tw.f_updete_status = '3'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_updete_status = '3'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
-        '运单修改驳回'
+        '申请变更驳回'
         WHEN  tw.f_updete_status = '4'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_updete_status = '4'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
-        '运单修改提交'
+        '申请变更提交'
         WHEN  tw.f_updete_status = '5'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_updete_status = '5'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
-        '运单修改审批中'
+        '申请变更审批中'
         WHEN  tw.f_updete_status = '6'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_updete_status = '6'and tw.f_submit_update = '2' and tw.f_delete_status = '2' THEN
-        '运单修改通过'
+        '申请变更通过'
         WHEN  tw.f_submit_update = '3' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_submit_update = '3' and tw.f_delete_status = '2' THEN
-        '修改提交驳回'
+        '提交变更驳回'
         WHEN  tw.f_submit_update = '4' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_submit_update = '4' and tw.f_delete_status = '2' THEN
-        '修改提交审批'
+        '提交变更审批'
         WHEN  tw.f_submit_update = '5' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_submit_update = '5' and tw.f_delete_status = '2' THEN
-        '修改提交审批中'
+        '提交变更审批中'
         WHEN  tw.f_submit_update = '6' and tw.f_delete_status = '2' THEN
         WHEN  tw.f_submit_update = '6' and tw.f_delete_status = '2' THEN
-        '修改提交通过'
+        '提交变更通过'
         WHEN  tw.f_delete_status = '3' THEN
         WHEN  tw.f_delete_status = '3' THEN
-        '运单删除驳回'
+        '申请删单驳回'
         WHEN  tw.f_delete_status = '4' THEN
         WHEN  tw.f_delete_status = '4' THEN
-        '运单删除提交'
+        '申请删单提交'
         WHEN  tw.f_delete_status = '5' THEN
         WHEN  tw.f_delete_status = '5' THEN
-        '运单删除审批中'
+        '申请删单审批中'
         WHEN  tw.f_delete_status = '6' THEN
         WHEN  tw.f_delete_status = '6' THEN
-        '运单删除通过'
+        '申请删单通过'
         END AS fBillstatusName,
         END AS fBillstatusName,
         CASE
         CASE
         WHEN tf.f_billstatus = '1' THEN
         WHEN tf.f_billstatus = '1' THEN
@@ -2000,7 +2021,28 @@
             <if test="fIfdamage != null  and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
             <if test="fIfdamage != null  and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
             <if test="fBankcorpid != null  and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
             <if test="fBankcorpid != null  and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
             <if test="fBilltype != null  and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
             <if test="fBilltype != null  and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
-            <if test="fBillstatus != null ">and tw.f_billstatus = #{fBillstatus}</if>
+            <if test="fBillstatus == null">
+            and tw.f_updete_status = 2
+            and tw.f_submit_update = 2
+            and tw.f_delete_status = 2
+            </if>
+            <if test="fBillstatus != null and (fBillstatus == 4 or fBillstatus == 6 or fBillstatus == 9 or fBillstatus == 11)">
+                and tw.f_billstatus = #{fBillstatus}
+                and tw.f_updete_status = 2
+                and tw.f_submit_update = 2
+                and tw.f_delete_status = 2
+            </if>
+            <if test="fBillstatus != null and fBillstatus == 10">
+                and tw.f_billstatus in ('3','8')
+                and tw.f_updete_status in ('2','3')
+                and tw.f_submit_update in ('2','3')
+                and tw.f_delete_status in ('2','3')
+            </if>
+            <if test="fBillstatus != null and fBillstatus == 12">
+                AND (tw.f_updete_status != 2
+                OR tw.f_submit_update != 2
+                OR tw.f_delete_status != 2 )
+            </if>
             <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
             <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
             <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
             <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
             <if test="fProductName != null  and fProductName != ''">and tw.f_product_name like concat('%',
             <if test="fProductName != null  and fProductName != ''">and tw.f_product_name like concat('%',