提交 b99d91c2 authored 作者: ljj's avatar ljj

docs:增加喝茶查询快照的日志

上级 05a3e180
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.sun.tools.javadoc.Start;
import com.tykj.dev.config.GlobalMap; import com.tykj.dev.config.GlobalMap;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.confirmcheck.common.CcNodeType; import com.tykj.dev.device.confirmcheck.common.CcNodeType;
...@@ -70,6 +71,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -70,6 +71,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.domain.Specification;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.util.StopWatch;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.time.LocalDate; import java.time.LocalDate;
...@@ -347,6 +349,9 @@ public class DeviceCheckController { ...@@ -347,6 +349,9 @@ public class DeviceCheckController {
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ResponseEntity<ResultObj<CheckDetailVo>> findDetail(@PathVariable Integer id) { public ResponseEntity<ResultObj<CheckDetailVo>> findDetail(@PathVariable Integer id) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
Task task = taskRepo.findByBillIdAndBusinessType(id, 8).orElseThrow(() -> new ApiException("给出的bill id 不存在")); Task task = taskRepo.findByBillIdAndBusinessType(id, 8).orElseThrow(() -> new ApiException("给出的bill id 不存在"));
if (task.getBillStatus() == 140 || task.getBillStatus() == 160) { if (task.getBillStatus() == 140 || task.getBillStatus() == 160) {
log.info("[核查] 刷新在库/不在库,bill id :{}", id); log.info("[核查] 刷新在库/不在库,bill id :{}", id);
...@@ -356,7 +361,11 @@ public class DeviceCheckController { ...@@ -356,7 +361,11 @@ public class DeviceCheckController {
CheckDetailVo detailVoList = detailRepo.findById(id) CheckDetailVo detailVoList = detailRepo.findById(id)
.map(transUtil::CheckDetailDo2Vo) .map(transUtil::CheckDetailDo2Vo)
.orElse(null); .orElse(null);
return ResponseEntity.ok(new ResultObj<>(historyCheckDeviceService.replayHistoryDevice(detailVoList, id))); log.info("[check] 原方法执行用时:{}ms", stopWatch.getTotalTimeMillis());
CheckDetailVo checkDetailVo = historyCheckDeviceService.replayHistoryDevice(detailVoList, id);
log.info("[check] 查询快照所用的时间:{}ms", stopWatch.getTotalTimeMillis());
return ResponseEntity.ok(new ResultObj<>(checkDetailVo));
} }
/** /**
...@@ -477,8 +486,12 @@ public class DeviceCheckController { ...@@ -477,8 +486,12 @@ public class DeviceCheckController {
detail = detailRepo.save(detail); detail = detailRepo.save(detail);
CheckDetailVo cdVo = transUtil.CheckDetailDo2Vo(detail); CheckDetailVo cdVo = transUtil.CheckDetailDo2Vo(detail);
CheckDetailVo rs = historyCheckDeviceService.replayHistoryDevice(cdVo, id);
// 查询快照
StopWatch stopWatch = new StopWatch();
stopWatch.start();
CheckDetailVo rs = historyCheckDeviceService.replayHistoryDevice(cdVo, id);
log.info("[check] 查询快照所用的时间:{}ms", stopWatch.getTotalTimeMillis());
return ResponseEntity.ok(new ResultObj<>(rs)); return ResponseEntity.ok(new ResultObj<>(rs));
} }
......
...@@ -259,7 +259,7 @@ public class FileController { ...@@ -259,7 +259,7 @@ public class FileController {
/** /**
* 文件下载 * 文件xiaza下载
*/ */
@PostMapping("/download") @PostMapping("/download")
public void download(@RequestBody FileRet fileRet, HttpServletResponse response, HttpServletRequest httpServletRequest){ public void download(@RequestBody FileRet fileRet, HttpServletResponse response, HttpServletRequest httpServletRequest){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论