代码更新:

1. 增加站台监控
2. 修复拉取任务的问题
This commit is contained in:
梁州 2024-10-10 17:24:09 +08:00
parent 345a14d7ae
commit 229df2792a
5 changed files with 481896 additions and 32334 deletions

View File

@ -66,14 +66,7 @@ public class StandController {
.like(StringUtils.isNotEmpty(standQuery.getStandId()), Stand::getStandId, standQuery.getStandId())
.eq(standQuery.getStandStatus() != null, Stand::getStandStatus, standQuery.getStandStatus())
.eq(standQuery.getIsLock() != null, Stand::getIsLock, standQuery.getIsLock())
.eq(standQuery.getEquipmentType() != null, Stand::getStandType, standQuery.getEquipmentType());
if (standQuery.getStandType() != null) {
if (standQuery.getStandType() == 1) {// 入库
lambdaQueryWrapper.eq(Stand::getAllowIn, 1);// 入库
} else if (standQuery.getStandType() == 2) {// 出库
lambdaQueryWrapper.eq(Stand::getAllowOut, 1);// 出库
}
}
.eq(standQuery.getStandType() != null, Stand::getStandType, standQuery.getStandType());
Page<Stand> standPage = standService.page(page, lambdaQueryWrapper);
PageDto<StandVo> pageDto = PageDto.of(standPage, stand -> BeanUtil.copyProperties(stand, StandVo.class));
@ -94,34 +87,39 @@ public class StandController {
/**
* 更新站台信息
*
* @param stand 站台信息
* @param request 站台信息
* @return 结果
*/
@PostMapping("/updateStandInfo")
@ResponseBody
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
@MyLog(logTitle = "更新站台信息", logMethod = "updateStandInfo")
public String updateGoodsInfo(@RequestBody StandDto stand) {
logger.info("接收到更新站台信息请求:{}请求ip{}", convertJsonString(stand), HttpUtils.getIpAddr(servletRequest));
public String updateGoodsInfo(@RequestBody StandQuery request) {
logger.info("接收到更新站台信息请求:{}请求ip{}", convertJsonString(request), HttpUtils.getIpAddr(servletRequest));
// 创建响应信息
ResponseEntity rsp = new ResponseEntity();
try {
if (StringUtils.isEmpty(stand.getStandId())) {// 站台id为空不允许更新
logger.error("请求更新的站台id为空");
if (StringUtils.isEmpty(request.getStandId())) {// 站台id为空不允许更新
logger.error("缺少站台号。");
rsp.setCode(ResponseCode.ERROR.getCode());
rsp.setMessage("请求更新的站台id为空");
rsp.setMessage("缺少站台号。");
return convertJsonString(rsp);
}
if (standService.update(BeanUtil.copyProperties(stand, Stand.class),
new LambdaUpdateWrapper<Stand>().eq(Stand::getStandId, stand.getStandId()))) {
// 返回成功
logger.info("更新站台信息成功");
// 更新信息
LambdaUpdateWrapper<Stand> lambdaUpdateWrapper = new LambdaUpdateWrapper<Stand>()
.set(request.getIsLock() != null, Stand::getIsLock, request.getIsLock())
.set(request.getStandStatus() != null, Stand::getStandStatus, request.getStandStatus())
.set(request.getLastUseTime() != null, Stand::getLastUseTime, request.getLastUseTime())
.set(request.getPickVehicleCount() != null, Stand::getPickVehicleCount, request.getPickVehicleCount())
.eq(Stand::getStandId, request.getStandId());
if (standService.update(lambdaUpdateWrapper)) {
logger.info("更新站台信息成功。");
rsp.setCode(ResponseCode.OK.getCode());
rsp.setMessage("更新站台信息成功");
rsp.setMessage("更新站台信息成功");
} else {
logger.error("更新站台信息失败");
logger.error("更新站台信息失败");
rsp.setCode(ResponseCode.ERROR.getCode());
rsp.setMessage("更新站台信息失败");
rsp.setMessage("更新站台信息失败");
}
return convertJsonString(rsp);
} catch (Exception e) {

View File

@ -1,8 +1,12 @@
package com.wms.entity.app.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* 站台查询请求
@ -11,10 +15,20 @@ import lombok.EqualsAndHashCode;
@Data
public class StandQuery extends PageQuery {
/**
* 站台
* 站台id
*/
@JsonProperty("standId")
private String standId;
/**
* 是否允许入库
*/
@JsonProperty("allowIn")
private Integer allowIn;
/**
* 是否允许出库
*/
@JsonProperty("allowOut")
private Integer allowOut;
/**
* 站台是否锁定
*/
@ -25,14 +39,59 @@ public class StandQuery extends PageQuery {
*/
@JsonProperty("standStatus")
private Integer standStatus;
/**
* 设备编号
*/
@JsonProperty("equipmentId")
private Integer equipmentId;
/**
* 库区编号
*/
@JsonProperty("areaId")
private Integer areaId;
/**
* 站台类型
*/
@JsonProperty("standType")
private Integer standType;
/**
* 设备类型
* 站台ip
*/
@JsonProperty("equipmentType")
private Integer equipmentType;
@JsonProperty("standIp")
private String standIp;
/**
* 外部id
* 如mes上的站台编号
*/
@JsonProperty("outerId")
private String outerId;
/**
* 最近一次的使用时间
*/
@JsonProperty("lastUseTime")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime lastUseTime;
/**
* 正在拣选的物料
*/
@JsonProperty("pickGoods")
private String pickGoods;
/**
* 正在拣选的物料
*/
@JsonProperty("pickVehicle")
private String pickVehicle;
/**
* 拣选提示信息
*/
@JsonProperty("pickTip")
private String pickTip;
/**
* 所有待拣选的箱子数量
*/
@JsonProperty("pickVehicleCount")
private Integer pickVehicleCount;
}

View File

@ -7,66 +7,85 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* 站台显示
*/
@Data
public class StandVo {
/**
* 站台id
*/
@JsonProperty("standId")
private String standId;
/**
* 是否允许入库
*/
@JsonProperty("allowIn")
private Integer allowIn;
/**
* 是否允许出库
*/
@JsonProperty("allowOut")
private Integer allowOut;
/**
* 站台是否锁定
*/
@JsonProperty("isLock")
private Integer isLock;
/**
* 站台状态
*/
@JsonProperty("standStatus")
private Integer standStatus;
/**
* 设备编号
*/
@JsonProperty("equipmentId")
private Integer equipmentId;
/**
* 库区编号
*/
@JsonProperty("areaId")
private Integer areaId;
/**
* 站台类型
*/
@JsonProperty("standType")
private Integer standType;
/**
* 站台ip
*/
@JsonProperty("standIp")
private String standIp;
/**
* 外部id
* 果对接其它系统的站台id
* mes上的站台编号
*/
@JsonProperty("outerId")
private String outerId;
/**
* 最近一次的使用时间
*/
@JsonProperty("lastUseTime")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime lastUseTime;
/**
* 正在拣选的物料
*/
@JsonProperty("pickGoods")
private String pickGoods;
/**
* 正在拣选的物料
*/
@JsonProperty("pickVehicle")
private String pickVehicle;
/**
* 拣选提示信息
*/
@JsonProperty("pickTip")
private String pickTip;
/**
* 所有待拣选的箱子数量

View File

@ -448,6 +448,7 @@ public class WmsTaskServiceImplements implements IWmsTaskService {
outsideVehicle.setVehicleId(tempStock.getVehicleId());
outsideVehicle.setGoodsId(tempStock.getGoodsRelated().getGoodsId());
outsideVehicle.setRemainNum(tempStock.getGoodsRelated().getRemainNum());
outsideVehicle.setOutStatus(0);
outsideVehicles.add(outsideVehicle);
}
for (String vehicleId : vehicleIds) {
@ -466,6 +467,7 @@ public class WmsTaskServiceImplements implements IWmsTaskService {
outsideVehicle.setVehicleId(vehicleStock.getVehicleId());
outsideVehicle.setGoodsId(vehicleStock.getGoodsRelated().getGoodsId());
outsideVehicle.setRemainNum(vehicleStock.getGoodsRelated().getRemainNum());
outsideVehicle.setOutStatus(0);
outsideVehicles.add(outsideVehicle);
}
}
@ -516,10 +518,12 @@ public class WmsTaskServiceImplements implements IWmsTaskService {
tempPickTask.setPickStatus(PickTaskStatusEnum.TEMP.getCode());
} else {
tempPickTask.setPickStatus(pickStatus);
addNum++;
}
tempPickTask.setLastUpdateTime(LocalDateTime.now());
pickTasks.add(tempPickTask);
if (!Objects.equals(tempPickTask.getPickStatus(), PickTaskStatusEnum.TEMP.getCode())) {
addNum++;
}
}
// 添加数据库
pickTaskService.saveBatch(pickTasks);

File diff suppressed because one or more lines are too long