todo完善

This commit is contained in:
李广豪 2022-03-19 11:24:21 +08:00
parent de098ec968
commit 2104ddc7fc
3 changed files with 10 additions and 33 deletions

View File

@ -15,12 +15,14 @@ import com.mt.wms.core.vo.R;
import com.mt.wms.empty.params.OutStockParam;
import com.mt.wms.empty.service.OutStockService;
import com.mt.wms.empty.task.AsynRunTaskService;
import com.mt.wms.empty.task.RunTaskUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.List;
@ -41,42 +43,16 @@ public class OutStockServiceImpl extends BaseService implements OutStockService
private InStockInfoServiceBiz inStockInfoServiceBiz;
@Resource
private RunTaskServiceBiz runTaskServiceBiz;
@Resource
private RunTaskUtils runTaskUtils;
@Override
public R<String> outTask(OutStockParam outStockParam) {
// TODO: 2021/12/17 出库
public R outTask(OutStockParam outStockParam) throws IOException {
// 2021/12/17 出库
Long locationId = outStockParam.getLocaltionId();
//提升台
Integer code = outStockParam.getCode();
//查询是否有空闲车辆若有占用车辆若无返回暂无可用车辆
List<VehicleInfo> vehicleInfoList = vehicleInfoServiceBiz.list(new QueryWrapper<VehicleInfo>()
.eq(VehicleInfo.STATUS, 0)
.eq(VehicleInfo.VALID, 1));
if (vehicleInfoList.size()>0){
VehicleInfo vehicleInfo = vehicleInfoList.get(0);
vehicleInfo.setStatus(1);
vehicleInfo.setUpdateTime(LocalDateTime.now());
vehicleInfoServiceBiz.updateById(vehicleInfo);
}else {
return R.failed("暂无可用车辆!请稍后重试!");
}
//生成调度任务
RunTask runTask=new RunTask();
runTask.setBeginTime(LocalDateTime.now());
runTask.setVehicleId(vehicleInfoList.get(0).getId());
// TODO: 2021/12/22 库位id对应的位置 提升平台对应的位置
runTask.setStartPosition("库位位置");
runTask.setEndPosition("提升台位置");
setCommonField(runTask);
runTaskServiceBiz.save(runTask);
//异步调用车辆
asynRunTaskService.asynRunOutStock(locationId);
//修改库位状态
InStockInfo inStockInfo = inStockInfoServiceBiz
.getOne(new QueryWrapper<InStockInfo>().eq("Location_id", locationId));
inStockInfo.setStatus(1);
inStockInfoServiceBiz.updateById(inStockInfo);
return R.ok("操作成功");
String code = outStockParam.getCode();
return runTaskUtils.runTaskForOut(locationId,code);
}
}

View File

@ -46,7 +46,7 @@ public class WebSocketServer {
this.id = id;//接收到发送消息的人员编号
webSocketSet.put(id, this); //加入set中
addOnlineCount(); //在线数加1
//log.info("用户"+id+"加入!当前在线人数为" + getOnlineCount());
log.info("用户"+id+"加入!当前在线人数为" + getOnlineCount());
try {
sendMessage("连接成功");

View File

@ -89,6 +89,7 @@ wms:
- /*/wechatLogin
- /*/mobileLogin
- /apms
- /qj/websocket/*
#公共配置
common: