KeyBoxController.java
2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.ruoyi.controller.dss;
import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.ResponseResult;
import com.ruoyi.domain.equipment.linke.log.LingangEquipmentLinkeLog;
import com.ruoyi.domain.keyInfo.box.dto.KeyBoxQueryDTO;
import com.ruoyi.service.dss.KeyBoxVoService;
import com.ruoyi.service.equipment.linke.log.LingangEquipmentLinkeLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
* @author liujun
* @date 2024年06月25日 13:04
*/
@RestController
@RequestMapping("/dss/keybox")
@Api(tags = "【蓝斯一期】钥匙信息")
public class KeyBoxController extends BaseController {
@Autowired
private LingangEquipmentLinkeLogService lingangEquipmentLinkeLogService;
@Autowired
private KeyBoxVoService keyBoxVoService;
@PostMapping(value = "/findKey")
@ApiOperation("钥匙信息查询")
public ResponseResult listSelect(@RequestBody KeyBoxQueryDTO request) {
LingangEquipmentLinkeLog linkeLog = saveLog(request);
return keyBoxVoService.listSelect(request,linkeLog);
}
/***
* 保存链接日志
* @author liujun
* @date 2024/6/25 15:24
* @param request
* @return com.ruoyi.domain.equipment.linke.log.LingangEquipmentLinkeLog
*/
private LingangEquipmentLinkeLog saveLog(KeyBoxQueryDTO request) {
LingangEquipmentLinkeLog linkeLog = new LingangEquipmentLinkeLog();
linkeLog.setDevice(request.getDevice());
linkeLog.setCreateTime(new Date());
linkeLog.setPassingReferences(JSON.toJSONString(request));
linkeLog.setUrl("/dss/keybox/findKey");
lingangEquipmentLinkeLogService.save(linkeLog);
return linkeLog;
}
}