代码更新

This commit is contained in:
梁州 2024-08-02 23:09:53 +08:00
parent 1f298e89d6
commit 8fd1c50722
10 changed files with 363 additions and 38 deletions

View File

@ -8,7 +8,10 @@ public enum ConfigMapKeyEnum {
URL_WCS_E_TASK("URL_WCS_E_TASK"),
URL_WCS_DISPOSE_VEHICLE("URL_WCS_DISPOSE_VEHICLE"),
START_WORK("START_WORK"),
SEND_TASK("SEND_TASK");
SEND_TASK("SEND_TASK"),
MAX_VEHICLE_NUMS("MAX_VEHICLE_NUMS"),
SLOC_FILTER_STRING("SLOC_FILTER_STRING"),
URL_WCS_CHANGE_TASK("URL_WCS_CHANGE_TASK");
private final String configKey;
ConfigMapKeyEnum(String configKey) {
this.configKey = configKey;

View File

@ -1,12 +1,22 @@
package com.wms.controller;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wms.annotation.MyLog;
import com.wms.constants.enums.ResponseCode;
import com.wms.entity.app.ResponseEntity;
import com.wms.entity.app.dto.PageDto;
import com.wms.entity.app.request.ConfigQuery;
import com.wms.entity.app.vo.ConfigVo;
import com.wms.entity.app.vo.VehicleVO;
import com.wms.entity.table.Config;
import com.wms.entity.table.Vehicle;
import com.wms.service.ConfigService;
import com.wms.utils.HttpUtils;
import com.wms.utils.StringUtils;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
@ -25,6 +35,7 @@ import static com.wms.utils.StringUtils.convertJsonString;
/**
* WMS系统配置控制类
*
* @author 梁州
* @date 2023/3/23
*/
@ -32,7 +43,7 @@ import static com.wms.utils.StringUtils.convertJsonString;
@CrossOrigin
@RequestMapping(value = "/wms/config")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ConfigController{
public class ConfigController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
* 系统配置服务
@ -45,43 +56,92 @@ public class ConfigController{
/**
* 查找所有配置
*
* @return 配置
*/
@GetMapping("/getConfigs")
@ResponseBody
public List<Config> getConfigs(){
public List<Config> getConfigs() {
logger.info("查询系统配置查询ip{}", HttpUtils.getIpAddr(servletRequest));
return configService.selectConfigs("");
}
/**
* 查询系统配置
*
* @param configQuery 配置
* @return 结果
*/
@PostMapping("/getConfigsByPage")
@ResponseBody
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
@MyLog(logTitle = "查询系统配置", logMethod = "getConfigsByPage")
public String getConfigsByPage(@RequestBody ConfigQuery configQuery) {
logger.info("查询系统配置,{}请求ip{}", convertJsonString(configQuery), HttpUtils.getIpAddr(servletRequest));
// 创建响应信息
ResponseEntity response = new ResponseEntity();
try {
Page<Config> page = configQuery.toMpPage();
Page<Config> configPage = configService.page(page, new LambdaQueryWrapper<Config>()
.like(StringUtils.isNotEmpty(configQuery.getConfigName()), Config::getConfigName, configQuery.getConfigName())
.like(StringUtils.isNotEmpty(configQuery.getConfigKey()), Config::getConfigKey, configQuery.getConfigKey())
.eq(StringUtils.isNotEmpty(configQuery.getConfigType()), Config::getConfigType, configQuery.getConfigType()));
PageDto<ConfigVo> pageDto = PageDto.of(configPage, config -> BeanUtil.copyProperties(config, ConfigVo.class));
response.setCode(ResponseCode.OK.getCode());
response.setMessage("查询系统配置成功。");
response.setReturnData(pageDto);
return convertJsonString(response);
} catch (Exception e) {
// 回滚事务
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
logger.error("查询系统配置发生异常。");
response.setCode(ResponseCode.ERROR.getCode());
response.setMessage("查询系统配置发生异常。");
return convertJsonString(response);
}
}
/**
* 更新系统配置
*
* @param config 配置
* @param configQuery 配置
* @return 结果
*/
@PostMapping("/updateConfig")
@ResponseBody
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
@MyLog(logTitle = "更新配置", logMethod = "updateConfig")
public String updateConfig(@RequestBody Config config) {
logger.info("更新系统配置,{}请求ip{}", convertJsonString(config), HttpUtils.getIpAddr(servletRequest));
public String updateConfig(@RequestBody ConfigQuery configQuery) {
logger.info("更新系统配置,{}请求ip{}", convertJsonString(configQuery), HttpUtils.getIpAddr(servletRequest));
// 创建响应信息
ResponseEntity rsp = new ResponseEntity();
try {
configService.updateConfig(config);
if (configQuery == null || configQuery.getConfigId() == null) {
logger.info("更新系统配置时配置id为必须项");
// 返回其他异常
rsp.setCode(ResponseCode.ERROR.getCode());
rsp.setMessage("更新系统配置时配置id为必须项");
return JSON.toJSONString(rsp);
}
configService.update(new LambdaUpdateWrapper<Config>()
.set(StringUtils.isNotEmpty(configQuery.getConfigKey()), Config::getConfigKey, configQuery.getConfigKey())
.set(StringUtils.isNotEmpty(configQuery.getConfigType()), Config::getConfigType, configQuery.getConfigType())
.set(StringUtils.isNotEmpty(configQuery.getConfigValue()), Config::getConfigValue, configQuery.getConfigValue())
.set(StringUtils.isNotEmpty(configQuery.getConfigName()), Config::getConfigName, configQuery.getConfigName())
.eq(Config::getConfigId, configQuery.getConfigId()));
// 返回成功
rsp.setCode(ResponseCode.OK.getCode());
rsp.setMessage("更新系统配置成功!");
return JSON.toJSONString(rsp);
} catch (Exception e) {
// 回滚事务
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
logger.info("更新系统配置错误:{}", e.getMessage());
// 返回其他异常
rsp.setCode(ResponseCode.ERROR.getCode());
rsp.setMessage(e.getMessage());
rsp.setMessage("更新系统配置错误。");
return JSON.toJSONString(rsp);
}
// 返回成功
rsp.setCode(ResponseCode.OK.getCode());
rsp.setMessage("更新系统配置成功!");
return JSON.toJSONString(rsp);
}
}

View File

@ -777,6 +777,10 @@ public class TaskController {
pickTask.setLastUpdateTime(LocalDateTime.now());
// 更新为完成
pickTaskService.updateById(pickTask);
// 更新站台信息
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getPickVehicle, boxArriveRequest.getVehicleNo())
.eq(Stand::getStandId, pickTask.getStandId()));
response.setCode(ResponseCode.OK.getCode());
response.setMessage("上报成功");
@ -821,7 +825,7 @@ public class TaskController {
// 站台号从ip获取
Stand standOfIp = standService.getOne(new LambdaQueryWrapper<Stand>()
.eq(Stand::getStandIp, HttpUtils.getIpAddr(servletRequest))
.eq(Stand::getStandType, 1));
.eq(Stand::getStandType, 2));
if (standOfIp != null && StringUtils.isNotEmpty(standOfIp.getStandId())) {
standId = standOfIp.getStandId();
}
@ -893,6 +897,12 @@ public class TaskController {
eTaskData.setNeedNum(thisPickNum.intValue());
eTaskData.setLocation(eConfig.getELocationId());
eTaskDataList.add(eTaskData);
// 更新电子标签库位信息
etagLocationService.update(new LambdaUpdateWrapper<ETagLocation>()
.set(ETagLocation::getTaskId, eTaskData.getTaskId())
.set(ETagLocation::getNeedNum, eTaskData.getNeedNum())
.set(ETagLocation::getConfirmNum, eTaskData.getNeedNum())
.eq(ETagLocation::getELocationId, eConfig.getELocationId()));
// 设置工作流更新信息
// tempWork.setPickedNum(tempWork.getPickedNum().add(thisPickNum));
tempWork.setLightStatus(1);
@ -921,7 +931,16 @@ public class TaskController {
// 更新workFlow数据
workFlowService.updateBatchById(workFlows);
// 更新亮灯数据
etagLocationService.update(new LambdaUpdateWrapper<ETagLocation>().set(ETagLocation::getPickStatus, 1).in(ETagLocation::getELocationId, eTaskDataList.stream().map(ETaskData::getLocation).collect(Collectors.toList())));
etagLocationService.update(new LambdaUpdateWrapper<ETagLocation>()
.set(ETagLocation::getPickStatus, 1)
.set(ETagLocation::getTaskType, wcsETaskRequest.getTaskType())
.set(ETagLocation::getVehicleNo, wcsETaskRequest.getVehicleNo())
.in(ETagLocation::getELocationId, eTaskDataList.stream().map(ETaskData::getLocation).collect(Collectors.toList())));
// 更新站台数据
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getPickGoods, workQuery.getGoodsId())
.set(Stand::getPickVehicle, vehicleId)
.eq(Stand::getStandId, standId));
// 生成前台VO
StandPickVo standPickVo = new StandPickVo();
standPickVo.setStandId(standId);
@ -967,6 +986,82 @@ public class TaskController {
}
}
/**
* 查询当前站台的正在拣选的物料是否完成
*
* @param workQuery 查询参数
* @return 生成的vo信息
*/
@PostMapping("/queryFinishByStandAndGoods")
@ResponseBody
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
@MyLog(logTitle = "查询当前站台的正在拣选的物料是否完成", logMethod = "queryFinishByStandAndGoods")
public String queryFinishByStandAndGoods(@RequestBody WorkQuery workQuery) {
logger.info("查询当前站台的正在拣选的物料是否完成:{}ip地址{}", convertJsonString(workQuery), HttpUtils.getIpAddr(servletRequest));
ResponseEntity response = new ResponseEntity();
try {
String validateInfo = validateService.validateGetWorkVoRequest(workQuery);
if (!Objects.equals(validateInfo, "")) {
logger.error("查询当前站台的正在拣选的物料是否完成错误:{}", validateInfo);
response.setCode(ResponseCode.ERROR.getCode());
response.setMessage(validateInfo);
return convertJsonString(response);
}
Stand targetStand;
if (StringUtils.isNotEmpty(workQuery.getStandId())) {
// 站台号从请求参数中获取
targetStand = standService.getById(workQuery.getStandId());
} else {
// 站台号从ip获取
targetStand = standService.getOne(new LambdaQueryWrapper<Stand>()
.eq(Stand::getStandIp, HttpUtils.getIpAddr(servletRequest))
.eq(Stand::getStandType, 2));
}
if (targetStand == null) {
logger.error("查询拣选站台错误。");
response.setCode(ResponseCode.ERROR.getCode());
response.setMessage("查询拣选站台错误。");
return convertJsonString(response);
}
if (StringUtils.isEmpty(targetStand.getPickGoods())) {
// 返回成功
StandPickVo standPickVo = new StandPickVo();
standPickVo.setTip(targetStand.getPickTip());
response.setCode(ResponseCode.OK.getCode());
response.setMessage("当前物料拣货完成。");
response.setReturnData(standPickVo);
} else {
// 查询当前站台的拣货任务
PickTask pickTask = pickTaskService.getOne(new LambdaQueryWrapper<PickTask>()
.eq(PickTask::getStandId, targetStand.getStandId())
.eq(PickTask::getPickStatus, PickTaskStatusEnum.FINISH.getCode()));
if (pickTask == null) {
// 返回成功
response.setCode(ResponseCode.OK.getCode());
response.setMessage("当前物料拣货完成。");
} else {
if (!targetStand.getPickGoods().equals(workQuery.getGoodsId())) {
// 返回成功
response.setCode(ResponseCode.OK.getCode());
response.setMessage("正在拣选其他物料。");
} else {
// 返回成功
response.setCode(ResponseCode.ERROR.getCode());
response.setMessage("当前物料正在拣货");
}
}
}
return convertJsonString(response);
} catch (Exception e) {
// 回滚事务
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
logger.error("获取工作信息异常:{}", convertJsonString(e));
response.setCode(ResponseCode.ERROR.getCode());
response.setMessage("获取工作信息异常");
return convertJsonString(response);
}
}
/**
* 获取电子标签反馈
*
@ -998,10 +1093,6 @@ public class TaskController {
}
// 更新实际拣选数量
workFlow.setPickedNum(workFlow.getPickedNum().add(BigDecimal.valueOf(eTaskFeedbackRequest.getConfirmNum())));
if (eTaskFeedbackRequest.getConfirmNum() < eTaskFeedbackRequest.getNeedNum()) {
// 数量不够时向库存要料
// TODO
}
if (workFlow.getPickedNum().compareTo(workFlow.getNeedNum()) < 0) {
// 判断后续有无物料进此站台
List<PickTask> pickedTasks = pickTaskService.list(new LambdaQueryWrapper<PickTask>()
@ -1014,7 +1105,6 @@ public class TaskController {
workFlow.setLightStatus(1);// 已亮灯
workFlow.setWorkStatus(1);// 正在做
} else {
// TODO 继续向库存要料
// 当前物料当前站台需求数量
BigDecimal needNum = workFlow.getNeedNum().subtract(workFlow.getPickedNum());
// 判断当前物料是否在流转中
@ -1048,14 +1138,19 @@ public class TaskController {
existStock.setGoodsRelated(goodsDetail);
stockService.updateById(existStock);
}
// 更新亮灯信息
// 更新电子标签库位信息
etagLocationService.update(new LambdaUpdateWrapper<ETagLocation>()
.set(ETagLocation::getPickStatus, 0)
.set(ETagLocation::getTaskId, "")
.set(ETagLocation::getVehicleNo, "")
.set(ETagLocation::getTaskType, null)
.set(ETagLocation::getNeedNum, null)
.set(ETagLocation::getConfirmNum, null)
.eq(ETagLocation::getELocationId, eTaskFeedbackRequest.getLocation()));
response.setCode(ResponseCode.OK.getCode());
response.setMessage("处理反馈成功");
} else {// 小盒子放入大盒子
// TODO
// TODO
logger.info("小盒子放入大盒子");
}
return convertJsonString(response);
@ -1092,7 +1187,7 @@ public class TaskController {
// 站台号从ip获取
Stand standOfIp = standService.getOne(new LambdaQueryWrapper<Stand>()
.eq(Stand::getStandIp, HttpUtils.getIpAddr(servletRequest))
.eq(Stand::getStandType, 1));
.eq(Stand::getStandType, 2));
if (standOfIp != null && StringUtils.isNotEmpty(standOfIp.getStandId())) {
standId = standOfIp.getStandId();
}
@ -1120,16 +1215,24 @@ public class TaskController {
// 没有拣货任务直接放行
// 调用Wcs的放行接口
wcsService.sendWcsDisposeVehicle(new WcsDisposeVehicleRequest(standId, null));
// 更新站台信息
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now())
.set(Stand::getPickVehicle, "")
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, "")
.eq(Stand::getStandId, standId));
response.setCode(ResponseCode.OK.getCode());
response.setMessage("确认成功,放行");
} else {
// 处理库存偏差
if (workConfirmRequest.getRemainNumReal().compareTo(workConfirmRequest.getRemainNumOrigin()) != 0) {
// TODO 这里库存的处理仍然需要完善
if (workConfirmRequest.getRemainNumReal().compareTo(BigDecimal.ZERO) == 0) {// 实际剩余数量为0
// 删除库存
stockService.remove(new LambdaQueryWrapper<Stock>()
.apply("goods_related -> '$.goodsId' = {0}", workConfirmRequest.getGoodsId())
.eq(Stock::getVehicleId, pickTask.getVehicleId()));
.apply("goods_related -> '$.goodsId' = {0}", workConfirmRequest.getGoodsId())
.eq(Stock::getVehicleId, pickTask.getVehicleId()));
//
} else {
// 更新库存数量
@ -1166,6 +1269,10 @@ public class TaskController {
// 需要不放行返回前台提示信息
StandPickVo pickVoEntity = new StandPickVo();
pickVoEntity.setTip("当前料箱还有其他物料需要拣货");
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, pickVoEntity.getTip())
.eq(Stand::getStandId, standId));
response.setCode(ResponseCode.WARNING.getCode());
response.setMessage("当前料箱还有其他物料需要拣货");
response.setReturnData(pickVoEntity);
@ -1183,10 +1290,25 @@ public class TaskController {
.eq(WorkFlow::getWorkStation, standId)
.ne(WorkFlow::getWorkStatus, 2))) {
// 当前站台工作未全部完成
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now())
.set(Stand::getPickVehicle, "")
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, "")
.eq(Stand::getStandId, standId));
response.setMessage("确认成功,放行");
} else {
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now())
.set(Stand::getPickVehicle, "")
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, "当前工作已经全部完成,请至完成界面进行后续工作。")
.eq(Stand::getStandId, standId));
StandPickVo pickVoEntity = new StandPickVo();
pickVoEntity.setTip("当前工作已经全部完成,请至完成界面进行后续工作。");
// 当前站台工作已全部完成需要提示工作完成打印标签
response.setMessage("当前工作已经全部完成,请至完成界面进行后续工作。");
response.setReturnData(pickVoEntity);
}
response.setCode(ResponseCode.OK.getCode());
}
@ -1204,10 +1326,25 @@ public class TaskController {
.eq(WorkFlow::getWorkStation, standId)
.ne(WorkFlow::getWorkStatus, 2))) {
// 当前站台工作未全部完成
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now())
.set(Stand::getPickVehicle, "")
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, "")
.eq(Stand::getStandId, standId));
response.setMessage("确认成功,放行");
} else {
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now())
.set(Stand::getPickVehicle, "")
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, "当前工作已经全部完成,请至完成界面进行后续工作。")
.eq(Stand::getStandId, standId));
StandPickVo pickVoEntity = new StandPickVo();
pickVoEntity.setTip("当前工作已经全部完成,请至完成界面进行后续工作。");
// 当前站台工作已全部完成需要提示工作完成打印标签
response.setMessage("当前工作已经全部完成,请至完成界面进行后续工作。");
response.setReturnData(pickVoEntity);
}
response.setCode(ResponseCode.OK.getCode());
}
@ -1246,13 +1383,12 @@ public class TaskController {
// 站台号从ip获取
Stand standOfIp = standService.getOne(new LambdaQueryWrapper<Stand>()
.eq(Stand::getStandIp, HttpUtils.getIpAddr(servletRequest))
.eq(Stand::getStandType, 1));
.eq(Stand::getStandType, 2));
if (standOfIp != null && StringUtils.isNotEmpty(standOfIp.getStandId())) {
standId = standOfIp.getStandId();
}
}
if (StringUtils.isEmpty(standId)) {
// TODO 这里需要使用websocket从后台向前台推送消息
logger.error("请求参数缺少站台号。");
response.setCode(ResponseCode.ERROR.getCode());
response.setMessage("请求参数缺少站台号。");
@ -1262,7 +1398,6 @@ public class TaskController {
if (etagLocationService.exists(new LambdaQueryWrapper<ETagLocation>()
.eq(ETagLocation::getWorkStation, standId)
.eq(ETagLocation::getPickStatus, 1))) {
// TODO 这里需要使用websocket从后台向前台推送消息
logger.error("站台灯光未全部拍灭,请检查。");
response.setCode(ResponseCode.ERROR.getCode());
response.setMessage("站台灯光未全部拍灭,请检查。");
@ -1275,7 +1410,14 @@ public class TaskController {
if (pickTask == null) {
// 没有拣货任务直接放行
// 调用Wcs的放行接口
wcsService.sendWcsDisposeVehicle(new WcsDisposeVehicleRequest(standId, null));
// wcsService.sendWcsDisposeVehicle(new WcsDisposeVehicleRequest(standId, null));
// 更新站台信息
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now())
.set(Stand::getPickVehicle, "")
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, "")
.eq(Stand::getStandId, standId));
response.setCode(ResponseCode.OK.getCode());
response.setMessage("确认成功,放行");
} else {
@ -1291,12 +1433,16 @@ public class TaskController {
}
}
if (goodsIdList.size() > 0) {
// 判断这些物料是不是当前站台的工作流中否需要
// 判断这些物料是不是当前站台的工作流中否需要
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, standId)
.in(WorkFlow::getGoodsId, goodsIdList)
.ne(WorkFlow::getWorkStatus, 2))) {
// TODO 这里需要使用websocket从后台向前台推送消息
// 更新站台信息
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, "当前料箱还有其他物料需要拣货")
.eq(Stand::getStandId, standId));
// 需要不放行返回前台提示信息
response.setCode(ResponseCode.ERROR.getCode());
response.setMessage("当前料箱还有其他物料需要拣货");
@ -1313,9 +1459,21 @@ public class TaskController {
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, standId)
.ne(WorkFlow::getWorkStatus, 2))) {
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now())
.set(Stand::getPickVehicle, "")
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, "")
.eq(Stand::getStandId, standId));
// 当前站台工作未全部完成
response.setMessage("确认成功,放行");
} else {
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now())
.set(Stand::getPickVehicle, "")
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, "当前工作已经全部完成,请至完成界面进行后续工作。")
.eq(Stand::getStandId, standId));
// 当前站台工作已全部完成需要提示工作完成打印标签
response.setMessage("当前工作已经全部完成,请至完成界面进行后续工作。");
}
@ -1335,8 +1493,20 @@ public class TaskController {
.eq(WorkFlow::getWorkStation, standId)
.ne(WorkFlow::getWorkStatus, 2))) {
// 当前站台工作未全部完成
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now())
.set(Stand::getPickVehicle, "")
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, "")
.eq(Stand::getStandId, standId));
response.setMessage("确认成功,放行");
} else {
standService.update(new LambdaUpdateWrapper<Stand>()
.set(Stand::getLastUseTime, LocalDateTime.now())
.set(Stand::getPickVehicle, "")
.set(Stand::getPickGoods, "")
.set(Stand::getPickTip, "当前工作已经全部完成,请至完成界面进行后续工作。")
.eq(Stand::getStandId, standId));
// 当前站台工作已全部完成需要提示工作完成打印标签
response.setMessage("当前工作已经全部完成,请至完成界面进行后续工作。");
}
@ -1377,7 +1547,7 @@ public class TaskController {
// 站台号从ip获取
Stand standOfIp = standService.getOne(new LambdaQueryWrapper<Stand>()
.eq(Stand::getStandIp, HttpUtils.getIpAddr(servletRequest))
.eq(Stand::getStandType, 1));
.eq(Stand::getStandType, 2));
if (standOfIp != null && StringUtils.isNotEmpty(standOfIp.getStandId())) {
standId = standOfIp.getStandId();
}
@ -1469,7 +1639,7 @@ public class TaskController {
// 站台号从ip获取
Stand standOfIp = standService.getOne(new LambdaQueryWrapper<Stand>()
.eq(Stand::getStandIp, HttpUtils.getIpAddr(servletRequest))
.eq(Stand::getStandType, 1));
.eq(Stand::getStandType, 2));
if (standOfIp != null && StringUtils.isNotEmpty(standOfIp.getStandId())) {
standId = standOfIp.getStandId();
}
@ -1583,7 +1753,7 @@ public class TaskController {
if (needNum <= 0) {
response.setCode(ResponseCode.OK.getCode());
response.setMessage("呼叫空箱成功,请等待箱子出库。");
} else if (needNum < callEmptyVehicleRequest.getNeedNum()) {
} else if (needNum < callEmptyVehicleRequest.getNeedNum()) {
response.setCode(ResponseCode.OK.getCode());
response.setMessage("已呼叫空箱,但库中空箱数量不足。需求" + callEmptyVehicleRequest.getNeedNum() + "个,实际呼叫" + (callEmptyVehicleRequest.getNeedNum() - needNum) + "个。");
} else {
@ -1601,9 +1771,9 @@ public class TaskController {
}
}
// TODO 接收Wcs询问是否回库的请求
/**
* Wcs请求箱子是否回库
*
* @param requestBackQuery 请求信息
* @return 结果
*/

View File

@ -54,4 +54,16 @@ public class StandDto {
* 最近一次的使用时间
*/
private LocalDateTime lastUseTime;
/**
* 正在拣选的物料
*/
private String pickGoods;
/**
* 正在拣选的箱子
*/
private String pickVehicle;
/**
* 拣选提示信息
*/
private String pickTip;
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.wms.entity.table.Config;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -42,4 +43,17 @@ public class ConfigQuery extends PageQuery {
*/
@JsonProperty("configName")
private String configName;
/**
* 返回配置PO
*/
public Config toConfigPO() {
Config config = new Config();
config.setConfigId(this.configId);
config.setConfigKey(this.configKey);
config.setConfigName(this.configName);
config.setConfigValue(this.configValue);
config.setConfigType(this.configType);
return config;
}
}

View File

@ -0,0 +1,34 @@
package com.wms.entity.app.vo;
import lombok.Data;
/**
* 配置显示类
*/
@Data
public class ConfigVo {
/**
* 配置ID
*/
private Integer configId;
/**
* 配置键
*/
private String configKey;
/**
* 配置值
*/
private String configValue;
/**
* 配置类型
*/
private String configType;
/**
* 配置名称
*/
private String configName;
}

View File

@ -1,6 +1,8 @@
package com.wms.entity.app.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@ -50,5 +52,19 @@ public class StandVo {
/**
* 最近一次的使用时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime lastUseTime;
/**
* 正在拣选的物料
*/
private String pickGoods;
/**
* 正在拣选的物料
*/
private String pickVehicle;
/**
* 拣选提示信息
*/
private String pickTip;
}

View File

@ -71,4 +71,19 @@ public class Stand {
*/
@TableField("last_use_time")
private LocalDateTime lastUseTime;
/**
* 正在拣选的物料
*/
@TableField("pick_goods")
private String pickGoods;
/**
* 正在拣选的物料
*/
@TableField("pick_vehicle")
private String pickVehicle;
/**
* 拣选提示信息
*/
@TableField("pick_tip")
private String pickTip;
}

View File

@ -47,7 +47,7 @@ public class WmsJobServiceImplements implements IWmsJobService {
*/
public void sendCommonTasks() throws Exception {
try {
String max_vehicle_nums = configMap.get("MAX_VEHICLE_NUMS");
String max_vehicle_nums = configMap.get(ConfigMapKeyEnum.MAX_VEHICLE_NUMS.getConfigKey());
if (StringUtils.isEmpty(max_vehicle_nums)) {
logger.error("配置未生成");
return;

View File

@ -2,6 +2,7 @@ package com.wms.service.business.serviceImplements;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.wms.constants.enums.ConfigMapKeyEnum;
import com.wms.entity.app.dto.WorkCenterAndOrderDto;
import com.wms.entity.table.*;
import com.wms.service.*;
@ -171,7 +172,7 @@ public class WorkServiceImplements implements IWorkService {
// 查找当前站台未开始的工作流
List<WorkFlow> currentWorkFlowList = workFlowService.list(new LambdaQueryWrapper<WorkFlow>()
.eq(WorkFlow::getWorkStation, workStation)
.ne(WorkFlow::getWorkStatus, 2));
.eq(WorkFlow::getWorkStatus, 0));
// 没有可做的任务
if (currentWorkFlowList == null || currentWorkFlowList.isEmpty()) {
return;
@ -342,7 +343,7 @@ public class WorkServiceImplements implements IWorkService {
List<KateOrders> kateWorkOrders = kateOrdersService.list(new LambdaQueryWrapper<KateOrders>()
.eq(KateOrders::getSupplyArea, workConfig.getSmallBox())
.eq(KateOrders::getOrderStatus, 0)
.eq(KateOrders::getSLoc, configMap.get("SLOC_FILTER_STRING")));
.eq(KateOrders::getSLoc, configMap.get(ConfigMapKeyEnum.SLOC_FILTER_STRING.getConfigKey())));
// 当前工位没有未完成的工单
if (kateWorkOrders == null || kateWorkOrders.isEmpty()) {
continue;
@ -384,7 +385,7 @@ public class WorkServiceImplements implements IWorkService {
.eq(KateOrders::getWorkOrder, currentWorkCenterAndOrderDto.getWorkOrder())
.eq(KateOrders::getSupplyArea, currentWorkCenterAndOrderDto.getWorkCenter())
.eq(KateOrders::getOrderStatus, 0)
.eq(KateOrders::getSLoc, configMap.get("SLOC_FILTER_STRING")));
.eq(KateOrders::getSLoc, configMap.get(ConfigMapKeyEnum.SLOC_FILTER_STRING.getConfigKey())));
for (KateOrders tempOrder : kateWorkOrderList) {
// 生成workFlow
WorkFlow tempWorkFlow = new WorkFlow();