todo完善
This commit is contained in:
parent
de098ec968
commit
2104ddc7fc
@ -15,12 +15,14 @@ import com.mt.wms.core.vo.R;
|
|||||||
import com.mt.wms.empty.params.OutStockParam;
|
import com.mt.wms.empty.params.OutStockParam;
|
||||||
import com.mt.wms.empty.service.OutStockService;
|
import com.mt.wms.empty.service.OutStockService;
|
||||||
import com.mt.wms.empty.task.AsynRunTaskService;
|
import com.mt.wms.empty.task.AsynRunTaskService;
|
||||||
|
import com.mt.wms.empty.task.RunTaskUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.IOException;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -41,42 +43,16 @@ public class OutStockServiceImpl extends BaseService implements OutStockService
|
|||||||
private InStockInfoServiceBiz inStockInfoServiceBiz;
|
private InStockInfoServiceBiz inStockInfoServiceBiz;
|
||||||
@Resource
|
@Resource
|
||||||
private RunTaskServiceBiz runTaskServiceBiz;
|
private RunTaskServiceBiz runTaskServiceBiz;
|
||||||
|
@Resource
|
||||||
|
private RunTaskUtils runTaskUtils;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R<String> outTask(OutStockParam outStockParam) {
|
public R outTask(OutStockParam outStockParam) throws IOException {
|
||||||
// TODO: 2021/12/17 出库
|
// 2021/12/17 出库
|
||||||
Long locationId = outStockParam.getLocaltionId();
|
Long locationId = outStockParam.getLocaltionId();
|
||||||
//提升台
|
//提升台
|
||||||
Integer code = outStockParam.getCode();
|
String code = outStockParam.getCode();
|
||||||
//查询是否有空闲车辆,若有。占用车辆,若无,返回暂无可用车辆
|
return runTaskUtils.runTaskForOut(locationId,code);
|
||||||
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("操作成功");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public class WebSocketServer {
|
|||||||
this.id = id;//接收到发送消息的人员编号
|
this.id = id;//接收到发送消息的人员编号
|
||||||
webSocketSet.put(id, this); //加入set中
|
webSocketSet.put(id, this); //加入set中
|
||||||
addOnlineCount(); //在线数加1
|
addOnlineCount(); //在线数加1
|
||||||
//log.info("用户"+id+"加入!当前在线人数为" + getOnlineCount());
|
log.info("用户"+id+"加入!当前在线人数为" + getOnlineCount());
|
||||||
try {
|
try {
|
||||||
sendMessage("连接成功");
|
sendMessage("连接成功");
|
||||||
|
|
||||||
|
@ -89,6 +89,7 @@ wms:
|
|||||||
- /*/wechatLogin
|
- /*/wechatLogin
|
||||||
- /*/mobileLogin
|
- /*/mobileLogin
|
||||||
- /apms
|
- /apms
|
||||||
|
- /qj/websocket/*
|
||||||
|
|
||||||
#公共配置
|
#公共配置
|
||||||
common:
|
common:
|
||||||
|
Loading…
Reference in New Issue
Block a user