haungfuli 2 år sedan
förälder
incheckning
4d7e302c93

+ 2 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FreightInfoServiceImpl.java

@@ -95,7 +95,7 @@ public class FreightInfoServiceImpl extends ServiceImpl<FreightInfoMapper, Freig
         freightInfo1.setPayabledFreight(d + freightInfo.getFreightBalance());
         freightInfo1.setNopayableFreight(freightInfo1.getPayableFreight() - freightInfo1.getPayabledFreight());
         Double d1 = freightInfo1.getReceivableFreight();
-        freightInfo1.setReceivableFreight(d1 + freightInfo.getFreightBalance());
+        freightInfo1.setReceivableFreight(d1 + freightInfo.getOwnerFreightBalance());
         freightInfo1.setTotalPayment(freightInfo1.getActualFreight() + freightInfo1.getOwnerServiceCharge());
         boolean one = this.updateById(freightInfo1);
         //查询订单
@@ -145,7 +145,7 @@ public class FreightInfoServiceImpl extends ServiceImpl<FreightInfoMapper, Freig
                 //账户余额小于应收
                 throw new YException(YExceptionEnum.INSUFFICIENT_ACCOUNT_BALANCES);
             } else {
-                //冻结公司账户余额
+                //冻结货主账户余额
                 Double d2 = hyCargoOwnerInfo.getAccountBalance();
                 Double d3 = hyCargoOwnerInfo.getFrozenAmount();
                 hyCargoOwnerInfo.setAccountBalance(d2 - freightInfo1.getReceivableFreight());

+ 12 - 6
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PublishTaskInfoServiceImpl.java

@@ -1196,12 +1196,18 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
             throw new YException(YExceptionEnum.TASK_CANCELLED);
         }
         //查询货主身份授权是否到期
-        HyCargoOwnerCompInfo hyCargoOwnerCompInfo = cargoOwnerCompInfoService.selectOne(new EntityWrapper<HyCargoOwnerCompInfo>().eq("common_id", publishTaskInfo.getCommonId())
-                .eq("delete_flag", "0"));
-        if (hyCargoOwnerCompInfo != null) {
-            boolean cancelled = "11".equals(hyCargoOwnerCompInfo.getStatusKey()) || "17".equals(hyCargoOwnerCompInfo.getStatusKey());
-            if (cancelled) {
-                throw new YException(YExceptionEnum.TASK_CANCELLED);
+        if(!"个人货主".equals(publishTaskInfo.getCargoOwner())){
+            List<HyCargoOwnerCompInfo> hyCargoOwnerCompInfos = cargoOwnerCompInfoService.selectList(new EntityWrapper<HyCargoOwnerCompInfo>().eq("common_id", publishTaskInfo.getCommonId())
+                    .eq("delete_flag", "0"));
+            if (!CollectionUtils.isEmpty(hyCargoOwnerCompInfos)) {
+                for (HyCargoOwnerCompInfo hyCargoOwnerCompInfo : hyCargoOwnerCompInfos){
+                    if (hyCargoOwnerCompInfo.getCompany().equals(publishTaskInfo.getCargoOwner())){
+                        boolean cancelled = "11".equals(hyCargoOwnerCompInfo.getStatusKey()) || "17".equals(hyCargoOwnerCompInfo.getStatusKey());
+                        if (cancelled) {
+                            throw new YException(YExceptionEnum.TASK_CANCELLED);
+                        }
+                    }
+                }
             }
         }
         //获取当前年月日

+ 49 - 21
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/PublishTaskInfoMapper.xml

@@ -131,9 +131,13 @@
         AND p.status_key = '5'
         AND p.show_hide = '1'
         AND c.delete_flag = '0'
-        AND co.status_key != '11'
-        AND co.status_key != '17'
-        AND co.delete_flag = '0'
+        <if test="p != null">
+            <if test="p.comp_id != null">
+                AND co.status_key != '11'
+                AND co.status_key != '17'
+                AND co.delete_flag = '0'
+            </if>
+        </if>
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
                 AND p.freight_advance = '1'
@@ -217,9 +221,13 @@
         AND p.status_key = '5'
         AND p.show_hide = '1'
         AND c.delete_flag = '0'
-        AND co.status_key != '11'
-        AND co.status_key != '17'
-        AND co.delete_flag = '0'
+        <if test="p != null">
+            <if test="p.comp_id != null">
+                AND co.status_key != '11'
+                AND co.status_key != '17'
+                AND co.delete_flag = '0'
+            </if>
+        </if>
         AND p.create_date >= ADDDATE( NOW( ),- 2 )
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
@@ -296,9 +304,13 @@
         AND p.status_key = '5'
         AND p.show_hide = '1'
         AND c.delete_flag = '0'
-        AND co.status_key != '11'
-        AND co.status_key != '17'
-        AND co.delete_flag = '0'
+        <if test="p != null">
+            <if test="p.comp_id != null">
+                AND co.status_key != '11'
+                AND co.status_key != '17'
+                AND co.delete_flag = '0'
+            </if>
+        </if>
         AND p.create_date &lt; ADDDATE( NOW( ),- 2 )
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
@@ -387,9 +399,13 @@
         AND p.status_key = '5'
         AND p.show_hide = '1'
         AND c.delete_flag = '0'
-        AND co.status_key != '11'
-        AND co.status_key != '17'
-        AND co.delete_flag = '0'
+        <if test="p != null">
+            <if test="p.comp_id != null">
+                AND co.status_key != '11'
+                AND co.status_key != '17'
+                AND co.delete_flag = '0'
+            </if>
+        </if>
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
                 AND p.freight_advance = '1'
@@ -477,9 +493,13 @@
         AND p.status_key = '5'
         AND p.show_hide = '1'
         AND c.delete_flag = '0'
-        AND co.status_key != '11'
-        AND co.status_key != '17'
-        AND co.delete_flag = '0'
+        <if test="p != null">
+            <if test="p.comp_id != null">
+                AND co.status_key != '11'
+                AND co.status_key != '17'
+                AND co.delete_flag = '0'
+            </if>
+        </if>
         AND p.create_date >= ADDDATE( NOW( ),- 5 )
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
@@ -556,9 +576,13 @@
         AND p.status_key = '5'
         AND p.show_hide = '1'
         AND c.delete_flag = '0'
-        AND co.status_key != '11'
-        AND co.status_key != '17'
-        AND co.delete_flag = '0'
+        <if test="p != null">
+            <if test="p.comp_id != null">
+                AND co.status_key != '11'
+                AND co.status_key != '17'
+                AND co.delete_flag = '0'
+            </if>
+        </if>
         AND p.create_date &lt; ADDDATE( NOW( ),- 5 )
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
@@ -643,9 +667,13 @@
         AND p.status_key = '5'
         AND p.show_hide = '1'
         AND c.delete_flag = '0'
-        AND co.status_key != '11'
-        AND co.status_key != '17'
-        AND co.delete_flag = '0'
+        <if test="p != null">
+            <if test="p.comp_id != null">
+                AND co.status_key != '11'
+                AND co.status_key != '17'
+                AND co.delete_flag = '0'
+            </if>
+        </if>
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
                 AND p.freight_advance = '1'