|
|
@@ -5,7 +5,7 @@ import com.zd.common.core.security.TokenService;
|
|
|
import com.zd.common.core.utils.DateUtils;
|
|
|
import com.zd.common.core.utils.DictUtils;
|
|
|
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.api.entity.LabMessageContent;
|
|
|
import com.zd.laboratory.domain.*;
|
|
|
import com.zd.laboratory.domain.dto.LabBlacklistDTO;
|
|
|
@@ -15,7 +15,7 @@ import com.zd.laboratory.mapper.*;
|
|
|
import com.zd.laboratory.service.ILabBlacklistService;
|
|
|
import com.zd.laboratory.service.ILabViolationService;
|
|
|
import com.zd.laboratory.service.ILabViolationSiteService;
|
|
|
-import com.zd.model.domain.R;
|
|
|
+//import com.zd.model.domain.R;
|
|
|
import com.zd.model.domain.ResultData;
|
|
|
import com.zd.model.domain.per.PerPrefix;
|
|
|
import com.zd.system.api.entity.SysDictData;
|
|
|
@@ -48,8 +48,8 @@ public class LabViolationServiceImpl implements ILabViolationService {
|
|
|
@Autowired
|
|
|
private ILabBlacklistService labBlacklistService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private RemoteExamService remoteExamService;
|
|
|
+// @Autowired
|
|
|
+// private RemoteExamService remoteExamService;
|
|
|
|
|
|
@Autowired
|
|
|
private LabMessageContentMapper labMessageContentMapper;
|
|
|
@@ -387,250 +387,250 @@ public class LabViolationServiceImpl implements ILabViolationService {
|
|
|
*/
|
|
|
@Override
|
|
|
public ResultData addViolationHistory(ViolationNewVo vo) {
|
|
|
- if (vo.getUserId() == null) {
|
|
|
- return ResultData.fail("用户id不能为空");
|
|
|
- }
|
|
|
- if (vo.getDeptId() == null) {
|
|
|
- return ResultData.fail("关联学院不能为空");
|
|
|
- }
|
|
|
- Boolean b = this.checkDeptId(vo.getDeptId());
|
|
|
- if (!b) {
|
|
|
- return ResultData.fail("该人员所属学院学院未找到");
|
|
|
- }
|
|
|
- //校验规则
|
|
|
- Map<String, Object> p = new HashMap<>();
|
|
|
- p.put("userId", vo.getUserId());
|
|
|
- R<Object> r = remoteExamService.findByUserId(p);
|
|
|
- List<Map> list = (List<Map>) r.getData();
|
|
|
- Integer creditScore = 0;
|
|
|
- if (list != null && !list.isEmpty()) {
|
|
|
- creditScore = Integer.valueOf(list.get(0).get("creditScore").toString());
|
|
|
- }
|
|
|
- if (r.getData() == null || ((List) r.getData()).isEmpty()) {
|
|
|
- return ResultData.fail("没有实验室安全准入资格");
|
|
|
- }
|
|
|
-
|
|
|
- LabViolationScoreSite scoreSite = scoreSiteMapper.selectLabViolationScoreSiteById(Long.valueOf(vo.getReason()));
|
|
|
- Map map = new HashMap();
|
|
|
- map.put("joinUserId", vo.getUserId());
|
|
|
- if (vo.getReason().equals("-1")) {
|
|
|
- map.put("deductPoints", vo.getDeductionVal());
|
|
|
- } else {
|
|
|
- map.put("deductPoints", scoreSite.getViolationVal());
|
|
|
- }
|
|
|
- map.put("pointsType", "1");
|
|
|
- if(StringUtils.isNotNull(vo.getTreatmentMessage())){
|
|
|
- map.put("reason", vo.getTreatmentMessage());
|
|
|
- }else{
|
|
|
- map.put("reason", "手动新增违规记录");
|
|
|
- }
|
|
|
-
|
|
|
- remoteExamService.deductionPoints(map);
|
|
|
- LabViolation labViolation = labViolationMapper.selectByUserId(vo.getUserId());
|
|
|
- LabNegativeListRecords records = negativeListRecordsMapper.findByUserId(vo.getUserId());
|
|
|
-
|
|
|
- Map<String, Object> mapscore = (Map<String, Object>) scoreData().getData();
|
|
|
- Integer hmdval = Integer.valueOf(mapscore.get("blackScore").toString());
|
|
|
- if (labViolation != null) {
|
|
|
-
|
|
|
- Integer score = 0;
|
|
|
- LabNegativelistHistory history = CovertHistory(vo);
|
|
|
- if (vo.getReason().equals("-1")) {
|
|
|
- score = creditScore - Integer.parseInt(vo.getDeductionVal() + "");
|
|
|
- history.setReason(vo.getViolationReasons());
|
|
|
- history.setDeductionVal(Long.valueOf(vo.getDeductionVal()));
|
|
|
- } else {
|
|
|
- score = creditScore - Integer.parseInt(scoreSite.getViolationVal());
|
|
|
- history.setReason(scoreSite.getViolationName());
|
|
|
- history.setDeductionVal(Long.valueOf(scoreSite.getViolationVal()));
|
|
|
- }
|
|
|
- history.setCreditScore(Long.valueOf(score));
|
|
|
- if (records == null) {
|
|
|
- LabNegativeListRecords records1 = new LabNegativeListRecords();
|
|
|
- records1.setUserId(vo.getUserId());
|
|
|
- records1.setJoinUserId(vo.getUserId());
|
|
|
- records1.setStatus("2");
|
|
|
- records1.setCeditScore(score);
|
|
|
- records1.setBlackListNum("0");
|
|
|
- records1.setIsNegative(1);
|
|
|
- records1.setCreact_id(vo.getCreact_id());
|
|
|
- records1.setCreateTime(new Date());
|
|
|
- negativeListRecordsMapper.insertLabNegativeListRecords(records1);
|
|
|
- history.setBlackId(records1.getId());
|
|
|
- } else {
|
|
|
- history.setBlackId(records.getId());
|
|
|
- }
|
|
|
-
|
|
|
- history.setCreateTime(new Date());
|
|
|
- if (tokenService.getLoginUser() != null) {
|
|
|
- history.setCreateBy(tokenService.getLoginUser().getNickName());
|
|
|
- } else {
|
|
|
- history.setCreateBy("系统");
|
|
|
- }
|
|
|
- negativelistHistoryMapper.insertLabNegativelistHistory(history);
|
|
|
-
|
|
|
-
|
|
|
- //对比进入负面清单的次数如果达到直接进入黑名单
|
|
|
- if (labViolation.getNegativeListNum() + 1 >= getCount()) {
|
|
|
- labViolation.setStatus(3);
|
|
|
- labViolation.setCreditScore(labViolation.getCreditScore());
|
|
|
- labViolationMapper.updateLabViolation(labViolation);
|
|
|
- comperAndExitsBlackList(vo.getUserId());
|
|
|
- return ResultData.success(200, "达到负面清单设定次数,直接加入黑名单成功");
|
|
|
- } else if (score <= hmdval) {//积分达到黑名单设定分值进入黑名单
|
|
|
- labViolation.setCreditScore(labViolation.getCreditScore());
|
|
|
- labViolation.setViolationNum(labViolation.getViolationNum() + 1);
|
|
|
- if (records != null) {
|
|
|
- labViolation.setBlackListNum(Long.valueOf(records.getBlackListNum()) + 1);
|
|
|
- }
|
|
|
- labViolation.setSubjectId(vo.getLaboratoryId());
|
|
|
- labViolation.setDeptName(vo.getDeptName());
|
|
|
- labViolation.setDeptId(vo.getDeptId());
|
|
|
- labViolation.setStatus(3);
|
|
|
- labViolation.setIsNegative(0);
|
|
|
- labViolation.setIsBlackList(1);
|
|
|
- labViolation.setCreact_id(vo.getCreact_id());
|
|
|
- labViolationMapper.updateLabViolation(labViolation);
|
|
|
-
|
|
|
- Integer passMark = Integer.valueOf(mapscore.get("passMark").toString());
|
|
|
- Integer newCreditScore = passMark - creditScore;
|
|
|
- violationBlack(vo.getUserId(), String.valueOf(newCreditScore), creditScore + "");
|
|
|
- return ResultData.success(200, "积分达到黑名单设定值,加入黑名单成功");
|
|
|
- } else {
|
|
|
- labViolation.setCreditScore(labViolation.getCreditScore());
|
|
|
- labViolation.setViolationNum(labViolation.getViolationNum() + 1);
|
|
|
- if (labViolation != null) {
|
|
|
- labViolation.setNegativeListNum(labViolation.getNegativeListNum() + 1);
|
|
|
- }
|
|
|
- labViolation.setSubjectId(vo.getLaboratoryId());
|
|
|
- labViolation.setDeptName(vo.getDeptName());
|
|
|
- labViolation.setDeptId(vo.getDeptId());
|
|
|
- labViolation.setStatus(2);
|
|
|
- labViolation.setIsNegative(1);
|
|
|
- labViolation.setCreact_id(vo.getCreact_id());
|
|
|
- labViolationMapper.updateLabViolation(labViolation);
|
|
|
- if (records != null) {
|
|
|
- records.setViolationNum(records.getViolationNum() + 1);
|
|
|
- Long num = Long.valueOf(records.getNegativeListNum()) + 1;
|
|
|
- records.setNegativeListNum(num + "");
|
|
|
- records.setDeptName(vo.getDeptName());
|
|
|
- records.setIsNegative(1);
|
|
|
- if (vo.getReason().equals("-1")) {
|
|
|
- records.setCeditScore(records.getCeditScore() - vo.getDeductionVal().intValue());
|
|
|
- } else {
|
|
|
- records.setCeditScore(records.getCeditScore() - Integer.parseInt(scoreSite.getViolationVal()));
|
|
|
- }
|
|
|
-
|
|
|
- records.setStatus("2");
|
|
|
- records.setCreact_id(vo.getCreact_id());
|
|
|
- negativeListRecordsMapper.updateLabNegativeListRecords(records);
|
|
|
- }
|
|
|
- }
|
|
|
+// if (vo.getUserId() == null) {
|
|
|
+// return ResultData.fail("用户id不能为空");
|
|
|
+// }
|
|
|
+// if (vo.getDeptId() == null) {
|
|
|
+// return ResultData.fail("关联学院不能为空");
|
|
|
+// }
|
|
|
+// Boolean b = this.checkDeptId(vo.getDeptId());
|
|
|
+// if (!b) {
|
|
|
+// return ResultData.fail("该人员所属学院学院未找到");
|
|
|
+// }
|
|
|
+// //校验规则
|
|
|
+// Map<String, Object> p = new HashMap<>();
|
|
|
+// p.put("userId", vo.getUserId());
|
|
|
+// R<Object> r = remoteExamService.findByUserId(p);
|
|
|
+// List<Map> list = (List<Map>) r.getData();
|
|
|
+// Integer creditScore = 0;
|
|
|
+// if (list != null && !list.isEmpty()) {
|
|
|
+// creditScore = Integer.valueOf(list.get(0).get("creditScore").toString());
|
|
|
+// }
|
|
|
+// if (r.getData() == null || ((List) r.getData()).isEmpty()) {
|
|
|
+// return ResultData.fail("没有实验室安全准入资格");
|
|
|
+// }
|
|
|
+//
|
|
|
+// LabViolationScoreSite scoreSite = scoreSiteMapper.selectLabViolationScoreSiteById(Long.valueOf(vo.getReason()));
|
|
|
+// Map map = new HashMap();
|
|
|
+// map.put("joinUserId", vo.getUserId());
|
|
|
+// if (vo.getReason().equals("-1")) {
|
|
|
+// map.put("deductPoints", vo.getDeductionVal());
|
|
|
+// } else {
|
|
|
+// map.put("deductPoints", scoreSite.getViolationVal());
|
|
|
+// }
|
|
|
+// map.put("pointsType", "1");
|
|
|
+// if(StringUtils.isNotNull(vo.getTreatmentMessage())){
|
|
|
+// map.put("reason", vo.getTreatmentMessage());
|
|
|
+// }else{
|
|
|
+// map.put("reason", "手动新增违规记录");
|
|
|
+// }
|
|
|
+//
|
|
|
+// remoteExamService.deductionPoints(map);
|
|
|
+// LabViolation labViolation = labViolationMapper.selectByUserId(vo.getUserId());
|
|
|
+// LabNegativeListRecords records = negativeListRecordsMapper.findByUserId(vo.getUserId());
|
|
|
+//
|
|
|
+// Map<String, Object> mapscore = (Map<String, Object>) scoreData().getData();
|
|
|
+// Integer hmdval = Integer.valueOf(mapscore.get("blackScore").toString());
|
|
|
+// if (labViolation != null) {
|
|
|
+//
|
|
|
+// Integer score = 0;
|
|
|
+// LabNegativelistHistory history = CovertHistory(vo);
|
|
|
+// if (vo.getReason().equals("-1")) {
|
|
|
+// score = creditScore - Integer.parseInt(vo.getDeductionVal() + "");
|
|
|
+// history.setReason(vo.getViolationReasons());
|
|
|
+// history.setDeductionVal(Long.valueOf(vo.getDeductionVal()));
|
|
|
+// } else {
|
|
|
+// score = creditScore - Integer.parseInt(scoreSite.getViolationVal());
|
|
|
+// history.setReason(scoreSite.getViolationName());
|
|
|
+// history.setDeductionVal(Long.valueOf(scoreSite.getViolationVal()));
|
|
|
+// }
|
|
|
+// history.setCreditScore(Long.valueOf(score));
|
|
|
+// if (records == null) {
|
|
|
+// LabNegativeListRecords records1 = new LabNegativeListRecords();
|
|
|
+// records1.setUserId(vo.getUserId());
|
|
|
+// records1.setJoinUserId(vo.getUserId());
|
|
|
+// records1.setStatus("2");
|
|
|
+// records1.setCeditScore(score);
|
|
|
+// records1.setBlackListNum("0");
|
|
|
+// records1.setIsNegative(1);
|
|
|
+// records1.setCreact_id(vo.getCreact_id());
|
|
|
+// records1.setCreateTime(new Date());
|
|
|
+// negativeListRecordsMapper.insertLabNegativeListRecords(records1);
|
|
|
+// history.setBlackId(records1.getId());
|
|
|
+// } else {
|
|
|
+// history.setBlackId(records.getId());
|
|
|
+// }
|
|
|
+//
|
|
|
+// history.setCreateTime(new Date());
|
|
|
+// if (tokenService.getLoginUser() != null) {
|
|
|
+// history.setCreateBy(tokenService.getLoginUser().getNickName());
|
|
|
+// } else {
|
|
|
+// history.setCreateBy("系统");
|
|
|
+// }
|
|
|
+// negativelistHistoryMapper.insertLabNegativelistHistory(history);
|
|
|
+//
|
|
|
+//
|
|
|
+// //对比进入负面清单的次数如果达到直接进入黑名单
|
|
|
+// if (labViolation.getNegativeListNum() + 1 >= getCount()) {
|
|
|
+// labViolation.setStatus(3);
|
|
|
+// labViolation.setCreditScore(labViolation.getCreditScore());
|
|
|
+// labViolationMapper.updateLabViolation(labViolation);
|
|
|
+// comperAndExitsBlackList(vo.getUserId());
|
|
|
+// return ResultData.success(200, "达到负面清单设定次数,直接加入黑名单成功");
|
|
|
+// } else if (score <= hmdval) {//积分达到黑名单设定分值进入黑名单
|
|
|
+// labViolation.setCreditScore(labViolation.getCreditScore());
|
|
|
+// labViolation.setViolationNum(labViolation.getViolationNum() + 1);
|
|
|
+// if (records != null) {
|
|
|
+// labViolation.setBlackListNum(Long.valueOf(records.getBlackListNum()) + 1);
|
|
|
+// }
|
|
|
+// labViolation.setSubjectId(vo.getLaboratoryId());
|
|
|
+// labViolation.setDeptName(vo.getDeptName());
|
|
|
+// labViolation.setDeptId(vo.getDeptId());
|
|
|
+// labViolation.setStatus(3);
|
|
|
+// labViolation.setIsNegative(0);
|
|
|
+// labViolation.setIsBlackList(1);
|
|
|
+// labViolation.setCreact_id(vo.getCreact_id());
|
|
|
+// labViolationMapper.updateLabViolation(labViolation);
|
|
|
+//
|
|
|
+// Integer passMark = Integer.valueOf(mapscore.get("passMark").toString());
|
|
|
+// Integer newCreditScore = passMark - creditScore;
|
|
|
+// violationBlack(vo.getUserId(), String.valueOf(newCreditScore), creditScore + "");
|
|
|
+// return ResultData.success(200, "积分达到黑名单设定值,加入黑名单成功");
|
|
|
+// } else {
|
|
|
+// labViolation.setCreditScore(labViolation.getCreditScore());
|
|
|
+// labViolation.setViolationNum(labViolation.getViolationNum() + 1);
|
|
|
+// if (labViolation != null) {
|
|
|
+// labViolation.setNegativeListNum(labViolation.getNegativeListNum() + 1);
|
|
|
+// }
|
|
|
+// labViolation.setSubjectId(vo.getLaboratoryId());
|
|
|
+// labViolation.setDeptName(vo.getDeptName());
|
|
|
+// labViolation.setDeptId(vo.getDeptId());
|
|
|
+// labViolation.setStatus(2);
|
|
|
+// labViolation.setIsNegative(1);
|
|
|
+// labViolation.setCreact_id(vo.getCreact_id());
|
|
|
+// labViolationMapper.updateLabViolation(labViolation);
|
|
|
+// if (records != null) {
|
|
|
+// records.setViolationNum(records.getViolationNum() + 1);
|
|
|
+// Long num = Long.valueOf(records.getNegativeListNum()) + 1;
|
|
|
+// records.setNegativeListNum(num + "");
|
|
|
+// records.setDeptName(vo.getDeptName());
|
|
|
+// records.setIsNegative(1);
|
|
|
+// if (vo.getReason().equals("-1")) {
|
|
|
+// records.setCeditScore(records.getCeditScore() - vo.getDeductionVal().intValue());
|
|
|
+// } else {
|
|
|
+// records.setCeditScore(records.getCeditScore() - Integer.parseInt(scoreSite.getViolationVal()));
|
|
|
+// }
|
|
|
+//
|
|
|
+// records.setStatus("2");
|
|
|
+// records.setCreact_id(vo.getCreact_id());
|
|
|
+// negativeListRecordsMapper.updateLabNegativeListRecords(records);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return ResultData.success();
|
|
|
+// } else {
|
|
|
+// Integer score = 0;
|
|
|
+// if (vo.getReason().equals("-1")) {
|
|
|
+// score = creditScore - Integer.parseInt(vo.getDeductionVal() + "");
|
|
|
+// } else {
|
|
|
+// score = creditScore - Integer.parseInt(scoreSite.getViolationVal());
|
|
|
+// }
|
|
|
+// if (score <= hmdval) {//积分达到黑名单设定分值进入黑名单
|
|
|
+// Integer passMark = Integer.valueOf(mapscore.get("passMark").toString());
|
|
|
+// Integer newCreditScore = passMark - creditScore;
|
|
|
+// violationBlack(vo.getUserId(), String.valueOf(newCreditScore), creditScore + "");
|
|
|
+// //违规记录
|
|
|
+// labViolation = new LabViolation();
|
|
|
+// labViolation.setUserId(vo.getUserId());
|
|
|
+// labViolation.setJoinUserId(vo.getUserId());
|
|
|
+// labViolation.setStatus(3);
|
|
|
+// labViolation.setDeptName(vo.getDeptName());
|
|
|
+// labViolation.setCreditScore(score);
|
|
|
+// labViolation.setIsNegative(0);
|
|
|
+// labViolation.setIsBlackList(1);
|
|
|
+// labViolation.setNegativeListNum(0L);
|
|
|
+// labViolation.setBlackListNum(1L);
|
|
|
+// labViolation.setCreact_id(vo.getCreact_id());
|
|
|
+// labViolation.setCreateTime(new Date());
|
|
|
+// labViolationMapper.insertLabViolation(labViolation);
|
|
|
+// records = new LabNegativeListRecords();
|
|
|
+// records.setUserId(vo.getUserId());
|
|
|
+// records.setJoinUserId(vo.getUserId());
|
|
|
+// records.setStatus("2");
|
|
|
+// records.setCeditScore(score);
|
|
|
+// records.setNegativeListNum("0");
|
|
|
+// records.setBlackListNum("1");
|
|
|
+// records.setIsNegative(0);
|
|
|
+// records.setIsBlackList(1);
|
|
|
+// records.setCreact_id(vo.getCreact_id());
|
|
|
+// records.setCreateTime(new Date());
|
|
|
+// negativeListRecordsMapper.insertLabNegativeListRecords(records);
|
|
|
+// vo.setCreditScore(Long.valueOf(score));
|
|
|
+// LabNegativelistHistory nhistory = CovertHistory(vo);
|
|
|
+// nhistory.setBlackId(records.getId());
|
|
|
+// nhistory.setCreateTime(new Date());
|
|
|
+//
|
|
|
+// nhistory.setCreditScore(Long.valueOf(score));
|
|
|
+// if (vo.getReason().equals("-1")) {
|
|
|
+// nhistory.setReason(vo.getViolationReasons());
|
|
|
+// nhistory.setDeductionVal(vo.getDeductionVal());
|
|
|
+// } else {
|
|
|
+// nhistory.setReason(scoreSite.getViolationName());
|
|
|
+// nhistory.setDeductionVal(Long.valueOf(scoreSite.getViolationVal()));
|
|
|
+// }
|
|
|
+// if (tokenService.getLoginUser() != null) {
|
|
|
+// nhistory.setCreateBy(tokenService.getLoginUser().getNickName());
|
|
|
+// } else {
|
|
|
+// nhistory.setCreateBy("系统");
|
|
|
+// }
|
|
|
+// negativelistHistoryMapper.insertLabNegativelistHistory(nhistory);
|
|
|
+// } else {
|
|
|
+// //违规记录
|
|
|
+// labViolation = new LabViolation();
|
|
|
+// labViolation.setUserId(vo.getUserId());
|
|
|
+// labViolation.setJoinUserId(vo.getUserId());
|
|
|
+// labViolation.setStatus(2);
|
|
|
+// labViolation.setDeptName(vo.getDeptName());
|
|
|
+// labViolation.setCreditScore(score);
|
|
|
+// labViolation.setIsNegative(1);
|
|
|
+// labViolation.setBlackListNum(0L);
|
|
|
+// labViolation.setCreact_id(vo.getCreact_id());
|
|
|
+// labViolation.setCreateTime(new Date());
|
|
|
+// labViolationMapper.insertLabViolation(labViolation);
|
|
|
+// records = new LabNegativeListRecords();
|
|
|
+// records.setUserId(vo.getUserId());
|
|
|
+// records.setJoinUserId(vo.getUserId());
|
|
|
+// records.setStatus("2");
|
|
|
+// records.setCeditScore(score);
|
|
|
+// records.setBlackListNum("0");
|
|
|
+// records.setIsNegative(1);
|
|
|
+// records.setCreact_id(vo.getCreact_id());
|
|
|
+// records.setCreateTime(new Date());
|
|
|
+// negativeListRecordsMapper.insertLabNegativeListRecords(records);
|
|
|
+// vo.setCreditScore(Long.valueOf(score));
|
|
|
+// LabNegativelistHistory nhistory = CovertHistory(vo);
|
|
|
+// nhistory.setBlackId(records.getId());
|
|
|
+// nhistory.setCreateTime(new Date());
|
|
|
+//
|
|
|
+// nhistory.setCreditScore(Long.valueOf(score));
|
|
|
+// if (vo.getReason().equals("-1")) {
|
|
|
+// nhistory.setReason(vo.getViolationReasons());
|
|
|
+// nhistory.setDeductionVal(vo.getDeductionVal());
|
|
|
+// } else {
|
|
|
+// nhistory.setReason(scoreSite.getViolationName());
|
|
|
+// nhistory.setDeductionVal(Long.valueOf(scoreSite.getViolationVal()));
|
|
|
+// }
|
|
|
+// if (tokenService.getLoginUser() != null) {
|
|
|
+// nhistory.setCreateBy(tokenService.getLoginUser().getNickName());
|
|
|
+// } else {
|
|
|
+// nhistory.setCreateBy("系统");
|
|
|
+// }
|
|
|
+// negativelistHistoryMapper.insertLabNegativelistHistory(nhistory);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
return ResultData.success();
|
|
|
- } else {
|
|
|
- Integer score = 0;
|
|
|
- if (vo.getReason().equals("-1")) {
|
|
|
- score = creditScore - Integer.parseInt(vo.getDeductionVal() + "");
|
|
|
- } else {
|
|
|
- score = creditScore - Integer.parseInt(scoreSite.getViolationVal());
|
|
|
- }
|
|
|
- if (score <= hmdval) {//积分达到黑名单设定分值进入黑名单
|
|
|
- Integer passMark = Integer.valueOf(mapscore.get("passMark").toString());
|
|
|
- Integer newCreditScore = passMark - creditScore;
|
|
|
- violationBlack(vo.getUserId(), String.valueOf(newCreditScore), creditScore + "");
|
|
|
- //违规记录
|
|
|
- labViolation = new LabViolation();
|
|
|
- labViolation.setUserId(vo.getUserId());
|
|
|
- labViolation.setJoinUserId(vo.getUserId());
|
|
|
- labViolation.setStatus(3);
|
|
|
- labViolation.setDeptName(vo.getDeptName());
|
|
|
- labViolation.setCreditScore(score);
|
|
|
- labViolation.setIsNegative(0);
|
|
|
- labViolation.setIsBlackList(1);
|
|
|
- labViolation.setNegativeListNum(0L);
|
|
|
- labViolation.setBlackListNum(1L);
|
|
|
- labViolation.setCreact_id(vo.getCreact_id());
|
|
|
- labViolation.setCreateTime(new Date());
|
|
|
- labViolationMapper.insertLabViolation(labViolation);
|
|
|
- records = new LabNegativeListRecords();
|
|
|
- records.setUserId(vo.getUserId());
|
|
|
- records.setJoinUserId(vo.getUserId());
|
|
|
- records.setStatus("2");
|
|
|
- records.setCeditScore(score);
|
|
|
- records.setNegativeListNum("0");
|
|
|
- records.setBlackListNum("1");
|
|
|
- records.setIsNegative(0);
|
|
|
- records.setIsBlackList(1);
|
|
|
- records.setCreact_id(vo.getCreact_id());
|
|
|
- records.setCreateTime(new Date());
|
|
|
- negativeListRecordsMapper.insertLabNegativeListRecords(records);
|
|
|
- vo.setCreditScore(Long.valueOf(score));
|
|
|
- LabNegativelistHistory nhistory = CovertHistory(vo);
|
|
|
- nhistory.setBlackId(records.getId());
|
|
|
- nhistory.setCreateTime(new Date());
|
|
|
-
|
|
|
- nhistory.setCreditScore(Long.valueOf(score));
|
|
|
- if (vo.getReason().equals("-1")) {
|
|
|
- nhistory.setReason(vo.getViolationReasons());
|
|
|
- nhistory.setDeductionVal(vo.getDeductionVal());
|
|
|
- } else {
|
|
|
- nhistory.setReason(scoreSite.getViolationName());
|
|
|
- nhistory.setDeductionVal(Long.valueOf(scoreSite.getViolationVal()));
|
|
|
- }
|
|
|
- if (tokenService.getLoginUser() != null) {
|
|
|
- nhistory.setCreateBy(tokenService.getLoginUser().getNickName());
|
|
|
- } else {
|
|
|
- nhistory.setCreateBy("系统");
|
|
|
- }
|
|
|
- negativelistHistoryMapper.insertLabNegativelistHistory(nhistory);
|
|
|
- } else {
|
|
|
- //违规记录
|
|
|
- labViolation = new LabViolation();
|
|
|
- labViolation.setUserId(vo.getUserId());
|
|
|
- labViolation.setJoinUserId(vo.getUserId());
|
|
|
- labViolation.setStatus(2);
|
|
|
- labViolation.setDeptName(vo.getDeptName());
|
|
|
- labViolation.setCreditScore(score);
|
|
|
- labViolation.setIsNegative(1);
|
|
|
- labViolation.setBlackListNum(0L);
|
|
|
- labViolation.setCreact_id(vo.getCreact_id());
|
|
|
- labViolation.setCreateTime(new Date());
|
|
|
- labViolationMapper.insertLabViolation(labViolation);
|
|
|
- records = new LabNegativeListRecords();
|
|
|
- records.setUserId(vo.getUserId());
|
|
|
- records.setJoinUserId(vo.getUserId());
|
|
|
- records.setStatus("2");
|
|
|
- records.setCeditScore(score);
|
|
|
- records.setBlackListNum("0");
|
|
|
- records.setIsNegative(1);
|
|
|
- records.setCreact_id(vo.getCreact_id());
|
|
|
- records.setCreateTime(new Date());
|
|
|
- negativeListRecordsMapper.insertLabNegativeListRecords(records);
|
|
|
- vo.setCreditScore(Long.valueOf(score));
|
|
|
- LabNegativelistHistory nhistory = CovertHistory(vo);
|
|
|
- nhistory.setBlackId(records.getId());
|
|
|
- nhistory.setCreateTime(new Date());
|
|
|
-
|
|
|
- nhistory.setCreditScore(Long.valueOf(score));
|
|
|
- if (vo.getReason().equals("-1")) {
|
|
|
- nhistory.setReason(vo.getViolationReasons());
|
|
|
- nhistory.setDeductionVal(vo.getDeductionVal());
|
|
|
- } else {
|
|
|
- nhistory.setReason(scoreSite.getViolationName());
|
|
|
- nhistory.setDeductionVal(Long.valueOf(scoreSite.getViolationVal()));
|
|
|
- }
|
|
|
- if (tokenService.getLoginUser() != null) {
|
|
|
- nhistory.setCreateBy(tokenService.getLoginUser().getNickName());
|
|
|
- } else {
|
|
|
- nhistory.setCreateBy("系统");
|
|
|
- }
|
|
|
- negativelistHistoryMapper.insertLabNegativelistHistory(nhistory);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- return ResultData.success();
|
|
|
- }
|
|
|
-
|
|
|
+// }
|
|
|
+//
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -838,7 +838,7 @@ public class LabViolationServiceImpl implements ILabViolationService {
|
|
|
recoveryMap.put("reason", "负面清单移除恢复信用分");
|
|
|
}
|
|
|
|
|
|
- remoteExamService.recoveryPoints(recoveryMap);
|
|
|
+// remoteExamService.recoveryPoints(recoveryMap);
|
|
|
|
|
|
return ResultData.success();
|
|
|
}
|
|
|
@@ -879,7 +879,7 @@ public class LabViolationServiceImpl implements ILabViolationService {
|
|
|
recoveryMap.put("reason", "负面清单移除恢复信用分");
|
|
|
}
|
|
|
|
|
|
- remoteExamService.recoveryPoints(recoveryMap);
|
|
|
+// remoteExamService.recoveryPoints(recoveryMap);
|
|
|
|
|
|
return ResultData.success();
|
|
|
}
|
|
|
@@ -887,11 +887,11 @@ public class LabViolationServiceImpl implements ILabViolationService {
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public ResultData blackAdd(LabBlacklistVO labBlacklistVO) {
|
|
|
- LabViolation violation = labViolationMapper.selectByUserId(labBlacklistVO.getJoinUserId());
|
|
|
- moveBlackList(violation, labBlacklistVO.getReason());
|
|
|
- Map<String, Object> pointsConfig = (Map<String, Object>) scoreData().getData();
|
|
|
- Long deducPoints = violation.getCreditScore() - Long.parseLong(pointsConfig.get("blackScore") + "");
|
|
|
- resetNegative(labBlacklistVO.getJoinUserId(), deducPoints);
|
|
|
+// LabViolation violation = labViolationMapper.selectByUserId(labBlacklistVO.getJoinUserId());
|
|
|
+// moveBlackList(violation, labBlacklistVO.getReason());
|
|
|
+// Map<String, Object> pointsConfig = (Map<String, Object>) scoreData().getData();
|
|
|
+// Long deducPoints = violation.getCreditScore() - Long.parseLong(pointsConfig.get("blackScore") + "");
|
|
|
+// resetNegative(labBlacklistVO.getJoinUserId(), deducPoints);
|
|
|
return ResultData.success();
|
|
|
}
|
|
|
|
|
|
@@ -909,46 +909,46 @@ public class LabViolationServiceImpl implements ILabViolationService {
|
|
|
|
|
|
//移入黑名单操作
|
|
|
public void moveBlackList(LabViolation violation, String reason) {
|
|
|
- Map<String, Object> markconfigMap = new HashMap<>();
|
|
|
- R<Object> data = remoteExamService.getPointsConfig(markconfigMap);
|
|
|
- if (data != null) {
|
|
|
- String code = data.getCode() + "";
|
|
|
- if (code.equals("200")) {
|
|
|
- Map<String, Object> pointsConfig = (Map<String, Object>) data.getData();
|
|
|
- Long deducPoints = violation.getCreditScore() - Long.parseLong(pointsConfig.get("blackScore") + "");
|
|
|
- if (deducPoints > 0
|
|
|
- && deducPointsFun(violation.getUserId(), deducPoints, reason)) {
|
|
|
- //这里移入黑名单
|
|
|
- LabBlacklistVO labBlacklistVO = new LabBlacklistVO();
|
|
|
- labBlacklistVO.setJoinUserId(violation.getUserId());
|
|
|
- labBlacklistVO.setCreditScore(deducPoints + "");
|
|
|
- labBlacklistVO.setSurplusCreditScore((violation.getCreditScore() - deducPoints) + "");
|
|
|
- labBlacklistVO.setReason("从负面清单移入到黑名单");
|
|
|
- labBlacklistService.addBlacklist(labBlacklistVO);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// Map<String, Object> markconfigMap = new HashMap<>();
|
|
|
+// R<Object> data = remoteExamService.getPointsConfig(markconfigMap);
|
|
|
+// if (data != null) {
|
|
|
+// String code = data.getCode() + "";
|
|
|
+// if (code.equals("200")) {
|
|
|
+// Map<String, Object> pointsConfig = (Map<String, Object>) data.getData();
|
|
|
+// Long deducPoints = violation.getCreditScore() - Long.parseLong(pointsConfig.get("blackScore") + "");
|
|
|
+// if (deducPoints > 0
|
|
|
+// && deducPointsFun(violation.getUserId(), deducPoints, reason)) {
|
|
|
+// //这里移入黑名单
|
|
|
+// LabBlacklistVO labBlacklistVO = new LabBlacklistVO();
|
|
|
+// labBlacklistVO.setJoinUserId(violation.getUserId());
|
|
|
+// labBlacklistVO.setCreditScore(deducPoints + "");
|
|
|
+// labBlacklistVO.setSurplusCreditScore((violation.getCreditScore() - deducPoints) + "");
|
|
|
+// labBlacklistVO.setReason("从负面清单移入到黑名单");
|
|
|
+// labBlacklistService.addBlacklist(labBlacklistVO);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
|
|
|
private boolean deducPointsFun(Long joinUserId, Long deductPoints, String reason) {
|
|
|
- Map<String, Object> deducPointsMap = new HashMap<>();
|
|
|
- deducPointsMap.put("joinUserId", joinUserId);
|
|
|
- deducPointsMap.put("deductPoints", deductPoints);
|
|
|
- deducPointsMap.put("pointsType", 1);
|
|
|
- if (StringUtils.isNotNull(reason)) {
|
|
|
- deducPointsMap.put("reason", "手动添加到黑名单(" + reason + ")");
|
|
|
- } else {
|
|
|
- deducPointsMap.put("reason", "手动添加到黑名单");
|
|
|
- }
|
|
|
-
|
|
|
- R<Object> data = remoteExamService.deductionPoints(deducPointsMap);
|
|
|
- if (data != null) {
|
|
|
- String code = data.getCode() + "";
|
|
|
- if (code.equals("200")) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
+// Map<String, Object> deducPointsMap = new HashMap<>();
|
|
|
+// deducPointsMap.put("joinUserId", joinUserId);
|
|
|
+// deducPointsMap.put("deductPoints", deductPoints);
|
|
|
+// deducPointsMap.put("pointsType", 1);
|
|
|
+// if (StringUtils.isNotNull(reason)) {
|
|
|
+// deducPointsMap.put("reason", "手动添加到黑名单(" + reason + ")");
|
|
|
+// } else {
|
|
|
+// deducPointsMap.put("reason", "手动添加到黑名单");
|
|
|
+// }
|
|
|
+//
|
|
|
+// R<Object> data = remoteExamService.deductionPoints(deducPointsMap);
|
|
|
+// if (data != null) {
|
|
|
+// String code = data.getCode() + "";
|
|
|
+// if (code.equals("200")) {
|
|
|
+// return true;
|
|
|
+// }
|
|
|
+// }
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -1012,19 +1012,20 @@ public class LabViolationServiceImpl implements ILabViolationService {
|
|
|
|
|
|
@Override
|
|
|
public Integer getScore() {
|
|
|
- Map<String, Object> markconfig = new HashMap<>();
|
|
|
- R<Object> r = remoteExamService.getPointsConfig(markconfig);
|
|
|
- //获取设置积分进行扣减
|
|
|
- Map<String, Object> result = (Map<String, Object>) r.getData();
|
|
|
- return Integer.valueOf(result.get("passMark").toString());
|
|
|
+// Map<String, Object> markconfig = new HashMap<>();
|
|
|
+// R<Object> r = remoteExamService.getPointsConfig(markconfig);
|
|
|
+// //获取设置积分进行扣减
|
|
|
+// Map<String, Object> result = (Map<String, Object>) r.getData();
|
|
|
+// return Integer.valueOf(result.get("passMark").toString());
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
public ResultData scoreData() {
|
|
|
- Map<String, Object> markconfig = new HashMap<>();
|
|
|
- R<Object> r = remoteExamService.getPointsConfig(markconfig);
|
|
|
- if (r.getCode() == 200) {
|
|
|
- return ResultData.success((r.getData()));
|
|
|
- }
|
|
|
+// Map<String, Object> markconfig = new HashMap<>();
|
|
|
+// R<Object> r = remoteExamService.getPointsConfig(markconfig);
|
|
|
+// if (r.getCode() == 200) {
|
|
|
+// return ResultData.success((r.getData()));
|
|
|
+// }
|
|
|
return ResultData.fail("获取积分扣减接口失败");
|
|
|
}
|
|
|
|