haungfuli 3 tahun lalu
induk
melakukan
3e07dce064

+ 6 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/ClothingColorController.java

@@ -1,6 +1,7 @@
 package com.yh.saas.plugin.yiliangyiyun.controller;
 import java.awt.image.BufferedImage;
 import java.io.IOException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -11,6 +12,8 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.imageio.ImageIO;
+
 
 @RestController
 @RequestMapping("/ClothingColorController")
@@ -71,7 +74,9 @@ public class ClothingColorController {
 
         try {
             int[] rgb = new int[3];
-            BufferedImage bi = Thumbnails.of(path).size(100, 100).asBufferedImage();
+//            BufferedImage bi = Thumbnails.of(path).size(100, 100).asBufferedImage();
+            URL url = new URL(path);
+            BufferedImage bi = ImageIO.read(url);
             Map<String, Integer> colorCount = new HashMap<String, Integer>();
             // 统计图中颜色标准的数量分布情况
             for (int w = 0; w < bi.getWidth(); w = w + 2) {

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

@@ -77,7 +77,7 @@ public class DriverCarInfo extends BaseModel<DriverCarInfo> {
      */
     private String addressUrl;
     /**
-     * 认证状态key(1审核中3未通过5已认证
+     * 认证状态key(1审核中3未通过5已通过
      */
     private String statusKey;
     /**

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

@@ -180,9 +180,33 @@ public class DriverInfo extends BaseModel<DriverInfo> {
      */
     private String authenticationStatus;
     /**
-     * 过期标识(1身份证过期2驾驶证过期3行驶证过期4挂车行驶证过期5从业资格证过期6道路运输证过期7挂车运输证过期)
+     * 身份证过期标识(1是)
      */
     private String overdueFlag;
+    /**
+     * 驾驶证过期标识(1是)
+     */
+    private String driverOverdueFlag;
+    /**
+     * 行驶证过期标识(1是)
+     */
+    private String drivingOverdueFlag;
+    /**
+     * 挂车行驶证过期标识(1是)
+     */
+    private String trailerOverdueFlag;
+    /**
+     * 从业资格证过期标识(1是)
+     */
+    private String qualificationOverdueFlag;
+    /**
+     * 道路运输证过期标识(1是)
+     */
+    private String operationOverdueFlag;
+    /**
+     * 挂车运输证过期标识(1是)
+     */
+    private String trailerOperationOverdueFlag;
     /**
      * 第一次认证标识(1是)
      */

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

@@ -47,6 +47,10 @@ public class DriverPayeeInfo extends BaseModel<DriverPayeeInfo> {
      * 银行卡号码
      */
     private String bankCard;
+    /**
+     * 银行卡颜色
+     */
+    private String cardColor;
     /**
      * 开户行
      */
@@ -63,11 +67,7 @@ public class DriverPayeeInfo extends BaseModel<DriverPayeeInfo> {
      * 默认标识(1是)
      */
     private String defaultFlag;
-    /**
-     * 银行卡颜色
-     */
-    @TableField(exist = false)
-    private String cardColor;
+
 
 
     @Override

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

@@ -62,6 +62,16 @@ public class FreightInfo extends BaseModel<FreightInfo> {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date freightBalanceDate;
+    /**
+     * 运费(非垫付订单)
+     */
+    private Float freight;
+    /**
+     * 运费支付时间(非垫付订单)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date freightDate;
     /**
      * 明细
      */

+ 20 - 30
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CargoOwnerInfoServiceImpl.java

@@ -10,11 +10,8 @@ import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.exception.YException;
 import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CargoOwnerInfoMapper;
-import com.yh.saas.plugin.yiliangyiyun.service.IAgentCargoOwnerInfoService;
-import com.yh.saas.plugin.yiliangyiyun.service.ICargoOwnerCompInfoService;
-import com.yh.saas.plugin.yiliangyiyun.service.ICargoOwnerInfoService;
+import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
-import com.yh.saas.plugin.yiliangyiyun.service.ICompanyInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -37,7 +34,8 @@ public class CargoOwnerInfoServiceImpl extends ServiceImpl<CargoOwnerInfoMapper,
 
     @Autowired
     private ICargoOwnerCompInfoService cargoOwnerCompInfoService;
-
+    @Autowired
+    private INewsInfoService newsInfoService;
 
 
     /**
@@ -145,36 +143,28 @@ public class CargoOwnerInfoServiceImpl extends ServiceImpl<CargoOwnerInfoMapper,
                 cargoOwnerInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
                 cargoOwnerInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED.getName());
                 cargoOwnerInfo1.setFirstFlag("1");
-//                geTuiUtils.pushByCid("审核通知", "您的司机认证申请已审核通过", commonUser.getId());
-//                UnimallMessage messageDO = new UnimallMessage();
-//                messageDO.setAdminId(commonUser.getId());
-//                messageDO.setCustomer(commonUser.getUserName());
-//                messageDO.setOperation("审核通知");
-//                messageDO.setResult("您的司机认证申请已审核通过");
-//                messageDO.setGmtUpdate(new java.util.Date());
-//                messageDO.setGmtCreate(new Date());
-//                messageDO.setTaskId(IdGenerator.generateUUID());
-//                messageDO.setCompanyId(AuthSecurityUtils.getCurrentUserInfo().getCompId());
-//                messageDO.setPath("XXXXX");
-//                webSocket.sendOneMessage(messageDO);
+                //发送消息
+                NewsInfo newsInfo = new NewsInfo();
+                newsInfo.setReCommonId(cargoOwnerInfo1.getCommonId());
+                newsInfo.setNewsContent("身份认证已通过!");
+                newsInfo.setBussId(cargoOwnerInfo1.getId());
+                newsInfo.setNewsTypeKey("1");
+                newsInfo.setNewsType("系统消息");
+                newsInfoService.addNewsInfo(newsInfo);
             }
-//            驳回
+            //驳回
             else if("2".equals(cargoOwnerInfo.getFlag())){
                 cargoOwnerInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_FAILED.getFlag());
                 cargoOwnerInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_FAILED.getName());
                 this.updateById(cargoOwnerInfo);
-//                geTuiUtils.pushByCid("驳回通知", "您的司机认证申请已被驳回", commonUser.getId());
-//                UnimallMessage messageDO = new UnimallMessage();
-//                messageDO.setAdminId(commonUser.getId());
-//                messageDO.setCustomer(commonUser.getUserName());
-//                messageDO.setOperation("驳回通知");
-//                messageDO.setResult("您的司机认证申请已被驳回");
-//                messageDO.setGmtUpdate(new java.util.Date());
-//                messageDO.setGmtCreate(new Date());
-//                messageDO.setTaskId(IdGenerator.generateUUID());
-//                messageDO.setCompanyId(AuthSecurityUtils.getCurrentUserInfo().getCompId());
-//                messageDO.setPath("XXXXX");
-//                webSocket.sendOneMessage(messageDO);
+                //发送消息
+                NewsInfo newsInfo = new NewsInfo();
+                newsInfo.setReCommonId(cargoOwnerInfo1.getCommonId());
+                newsInfo.setNewsContent("身份认证已驳回!");
+                newsInfo.setBussId(cargoOwnerInfo1.getId());
+                newsInfo.setNewsTypeKey("1");
+                newsInfo.setNewsType("系统消息");
+                newsInfoService.addNewsInfo(newsInfo);
             }
             // 禁用
             else if("3".equals(cargoOwnerInfo.getFlag())){

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

@@ -137,8 +137,8 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, D
         if (driverCarInfo1 != null) {
             //通过
             if ("1".equals(driverCarInfo.getFlag())) {
-                driverCarInfo1.setStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
-                driverCarInfo1.setStatus(StatusEnum.IDENTITY_COMPLETED.getName());
+                driverCarInfo1.setStatusKey(StatusEnum.TASK_REJECT.getFlag());
+                driverCarInfo1.setStatus(StatusEnum.TASK_REJECT.getName());
 //                geTuiUtils.pushByCid("审核通知", "您的司机认证申请已审核通过", commonUser.getId());
 //                UnimallMessage messageDO = new UnimallMessage();
 //                messageDO.setAdminId(commonUser.getId());

+ 26 - 25
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverInfoServiceImpl.java

@@ -15,6 +15,7 @@ import com.yh.saas.plugin.yiliangyiyun.service.IDriverCarInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IDriverInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.service.IDriverPayeeInfoService;
+import com.yh.saas.plugin.yiliangyiyun.service.INewsInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -40,7 +41,8 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, DriverI
     private IDriverCarInfoService driverCarInfoService;
     @Autowired
     private IDriverPayeeInfoService driverPayeeInfoService;
-
+    @Autowired
+    private INewsInfoService newsInfoService;
 
 
 
@@ -214,36 +216,35 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, DriverI
             if ("1".equals(driverInfo.getFlag())) {
                 driverInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
                 driverInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED.getName());
-//                geTuiUtils.pushByCid("审核通知", "您的司机认证申请已审核通过", commonUser.getId());
-//                UnimallMessage messageDO = new UnimallMessage();
-//                messageDO.setAdminId(commonUser.getId());
-//                messageDO.setCustomer(commonUser.getUserName());
-//                messageDO.setOperation("审核通知");
-//                messageDO.setResult("您的司机认证申请已审核通过");
-//                messageDO.setGmtUpdate(new java.util.Date());
-//                messageDO.setGmtCreate(new Date());
-//                messageDO.setTaskId(IdGenerator.generateUUID());
-//                messageDO.setCompanyId(AuthSecurityUtils.getCurrentUserInfo().getCompId());
-//                messageDO.setPath("XXXXX");
-//                webSocket.sendOneMessage(messageDO);
+                driverInfo1.setOverdueFlag("0");
+                driverInfo1.setDriverOverdueFlag("0");
+                driverInfo1.setDrivingOverdueFlag("0");
+                driverInfo1.setTrailerOverdueFlag("0");
+                driverInfo1.setQualificationOverdueFlag("0");
+                driverInfo1.setOperationOverdueFlag("0");
+                driverInfo1.setTrailerOperationOverdueFlag("0");
+                //发送消息
+                NewsInfo newsInfo = new NewsInfo();
+                newsInfo.setReCommonId(driverInfo1.getCommonId());
+                newsInfo.setNewsContent("身份认证已通过!");
+                newsInfo.setBussId(driverInfo1.getId());
+                newsInfo.setNewsTypeKey("1");
+                newsInfo.setNewsType("系统消息");
+                newsInfoService.addNewsInfo(newsInfo);
             }
 //            驳回
             else if("2".equals(driverInfo.getFlag())){
                 driverInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_FAILED.getFlag());
                 driverInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_FAILED.getName());
                 this.updateById(driverInfo);
-//                geTuiUtils.pushByCid("驳回通知", "您的司机认证申请已被驳回", commonUser.getId());
-//                UnimallMessage messageDO = new UnimallMessage();
-//                messageDO.setAdminId(commonUser.getId());
-//                messageDO.setCustomer(commonUser.getUserName());
-//                messageDO.setOperation("驳回通知");
-//                messageDO.setResult("您的司机认证申请已被驳回");
-//                messageDO.setGmtUpdate(new java.util.Date());
-//                messageDO.setGmtCreate(new Date());
-//                messageDO.setTaskId(IdGenerator.generateUUID());
-//                messageDO.setCompanyId(AuthSecurityUtils.getCurrentUserInfo().getCompId());
-//                messageDO.setPath("XXXXX");
-//                webSocket.sendOneMessage(messageDO);
+                //发送消息
+                NewsInfo newsInfo = new NewsInfo();
+                newsInfo.setReCommonId(driverInfo1.getCommonId());
+                newsInfo.setNewsContent("身份认证已驳回!");
+                newsInfo.setBussId(driverInfo1.getId());
+                newsInfo.setNewsTypeKey("1");
+                newsInfo.setNewsType("系统消息");
+                newsInfoService.addNewsInfo(newsInfo);
             }
             // 禁用
             else if("3".equals(driverInfo.getFlag())){

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

@@ -76,7 +76,18 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
         //获取当前年月日
         SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
         String date = f.format(new Date(System.currentTimeMillis()));
+        //获取当前日期
         Date date1 = new Date();
+        //获取当前日期的前三天
+        Calendar calendar1 = Calendar.getInstance();
+        calendar1.add(Calendar.DATE, -3);
+        Date date3 = calendar1.getTime();
+        String sdate3 = f.format(calendar1.getTime());
+        //获取当前日期的前十天
+        Calendar calendar2 = Calendar.getInstance();
+        calendar1.add(Calendar.DATE, -10);
+        Date date10 = calendar2.getTime();
+        String sdate10 = f.format(calendar2.getTime());
 
         //查询任务
         List<PublishTaskInfo> publishTaskInfos = this.selectList(new EntityWrapper<PublishTaskInfo>().eq("delete_flag", "0"));
@@ -87,7 +98,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                 if (!task) {
                     //任务有效期与日期比较
                     int result = publishTaskInfo.getTaskValidity().compareTo(date);
-                    if(result < 0){
+                    if (result < 0) {
                         publishTaskInfo.setStatus(StatusEnum.TASK_ADOPT.getName());
                         publishTaskInfo.setStatusKey(StatusEnum.TASK_ADOPT.getFlag());
                     }
@@ -101,25 +112,49 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
         if (!CollectionUtils.isEmpty(cargoOwnerInfos)) {
             cargoOwnerInfos.forEach(cargoOwnerInfo -> {
                 cargoOwnerInfo.setRefreshTimes(0L);
-                if(!"长期".equals(cargoOwnerInfo.getCardValidityDate())){
+                if (!"长期".equals(cargoOwnerInfo.getCardValidityDate())) {
                     int result = cargoOwnerInfo.getCardValidityDate().compareTo(date);
-                    if(result < 0){
+                    if (result < 0) {
                         cargoOwnerInfo.setAuthenticationStatus(StatusEnum.IDENTITY_OVERDUE.getName());
                         cargoOwnerInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_OVERDUE.getFlag());
                     }
+                    //身份证到期前10天
+                    int result10 = cargoOwnerInfo.getCardValidityDate().compareTo(sdate10);
+                    if (result10 == 0) {
+                        //发送系统消息
+                        NewsInfo newsInfo = new NewsInfo();
+                        newsInfo.setReCommonId(cargoOwnerInfo.getCommonId());
+                        newsInfo.setBussId(cargoOwnerInfo.getId());
+                        newsInfo.setNewsContent("您的身份证即将到期,请尽快到个人中心中更新,逾期将影响运费垫付。");
+                        newsInfo.setNewsTypeKey("1");
+                        newsInfo.setNewsType("系统消息");
+                        newsInfoService.addNewsInfo(newsInfo);
+                    }
+                    //身份证到期前3天
+                    int result3 = cargoOwnerInfo.getCardValidityDate().compareTo(sdate3);
+                    if (result3 == 0) {
+                        //发送系统消息
+                        NewsInfo newsInfo = new NewsInfo();
+                        newsInfo.setReCommonId(cargoOwnerInfo.getCommonId());
+                        newsInfo.setBussId(cargoOwnerInfo.getId());
+                        newsInfo.setNewsContent("您的身份证即将到期,请尽快到个人中心中更新,逾期将影响运费垫付。");
+                        newsInfo.setNewsTypeKey("1");
+                        newsInfo.setNewsType("系统消息");
+                        newsInfoService.addNewsInfo(newsInfo);
+                    }
                 }
                 cargoOwnerInfoService.updateById(cargoOwnerInfo);
             });
         }
 
         //查询企业
-        List<CompanyInfo> companyInfos = companyInfoService.selectList(new EntityWrapper<CompanyInfo>().eq("delete_flag","0")
-                .ne("business_term_date","长期"));
-        if(!CollectionUtils.isEmpty(companyInfos)){
+        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){
+                if (result < 0) {
                     companyInfo.setStatus(StatusEnum.TASK_ADOPT.getName());
                     companyInfo.setStatusKey(StatusEnum.TASK_ADOPT.getFlag());
                     companyInfoService.updateById(companyInfo);
@@ -128,61 +163,252 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
         }
 
         //查询授权审核
-        List<CargoOwnerCompInfo> cargoOwnerCompInfos = cargoOwnerCompInfoService.selectList(new EntityWrapper<CargoOwnerCompInfo>().eq("delete_flag","0")
-                .ne("authorization_deadline","长期"));
-        if(!CollectionUtils.isEmpty(cargoOwnerCompInfos)){
+        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){
+                if (result < 0) {
                     cargoOwnerCompInfo.setStatus(StatusEnum.CAUTHORIZATION_OVERDUE.getName());
                     cargoOwnerCompInfo.setStatusKey(StatusEnum.CAUTHORIZATION_OVERDUE.getFlag());
                     cargoOwnerCompInfoService.updateById(cargoOwnerCompInfo);
                 }
+                //授权书到期前10天
+                int result10 = cargoOwnerCompInfo.getAuthorizationDeadline().compareTo(sdate10);
+                if (result10 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(cargoOwnerCompInfo.getCommonId());
+                    newsInfo.setBussId(cargoOwnerCompInfo.getId());
+                    newsInfo.setNewsContent("您的"+ cargoOwnerCompInfo.getCompany() + "的授权书即将到期,请尽快到个人中心中更新,逾期将影响运费垫付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
+                }
+                //授权书到期前3天
+                int result3 = cargoOwnerCompInfo.getAuthorizationDeadline().compareTo(sdate3);
+                if (result3 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(cargoOwnerCompInfo.getCommonId());
+                    newsInfo.setBussId(cargoOwnerCompInfo.getId());
+                    newsInfo.setNewsContent("您的"+ cargoOwnerCompInfo.getCompany() + "的授权书即将到期,请尽快到个人中心中更新,逾期将影响运费垫付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
+                }
             });
         }
 
         //查询司机
-        List<DriverInfo> driverInfos = driverInfoService.selectList(new EntityWrapper<DriverInfo>().eq("delete_flag","0"));
-        if(!CollectionUtils.isEmpty(driverInfos)){
+        List<DriverInfo> driverInfos = driverInfoService.selectList(new EntityWrapper<DriverInfo>().eq("delete_flag", "0"));
+        if (!CollectionUtils.isEmpty(driverInfos)) {
             driverInfos.forEach(driverInfo -> {
                 //身份证
-                if(!"长期".equals(driverInfo.getCardValidityDate())){
+                if (!"长期".equals(driverInfo.getCardValidityDate())) {
                     //身份证截止日期与日期比较
                     int result1 = driverInfo.getCardValidityDate().compareTo(date);
-                    if(result1 < 0){
+                    if (result1 < 0) {
                         driverInfo.setOverdueFlag("1");
                     }
+                    //身份证到期前10天
+                    int result110 = driverInfo.getCardValidityDate().compareTo(sdate10);
+                    if (result110 == 0) {
+                        //发送系统消息
+                        NewsInfo newsInfo = new NewsInfo();
+                        newsInfo.setReCommonId(driverInfo.getCommonId());
+                        newsInfo.setBussId(driverInfo.getId());
+                        newsInfo.setNewsContent("您的身份证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                        newsInfo.setNewsTypeKey("1");
+                        newsInfo.setNewsType("系统消息");
+                        newsInfoService.addNewsInfo(newsInfo);
+                    }
+                    //身份证到期前3天
+                    int result13 = driverInfo.getCardValidityDate().compareTo(sdate3);
+                    if (result13 == 0) {
+                        //发送系统消息
+                        NewsInfo newsInfo = new NewsInfo();
+                        newsInfo.setReCommonId(driverInfo.getCommonId());
+                        newsInfo.setBussId(driverInfo.getId());
+                        newsInfo.setNewsContent("您的身份证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                        newsInfo.setNewsTypeKey("1");
+                        newsInfo.setNewsType("系统消息");
+                        newsInfoService.addNewsInfo(newsInfo);
+                    }
                 }
                 //驾驶证
                 int result2 = driverInfo.getDriverLicenseValidityDate().compareTo(date1);
-                if(result2 < 0){
-                    driverInfo.setOverdueFlag("2");
+                if (result2 < 0) {
+                    driverInfo.setDriverOverdueFlag("1");
+                }//驾驶证到期前10天
+                int result210 = driverInfo.getDriverLicenseValidityDate().compareTo(date10);
+                if (result210 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的驾驶证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
+                }
+                //驾驶证到期前3天
+                int result23 = driverInfo.getDriverLicenseValidityDate().compareTo(date3);
+                if (result23 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的驾驶证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
                 }
                 //行驶证
                 int result3 = driverInfo.getDrivingLicenseValidityDate().compareTo(date1);
-                if(result3 < 0){
-                    driverInfo.setOverdueFlag("3");
+                if (result3 < 0) {
+                    driverInfo.setDrivingOverdueFlag("1");
+                }
+                //行驶证到期前10天
+                int result310 = driverInfo.getDrivingLicenseValidityDate().compareTo(date10);
+                if (result310 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的行驶证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
+                }
+                //行驶证到期前3天
+                int result33 = driverInfo.getDrivingLicenseValidityDate().compareTo(date3);
+                if (result33 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的行驶证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
                 }
                 //挂车行驶证
                 int result4 = driverInfo.getTrailerLicenseValidityDate().compareTo(date1);
-                if(result4 < 0){
-                    driverInfo.setOverdueFlag("4");
+                if (result4 < 0) {
+                    driverInfo.setTrailerOverdueFlag("1");
+                }
+                //挂车行驶证到期前10天
+                int result410 = driverInfo.getTrailerLicenseValidityDate().compareTo(date10);
+                if (result410 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的挂车行驶证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
+                }
+                //挂车行驶证到期前3天
+                int result43 = driverInfo.getTrailerLicenseValidityDate().compareTo(date3);
+                if (result43 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的挂车行驶证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
                 }
                 //从业资格证
                 int result5 = driverInfo.getQualificationCertificateValidityDate().compareTo(date1);
-                if(result5 < 0){
-                    driverInfo.setOverdueFlag("5");
+                if (result5 < 0) {
+                    driverInfo.setQualificationOverdueFlag("1");
+                }
+                //从业资格证到期前10天
+                int result510 = driverInfo.getQualificationCertificateValidityDate().compareTo(date10);
+                if (result510 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的从业资格证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
+                }
+                //从业资格证到期前3天
+                int result53 = driverInfo.getQualificationCertificateValidityDate().compareTo(date3);
+                if (result53 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的从业资格证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
                 }
                 //道路运输证
                 int result6 = driverInfo.getOperationCertificateValidityDate().compareTo(date1);
-                if(result6 < 0){
-                    driverInfo.setOverdueFlag("6");
+                if (result6 < 0) {
+                    driverInfo.setOperationOverdueFlag("1");
+                }
+                //道路运输证到期前10天
+                int result610 = driverInfo.getOperationCertificateValidityDate().compareTo(date10);
+                if (result610 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的道路运输证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
+                }
+                //道路运输证到期前3天
+                int result63 = driverInfo.getOperationCertificateValidityDate().compareTo(date3);
+                if (result63 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的道路运输证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
                 }
                 //挂车运输证
                 int result7 = driverInfo.getTrailerOperationCertificateValidityDate().compareTo(date1);
-                if(result7 < 0){
-                    driverInfo.setOverdueFlag("7");
+                if (result7 < 0) {
+                    driverInfo.setTrailerOperationOverdueFlag("1");
+                }
+                //挂车运输证到期前10天
+                int result710 = driverInfo.getTrailerOperationCertificateValidityDate().compareTo(date10);
+                if (result710 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的挂车运输证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
+                }
+                //挂车运输证到期前3天
+                int result73 = driverInfo.getTrailerOperationCertificateValidityDate().compareTo(date3);
+                if (result73 == 0) {
+                    //发送系统消息
+                    NewsInfo newsInfo = new NewsInfo();
+                    newsInfo.setReCommonId(driverInfo.getCommonId());
+                    newsInfo.setBussId(driverInfo.getId());
+                    newsInfo.setNewsContent("您的挂车运输证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。");
+                    newsInfo.setNewsTypeKey("1");
+                    newsInfo.setNewsType("系统消息");
+                    newsInfoService.addNewsInfo(newsInfo);
                 }
                 driverInfo.setAuthenticationStatus(StatusEnum.IDENTITY_OVERDUE.getName());
                 driverInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_OVERDUE.getFlag());
@@ -275,31 +501,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     double lat2 = Math.toRadians(Double.valueOf(publishTaskInfo1.getSendLatitude()));
                     double lng2 = Math.toRadians(Double.valueOf(publishTaskInfo1.getSendLongitude()));
                     //根据司机经纬度求货距
-                    if(!StringUtils.isEmpty(publishTaskInfo.getDriverLatitude()) && !StringUtils.isEmpty(publishTaskInfo.getDriverLongitude())){
+                    if (!StringUtils.isEmpty(publishTaskInfo.getDriverLatitude()) && !StringUtils.isEmpty(publishTaskInfo.getDriverLongitude())) {
                         double lat1 = Math.toRadians(Double.valueOf(publishTaskInfo.getDriverLatitude()));
                         double lng1 = Math.toRadians(Double.valueOf(publishTaskInfo.getDriverLongitude()));
-                    // 纬度之差
-                    double a = lat1 - lat2;
-                    // 经度之差
-                    double b = lng1 - lng2;
-                    // 计算两点距离的公式
-                    double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
-                            Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
-
-                    // 弧长乘地球半径, 返回单位: 千米
-                    s = s * EARTH_RADIUS;
-                    publishTaskInfo1.setCargoDistance(Math.floor(s));
-                    }
-                    //根据装货城市求货距
-                    else if (!StringUtils.isEmpty(publishTaskInfo.getLoadingPlaceCity())) {
-                        //根据装货城市获取经纬度
-                        String str = EntCoordUtil.getCoordinate(publishTaskInfo.getLoadingPlaceCity());
-                        String str1 = str.substring(0, str.indexOf(","));//经度
-                        String str2 = str.substring(str1.length() + 1, str.length());//纬度
-
-                        //装货地经纬度
-                        double lng1 = Math.toRadians(Double.valueOf(str1));
-                        double lat1 = Math.toRadians(Double.valueOf(str2));
                         // 纬度之差
                         double a = lat1 - lat2;
                         // 经度之差
@@ -307,17 +511,15 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         // 计算两点距离的公式
                         double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
                                 Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
+
                         // 弧长乘地球半径, 返回单位: 千米
                         s = s * EARTH_RADIUS;
                         publishTaskInfo1.setCargoDistance(Math.floor(s));
                     }
-                    //根据省会城市求货距
-                    else {
-                        //根据省名查询省会城市
-                        ProvinceCityInfo provinceCityInfo = provinceCityInfoService.selectOne(new EntityWrapper<ProvinceCityInfo>()
-                                .like("province", publishTaskInfo.getLoadingPlace()));
-                        //根据省会城市获取经纬度
-                        String str = EntCoordUtil.getCoordinate(provinceCityInfo.getCity());
+                    //根据装货城市求货距
+                    else if (!StringUtils.isEmpty(publishTaskInfo.getLoadingPlaceCity())) {
+                        //根据装货城市获取经纬度
+                        String str = EntCoordUtil.getCoordinate(publishTaskInfo.getLoadingPlaceCity());
                         String str1 = str.substring(0, str.indexOf(","));//经度
                         String str2 = str.substring(str1.length() + 1, str.length());//纬度
 
@@ -335,6 +537,30 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         s = s * EARTH_RADIUS;
                         publishTaskInfo1.setCargoDistance(Math.floor(s));
                     }
+                    //根据省会城市求货距
+//                    else {
+//                        //根据省名查询省会城市
+//                        ProvinceCityInfo provinceCityInfo = provinceCityInfoService.selectOne(new EntityWrapper<ProvinceCityInfo>()
+//                                .like("province", publishTaskInfo.getLoadingPlace()));
+//                        //根据省会城市获取经纬度
+//                        String str = EntCoordUtil.getCoordinate(provinceCityInfo.getCity());
+//                        String str1 = str.substring(0, str.indexOf(","));//经度
+//                        String str2 = str.substring(str1.length() + 1, str.length());//纬度
+//
+//                        //装货地经纬度
+//                        double lng1 = Math.toRadians(Double.valueOf(str1));
+//                        double lat1 = Math.toRadians(Double.valueOf(str2));
+//                        // 纬度之差
+//                        double a = lat1 - lat2;
+//                        // 经度之差
+//                        double b = lng1 - lng2;
+//                        // 计算两点距离的公式
+//                        double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
+//                                Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
+//                        // 弧长乘地球半径, 返回单位: 千米
+//                        s = s * EARTH_RADIUS;
+//                        publishTaskInfo1.setCargoDistance(Math.floor(s));
+//                    }
                 }
             }
             publishTaskInfoList.addAll(dataList);
@@ -350,7 +576,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     double lat2 = Math.toRadians(Double.valueOf(publishTaskInfo1.getSendLatitude()));
                     double lng2 = Math.toRadians(Double.valueOf(publishTaskInfo1.getSendLongitude()));
                     //根据司机经纬度求货距
-                    if(!StringUtils.isEmpty(publishTaskInfo.getDriverLatitude()) && !StringUtils.isEmpty(publishTaskInfo.getDriverLongitude())){
+                    if (!StringUtils.isEmpty(publishTaskInfo.getDriverLatitude()) && !StringUtils.isEmpty(publishTaskInfo.getDriverLongitude())) {
                         double lat1 = Math.toRadians(Double.valueOf(publishTaskInfo.getDriverLatitude()));
                         double lng1 = Math.toRadians(Double.valueOf(publishTaskInfo.getDriverLongitude()));
                         // 纬度之差
@@ -387,29 +613,29 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         publishTaskInfo1.setCargoDistance(Math.floor(s));
                     }
                     //根据省会城市求货距
-                    else {
-                        //根据省名查询省会城市
-                        ProvinceCityInfo provinceCityInfo = provinceCityInfoService.selectOne(new EntityWrapper<ProvinceCityInfo>()
-                                .like("province", publishTaskInfo.getLoadingPlace()));
-                        //根据省会城市获取经纬度
-                        String str = EntCoordUtil.getCoordinate(provinceCityInfo.getCity());
-                        String str1 = str.substring(0, str.indexOf(","));//经度
-                        String str2 = str.substring(str1.length() + 1, str.length());//纬度
-
-                        //装货地经纬度
-                        double lng1 = Math.toRadians(Double.valueOf(str1));
-                        double lat1 = Math.toRadians(Double.valueOf(str2));
-                        // 纬度之差
-                        double a = lat1 - lat2;
-                        // 经度之差
-                        double b = lng1 - lng2;
-                        // 计算两点距离的公式
-                        double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
-                                Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
-                        // 弧长乘地球半径, 返回单位: 千米
-                        s = s * EARTH_RADIUS;
-                        publishTaskInfo1.setCargoDistance(Math.floor(s));
-                    }
+//                    else {
+//                        //根据省名查询省会城市
+//                        ProvinceCityInfo provinceCityInfo = provinceCityInfoService.selectOne(new EntityWrapper<ProvinceCityInfo>()
+//                                .like("province", publishTaskInfo.getLoadingPlace()));
+//                        //根据省会城市获取经纬度
+//                        String str = EntCoordUtil.getCoordinate(provinceCityInfo.getCity());
+//                        String str1 = str.substring(0, str.indexOf(","));//经度
+//                        String str2 = str.substring(str1.length() + 1, str.length());//纬度
+//
+//                        //装货地经纬度
+//                        double lng1 = Math.toRadians(Double.valueOf(str1));
+//                        double lat1 = Math.toRadians(Double.valueOf(str2));
+//                        // 纬度之差
+//                        double a = lat1 - lat2;
+//                        // 经度之差
+//                        double b = lng1 - lng2;
+//                        // 计算两点距离的公式
+//                        double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
+//                                Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
+//                        // 弧长乘地球半径, 返回单位: 千米
+//                        s = s * EARTH_RADIUS;
+//                        publishTaskInfo1.setCargoDistance(Math.floor(s));
+//                    }
                 }
             }
             publishTaskInfoList.addAll(dataList);
@@ -426,7 +652,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         double lat2 = Math.toRadians(Double.valueOf(publishTaskInfo1.getSendLatitude()));
                         double lng2 = Math.toRadians(Double.valueOf(publishTaskInfo1.getSendLongitude()));
                         //根据司机经纬度求货距
-                        if(!StringUtils.isEmpty(publishTaskInfo.getDriverLatitude()) && !StringUtils.isEmpty(publishTaskInfo.getDriverLongitude())){
+                        if (!StringUtils.isEmpty(publishTaskInfo.getDriverLatitude()) && !StringUtils.isEmpty(publishTaskInfo.getDriverLongitude())) {
                             double lat1 = Math.toRadians(Double.valueOf(publishTaskInfo.getDriverLatitude()));
                             double lng1 = Math.toRadians(Double.valueOf(publishTaskInfo.getDriverLongitude()));
                             // 纬度之差
@@ -463,29 +689,29 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                             publishTaskInfo1.setCargoDistance(Math.floor(s));
                         }
                         //根据省会城市求货距
-                        else {
-                            //根据省名查询省会城市
-                            ProvinceCityInfo provinceCityInfo = provinceCityInfoService.selectOne(new EntityWrapper<ProvinceCityInfo>()
-                                    .like("province", publishTaskInfo.getLoadingPlace()));
-                            //根据省会城市获取经纬度
-                            String str = EntCoordUtil.getCoordinate(provinceCityInfo.getCity());
-                            String str1 = str.substring(0, str.indexOf(","));//经度
-                            String str2 = str.substring(str1.length() + 1, str.length());//纬度
-
-                            //装货地经纬度
-                            double lng1 = Math.toRadians(Double.valueOf(str1));
-                            double lat1 = Math.toRadians(Double.valueOf(str2));
-                            // 纬度之差
-                            double a = lat1 - lat2;
-                            // 经度之差
-                            double b = lng1 - lng2;
-                            // 计算两点距离的公式
-                            double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
-                                    Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
-                            // 弧长乘地球半径, 返回单位: 千米
-                            s = s * EARTH_RADIUS;
-                            publishTaskInfo1.setCargoDistance(Math.floor(s));
-                        }
+//                        else {
+//                            //根据省名查询省会城市
+//                            ProvinceCityInfo provinceCityInfo = provinceCityInfoService.selectOne(new EntityWrapper<ProvinceCityInfo>()
+//                                    .like("province", publishTaskInfo.getLoadingPlace()));
+//                            //根据省会城市获取经纬度
+//                            String str = EntCoordUtil.getCoordinate(provinceCityInfo.getCity());
+//                            String str1 = str.substring(0, str.indexOf(","));//经度
+//                            String str2 = str.substring(str1.length() + 1, str.length());//纬度
+//
+//                            //装货地经纬度
+//                            double lng1 = Math.toRadians(Double.valueOf(str1));
+//                            double lat1 = Math.toRadians(Double.valueOf(str2));
+//                            // 纬度之差
+//                            double a = lat1 - lat2;
+//                            // 经度之差
+//                            double b = lng1 - lng2;
+//                            // 计算两点距离的公式
+//                            double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
+//                                    Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
+//                            // 弧长乘地球半径, 返回单位: 千米
+//                            s = s * EARTH_RADIUS;
+//                            publishTaskInfo1.setCargoDistance(Math.floor(s));
+//                        }
                     }
                     dataList.sort(Comparator.comparing(PublishTaskInfo::getCargoDistance));
                 }
@@ -507,40 +733,6 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     String str1 = str.substring(0, str.indexOf(","));//经度
                     String str2 = str.substring(str1.length() + 1, str.length());//纬度
 
-                    //装货地经纬度
-                    double lng1 = Math.toRadians(Double.valueOf(str1));
-                    double lat1 = Math.toRadians(Double.valueOf(str2));
-                    // 纬度之差
-                    double a = lat1 - lat2;
-                    // 经度之差
-                    double b = lng1 - lng2;
-                    // 计算两点距离的公式
-                    double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
-                            Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
-                    // 弧长乘地球半径, 返回单位: 千米
-                    s = s * EARTH_RADIUS;
-                    if (s <= 300) {
-                        //货距小于300公里,放入周边信息列表
-                        publishTaskInfo1.setCargoDistance(Math.floor(s));
-                        publishTaskInfo1.setPeripheralInfo("1");
-                        publishTaskInfoList.add(publishTaskInfo1);
-                    }
-                }
-            } else {
-                //查询发货地经纬度
-                for (int i = 0; i < dataList1.size(); i++) {
-                    PublishTaskInfo publishTaskInfo1 = dataList1.get(i);
-                    //发货地经纬度
-                    double lng2 = Math.toRadians(Double.valueOf(publishTaskInfo1.getSendLongitude()));
-                    double lat2 = Math.toRadians(Double.valueOf(publishTaskInfo1.getSendLatitude()));
-                    //根据省名查询省会城市
-                    ProvinceCityInfo provinceCityInfo = provinceCityInfoService.selectOne(new EntityWrapper<ProvinceCityInfo>()
-                            .like("province", publishTaskInfo.getLoadingPlace()));
-                    //根据省会城市获取经纬度
-                    String str = EntCoordUtil.getCoordinate(provinceCityInfo.getCity());
-                    String str1 = str.substring(0, str.indexOf(","));//经度
-                    String str2 = str.substring(str1.length() + 1, str.length());//纬度
-
                     //装货地经纬度
                     double lng1 = Math.toRadians(Double.valueOf(str1));
                     double lat1 = Math.toRadians(Double.valueOf(str2));
@@ -561,6 +753,41 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     }
                 }
             }
+//            else {
+//                //查询发货地经纬度
+//                for (int i = 0; i < dataList1.size(); i++) {
+//                    PublishTaskInfo publishTaskInfo1 = dataList1.get(i);
+//                    //发货地经纬度
+//                    double lng2 = Math.toRadians(Double.valueOf(publishTaskInfo1.getSendLongitude()));
+//                    double lat2 = Math.toRadians(Double.valueOf(publishTaskInfo1.getSendLatitude()));
+//                    //根据省名查询省会城市
+//                    ProvinceCityInfo provinceCityInfo = provinceCityInfoService.selectOne(new EntityWrapper<ProvinceCityInfo>()
+//                            .like("province", publishTaskInfo.getLoadingPlace()));
+//                    //根据省会城市获取经纬度
+//                    String str = EntCoordUtil.getCoordinate(provinceCityInfo.getCity());
+//                    String str1 = str.substring(0, str.indexOf(","));//经度
+//                    String str2 = str.substring(str1.length() + 1, str.length());//纬度
+//
+//                    //装货地经纬度
+//                    double lng1 = Math.toRadians(Double.valueOf(str1));
+//                    double lat1 = Math.toRadians(Double.valueOf(str2));
+//                    // 纬度之差
+//                    double a = lat1 - lat2;
+//                    // 经度之差
+//                    double b = lng1 - lng2;
+//                    // 计算两点距离的公式
+//                    double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
+//                            Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
+//                    // 弧长乘地球半径, 返回单位: 千米
+//                    s = s * EARTH_RADIUS;
+//                    if (s <= 300) {
+//                        //货距小于300公里,放入周边信息列表
+//                        publishTaskInfo1.setCargoDistance(Math.floor(s));
+//                        publishTaskInfo1.setPeripheralInfo("1");
+//                        publishTaskInfoList.add(publishTaskInfo1);
+//                    }
+//                }
+//            }
         }
         Page<PublishTaskInfo> page = new Page<>();
         page.setRecords(publishTaskInfoList == null ? Lists.newArrayList() : publishTaskInfoList);
@@ -845,23 +1072,23 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
         orderInfo.setId(IdGenerator.generateUUID());
         orderInfo.setCommonId(publishTaskInfo.getDriverCommonId());
         //判断司机是否认证
-        DriverInfo driverInfo = driverInfoService.selectOne(new EntityWrapper<DriverInfo>().eq("common_id",publishTaskInfo.getDriverCommonId())
-            .eq("delete_flag","0"));
-        if(driverInfo == null){
+        DriverInfo driverInfo = driverInfoService.selectOne(new EntityWrapper<DriverInfo>().eq("common_id", publishTaskInfo.getDriverCommonId())
+                .eq("delete_flag", "0"));
+        if (driverInfo == null) {
             throw new YException(YExceptionEnum.DRIVER_IDENTITY_AUTHENTICATION);
         }
         //司机证件过期
-        if(StringUtils.isEmpty(driverInfo.getOverdueFlag())){
+        if (StringUtils.isEmpty(driverInfo.getOverdueFlag())) {
             throw new YException(YExceptionEnum.CERTIFICATE_EXPIRED);
         }
         orderInfo.setCargoCommonId(publishTaskInfo.getCommonId());
         //查询货主身份是否删除
-        CargoOwnerInfo cargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<CargoOwnerInfo>().eq("delete_flag","0"));
-        if(cargoOwnerInfo == null){
+        CargoOwnerInfo cargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<CargoOwnerInfo>().eq("delete_flag", "0"));
+        if (cargoOwnerInfo == null) {
             throw new YException(YExceptionEnum.TASK_CANCELLED);
         }
         //查询货主身份授权是否到期
-        CargoOwnerCompInfo cargoOwnerCompInfo = cargoOwnerCompInfoService.selectOne(new EntityWrapper<CargoOwnerCompInfo>().eq("delete_flag","0"));
+        CargoOwnerCompInfo cargoOwnerCompInfo = cargoOwnerCompInfoService.selectOne(new EntityWrapper<CargoOwnerCompInfo>().eq("delete_flag", "0"));
         boolean cancelled = "11".equals(cargoOwnerCompInfo.getStatusKey()) || "17".equals(cargoOwnerCompInfo.getStatusKey());
         if (cancelled) {
             throw new YException(YExceptionEnum.TASK_CANCELLED);
@@ -915,8 +1142,8 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
         orderInfo.setCargoOwnerStatusKey(StatusEnum.OWNER_PENDING_STATEMENT.getFlag());
         orderInfo.setCargoOwnerStatus(StatusEnum.OWNER_PENDING_STATEMENT.getName());
         //判断是否已抢过单
-        OrderInfo orderInfo1 = orderInfoService.selectOne(new EntityWrapper<OrderInfo>().eq("common_id",publishTaskInfo.getDriverCommonId())
-        .eq("cargo_common_id",publishTaskInfo.getCommonId()).eq("delete_flag","0"));
+        OrderInfo orderInfo1 = orderInfoService.selectOne(new EntityWrapper<OrderInfo>().eq("common_id", publishTaskInfo.getDriverCommonId())
+                .eq("cargo_common_id", publishTaskInfo.getCommonId()).eq("delete_flag", "0"));
         boolean order = "1".equals(orderInfo1.getCargoOwnerStatusKey());
         if (order) {
             throw new YException(YExceptionEnum.ORDER_SNATCHED);

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

@@ -61,6 +61,13 @@
         d.authentication_status as authenticationStatus,
         d.create_date as createDate,
         d.update_date as updateDate,
+        d.overdue_flag as overdueFlag,
+        d.driver_overdue_flag as driverOverdueFlag,
+        d.driving_overdue_flag as drivingOverdueFlag,
+        d.trailer_overdue_flag as trailerOverdueFlag,
+        d.qualification_overdue_flag as qualificationOverdueFlag,
+        d.operation_overdue_flag as operationOverdueFlag,
+        d.trailer_operation_overdue_flag as trailerOperationOverdueFlag,
         c.avatar_url as avatarUrl
         FROM driver_info d
         LEFT JOIN common_user c on c.id = d.common_id and c.delete_flag = 0

+ 12 - 24
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/PublishTaskInfoMapper.xml

@@ -137,12 +137,10 @@
             AND (lower(p.unload_city) like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
         </if>
         <if test="loadingPlace != null and loadingPlace != ''">
-            AND (lower(p.send_private) like lower(CONCAT('%',#{loadingPlace},'%'))
-            OR lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
+            AND (lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
         </if>
         <if test="unLoadingPlace != null and unLoadingPlace != ''">
-            AND (lower(p.unload_private) like lower(CONCAT('%',#{unLoadingPlace},'%'))
-            OR lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
+            AND (lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
         </if>
         <if test="loadingList != null and loadingList.size > 0">
             and(
@@ -218,12 +216,10 @@
             AND (lower(p.unload_city) like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
         </if>
         <if test="loadingPlace != null and loadingPlace != ''">
-            AND (lower(p.send_private) like lower(CONCAT('%',#{loadingPlace},'%'))
-            OR lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
+            AND (lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
         </if>
         <if test="unLoadingPlace != null and unLoadingPlace != ''">
-            AND (lower(p.unload_private) like lower(CONCAT('%',#{unLoadingPlace},'%'))
-            OR lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
+            AND (lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
         </if>
         <if test="loadingList != null and loadingList.size > 0">
             and(
@@ -291,12 +287,10 @@
             AND (lower(p.unload_city) like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
         </if>
         <if test="loadingPlace != null and loadingPlace != ''">
-            AND (lower(p.send_private) like lower(CONCAT('%',#{loadingPlace},'%'))
-            OR lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
+            AND (lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
         </if>
         <if test="unLoadingPlace != null and unLoadingPlace != ''">
-            AND (lower(p.unload_private) like lower(CONCAT('%',#{unLoadingPlace},'%'))
-            OR lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
+            AND (lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
         </if>
         <if test="loadingList != null and loadingList.size > 0">
             and(
@@ -375,12 +369,10 @@
             AND (lower(p.unload_city) like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
         </if>
         <if test="loadingPlace != null and loadingPlace != ''">
-            AND (lower(p.send_private) like lower(CONCAT('%',#{loadingPlace},'%'))
-            OR lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
+            AND (lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
         </if>
         <if test="unLoadingPlace != null and unLoadingPlace != ''">
-            AND (lower(p.unload_private) like lower(CONCAT('%',#{unLoadingPlace},'%'))
-            OR lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
+            AND (lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
         </if>
         <if test="loadingList != null and loadingList.size > 0">
             and(
@@ -460,12 +452,10 @@
             AND (lower(p.unload_city) like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
         </if>
         <if test="loadingPlace != null and loadingPlace != ''">
-            AND (lower(p.send_private) like lower(CONCAT('%',#{loadingPlace},'%'))
-            OR lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
+            AND (lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
         </if>
         <if test="unLoadingPlace != null and unLoadingPlace != ''">
-            AND (lower(p.unload_private) like lower(CONCAT('%',#{unLoadingPlace},'%'))
-            OR lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
+            AND (lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
         </if>
         <if test="loadingList != null and loadingList.size > 0">
             and(
@@ -533,12 +523,10 @@
             AND (lower(p.unload_city) like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
         </if>
         <if test="loadingPlace != null and loadingPlace != ''">
-            AND (lower(p.send_private) like lower(CONCAT('%',#{loadingPlace},'%'))
-            OR lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
+            AND (lower(p.send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
         </if>
         <if test="unLoadingPlace != null and unLoadingPlace != ''">
-            AND (lower(p.unload_private) like lower(CONCAT('%',#{unLoadingPlace},'%'))
-            OR lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
+            AND (lower(p.unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
         </if>
         <if test="loadingList != null and loadingList.size > 0">
             and(