Ver código fonte

Merge branch 'master' of http://git.zthymaoyi.com/gongdecai/wangluohuoyun

ccj 2 anos atrás
pai
commit
71a5249339

+ 1 - 1
winsea-haixin-platform-backend/src/main/resources/application.yml

@@ -14,7 +14,7 @@ spring:
     serialization:
       write_dates_as_timestamps: false
   profiles:
-    active: prod
+    active: local
   resources:
     static-locations: file:///winsea/static/
   thymeleaf:

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

@@ -201,8 +201,8 @@ public class CommonUserController {
      */
     @Log(title = "发送验证码")
     @GetMapping("/sendVerifyCode")
-    public String sendVerifyCode(String phone) throws ServiceException {
-        return commonUserService.sendVerifyCode(phone);
+    public String sendVerifyCode(String phone,String identification) throws ServiceException {
+        return commonUserService.sendVerifyCode(phone,identification);
     }
 
     /**

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

@@ -114,9 +114,7 @@ public class HyDriverInfo extends BaseModel<HyDriverInfo> {
     /**
      * 驾驶证有效期至(结束时间)
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date driverLicenseValidityDate;
+    private String driverLicenseValidityDate;
     /**
      * 准驾车型
      */

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

@@ -46,6 +46,9 @@ public enum YExceptionEnum {
 	CAR_NOT_EXIST("ERROR23", "车辆不存在,请重新选择"),
 	PAY_ADVANCE_PAYMENT("ERROR24", "请先支付预付款"),
 	TOTAL_BIG_PREPAID("ERROR25", "合计应付运费必须大于预付款"),
+	TERM_OF_VALIDITY("ERROR26", "请重新选择身份证有效期"),
+	DRIVER_TERM_OF_VALIDITY("ERROR27", "请重新选择驾驶证有效期"),
+	CONG_TERM_OF_VALIDITY("ERROR28", "请重新选择从业资格证有效期"),
 	;
 	@Getter
 	private String value;

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

@@ -38,7 +38,7 @@ public interface ICommonUserService extends IService<CommonUser> {
      * @return
      * @throws ServiceException
      */
-    String sendVerifyCode(String phone) throws ServiceException;
+    String sendVerifyCode(String phone,String identification) throws ServiceException;
 
 
     /**

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

@@ -124,10 +124,11 @@ public class CargoOwnerAddressInfoServiceImpl extends ServiceImpl<CargoOwnerAddr
                     }else if("2".equals(hyCargoOwnerAddressInfo.getDefaultFlag())){
                         //取消默认收货
                         hyCargoOwnerAddressInfo1.setDefaultReceipt("0");
-                    }else {
-                        //取消置顶
-                        hyCargoOwnerAddressInfo1.setToppingFlag("0");
                     }
+//                    else {
+//                        //取消置顶
+//                        hyCargoOwnerAddressInfo1.setToppingFlag("0");
+//                    }
                     this.updateById(hyCargoOwnerAddressInfo1);
                 }
             }

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

@@ -401,10 +401,27 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
      * @throws ServiceException
      */
     @Override
-    public String sendVerifyCode(String phone) throws ServiceException {
+    public String sendVerifyCode(String phone, String identification) throws ServiceException {
         if (StringUtils.isEmpty(phone)) {
             throw new AppServiceException(ExceptionDefinition.USER_PHONE_HAS_ENTRY);
         }
+        //pc端
+        if ("3".equals(identification)) {
+            //2.校验pc用户是否存在
+            List<CommonStaff> commonStaffList = commonStaffService.selectList(new EntityWrapper<CommonStaff>()
+                    .eq("staff_mobile_phone", phone).eq("enabled", "1").eq("delete_flag", "0"));
+            if (CollectionUtils.isEmpty(commonStaffList)) {
+                throw new AppServiceException(ExceptionDefinition.USER_PHONE_NOT_EXIST);
+            }
+        } else {
+            //2.校验用户是否存在
+            List<CommonUser> targetUserList = this.selectList(
+                    new EntityWrapper<CommonUser>()
+                            .eq("phone", phone).eq("identification", identification));
+            if (CollectionUtils.isEmpty(targetUserList)) {
+                throw new AppServiceException(ExceptionDefinition.USER_PHONE_NOT_EXIST);
+            }
+        }
         String verifyCode = GeneratorUtil.genSixVerifyCode();
         System.out.println("verifyCode:" + verifyCode);
         SMSResult res = smsClient.sendRegisterVerify(phone, verifyCode);

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

@@ -17,12 +17,14 @@ import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import java.io.IOException;
 import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
@@ -44,6 +46,86 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
     private INewsInfoService newsInfoService;
     @Autowired
     private ICommonUserService commonUserService;
+    @Autowired
+    private IOrderInfoService orderInfoService;
+
+    /**
+     * 查询上报结果(每分钟执行一次)
+     */
+    @Transactional
+    @Scheduled(cron = "0 */1 * * * ?")
+    public void queryResults() throws IOException {
+
+        //查询司机上报结果
+        List<HyDriverInfo> hyDriverInfoList = this.selectList(new EntityWrapper<HyDriverInfo>()
+        .eq("escalation_status_key","5").eq("delete_flag","0"));
+        if (!CollectionUtils.isEmpty(hyDriverInfoList)){
+            //获取token
+            String token = EntityAnalyse.GetJTToken();
+            for (HyDriverInfo hyDriverInfo : hyDriverInfoList){
+                //上报司机信息校验结果查询
+                hyDriverInfo.setToken(token);
+                if ("通过".equals(EntityAnalyse.driverInfoCheck(hyDriverInfo))){
+                    hyDriverInfo.setEscalationStatusKey(StatusEnum.PASSED.getFlag());
+                    hyDriverInfo.setEscalationStatus(StatusEnum.PASSED.getName());
+                }else if ("待校验".equals(EntityAnalyse.driverInfoCheck(hyDriverInfo))){
+                    hyDriverInfo.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
+                    hyDriverInfo.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
+                }else {
+                    hyDriverInfo.setEscalationStatusKey(StatusEnum.FAIL.getFlag());
+                    hyDriverInfo.setEscalationStatus(StatusEnum.FAIL.getName());
+                    hyDriverInfo.setEscalationFailureReason(EntityAnalyse.driverInfoCheck(hyDriverInfo));
+                }
+                this.updateById(hyDriverInfo);
+            }
+        }
+        //查询车辆上报结果
+        List<HyDriverCarInfo> hyDriverCarInfoList = driverCarInfoService.selectList(new EntityWrapper<HyDriverCarInfo>()
+                .eq("escalation_status_key","5").eq("delete_flag","0"));
+        if (!CollectionUtils.isEmpty(hyDriverCarInfoList)){
+            //获取token
+            String token = EntityAnalyse.GetJTToken();
+            for (HyDriverCarInfo hyDriverCarInfo : hyDriverCarInfoList){
+                //上报车辆信息校验结果查询
+                hyDriverCarInfo.setToken(token);
+                if ("通过".equals(EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo))){
+                    hyDriverCarInfo.setEscalationStatusKey(StatusEnum.PASSED.getFlag());
+                    hyDriverCarInfo.setEscalationStatus(StatusEnum.PASSED.getName());
+                }else if ("待校验".equals(EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo))){
+                    hyDriverCarInfo.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
+                    hyDriverCarInfo.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
+                }else {
+                    hyDriverCarInfo.setEscalationStatusKey(StatusEnum.FAIL.getFlag());
+                    hyDriverCarInfo.setEscalationStatus(StatusEnum.FAIL.getName());
+                    hyDriverCarInfo.setEscalationFailureReason(EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo));
+                }
+                driverCarInfoService.updateById(hyDriverCarInfo);
+            }
+        }
+        //查询运单上报结果
+        List<OrderInfo> orderInfoList = orderInfoService.selectList(new EntityWrapper<OrderInfo>()
+                .eq("escalation_status_key","5").eq("delete_flag","0"));
+        if (!CollectionUtils.isEmpty(orderInfoList)){
+            //获取token
+            String token = EntityAnalyse.GetJTToken();
+            for (OrderInfo orderInfo : orderInfoList){
+                //上报车辆信息校验结果查询
+                orderInfo.setToken(token);
+                if ("通过".equals(EntityAnalyse.waybillCheck(orderInfo))){
+                    orderInfo.setEscalationStatusKey(StatusEnum.ADOPTED.getFlag());
+                    orderInfo.setEscalationStatus(StatusEnum.ADOPTED.getName());
+                }else if ("待校验".equals(EntityAnalyse.waybillCheck(orderInfo))){
+                    orderInfo.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
+                    orderInfo.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
+                }else {
+                    orderInfo.setEscalationStatusKey(StatusEnum.NOT_ADOPT.getFlag());
+                    orderInfo.setEscalationStatus(StatusEnum.NOT_ADOPT.getName());
+                    orderInfo.setEscalationFailureReason(EntityAnalyse.waybillCheck(orderInfo));
+                }
+                orderInfoService.updateById(orderInfo);
+            }
+        }
+    }
 
 
     /**
@@ -187,6 +269,28 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String editInfo(HyDriverInfo hyDriverInfo) throws IOException , ParseException {
+        //获取当前年月日
+        SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
+        String date = f.format(new Date(System.currentTimeMillis()));
+        //获取当前日期
+        Date date1 = new Date();
+        //判断身份证有效期
+        if (!"长期".equals(hyDriverInfo.getCardValidityDate())) {
+            int result1 = hyDriverInfo.getCardValidityDate().compareTo(date);
+            if (result1 == 0){
+                throw new YException(YExceptionEnum.TERM_OF_VALIDITY);
+            }
+        }
+        //驾驶证
+        int result2 = hyDriverInfo.getDriverLicenseValidityDate().compareTo(date);
+        if (result2 == 0){
+            throw new YException(YExceptionEnum.DRIVER_TERM_OF_VALIDITY);
+        }
+        //从业资格证
+        int result3 = hyDriverInfo.getQualificationCertificateValidityDate().compareTo(date1);
+        if (result3 < 0){
+            throw new YException(YExceptionEnum.CONG_TERM_OF_VALIDITY);
+        }
         hyDriverInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_REVIEWED.getFlag());
         hyDriverInfo.setAuthenticationStatus(StatusEnum.IDENTITY_REVIEWED.getName());
         hyDriverInfo.setBackStageStatusKey(StatusEnum.TO_BE_REVIEWED.getFlag());
@@ -285,7 +389,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
                 //发送消息
                 NewsInfo newsInfo = new NewsInfo();
                 newsInfo.setReCommonId(hyDriverInfo1.getCommonId());
-                newsInfo.setNewsContent("身份认证已驳回!驳回原因:" + hyDriverInfo.getRejectReason());
+                newsInfo.setNewsContent("身份认证已驳回!" + "\n" + "驳回原因:" + hyDriverInfo.getRejectReason() + "\n" + "驳回原因描述:" + hyDriverInfo.getRejectReasonDescription());
                 newsInfo.setBussId(hyDriverInfo1.getId());
                 newsInfo.setNewsTypeKey("1");
                 newsInfo.setNewsType("系统消息");

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

@@ -255,7 +255,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     }
                 }
                 //驾驶证
-                int result2 = driverInfo.getDriverLicenseValidityDate().compareTo(date1);
+                int result2 = driverInfo.getDriverLicenseValidityDate().compareTo(date);
                 if (result2 < 0) {
                     driverInfo.setDriverOverdueFlag("1");
                     driverInfo.setAuthenticationStatus(StatusEnum.IDENTITY_OVERDUE.getName());
@@ -266,7 +266,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     driverInfo.setEscalationStatusKey(StatusEnum.EXPIRED.getFlag());
                     driverInfoService.updateById(driverInfo);
                 }//驾驶证到期前10天
-                int result210 = driverInfo.getDriverLicenseValidityDate().compareTo(date10);
+                int result210 = driverInfo.getDriverLicenseValidityDate().compareTo(sdate10);
                 if (result210 == 0) {
                     //发送系统消息
                     NewsInfo newsInfo = new NewsInfo();
@@ -278,7 +278,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfoService.addNewsInfo(newsInfo);
                 }
                 //驾驶证到期前3天
-                int result23 = driverInfo.getDriverLicenseValidityDate().compareTo(date3);
+                int result23 = driverInfo.getDriverLicenseValidityDate().compareTo(sdate3);
                 if (result23 == 0) {
                     //发送系统消息
                     NewsInfo newsInfo = new NewsInfo();

+ 16 - 16
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/EntityAnalyse.java

@@ -153,7 +153,7 @@ public class EntityAnalyse {
                 params.put("vehicleClass", hyDriverInfo1.getQuasiDrivingVehicle());
                 params.put("issuingOrganizations", hyDriverInfo1.getLssuingAuthority());
                 params.put("validPeriodFrom", f.format(hyDriverInfo1.getDriverLicenseValidityStartDate()));
-                params.put("validPeriodTo", f.format(hyDriverInfo1.getDriverLicenseValidityDate()));
+                params.put("validPeriodTo", hyDriverInfo1.getDriverLicenseValidityDate());
                 params.put("qualificationCertificate", hyDriverInfo1.getQualificationCertificateNumber());
                 params.put("telephone", hyDriverInfo1.getDriverPhone());
                 params.put("remark", hyDriverInfo1.getDriverName() + hyDriverInfo1.getDriverPhone());
@@ -472,8 +472,8 @@ public class EntityAnalyse {
             // 执行请求操作,并拿到结果(同步阻塞)
             String body = EntityUtils.toString(response.getEntity());
             JSONObject jsonObject = JSONObject.parseObject(body);
-            if ("异常".equals(jsonObject.getJSONObject("result").getString("validateStatus"))) {
-                JSONArray jsonArray = jsonObject.getJSONObject("result").getJSONArray("validateResult");
+            if ("异常".equals(jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"))) {
+                JSONArray jsonArray = jsonObject.getJSONArray("result").getJSONObject(0).getJSONArray("validateResult");
                 String result = "";
                 for (int i = 0; i < jsonArray.size(); i++) {
                     if ("异常".equals(jsonArray.getJSONObject(i).getString("flag"))) {
@@ -482,12 +482,12 @@ public class EntityAnalyse {
                 }
                 System.out.println("result = " + result);
                 return result;
-            } else if ("待校验".equals(jsonObject.getJSONObject("result").getString("validateStatus"))) {
+            } else if ("待校验".equals(jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"))) {
                 String result = "待校验";
                 System.out.println("result = " + result);
                 return result;
-            } else if ("通过".equals(jsonObject.getJSONObject("result").getString("validateStatus"))) {
-                String result = jsonObject.getJSONObject("result").getString("validateStatus");
+            } else if ("通过".equals(jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"))) {
+                String result = (jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"));
                 System.out.println("result = " + result);
                 return result;
             }
@@ -529,8 +529,8 @@ public class EntityAnalyse {
             // 执行请求操作,并拿到结果(同步阻塞)
             String body = EntityUtils.toString(response.getEntity());
             JSONObject jsonObject = JSONObject.parseObject(body);
-            if ("异常".equals(jsonObject.getJSONObject("result").getString("validateStatus"))) {
-                JSONArray jsonArray = jsonObject.getJSONObject("result").getJSONArray("validateResult");
+            if ("异常".equals(jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"))) {
+                JSONArray jsonArray = jsonObject.getJSONArray("result").getJSONObject(0).getJSONArray("validateResult");
                 String result = "";
                 for (int i = 0; i < jsonArray.size(); i++) {
                     if ("异常".equals(jsonArray.getJSONObject(i).getString("flag"))) {
@@ -539,12 +539,12 @@ public class EntityAnalyse {
                 }
                 System.out.println("result = " + result);
                 return result;
-            } else if ("待校验".equals(jsonObject.getJSONObject("result").getString("validateStatus"))) {
+            } else if ("待校验".equals(jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"))) {
                 String result = "待校验";
                 System.out.println("result = " + result);
                 return result;
-            } else if ("通过".equals(jsonObject.getJSONObject("result").getString("validateStatus"))) {
-                String result = jsonObject.getJSONObject("result").getString("validateStatus");
+            } else if ("通过".equals(jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"))) {
+                String result = (jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"));
                 System.out.println("result = " + result);
                 return result;
             }
@@ -582,8 +582,8 @@ public class EntityAnalyse {
             // 执行请求操作,并拿到结果(同步阻塞)
             String body = EntityUtils.toString(response.getEntity());
             JSONObject jsonObject = JSONObject.parseObject(body);
-            if ("异常".equals(jsonObject.getJSONObject("result").getString("validateStatus"))) {
-                JSONArray jsonArray = jsonObject.getJSONObject("result").getJSONArray("validateResult");
+            if ("异常".equals(jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"))) {
+                JSONArray jsonArray = jsonObject.getJSONArray("result").getJSONObject(0).getJSONArray("validateResult");
                 String result = "";
                 for (int i = 0; i < jsonArray.size(); i++) {
                     if ("异常".equals(jsonArray.getJSONObject(i).getString("flag"))) {
@@ -592,12 +592,12 @@ public class EntityAnalyse {
                 }
                 System.out.println("result = " + result);
                 return result;
-            } else if ("待校验".equals(jsonObject.getJSONObject("result").getString("validateStatus"))) {
+            } else if ("待校验".equals(jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"))) {
                 String result = "待校验";
                 System.out.println("result = " + result);
                 return result;
-            } else if ("通过".equals(jsonObject.getJSONObject("result").getString("validateStatus"))) {
-                String result = jsonObject.getJSONObject("result").getString("validateStatus");
+            } else if ("通过".equals(jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"))) {
+                String result = (jsonObject.getJSONArray("result").getJSONObject(0).getString("validateStatus"));
                 System.out.println("result = " + result);
                 return result;
             }

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

@@ -213,7 +213,7 @@
         c.create_date as createDate,
         c.update_date as updateDate
         FROM hy_driver_car_info c
-        left join hy_driver_info d on d.id=c.driver_id and d.delete_flag = '0'
+        left join hy_driver_info d on d.common_id=c.common_id and d.delete_flag = '0'
         WHERE c.delete_flag = '0'
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">

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

@@ -14,11 +14,11 @@
             AND (lower(number) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(title) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
-        <if test="startDate != null">
+        <if test="startDate != null and startDate != ''">
             AND (DATE_FORMAT(update_date,"%Y%m%d") &gt;=
             DATE_FORMAT(#{startDate},"%Y%m%d"))
         </if>
-        <if test="endDate != null">
+        <if test="endDate != null and endDate != ''">
             AND (DATE_FORMAT(update_date,"%Y%m%d") &lt;=
             DATE_FORMAT(#{endDate},"%Y%m%d"))
         </if>