Prechádzať zdrojové kódy

2023-11-28 取消暨大项目中的 学习考试、安全检查、气瓶管理三个模块的依赖包。

chaiyunlong 2 rokov pred
rodič
commit
18d6320338
16 zmenil súbory, kde vykonal 1032 pridanie a 1045 odobranie
  1. 0 5
      zd-modules/zd-algorithm/pom.xml
  2. 24 24
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/rfid/service/impl/SendServiceImpl.java
  3. 0 5
      zd-modules/zd-base/pom.xml
  4. 166 166
      zd-modules/zd-base/src/main/java/com/zd/base/app/controller/ExamApi.java
  5. 57 57
      zd-modules/zd-base/src/main/java/com/zd/base/job/task/ExamTask.java
  6. 40 40
      zd-modules/zd-base/src/main/java/com/zd/base/job/task/FileViewTask.java
  7. 0 5
      zd-modules/zd-modules-laboratory/pom.xml
  8. 15 15
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabViolationController.java
  9. 22 22
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/onemachine/service/OneMachineService.java
  10. 22 22
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabApprovalServiceImpl.java
  11. 164 164
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabBlacklistServiceImpl.java
  12. 52 52
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabNegativeListRecordsServiceImpl.java
  13. 15 15
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSecurityApplyServiceImpl.java
  14. 86 85
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSubjectAccessRecordServiceImpl.java
  15. 301 300
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabViolationServiceImpl.java
  16. 68 68
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/utils/InblackListScheduleTask.java

+ 0 - 5
zd-modules/zd-algorithm/pom.xml

@@ -195,11 +195,6 @@
         </dependency>
 
         <dependency>
-            <groupId>com.zd.airbottle</groupId>
-            <artifactId>zd-airbottle-api</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>com.zd.laboratory</groupId>
             <artifactId>zd-laboratory-api</artifactId>
         </dependency>

+ 24 - 24
zd-modules/zd-algorithm/src/main/java/com/zd/alg/rfid/service/impl/SendServiceImpl.java

@@ -1,6 +1,6 @@
 package com.zd.alg.rfid.service.impl;
 
-import com.zd.airbottle.api.feign.RemoteAirBottleService;
+//import com.zd.airbottle.api.feign.RemoteAirBottleService;
 import com.zd.alg.rfid.service.ISendService;
 import com.zd.bottle.feign.service.RemoteBottleService;
 import com.zd.chemical.api.fegin.RemoteStockService;
@@ -23,8 +23,8 @@ public class SendServiceImpl implements ISendService {
 
     @Resource
     private RemoteStockService remoteStockService;
-    @Resource
-    private RemoteAirBottleService bottleService;
+//    @Resource
+//    private RemoteAirBottleService bottleService;
 
     @Resource
     private RemoteBottleService remoteBottleService;
@@ -112,27 +112,27 @@ public class SendServiceImpl implements ISendService {
      * 解决方案:为保障项目的顺利部署,和功能实现,最快捷的处理方式屏蔽其中一段代码,具体事故原因可在后续的项目应用中排查原因
      */
     private boolean sendBottle(InventoryTag tag) {
-        R<Boolean> result;
-        try {
-            log.info("======》气瓶服务开始调用");
-            result = bottleService.remoteAdd(tag);
-            log.info("======》气瓶服务调用结果:{},(true开启报警,false不报警)", result.getData());
-            if (result.getCode() == HttpStatus.SUCCESS) {
-                return result.getData();
-            }
-        } catch (Exception e) {
-            log.info("气瓶服务异常:{}", e.getMessage());
-        }
-        try {
-            log.info("======》新气瓶服务开始调用");
-            result = remoteBottleService.remoteAdd(tag);
-            log.info("======》新气瓶服务调用结果:{},(true开启报警,false不报警)",result.getData());
-            if (result.getCode() == HttpStatus.SUCCESS) {
-                return result.getData();
-            }
-        } catch (Exception e) {
-            log.info("新气瓶服务异常:" + e.getMessage());
-        }
+//        R<Boolean> result;
+//        try {
+//            log.info("======》气瓶服务开始调用");
+//            result = bottleService.remoteAdd(tag);
+//            log.info("======》气瓶服务调用结果:{},(true开启报警,false不报警)", result.getData());
+//            if (result.getCode() == HttpStatus.SUCCESS) {
+//                return result.getData();
+//            }
+//        } catch (Exception e) {
+//            log.info("气瓶服务异常:{}", e.getMessage());
+//        }
+//        try {
+//            log.info("======》新气瓶服务开始调用");
+//            result = remoteBottleService.remoteAdd(tag);
+//            log.info("======》新气瓶服务调用结果:{},(true开启报警,false不报警)",result.getData());
+//            if (result.getCode() == HttpStatus.SUCCESS) {
+//                return result.getData();
+//            }
+//        } catch (Exception e) {
+//            log.info("新气瓶服务异常:" + e.getMessage());
+//        }
         return false;
     }
 

+ 0 - 5
zd-modules/zd-base/pom.xml

@@ -81,11 +81,6 @@
             <artifactId>zd-laboratory-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.zd.exam</groupId>
-            <artifactId>zd-exam-api</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>com.zd.chemical</groupId>
             <artifactId>zd-chemical-api</artifactId>
         </dependency>

+ 166 - 166
zd-modules/zd-base/src/main/java/com/zd/base/app/controller/ExamApi.java

@@ -1,166 +1,166 @@
-package com.zd.base.app.controller;
-
-import com.zd.common.core.security.TokenService;
-import com.zd.common.core.utils.SecurityUtils;
-import com.zd.exam.api.feign.RemoteExamService;
-import com.zd.model.domain.R;
-import com.zd.model.page.TableDataInfo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @Author: zhoupan
- * @Date: 2021/09/03/16:11
- * @Description:
- */
-@RestController
-@RequestMapping("/app/exam")
-@Api(tags = {"考试相关"})
-public class ExamApi {
-
-    @Autowired
-    private RemoteExamService remoteExamService;
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询在线考试列表(用户相关,区分列表接口)
-     */
-    @ApiOperation(value = "我的在线考试列表")
-    @GetMapping(value = "/onlineExamList")
-    public TableDataInfo queryMyExamList(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @RequestParam(required = false) Integer scopeType) {
-        Long userId = SecurityUtils.getUserId();
-        Map map = new HashMap(3);
-        map.put("userId", userId);
-        map.put("pageNum", pageNum);
-        map.put("pageSize", pageSize);
-        map.put("scopeType", scopeType);
-        return remoteExamService.list(map);
-    }
-
-    /**
-     * 去考试自动创建试卷
-     */
-    @ApiOperation(value = "去考试自动创建试卷")
-    @PostMapping(value = "/create-paper/{examId}")
-    public R<Object> createPaper(@PathVariable Long examId) {
-        Map map = new HashMap(1);
-        map.put("examId", examId);
-        return remoteExamService.createPaper(map);
-    }
-
-    /**
-     * 获取试卷管理详细信息(答题卡信息)
-     */
-    @ApiOperation(value = "获取试卷管理详细信息(答题卡信息)")
-    @GetMapping(value = "/paper/{id}")
-    public R<Object> getInfo(@PathVariable("id") Long id) {
-
-        return remoteExamService.getInfo(id);
-    }
-
-    /**
-     * 答题过程根据 paperId 和 quId 查询问题和选项
-     */
-    @ApiOperation(value = "查询问题和选项")
-    @PostMapping(value = "/paper/paperDetail/{paperId}/{quId}")
-    public R<Object> queryQuDetail(@PathVariable Long paperId, @PathVariable Long quId) {
-        Map map = new HashMap(2);
-        map.put("paperId", paperId);
-        map.put("quId", quId);
-        return remoteExamService.queryQuDetail(map);
-    }
-
-    /**
-     * 填充答案 下一题实时保存上题答案
-     */
-    @ApiOperation(value = "保存用户答案")
-    @PostMapping(value = "/paper/fillAnswer")
-    public R<Object> fillAnswer(@RequestBody Map<String,Object> paperQuMap) {
-        return remoteExamService.fillAnswer(paperQuMap);
-    }
-
-    /**
-     * 交卷操作
-     */
-    @ApiOperation(value = "交卷操作")
-    @PostMapping(value = "/paper/handPaper/{id}")
-    public R<Object> handPaper(@PathVariable Long id,@RequestParam(required = false) Long violationId) {
-        Map map = new HashMap(1);
-        map.put("id", id);
-        map.put("violationId", violationId);
-        return remoteExamService.handPaper(map);
-    }
-
-    /**
-     * 查询当前用户考试记录列表
-     */
-    @ApiOperation(value = "查询当前用户考试记录列表")
-    @GetMapping("/my/exam/list")
-    public TableDataInfo list(@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
-        Long userId = tokenService.getLoginUser().getUserid();
-        Map map = new HashMap(3);
-        map.put("joinUserId", userId);
-        map.put("appPageNum", pageNum);
-        map.put("appPageSize", pageSize);
-        return remoteExamService.myExamResultList(map);
-    }
-
-
-    /**
-     * 交卷查询考试结果(没有调用,暂时不用)
-     */
-    @ApiOperation(value = "查询考试结果")
-    @GetMapping(value = "/paper/paperResult/{id}")
-    public R<Map> paperResult(@PathVariable Long id) {
-
-        Map map = new HashMap(1);
-        map.put("id", id);
-        return remoteExamService.paperResult(map);
-    }
-
-    /**
-     * 根据登录用户查询 我的证书列表
-     */
-    @PostMapping("/exam/queryMyCert")
-    @ApiOperation(value = "根据登录用户查询 我的证书列表")
-    public TableDataInfo queryMyCert(@RequestBody Map<String, Object> userCert) {
-        return remoteExamService.queryMyCert(userCert);
-    }
-
-    /**
-     * 考试过程 查询当前考题的正确和错误数量(暂时不用)
-     */
-    @ApiOperation(value = "考试过程 查询当前考题的正确和错误数量")
-    @GetMapping(value = "/paperStatistics/{id}")
-    public R<Object> getPaperStatistics(@PathVariable("id") Long id) {
-        return remoteExamService.getPaperStatistics(id);
-    }
-
-
-    /**
-     * 根据登录用户查询 我的积分列表
-     */
-    @PostMapping("/points/record/list/myApp")
-    @ApiOperation(value = "根据登录用户查询 我的积分列表")
-    public TableDataInfo recordMyApp(@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
-        Map<String, Object> myApp = new HashMap <>();
-        myApp.put("appPageNum",pageNum);
-        myApp.put("appPageSize",pageSize);
-        return remoteExamService.recordMyApp(myApp);
-    }
-
-    /**
-     * 根据登录用户查询 我的积分统计
-     */
-    @ApiOperation(value = "根据登录用户查询 我的积分统计")
-    @GetMapping(value = "/points/record/count/myApp")
-    public R<Object> recordMyAppCount() {
-        return remoteExamService.recordMyAppCount();
-    }
-
-}
+//package com.zd.base.app.controller;
+//
+//import com.zd.common.core.security.TokenService;
+//import com.zd.common.core.utils.SecurityUtils;
+//import com.zd.exam.api.feign.RemoteExamService;
+//import com.zd.model.domain.R;
+//import com.zd.model.page.TableDataInfo;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.*;
+//import java.util.HashMap;
+//import java.util.Map;
+//
+///**
+// * @Author: zhoupan
+// * @Date: 2021/09/03/16:11
+// * @Description:
+// */
+//@RestController
+//@RequestMapping("/app/exam")
+//@Api(tags = {"考试相关"})
+//public class ExamApi {
+//
+//    @Autowired
+//    private RemoteExamService remoteExamService;
+//    @Autowired
+//    private TokenService tokenService;
+//
+//    /**
+//     * 查询在线考试列表(用户相关,区分列表接口)
+//     */
+//    @ApiOperation(value = "我的在线考试列表")
+//    @GetMapping(value = "/onlineExamList")
+//    public TableDataInfo queryMyExamList(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @RequestParam(required = false) Integer scopeType) {
+//        Long userId = SecurityUtils.getUserId();
+//        Map map = new HashMap(3);
+//        map.put("userId", userId);
+//        map.put("pageNum", pageNum);
+//        map.put("pageSize", pageSize);
+//        map.put("scopeType", scopeType);
+//        return remoteExamService.list(map);
+//    }
+//
+//    /**
+//     * 去考试自动创建试卷
+//     */
+//    @ApiOperation(value = "去考试自动创建试卷")
+//    @PostMapping(value = "/create-paper/{examId}")
+//    public R<Object> createPaper(@PathVariable Long examId) {
+//        Map map = new HashMap(1);
+//        map.put("examId", examId);
+//        return remoteExamService.createPaper(map);
+//    }
+//
+//    /**
+//     * 获取试卷管理详细信息(答题卡信息)
+//     */
+//    @ApiOperation(value = "获取试卷管理详细信息(答题卡信息)")
+//    @GetMapping(value = "/paper/{id}")
+//    public R<Object> getInfo(@PathVariable("id") Long id) {
+//
+//        return remoteExamService.getInfo(id);
+//    }
+//
+//    /**
+//     * 答题过程根据 paperId 和 quId 查询问题和选项
+//     */
+//    @ApiOperation(value = "查询问题和选项")
+//    @PostMapping(value = "/paper/paperDetail/{paperId}/{quId}")
+//    public R<Object> queryQuDetail(@PathVariable Long paperId, @PathVariable Long quId) {
+//        Map map = new HashMap(2);
+//        map.put("paperId", paperId);
+//        map.put("quId", quId);
+//        return remoteExamService.queryQuDetail(map);
+//    }
+//
+//    /**
+//     * 填充答案 下一题实时保存上题答案
+//     */
+//    @ApiOperation(value = "保存用户答案")
+//    @PostMapping(value = "/paper/fillAnswer")
+//    public R<Object> fillAnswer(@RequestBody Map<String,Object> paperQuMap) {
+//        return remoteExamService.fillAnswer(paperQuMap);
+//    }
+//
+//    /**
+//     * 交卷操作
+//     */
+//    @ApiOperation(value = "交卷操作")
+//    @PostMapping(value = "/paper/handPaper/{id}")
+//    public R<Object> handPaper(@PathVariable Long id,@RequestParam(required = false) Long violationId) {
+//        Map map = new HashMap(1);
+//        map.put("id", id);
+//        map.put("violationId", violationId);
+//        return remoteExamService.handPaper(map);
+//    }
+//
+//    /**
+//     * 查询当前用户考试记录列表
+//     */
+//    @ApiOperation(value = "查询当前用户考试记录列表")
+//    @GetMapping("/my/exam/list")
+//    public TableDataInfo list(@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
+//        Long userId = tokenService.getLoginUser().getUserid();
+//        Map map = new HashMap(3);
+//        map.put("joinUserId", userId);
+//        map.put("appPageNum", pageNum);
+//        map.put("appPageSize", pageSize);
+//        return remoteExamService.myExamResultList(map);
+//    }
+//
+//
+//    /**
+//     * 交卷查询考试结果(没有调用,暂时不用)
+//     */
+//    @ApiOperation(value = "查询考试结果")
+//    @GetMapping(value = "/paper/paperResult/{id}")
+//    public R<Map> paperResult(@PathVariable Long id) {
+//
+//        Map map = new HashMap(1);
+//        map.put("id", id);
+//        return remoteExamService.paperResult(map);
+//    }
+//
+//    /**
+//     * 根据登录用户查询 我的证书列表
+//     */
+//    @PostMapping("/exam/queryMyCert")
+//    @ApiOperation(value = "根据登录用户查询 我的证书列表")
+//    public TableDataInfo queryMyCert(@RequestBody Map<String, Object> userCert) {
+//        return remoteExamService.queryMyCert(userCert);
+//    }
+//
+//    /**
+//     * 考试过程 查询当前考题的正确和错误数量(暂时不用)
+//     */
+//    @ApiOperation(value = "考试过程 查询当前考题的正确和错误数量")
+//    @GetMapping(value = "/paperStatistics/{id}")
+//    public R<Object> getPaperStatistics(@PathVariable("id") Long id) {
+//        return remoteExamService.getPaperStatistics(id);
+//    }
+//
+//
+//    /**
+//     * 根据登录用户查询 我的积分列表
+//     */
+//    @PostMapping("/points/record/list/myApp")
+//    @ApiOperation(value = "根据登录用户查询 我的积分列表")
+//    public TableDataInfo recordMyApp(@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
+//        Map<String, Object> myApp = new HashMap <>();
+//        myApp.put("appPageNum",pageNum);
+//        myApp.put("appPageSize",pageSize);
+//        return remoteExamService.recordMyApp(myApp);
+//    }
+//
+//    /**
+//     * 根据登录用户查询 我的积分统计
+//     */
+//    @ApiOperation(value = "根据登录用户查询 我的积分统计")
+//    @GetMapping(value = "/points/record/count/myApp")
+//    public R<Object> recordMyAppCount() {
+//        return remoteExamService.recordMyAppCount();
+//    }
+//
+//}

+ 57 - 57
zd-modules/zd-base/src/main/java/com/zd/base/job/task/ExamTask.java

@@ -1,57 +1,57 @@
-package com.zd.base.job.task;
-
-
-import com.zd.exam.api.feign.RemoteExamService;
-import com.zd.model.domain.R;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 考试定时调度任务
- *
- * @author liubo
- */
-@Component("examTask")
-public class ExamTask {
-
-    @Autowired
-    private RemoteExamService remoteExamService;
-
-    /**
-     * 超时弃考 调度任务
-     */
-    public void abandonPaper() {
-        remoteExamService.abandonPaper();
-    }
-
-    /**
-     * 一个月无违规获取配置表的奖励分 调度任务
-     */
-    public void getPointByNoViolation() {
-        Map map = new HashMap();
-        R r = remoteExamService.getBonusPointsConfig(map);
-        List <Map<String,Object>> list = (List<Map<String,Object>>) r.getData();
-        if(list!=null && !list.isEmpty()){
-            Map<String,Object> noViolation = list.get(0);
-            Integer monthNoviolationScore= Integer.parseInt(noViolation.get("monthNoviolationScore")+"");
-            if(monthNoviolationScore!=null){
-                Map violationMap = new HashMap();
-                R rlv = remoteExamService.getLastMonthViolation(violationMap);
-                List <Map<String,String>> recordList = (List <Map<String,String>>) rlv.getData();
-                for(Map key:recordList){
-                    Map <String,Object> obtainMap = new HashMap<>();
-                    // 用户
-                    obtainMap.put("joinUserId", key.get("joinUserId"));
-                    // 奖励的分数
-                    obtainMap.put("deductPoints", monthNoviolationScore);
-                    // 奖励的原因
-                    obtainMap.put("reason", "一个月无违规,奖励积分:"+monthNoviolationScore);
-                    remoteExamService.obtainBonusPoints(obtainMap);
-                }
-            }
-        }
-    }
-}
+//package com.zd.base.job.task;
+//
+//
+//import com.zd.exam.api.feign.RemoteExamService;
+//import com.zd.model.domain.R;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Component;
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//
+///**
+// * 考试定时调度任务
+// *
+// * @author liubo
+// */
+//@Component("examTask")
+//public class ExamTask {
+//
+//    @Autowired
+//    private RemoteExamService remoteExamService;
+//
+//    /**
+//     * 超时弃考 调度任务
+//     */
+//    public void abandonPaper() {
+//        remoteExamService.abandonPaper();
+//    }
+//
+//    /**
+//     * 一个月无违规获取配置表的奖励分 调度任务
+//     */
+//    public void getPointByNoViolation() {
+//        Map map = new HashMap();
+//        R r = remoteExamService.getBonusPointsConfig(map);
+//        List <Map<String,Object>> list = (List<Map<String,Object>>) r.getData();
+//        if(list!=null && !list.isEmpty()){
+//            Map<String,Object> noViolation = list.get(0);
+//            Integer monthNoviolationScore= Integer.parseInt(noViolation.get("monthNoviolationScore")+"");
+//            if(monthNoviolationScore!=null){
+//                Map violationMap = new HashMap();
+//                R rlv = remoteExamService.getLastMonthViolation(violationMap);
+//                List <Map<String,String>> recordList = (List <Map<String,String>>) rlv.getData();
+//                for(Map key:recordList){
+//                    Map <String,Object> obtainMap = new HashMap<>();
+//                    // 用户
+//                    obtainMap.put("joinUserId", key.get("joinUserId"));
+//                    // 奖励的分数
+//                    obtainMap.put("deductPoints", monthNoviolationScore);
+//                    // 奖励的原因
+//                    obtainMap.put("reason", "一个月无违规,奖励积分:"+monthNoviolationScore);
+//                    remoteExamService.obtainBonusPoints(obtainMap);
+//                }
+//            }
+//        }
+//    }
+//}

+ 40 - 40
zd-modules/zd-base/src/main/java/com/zd/base/job/task/FileViewTask.java

@@ -3,8 +3,8 @@ package com.zd.base.job.task;
 
 import com.zd.base.api.feign.RemoteKkFileService;
 import com.zd.common.core.redis.RedisService;
-import com.zd.exam.api.entity.ElResources;
-import com.zd.exam.api.feign.RemoteExamService;
+//import com.zd.exam.api.entity.ElResources;
+//import com.zd.exam.api.feign.RemoteExamService;
 import com.zd.model.domain.R;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -35,8 +35,8 @@ public class FileViewTask {
     private RemoteKkFileService remoteKkFileService;
     @Autowired
     private RedisService redisService;
-    @Autowired
-    private RemoteExamService remoteExamService;
+//    @Autowired
+//    private RemoteExamService remoteExamService;
 
     private URI url;
     {
@@ -54,42 +54,42 @@ public class FileViewTask {
      */
     public void cacheKkFile() throws InterruptedException {
         logger.info("***********文件分片任务开始***********");
-        R resourcesR = remoteExamService.listAll();
-        if (resourcesR.getCode() != 200) {
-            return;
-        }
-        List<ElResources> resourcesList = (List<ElResources>) resourcesR.getData();
-        for(ElResources resources:resourcesList){
-            resources.setPath("http://192.168.251.2/labSystem/"+resources.getPath());
-        }
-        if(resourcesList!=null && !resourcesList.isEmpty()){
-            logger.info("resourcesList.size()***********"+resourcesList.size()+"***********");
-        }
-        // 初始化计时器
-        CountDownLatch cdl = new CountDownLatch(!resourcesList.isEmpty()?resourcesList.size():5);
-        for (ElResources resources : resourcesList) {
-            executor.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        logger.info("ThreadName"+Thread.currentThread().getName()+"resourcesId:"+resources.getId());
-                        getKkFileAsync(resources.getPath());
-                    }catch (Exception e){
-                        logger.info("error msg:"+e.getMessage());
-                    }
-                    // 闭锁-1
-                    cdl.countDown();
-                }
-            });
-        }
-        try {
-            cdl.await();
-        } catch (InterruptedException e) {
-            logger.error(e.getMessage());
-            Thread.currentThread().interrupt();
-        }
-        //关闭线程池
-        executor.awaitTermination(5, TimeUnit.SECONDS);
+//        R resourcesR = remoteExamService.listAll();
+//        if (resourcesR.getCode() != 200) {
+//            return;
+//        }
+//        List<ElResources> resourcesList = (List<ElResources>) resourcesR.getData();
+//        for(ElResources resources:resourcesList){
+//            resources.setPath("http://192.168.251.2/labSystem/"+resources.getPath());
+//        }
+//        if(resourcesList!=null && !resourcesList.isEmpty()){
+//            logger.info("resourcesList.size()***********"+resourcesList.size()+"***********");
+//        }
+//        // 初始化计时器
+//        CountDownLatch cdl = new CountDownLatch(!resourcesList.isEmpty()?resourcesList.size():5);
+//        for (ElResources resources : resourcesList) {
+//            executor.submit(new Runnable() {
+//                @Override
+//                public void run() {
+//                    try {
+//                        logger.info("ThreadName"+Thread.currentThread().getName()+"resourcesId:"+resources.getId());
+//                        getKkFileAsync(resources.getPath());
+//                    }catch (Exception e){
+//                        logger.info("error msg:"+e.getMessage());
+//                    }
+//                    // 闭锁-1
+//                    cdl.countDown();
+//                }
+//            });
+//        }
+//        try {
+//            cdl.await();
+//        } catch (InterruptedException e) {
+//            logger.error(e.getMessage());
+//            Thread.currentThread().interrupt();
+//        }
+//        //关闭线程池
+//        executor.awaitTermination(5, TimeUnit.SECONDS);
         logger.info("***********文件分片任务完成***********");
     }
 

+ 0 - 5
zd-modules/zd-modules-laboratory/pom.xml

@@ -108,11 +108,6 @@
         </dependency>
 
         <dependency>
-            <groupId>com.zd.exam</groupId>
-            <artifactId>zd-exam-api</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>com.zd.algorithm</groupId>
             <artifactId>zd-algorithm-api</artifactId>
         </dependency>

+ 15 - 15
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabViolationController.java

@@ -9,7 +9,7 @@ import com.zd.common.core.utils.FileConfigUtils;
 import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.utils.UrlFormatUtils;
 import com.zd.common.core.web.controller.BaseController;
-import com.zd.exam.api.feign.RemoteExamService;
+//import com.zd.exam.api.feign.RemoteExamService;
 import com.zd.laboratory.domain.LabBlacklist;
 import com.zd.laboratory.domain.LabNegativelistHistory;
 import com.zd.laboratory.domain.LabViolation;
@@ -61,8 +61,8 @@ public class LabViolationController extends BaseController {
     @Autowired
     private ILabBlacklistService blacklistService;
 
-    @Autowired
-    private RemoteExamService remoteExamService;
+//    @Autowired
+//    private RemoteExamService remoteExamService;
 
     @Autowired
     private FileConfigUtils fileConfigUtils;
@@ -308,18 +308,18 @@ public class LabViolationController extends BaseController {
 
     @GetMapping("/getIntegralMatchingRules")
     public ResultData getIntegralMatchingRules(@RequestParam String creditScore){
-        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();
-                //获取积分详情列表
-                List<Map<String, Object>> pointsConfigDetail = (List<Map<String, Object>>) pointsConfig.get("configDetailList");
-                ElPassConfigdetailVO result = blacklistService.getIntegralMatchingRules(pointsConfigDetail,Integer.valueOf(creditScore));
-               return ResultData.success(result);
-            }
-        }
+//        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();
+//                //获取积分详情列表
+//                List<Map<String, Object>> pointsConfigDetail = (List<Map<String, Object>>) pointsConfig.get("configDetailList");
+//                ElPassConfigdetailVO result = blacklistService.getIntegralMatchingRules(pointsConfigDetail,Integer.valueOf(creditScore));
+//               return ResultData.success(result);
+//            }
+//        }
         return null;
     }
 

+ 22 - 22
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/onemachine/service/OneMachineService.java

@@ -11,7 +11,7 @@ import com.zd.common.core.utils.Assert;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.IdUtils;
 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.dto.LabViolationDTO;
 import com.zd.laboratory.domain.vo.*;
@@ -83,8 +83,8 @@ public class OneMachineService implements ValidationSignInPerInfo {
     private ILabSubAccessCheckLogService labSubAccessCheckLogService;
     @Autowired
     LabHardwareStateMapper hardwareStateMapper;
-    @Autowired
-    RemoteExamService remoteExamService;
+//    @Autowired
+//    RemoteExamService remoteExamService;
     @Autowired
     LabSubjectAccessRecordMapper labSubjectAccessRecordMapper;
     @Autowired
@@ -355,16 +355,16 @@ public class OneMachineService implements ValidationSignInPerInfo {
                         return ResultData.fail("当前用户已经签到成功,不能重复签到!");
                     }
 
-                    //学生登陆时 给奖励分
-                    if (UserConstants.USER_TYPE_STUDENT.equals(user.getType())) {
-                        Map map = new HashMap();
-                        map.put("userId", user.getUserId());
-                        map.put("status", "0");
-                        r = remoteExamService.addLoginfo(map);
-                        if (r.getCode() != 200) {
-                            logger.info("打卡签到奖励分记录保存失败!");
-                        }
-                    }
+//                    //学生登陆时 给奖励分
+//                    if (UserConstants.USER_TYPE_STUDENT.equals(user.getType())) {
+//                        Map map = new HashMap();
+//                        map.put("userId", user.getUserId());
+//                        map.put("status", "0");
+//                        r = remoteExamService.addLoginfo(map);
+//                        if (r.getCode() != 200) {
+//                            logger.info("打卡签到奖励分记录保存失败!");
+//                        }
+//                    }
                     // 用户签到成功检测有无管控工作,有则发起通知
                     labGradeManageRecordService.sendManageMsgBySiginUser(user.getUserId(), Long.parseLong(s));
 
@@ -374,15 +374,15 @@ public class OneMachineService implements ValidationSignInPerInfo {
                     redisService.deleteObject(verifyKey);
                     subjectAccessRecordService.out(Long.parseLong(s), user.getUserId());
 
-                    if (UserConstants.USER_TYPE_STUDENT.equals(user.getType())) {
-                        Map map = new HashMap();
-                        map.put("userId", user.getUserId());
-                        map.put("status", "1");
-                        R r = remoteExamService.addLoginfo(map);
-                        if (r.getCode() != 200) {
-                            logger.info("打卡签出奖励分记录保存失败!");
-                        }
-                    }
+//                    if (UserConstants.USER_TYPE_STUDENT.equals(user.getType())) {
+//                        Map map = new HashMap();
+//                        map.put("userId", user.getUserId());
+//                        map.put("status", "1");
+//                        R r = remoteExamService.addLoginfo(map);
+//                        if (r.getCode() != 200) {
+//                            logger.info("打卡签出奖励分记录保存失败!");
+//                        }
+//                    }
 
                     // 这里通过实验室id查询楼层id
                     LabBuildFloorLayout labBuildFloorLayout = new LabBuildFloorLayout();

+ 22 - 22
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabApprovalServiceImpl.java

@@ -4,7 +4,7 @@ import com.zd.common.core.annotation.DataScope;
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.DateUtils;
-import com.zd.exam.api.feign.RemoteExamService;
+//import com.zd.exam.api.feign.RemoteExamService;
 import com.zd.laboratory.domain.LabApproval;
 import com.zd.laboratory.domain.LabApprovalDetail;
 import com.zd.laboratory.domain.LabSecurityGroup;
@@ -40,8 +40,8 @@ public class LabApprovalServiceImpl implements ILabApprovalService {
     private LabApprovalDetailMapper labApprovalDetailMapper;
     @Autowired
     private TokenService tokenService;
-    @Autowired
-    private RemoteExamService remoteExamService;
+//    @Autowired
+//    private RemoteExamService remoteExamService;
 
     /**
      * 查询安全准入审批记录
@@ -181,25 +181,25 @@ public class LabApprovalServiceImpl implements ILabApprovalService {
         labApproval.setExpirationDate(date);
         int num = labApprovalMapper.updateLabApproval(labApproval);
 
-        LabApprovalAndDetailDTO labApprovalAndDetailDTO = labApprovalMapper.selectLabApprovalById(labApproval.getId());
-        if(labApprovalAndDetailDTO!=null){
-            //查询当前人员是否获取实验室安全证书
-            List<LabApprovalVO> cardList = labApprovalMapper.selectLabCardByUserid(labApprovalAndDetailDTO.getJoinUserId());
-            Integer gainSafeCert;
-            if(!cardList.isEmpty()){
-                gainSafeCert = 1;
-            }else{
-                gainSafeCert = 0;
-            }
-            Map<String,Object> initMap = new HashMap<>();
-            initMap.put("joinUserId",labApprovalAndDetailDTO.getJoinUserId());
-            initMap.put("nickName",labApprovalAndDetailDTO.getNickName());
-            initMap.put("userName",labApprovalAndDetailDTO.getUserName());
-            initMap.put("gainSafeCert",gainSafeCert);
-            initMap.put("gainSubSafeCert",1);
-            initMap.put("reason","获取实验室安全准入资格");
-            remoteExamService.initCreditPoints(initMap);
-        }
+//        LabApprovalAndDetailDTO labApprovalAndDetailDTO = labApprovalMapper.selectLabApprovalById(labApproval.getId());
+//        if(labApprovalAndDetailDTO!=null){
+//            //查询当前人员是否获取实验室安全证书
+//            List<LabApprovalVO> cardList = labApprovalMapper.selectLabCardByUserid(labApprovalAndDetailDTO.getJoinUserId());
+//            Integer gainSafeCert;
+//            if(!cardList.isEmpty()){
+//                gainSafeCert = 1;
+//            }else{
+//                gainSafeCert = 0;
+//            }
+//            Map<String,Object> initMap = new HashMap<>();
+//            initMap.put("joinUserId",labApprovalAndDetailDTO.getJoinUserId());
+//            initMap.put("nickName",labApprovalAndDetailDTO.getNickName());
+//            initMap.put("userName",labApprovalAndDetailDTO.getUserName());
+//            initMap.put("gainSafeCert",gainSafeCert);
+//            initMap.put("gainSubSafeCert",1);
+//            initMap.put("reason","获取实验室安全准入资格");
+//            remoteExamService.initCreditPoints(initMap);
+//        }
 
         return num;
     }

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

@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.zd.common.core.annotation.DataScope;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.*;
-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.LabBlackdetail;
 import com.zd.laboratory.domain.LabBlacklist;
@@ -38,8 +38,8 @@ public class LabBlacklistServiceImpl implements ILabBlacklistService {
     private LabBlacklistMapper labBlacklistMapper;
     @Autowired
     private LabBlackdetailMapper labBlackdetailMapper;
-    @Autowired
-    private RemoteExamService remoteExamService;
+//    @Autowired
+//    private RemoteExamService remoteExamService;
     @Autowired
     private TokenService tokenService;
     @Autowired
@@ -156,70 +156,70 @@ public class LabBlacklistServiceImpl implements ILabBlacklistService {
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int addBlacklist(LabBlacklistVO labBlacklistVO) {
-        Map<String, Object> markconfigMap = new HashMap<>();
-        R<Object> data = remoteExamService.getPointsConfig(markconfigMap);
+//        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");
-                //查询userid,是不是之前已经有进入过黑名单记录,没有需要新增,有则查回来修改。
-                LabBlacklist userBlack = labBlacklistMapper.selectLabBlacklistByUserId(labBlacklistVO.getJoinUserId());
-                if (userBlack != null) {
-                    //修改黑名单用户列表信息
-                    LabBlacklist userBlackNew = new LabBlacklist();
-                    userBlackNew.setId(userBlack.getId());
-                    userBlackNew.setBlacklistStatus(1);
-                    userBlackNew.setJoinUserId(userBlack.getJoinUserId());
-                    userBlackNew.setReason(labBlacklistVO.getReason());
-                    userBlackNew.setCreditScore(labBlacklistVO.getCreditScore());
-                    if (!labBlacklistVO.getFlagAction()) {
-                        if (tokenService.getLoginUser() != null) {
-                            userBlackNew.setUpdateBy(tokenService.getLoginUser().getNickName());
-                        } else {
-                            userBlackNew.setUpdateBy("系统");
-                        }
-                    } else {
-                        userBlackNew.setUpdateBy("系统");
-                    }
-
-                    userBlackNew.setUpdateTime(new Date());
-                    labBlacklistMapper.updateLabBlacklist(userBlackNew);
-                    //循环判断积分匹配规则
-                    ElPassConfigdetailVO passConfigdetailVO = getIntegralMatchingRules(pointsConfigDetail, Integer.parseInt(labBlacklistVO.getSurplusCreditScore()));
-                    //处理黑名单日志方法
-                    flag = handleBlackDetail(passConfigdetailVO, userBlackNew, labBlacklistVO.getSurplusCreditScore(), labBlacklistVO.getFlagAction());
-                    return flag;
-                } else {
-                    //插入黑名单列表
-                    LabBlacklist labBlacklistNew = new LabBlacklist();
-                    labBlacklistNew.setJoinUserId(labBlacklistVO.getJoinUserId());
-                    labBlacklistNew.setBlacklistStatus(1);
-                    labBlacklistNew.setReason(labBlacklistVO.getReason());
-                    if (!labBlacklistVO.getFlagAction()) {
-                        if (tokenService.getLoginUser() != null) {
-                            labBlacklistNew.setCreateBy(tokenService.getLoginUser().getNickName());
-                        } else {
-                            labBlacklistNew.setCreateBy("系统");
-                        }
-                    } else {
-                        labBlacklistNew.setCreateBy("系统");
-                    }
-
-                    labBlacklistNew.setCreateTime(new Date());
-                    labBlacklistNew.setCreditScore(labBlacklistVO.getCreditScore());
-                    labBlacklistMapper.insertLabBlacklist(labBlacklistNew);
-
-                    //循环判断积分匹配规则
-                    ElPassConfigdetailVO passConfigdetailVO = getIntegralMatchingRules(pointsConfigDetail, Integer.parseInt(labBlacklistVO.getSurplusCreditScore()));
-                    //处理黑名单日志方法
-                    flag = handleBlackDetail(passConfigdetailVO, labBlacklistNew, labBlacklistVO.getSurplusCreditScore(), labBlacklistVO.getFlagAction());
-                    return flag;
-                }
-            }
-        }
+//        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");
+//                //查询userid,是不是之前已经有进入过黑名单记录,没有需要新增,有则查回来修改。
+//                LabBlacklist userBlack = labBlacklistMapper.selectLabBlacklistByUserId(labBlacklistVO.getJoinUserId());
+//                if (userBlack != null) {
+//                    //修改黑名单用户列表信息
+//                    LabBlacklist userBlackNew = new LabBlacklist();
+//                    userBlackNew.setId(userBlack.getId());
+//                    userBlackNew.setBlacklistStatus(1);
+//                    userBlackNew.setJoinUserId(userBlack.getJoinUserId());
+//                    userBlackNew.setReason(labBlacklistVO.getReason());
+//                    userBlackNew.setCreditScore(labBlacklistVO.getCreditScore());
+//                    if (!labBlacklistVO.getFlagAction()) {
+//                        if (tokenService.getLoginUser() != null) {
+//                            userBlackNew.setUpdateBy(tokenService.getLoginUser().getNickName());
+//                        } else {
+//                            userBlackNew.setUpdateBy("系统");
+//                        }
+//                    } else {
+//                        userBlackNew.setUpdateBy("系统");
+//                    }
+//
+//                    userBlackNew.setUpdateTime(new Date());
+//                    labBlacklistMapper.updateLabBlacklist(userBlackNew);
+//                    //循环判断积分匹配规则
+//                    ElPassConfigdetailVO passConfigdetailVO = getIntegralMatchingRules(pointsConfigDetail, Integer.parseInt(labBlacklistVO.getSurplusCreditScore()));
+//                    //处理黑名单日志方法
+//                    flag = handleBlackDetail(passConfigdetailVO, userBlackNew, labBlacklistVO.getSurplusCreditScore(), labBlacklistVO.getFlagAction());
+//                    return flag;
+//                } else {
+//                    //插入黑名单列表
+//                    LabBlacklist labBlacklistNew = new LabBlacklist();
+//                    labBlacklistNew.setJoinUserId(labBlacklistVO.getJoinUserId());
+//                    labBlacklistNew.setBlacklistStatus(1);
+//                    labBlacklistNew.setReason(labBlacklistVO.getReason());
+//                    if (!labBlacklistVO.getFlagAction()) {
+//                        if (tokenService.getLoginUser() != null) {
+//                            labBlacklistNew.setCreateBy(tokenService.getLoginUser().getNickName());
+//                        } else {
+//                            labBlacklistNew.setCreateBy("系统");
+//                        }
+//                    } else {
+//                        labBlacklistNew.setCreateBy("系统");
+//                    }
+//
+//                    labBlacklistNew.setCreateTime(new Date());
+//                    labBlacklistNew.setCreditScore(labBlacklistVO.getCreditScore());
+//                    labBlacklistMapper.insertLabBlacklist(labBlacklistNew);
+//
+//                    //循环判断积分匹配规则
+//                    ElPassConfigdetailVO passConfigdetailVO = getIntegralMatchingRules(pointsConfigDetail, Integer.parseInt(labBlacklistVO.getSurplusCreditScore()));
+//                    //处理黑名单日志方法
+//                    flag = handleBlackDetail(passConfigdetailVO, labBlacklistNew, labBlacklistVO.getSurplusCreditScore(), labBlacklistVO.getFlagAction());
+//                    return flag;
+//                }
+//            }
+//        }
 
         return flag;
     }
@@ -448,55 +448,55 @@ public class LabBlacklistServiceImpl implements ILabBlacklistService {
     @Override
     public int removeBlacklist(LabBlacklist labBlacklist) {
         int flag = 500;
-        //给积分管理,写入对应的内容
-        LabBlacklist userBlack = labBlacklistMapper.selectLabBlacklistById(labBlacklist.getJoinUserId());
-        if (StringUtils.isNotNull(userBlack)) {
-            Map<String, Object> recoveryMap = new HashMap<>();
-            recoveryMap.put("joinUserId", userBlack.getJoinUserId() + "");
-            recoveryMap.put("pointsType", "1");
-            recoveryMap.put("reason", "手动恢复黑名单" + labBlacklist.getReason());
-            R<Object> data = remoteExamService.recoveryPoints(recoveryMap);
-            if (data != null) {
-                String code = data.getCode() + "";
-                if (code.equals("200")) {
-                    LabBlacklist labBlacklistNew = new LabBlacklist();
-                    //修改黑名单状态
-                    labBlacklistNew.setJoinUserId(labBlacklist.getJoinUserId());
-                    labBlacklistNew.setUpdateTime(DateUtils.getNowDate());
-                    labBlacklistNew.setUpdateBy(SecurityUtils.getUsername());
-                    labBlacklistNew.setBlacklistStatus(0);
-                    flag = labBlacklistMapper.updateLabBlacklist(labBlacklistNew);
-                    //移除黑名单,需要变更详细表考试状态为已恢复。
-                    LabBlackdetailVO blackdetailVO = new LabBlackdetailVO();
-                    blackdetailVO.setBlackId(userBlack.getId());
-                    List<LabBlackdetailVO> labBlackdetailVOList = labBlackdetailMapper.selectLabBlackdetailList(blackdetailVO);
-                    int limit = 0;
-                    for (LabBlackdetailVO labBlackdetailVO : labBlackdetailVOList) {
-                        if (limit == 1) {
-                            break;
-                        }
-                        if (labBlackdetailVO.getLearnStatus().equals(0)) {
-                            labBlackdetailVO.setLearnStatus(2);
-                        }
-                        if (labBlackdetailVO.getTestStatus().equals(0)) {
-                            labBlackdetailVO.setTestStatus(2);
-                        }
-                        if (labBlackdetailVO.getPracticeStatus().equals(0)) {
-                            labBlackdetailVO.setPracticeStatus(2);
-                        }
-                        labBlackdetailVO.setUserId(null);
-                        labBlackdetailVO.setOverStatus(1);
-                        labBlackdetailMapper.updateLabBlackdetail(labBlackdetailVO);
-                        limit++;
-                    }
-                    //这里调用刘吉焕的移除负面清单方法
-                    iLabViolationService.resetUserStatus(labBlacklist.getJoinUserId(), labBlacklist.getReason());
-                }
-            }
-        } else {
-            //这里调用刘吉焕的移除负面清单方法
-            iLabViolationService.resetUserStatus(labBlacklist.getJoinUserId(), labBlacklist.getReason());
-        }
+//        //给积分管理,写入对应的内容
+//        LabBlacklist userBlack = labBlacklistMapper.selectLabBlacklistById(labBlacklist.getJoinUserId());
+//        if (StringUtils.isNotNull(userBlack)) {
+//            Map<String, Object> recoveryMap = new HashMap<>();
+//            recoveryMap.put("joinUserId", userBlack.getJoinUserId() + "");
+//            recoveryMap.put("pointsType", "1");
+//            recoveryMap.put("reason", "手动恢复黑名单" + labBlacklist.getReason());
+//            R<Object> data = remoteExamService.recoveryPoints(recoveryMap);
+//            if (data != null) {
+//                String code = data.getCode() + "";
+//                if (code.equals("200")) {
+//                    LabBlacklist labBlacklistNew = new LabBlacklist();
+//                    //修改黑名单状态
+//                    labBlacklistNew.setJoinUserId(labBlacklist.getJoinUserId());
+//                    labBlacklistNew.setUpdateTime(DateUtils.getNowDate());
+//                    labBlacklistNew.setUpdateBy(SecurityUtils.getUsername());
+//                    labBlacklistNew.setBlacklistStatus(0);
+//                    flag = labBlacklistMapper.updateLabBlacklist(labBlacklistNew);
+//                    //移除黑名单,需要变更详细表考试状态为已恢复。
+//                    LabBlackdetailVO blackdetailVO = new LabBlackdetailVO();
+//                    blackdetailVO.setBlackId(userBlack.getId());
+//                    List<LabBlackdetailVO> labBlackdetailVOList = labBlackdetailMapper.selectLabBlackdetailList(blackdetailVO);
+//                    int limit = 0;
+//                    for (LabBlackdetailVO labBlackdetailVO : labBlackdetailVOList) {
+//                        if (limit == 1) {
+//                            break;
+//                        }
+//                        if (labBlackdetailVO.getLearnStatus().equals(0)) {
+//                            labBlackdetailVO.setLearnStatus(2);
+//                        }
+//                        if (labBlackdetailVO.getTestStatus().equals(0)) {
+//                            labBlackdetailVO.setTestStatus(2);
+//                        }
+//                        if (labBlackdetailVO.getPracticeStatus().equals(0)) {
+//                            labBlackdetailVO.setPracticeStatus(2);
+//                        }
+//                        labBlackdetailVO.setUserId(null);
+//                        labBlackdetailVO.setOverStatus(1);
+//                        labBlackdetailMapper.updateLabBlackdetail(labBlackdetailVO);
+//                        limit++;
+//                    }
+//                    //这里调用刘吉焕的移除负面清单方法
+//                    iLabViolationService.resetUserStatus(labBlacklist.getJoinUserId(), labBlacklist.getReason());
+//                }
+//            }
+//        } else {
+//            //这里调用刘吉焕的移除负面清单方法
+//            iLabViolationService.resetUserStatus(labBlacklist.getJoinUserId(), labBlacklist.getReason());
+//        }
 
         return flag;
     }
@@ -511,55 +511,55 @@ public class LabBlacklistServiceImpl implements ILabBlacklistService {
     @Override
     public int removeBlacklistByPc(LabBlacklist labBlacklist) {
         int flag = 500;
-        //给积分管理,写入对应的内容
-        LabBlacklist userBlack = labBlacklistMapper.selectLabBlacklistById(labBlacklist.getJoinUserId());
-        if (StringUtils.isNotNull(userBlack)) {
-            Map<String, Object> recoveryMap = new HashMap<>();
-            recoveryMap.put("joinUserId", userBlack.getJoinUserId() + "");
-            recoveryMap.put("pointsType", "1");
-            recoveryMap.put("reason", "手动恢复黑名单(" + labBlacklist.getReason() + ")");
-            R<Object> data = remoteExamService.recoveryPoints(recoveryMap);
-            if (data != null) {
-                String code = data.getCode() + "";
-                if (code.equals("200")) {
-                    LabBlacklist labBlacklistNew = new LabBlacklist();
-                    //修改黑名单状态
-                    labBlacklistNew.setJoinUserId(labBlacklist.getJoinUserId());
-                    labBlacklistNew.setUpdateTime(DateUtils.getNowDate());
-                    labBlacklistNew.setUpdateBy(SecurityUtils.getUsername());
-                    labBlacklistNew.setBlacklistStatus(0);
-                    flag = labBlacklistMapper.updateLabBlacklist(labBlacklistNew);
-                    //移除黑名单,需要变更详细表考试状态为已恢复。
-                    LabBlackdetailVO blackdetailVO = new LabBlackdetailVO();
-                    blackdetailVO.setBlackId(userBlack.getId());
-                    List<LabBlackdetailVO> labBlackdetailVOList = labBlackdetailMapper.selectLabBlackdetailList(blackdetailVO);
-                    int limit = 0;
-                    for (LabBlackdetailVO labBlackdetailVO : labBlackdetailVOList) {
-                        if (limit == 1) {
-                            break;
-                        }
-                        if (labBlackdetailVO.getLearnStatus().equals(0)) {
-                            labBlackdetailVO.setLearnStatus(2);
-                        }
-                        if (labBlackdetailVO.getTestStatus().equals(0)) {
-                            labBlackdetailVO.setTestStatus(2);
-                        }
-                        if (labBlackdetailVO.getPracticeStatus().equals(0)) {
-                            labBlackdetailVO.setPracticeStatus(2);
-                        }
-                        labBlackdetailVO.setUserId(null);
-                        labBlackdetailVO.setOverStatus(2);
-                        labBlackdetailMapper.updateLabBlackdetail(labBlackdetailVO);
-                        limit++;
-                    }
-                    //这里调用刘吉焕的移除负面清单方法
-                    iLabViolationService.resetUserRecovery(labBlacklist.getJoinUserId(), labBlacklist.getReason());
-                }
-            }
-        } else {
-            //这里调用刘吉焕的移除负面清单方法
-            iLabViolationService.resetUserRecovery(labBlacklist.getJoinUserId(), labBlacklist.getReason());
-        }
+//        //给积分管理,写入对应的内容
+//        LabBlacklist userBlack = labBlacklistMapper.selectLabBlacklistById(labBlacklist.getJoinUserId());
+//        if (StringUtils.isNotNull(userBlack)) {
+//            Map<String, Object> recoveryMap = new HashMap<>();
+//            recoveryMap.put("joinUserId", userBlack.getJoinUserId() + "");
+//            recoveryMap.put("pointsType", "1");
+//            recoveryMap.put("reason", "手动恢复黑名单(" + labBlacklist.getReason() + ")");
+//            R<Object> data = remoteExamService.recoveryPoints(recoveryMap);
+//            if (data != null) {
+//                String code = data.getCode() + "";
+//                if (code.equals("200")) {
+//                    LabBlacklist labBlacklistNew = new LabBlacklist();
+//                    //修改黑名单状态
+//                    labBlacklistNew.setJoinUserId(labBlacklist.getJoinUserId());
+//                    labBlacklistNew.setUpdateTime(DateUtils.getNowDate());
+//                    labBlacklistNew.setUpdateBy(SecurityUtils.getUsername());
+//                    labBlacklistNew.setBlacklistStatus(0);
+//                    flag = labBlacklistMapper.updateLabBlacklist(labBlacklistNew);
+//                    //移除黑名单,需要变更详细表考试状态为已恢复。
+//                    LabBlackdetailVO blackdetailVO = new LabBlackdetailVO();
+//                    blackdetailVO.setBlackId(userBlack.getId());
+//                    List<LabBlackdetailVO> labBlackdetailVOList = labBlackdetailMapper.selectLabBlackdetailList(blackdetailVO);
+//                    int limit = 0;
+//                    for (LabBlackdetailVO labBlackdetailVO : labBlackdetailVOList) {
+//                        if (limit == 1) {
+//                            break;
+//                        }
+//                        if (labBlackdetailVO.getLearnStatus().equals(0)) {
+//                            labBlackdetailVO.setLearnStatus(2);
+//                        }
+//                        if (labBlackdetailVO.getTestStatus().equals(0)) {
+//                            labBlackdetailVO.setTestStatus(2);
+//                        }
+//                        if (labBlackdetailVO.getPracticeStatus().equals(0)) {
+//                            labBlackdetailVO.setPracticeStatus(2);
+//                        }
+//                        labBlackdetailVO.setUserId(null);
+//                        labBlackdetailVO.setOverStatus(2);
+//                        labBlackdetailMapper.updateLabBlackdetail(labBlackdetailVO);
+//                        limit++;
+//                    }
+//                    //这里调用刘吉焕的移除负面清单方法
+//                    iLabViolationService.resetUserRecovery(labBlacklist.getJoinUserId(), labBlacklist.getReason());
+//                }
+//            }
+//        } else {
+//            //这里调用刘吉焕的移除负面清单方法
+//            iLabViolationService.resetUserRecovery(labBlacklist.getJoinUserId(), labBlacklist.getReason());
+//        }
 
         return flag;
     }

+ 52 - 52
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabNegativeListRecordsServiceImpl.java

@@ -1,7 +1,7 @@
 package com.zd.laboratory.service.impl;
 
 import com.zd.common.core.annotation.DataScope;
-import com.zd.exam.api.feign.RemoteExamService;
+//import com.zd.exam.api.feign.RemoteExamService;
 import com.zd.laboratory.domain.LabNegativeListRecords;
 import com.zd.laboratory.domain.LabNegativelistHistory;
 import com.zd.laboratory.domain.vo.LabBlackdetailVO;
@@ -40,8 +40,8 @@ public class LabNegativeListRecordsServiceImpl implements ILabNegativeListRecord
     @Autowired
     private LabNegativelistHistoryMapper labNegativelistHistoryMapper;
 
-    @Autowired
-    private RemoteExamService remoteExamService;
+//    @Autowired
+//    private RemoteExamService remoteExamService;
 
     @Autowired
     private LabNegativelistHistoryMapper negativeHistoryMapper;
@@ -86,31 +86,31 @@ public class LabNegativeListRecordsServiceImpl implements ILabNegativeListRecord
     @Override
     public ResultData insertLabNegativeListRecords(LabNegativelistHistory history)
     {
-        LabNegativeListRecords negativeListRecords = labNegativeListRecordsMapper.findByUserId(history.getUserId());
-        if (negativeListRecords!=null){
-            Map map = new HashMap();
-            map.put("joinUserId",history.getUserId());
-            map.put("deductPoints",history.getCreditScore());
-            map.put("pointsType","2");
-            map.put("reason",history.getReason());
-            remoteExamService.deductionPoints(map);
-            Integer val = (negativeListRecords.getCeditScore())-(history.getCreditScore().intValue());
-            negativeListRecords.setCeditScore(val);
-            negativeListRecords.setViolationNum(1L);
-            labNegativeListRecordsMapper.updateLabNegativeListRecords(negativeListRecords);
-        }else{
-            negativeListRecords = new LabNegativeListRecords();
-            negativeListRecords.setUserId(history.getUserId());
-            negativeListRecords.setViolationNum(1L);
-            negativeListRecords.setCeditScore(history.getCreditScore().intValue());
-            labNegativeListRecordsMapper.insertLabNegativeListRecords(negativeListRecords);
-            history.setBlackId(negativeListRecords.getId());
-        }
-
-        //给历史记录插入一条记录
-        history.setDataType(1);
-        int row = negativelistHistoryService.insertLabNegativelistHistory(history);
-        if (row > 0) return ResultData.success();
+//        LabNegativeListRecords negativeListRecords = labNegativeListRecordsMapper.findByUserId(history.getUserId());
+//        if (negativeListRecords!=null){
+//            Map map = new HashMap();
+//            map.put("joinUserId",history.getUserId());
+//            map.put("deductPoints",history.getCreditScore());
+//            map.put("pointsType","2");
+//            map.put("reason",history.getReason());
+//            remoteExamService.deductionPoints(map);
+//            Integer val = (negativeListRecords.getCeditScore())-(history.getCreditScore().intValue());
+//            negativeListRecords.setCeditScore(val);
+//            negativeListRecords.setViolationNum(1L);
+//            labNegativeListRecordsMapper.updateLabNegativeListRecords(negativeListRecords);
+//        }else{
+//            negativeListRecords = new LabNegativeListRecords();
+//            negativeListRecords.setUserId(history.getUserId());
+//            negativeListRecords.setViolationNum(1L);
+//            negativeListRecords.setCeditScore(history.getCreditScore().intValue());
+//            labNegativeListRecordsMapper.insertLabNegativeListRecords(negativeListRecords);
+//            history.setBlackId(negativeListRecords.getId());
+//        }
+//
+//        //给历史记录插入一条记录
+//        history.setDataType(1);
+//        int row = negativelistHistoryService.insertLabNegativelistHistory(history);
+//        if (row > 0) return ResultData.success();
         return ResultData.fail();
     }
 
@@ -219,36 +219,36 @@ public class LabNegativeListRecordsServiceImpl implements ILabNegativeListRecord
 
     @Override
     public ResultData delNegivelist(LabNegativeListRecordsVO vo) {
-        //更改按钮状态
-        Map<String,Object> recoveryMap = new HashMap<>();
-        recoveryMap.put("joinUserId",vo.getUserId()+"");
-        recoveryMap.put("pointsType","1");
-        recoveryMap.put("reason",vo.getReason());
-        //恢复积分
-        R<Object> data = remoteExamService.recoveryPoints(recoveryMap);
-        if (data.getCode()==200) {
-            return ResultData.success();
-        }
+//        //更改按钮状态
+//        Map<String,Object> recoveryMap = new HashMap<>();
+//        recoveryMap.put("joinUserId",vo.getUserId()+"");
+//        recoveryMap.put("pointsType","1");
+//        recoveryMap.put("reason",vo.getReason());
+//        //恢复积分
+//        R<Object> data = remoteExamService.recoveryPoints(recoveryMap);
+//        if (data.getCode()==200) {
+//            return ResultData.success();
+//        }
         return ResultData.fail();
 
     }
 
     @Override
     public ResultData delexam(LabNegativeListRecordsVO vo) {
-        LabNegativeListRecords records = this.labNegativeListRecordsMapper.findByUserId(vo.getUserId());
-        if (records!=null){
-            //恢复信用分,并且将状态置为正常,非负面清单
-            violationService.resetCreditScore(vo.getUserId());
-        }
-
-        updateIsNegative(vo.getUserId(),0L);
-        Map<String,Object> recoveryMap = new HashMap<>();
-        recoveryMap.put("joinUserId",vo.getUserId()+"");
-        recoveryMap.put("pointsType","1");
-        recoveryMap.put("reason",vo.getReason());
-        //恢复积分
-        R<Object> data = remoteExamService.recoveryPoints(recoveryMap);
-        if (data.getCode()==200) return ResultData.success();
+//        LabNegativeListRecords records = this.labNegativeListRecordsMapper.findByUserId(vo.getUserId());
+//        if (records!=null){
+//            //恢复信用分,并且将状态置为正常,非负面清单
+//            violationService.resetCreditScore(vo.getUserId());
+//        }
+//
+//        updateIsNegative(vo.getUserId(),0L);
+//        Map<String,Object> recoveryMap = new HashMap<>();
+//        recoveryMap.put("joinUserId",vo.getUserId()+"");
+//        recoveryMap.put("pointsType","1");
+//        recoveryMap.put("reason",vo.getReason());
+//        //恢复积分
+//        R<Object> data = remoteExamService.recoveryPoints(recoveryMap);
+//        if (data.getCode()==200) return ResultData.success();
         return ResultData.success();
     }
 

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

@@ -10,7 +10,7 @@ import com.zd.common.core.utils.BeanUtils;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.SecurityUtils;
 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.LabMessageUser;
 import com.zd.laboratory.domain.LabMessageDynamic;
 import com.zd.laboratory.domain.LabSecurityApply;
@@ -64,8 +64,8 @@ public class LabSecurityApplyServiceImpl implements ILabSecurityApplyService {
     @Autowired
     private LabSecurityMaterialrelationMapper labSecurityMaterialrelationMapper;
 
-    @Autowired
-    private RemoteExamService remoteExamService;
+//    @Autowired
+//    private RemoteExamService remoteExamService;
 
     @Autowired
     private RemoteUserService remoteUserService;
@@ -177,18 +177,18 @@ public class LabSecurityApplyServiceImpl implements ILabSecurityApplyService {
             //查询该条记录的详情
             LabSecurityApplyVO applyVO= labSecurityApplyMapper.selectLabSecurityApplyById(labSecurityApply.getId());
 
-            if(UserConstants.USER_TYPE_STUDENT.equals(applyVO.getUserType())){
-                //为学生时初始化分值
-                List<Map<String, Object>> cerlist= labSecurityApplyMapper.selectUserCertList(applyVO.getUserId());
-                Map<String,Object> initMap = new HashMap<>();
-                initMap.put("joinUserId",applyVO.getUserId());
-                initMap.put("nickName",applyVO.getUserName());
-                initMap.put("userName",applyVO.getUserNumber());
-                initMap.put("gainSafeCert",!cerlist.isEmpty()?1:0);
-                initMap.put("gainSubSafeCert",1);
-                initMap.put("reason","获取实验室安全准入资格");
-                remoteExamService.initCreditPoints(initMap);
-            }
+//            if(UserConstants.USER_TYPE_STUDENT.equals(applyVO.getUserType())){
+//                //为学生时初始化分值
+//                List<Map<String, Object>> cerlist= labSecurityApplyMapper.selectUserCertList(applyVO.getUserId());
+//                Map<String,Object> initMap = new HashMap<>();
+//                initMap.put("joinUserId",applyVO.getUserId());
+//                initMap.put("nickName",applyVO.getUserName());
+//                initMap.put("userName",applyVO.getUserNumber());
+//                initMap.put("gainSafeCert",!cerlist.isEmpty()?1:0);
+//                initMap.put("gainSubSafeCert",1);
+//                initMap.put("reason","获取实验室安全准入资格");
+//                remoteExamService.initCreditPoints(initMap);
+//            }
             haiKangDoorService.addUserDoorByApplay(applyVO, tokenService.getLoginUser());
         }
         labSecurityApply.setUpdateTime(DateUtils.getNowDate());

+ 86 - 85
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSubjectAccessRecordServiceImpl.java

@@ -6,7 +6,7 @@ import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.SecurityUtils;
 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.LabOnepc;
 import com.zd.laboratory.domain.LabSubjectAccessRecord;
 import com.zd.laboratory.domain.LabViolationScoreSite;
@@ -23,7 +23,7 @@ import com.zd.laboratory.service.ILabBlacklistService;
 import com.zd.laboratory.service.ILabOnepcService;
 import com.zd.laboratory.service.ILabPhotoInspectionService;
 import com.zd.laboratory.service.ILabSubjectAccessRecordService;
-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.feign.RemoteUserService;
@@ -65,8 +65,8 @@ public class LabSubjectAccessRecordServiceImpl implements ILabSubjectAccessRecor
     @Autowired
     private LabViolationScoreSiteMapper scoreSiteMapper;
 
-    @Autowired
-    private RemoteExamService remoteExamService;
+//    @Autowired
+//    private RemoteExamService remoteExamService;
 
     @Autowired
     private LabNegativeListRecordsMapper negativeListRecordsMapper;
@@ -232,87 +232,88 @@ public class LabSubjectAccessRecordServiceImpl implements ILabSubjectAccessRecor
      */
     @Override
     public int outTimeRecord() {
-        //查询超过24小时违规人员列表
-        List<LabSubjectAccessRecordVo> subAccessRecordList = labSubjectAccessRecordMapper.selOutTimeRecord();
-        int i = 0;
-        if (!subAccessRecordList.isEmpty()) {
-            i = labSubjectAccessRecordMapper.outTimeChangeStatus();
-            subMessageSendManager.SendBigViewUpdate(BigViewDataType.SUB_ONLINE);
-
-            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 -> {
-                        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.isEmpty()) {
-                                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);
-                                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, 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);
-                                    }
-                                }
-                            }
-                        } catch (Exception e) {
-                            log.error("执行违规失败" + e);
-                        }
-                    });
-        }
-        return i;
+//        //查询超过24小时违规人员列表
+//        List<LabSubjectAccessRecordVo> subAccessRecordList = labSubjectAccessRecordMapper.selOutTimeRecord();
+//        int i = 0;
+//        if (!subAccessRecordList.isEmpty()) {
+//            i = labSubjectAccessRecordMapper.outTimeChangeStatus();
+//            subMessageSendManager.SendBigViewUpdate(BigViewDataType.SUB_ONLINE);
+//
+//            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 -> {
+//                        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.isEmpty()) {
+//                                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);
+//                                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, 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);
+//                                    }
+//                                }
+//                            }
+//                        } catch (Exception e) {
+//                            log.error("执行违规失败" + e);
+//                        }
+//                    });
+//        }
+//        return i;
+        return 1;
     }
 
     /**

+ 301 - 300
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabViolationServiceImpl.java

@@ -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("获取积分扣减接口失败");
     }
 

+ 68 - 68
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/utils/InblackListScheduleTask.java

@@ -1,6 +1,6 @@
 package com.zd.laboratory.utils;
 
-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.LabNegativelistHistory;
 import com.zd.laboratory.domain.vo.LabBlacklistVO;
@@ -32,8 +32,8 @@ public class InblackListScheduleTask {
 
     @Autowired
     private ILabNegativeListRecordsService iLabNegativeListRecordsService;
-    @Autowired
-    private RemoteExamService remoteExamService;
+//    @Autowired
+//    private RemoteExamService remoteExamService;
 
     @Autowired
     private ILabBlacklistService iLabBlacklistService;
@@ -47,69 +47,69 @@ public class InblackListScheduleTask {
     @Autowired
     private LabMessageContentMapper labMessageContentMapper;
 
-    /**
-     * 每10分钟执行一次    //    @Scheduled(cron = "0 47 12 ? * *")
-     */
-    @Scheduled(cron = "0 */10 * * * ?")
-    public void configureTasks() {
-        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();
-                ResultData list = iLabNegativeListRecordsService.getExpireTimeData();
-                List <LabNegativelistHistory> labNegativelistHistoryList = (List <LabNegativelistHistory>) list.getData();
-                for (LabNegativelistHistory history : labNegativelistHistoryList) {
-
-                    if(history.getCreditScore() == null || pointsConfig.get("blackScore") == null){
-                        continue;
-                    }
-                    Long deducPoints = history.getCreditScore() - Long.parseLong(pointsConfig.get("blackScore")+"");
-                    if(deducPoints>0
-                            && deducPointsFun(history.getUserId(),deducPoints)){
-                        //这里扣减信用分
-                        //这里移入黑名单
-                        LabBlacklistVO labBlacklistVO = new LabBlacklistVO();
-                        labBlacklistVO.setJoinUserId(history.getUserId());
-                        labBlacklistVO.setCreditScore(deducPoints+"");
-                        labBlacklistVO.setSurplusCreditScore((history.getCreditScore()-deducPoints)+"");
-                        labBlacklistVO.setReason("从负面清单移入到黑名单");
-                        labBlacklistVO.setFlagAction(true);
-                        iLabBlacklistService.addBlacklist(labBlacklistVO);
-                        //最后移除负面清单
-                        iLabNegativeListRecordsService.updateByUserId(history.getUserId(),history.getCreditScore()-deducPoints);
-
-                        //逾期消息通知
-                        LabMessageContent labMessageContent = new LabMessageContent();
-                        labMessageContent.setSendRange(3);
-                        labMessageContent.setMessClass(1);
-                        labMessageContent.setContent("您有违规已经逾期,请及时处理,详细请登录系统查看具体处理方式方法。");
-                        labMessageContent.setUserIds(history.getUserId()+"");
-                        labMessageContent.setUserId(-2L);
-                        labMessageContent.setCreateTime(new Date());
-                        labMessageContent.setCreateBy("系统");
-                        labMessageContentMapper.insertLabMessageContent(labMessageContent);
-                    }
-                }
-            }
-        }
-    }
-
-
-    private boolean deducPointsFun(Long joinUserId,Long deductPoints){
-        Map <String,Object> deducPointsMap = new HashMap <>();
-        deducPointsMap.put("joinUserId",joinUserId);
-        deducPointsMap.put("deductPoints",deductPoints);
-        deducPointsMap.put("pointsType",1);
-        deducPointsMap.put("reason","没有在指定时间完成负面清单学习,扣减信用分移入黑名单!!");
-        R<Object> data = remoteExamService.deductionPoints(deducPointsMap);
-        if (data!=null) {
-            String code = data.getCode() + "";
-            if (code.equals("200")) {
-                return true;
-            }
-        }
-        return false;
-    }
+//    /**
+//     * 每10分钟执行一次    //    @Scheduled(cron = "0 47 12 ? * *")
+//     */
+//    @Scheduled(cron = "0 */10 * * * ?")
+//    public void configureTasks() {
+//        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();
+//                ResultData list = iLabNegativeListRecordsService.getExpireTimeData();
+//                List <LabNegativelistHistory> labNegativelistHistoryList = (List <LabNegativelistHistory>) list.getData();
+//                for (LabNegativelistHistory history : labNegativelistHistoryList) {
+//
+//                    if(history.getCreditScore() == null || pointsConfig.get("blackScore") == null){
+//                        continue;
+//                    }
+//                    Long deducPoints = history.getCreditScore() - Long.parseLong(pointsConfig.get("blackScore")+"");
+//                    if(deducPoints>0
+//                            && deducPointsFun(history.getUserId(),deducPoints)){
+//                        //这里扣减信用分
+//                        //这里移入黑名单
+//                        LabBlacklistVO labBlacklistVO = new LabBlacklistVO();
+//                        labBlacklistVO.setJoinUserId(history.getUserId());
+//                        labBlacklistVO.setCreditScore(deducPoints+"");
+//                        labBlacklistVO.setSurplusCreditScore((history.getCreditScore()-deducPoints)+"");
+//                        labBlacklistVO.setReason("从负面清单移入到黑名单");
+//                        labBlacklistVO.setFlagAction(true);
+//                        iLabBlacklistService.addBlacklist(labBlacklistVO);
+//                        //最后移除负面清单
+//                        iLabNegativeListRecordsService.updateByUserId(history.getUserId(),history.getCreditScore()-deducPoints);
+//
+//                        //逾期消息通知
+//                        LabMessageContent labMessageContent = new LabMessageContent();
+//                        labMessageContent.setSendRange(3);
+//                        labMessageContent.setMessClass(1);
+//                        labMessageContent.setContent("您有违规已经逾期,请及时处理,详细请登录系统查看具体处理方式方法。");
+//                        labMessageContent.setUserIds(history.getUserId()+"");
+//                        labMessageContent.setUserId(-2L);
+//                        labMessageContent.setCreateTime(new Date());
+//                        labMessageContent.setCreateBy("系统");
+//                        labMessageContentMapper.insertLabMessageContent(labMessageContent);
+//                    }
+//                }
+//            }
+//        }
+//    }
+//
+//
+//    private boolean deducPointsFun(Long joinUserId,Long deductPoints){
+//        Map <String,Object> deducPointsMap = new HashMap <>();
+//        deducPointsMap.put("joinUserId",joinUserId);
+//        deducPointsMap.put("deductPoints",deductPoints);
+//        deducPointsMap.put("pointsType",1);
+//        deducPointsMap.put("reason","没有在指定时间完成负面清单学习,扣减信用分移入黑名单!!");
+//        R<Object> data = remoteExamService.deductionPoints(deducPointsMap);
+//        if (data!=null) {
+//            String code = data.getCode() + "";
+//            if (code.equals("200")) {
+//                return true;
+//            }
+//        }
+//        return false;
+//    }
 }