| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.cloud.web.cabinet; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.JkVersionMapper; |
| | | 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; |
| | | import com.doumee.dao.business.vo.CabinetFaceVO; |
| | | import com.doumee.dao.business.vo.CabinetInfoVO; |
| | | import com.doumee.dao.web.response.DriverHomeVO; |
| | | import com.doumee.service.business.*; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | import com.hikvision.artemis.sdk.config.ArtemisConfig; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2025/10/15 9:10 |
| | | */ |
| | | @Api(tags = "ãé¥åæãé¥åæä¸å¡") |
| | | @Trace(exclude = true) |
| | | @RestController |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/web/cabinet") |
| | | @Slf4j |
| | | public class CabinetController extends BaseController { |
| | | |
| | | @Autowired |
| | | private JkCabinetService jkCabinetService; |
| | | |
| | | @Autowired |
| | | private JkCabinetGridService jkCabinetGridService; |
| | | |
| | | @Autowired |
| | | private JkInterfaceLogService interfaceLogService; |
| | | |
| | | @Autowired |
| | | private JkIccardService jkIccardService; |
| | | |
| | | @Autowired |
| | | private JkVersionService jkVersionService; |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("è·åé¥åæAPKææ°çæ¬") |
| | | @GetMapping("/getLastVersion") |
| | | public ApiResponse<JkVersion> getLastVersion () { |
| | | JkVersion jkVersion = jkVersionService.getLastVersion(); |
| | | this.saveInterfaceLog(null, JSONObject.toJSONString(jkVersion),"getLastVersion","è·åé¥åæAPKææ°çæ¬"); |
| | | return ApiResponse.success(jkVersion); |
| | | } |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("è·åé¥åæåºæ¬ä¿¡æ¯ - 叿º") |
| | | @GetMapping("/getCabinetInfoForDriver") |
| | | public ApiResponse<CabinetInfoVO> getCabinetInfoForDriver (@RequestParam String code) { |
| | | CabinetInfoVO cabinetInfoVO = jkCabinetService.getCabinetInfoForDriver(code); |
| | | this.saveInterfaceLog(Constants.strToJson("code",code), JSONObject.toJSONString(cabinetInfoVO),"getCabinetInfoForDriver","è·åé¥åæåºæ¬ä¿¡æ¯ - 叿º"); |
| | | return ApiResponse.success(cabinetInfoVO); |
| | | } |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("æ´æ°é¥åæå¨çº¿ç¶æ") |
| | | @GetMapping("/updateRunStatusById") |
| | | public ApiResponse updateRunStatusById (@RequestParam Integer id) { |
| | | jkCabinetService.updateRunStatusById(id); |
| | | this.saveInterfaceLog(Constants.strToJson("id",id.toString()), null,"updateRunStatusById","æ´æ°é¥åæå¨çº¿ç¶æ"); |
| | | return ApiResponse.success("æ´æ°æå"); |
| | | } |
| | | |
| | | @ApiOperation("è·åå¯ç®¡ççé¥åæå表 - 管çå") |
| | | @GetMapping("/getAdminCabinetInfo") |
| | | public ApiResponse<List<AdminCabinetVO>> getAdminCabinetInfo (@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | List<AdminCabinetVO> list = jkCabinetService.getAdminCabinetInfo(getLoginUser(token)); |
| | | this.saveInterfaceLog(null, JSONArray.toJSONString(list),"getAdminCabinetInfo","è·åå¯ç®¡ççé¥åæå表 - 管çå"); |
| | | return ApiResponse.success(list); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("è·åé¥åæè¯¦æ
- 管çå") |
| | | @GetMapping("/getCabinetDetail") |
| | | public ApiResponse<CabinetDetailVO> getCabinetDetail (@RequestParam Integer cabinetId, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | CabinetDetailVO cabinetDetailVO = jkCabinetService.getCabinetDetail(cabinetId,getLoginUser(token)); |
| | | this.saveInterfaceLog(Constants.strToJson("cabinetId",cabinetId.toString()), JSONObject.toJSONString(cabinetDetailVO),"getCabinetDetail","è·åé¥åæè¯¦æ
- 管çå"); |
| | | return ApiResponse.success(cabinetDetailVO); |
| | | } |
| | | |
| | | @ApiOperation("æ è®°ææ ¼æ
é - 管çå") |
| | | @PostMapping("/markFault") |
| | | public ApiResponse markFault(@RequestBody OptGridDTO dto, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | dto.setLoginUserInfo(getLoginUser(token)); |
| | | jkCabinetGridService.markFault(dto); |
| | | this.saveInterfaceLog(JSONObject.toJSONString(dto), null,"markFault","æ è®°ææ ¼æ
é - 管çå"); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | @ApiOperation("æ è®°ææ ¼æ£å¸¸ - 管çå") |
| | | @PostMapping("/cancelFault") |
| | | public ApiResponse cancelFault(@RequestBody OptGridDTO dto, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | dto.setLoginUserInfo(getLoginUser(token)); |
| | | jkCabinetGridService.cancelFault(dto); |
| | | this.saveInterfaceLog(JSONObject.toJSONString(dto), null,"cancelFault","æ è®°ææ ¼æ£å¸¸ - 管çå"); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | @ApiOperation("æ è®°ç»´ä¿®ä¿å
» - 管çå") |
| | | @PostMapping("/markRepair") |
| | | public ApiResponse markRepair(@RequestBody OptGridDTO dto, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | dto.setLoginUserInfo(getLoginUser(token)); |
| | | jkCabinetGridService.markRepair(dto); |
| | | this.saveInterfaceLog(JSONObject.toJSONString(dto), null,"markRepair","æ è®°ç»´ä¿®ä¿å
» - 管çå"); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("å
³éæé¨") |
| | | @PostMapping("/closeGrid") |
| | | public ApiResponse closeGrid(@RequestBody CloseGridDTO dto) { |
| | | jkCabinetGridService.closeGrid(dto); |
| | | this.saveInterfaceLog(JSONObject.toJSONString(dto), null,"closeGrid","å
³éæé¨"); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå¼é¨ - 管çå") |
| | | @PostMapping("/batchOpenGridAdmin") |
| | | public ApiResponse batchOpenGridAdmin(@RequestBody OptGridDTO dto, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | dto.setLoginUserInfo(getLoginUser(token)); |
| | | jkCabinetGridService.batchOpenGridAdmin(dto); |
| | | this.saveInterfaceLog(JSONObject.toJSONString(dto), null,"batchOpenGridAdmin","æ¹éå¼é¨ - 管çå"); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("è·åé¥åæäººè¸æ°æ®") |
| | | @GetMapping("/getCabinetFaceVO") |
| | | public ApiResponse<CabinetFaceVO> getCabinetFaceVO(@RequestParam String code) { |
| | | CabinetFaceVO cabinetFaceVO = jkCabinetService.getCabinetFaceVO(code); |
| | | this.saveInterfaceLog(Constants.strToJson("code",code), JSONObject.toJSONString(cabinetFaceVO),"getCabinetFaceVO","è·åé¥åæäººè¸æ°æ®"); |
| | | return ApiResponse.success(cabinetFaceVO); |
| | | } |
| | | |
| | | |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("è·åå¯æä½ææ ¼ - 叿º") |
| | | @PostMapping("/getDriverGrid") |
| | | public ApiResponse<List<JkCabinetGrid>> getDriverGrid(@RequestBody GetDriverGridDTO dto) { |
| | | List<JkCabinetGrid> jkCabinetGridList = jkCabinetGridService.getDriverGrid(dto); |
| | | this.saveInterfaceLog(JSONObject.toJSONString(dto), JSONObject.toJSONString(jkCabinetGridList),"getDriverGrid","è·åå¯æä½ææ ¼ - 叿º"); |
| | | return ApiResponse.success(jkCabinetGridList); |
| | | } |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("å¼å¯ææ ¼ - 叿º") |
| | | @PostMapping("/openGridDriver") |
| | | public ApiResponse openGridDriver(@RequestBody OpenGridDriverDTO dto) { |
| | | jkCabinetGridService.openGridDriver(dto); |
| | | this.saveInterfaceLog(JSONObject.toJSONString(dto), null,"openGridDriver","å¼å¯ææ ¼ - 叿º"); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("è·åICå¡ç¨æ·ä¸»é® - 叿º") |
| | | @PostMapping("/getMemberIdByCode") |
| | | 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) { |
| | | JkInterfaceLog hkMonitoryLogDO=new JkInterfaceLog(); |
| | | hkMonitoryLogDO.setType(0); |
| | | hkMonitoryLogDO.setCreateDate(new Date()); |
| | | hkMonitoryLogDO.setIsdeleted(0); |
| | | hkMonitoryLogDO.setRequest(s); |
| | | hkMonitoryLogDO.setRepose(result); |
| | | hkMonitoryLogDO.setName("ãé¥åæã"+name); |
| | | hkMonitoryLogDO.setUrl(url); |
| | | interfaceLogService.create(hkMonitoryLogDO); |
| | | } |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("é
ç²¾æ£æµåè¦") |
| | | @PostMapping("/alcoholTestAlarm") |
| | | public ApiResponse alcoholTestAlarm(@RequestBody AlcoholTestAlarmDTO dto) { |
| | | jkCabinetGridService.alcoholTestAlarm(dto); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("ææ ¼å¼é¨è¶
æ¶æªå
³éåè¦") |
| | | @PostMapping("/timeOutUnCloseAlarm") |
| | | public ApiResponse timeOutUnCloseAlarm(@RequestBody TimeOutCloseGridDTO dto) { |
| | | jkCabinetGridService.timeOutUnCloseAlarm(dto); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | } |