mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-02 21:18:05 +08:00
新增 遥控地锁接口
This commit is contained in:
@@ -7,10 +7,12 @@ import com.jsowell.common.core.page.PageResponse;
|
|||||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||||
import com.jsowell.common.exception.BusinessException;
|
import com.jsowell.common.exception.BusinessException;
|
||||||
import com.jsowell.common.response.RestApiResponse;
|
import com.jsowell.common.response.RestApiResponse;
|
||||||
|
import com.jsowell.pile.domain.ykcCommond.RemoteControlGroundLockCommand;
|
||||||
import com.jsowell.pile.dto.QueryConnectorListDTO;
|
import com.jsowell.pile.dto.QueryConnectorListDTO;
|
||||||
import com.jsowell.pile.dto.QueryStationDTO;
|
import com.jsowell.pile.dto.QueryStationDTO;
|
||||||
import com.jsowell.pile.service.IPileConnectorInfoService;
|
import com.jsowell.pile.service.IPileConnectorInfoService;
|
||||||
import com.jsowell.pile.service.IPileStationInfoService;
|
import com.jsowell.pile.service.IPileStationInfoService;
|
||||||
|
import com.jsowell.pile.service.YKCPushCommandService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@@ -29,7 +31,8 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
@RequestMapping("/uniapp/pile")
|
@RequestMapping("/uniapp/pile")
|
||||||
public class PileController extends BaseController {
|
public class PileController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private YKCPushCommandService ykcPushCommandService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPileStationInfoService pileStationInfoService;
|
private IPileStationInfoService pileStationInfoService;
|
||||||
@@ -106,4 +109,23 @@ public class PileController extends BaseController {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 远程遥控地锁指令
|
||||||
|
* @param command
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/remoteGroundLock")
|
||||||
|
public RestApiResponse<?> remoteGroundLock(@RequestBody RemoteControlGroundLockCommand command) {
|
||||||
|
logger.info("遥控地锁指令 params:{}", JSONObject.toJSONString(command));
|
||||||
|
RestApiResponse<?> response = null;
|
||||||
|
try {
|
||||||
|
ykcPushCommandService.pushRemoteControlGroundLock(command);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("遥控地锁指令 error, ", e);
|
||||||
|
response = new RestApiResponse<>(e);
|
||||||
|
}
|
||||||
|
logger.info("遥控地锁指令 result:{}", response);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ public class GroundLockDataUploadHandler extends AbstractHandler{
|
|||||||
String redisKey = CacheConstants.GROUND_LOCK_DATA + pileSn + connectorCode;
|
String redisKey = CacheConstants.GROUND_LOCK_DATA + pileSn + connectorCode;
|
||||||
redisCache.setCacheObject(redisKey, data, CacheConstants.cache_expire_time_10m);
|
redisCache.setCacheObject(redisKey, data, CacheConstants.cache_expire_time_10m);
|
||||||
|
|
||||||
|
log.info("[===地锁数据上送===] result: 桩编码:{}, 枪号:{}, 车位锁状态:{}, 车位状态:{}, 地锁电量状态:{}, 报警状态:{}",
|
||||||
|
pileSn, connectorCode, parkingLockStatus, parkingStatus, groundLockElectric, alarmStatus);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user