|
@@ -135,7 +135,7 @@ public class UserInfoServiceImpl implements IUserInfoService {
|
|
|
public String importUser(List<UserInfo> userList, String jobStyle, String focusCrowdStyle, String detectionNumber,
|
|
|
String detectionScope, String startTime, String endTime) throws Exception {
|
|
|
|
|
|
- if(userList == null){
|
|
|
+ if (userList == null) {
|
|
|
return "表格格式错误,请按照表格模板格式上传人员名单";
|
|
|
}
|
|
|
|
|
@@ -144,19 +144,26 @@ public class UserInfoServiceImpl implements IUserInfoService {
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
for (UserInfo userInfo : userList) {
|
|
|
- if(userInfo == null){
|
|
|
+ if (userInfo == null) {
|
|
|
return "表格格式错误,请按照表格模板格式上传人员名单";
|
|
|
}
|
|
|
|
|
|
- if(userInfo.getIdCard().length()!=18){
|
|
|
+ if (userInfo.getIdCard().length() != 18) {
|
|
|
sb.append(userInfo.getName()).append(",");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(StringUtils.isNotEmpty(sb.toString())){
|
|
|
- return "操作失败,以下人员身份证格式错误【"+sb.toString()+"】";
|
|
|
+ if (StringUtils.isNotEmpty(sb.toString())) {
|
|
|
+ return "操作失败,以下人员身份证格式错误【" + sb.toString() + "】";
|
|
|
}
|
|
|
|
|
|
+ //计算开始时间结束时间相隔天数
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Date date1 = simpleDateFormat.parse(startTime);
|
|
|
+ Date date2 = simpleDateFormat.parse(endTime);
|
|
|
+ detectionScope = String.valueOf(DateUtils.differentDaysByMillisecond(date1, date2));
|
|
|
+
|
|
|
+
|
|
|
//todo 获取当前上传人员部门id
|
|
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
|
String deptId = String.valueOf(user.getDeptId());
|
|
@@ -171,9 +178,6 @@ public class UserInfoServiceImpl implements IUserInfoService {
|
|
|
List<UserNucleicTime> UserNucleicTimeList = new ArrayList<>();
|
|
|
|
|
|
int index = 0;
|
|
|
- int res1 = 0;
|
|
|
- int res2 = 0;
|
|
|
- String date = null;
|
|
|
for (UserInfo userInfo : userList) {
|
|
|
|
|
|
userInfo.setDeptId(deptId);
|
|
@@ -195,87 +199,40 @@ public class UserInfoServiceImpl implements IUserInfoService {
|
|
|
userInfo.setUpdateBy(user.getUserName());
|
|
|
//判断结果是否合格,默认合格
|
|
|
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;
|
|
|
+
|
|
|
+ index = 0;
|
|
|
+ for (OdsQssHsjcxx odsQssHsjcxx : OdsQssHsjcxxList) {
|
|
|
+ //判断 核酸采集时间是不是在 startTime和date之间
|
|
|
+ if (userInfo.getIdCard().equals(odsQssHsjcxx.getSfzhm())) {
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(collectPlace.toString())) {
|
|
|
+ collectPlace.append("/");
|
|
|
}
|
|
|
- } 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;
|
|
|
- }
|
|
|
- }
|
|
|
+ collectPlace.append(odsQssHsjcxx.getJcdd());
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(nucleicCollectTime.toString())) {
|
|
|
+ nucleicCollectTime.append("/");
|
|
|
}
|
|
|
- if (index < Integer.parseInt(detectionNumber)) {
|
|
|
- bl = false;
|
|
|
- //跳出死循环
|
|
|
- i = -1;
|
|
|
+ nucleicCollectTime.append(odsQssHsjcxx.getCjsj());
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(nucleicResultsTime.toString())) {
|
|
|
+ nucleicResultsTime.append("/");
|
|
|
}
|
|
|
+ nucleicResultsTime.append(odsQssHsjcxx.getJgcjss());
|
|
|
+
|
|
|
+ index++;
|
|
|
}
|
|
|
}
|
|
|
+ if (index < Integer.parseInt(detectionNumber)) {
|
|
|
+ bl = false;
|
|
|
+ }
|
|
|
+
|
|
|
userInfo.setCollectPlace(collectPlace.toString());
|
|
|
userInfo.setNucleicCollectTime(nucleicCollectTime.toString());
|
|
|
userInfo.setNucleicResultsTime(nucleicResultsTime.toString());
|
|
|
+ userInfo.setDetectionProgress(index + "/" + detectionNumber);
|
|
|
+
|
|
|
+
|
|
|
if (bl) {
|
|
|
userInfo.setDetectionResult("正常");
|
|
|
} else {
|
|
@@ -314,25 +271,34 @@ public class UserInfoServiceImpl implements IUserInfoService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AjaxResult oneDate(UserInfo userInfo) {
|
|
|
- if(StringUtils.isEmpty(userInfo.getIdCard())){
|
|
|
+ public AjaxResult oneDate(UserInfo userInfo) throws Exception {
|
|
|
+ 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()) ){
|
|
|
+ if (StringUtils.isEmpty(userInfo.getStartTime()) || StringUtils.isEmpty(userInfo.getEndTime()) ||
|
|
|
+ StringUtils.isEmpty(userInfo.getDetectionNumber())) {
|
|
|
return AjaxResult.error("请将参数填写完整后查询");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
String startTime = userInfo.getStartTime();
|
|
|
String endTime = userInfo.getEndTime();
|
|
|
- String detectionScope = userInfo.getDetectionScope();
|
|
|
String detectionNumber = userInfo.getDetectionNumber();
|
|
|
|
|
|
+
|
|
|
+ //计算开始时间结束时间相隔天数
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Date date1 = simpleDateFormat.parse(startTime);
|
|
|
+ Date date2 = simpleDateFormat.parse(endTime);
|
|
|
+ String detectionScope = String.valueOf(DateUtils.differentDaysByMillisecond(date1, date2));
|
|
|
+ userInfo.setDetectionScope(detectionScope);
|
|
|
+
|
|
|
+
|
|
|
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){
|
|
|
+ if (OdsQssHsjcxxList == null || OdsQssHsjcxxList.size() <= 0) {
|
|
|
return AjaxResult.success("暂无数据");
|
|
|
}
|
|
|
|
|
@@ -341,9 +307,6 @@ public class UserInfoServiceImpl implements IUserInfoService {
|
|
|
userInfo.setDetectionFrequency(detectionNumber + "/" + detectionScope);
|
|
|
|
|
|
int index = 0;
|
|
|
- int res1 = 0;
|
|
|
- int res2 = 0;
|
|
|
- String date = null;
|
|
|
|
|
|
//采集地点
|
|
|
StringBuilder collectPlace = new StringBuilder();
|
|
@@ -354,87 +317,38 @@ public class UserInfoServiceImpl implements IUserInfoService {
|
|
|
|
|
|
//判断结果是否合格,默认合格
|
|
|
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;
|
|
|
+
|
|
|
+
|
|
|
+ index = 0;
|
|
|
+ for (OdsQssHsjcxx odsQssHsjcxx : OdsQssHsjcxxList) {
|
|
|
+ //判断 核酸采集时间是不是在 startTime和date之间
|
|
|
+ if (userInfo.getIdCard().equals(odsQssHsjcxx.getSfzhm())) {
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(collectPlace.toString())) {
|
|
|
+ collectPlace.append("/");
|
|
|
}
|
|
|
- } 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;
|
|
|
- }
|
|
|
- }
|
|
|
+ collectPlace.append(odsQssHsjcxx.getJcdd());
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(nucleicCollectTime.toString())) {
|
|
|
+ nucleicCollectTime.append("/");
|
|
|
}
|
|
|
- if (index < Integer.parseInt(detectionNumber)) {
|
|
|
- bl = false;
|
|
|
- //跳出死循环
|
|
|
- i = -1;
|
|
|
+ nucleicCollectTime.append(odsQssHsjcxx.getCjsj());
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(nucleicResultsTime.toString())) {
|
|
|
+ nucleicResultsTime.append("/");
|
|
|
}
|
|
|
+ nucleicResultsTime.append(odsQssHsjcxx.getJgcjss());
|
|
|
+
|
|
|
+ index++;
|
|
|
}
|
|
|
}
|
|
|
+ if (index < Integer.parseInt(detectionNumber)) {
|
|
|
+ bl = false;
|
|
|
+ }
|
|
|
userInfo.setCollectPlace(collectPlace.toString());
|
|
|
userInfo.setNucleicCollectTime(nucleicCollectTime.toString());
|
|
|
userInfo.setNucleicResultsTime(nucleicResultsTime.toString());
|
|
|
+ userInfo.setDetectionProgress(index + "/" + detectionNumber);
|
|
|
if (bl) {
|
|
|
userInfo.setDetectionResult("正常");
|
|
|
} else {
|
|
@@ -443,7 +357,7 @@ public class UserInfoServiceImpl implements IUserInfoService {
|
|
|
List<UserInfo> userList = new ArrayList<>();
|
|
|
|
|
|
userList.add(userInfo);
|
|
|
- return AjaxResult.success("操作成功",userList);
|
|
|
+ return AjaxResult.success("操作成功", userList);
|
|
|
}
|
|
|
|
|
|
|