zhb.dong il y a 1 an
Parent
commit
de09940500

+ 4 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabBlacklistController.java

@@ -1,5 +1,6 @@
 package com.zd.laboratory.controller;
 
+import cn.hutool.json.JSONUtil;
 import com.zd.common.core.annotation.Log;
 import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.log.BusinessType;
@@ -144,12 +145,14 @@ public class LabBlacklistController extends BaseController {
     @Log(title = "黑名单完成学习规则", businessType = BusinessType.UPDATE)
     @PostMapping("/blacklistLearningRules")
     public ResultData blacklistLearningRules(@RequestBody LabBlackdetailVO labBlackdetailVO) {
-        logger.error("学习离开负面清单==============-----------==============++++"+labBlackdetailVO.toString());
+        logger.info("Blacklist and negative list processing logic begins,vo:{}", JSONUtil.toJsonStr(labBlackdetailVO));
         if(labBlackdetailVO.getNegativeOrBlack().equals("2")){
             //黑名单处理
+            logger.info("Blacklist processing logic ongoing...");
             return ResultData.result(labBlacklistService.blacklistCompletionLearningRules(labBlackdetailVO));
         }else if(labBlackdetailVO.getNegativeOrBlack().equals("1")){
             //负面清单处理
+            logger.info("Negative list processing logic ongoing...");
             return ResultData.result(iLabNegativeListRecordsService.negivelistLearningRules(labBlackdetailVO));
         }
         return ResultData.result(false,()->"类型错误,请联系管理员!!");

+ 15 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabBlacklistServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zd.laboratory.service.impl;
 
+import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
 import com.zd.common.core.annotation.DataScope;
 import com.zd.common.core.security.TokenService;
@@ -19,6 +20,7 @@ import com.zd.laboratory.service.ILabBlacklistService;
 import com.zd.laboratory.service.ILabViolationService;
 import com.zd.model.domain.R;
 import com.zd.model.domain.per.PerPrefix;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -32,6 +34,7 @@ import java.util.*;
  * @author zd
  * @date 2021-09-01
  */
+@Slf4j(topic = "LabBlacklistServiceImpl")
 @Service
 public class LabBlacklistServiceImpl implements ILabBlacklistService {
     @Autowired
@@ -368,21 +371,26 @@ public class LabBlacklistServiceImpl implements ILabBlacklistService {
     public int blacklistCompletionLearningRules(LabBlackdetailVO blackdetailVO) {
         int flag = 0;
         LabBlacklist labBlack = this.selectLabBlacklistById(blackdetailVO.getJoinUserId());
+        log.info("Blacklist processing logic ,labBlack:{}", JSONUtil.toJsonStr(labBlack));
         if (labBlack != null && labBlack.getBlacklistStatus() == 1) {
             LabBlackdetail labBlackdetail = labBlackdetailMapper.selectLabBlackdetailByBlackId(labBlack.getId());
             LabBlackdetail labBlackdetailNew = new LabBlackdetail();
             if (blackdetailVO.getLearnStatus() != null && blackdetailVO.getLearnStatus().equals(labBlackdetail.getLearnStatus())
                     && blackdetailVO.getLearnTime() >= labBlackdetail.getLearnTime()) {
+                log.info("Blacklist processing logic ,learnStatus:{},learnTime:{}", blackdetailVO.getLearnStatus(),blackdetailVO.getLearnTime());
                 labBlackdetailNew.setLearnStatus(1);
                 labBlackdetailNew.setId(labBlackdetail.getId());
             }
             if (blackdetailVO.getTestStatus() != null && blackdetailVO.getTestStatus().equals(labBlackdetail.getTestStatus())) {
+                log.info("Blacklist processing logic ,testStatus:{}", blackdetailVO.getTestStatus());
                 labBlackdetailNew.setTestStatus(1);
                 labBlackdetailNew.setId(labBlackdetail.getId());
             }
             if (blackdetailVO.getPracticeStatus() != null && blackdetailVO.getPracticeStatus().equals(labBlackdetail.getPracticeStatus())
                     && blackdetailVO.getNumberTopics() >= labBlackdetail.getNumberTopics()
                     && blackdetailVO.getNumberAccuracy() >= labBlackdetail.getNumberAccuracy()) {
+                log.info("Blacklist processing logic ,practiceStatus:{},numberTopics:{},numberAccuracy:{}", blackdetailVO.getPracticeStatus(),
+                        blackdetailVO.getNumberTopics(),blackdetailVO.getNumberAccuracy());
                 labBlackdetailNew.setPracticeStatus(1);
                 labBlackdetailNew.setId(labBlackdetail.getId());
             }
@@ -390,6 +398,7 @@ public class LabBlacklistServiceImpl implements ILabBlacklistService {
                 labBlackdetailNew.setUpdateBy("系统执行");
                 labBlackdetailNew.setUpdateTime(new Date());
                 labBlackdetailMapper.updateLabBlackdetail(labBlackdetailNew);
+                log.info("updateLabBlackdetail success,labBlackdetailNew:{}",JSON.toJSONString(labBlackdetailNew));
             }
 
             overBlackLearn(labBlack.getId(), blackdetailVO.getJoinUserId());
@@ -423,17 +432,19 @@ public class LabBlacklistServiceImpl implements ILabBlacklistService {
                 }
                 maxCount++;
             }
+            log.info("overBlackLearn ,maxCount:{}",maxCount);
             if (maxCount != 0 && nowCount == maxCount) {
                 LabBlackdetail labBlackdetailNew = new LabBlackdetail();
                 labBlackdetailNew.setId(labBlackdetail.getId());
                 labBlackdetailNew.setOverStatus(1);
                 labBlackdetailNew.setUpdateBy("系统执行");
                 labBlackdetailNew.setUpdateTime(new Date());
+                log.info("updateLabBlackdetail ,updateLabBlackdetail:{}",JSON.toJSONString(labBlackdetailNew));
                 labBlackdetailMapper.updateLabBlackdetail(labBlackdetailNew);
 
                 LabBlacklist labBlacklist = new LabBlacklist();
                 labBlacklist.setJoinUserId(joinUserId);
-                labBlacklist.setReason("完成规定内容:" + labBlackdetail.getTreatmentMethod() + ",系统自动复原信用分.");
+                log.info("Complete the specified content:{} and the system will automatically restore the credit score",labBlackdetail.getTreatmentMethod());
                 removeBlacklist(labBlacklist);
             }
         }
@@ -448,6 +459,7 @@ public class LabBlacklistServiceImpl implements ILabBlacklistService {
     @Override
     public int removeBlacklist(LabBlacklist labBlacklist) {
         int flag = 500;
+        log.info("removeBlacklist begins, labBlacklist:{}", cn.hutool.json.JSONUtil.toJsonStr(labBlacklist));
         //给积分管理,写入对应的内容
         LabBlacklist userBlack = labBlacklistMapper.selectLabBlacklistById(labBlacklist.getJoinUserId());
         if (StringUtils.isNotNull(userBlack)) {
@@ -455,10 +467,12 @@ public class LabBlacklistServiceImpl implements ILabBlacklistService {
             recoveryMap.put("joinUserId", userBlack.getJoinUserId() + "");
             recoveryMap.put("pointsType", "1");
             recoveryMap.put("reason", "手动恢复黑名单" + labBlacklist.getReason());
+            log.info("recoveryPoints begins, recoveryMap:{}",JSON.toJSONString(recoveryMap));
             R<Object> data = remoteExamService.recoveryPoints(recoveryMap);
             if (data != null) {
                 String code = data.getCode() + "";
                 if (code.equals("200")) {
+                    log.info("recoveryPoints sucess!");
                     LabBlacklist labBlacklistNew = new LabBlacklist();
                     //修改黑名单状态
                     labBlacklistNew.setJoinUserId(labBlacklist.getJoinUserId());
@@ -497,7 +511,6 @@ public class LabBlacklistServiceImpl implements ILabBlacklistService {
             //这里调用刘吉焕的移除负面清单方法
             iLabViolationService.resetUserStatus(labBlacklist.getJoinUserId(), labBlacklist.getReason());
         }
-
         return flag;
     }
 

+ 5 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabViolationServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zd.laboratory.service.impl;
 
+import cn.hutool.json.JSONUtil;
 import com.zd.common.core.annotation.DataScope;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.DateUtils;
@@ -19,6 +20,7 @@ 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;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -35,6 +37,7 @@ import java.util.stream.Collectors;
  * @date 2021-09-01
  */
 @Service
+@Slf4j
 public class LabViolationServiceImpl implements ILabViolationService {
     @Autowired
     private LabViolationMapper labViolationMapper;
@@ -1090,6 +1093,7 @@ public class LabViolationServiceImpl implements ILabViolationService {
     @Override
     @Transactional
     public ResultData resetUserStatus(Long userId, String reason) {
+        log.info("resetUserStatus begins,userId:{},reason:{}",userId,reason);
         //后续 reason
         labViolationMapper.delByUserId(userId);
         negativeListRecordsMapper.delByUserId(userId);
@@ -1111,6 +1115,7 @@ public class LabViolationServiceImpl implements ILabViolationService {
             newHistory.setOverStatus(1);
             newHistory.setUserId(null);
             negativelistHistoryMapper.updateLabNegativelistHistory(newHistory);
+            log.info("resetUserStatus success,newHistory:{}", JSONUtil.toJsonStr(newHistory));
         }
         return ResultData.success();
     }