Przeglądaj źródła

Merge remote-tracking branch 'origin/dev-merge-pre-secrity-kdhc' into dev-merge-pre-secrity-kdhc

donggaosheng 1 rok temu
rodzic
commit
aca175e876

+ 1 - 1
zd-auth/src/main/java/com/zd/auth/controller/AuthController.java

@@ -150,7 +150,7 @@ public class AuthController {
                 } else {
                     String token = IdUtils.fastUUID();
                     commLogin(loginModel, token);
-                    redisService.setCacheObject(tokenKey + loginModel.getUserId(), token, BaseConstants.TOKEN_EXPIRE, TimeUnit.SECONDS);
+                    redisService.setCacheObject(tokenKey + loginModel.getUserId(), token, 180L, TimeUnit.DAYS);
                     // 获取大屏TOKEN
                     data.put("screen_token", token);
                 }

+ 22 - 5
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSecurityApplyController.java

@@ -42,6 +42,8 @@ import java.net.HttpURLConnection;
 import java.net.URL;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * 安全准入申请Controller
@@ -513,7 +515,7 @@ public class LabSecurityApplyController extends BaseController {
     @GetMapping("/listOrderByYmd")
     @ApiOperation(value = "查询安全准入审核列表")
     public TableDataInfo<Map<String, Object>> selectLabCheckRecordListOrderBydate(LabSecurityApplyVO labSecurityApplyVO) {
-        startPage();
+
         ///获取当前登录用户信息
         LoginModel sysUser = tokenService.getLoginUser();
 
@@ -538,13 +540,28 @@ public class LabSecurityApplyController extends BaseController {
             //学生登录
             labSecurityApplyVO.setUserId(sysUser.getUserId());
         }
+        startPage();
         //查询日期
         List<LabSecurityApplyVO> list = labSecurityApplyService.selectLabSecurityApplyListOrderBydate(labSecurityApplyVO);
+        List<LabSecurityApplyVO> list2 = labSecurityApplyService.selectLabSecurityApplyListYmd(labSecurityApplyVO);
+        //日期格式转换
+        SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
+
+        //日期匹配函数
+        Function <LabSecurityApplyVO,List<LabSecurityApplyVO>> function = a->Optional.ofNullable(list2).orElseGet(Collections::emptyList)
+                .stream()
+                .filter(p->{
+                    String createTime1 = format.format(a.getCreatTime());
+                    String createTime2 = format.format(p.getCreatTime());
+                    if(createTime1.equals(createTime2)){
+                        return true;
+                    }
+                    return false;
+                })
+                .collect(Collectors.toList());
 
-        for (int i = 0; i < list.size(); i++) {
-            labSecurityApplyVO.setCreatTime(list.get(i).getCreatTime());
-            List<LabSecurityApplyVO> list2 = labSecurityApplyService.selectLabSecurityApplyListYmd(labSecurityApplyVO);
-            list.get(i).setApplyList(list2);
+        for(LabSecurityApplyVO secApplyVO : list){
+            secApplyVO.setApplyList(function.apply(secApplyVO));
         }
         return getDataTable(list);
     }