|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONArray;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.TypeReference;
|
|
import com.alibaba.fastjson2.TypeReference;
|
|
import com.ruoyi.common.annotation.DataSource;
|
|
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.core.domain.entity.SysUser;
|
|
import com.ruoyi.common.enums.DataSourceType;
|
|
import com.ruoyi.common.enums.DataSourceType;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
@@ -312,5 +313,138 @@ public class UserInfoServiceImpl implements IUserInfoService {
|
|
return "操作成功";
|
|
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);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|