rk
16 小时以前 f7167562105604f1e7656983d120f145db6edd12
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/web/cabinet/CabinetController.java
@@ -11,6 +11,7 @@
import com.doumee.dao.business.dto.*;
import com.doumee.dao.business.model.InterfaceLog;
import com.doumee.dao.business.model.JkCabinetGrid;
import com.doumee.dao.business.model.JkInterfaceLog;
import com.doumee.dao.business.model.JkVersion;
import com.doumee.dao.business.vo.AdminCabinetVO;
import com.doumee.dao.business.vo.CabinetDetailVO;
@@ -18,6 +19,7 @@
import com.doumee.dao.business.vo.CabinetInfoVO;
import com.doumee.dao.web.response.DriverHomeVO;
import com.doumee.service.business.*;
import com.doumee.service.business.impl.JkCabinetGridServiceImpl;
import com.doumee.service.business.third.model.ApiResponse;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import io.swagger.annotations.Api;
@@ -52,7 +54,10 @@
    private JkCabinetGridService jkCabinetGridService;
    @Autowired
    private InterfaceLogService interfaceLogService;
    private JkCabinetLogService jkCabinetLogService;
    @Autowired
    private JkInterfaceLogService interfaceLogService;
    @Autowired
    private JkIccardService jkIccardService;
@@ -86,8 +91,6 @@
        this.saveInterfaceLog(Constants.strToJson("id",id.toString()), null,"updateRunStatusById","更新钥匙柜在线状态");
        return ApiResponse.success("更新成功");
    }
    @ApiOperation("获取可管理的钥匙柜列表 - 管理员")
    @GetMapping("/getAdminCabinetInfo")
@@ -172,6 +175,7 @@
        return ApiResponse.success(jkCabinetGridList);
    }
    @LoginNoRequired
    @ApiOperation("开启柜格 - 司机")
    @PostMapping("/openGridDriver")
@@ -184,13 +188,13 @@
    @LoginNoRequired
    @ApiOperation("获取IC卡用户主键 - 司机")
    @PostMapping("/getMemberIdByCode")
    public ApiResponse<Integer> getMemberIdByCode(@RequestParam String code) {
        this.saveInterfaceLog(Constants.strToJson("code",code), null,"getMemberIdByCode","获取IC卡用户主键 - 司机");
        return ApiResponse.success(jkIccardService.getMemberIdByCode(code));
    public ApiResponse<Integer> getMemberIdByCode(@RequestBody QueryUserByCodeDTO dto) {
        this.saveInterfaceLog(JSONObject.toJSONString(dto), null,"getMemberIdByCode","获取IC卡用户主键 - 司机");
        return ApiResponse.success(jkIccardService.getMemberIdByCode(dto));
    }
    private void saveInterfaceLog(String s, String result,String url,String name) {
        InterfaceLog hkMonitoryLogDO=new InterfaceLog();
        JkInterfaceLog hkMonitoryLogDO=new JkInterfaceLog();
        hkMonitoryLogDO.setType(0);
        hkMonitoryLogDO.setCreateDate(new Date());
        hkMonitoryLogDO.setIsdeleted(0);
@@ -201,12 +205,12 @@
        interfaceLogService.create(hkMonitoryLogDO);
    }
    @LoginNoRequired
    @ApiOperation("酒精检测告警")
    @PostMapping("/alcoholTestAlarm")
    public ApiResponse alcoholTestAlarm(@RequestBody AlcoholTestAlarmDTO dto) {
        jkCabinetGridService.alcoholTestAlarm(dto);
        this.saveInterfaceLog(JSONObject.toJSONString(dto), null,"酒精检测告警","酒精检测告警");
        return ApiResponse.success("操作成功");
    }
@@ -217,8 +221,41 @@
    @PostMapping("/timeOutUnCloseAlarm")
    public ApiResponse timeOutUnCloseAlarm(@RequestBody TimeOutCloseGridDTO dto) {
        jkCabinetGridService.timeOutUnCloseAlarm(dto);
        this.saveInterfaceLog(JSONObject.toJSONString(dto), null,"timeOutUnCloseAlarm","柜格开门超时未关闭告警");
        return ApiResponse.success("操作成功");
    }
    @LoginNoRequired
    @ApiOperation("钥匙柜心跳接口")
    @GetMapping("/heartbeat")
    public ApiResponse heartbeat() {
        return ApiResponse.success("链接成功");
    }
    @LoginNoRequired
    @ApiOperation("同步柜格实际钥匙数据")
    @PostMapping("/syncGridData")
    public ApiResponse syncGridData(@RequestBody SyncCabinetDTO dto) {
        jkCabinetGridService.syncGridData(dto);
        this.saveInterfaceLog(JSONObject.toJSONString(dto), null,"syncGridData","同步柜格实际钥匙数据");
        return ApiResponse.success("操作成功");
    }
    @Autowired
    private JkCabinetGridServiceImpl impl;
    @LoginNoRequired
    @ApiOperation("testTimeOutBackAlarm")
    @GetMapping("/testTimeOutBackAlarm")
    public ApiResponse testTimeOutBackAlarm() {
        jkCabinetLogService.timeOutUnBackAlarm(impl);
        return ApiResponse.success("操作成功");
    }
}