haungfuli 2 tahun lalu
induk
melakukan
1b3ea1ce8d
13 mengubah file dengan 114 tambahan dan 40 penghapusan
  1. 4 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/FleetMemberInfo.java
  2. 2 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyCargoOwnerInfo.java
  3. 6 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyCompanyInfo.java
  4. 3 3
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/ExceptionDefinition.java
  5. 0 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/RepaymentInfoMapper.java
  6. 9 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CommonUserServiceImpl.java
  7. 1 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FleetInfoServiceImpl.java
  8. 3 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FleetMemberInfoServiceImpl.java
  9. 9 5
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HyFreightSettlementInfoServiceImpl.java
  10. 61 13
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/OrderInfoServiceImpl.java
  11. 1 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/CompanyInfoMapper.xml
  12. 2 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FleetMemberInfoMapper.xml
  13. 13 13
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FreightInfoMapper.xml

+ 4 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/FleetMemberInfo.java

@@ -77,6 +77,10 @@ public class FleetMemberInfo extends BaseModel<FleetMemberInfo> {
      * 列表展示删除标识(1已删除)
      */
     private Long exhibitionDeleteFlag;
+    /**
+     * 加入车队(1加入2邀请)
+     */
+    private String joinTeam;
     /**
      * 模糊查询
      */

+ 2 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyCargoOwnerInfo.java

@@ -65,11 +65,11 @@ public class HyCargoOwnerInfo extends BaseModel<HyCargoOwnerInfo> {
      */
     private String phone;
     /**
-     * 账户余额
+     * 账户余额(元)
      */
     private Double accountBalance;
     /**
-     * 冻结金额
+     * 冻结金额(元)
      */
     private Double frozenAmount;
     /**

+ 6 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyCompanyInfo.java

@@ -69,13 +69,17 @@ public class HyCompanyInfo extends BaseModel<HyCompanyInfo> {
      */
     private String bankDepositBranch;
     /**
-     * 账户余额
+     * 账户余额(元)
      */
     private Double accountBalance;
     /**
-     * 冻结金额
+     * 冻结金额(元)
      */
     private Double frozenAmount;
+    /**
+     * 累计支付运费(元)
+     */
+    private Double accumulatedFreight;
     /**
      * 身份证人像面附件地址
      */

+ 3 - 3
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/ExceptionDefinition.java

@@ -30,13 +30,13 @@ public class ExceptionDefinition {
             new ServiceExceptionDefinition(11001, "发送验证码失败");
 
     public static  ServiceExceptionDefinition USER_VERIFY_CODE_NOT_EXIST =
-            new ServiceExceptionDefinition(11002, "验证码未发送或已过期");
+            new ServiceExceptionDefinition(11002, "验证码错误或已过期");
 
     public static  ServiceExceptionDefinition USER_VERIFY_CODE_NOT_CORRECT =
-            new ServiceExceptionDefinition(11003, "验证码不正确");
+            new ServiceExceptionDefinition(11003, "验证码错误或已过期");
 
     public static  ServiceExceptionDefinition USER_PHONE_HAS_EXISTED =
-            new ServiceExceptionDefinition(11004, "手机已经被注册");
+            new ServiceExceptionDefinition(11004, "手机已注册");
 
     public static  ServiceExceptionDefinition USER_PHONE_NOT_EXIST =
             new ServiceExceptionDefinition(11005, "手机尚未绑定账号");

+ 0 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/RepaymentInfoMapper.java

@@ -1,6 +1,5 @@
 package com.yh.saas.plugin.yiliangyiyun.mapper;
 
-import com.yh.saas.plugin.yiliangyiyun.entity.HyFreightSettlementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.RepaymentInfo;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 

+ 9 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CommonUserServiceImpl.java

@@ -439,6 +439,15 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
                 throw new AppServiceException(ExceptionDefinition.USER_PHONE_NOT_EXIST);
             }
         }
+        //注册
+        if("3".equals(flag)){
+            //2.校验用户是否存在
+            Integer count = this.selectCount(new EntityWrapper<CommonUser>()
+                    .eq("phone", phone).eq("identification", identification));
+            if (count > 0) {
+                throw new AppServiceException(ExceptionDefinition.USER_PHONE_HAS_EXISTED);
+            }
+        }
         String verifyCode = GeneratorUtil.genSixVerifyCode();
         System.out.println("verifyCode:" + verifyCode);
         SMSResult res = smsClient.sendRegisterVerify(phone, verifyCode);

+ 1 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FleetInfoServiceImpl.java

@@ -86,6 +86,7 @@ public class FleetInfoServiceImpl extends ServiceImpl<FleetInfoMapper, FleetInfo
         fleetMemberInfo.setId(IdGenerator.generateUUID());
         fleetMemberInfo.setFleetId(fleetInfo.getId());
         fleetMemberInfo.setCaptainFlag(Long.valueOf(1));
+        fleetMemberInfo.setJoinTeam("1");
         fleetMemberInfo.setStatusKey(StatusEnum.FLEETMEMBER_JOIN.getFlag());
         fleetMemberInfo.setStatus(StatusEnum.FLEETMEMBER_JOIN.getName());
         boolean two = fleetMemberInfoService.insert(fleetMemberInfo);

+ 3 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FleetMemberInfoServiceImpl.java

@@ -99,6 +99,7 @@ public class FleetMemberInfoServiceImpl extends ServiceImpl<FleetMemberInfoMappe
                     .eq("captain_flag", "1").eq("delete_flag", "0"));
             fleetMemberInfo1.setTeamApplication("0");
             this.updateById(fleetMemberInfo1);
+            fleetMemberInfo.setJoinTeam("1");
         } else {
             //查询对方是否已经在车队
             FleetMemberInfo fleetMemberInfo1 = this.selectOne(new EntityWrapper<FleetMemberInfo>().eq("common_id", fleetMemberInfo.getCommonId())
@@ -122,6 +123,7 @@ public class FleetMemberInfoServiceImpl extends ServiceImpl<FleetMemberInfoMappe
                 throw new YException(YExceptionEnum.ALREADY_INVITATION);
             }
             fleetMemberInfo.setFleetInvitation("0");
+            fleetMemberInfo.setJoinTeam("2");
         }
         //新增主键id
         fleetMemberInfo.setId(IdGenerator.generateUUID());
@@ -133,7 +135,7 @@ public class FleetMemberInfoServiceImpl extends ServiceImpl<FleetMemberInfoMappe
 
 
     /**
-     * 入队申请/车队邀请
+     * 入队申请/车队邀请列表
      *
      * @param fleetMemberInfo
      * @return

+ 9 - 5
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HyFreightSettlementInfoServiceImpl.java

@@ -296,12 +296,16 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                         hyDriverCapitalInfo.setOrderNo(orderInfo1.getOrderNo());
                         hyDriverCapitalInfoService.insert(hyDriverCapitalInfo);
                     } else {
-                        //查询是否支付预付款
-                        HyFreightSettlementInfo hyFreightSettlementInfo2 = this.selectOne(new EntityWrapper<HyFreightSettlementInfo>()
+                        //查询是否预付款
+                        HyFreightSettlementInfo hyFreightSettlementInfo3 = this.selectOne(new EntityWrapper<HyFreightSettlementInfo>()
                                 .eq("order_id",hyFreightSettlementInfo1.getOrderId()).eq("payment_type","预付款")
-                                .eq("status_key","7").eq("delete_flag","0"));
-                        if (hyFreightSettlementInfo2 == null){
-                            throw new YException(YExceptionEnum.PAY_ADVANCE_PAYMENT);
+                                .eq("delete_flag","0"));
+                        //有预付款
+                        if (hyFreightSettlementInfo3 != null){
+                            //查询是否支付预付款
+                            if (!"7".equals(hyFreightSettlementInfo3.getStatusKey())){
+                                throw new YException(YExceptionEnum.PAY_ADVANCE_PAYMENT);
+                            }
                         }
                         //尾款
                         freightInfo.setFreightBalance(hyFreightSettlementInfo1.getAmountMoney());

+ 61 - 13
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/OrderInfoServiceImpl.java

@@ -701,14 +701,31 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
             //查询费用表
             FreightInfo freightInfo = freightInfoService.selectOne(new EntityWrapper<FreightInfo>().eq("order_id", orderInfo1.getId())
                     .eq("delete_flag", "0"));
-            //货主发运次数+1,计算累计支付运费
+            //查询货主
             HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
                     .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
+            //货主是公司
+            if(orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()){
+                //计算公司累计支付运费
+                HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
+                if(hyCompanyInfo != null){
+                    Double d = hyCompanyInfo.getAccumulatedFreight();
+                    hyCompanyInfo.setAccumulatedFreight(d + freightInfo.getActualFreight() + freightInfo.getOwnerServiceCharge());
+                    companyInfoService.updateById(hyCompanyInfo);
+                }
+            }
+            //货主是个人
+            else{
+                //计算货主累计支付运费
+                if (hyCargoOwnerInfo != null) {
+                    Double d = hyCargoOwnerInfo.getAccumulatedFreight();
+                    hyCargoOwnerInfo.setAccumulatedFreight(d + freightInfo.getActualFreight() + freightInfo.getOwnerServiceCharge());
+                }
+            }
+            //货主发运次数+1
             if (hyCargoOwnerInfo != null) {
                 Long count = hyCargoOwnerInfo.getShipmentsNumber() + 1;
                 hyCargoOwnerInfo.setShipmentsNumber(count);
-                Double d = hyCargoOwnerInfo.getAccumulatedFreight();
-                hyCargoOwnerInfo.setAccumulatedFreight(d + freightInfo.getActualFreight() + freightInfo.getOwnerServiceCharge());
                 cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
             }
         }
@@ -972,13 +989,27 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                             }
                         }
                         hyFreezingMoneyInfoService.insert(hyFreezingMoneyInfo);
-                        //计算货主累计支付运费
-                        HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
-                                .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
-                        if (hyCargoOwnerInfo != null) {
-                            Double d3 = hyCargoOwnerInfo.getAccumulatedFreight();
-                            hyCargoOwnerInfo.setAccumulatedFreight(d3 + orderInfo1.getAdvanceCharge());
-                            cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
+                        //货主是公司
+                        if(orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()){
+                            //计算公司累计支付运费
+                            HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
+                            if(hyCompanyInfo != null){
+                                Double d3 = hyCompanyInfo.getAccumulatedFreight();
+                                hyCompanyInfo.setAccumulatedFreight(d3 + orderInfo1.getAdvanceCharge());
+                                companyInfoService.updateById(hyCompanyInfo);
+                            }
+                        }
+                        //货主是个人
+                        else{
+                            //查询货主
+                            HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
+                                    .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
+                            //计算货主累计支付运费
+                            if (hyCargoOwnerInfo != null) {
+                                Double d3 = hyCargoOwnerInfo.getAccumulatedFreight();
+                                hyCargoOwnerInfo.setAccumulatedFreight(d3 + orderInfo1.getAdvanceCharge());
+                                cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
+                            }
                         }
                     }
                     freightInfoService.insert(freightInfo);
@@ -1117,14 +1148,31 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                             hyCargoOwnerCapitalInfoService.insert(hyCargoOwnerCapitalInfo);
                         }
                         hyFreezingMoneyInfoService.insert(hyFreezingMoneyInfo);
-                        //货主发运次数+1,计算累计支付运费
+                        //查询货主
                         HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
                                 .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
+                        //货主是公司
+                        if(orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()){
+                            //计算公司累计支付运费
+                            HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
+                            if(hyCompanyInfo != null){
+                                Double d3 = hyCompanyInfo.getAccumulatedFreight();
+                                hyCompanyInfo.setAccumulatedFreight(d3 + freightInfo.getOwnerFreightBalance() + freightInfo.getOwnerServiceCharge());
+                                companyInfoService.updateById(hyCompanyInfo);
+                            }
+                        }
+                        //货主是个人
+                        else{
+                            //计算货主累计支付运费
+                            if (hyCargoOwnerInfo != null) {
+                                Double d3 = hyCargoOwnerInfo.getAccumulatedFreight();
+                                hyCargoOwnerInfo.setAccumulatedFreight(d3 + freightInfo.getOwnerFreightBalance() + freightInfo.getOwnerServiceCharge());
+                            }
+                        }
+                        //货主发运次数+1
                         if (hyCargoOwnerInfo != null) {
                             Long count = hyCargoOwnerInfo.getShipmentsNumber() + 1;
                             hyCargoOwnerInfo.setShipmentsNumber(count);
-                            Double d3 = hyCargoOwnerInfo.getAccumulatedFreight();
-                            hyCargoOwnerInfo.setAccumulatedFreight(d3 + freightInfo.getOwnerFreightBalance() + freightInfo.getOwnerServiceCharge());
                             cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
                         }
                     }

+ 1 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/CompanyInfoMapper.xml

@@ -71,6 +71,7 @@
         c.legal_person_name as legalPersonName,
         c.account_balance as accountBalance,
         c.frozen_amount as frozenAmount,
+        c.accumulated_freight as accumulatedFreight,
         c.corporate_account as corporateAccount,
         c.bank_card as bankCard,
         c.bank_deposit as bankDeposit,

+ 2 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FleetMemberInfoMapper.xml

@@ -76,6 +76,7 @@
         WHERE
         m.delete_flag = '0'
         and f.common_id = #{commonId}
+        and m.join_team = '1'
         and m.exhibition_delete_flag = 0
         ORDER BY m.status_key ASC , m.create_date DESC
         <if test="currentPage != null and currentPage != ''">
@@ -110,6 +111,7 @@
         WHERE
         m.delete_flag = '0'
         AND m.common_id = #{commonId}
+        and m.join_team = '2'
         AND m.exhibition_delete_flag = 0
         ORDER BY m.status_key ASC , m.create_date DESC
         <if test="currentPage != null and currentPage != ''">

+ 13 - 13
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FreightInfoMapper.xml

@@ -7,19 +7,19 @@
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo">
         <if test="year != null and year != ''">
             SELECT
-            SUM(case month(profit_date) when '1' then profit else 0 end)/10000 AS Jan,
-            SUM(case month(profit_date) when '2' then profit else 0 end)/10000 AS Feb,
-            SUM(case month(profit_date) when '3' then profit else 0 end)/10000 AS Mar,
-            SUM(case month(profit_date) when '4' then profit else 0 end)/10000 AS Apr,
-            SUM(case month(profit_date) when '5' then profit else 0 end)/10000 AS May,
-            SUM(case month(profit_date) when '6' then profit else 0 end)/10000 AS June,
-            SUM(case month(profit_date) when '7' then profit else 0 end)/10000 AS July,
-            SUM(case month(profit_date) when '8' then profit else 0 end)/10000 AS Aug,
-            SUM(case month(profit_date) when '9' then profit else 0 end)/10000 AS Sept,
-            SUM(case month(profit_date) when '10' then profit else 0 end)/10000 AS Oct,
-            SUM(case month(profit_date) when '11' then profit else 0 end)/10000 AS Nov,
-            SUM(case month(profit_date) when '12' then profit else 0 end)/10000 AS Dece,
-            SUM(profit)/10000 AS total
+            ROUND(SUM(case month(profit_date) when '1' then profit else 0 end)/10000,4) AS Jan,
+            ROUND(SUM(case month(profit_date) when '2' then profit else 0 end)/10000,4) AS Feb,
+            ROUND(SUM(case month(profit_date) when '3' then profit else 0 end)/10000,4) AS Mar,
+            ROUND(SUM(case month(profit_date) when '4' then profit else 0 end)/10000,4) AS Apr,
+            ROUND(SUM(case month(profit_date) when '5' then profit else 0 end)/10000,4) AS May,
+            ROUND(SUM(case month(profit_date) when '6' then profit else 0 end)/10000,4) AS June,
+            ROUND(SUM(case month(profit_date) when '7' then profit else 0 end)/10000,4) AS July,
+            ROUND(SUM(case month(profit_date) when '8' then profit else 0 end)/10000,4) AS Aug,
+            ROUND(SUM(case month(profit_date) when '9' then profit else 0 end)/10000,4) AS Sept,
+            ROUND(SUM(case month(profit_date) when '10' then profit else 0 end)/10000,4) AS Oct,
+            ROUND(SUM(case month(profit_date) when '11' then profit else 0 end)/10000,4) AS Nov,
+            ROUND(SUM(case month(profit_date) when '12' then profit else 0 end)/10000,4) AS Dece,
+            ROUND(SUM(profit)/10000,4) AS total
             FROM
             hy_freight_info
             WHERE