Compare commits
No commits in common. "97c808bc7a6852fa02120a0833bb7ee9c1b594cd" and "70599d191f373a3954756b11c8479863cff58fc0" have entirely different histories.
97c808bc7a
...
70599d191f
|
|
@ -273,55 +273,6 @@ public class AppTaskController extends BaseController
|
||||||
ObjectUtil.isEmpty(wcsStackerTask.getVehicleNo())){
|
ObjectUtil.isEmpty(wcsStackerTask.getVehicleNo())){
|
||||||
return error("缺少请求数据");
|
return error("缺少请求数据");
|
||||||
}
|
}
|
||||||
// 检查是不是有库存,有库存并且货位是空的是捡货完回库的
|
|
||||||
AppStock appStock = new AppStock();
|
|
||||||
appStock.setVehicleId(wcsStackerTask.getVehicleNo());
|
|
||||||
appStock.setLocationId("");
|
|
||||||
List<AppStock> appStocks = appStockService.selectAppStockList(appStock);
|
|
||||||
if(appStocks == null){
|
|
||||||
return error("数据服务异常");
|
|
||||||
}
|
|
||||||
if(!appStocks.isEmpty()){
|
|
||||||
AppTask appTask = new AppTask();
|
|
||||||
appTask.setVehicleId(wcsStackerTask.getVehicleNo());
|
|
||||||
AppTask appTask2 = new AppTask();
|
|
||||||
BeanUtils.copyProperties(wcsStackerTask, appTask2);
|
|
||||||
appTask2.setTaskId("RK"+System.currentTimeMillis());
|
|
||||||
appTask2.setWcsTaskId("RK"+System.currentTimeMillis());
|
|
||||||
appTask2.setTaskStatus(1);
|
|
||||||
appTask2.setTaskType(1);
|
|
||||||
appTask2.setOrigin(wcsStackerTask.getPoint());
|
|
||||||
appTask2.setTaskPriority(1);
|
|
||||||
String location = appLocationService.sendLocation();
|
|
||||||
appTask2.setDestination(location);
|
|
||||||
appTask2.setVehicleId(wcsStackerTask.getVehicleNo());
|
|
||||||
int i1 = appTaskService.insertAppTask(appTask2);
|
|
||||||
if(i1 == 0 ){
|
|
||||||
return error("wms生成入库任务异常");
|
|
||||||
}
|
|
||||||
AppWcsTask appTask1 = new AppWcsTask();
|
|
||||||
BeanUtils.copyProperties(wcsStackerTask, appTask);
|
|
||||||
appTask1.setWcsTaskId(appTask2.getTaskId());
|
|
||||||
appTask1.setWcsTaskStatus(1);
|
|
||||||
appTask1.setWcsTaskType(appTask2.getTaskType());
|
|
||||||
appTask1.setOrigin("101");
|
|
||||||
appTask1.setTaskPriority(appTask2.getTaskPriority());
|
|
||||||
appTask1.setDestination(location);
|
|
||||||
appTask1.setSendTime(new Date());
|
|
||||||
appTask1.setVehicleId(appTask2.getVehicleId());
|
|
||||||
int i = appWcsTaskService.insertAppWcsTask(appTask1);
|
|
||||||
if(i == 0 ){
|
|
||||||
return error("wcs生成入库任务异常");
|
|
||||||
}
|
|
||||||
|
|
||||||
WcsDate wcsDate = new WcsDate();
|
|
||||||
wcsDate.setTaskId(appTask2.getTaskId());
|
|
||||||
wcsDate.setUser("WMS");
|
|
||||||
wcsDate.setVehicleNo(wcsStackerTask.getVehicleNo());
|
|
||||||
wcsDate.setDestination(location);
|
|
||||||
return success(wcsDate);
|
|
||||||
}
|
|
||||||
// 没有库存,表示可能是新入库的
|
|
||||||
AppPendingStorage appPendingStorage = new AppPendingStorage();
|
AppPendingStorage appPendingStorage = new AppPendingStorage();
|
||||||
appPendingStorage.setVehicleNo(wcsStackerTask.getVehicleNo());
|
appPendingStorage.setVehicleNo(wcsStackerTask.getVehicleNo());
|
||||||
List<AppPendingStorage> appPendingStorages = appPendingStorageService.selectAppPendingStorageList(appPendingStorage);
|
List<AppPendingStorage> appPendingStorages = appPendingStorageService.selectAppPendingStorageList(appPendingStorage);
|
||||||
|
|
|
||||||
|
|
@ -184,41 +184,6 @@ public class TaskExecutor {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (AppTask task : appTasks) {
|
for (AppTask task : appTasks) {
|
||||||
// 检查是否存在库存
|
|
||||||
AppStock appStockCheck = new AppStock();
|
|
||||||
appStockCheck.setVehicleId(task.getVehicleId());
|
|
||||||
List<AppStock> appStocks = appStockService.selectAppStockList(appStockCheck);
|
|
||||||
if (appStocks == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!appStocks.isEmpty()) { // 存在库存,可能是回库任务
|
|
||||||
int updateLocationWithVehicleId = appStockService.updateLocationWithVehicleId(task.getVehicleId(), task.getDestination());
|
|
||||||
logger.info("重新回库更新库存成功,更新条数:{}", updateLocationWithVehicleId);
|
|
||||||
AppTask updateRemark = new AppTask();
|
|
||||||
updateRemark.setTaskId(task.getTaskId());
|
|
||||||
updateRemark.setRemark("已更新库存库位");
|
|
||||||
appTaskService.updateAppTask(updateRemark); // 更新备注信息
|
|
||||||
AppTaskBak appTaskBak = new AppTaskBak();
|
|
||||||
appTaskBak.setTaskId(task.getTaskId());
|
|
||||||
appTaskBak.setTaskStatus(task.getTaskStatus());
|
|
||||||
appTaskBak.setRemark(updateRemark.getRemark());
|
|
||||||
appTaskBak.setTaskType(task.getTaskType());
|
|
||||||
appTaskBak.setTaskPriority(task.getTaskPriority());
|
|
||||||
appTaskBak.setVehicleId(task.getVehicleId());
|
|
||||||
appTaskBak.setOrigin(task.getOrigin());
|
|
||||||
appTaskBak.setDestination(task.getDestination());
|
|
||||||
appTaskBak.setWcsTaskId(task.getWcsTaskId());
|
|
||||||
appTaskBak.setFinishTime(task.getFinishTime());
|
|
||||||
appTaskBak.setGoodsId(task.getGoodsId());
|
|
||||||
appTaskBak.setOpNum(task.getOpNum());
|
|
||||||
appTaskBak.setStockNum(task.getStockNum());
|
|
||||||
appTaskBak.setOpUser(task.getOpUser());
|
|
||||||
appTaskBak.setPreTask(task.getPreTask());
|
|
||||||
logger.info("入库任务数据归档成功(回库)。{}", JSON.toJSONString(appTaskBak));
|
|
||||||
appTaskBakService.insertAppTaskBak(appTaskBak);// 数据归档
|
|
||||||
appTaskService.deleteAppTaskByTaskId(task.getTaskId()); // 删除旧数据
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 从码盘表内拉出数据
|
// 从码盘表内拉出数据
|
||||||
AppPendingStorage appPendingStorage = new AppPendingStorage();
|
AppPendingStorage appPendingStorage = new AppPendingStorage();
|
||||||
appPendingStorage.setVehicleNo(task.getVehicleId());
|
appPendingStorage.setVehicleNo(task.getVehicleId());
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,4 @@ public interface AppStockMapper
|
||||||
List<AppStock> selectStockByGoodsId(AppStock appStock);
|
List<AppStock> selectStockByGoodsId(AppStock appStock);
|
||||||
|
|
||||||
int updateSts(AppStock appStock);
|
int updateSts(AppStock appStock);
|
||||||
|
|
||||||
int updateLocationWithVehicleId(String vehicleId, String location);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,6 @@ public interface IAppStockService
|
||||||
|
|
||||||
|
|
||||||
public int updateNewLocation(String oldLocation, String newLocation);
|
public int updateNewLocation(String oldLocation, String newLocation);
|
||||||
|
|
||||||
int updateLocationWithVehicleId(String vehicleId, String location);
|
|
||||||
|
|
||||||
List<AppStock> selectStockByGoodsId(AppStock tMiStock);
|
List<AppStock> selectStockByGoodsId(AppStock tMiStock);
|
||||||
|
|
||||||
int updateSts(AppStock tMiStock3);
|
int updateSts(AppStock tMiStock3);
|
||||||
|
|
|
||||||
|
|
@ -98,12 +98,6 @@ public class AppStockServiceImpl implements IAppStockService
|
||||||
public int updateNewLocation(String oldLocation, String newLocation) {
|
public int updateNewLocation(String oldLocation, String newLocation) {
|
||||||
return appStockMapper.updateNewLocation(oldLocation,newLocation);
|
return appStockMapper.updateNewLocation(oldLocation,newLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int updateLocationWithVehicleId(String vehicleId, String location) {
|
|
||||||
return appStockMapper.updateLocationWithVehicleId(vehicleId,location);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AppStock> selectStockByGoodsId(AppStock appStock) {
|
public List<AppStock> selectStockByGoodsId(AppStock appStock) {
|
||||||
return appStockMapper.selectStockByGoodsId(appStock);
|
return appStockMapper.selectStockByGoodsId(appStock);
|
||||||
|
|
|
||||||
|
|
@ -169,9 +169,6 @@
|
||||||
<update id="updateNewLocation">
|
<update id="updateNewLocation">
|
||||||
update app_stock set location_id = #{newLocation} where location_id = #{oldLocation}
|
update app_stock set location_id = #{newLocation} where location_id = #{oldLocation}
|
||||||
</update>
|
</update>
|
||||||
<update id="updateLocationWithVehicleId">
|
|
||||||
update app_stock set location_id = #{location} where vehicle_id = #{vehicleId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="deleteAppStockByStockId" parameterType="String">
|
<delete id="deleteAppStockByStockId" parameterType="String">
|
||||||
delete from app_stock where stock_id = #{stockId}
|
delete from app_stock where stock_id = #{stockId}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user