Procházet zdrojové kódy

算发日志bug修复

linfutong před 2 roky
rodič
revize
ca2718c908

+ 2 - 1
zd-model/src/main/java/com/zd/model/entity/Algorithm.java

@@ -31,10 +31,11 @@ public class Algorithm {
     private String originalImg;
     @ApiModelProperty("算法请求状态码")
     private Long respCode;
+
     @ApiModelProperty("算法请求返回的json串")
     private String respData;
+
     @ApiModelProperty("更新时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date updateTime;
     /**
      * 只有签到检查存在

+ 6 - 4
zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/controller/SignInCheckController.java

@@ -73,6 +73,7 @@ public class SignInCheckController {
     @ApiOperation(value = "进入项验证")
     @PostMapping("/{code}/{id}")
     public R checkIn(@ApiParam("进出记录ID") @PathVariable("id") Long id, @ApiParam("验证类型编码") @PathVariable("code") String code, @RequestParam("file") MultipartFile file) {
+        logger.info("【算法服务】 进入项验证");
         return checkService.checkAndCommit(code, file, id);
     }
 
@@ -87,6 +88,7 @@ public class SignInCheckController {
     public R checkInAll(@ApiParam("进出记录ID") @RequestParam("id") Long id,
                         @ApiParam("图片文件") @RequestParam("file") MultipartFile file,
                         @ApiParam("实验室ID") @RequestParam("subId") Long subId) {
+        logger.info("【算法服务】 三合一验证");
         return checkService.checkAndCommit(id, file, subId);
     }
 
@@ -100,6 +102,7 @@ public class SignInCheckController {
     @ApiOperation(value = "进入项验证:mock方法")
     @PostMapping("/mock/{code}/{id}")
     public R checkInMock(@ApiParam("进出记录ID") @PathVariable("id") Long id, @ApiParam("验证类型编码") @PathVariable("code") String code, @RequestParam("file") MultipartFile file) {
+        logger.info("【算法服务】 进入项验证:mock方法");
         return checkService.mockTest(code, file, id);
     }
 
@@ -169,12 +172,11 @@ public class SignInCheckController {
     public R checkFire(@ApiParam("图片文件") @RequestParam("file") MultipartFile file) {
         return R.ok(fireImageService.catchImage(file));
     }
-/*
-    @PostMapping("/testXXF")
+    @GetMapping("/testXXF")
     public R testXXF() {
         //TODO 添加一条请求记录到数据库,
         Algorithm algorithmFirst = new Algorithm();
-        R alg= laboratoryService.saveAlgorithmData(algorithmFirst);
+        R<Long> alg= laboratoryService.saveAlgorithmData(algorithmFirst);
         System.out.println(alg.getData());
         Map<String,String> map = new HashMap<>();
         map.put("type", "image");
@@ -193,5 +195,5 @@ public class SignInCheckController {
         algorithmFirst.setUpdateTime(new Date());
         R f = laboratoryService.update(algorithmFirst);
         return R.ok(f);
-    }*/
+    }
 }

+ 6 - 2
zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/serivce/CheckService.java

@@ -97,6 +97,7 @@ public class CheckService {
             int alarmNum = 0;
             //========= 请求超时验证部分开始 ===========
             //600 则代表退出验证流程 需要重新刷卡
+            logger.info("【算法服务】 进入服务,检查开始.............");
             R<Long> fail = getObjectR(id);
             if (fail.getCode() != 200) {
                 return fail;
@@ -114,6 +115,7 @@ public class CheckService {
             //上传原始图片
             String orgImgUrl = "";
             R<SysFile> r = remoteFileService.upload(file);
+            logger.info("【算法服务】 原始文件上传结果:"+JSONObject.toJSONString(r));
             if (r.getCode() == 200) {
                 orgImgUrl = r.getData().getUrl();
             }
@@ -136,7 +138,8 @@ public class CheckService {
                 MultiValueMap<String, Object> params = getStringObjectMultiValueMap(checkValid, String.valueOf(id));
                 HttpEntity<MultiValueMap<String, Object>> files = getHttpEntityMap(toFile, params);
                 //添加一条算法请求记录
-                R<Long> alg = insertRequestRecordLog(orgImgUrl, subId, checkValid);
+                R alg = insertRequestRecordLog(orgImgUrl, subId, checkValid);
+                logger.info("【算法服务】 添加日志记录结果:"+JSONObject.toJSONString(alg));
                 logger.info("==============>>>算法数据添加结果,alg="+ JSONObject.toJSONString(alg));
                 ImgPostResponse<AnalysisReturnData> send = HttpUtils.sendV5(restTemplateLocal, files, algorithmYml);
                 //算法记录更新
@@ -212,7 +215,7 @@ public class CheckService {
         algorithm.setSubId(subId);
         algorithm.setAlgorithmType("image");
         algorithm.setAlgorithmName(checkValid.getAlgorithmName());
-        logger.info("日志Model:"+JSONObject.toJSONString(algorithm));
+        logger.info("【算法服务】 添加日志记录实体:"+JSONObject.toJSONString(algorithm));
         return laboratoryService.saveAlgorithmData(algorithm);
     }
 
@@ -264,6 +267,7 @@ public class CheckService {
             algorithm.setRespCode(send.getStatus_code());
         }
         algorithm.setUpdateTime(new Date());
+        logger.info("【算法服务】 更新日志实体信息:"+JSONObject.toJSONString(algorithm));
         laboratoryService.update(algorithm);
     }