Forráskód Böngészése

Merge branch 'master' of http://111.47.6.224:3000/udream-cxs/lift-server.git

Wei Ruifeng 5 éve
szülő
commit
590df5ea90

+ 2 - 2
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/mapper/MaintenancePlanMapper.java

@@ -60,6 +60,6 @@ public interface MaintenancePlanMapper extends BaseMapper<MaintenancePlan> {
     Long getCountByPlanId(Long planId);
 
     @Select("select (select value from global_set where company_id = #{mtCompanyId}  and code = 'sameUnits') >" +
-            "       (select count(*) from maintenance_record where mt_company_id=#{mtCompanyId} and worker_id1 = #{workerId1} and status = '1' and work_date = #{today})")
-    boolean selectLiftMaintainableBy(Long workerId1, Long mtCompanyId, LocalDate today);
+            "       (select count(*) from maintenance_record where mt_company_id=#{mtCompanyId} and (worker_id1 = #{workerId1} or worker_id = #{workerId1}) and status = '1' and DATE_FORMAT(work_date, '%Y-%m-%d') = #{today})")
+    boolean selectLiftMaintainableBy(Long workerId1, Long mtCompanyId, String today);
 }

+ 2 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/MaintenanceRecordService.java

@@ -67,6 +67,7 @@ import java.net.HttpURLConnection;
 import java.net.URL;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -235,7 +236,7 @@ public class MaintenanceRecordService extends ServiceImpl<MaintenanceRecordMappe
         if (result)
             return RestResponse.fail(MessageUtils.get("msg.error.person.scope"));
         log.debug("根据全局设置判断当前维保工是否可以继续维保电梯");
-        boolean maintainable = maintenancePlanService.getBaseMapper().selectLiftMaintainableBy(request.getUserId(), request.getMtCompanyId(),LocalDate.now());
+        boolean maintainable = maintenancePlanService.getBaseMapper().selectLiftMaintainableBy(request.getUserId(), request.getMtCompanyId(),DateTimeFormatter.ofPattern("yyyy-MM-dd").format(LocalDate.now()));
         if (!maintainable) {
             return RestResponse.fail("超出公司设置的维保工可维保电梯上限数量");
         }

+ 4 - 2
lift-ud-service/src/main/java/cn/com/ty/lift/ud/chat/service/impl/ChatSessionServiceImpl.java

@@ -135,8 +135,10 @@ public class ChatSessionServiceImpl extends ServiceImpl<ChatSessionMapper, ChatS
         List<ChatSessionEntity> list = sessionMapper.findDBListByUserId(query.getUserId());
         list.forEach(entity -> {
             RoomInfo roomInfo = redis.get("ROOM:" + entity.getSessionid(), RoomInfo.class);
-            entity.setLastMsg(roomInfo.getLastChat());
-            entity.setLastTime(roomInfo.getLastTime());
+            if (null != roomInfo){
+                entity.setLastMsg(roomInfo.getLastChat());
+                entity.setLastTime(roomInfo.getLastTime());
+            }
         });
         Collections.sort(list, (ent1, ent2) -> ent2.getLastTime().compareTo(ent1.getLastTime()));