|
@@ -1,5 +1,6 @@
|
|
|
package com.zd.laboratory.service.impl;
|
|
package com.zd.laboratory.service.impl;
|
|
|
|
|
|
|
|
|
|
+import com.zd.algorithm.api.smartlock.feign.fallback.RemoteSmartlockFallbackFactory;
|
|
|
import com.zd.common.core.utils.StringUtils;
|
|
import com.zd.common.core.utils.StringUtils;
|
|
|
import com.zd.exam.api.feign.RemoteExamService;
|
|
import com.zd.exam.api.feign.RemoteExamService;
|
|
|
import com.zd.laboratory.domain.*;
|
|
import com.zd.laboratory.domain.*;
|
|
@@ -27,6 +28,8 @@ import com.zd.laboratory.service.ILabPhotoInspectionService;
|
|
|
import com.zd.laboratory.service.ILabSubjectAccessRecordService;
|
|
import com.zd.laboratory.service.ILabSubjectAccessRecordService;
|
|
|
import com.zd.system.api.feign.RemoteUserService;
|
|
import com.zd.system.api.feign.RemoteUserService;
|
|
|
import com.zd.model.entity.SysUser;
|
|
import com.zd.model.entity.SysUser;
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -75,6 +78,8 @@ public class LabSubjectAccessRecordServiceImpl implements ILabSubjectAccessRecor
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ILabBlacklistService blacklistService;
|
|
private ILabBlacklistService blacklistService;
|
|
|
|
|
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(LabSubjectAccessRecordServiceImpl.class);
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询实验室进出记录
|
|
* 查询实验室进出记录
|
|
|
*
|
|
*
|
|
@@ -254,63 +259,66 @@ public class LabSubjectAccessRecordServiceImpl implements ILabSubjectAccessRecor
|
|
|
Optional.ofNullable(subAccessRecordList).orElseGet(Collections::emptyList)
|
|
Optional.ofNullable(subAccessRecordList).orElseGet(Collections::emptyList)
|
|
|
.parallelStream()
|
|
.parallelStream()
|
|
|
.forEach(a->{
|
|
.forEach(a->{
|
|
|
- //校验规则
|
|
|
|
|
- Map<String, Object> p = new HashMap<>();
|
|
|
|
|
- p.put("userId", a.getJoinUserId());
|
|
|
|
|
- R<Object> r = remoteExamService.findByUserId(p);
|
|
|
|
|
- List<Map> list = (List<Map>) r.getData();
|
|
|
|
|
- if (list != null && list.size() > 0) {
|
|
|
|
|
- Integer creditScore = Integer.valueOf(list.get(0).get("creditScore").toString())-Integer.parseInt(allMapScore.get(a.getViolationName()));
|
|
|
|
|
- //这里查询积分规则详情数据
|
|
|
|
|
- Map<String,Object> markconfigMap = new HashMap<>();
|
|
|
|
|
- R<Object> data = remoteExamService.getPointsConfig(markconfigMap);
|
|
|
|
|
- int flag=0;
|
|
|
|
|
- if (data!=null) {
|
|
|
|
|
- String code = data.getCode() + "";
|
|
|
|
|
- if (code.equals("200")) {
|
|
|
|
|
- Map<String, Object> pointsConfig = (Map<String, Object>) data.getData();
|
|
|
|
|
- //获取积分详情列表
|
|
|
|
|
- List<Map<String, Object>> pointsConfigDetail = (List<Map<String, Object>>) pointsConfig.get("configDetailList");
|
|
|
|
|
- ElPassConfigdetailVO result = blacklistService.getIntegralMatchingRules(pointsConfigDetail,Integer.valueOf(creditScore));
|
|
|
|
|
-
|
|
|
|
|
- ViolationNewVo vo = new ViolationNewVo();
|
|
|
|
|
- vo.setUserId(a.getJoinUserId());
|
|
|
|
|
- vo.setDeptId(a.getDeptId());
|
|
|
|
|
- vo.setCreact_id(-2L);
|
|
|
|
|
- vo.setReason("-1");
|
|
|
|
|
- vo.setViolationReasons(a.getViolationName());
|
|
|
|
|
- vo.setDeductionVal(Long.parseLong(allMapScore.get(a.getViolationName())));
|
|
|
|
|
- vo.setCreditScore(Long.parseLong(allMapScore.get(a.getViolationName())));
|
|
|
|
|
-
|
|
|
|
|
- vo.setLaboratoryId(a.getSubjectId());
|
|
|
|
|
- vo.setLaboratoryName(a.getSubjectName());
|
|
|
|
|
- vo.setUserName(a.getNickName());
|
|
|
|
|
- if(StringUtils.isNotNull(result)){
|
|
|
|
|
- vo.setWarningStatus(result.getWarningStatus());
|
|
|
|
|
- vo.setInterviewStatus(result.getInterviewStatus());
|
|
|
|
|
- vo.setTestStatus(result.getTestStatus());
|
|
|
|
|
- vo.setLearnStatus(result.getLearnStatus());
|
|
|
|
|
- vo.setPracticeStatus(result.getPracticeStatus());
|
|
|
|
|
- vo.setHandleDay(result.getHandleDay());
|
|
|
|
|
- vo.setTreatmentMessage(a.getViolationName());
|
|
|
|
|
- vo.setLearnHour(result.getLearnHour());
|
|
|
|
|
- vo.setLearnMinute(result.getLearnMinute());
|
|
|
|
|
- if(StringUtils.isNotNull(result.getNumberTopics())){
|
|
|
|
|
- vo.setNumberTopics(Integer.parseInt(result.getNumberTopics()+""));
|
|
|
|
|
- }else{
|
|
|
|
|
- vo.setNumberTopics(null);
|
|
|
|
|
- }
|
|
|
|
|
- if(StringUtils.isNotNull(result.getNumberAccuracy())){
|
|
|
|
|
- vo.setNumberAccuracy(Integer.parseInt(result.getNumberAccuracy()+""));
|
|
|
|
|
- }else{
|
|
|
|
|
- vo.setNumberAccuracy(null);
|
|
|
|
|
|
|
+ try{
|
|
|
|
|
+ //校验规则
|
|
|
|
|
+ Map<String, Object> p = new HashMap<>();
|
|
|
|
|
+ p.put("userId", a.getJoinUserId());
|
|
|
|
|
+ R<Object> r = remoteExamService.findByUserId(p);
|
|
|
|
|
+ List<Map> list = (List<Map>) r.getData();
|
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
|
+ Integer creditScore = Integer.valueOf(list.get(0).get("creditScore").toString())-Integer.parseInt(allMapScore.get(a.getViolationName()));
|
|
|
|
|
+ //这里查询积分规则详情数据
|
|
|
|
|
+ Map<String,Object> markconfigMap = new HashMap<>();
|
|
|
|
|
+ R<Object> data = remoteExamService.getPointsConfig(markconfigMap);
|
|
|
|
|
+ int flag=0;
|
|
|
|
|
+ if (data!=null) {
|
|
|
|
|
+ String code = data.getCode() + "";
|
|
|
|
|
+ if (code.equals("200")) {
|
|
|
|
|
+ Map<String, Object> pointsConfig = (Map<String, Object>) data.getData();
|
|
|
|
|
+ //获取积分详情列表
|
|
|
|
|
+ List<Map<String, Object>> pointsConfigDetail = (List<Map<String, Object>>) pointsConfig.get("configDetailList");
|
|
|
|
|
+ ElPassConfigdetailVO result = blacklistService.getIntegralMatchingRules(pointsConfigDetail,Integer.valueOf(creditScore));
|
|
|
|
|
+
|
|
|
|
|
+ ViolationNewVo vo = new ViolationNewVo();
|
|
|
|
|
+ vo.setUserId(a.getJoinUserId());
|
|
|
|
|
+ vo.setDeptId(a.getDeptId());
|
|
|
|
|
+ vo.setCreact_id(-2L);
|
|
|
|
|
+ vo.setReason("-1");
|
|
|
|
|
+ vo.setViolationReasons(a.getViolationName());
|
|
|
|
|
+ vo.setDeductionVal(Long.parseLong(allMapScore.get(a.getViolationName())));
|
|
|
|
|
+ vo.setCreditScore(Long.parseLong(allMapScore.get(a.getViolationName())));
|
|
|
|
|
+
|
|
|
|
|
+ vo.setLaboratoryId(a.getSubjectId());
|
|
|
|
|
+ vo.setLaboratoryName(a.getSubjectName());
|
|
|
|
|
+ vo.setUserName(a.getNickName());
|
|
|
|
|
+ if(StringUtils.isNotNull(result)){
|
|
|
|
|
+ vo.setWarningStatus(result.getWarningStatus());
|
|
|
|
|
+ vo.setInterviewStatus(result.getInterviewStatus());
|
|
|
|
|
+ vo.setTestStatus(result.getTestStatus());
|
|
|
|
|
+ vo.setLearnStatus(result.getLearnStatus());
|
|
|
|
|
+ vo.setPracticeStatus(result.getPracticeStatus());
|
|
|
|
|
+ vo.setHandleDay(result.getHandleDay());
|
|
|
|
|
+ vo.setTreatmentMessage(a.getViolationName());
|
|
|
|
|
+ vo.setLearnHour(result.getLearnHour());
|
|
|
|
|
+ vo.setLearnMinute(result.getLearnMinute());
|
|
|
|
|
+ if(StringUtils.isNotNull(result.getNumberTopics())){
|
|
|
|
|
+ vo.setNumberTopics(Integer.parseInt(result.getNumberTopics()+""));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ vo.setNumberTopics(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(StringUtils.isNotNull(result.getNumberAccuracy())){
|
|
|
|
|
+ vo.setNumberAccuracy(Integer.parseInt(result.getNumberAccuracy()+""));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ vo.setNumberAccuracy(null);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ labViolationServiceImpl.addViolationHistory(vo);
|
|
|
}
|
|
}
|
|
|
- labViolationServiceImpl.addViolationHistory(vo);
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ log.error("执行违规失败"+e);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|