接口封装提交

main
Comair 7 months ago
parent c495e13601
commit 9f3102f0bc
  1. 6
      shkj-admin/src/main/resources/application-yun.yml
  2. 2
      shkj-admin/src/main/resources/application.yml
  3. 52
      shkj-wms/src/main/java/com/shkj/wcs/controller/busin/WcsTaskController.java
  4. 6
      shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java
  5. 6
      shkj-wms/src/main/java/com/shkj/wcs/third/rcs/RCSUtil.java

@ -12,7 +12,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://120.77.94.227:3306/sc-wcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://120.77.94.227:3306/sc_wcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: CTlTwKgIrRVTsEHqxxx
# 从库数据源
@ -71,7 +71,7 @@ spring:
# 数据库索引
database: 3
# 密码
password: rvGUoUFAIg4nESp9
password:
# 连接超时时间
timeout: 10s
lettuce:
@ -93,7 +93,7 @@ third:
uploadWCSTaskStatusUrl: http://127.0.0.1:8081/api/toWzWcs/uploadWCSTaskStatus
# agv接口
agvCreateTaskUrl: http://127.0.0.1:8081/rest/common/createTask
agvStatesUrl: http://127.0.0.1:8081/rest/robots/states
agvStatesUrl: http://127.0.0.1:8081/api/robot/controller/robot/query
agvCancelTaskUrl: http://127.0.0.1:8081/rest/common/cancelTask
queryAckByTaskUrl: http://127.0.0.1:8081/rest/common/queryAckByTaskId
# ess接口

@ -45,7 +45,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: pro146
active: yun
# 文件上传
servlet:
multipart:

@ -91,52 +91,18 @@ public class WcsTaskController {
}
@Log(title = "wz-wcs任务下发", businessType = BusinessType.UPDATE)
@PostMapping("/toWzWcs/wcsIncomingTrayCheck")
@Log(title = "查询库区状态", businessType = BusinessType.UPDATE)
@PostMapping("/toWzWcs/queryAreaStatus")
@RepeatSubmit
public WcsResponseVo wcsIncomingTrayCheck(WcsCreateTaskDto bo) {
if (bo != null) {
List<WcsCreateTaskBody> body = bo.getBody();
if (!body.isEmpty()) {
for (WcsCreateTaskBody by : body) {
String taskId = by.getTaskId();
String trayCode = by.getTrayCode();
String taskType = by.getTaskType();
String fromBinCode = by.getFromBinCode();
String toBinCode = by.getToBinCode();
String dataChange = by.getDataChange();
String priority = by.getPriority();
LambdaQueryWrapper<BusinDataTask> lqwDataTask = new LambdaQueryWrapper<BusinDataTask>()
.eq(BusinDataTask::getContainerId, trayCode)
.in(BusinDataTask::getTaskStatus, "1", "2");
BusinDataTask one = iBusinDataTaskService.getOne(lqwDataTask);
if (dataChange.equals("1")) {
if (one != null) {
return WcsResponseVo.error(500, "该托盘" + trayCode + "存在未完成的任务");
}
BusinDataTask businDataTask = new BusinDataTask();
businDataTask.setTaskCode(taskId);
businDataTask.setTaskType(taskType);
businDataTask.setContainerId(Long.valueOf(trayCode));
businDataTask.setFromSide(fromBinCode);
businDataTask.setToSide(toBinCode);
businDataTask.setCreateTime(DateUtils.getNowDate());
businDataTask.setPriority(priority);
boolean save = iBusinDataTaskService.save(businDataTask);
if (save) {
//调用下游接口下任务
public WcsResponseVo queryAreaStatus(WcsCreateTaskDto dto) {
if (dto != null) {
String businessType = dto.getHeader().getBusinessType();
if(businessType.equals("queryAreaStatus")){
}
} else if (dataChange.equals("2")) {
if (one == null) {
return WcsResponseVo.error(500, "未查询到该托盘" + trayCode + "存在未完成的任务");
}
one.setTaskStatus("6");
iBusinDataTaskService.updateById(one);
//推送给下游
}
List<WcsCreateTaskBody> body = dto.getBody();
if (!body.isEmpty()) {
}
}
}
}

@ -85,7 +85,7 @@ public class PlcEventTask {
@Autowired
IBusinDataTaskService iBusinDataTaskService;
@Scheduled(fixedDelay = 5000)
//@Scheduled(fixedDelay = 5000)
public void init() {
//查询需要连接的PLC,初始化连接对象
List<WcsPlcConnectVo> plcList =(List<WcsPlcConnectVo>) redisTemplate.opsForValue().get(RedisConstant.redisPlcListConnect);
@ -107,7 +107,7 @@ public class PlcEventTask {
//输送线心跳
@Scheduled(fixedDelay = 4000)
//@Scheduled(fixedDelay = 4000)
public void writePlcheartbeatDps() {
//根据连接的plcId获取属性
PlcOperate plcOperate = plcInit.getPlcOperate_dps();
@ -136,7 +136,7 @@ public class PlcEventTask {
}
//堆垛机心跳
@Scheduled(fixedDelay = 4000)
//@Scheduled(fixedDelay = 4000)
public void writePlcheartbeatStk() {
//根据连接的plcId获取属性
PlcOperate plcOperate = plcInit.getPlcOperate_stk();

@ -206,11 +206,11 @@ public class RCSUtil {
/**
* 获取AGV实时状态信息
*
* @param mapId bo
* @param singleRobotCode bo
* @return {@code Result}
*/
public Result rcsRobotsStates(String mapId) {
String json = JSONObject.toJSONString(mapId);
public Result rcsRobotsStates(String singleRobotCode) {
String json = JSONObject.toJSONString(singleRobotCode);
try {
Map<String, String> headerMap = getHeaderMap();
String res = HttpRequest.post(agvStatesUrl)

Loading…
Cancel
Save