From a77b4b41cc6d7521756017985aac2d3b38935254 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 18 十月 2024 11:57:30 +0800
Subject: [PATCH] 最新版本541200007

---
 server/system_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java                          |   28 +++++
 server/system_service/src/main/java/com/doumee/core/model/LoginUserInfo.java                                   |    1 
 server/system_service/src/main/java/com/doumee/core/utils/PwdCheckUtil.java                                    |   78 +++++++++++++++
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java |  108 ++++++++-------------
 admin/src/views/business/relativeMember.vue                                                                    |   12 +
 server/system_service/src/main/java/com/doumee/api/cloud/SystemCloudController.java                            |    6 +
 server/system_service/src/main/java/com/doumee/dao/system/model/SystemUser.java                                |    2 
 server/system_service/src/main/java/com/doumee/api/BaseController.java                                         |    8 +
 server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/WmsPushController.java                       |    2 
 9 files changed, 172 insertions(+), 73 deletions(-)

diff --git a/admin/src/views/business/relativeMember.vue b/admin/src/views/business/relativeMember.vue
index 31248aa..df14305 100644
--- a/admin/src/views/business/relativeMember.vue
+++ b/admin/src/views/business/relativeMember.vue
@@ -37,9 +37,9 @@
           <el-option label="鍚屾澶辫触" value="2"></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="">
+<!--      <el-form-item label="">
         <el-checkbox style="font-size: 12px" label="1" v-model="searchForm.includeChild" key="1">鏄惁鍖呭惈涓嬬骇缁勭粐</el-checkbox>
-      </el-form-item>
+      </el-form-item>-->
       <section>
         <el-button type="primary" @click="search">鎼滅储</el-button>
         <el-button @click="reset">閲嶇疆</el-button>
@@ -71,8 +71,14 @@
             icon="el-icon-plus" v-permissions="['business:traintime:create']">鍩硅鏈熷鍏�</el-button></li>
         <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete"
             v-permissions="['business:member:delete']">鎵归噺鍒犻櫎</el-button></li>
-        <li><el-button type="primary" v-permissions="['business:empower:create']" @click="startEmpowerBatch()">涓嬪彂鎺堟潈</el-button></li>
+        <li><el-button type="primary" v-permissions="['business:empower:create']" @click="startEmpowerBatch()">涓嬪彂鎺堟潈</el-button>
+        <li style="float: right">
+          <el-checkbox style="font-size: 12px" label="1" v-model="searchForm.includeChild" key="1"
+                       @change="search">鏄惁鍖呭惈涓嬬骇缁勭粐</el-checkbox>
+        </li>
+<!--
         <li><el-button type="primary" v-permissions="['business:empower:exportExcel']" @click="exportExcel">瀵煎嚭</el-button></li>
+-->
       </ul>
       <el-table v-loading="isWorking.search" :data="tableData.list" stripe @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55"></el-table-column>
diff --git a/server/system_service/src/main/java/com/doumee/api/BaseController.java b/server/system_service/src/main/java/com/doumee/api/BaseController.java
index 7aae08b..3001582 100644
--- a/server/system_service/src/main/java/com/doumee/api/BaseController.java
+++ b/server/system_service/src/main/java/com/doumee/api/BaseController.java
@@ -1,6 +1,7 @@
 package com.doumee.api;
 
 import com.alibaba.fastjson.JSONObject;
+import com.doumee.config.jwt.JwtProperties;
 import com.doumee.core.constants.ResponseStatus;
 import com.doumee.core.exception.BusinessException;
 import com.doumee.core.model.LoginUserInfo;
@@ -13,9 +14,11 @@
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
 
 /**
  * Controller鍩虹被
@@ -27,6 +30,8 @@
 
     @Autowired
     private RedisTemplate<String,Object> stringRedisTemplate;
+    @Resource
+    private JwtProperties jwtProperties;
     /**
      * 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛
      * @author Eva.Caesar Liu
@@ -47,6 +52,9 @@
         }
         return  user;
     }
+    public void updateLoginUser (String token,LoginUserInfo userInfo) {
+        stringRedisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,JSONObject.toJSONString(userInfo),jwtProperties.getExpiration(), TimeUnit.MILLISECONDS);
+    }
 
 
     /**
diff --git a/server/system_service/src/main/java/com/doumee/api/cloud/SystemCloudController.java b/server/system_service/src/main/java/com/doumee/api/cloud/SystemCloudController.java
index fa6223a..eee029f 100644
--- a/server/system_service/src/main/java/com/doumee/api/cloud/SystemCloudController.java
+++ b/server/system_service/src/main/java/com/doumee/api/cloud/SystemCloudController.java
@@ -4,6 +4,7 @@
 import com.doumee.biz.system.SystemUserBiz;
 import com.doumee.core.annotation.trace.Trace;
 import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.LoginUserInfo;
 import com.doumee.core.utils.Constants;
 import com.doumee.dao.system.dto.UpdatePwdDto;
 import com.doumee.service.system.SystemLoginService;
@@ -35,8 +36,11 @@
     @ApiOperation("淇敼褰撳墠鐢ㄦ埛瀵嗙爜")
     @PostMapping("/updatePwd")
     public ApiResponse updatePwd (@RequestHeader(Constants.HEADER_USER_TOKEN) String token, @Validated @RequestBody UpdatePwdDto dto) {
-        dto.setUserId(this.getLoginUser(token).getId());
+        LoginUserInfo userInfo = this.getLoginUser(token);
+        dto.setUserId(userInfo.getId());
         systemUserBiz.updatePwd(dto);
+        userInfo.setNeedChangePwd(Constants.ONE);
+        updateLoginUser(token,userInfo);//鏇存柊鐧诲綍token涓粦瀹氱殑鐢ㄦ埛淇℃伅涓哄凡鏇存柊瀵嗙爜
         return ApiResponse.success(null);
     }
 
diff --git a/server/system_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java b/server/system_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java
index 71edf44..071fe85 100644
--- a/server/system_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java
+++ b/server/system_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java
@@ -9,6 +9,7 @@
 import com.doumee.core.constants.ResponseStatus;
 import com.doumee.core.model.LoginUserInfo;
 import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.PwdCheckUtil;
 import com.doumee.core.utils.Utils;
 import com.doumee.dao.system.SystemDepartmentUserMapper;
 import com.doumee.dao.system.dto.*;
@@ -81,6 +82,13 @@
 
     @Override
     public void updatePwd(UpdatePwdDto dto) {
+        //鐧诲綍瀵嗙爜澶嶆潅搴︽牎楠岋細6-20涓瓧绗︼紝鑷冲皯鍖呭惈瀛楁瘝銆佹暟瀛楀強鐗规畩瀛楃2绉�
+        if(StringUtils.isBlank(dto.getNewPwd())
+                ||dto.getNewPwd().length()>20
+                ||dto.getNewPwd().length()<6
+                ||PwdCheckUtil.checkPassword(dto.getNewPwd())){
+            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝瀵嗙爜澶嶆潅搴︿笉婊¤冻瑕佹眰锛�6-20涓瓧绗︼紝鑷冲皯鍖呭惈瀛楁瘝銆佹暟瀛楀強鐗规畩瀛楃2绉�");
+        }
         SystemUser user = systemUserService.findById(dto.getUserId());
         if (user.getDeleted()) {
             throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "鐢ㄦ埛涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎");
@@ -93,6 +101,7 @@
         SystemUser newUser = new SystemUser();
         newUser.setId(dto.getUserId());
         newUser.setPassword(Utils.Secure.encryptPassword(dto.getNewPwd(), user.getSalt()));
+        newUser.setNeedChangePwd(Constants.ONE);
         systemUserService.updateById(newUser);
     }
 
@@ -108,6 +117,7 @@
         updateUserDto.setId(dto.getId());
         updateUserDto.setUpdateUser(dto.getOperaUserId());
         updateUserDto.setPassword(Utils.Secure.encryptPassword(dto.getPassword(), systemUser.getSalt()));
+        updateUserDto.setNeedChangePwd(Constants.ZERO);
         systemUserService.updateById(updateUserDto);
     }
 
@@ -138,6 +148,7 @@
         systemUser.setPassword(Utils.Secure.encryptPassword(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.INITIAL_PASSWORD).getCode(), salt));
         systemUser.setSalt(salt);
         systemUser.setSource(Constants.ZERO);
+        systemUser.setNeedChangePwd(Constants.ZERO);
 
         // 鍒涘缓鐢ㄦ埛璁板綍
         systemUser.setType(Constants.ZERO);
@@ -263,20 +274,27 @@
                     .filter(s->StringUtils.isNotBlank(s))
                     .distinct()
                     .collect(Collectors.toList());
+            String pwd =systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.INITIAL_PASSWORD).getCode();
             if (!CollectionUtils.isEmpty(collect)){
                 QueryWrapper<SystemDepartment> wrapper = new QueryWrapper<>();
                 wrapper.lambda().in(SystemDepartment::getName,collect);
                 List<SystemDepartment> systemDepartments = systemDepartmentService.findList(wrapper);
                 Map<Integer, String> collect1 = systemDepartments.stream().collect(Collectors.toMap(s -> s.getId(), s -> s.getName()));
-
+                // 鐢熸垚瀵嗙爜鐩�
                 dataList.forEach(s->{
+
                     CreateSystemUserDTO systemUser = new CreateSystemUserDTO();
                     systemUser.setDepartmentId(getKey(collect1,s.getDepartmentName()));
                     systemUser.setUsername(s.getUsername());
                     systemUser.setRealname(s.getUsername());
                     systemUser.setEmpNo(s.getEmpNo());
                     systemUser.setMobile(s.getMobile());
-                    systemUser.setPassword(s.getMobile());
+                    String salt = RandomStringUtils.randomAlphabetic(6);
+//                    systemUser.setPassword(s.getMobile());
+                    // 鐢熸垚瀵嗙爜  String pwd =systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.INITIAL_PASSWORD).getCode();
+                    systemUser.setPassword(Utils.Secure.encryptPassword(pwd, salt));
+                    systemUser.setNeedChangePwd(Constants.ZERO);
+                    systemUser.setSalt(salt);
                     systemUser.setCreateUser(loginUserInfo.getId());
                     systemUser.setUpdateUser(loginUserInfo.getId());
                     systemUser.setType(Constants.ZERO);
@@ -297,7 +315,11 @@
                     systemUser.setRealname(s.getUsername());
                     systemUser.setEmpNo(s.getEmpNo());
                     systemUser.setMobile(s.getMobile());
-                    systemUser.setPassword(s.getMobile());
+                    // 鐢熸垚瀵嗙爜             String pwd =systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.INITIAL_PASSWORD).getCode();
+                    String salt = RandomStringUtils.randomAlphabetic(6);
+                    systemUser.setPassword(Utils.Secure.encryptPassword(pwd, salt));
+                    systemUser.setNeedChangePwd(Constants.ZERO);
+//                    systemUser.setPassword(s.getMobile());
                     systemUser.setCreateUser(loginUserInfo.getId());
                     systemUser.setUpdateUser(loginUserInfo.getId());
                     systemUser.setType(Constants.ZERO);
diff --git a/server/system_service/src/main/java/com/doumee/core/model/LoginUserInfo.java b/server/system_service/src/main/java/com/doumee/core/model/LoginUserInfo.java
index 907be16..8cc71b7 100644
--- a/server/system_service/src/main/java/com/doumee/core/model/LoginUserInfo.java
+++ b/server/system_service/src/main/java/com/doumee/core/model/LoginUserInfo.java
@@ -36,6 +36,7 @@
 
     private Integer memberId;
     private Integer type;
+    private Integer needChangePwd;
     private String mobile;
     private String sessionId;
 
diff --git a/server/system_service/src/main/java/com/doumee/core/utils/PwdCheckUtil.java b/server/system_service/src/main/java/com/doumee/core/utils/PwdCheckUtil.java
new file mode 100644
index 0000000..8ecd514
--- /dev/null
+++ b/server/system_service/src/main/java/com/doumee/core/utils/PwdCheckUtil.java
@@ -0,0 +1,78 @@
+package com.doumee.core.utils;
+
+import java.util.regex.Pattern;
+
+/**
+ * Java姝e垯鏍¢獙瀵嗙爜鑷冲皯鍖呭惈锛氬瓧姣嶆暟瀛楃壒娈婄鍙蜂腑鐨�2绉�
+ */
+public class PwdCheckUtil {
+
+    /**
+     * 鍋囧畾璁剧疆瀵嗙爜鏃讹紝瀵嗙爜瑙勫垯涓猴細  瀛楁瘝銆佹暟瀛椼�佺壒娈婄鍙凤紝鑷冲皯鍖归厤2绉�
+     * 鍒欏瘑鐮佸彲鑳藉嚭鐜扮殑鎯呭喌鏈夛細
+     * 1銆佹暟瀛�+鐗规畩绗﹀彿
+     * 2銆佸瓧姣�+鐗规畩绗﹀彿
+     * 3銆佸瓧姣�+鏁板瓧
+     * 4銆佸瓧姣�+鏁板瓧+鐗规畩绗﹀彿
+     * (缁勫悎涓庨『搴忔棤鍏�)
+     * 瑙e喅鎬濊矾锛�
+     * 1銆侀亶鍘嗗瓧绗︿覆鐨勫瓧绗︽暟缁勶紝鏌ョ湅鏄惁鍖呭惈鐩爣鐗规畩瀛楃锛岃嫢鍖呭惈锛屽垯鏍囪瀛楃涓�
+     * 鍖呭惈鐗规畩瀛楃锛屽苟鏇挎崲褰撳墠鐗规畩瀛楃涓�''銆�
+     * 2銆佸垽鏂墿涓嬬殑瀛楃缁勬垚鐨勫瓧绗︿覆锛屾槸鍚﹀尮閰嶄互涓嬫儏鍐�
+     * - 绾瓧姣�
+     * - 绾暟瀛�
+     * - 瀛楁瘝+鏁板瓧
+     * 3銆佸瓧绗︿覆鍖归厤瑙勫垯
+     * 绾瓧姣�+鍖呭惈鐗规畩瀛楃  ---- 鍖归厤閫氳繃
+     * 绾暟瀛�+鍖呭惈鐗规畩瀛楃 ---- 鍖归厤閫氳繃
+     * 瀛楁瘝+鏁板瓧+鍖呭惈涓暟瀛楃 ---- 鍖归厤閫氳繃
+     */
+    //鐗规畩瀛楃
+    public static final String SPEC_CHARACTERS = " !\"#$%&'()*+,-./:;<=>?@\\]\\[^_`{|}~";
+    // 绾瓧姣�
+    public static final String character = "[a-zA-Z]{1,}$";
+    // 绾暟瀛�
+    public static final String numberic = "[0-9]{1,}$";
+    // 瀛楁瘝鍜屾暟瀛�
+    public static final String number_and_character = "((^[a-zA-Z]{1,}[0-9]{1,}[a-zA-Z0-9]*)+)" +
+            "|((^[0-9]{1,}[a-zA-Z]{1,}[a-zA-Z0-9]*)+)$";
+    // 瀛楁瘝鎴栨暟瀛�
+    public static final String number_or_character = "[a-zA-Z0-9]+$";
+    // 瀛楁瘝鏁板瓧涓嬪垝绾�
+    public static final String ncw = "\\w+$";
+
+    public static boolean checkPassword(String targetString) {
+        String opStr = targetString;
+        boolean isLegal = false;
+        boolean hasSpecChar = false;
+        char[] charArray = opStr.toCharArray();
+        for (char c : charArray) {
+            if (SPEC_CHARACTERS.contains(String.valueOf(c))) {
+                hasSpecChar = true;
+                // 鏇挎崲姝ゅ瓧绗︿覆
+                opStr = opStr.replace(c, ' ');
+            }
+        }
+        String excSpecCharStr = opStr.replace(" ", "");
+        boolean isPureNum = Pattern.compile(numberic).matcher(excSpecCharStr).matches();
+        boolean isPureChar = Pattern.compile(character).matcher(excSpecCharStr).matches();
+        boolean isNumAndChar = Pattern.compile(number_and_character).matcher(excSpecCharStr).matches();
+        isLegal = ((isPureNum && hasSpecChar)
+                || (isPureChar && hasSpecChar) || isNumAndChar && hasSpecChar) || isNumAndChar;
+        System.out.println("瀛楃涓诧細" + targetString + ",鏄惁绗﹀悎瑙勫垯锛�" + isLegal);
+        System.out.println("---------------");
+        return isLegal;
+    }
+
+    public static void main(String[] args) {
+        checkPassword("fasdagd");
+        checkPassword("41234123");
+        checkPassword("#$%^&&*(");
+        checkPassword("fasd$$");
+        checkPassword("41234%%%");
+        checkPassword("fasd41^(324");
+        checkPassword("fa413%^&*");
+        checkPassword("&%fa413%^&*");
+    }
+
+}
\ No newline at end of file
diff --git a/server/system_service/src/main/java/com/doumee/dao/system/model/SystemUser.java b/server/system_service/src/main/java/com/doumee/dao/system/model/SystemUser.java
index 196e1e6..d4874b3 100644
--- a/server/system_service/src/main/java/com/doumee/dao/system/model/SystemUser.java
+++ b/server/system_service/src/main/java/com/doumee/dao/system/model/SystemUser.java
@@ -84,6 +84,8 @@
 
     @ApiModelProperty(value = "鍒涘缓浜�", example = "1", hidden = true)
     private Integer createUser;
+    @ApiModelProperty(value = "鏄惁闇�瑕佸己鍒舵洿鏂板瘑鐮� 0鏄� 1鍚�")
+    private Integer needChangePwd;
 
     @ApiModelProperty(value = "鏇存柊浜�", example = "1", hidden = true)
     private Integer updateUser;
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/WmsPushController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/WmsPushController.java
index a968b68..05e12cf 100644
--- a/server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/WmsPushController.java
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/api/business/WmsPushController.java
@@ -72,7 +72,7 @@
             e.printStackTrace();
             success = Constants.ONE;
         }finally {
-            wmsService.saveInterfaceLog("/wms/push/outboundNotice", "鎺ㄩ�佸嚭搴撳崟閫氱煡浠诲姟",JSONObject.toJSONString(param),success
+            wmsService.saveInterfaceLog("/wms/push/outboundNotice", "銆怶MS銆戞帹閫佸嚭搴撳崟閫氱煡浠诲姟",JSONObject.toJSONString(param),success
                     , JSONObject.toJSONString(result),Constants.ONE);
         }
 
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
index 45a748e..cc37400 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -87,8 +87,6 @@
     private PlatformLogMapper platformLogMapper;
     @Autowired
     private PlatformWarnEventServiceImpl platformWarnEventService;
-    @Autowired
-    private PlatformJobService platformJobService;
     /**
      * 娴峰悍闂ㄧ浜嬩欢鎺ㄩ��
      * @param param
@@ -825,75 +823,55 @@
                     .last("limit 1" ));
             if(cars!=null){
                 event.setMemberId(cars.getMemberId());
-
-                    if(Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.PARK_PASS_IN.getKey()){
-                        if(carsMapper.selectCount(new QueryWrapper<Cars>()
-                                .lambda().eq(Cars::getCode,event.getPlateNos())
-                                .eq(Cars::getType,Constants.ONE)
-                                .eq(Cars::getIsdeleted,Constants.ZERO)
-                        )>Constants.ZERO){
-                            //鑷湁杞﹁繘鍦�  鏌ヨ褰撳墠鏄惁鏈夊緟绛惧埌鐨勪换鍔�
-                            //鏌ヨ杞﹁締褰撳墠鏄惁瀛樺湪杩涜涓殑浠诲姟
-                            if(platformJobMapper.selectCount(new QueryWrapper<PlatformJob>().lambda()
-                                    .eq(PlatformJob::getCarCodeFront,event.getPlateNos())
-                                    .eq(PlatformJob::getIsdeleted,Constants.ZERO)
-                                    .in(PlatformJob::getStatus,
-                                            Constants.PlatformJobStatus.IN_WAIT.getKey(),
-                                            Constants.PlatformJobStatus.CALLED.getKey(),
-                                            Constants.PlatformJobStatus.WORKING.getKey(),
-                                            Constants.PlatformJobStatus.DONE.getKey(),
-                                            Constants.PlatformJobStatus.TRANSFERING.getKey(),
-                                            Constants.PlatformJobStatus.EXCEPTION.getKey(),
-                                            Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()
-                                    )
-                            )==Constants.ZERO){
-                                PlatformJob platformJob = platformJobMapper.selectOne(new QueryWrapper<PlatformJob>().lambda()
-                                        .eq(PlatformJob::getCarCodeFront,event.getPlateNos())
-                                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
-                                        .in(PlatformJob::getStatus,
-                                                Constants.PlatformJobStatus.WAIT_CONFIRM.getKey(),
-                                                Constants.PlatformJobStatus.WART_SIGN_IN.getKey()
-                                        )
-                                        .orderByAsc(PlatformJob::getCreateDate)
-                                        .last(" limit 1")
-                                );
-                                if(Objects.nonNull(platformJob)){
-                                    platformJob.setStatus(Constants.PlatformJobStatus.WAIT_CALL.getKey());
-                                    platformJob.setArriveDate(new Date());
-                                    platformJob.setSingType(Constants.TWO);
-                                    platformJob.setSignDate(new Date());
-                                    List<PlatformJob> signList = platformJobMapper.selectList(new QueryWrapper<PlatformJob>().lambda().apply(" DATE(SIGN_DATE) = DATE(NOW()) and sign_date is not null  "));
-                                    if(CollectionUtils.isEmpty(signList)){
-                                        platformJob.setSignNum(Constants.ONE);
-                                    } else{
-                                        int maxNumber = Collections.max(signList.stream().map(i->i.getSignNum()).collect(Collectors.toList()));
-                                        platformJob.setSignNum(maxNumber + Constants.ONE);
-                                    }
-                                    platformJobMapper.updateById(platformJob);
-                                }
-                            }
-                        }
-                    }else if(Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.PARK_PASS_OUT.getKey()){
-                        //绂诲満鍒ゆ柇鏄惁瀛樺湪鏈鍦虹殑璁㈠崟鏁版嵁 澶勭悊璁㈠崟鏁版嵁
-                        List<PlatformJob> platformJobList = platformJobMapper.selectList(new QueryWrapper<PlatformJob>().lambda()
+                //鑷湁杞�  鏌ヨ褰撳墠鏄惁鏈夊緟绛惧埌鐨勪换鍔�
+                if(carsMapper.selectCount(new QueryWrapper<Cars>()
+                        .lambda().eq(Cars::getCode,event.getPlateNos())
+                        .eq(Cars::getType,Constants.ONE)
+                        .eq(Cars::getIsdeleted,Constants.ZERO)
+                )>Constants.ZERO){
+                    //鏌ヨ杞﹁締褰撳墠鏄惁瀛樺湪杩涜涓殑浠诲姟
+                    if( platformJobMapper.selectCount(new QueryWrapper<PlatformJob>().lambda()
+                            .eq(PlatformJob::getCarCodeFront,event.getPlateNos())
+                            .eq(PlatformJob::getIsdeleted,Constants.ZERO)
+                            .in(PlatformJob::getStatus,
+                                    Constants.PlatformJobStatus.IN_WAIT.getKey(),
+                                    Constants.PlatformJobStatus.CALLED.getKey(),
+                                    Constants.PlatformJobStatus.WORKING.getKey(),
+                                    Constants.PlatformJobStatus.DONE.getKey(),
+                                    Constants.PlatformJobStatus.TRANSFERING.getKey(),
+                                    Constants.PlatformJobStatus.EXCEPTION.getKey(),
+                                    Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()
+                            )
+                    )==Constants.ZERO){
+                        PlatformJob platformJob = platformJobMapper.selectOne(new QueryWrapper<PlatformJob>().lambda()
                                 .eq(PlatformJob::getCarCodeFront,event.getPlateNos())
                                 .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                                 .in(PlatformJob::getStatus,
-                                        Constants.PlatformJobStatus.DONE.getKey(),
-                                        Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()
-                                ));
-                        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobList)){
-                            for (PlatformJob platformJob:platformJobList) {
-                                platformJob.setStatus(Constants.PlatformJobStatus.LEAVED.getKey());
-                                platformJob.setOutDate(new Date());
-                                platformJob.setEditDate(new Date());
-                                platformJob.setOutType(Constants.ZERO);
-                                platformJobMapper.updateById(platformJob);
-                                //娓呯┖鎺堟潈
-                                platformJobService.cancelInPark(platformJob);
+                                        Constants.PlatformJobStatus.WAIT_CONFIRM.getKey(),
+                                        Constants.PlatformJobStatus.WART_SIGN_IN.getKey()
+                                )
+                                .orderByAsc(PlatformJob::getCreateDate)
+                                .last(" limit 1")
+                        );
+                        if(Objects.nonNull(platformJob)){
+                            platformJob.setStatus(Constants.PlatformJobStatus.WAIT_CALL.getKey());
+                            platformJob.setArriveDate(new Date());
+                            platformJob.setSingType(Constants.TWO);
+                            platformJob.setSignDate(new Date());
+                            List<PlatformJob> signList = platformJobMapper.selectList(new QueryWrapper<PlatformJob>().lambda().apply(" DATE(SIGN_DATE) = DATE(NOW()) and sign_date is not null  "));
+                            if(CollectionUtils.isEmpty(signList)){
+                                platformJob.setSignNum(Constants.ONE);
+                            } else{
+                                int maxNumber = Collections.max(signList.stream().map(i->i.getSignNum()).collect(Collectors.toList()));
+                                platformJob.setSignNum(maxNumber + Constants.ONE);
                             }
+                            platformJobMapper.updateById(platformJob);
                         }
                     }
+                };
+
+
+
             }else{
                 Visits visits =  visitsMapper.selectOne(new QueryWrapper<Visits>().lambda()
                         .eq(Visits::getCarNos,event.getPlateNos())

--
Gitblit v1.9.3