LIVE_YE 2 жил өмнө
parent
commit
a2ae970d22

+ 10 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/info/UserInfoController.java

@@ -49,6 +49,16 @@ public class UserInfoController extends BaseController
     }
 
 
+    /**
+     * 查询导入人员信息列表
+     */
+    @GetMapping("/oneDate")
+    public AjaxResult oneDate(UserInfo userInfo)
+    {
+        return userInfoService.oneDate(userInfo);
+    }
+
+
     /**
      * 导出导入人员信息列表
      */

+ 8 - 9
ruoyi-admin/src/main/resources/application-prod.yml

@@ -1,7 +1,7 @@
 # 项目相关配置
 ruoyi:
     # 名称
-    name: 信用
+    name: 核酸对比
     # 版本
     version: 3.8.2
     # 版权年份
@@ -11,12 +11,11 @@ ruoyi:
     # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
     profile: /home/boman/xinyong
     #文件上传的激活前缀
-    pathMapping: http://118.31.23.65:5007/prod-api
+    pathMapping: http://47.99.82.249:6000/prod-api
     # 获取ip地址开关
     addressEnabled: false
     # 验证码类型 math 数组计算 char 字符验证
-    captchaType: math
-
+    captchaType: char
 # 数据源配置
 spring:
     datasource:
@@ -25,16 +24,16 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://127.0.0.1:3306/qianshan_credit_interests?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://127.0.0.1:3306/qianshan_nucleic_contrast?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
                 password: zhaoshang@2018
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭
                 enabled: true
-                    url: jdbc:mysql://60.171.171.235:3386/qss_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
-                    username: qss_db
-                    password: S6u269%6
+                url: jdbc:mysql://60.171.171.235:3386/qss_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
+                username: qss_db
+                password: S6u269%6
             # 初始连接数
             initialSize: 5
             # 最小连接池数量
@@ -83,7 +82,7 @@ spring:
         # 数据库索引
         database: 9
         # 密码
-        password: 3r263Tr$
+        password: D3fQYAsw
         # 连接超时时间
         timeout: 10s
         lettuce:

+ 1 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -30,6 +30,7 @@ spring:
     basename: i18n/messages
   profiles:
     active: druid
+    #active: prod
   # 文件上传
   servlet:
     multipart:

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IUserInfoService.java

@@ -1,6 +1,8 @@
 package com.ruoyi.system.service;
 
 import java.util.List;
+
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.system.domain.UserInfo;
 
 /**
@@ -60,4 +62,6 @@ public interface IUserInfoService
     public int deleteUserInfoById(Long id);
 
     String importUser(List<UserInfo> userList, String jobStyle, String focusCrowdStyle, String detectionNumber, String detectionScope, String startTime, String endTime) throws Exception;
+
+    AjaxResult oneDate(UserInfo userInfo);
 }

+ 134 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserInfoServiceImpl.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
 import com.alibaba.fastjson2.TypeReference;
 import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.enums.DataSourceType;
 import com.ruoyi.common.utils.DateUtils;
@@ -312,5 +313,138 @@ public class UserInfoServiceImpl implements IUserInfoService {
         return "操作成功";
     }
 
+    @Override
+    public AjaxResult oneDate(UserInfo userInfo) {
+        if(StringUtils.isEmpty(userInfo.getIdCard())){
+            return AjaxResult.error("请填写身份证号");
+        }
+        if(StringUtils.isEmpty(userInfo.getStartTime()) || StringUtils.isEmpty(userInfo.getEndTime()) ||
+                StringUtils.isEmpty(userInfo.getDetectionScope()) || StringUtils.isEmpty(userInfo.getDetectionNumber())  ){
+            return AjaxResult.error("请将参数填写完整后查询");
+        }
+
+        String startTime = userInfo.getStartTime();
+        String endTime = userInfo.getEndTime();
+        String detectionScope = userInfo.getDetectionScope();
+        String detectionNumber = userInfo.getDetectionNumber();
+
+        List<String> idCardList = new ArrayList<>();
+        idCardList.add(userInfo.getIdCard());
+        //从第三方数据库查询人员核酸计录
+        List<OdsQssHsjcxx> OdsQssHsjcxxList = qdsQssHsjcxxService.thirdNucleicAcid(userInfo.getStartTime(), userInfo.getEndTime(), idCardList);
+        if(OdsQssHsjcxxList==null || OdsQssHsjcxxList.size()<=0){
+            return AjaxResult.success("暂无数据");
+        }
+
+        userInfo.setName(OdsQssHsjcxxList.get(0).getXm());
+        userInfo.setPhoneNum(OdsQssHsjcxxList.get(0).getSjhm());
+        userInfo.setDetectionFrequency(detectionNumber + "/" + detectionScope);
+
+        int index = 0;
+        int res1 = 0;
+        int res2 = 0;
+        String date = null;
+
+        //采集地点
+        StringBuilder collectPlace = new StringBuilder();
+        //核酸采集时间
+        StringBuilder nucleicCollectTime = new StringBuilder();
+        //核酸结果时间
+        StringBuilder nucleicResultsTime = new StringBuilder();
+
+        //判断结果是否合格,默认合格
+        Boolean bl = true;
+        //创建一个死循环
+        for (int i = 2; i > 1; i++) {
+            //计算开始时间加上检测频次(时间范围)后的时间
+            date = DateUtils.getAddDate(startTime, Integer.parseInt(detectionScope));
+            int res = endTime.compareTo(date);//res>0(endTime>date),res=0(endTime=date),res<0(endTime<date)
+            if (res > 0) {
+                index = 0;
+                for (OdsQssHsjcxx odsQssHsjcxx : OdsQssHsjcxxList) {
+                    //判断 核酸采集时间是不是在 startTime和date之间
+                    res1 = odsQssHsjcxx.getCjsj().compareTo(startTime);
+                    res2 = date.compareTo(odsQssHsjcxx.getCjsj());
+                    if (userInfo.getIdCard().equals(odsQssHsjcxx.getSfzhm()) && res1 >= 0 && res2 >= 0) {
+
+                        if (StringUtils.isNotEmpty(collectPlace.toString())) {
+                            collectPlace.append("/");
+                        }
+                        collectPlace.append(odsQssHsjcxx.getJcdd());
+
+                        if (StringUtils.isNotEmpty(nucleicCollectTime.toString())) {
+                            nucleicCollectTime.append("/");
+                        }
+                        nucleicCollectTime.append(odsQssHsjcxx.getCjsj());
+
+                        if (StringUtils.isNotEmpty(nucleicResultsTime.toString())) {
+                            nucleicResultsTime.append("/");
+                        }
+                        nucleicResultsTime.append(odsQssHsjcxx.getJgcjss());
+
+                        index++;
+                        //当index与detectionNumber相等时,满足条件,跳出当前循环
+                        if (index == Integer.parseInt(detectionNumber)) {
+                            startTime = date;
+                            break;
+                        }
+                    }
+                }
+                if (index < Integer.parseInt(detectionNumber)) {
+                    bl = false;
+                }
+            } else {
+                index = 0;
+                for (OdsQssHsjcxx odsQssHsjcxx : OdsQssHsjcxxList) {
+                    //判断 核酸采集时间是不是在 startTime和date之间
+                    res1 = odsQssHsjcxx.getCjsj().compareTo(startTime);
+                    res2 = date.compareTo(odsQssHsjcxx.getCjsj());
+                    if (userInfo.getIdCard().equals(odsQssHsjcxx.getSfzhm()) && res1 >= 0 && res2 >= 0) {
+
+                        if (StringUtils.isNotEmpty(collectPlace.toString())) {
+                            collectPlace.append("/");
+                        }
+                        collectPlace.append(odsQssHsjcxx.getJcdd());
+
+                        if (StringUtils.isNotEmpty(nucleicCollectTime.toString())) {
+                            nucleicCollectTime.append("/");
+                        }
+                        nucleicCollectTime.append(odsQssHsjcxx.getCjsj());
+
+                        if (StringUtils.isNotEmpty(nucleicResultsTime.toString())) {
+                            nucleicResultsTime.append("/");
+                        }
+                        nucleicResultsTime.append(odsQssHsjcxx.getJgcjss());
+
+                        index++;
+                        //当index与detectionNumber相等时,满足条件,跳出当前循环
+                        if (index == Integer.parseInt(detectionNumber)) {
+                            //跳出死循环
+                            i = -1;
+                            break;
+                        }
+                    }
+                }
+                if (index < Integer.parseInt(detectionNumber)) {
+                    bl = false;
+                    //跳出死循环
+                    i = -1;
+                }
+            }
+        }
+        userInfo.setCollectPlace(collectPlace.toString());
+        userInfo.setNucleicCollectTime(nucleicCollectTime.toString());
+        userInfo.setNucleicResultsTime(nucleicResultsTime.toString());
+        if (bl) {
+            userInfo.setDetectionResult("正常");
+        } else {
+            userInfo.setDetectionResult("异常");
+        }
+        List<UserInfo> userList = new ArrayList<>();
+
+        userList.add(userInfo);
+        return AjaxResult.success("操作成功",userList);
+    }
+
 
 }

+ 1 - 1
ruoyi-system/src/main/resources/mapper/system/UserInfoMapper.xml

@@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
             <if test="startTime != null  and startTime != ''"> and start_time = #{startTime}</if>
             <if test="endTime != null  and endTime != ''"> and #{endTime} = end_time</if>
-
+            <if test="detectionResult != null  and detectionResult != ''"> and #{detectionResult} = detection_result</if>
         </where>
     </select>