|
@@ -1,5 +1,13 @@
|
|
|
package com.zd.laboratory.service.impl;
|
|
package com.zd.laboratory.service.impl;
|
|
|
|
|
|
|
|
|
|
+import com.zd.common.core.utils.StringUtils;
|
|
|
|
|
+import com.zd.exam.api.feign.RemoteExamService;
|
|
|
|
|
+import com.zd.laboratory.domain.*;
|
|
|
|
|
+import com.zd.laboratory.domain.vo.ElPassConfigdetailVO;
|
|
|
|
|
+import com.zd.laboratory.domain.vo.ViolationNewVo;
|
|
|
|
|
+import com.zd.laboratory.mapper.LabNegativeListRecordsMapper;
|
|
|
|
|
+import com.zd.laboratory.mapper.LabViolationScoreSiteMapper;
|
|
|
|
|
+import com.zd.laboratory.service.ILabBlacklistService;
|
|
|
import com.zd.model.constant.SecurityConstants;
|
|
import com.zd.model.constant.SecurityConstants;
|
|
|
import com.zd.model.domain.R;
|
|
import com.zd.model.domain.R;
|
|
|
import com.zd.model.domain.ResultData;
|
|
import com.zd.model.domain.ResultData;
|
|
@@ -9,8 +17,6 @@ import com.zd.common.core.utils.DateUtils;
|
|
|
import com.zd.common.core.utils.SecurityUtils;
|
|
import com.zd.common.core.utils.SecurityUtils;
|
|
|
import com.zd.common.core.annotation.DataScope;
|
|
import com.zd.common.core.annotation.DataScope;
|
|
|
import com.zd.common.core.security.TokenService;
|
|
import com.zd.common.core.security.TokenService;
|
|
|
-import com.zd.laboratory.domain.LabOnepc;
|
|
|
|
|
-import com.zd.laboratory.domain.LabSubjectAccessRecord;
|
|
|
|
|
import com.zd.laboratory.domain.vo.LabSubjectAccessRecordVo;
|
|
import com.zd.laboratory.domain.vo.LabSubjectAccessRecordVo;
|
|
|
import com.zd.laboratory.mapper.LabSubjectAccessRecordMapper;
|
|
import com.zd.laboratory.mapper.LabSubjectAccessRecordMapper;
|
|
|
import com.zd.laboratory.mapper.LabViolationMapper;
|
|
import com.zd.laboratory.mapper.LabViolationMapper;
|
|
@@ -25,10 +31,7 @@ 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;
|
|
|
|
|
|
|
|
-import java.util.Date;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
-import java.util.Optional;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 实验室进出记录Service业务层处理
|
|
* 实验室进出记录Service业务层处理
|
|
@@ -57,6 +60,21 @@ public class LabSubjectAccessRecordServiceImpl implements ILabSubjectAccessRecor
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RemoteUserService userService;
|
|
private RemoteUserService userService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private LabViolationScoreSiteMapper scoreSiteMapper;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RemoteExamService remoteExamService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private LabNegativeListRecordsMapper negativeListRecordsMapper;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private LabViolationServiceImpl labViolationServiceImpl;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ILabBlacklistService blacklistService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询实验室进出记录
|
|
* 查询实验室进出记录
|
|
|
*
|
|
*
|
|
@@ -215,11 +233,103 @@ public class LabSubjectAccessRecordServiceImpl implements ILabSubjectAccessRecor
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public int outTimeRecord() {
|
|
public int outTimeRecord() {
|
|
|
- labSubjectAccessRecordMapper.outTimeRecord();
|
|
|
|
|
- int i = labSubjectAccessRecordMapper.outTimeChangeStatus();
|
|
|
|
|
- if(i>0)
|
|
|
|
|
|
|
+ //查询超过24小时违规人员列表
|
|
|
|
|
+ List<LabSubjectAccessRecordVo> subAccessRecordList = labSubjectAccessRecordMapper.selOutTimeRecord();
|
|
|
|
|
+
|
|
|
|
|
+// labSubjectAccessRecordMapper.outTimeRecord();
|
|
|
|
|
+ int i = 0;
|
|
|
|
|
+ if(subAccessRecordList.size()>0)
|
|
|
{
|
|
{
|
|
|
|
|
+ List<LabViolationScoreSite> scoreSiteList = scoreSiteMapper.selectLabViolationScore();
|
|
|
|
|
+ Map<String,String> allMapScore = new HashMap <>();
|
|
|
|
|
+ Optional.ofNullable(scoreSiteList).orElseGet(Collections::emptyList)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .forEach(a->{
|
|
|
|
|
+ allMapScore.put(a.getViolationName(),a.getViolationVal());
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ Optional.ofNullable(subAccessRecordList).orElseGet(Collections::emptyList)
|
|
|
|
|
+ .parallelStream()
|
|
|
|
|
+ .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);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ labViolationServiceImpl.addViolationHistory(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// Map map = new HashMap();
|
|
|
|
|
+// map.put("joinUserId", a.getJoinUserId());
|
|
|
|
|
+// if (allMapScore.get(a.getViolationName())!=null) {
|
|
|
|
|
+// map.put("deductPoints", allMapScore.get(a.getViolationName()));
|
|
|
|
|
+// } else {
|
|
|
|
|
+// map.put("deductPoints", 0);
|
|
|
|
|
+// }
|
|
|
|
|
+// map.put("pointsType", "1");
|
|
|
|
|
+// map.put("reason", a.getViolationName());
|
|
|
|
|
+// remoteExamService.deductionPoints(map);
|
|
|
|
|
+//
|
|
|
|
|
+// LabNegativeListRecords records = negativeListRecordsMapper.findByUserId(a.getJoinUserId());
|
|
|
|
|
+// Integer score = 0;
|
|
|
|
|
+// LabNegativelistHistory history = labViolationServiceImpl.CovertHistory(vo);
|
|
|
|
|
+ });
|
|
|
subMessageSendManager.SendBigViewUpdate(BigViewDataType.SUB_ONLINE);
|
|
subMessageSendManager.SendBigViewUpdate(BigViewDataType.SUB_ONLINE);
|
|
|
|
|
+ i = labSubjectAccessRecordMapper.outTimeChangeStatus();
|
|
|
}
|
|
}
|
|
|
return i;
|
|
return i;
|
|
|
}
|
|
}
|