haungfuli há 3 anos atrás
pai
commit
4a36f579cc

+ 3 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/constant/StatusEnum.java

@@ -76,7 +76,8 @@ public enum StatusEnum {
     IDENTITY_REVIEWED("1", "审核中", "reviewed"),
     IDENTITY_FAILED("3", "未通过", "passed"),
     IDENTITY_COMPLETED("5", "已认证", "Completed"),
-    IDENTITY_COMPLETED_NO("7", "禁用", "Completed"),
+    IDENTITY_COMPLETED_NO("7", "已禁用", "identity_completed_no"),
+    IDENTITY_OVERDUE("9", "已过期", "identity_overdue"),
 
     //确认卸货状态
     NOT_CONFIRM("1", "未确认", "not_confirmed"),
@@ -195,6 +196,7 @@ public enum StatusEnum {
     PLATFORM_EXAMINEING("5", "平台审核中", "platform_examineing"),
     PLATFORM_REJECTED("7", "平台已驳回", "platform_rejected"),
     PLATFORM_CERTIFIED("9", "已认证", "platform_certified"),
+    CAUTHORIZATION_OVERDUE("11", "授权已过期", "authorization_overdue"),
     CAUTHORIZATION_REVOKED("17", "授权已撤销", "authorization_revoked"),
 
     //平台规定管理状态

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

@@ -65,7 +65,7 @@ public class CargoOwnerCompInfo extends BaseModel<CargoOwnerCompInfo> {
      */
     private String advanceFreightService;
     /**
-     * 认证状态key(1企业审核中3企业已驳回5平台审核中7平台已驳回审核9已认证11授权已过期13企业暂不可用15企业不存在17授权已撤销)
+     * 认证状态key(1企业审核中3企业已驳回5平台审核中7平台已驳回9已认证11授权已过期13企业暂不可用15企业不存在17授权已撤销)
      */
     private String statusKey;
     /**

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

@@ -75,7 +75,7 @@ public class CargoOwnerInfo extends BaseModel<CargoOwnerInfo> {
      */
     private String cardValidityDate;
     /**
-     * 认证状态key(1审核中3已驳回5已通过7禁用)
+     * 认证状态key(1审核中3已驳回5已通过7禁用9已过期
      */
     private String authenticationStatusKey;
     /**

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

@@ -108,7 +108,7 @@ public class CompanyInfo extends BaseModel<CompanyInfo> {
      */
     private String advanceFreightService;
     /**
-     * 认证状态key(1审核中3已驳回5已认证)
+     * 认证状态key(1审核中3已驳回5已认证7已过期
      */
     private String statusKey;
     /**

+ 5 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/DriverInfo.java

@@ -172,13 +172,17 @@ public class DriverInfo extends BaseModel<DriverInfo> {
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date trailerOperationCertificateValidityDate;
     /**
-     * 认证状态key(1审核中3未通过5已认证7 禁用
+     * 认证状态key(1审核中3未通过5已认证7已禁用9已过期
      */
     private String authenticationStatusKey;
     /**
      * 认证状态
      */
     private String authenticationStatus;
+    /**
+     * 过期标识(1身份证过期2驾驶证过期3行驶证过期4挂车行驶证过期5从业资格证过期6道路运输证过期7挂车运输证过期)
+     */
+    private String overdueFlag;
     /**
      * 第一次认证标识(1是)
      */

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

@@ -8,7 +8,6 @@ import com.yh.saas.common.support.util.StringUtils;
 import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.*;
-import com.yh.saas.plugin.yiliangyiyun.entity.view.GoodsSourceView;
 import com.yh.saas.plugin.yiliangyiyun.exception.YException;
 import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.PublishTaskInfoMapper;
@@ -21,9 +20,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
-import java.lang.reflect.Array;
-import java.text.DateFormat;
+
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
 import java.util.*;
 
 /**
@@ -55,6 +54,11 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
     private IProvinceCityInfoService provinceCityInfoService;
     @Autowired
     private ICompanyInfoService companyInfoService;
+    @Autowired
+    private ICargoOwnerCompInfoService cargoOwnerCompInfoService;
+    @Autowired
+    private IDriverInfoService driverInfoService;
+
 
     /**
      * 地球半径,单位 km
@@ -68,34 +72,124 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
     @Transactional
     @Scheduled(cron = "0 20 1 * * ?")
     public void rushTime() {
+
+        //获取当前年月日
+        SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
+        String date = f.format(new Date(System.currentTimeMillis()));
+        Date date1 = new Date();
+
+        //查询任务
         List<PublishTaskInfo> publishTaskInfos = this.selectList(new EntityWrapper<PublishTaskInfo>().eq("delete_flag", "0"));
         if (!CollectionUtils.isEmpty(publishTaskInfos)) {
             publishTaskInfos.forEach(publishTaskInfo -> {
                 publishTaskInfo.setRefreshTimes("0");
+                if (!"长期有效".equals(publishTaskInfo.getTaskValidity())) {
+                    //任务有效期与日期比较
+                    int result = publishTaskInfo.getTaskValidity().compareTo(date);
+                    if(result > 0){
+                        publishTaskInfo.setStatus(StatusEnum.TASK_ADOPT.getName());
+                        publishTaskInfo.setStatusKey(StatusEnum.TASK_ADOPT.getFlag());
+                    }
+                }
+                this.updateById(publishTaskInfo);
             });
         }
+
+        //查询货主
         List<CargoOwnerInfo> cargoOwnerInfos = cargoOwnerInfoService.selectList(new EntityWrapper<CargoOwnerInfo>().eq("delete_flag", "0"));
         if (!CollectionUtils.isEmpty(cargoOwnerInfos)) {
             cargoOwnerInfos.forEach(cargoOwnerInfo -> {
                 cargoOwnerInfo.setRefreshTimes(0L);
+                if(!"长期".equals(cargoOwnerInfo.getCardValidityDate())){
+                    int result = cargoOwnerInfo.getCardValidityDate().compareTo(date);
+                    if(result > 0){
+                        cargoOwnerInfo.setAuthenticationStatus(StatusEnum.IDENTITY_OVERDUE.getName());
+                        cargoOwnerInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_OVERDUE.getFlag());
+                    }
+                }
+                cargoOwnerInfoService.updateById(cargoOwnerInfo);
             });
         }
 
-        //获取当前年月日
-        SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
-        String date = f.format(new Date(System.currentTimeMillis()));
-
         //查询企业
-//        List<CompanyInfo> companyInfos = companyInfoService.selectList(new EntityWrapper<CompanyInfo>().eq("delete_flag","0")
-//                .ne("business_term_date","长期"));
-//        if(!CollectionUtils.isEmpty(companyInfos)){
-//            companyInfos.forEach(companyInfo -> {
-//                int result = companyInfo.getBusinessTermDate().compareTo(date);
-//                if(result > 0){
-//
-//                }
-//            });
-//        }
+        List<CompanyInfo> companyInfos = companyInfoService.selectList(new EntityWrapper<CompanyInfo>().eq("delete_flag","0")
+                .ne("business_term_date","长期"));
+        if(!CollectionUtils.isEmpty(companyInfos)){
+            companyInfos.forEach(companyInfo -> {
+                //企业营业期限截止日期与日期比较
+                int result = companyInfo.getBusinessTermDate().compareTo(date);
+                if(result > 0){
+                    companyInfo.setStatus(StatusEnum.TASK_ADOPT.getName());
+                    companyInfo.setStatusKey(StatusEnum.TASK_ADOPT.getFlag());
+                    companyInfoService.updateById(companyInfo);
+                }
+            });
+        }
+
+        //查询授权审核
+        List<CargoOwnerCompInfo> cargoOwnerCompInfos = cargoOwnerCompInfoService.selectList(new EntityWrapper<CargoOwnerCompInfo>().eq("delete_flag","0")
+                .ne("authorization_deadline","长期"));
+        if(!CollectionUtils.isEmpty(cargoOwnerCompInfos)){
+            cargoOwnerCompInfos.forEach(cargoOwnerCompInfo -> {
+                //授权截止日期与日期比较
+                int result = cargoOwnerCompInfo.getAuthorizationDeadline().compareTo(date);
+                if(result > 0){
+                    cargoOwnerCompInfo.setStatus(StatusEnum.CAUTHORIZATION_OVERDUE.getName());
+                    cargoOwnerCompInfo.setStatusKey(StatusEnum.CAUTHORIZATION_OVERDUE.getFlag());
+                    cargoOwnerCompInfoService.updateById(cargoOwnerCompInfo);
+                }
+            });
+        }
+
+        //查询司机
+        List<DriverInfo> driverInfos = driverInfoService.selectList(new EntityWrapper<DriverInfo>().eq("delete_flag","0"));
+        if(!CollectionUtils.isEmpty(driverInfos)){
+            driverInfos.forEach(driverInfo -> {
+                //身份证
+                if(!"长期".equals(driverInfo.getCardValidityDate())){
+                    //身份证截止日期与日期比较
+                    int result1 = driverInfo.getCardValidityDate().compareTo(date);
+                    if(result1 > 0){
+                        driverInfo.setOverdueFlag("1");
+                    }
+                }
+                //驾驶证
+                int result2 = driverInfo.getDriverLicenseValidityDate().compareTo(date1);
+                if(result2 > 0){
+                    driverInfo.setOverdueFlag("2");
+                }
+                //行驶证
+                int result3 = driverInfo.getDrivingLicenseValidityDate().compareTo(date1);
+                if(result3 > 0){
+                    driverInfo.setOverdueFlag("3");
+                }
+                //挂车行驶证
+                int result4 = driverInfo.getTrailerLicenseValidityDate().compareTo(date1);
+                if(result4 > 0){
+                    driverInfo.setOverdueFlag("4");
+                }
+                //从业资格证
+                int result5 = driverInfo.getQualificationCertificateValidityDate().compareTo(date1);
+                if(result5 > 0){
+                    driverInfo.setOverdueFlag("5");
+                }
+                //道路运输证
+                int result6 = driverInfo.getOperationCertificateValidityDate().compareTo(date1);
+                if(result6 > 0){
+                    driverInfo.setOverdueFlag("6");
+                }
+                //挂车运输证
+                int result7 = driverInfo.getTrailerOperationCertificateValidityDate().compareTo(date1);
+                if(result7 > 0){
+                    driverInfo.setOverdueFlag("7");
+                }
+                driverInfo.setAuthenticationStatus(StatusEnum.IDENTITY_OVERDUE.getName());
+                driverInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_OVERDUE.getFlag());
+                driverInfoService.updateById(driverInfo);
+            });
+        }
+
+
     }
 
     /**

+ 6 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/CargoOwnerInfoMapper.xml

@@ -22,6 +22,9 @@
             <if test="searchType == 4">
                 AND authentication_status_key = '7'
             </if>
+            <if test="searchType == 5">
+                AND authentication_status_key = '9'
+            </if>
         </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(name) like lower(CONCAT('%',#{searchKeyWord},'%'))
@@ -64,6 +67,9 @@
             <if test="searchType == 4">
                 AND c.authentication_status_key = '7'
             </if>
+            <if test="searchType == 5">
+                AND c.authentication_status_key = '9'
+            </if>
         </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(c.name) like lower(CONCAT('%',#{searchKeyWord},'%'))

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

@@ -93,6 +93,9 @@
             <if test="searchType == 3">
                 AND c.status_key = '5'
             </if>
+            <if test="searchType == 4">
+                AND c.status_key = '7'
+            </if>
         </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(c.legal_person_name) like lower(CONCAT('%',#{searchKeyWord},'%'))

+ 6 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/DriverInfoMapper.xml

@@ -23,6 +23,9 @@
         <if test="searchType == 4">
             AND authentication_status_key = '7'
         </if>
+        <if test="searchType == 5">
+            AND authentication_status_key = '9'
+        </if>
     </if>
     <if test="searchKeyWord != null and searchKeyWord != ''">
         AND (lower(driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
@@ -75,6 +78,9 @@
             <if test="searchType == 4">
                 AND d.authentication_status_key = '7'
             </if>
+            <if test="searchType == 5">
+                AND d.authentication_status_key = '9'
+            </if>
         </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))

+ 36 - 37
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/OrderInfoMapper.xml

@@ -21,28 +21,28 @@
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
                 AND order_status_key = '1'
-                OR order_status_key = '3'
+                OR (order_status_key = '3' AND common_id = #{commonId})
             </if>
             <if test="searchType == 2">
                 AND order_status_key = '5'
-                OR order_status_key = '7'
-                OR order_status_key = '9'
-                OR order_status_key = '11'
-                OR order_status_key = '13'
+                OR (order_status_key = '7' AND common_id = #{commonId})
+                OR (order_status_key = '9' AND common_id = #{commonId})
+                OR (order_status_key = '11' AND common_id = #{commonId})
+                OR (order_status_key = '13' AND common_id = #{commonId})
             </if>
             <if test="searchType == 3">
                 AND order_status_key = '15'
-                OR order_status_key = '17'
-                OR order_status_key = '19'
-                OR order_status_key = '21'
+                OR (order_status_key = '17' AND common_id = #{commonId})
+                OR (order_status_key = '19' AND common_id = #{commonId})
+                OR (order_status_key = '21' AND common_id = #{commonId})
             </if>
             <if test="searchType == 4">
                 AND order_status_key = '23'
-                OR order_status_key = '29'
+                OR (order_status_key = '29' AND common_id = #{commonId})
             </if>
             <if test="searchType == 5">
                 AND order_status_key = '25'
-                OR order_status_key = '27'
+                OR (order_status_key = '27' AND common_id = #{commonId})
             </if>
         </if>
     </select>
@@ -86,28 +86,28 @@
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
                 AND o.order_status_key = '1'
-                OR o.order_status_key = '3'
+                OR (o.order_status_key = '3' AND o.common_id = #{commonId})
             </if>
             <if test="searchType == 2">
                 AND o.order_status_key = '5'
-                OR o.order_status_key = '7'
-                OR o.order_status_key = '9'
-                OR o.order_status_key = '11'
-                OR o.order_status_key = '13'
+                OR (o.order_status_key = '7' AND o.common_id = #{commonId})
+                OR (o.order_status_key = '9' AND o.common_id = #{commonId})
+                OR (o.order_status_key = '11' AND o.common_id = #{commonId})
+                OR (o.order_status_key = '13' AND o.common_id = #{commonId})
             </if>
             <if test="searchType == 3">
                 AND o.order_status_key = '15'
-                OR o.order_status_key = '17'
-                OR o.order_status_key = '19'
-                OR o.order_status_key = '21'
+                OR (o.order_status_key = '17' AND o.common_id = #{commonId})
+                OR (o.order_status_key = '19' AND o.common_id = #{commonId})
+                OR (o.order_status_key = '21' AND o.common_id = #{commonId})
             </if>
             <if test="searchType == 4">
                 AND o.order_status_key = '23'
-                OR o.order_status_key = '29'
+                OR (o.order_status_key = '29' AND o.common_id = #{commonId})
             </if>
             <if test="searchType == 5">
                 AND o.order_status_key = '25'
-                OR o.order_status_key = '27'
+                OR (o.order_status_key = '27' AND o.common_id = #{commonId})
             </if>
         </if>
         ORDER BY o.create_date DESC
@@ -142,16 +142,16 @@
             </if>
             <if test="searchType == 3">
                 AND cargo_owner_status_key = '5'
-                OR cargo_owner_status_key = '7'
-                OR cargo_owner_status_key = '9'
-                OR cargo_owner_status_key = '11'
-                OR cargo_owner_status_key = '13'
+                OR (cargo_owner_status_key = '7' AND cargo_common_id = #{cargoCommonId})
+                OR (cargo_owner_status_key = '9' AND cargo_common_id = #{cargoCommonId})
+                OR (cargo_owner_status_key = '11' AND cargo_common_id = #{cargoCommonId})
+                OR (cargo_owner_status_key = '13' AND cargo_common_id = #{cargoCommonId})
             </if>
             <if test="searchType == 4">
                 AND cargo_owner_status_key = '15'
-                OR cargo_owner_status_key = '17'
-                OR cargo_owner_status_key = '19'
-                OR cargo_owner_status_key = '21'
+                OR (cargo_owner_status_key = '17' AND cargo_common_id = #{cargoCommonId})
+                OR (cargo_owner_status_key = '19' AND cargo_common_id = #{cargoCommonId})
+                OR (cargo_owner_status_key = '21' AND cargo_common_id = #{cargoCommonId})
             </if>
             <if test="searchType == 5">
                 AND cargo_owner_status_key = '23'
@@ -167,7 +167,7 @@
             </if>
             <if test="searchType == 9">
                 AND cargo_owner_status_key = '31'
-                OR cargo_owner_status_key = '33'
+                OR (cargo_owner_status_key = '33' AND cargo_common_id = #{cargoCommonId})
             </if>
         </if>
     </select>
@@ -222,16 +222,16 @@
             </if>
             <if test="searchType == 3">
                 AND o.cargo_owner_status_key = '5'
-                OR o.cargo_owner_status_key = '7'
-                OR o.cargo_owner_status_key = '9'
-                OR o.cargo_owner_status_key = '11'
-                OR o.cargo_owner_status_key = '13'
+                OR (o.cargo_owner_status_key = '7' AND o.cargo_common_id = #{cargoCommonId})
+                OR (o.cargo_owner_status_key = '9' AND o.cargo_common_id = #{cargoCommonId})
+                OR (o.cargo_owner_status_key = '11' AND o.cargo_common_id = #{cargoCommonId})
+                OR (o.cargo_owner_status_key = '13' AND o.cargo_common_id = #{cargoCommonId})
             </if>
             <if test="searchType == 4">
                 AND o.cargo_owner_status_key = '15'
-                OR o.cargo_owner_status_key = '17'
-                OR o.cargo_owner_status_key = '19'
-                OR o.cargo_owner_status_key = '21'
+                OR (o.cargo_owner_status_key = '17' AND o.cargo_common_id = #{cargoCommonId})
+                OR (o.cargo_owner_status_key = '19' AND o.cargo_common_id = #{cargoCommonId})
+                OR (o.cargo_owner_status_key = '21' AND o.cargo_common_id = #{cargoCommonId})
             </if>
             <if test="searchType == 5">
                 AND o.cargo_owner_status_key = '23'
@@ -247,7 +247,7 @@
             </if>
             <if test="searchType == 9">
                 AND o.cargo_owner_status_key = '31'
-                OR o.cargo_owner_status_key = '33'
+                OR (o.cargo_owner_status_key = '33' AND o.cargo_common_id = #{cargoCommonId})
             </if>
         </if>
         ORDER BY o.create_date DESC
@@ -324,7 +324,6 @@
         f.freight_balance as freightBalance,
         f.overdue_fee as overdueFee,
         f.interest_rate as interestRate,
---         sum(r.repayment) as alreadyRepaid,
         o.invoicing,
         o.order_status as orderStatus,
         o.order_status_key as orderStatusKey,