forked from BaoKaiWms/202501-Wms-Kate-Wuxi
Merge branch 'master' of http://112.4.208.194:3000/BaoKaiWms/202501-Wms-Kate-Wuxi
This commit is contained in:
commit
34ffc5f065
|
|
@ -204,12 +204,10 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
|||
tAppProductService.remove(new LambdaQueryWrapper<TAppProduct>().in(TAppProduct::getProductId, productMap.keySet()));
|
||||
// 保存新数据
|
||||
tAppProductService.saveBatch(productList);
|
||||
// 处理旧图纸
|
||||
Map<String, List<TAppImage>> imageMap = imageList.stream().collect(Collectors.groupingBy(TAppImage::getProductId));
|
||||
// 移除旧图纸
|
||||
tAppImageService.remove(new LambdaQueryWrapper<TAppImage>().in(TAppImage::getProductId, imageMap.keySet()));
|
||||
// 合并图纸id
|
||||
updateImageIds(thisProductId, imageList);
|
||||
// 保存新图纸
|
||||
tAppImageService.saveBatch(imageList);
|
||||
tAppImageService.saveOrUpdateBatch(imageList);
|
||||
// 保存导入file记录
|
||||
saveFileVo(fileVo);
|
||||
return BaseWmsApiResponse.success("导入配料单成功。");
|
||||
|
|
@ -285,12 +283,10 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
|||
tAppSingleProductService.remove(new LambdaQueryWrapper<TAppSingleProduct>().in(TAppSingleProduct::getProductId, productMap.keySet()));
|
||||
// 保存新数据
|
||||
tAppSingleProductService.saveBatch(productList);
|
||||
// 处理旧图纸
|
||||
Map<String, List<TAppImage>> imageMap = imageList.stream().collect(Collectors.groupingBy(TAppImage::getProductId));
|
||||
// 移除旧图纸
|
||||
tAppImageService.remove(new LambdaQueryWrapper<TAppImage>().in(TAppImage::getProductId, imageMap.keySet()));
|
||||
// 合并图纸id
|
||||
updateImageIds(thisProductId, imageList);
|
||||
// 保存新图纸
|
||||
tAppImageService.saveBatch(imageList);
|
||||
tAppImageService.saveOrUpdateBatch(imageList);
|
||||
// 保存导入file记录
|
||||
saveFileVo(fileVo);
|
||||
return BaseWmsApiResponse.success("导入服务件配料单成功。");
|
||||
|
|
@ -301,6 +297,30 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新图纸id
|
||||
* @param productId 成品号
|
||||
* @param imageList 新的图纸列表
|
||||
*/
|
||||
private void updateImageIds(String productId, List<TAppImage> imageList) {
|
||||
if (StringUtils.isEmpty(productId) || imageList == null || imageList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
// 获取到数据库中当前成品的图纸列表
|
||||
List<TAppImage> oldImageList = tAppImageService.list(new LambdaQueryWrapper<TAppImage>().eq(TAppImage::getProductId, productId));
|
||||
if (oldImageList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
// 根据料盒号map一下
|
||||
Map<String, TAppImage> oldImageMap = oldImageList.stream().collect(Collectors.toMap(TAppImage::getBoxNo, image -> image));
|
||||
for (TAppImage image : imageList) {
|
||||
if (oldImageMap.containsKey(image.getBoxNo())) {
|
||||
// 使用原来的图纸id
|
||||
image.setImageId(oldImageMap.get(image.getBoxNo()).getImageId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入总成与单片对应关系
|
||||
*
|
||||
|
|
|
|||
|
|
@ -394,8 +394,13 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
}
|
||||
// 当前站台到达的拣选任务
|
||||
TAppPickTask thisPickTask = pickTaskList.getFirst();
|
||||
if (confirmWorkRequest.getOrderConfirm() != null) {
|
||||
// 更新工作信息
|
||||
updateWorkInfo(confirmWorkRequest);
|
||||
String updateWorkResult = updateWorkInfo(confirmWorkRequest);
|
||||
if (StringUtils.isNotEmpty(updateWorkResult)) {
|
||||
return BaseWmsApiResponse.error("更新工作信息失败:" + updateWorkResult + ",请重试。");
|
||||
}
|
||||
}
|
||||
// 更新库存信息
|
||||
stockDataService.updateStockInfo(confirmWorkRequest.getStockConfirm(), confirmWorkRequest.getStandId(), confirmWorkRequest.getUserName(), "配料拣选");
|
||||
// 查询库存获得当前载具中存储的库存列表
|
||||
|
|
@ -1246,25 +1251,27 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
*
|
||||
* @param confirmWorkRequest 工作确认信息
|
||||
*/
|
||||
private void updateWorkInfo(ConfirmWorkRequest confirmWorkRequest) {
|
||||
private String updateWorkInfo(ConfirmWorkRequest confirmWorkRequest) {
|
||||
// 判断请求是否为空
|
||||
if (confirmWorkRequest == null) {
|
||||
return;
|
||||
return "确认请求为空";
|
||||
}
|
||||
OrderConfirmEntity orderConfirm = confirmWorkRequest.getOrderConfirm();
|
||||
if (orderConfirm == null || StringUtils.isEmpty(orderConfirm.getWorkIndex())
|
||||
|| orderConfirm.getRealPickQty() == null) {
|
||||
return;
|
||||
return "工作确认请求信息不全";
|
||||
}
|
||||
// 查询对应的工作信息
|
||||
List<TAppWork> targetWorks = appWorkService.list(new LambdaQueryWrapper<TAppWork>()
|
||||
.eq(StringUtils.isNotEmpty(orderConfirm.getWorkIndex()), TAppWork::getWorkIndex, orderConfirm.getWorkIndex())
|
||||
);
|
||||
if (targetWorks == null || targetWorks.isEmpty()) {
|
||||
return;
|
||||
return "未查到对应工作信息";
|
||||
}
|
||||
TAppWork work = targetWorks.getFirst();
|
||||
if (work != null && orderConfirm.getRealPickQty() >= 0) {
|
||||
if (orderConfirm.getRealPickQty() < 0) {
|
||||
return "实际拣选数量不能为负整数";
|
||||
}
|
||||
work.setFinishNum(work.getFinishNum() + orderConfirm.getRealPickQty());
|
||||
if (work.getFinishNum() >= work.getNeedNum()) {
|
||||
work.setWorkStatus(2);
|
||||
|
|
@ -1274,7 +1281,6 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
work.setWorkUser(confirmWorkRequest.getUserName());
|
||||
// 更新
|
||||
appWorkService.updateById(work);
|
||||
}
|
||||
// 清除当前站台的正在工作信息
|
||||
appStandWorkService.update(new LambdaUpdateWrapper<TAppStandWork>()
|
||||
.set(TAppStandWork::getWorkIndex, "")
|
||||
|
|
@ -1291,6 +1297,7 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
// 清除拣选计划
|
||||
appPickPlanService.remove(new LambdaQueryWrapper<TAppPickPlan>()
|
||||
.eq(TAppPickPlan::getWorkIndex, confirmWorkRequest.getOrderConfirm().getWorkIndex()));
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -681,8 +681,13 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
}
|
||||
// 当前站台到达的拣选任务
|
||||
TAppPickTask thisPickTask = pickTaskList.getFirst();
|
||||
if (confirmTaskRequest.getTaskConfirm() != null) {
|
||||
// 更新工作信息
|
||||
updateTaskInfo(confirmTaskRequest);
|
||||
String updateTaskResult = updateTaskInfo(confirmTaskRequest);
|
||||
if (StringUtils.isNotEmpty(updateTaskResult)) {
|
||||
return BaseWmsApiResponse.error("更新任务信息失败:" + updateTaskResult + ",请重试。");
|
||||
}
|
||||
}
|
||||
// 更新库存信息
|
||||
stockDataService.updateStockInfo(confirmTaskRequest.getStockConfirm(), confirmTaskRequest.getStandId(), confirmTaskRequest.getUserName(), "出库拣选");
|
||||
// 查询库存获得当前载具中存储的库存列表
|
||||
|
|
@ -719,23 +724,23 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
* 更新出库单信息
|
||||
* @param confirmTaskRequest 确认信息
|
||||
*/
|
||||
private void updateTaskInfo(ConfirmTaskRequest confirmTaskRequest) {
|
||||
private String updateTaskInfo(ConfirmTaskRequest confirmTaskRequest) {
|
||||
if (confirmTaskRequest == null) {
|
||||
return;
|
||||
return "请求参数为空";
|
||||
}
|
||||
TaskConfirmEntity taskConfirm = confirmTaskRequest.getTaskConfirm();
|
||||
if (taskConfirm == null || StringUtils.isEmpty(taskConfirm.getTaskId())) {
|
||||
return;
|
||||
return "请求参数不全";
|
||||
}
|
||||
// 查询对应的任务
|
||||
TAppOuts outs = appOutsService.getOne(new LambdaQueryWrapper<TAppOuts>()
|
||||
.eq(TAppOuts::getTaskId, taskConfirm.getTaskId()));
|
||||
if (outs == null || taskConfirm.getRealPickQty() == null) {
|
||||
return;
|
||||
return "未查到对应的任务或者实际拣选数量未填写";
|
||||
}
|
||||
outs.setPickNum(outs.getPickNum() + taskConfirm.getRealPickQty());
|
||||
outs.setUserName(confirmTaskRequest.getUserName());
|
||||
if (Objects.equals(outs.getPickNum(), outs.getNeedNum())) {
|
||||
if (outs.getPickNum() >= outs.getNeedNum()) {
|
||||
// 生成记录
|
||||
TAppOutsRecord record = new TAppOutsRecord(
|
||||
outs.getTaskId(),
|
||||
|
|
@ -760,5 +765,6 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
// 清除拣选计划
|
||||
appPickPlanService.remove(new LambdaQueryWrapper<TAppPickPlan>()
|
||||
.eq(TAppPickPlan::getWorkIndex, confirmTaskRequest.getTaskConfirm().getTaskId()));
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,8 +92,14 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
solveEmerge(equipVehicleMap, appOuts, allStocks, pickTasks, newOutWmsTasks, newPickTasks, thisTimeOutVehicleIds, newPickPlans);
|
||||
}
|
||||
}
|
||||
// 保存出库单
|
||||
appOutsService.updateBatchById(appOutsList);
|
||||
// 保存出库单---只更新分配数量
|
||||
List<TAppOuts> onlyDistributeNumOuts = appOutsList.stream().map(outs -> {
|
||||
TAppOuts outCopy = new TAppOuts();
|
||||
outCopy.setTaskId(outs.getTaskId());
|
||||
outCopy.setDistributeNum(outs.getDistributeNum());
|
||||
return outCopy;
|
||||
}).toList();
|
||||
appOutsService.updateBatchById(onlyDistributeNumOuts);
|
||||
// 保存出库任务
|
||||
if (!newOutWmsTasks.isEmpty()) {
|
||||
appTaskService.saveBatch(newOutWmsTasks);
|
||||
|
|
@ -646,7 +652,14 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
}
|
||||
}
|
||||
// 更新工作状态
|
||||
appWorkService.updateBatchById(works);
|
||||
List<TAppWork> onlyDistributeNumWorks = works.stream().map(work -> {
|
||||
TAppWork workCopy = new TAppWork();
|
||||
workCopy.setWorkIndex(work.getWorkIndex());
|
||||
workCopy.setDistributeNum(work.getDistributeNum());
|
||||
workCopy.setWorkStatus(work.getWorkStatus());
|
||||
return workCopy;
|
||||
}).toList();
|
||||
appWorkService.updateBatchById(onlyDistributeNumWorks);
|
||||
}
|
||||
// 保存出库任务
|
||||
if (!newOutWmsTasks.isEmpty()) {
|
||||
|
|
@ -747,7 +760,9 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
return result && stock.getGoodsId().equals(work.getGoodsId());
|
||||
}).toList();
|
||||
if (outStocks.isEmpty()) {
|
||||
if (work.getWorkStatus() == 2) {
|
||||
work.setWorkStatus(1);
|
||||
}
|
||||
work.setDistributeNum(work.getFinishNum());
|
||||
ifAllFinished = false;
|
||||
continue;
|
||||
|
|
@ -757,7 +772,9 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
List<TAppPickTask> pickTasks = allPickTasks.stream().filter(pickTask ->
|
||||
vehicleIds.contains(pickTask.getVehicleId()) && Objects.equals(pickTask.getPickStand(), work.getWorkStand())).toList();
|
||||
if (pickTasks.isEmpty()) {
|
||||
if (work.getWorkStatus() == 2) {
|
||||
work.setWorkStatus(1);
|
||||
}
|
||||
work.setDistributeNum(work.getFinishNum());
|
||||
ifAllFinished = false;
|
||||
continue;
|
||||
|
|
@ -785,7 +802,20 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
|||
.eq(TAppDbs::getWorkOrder, workOrder));
|
||||
} else {
|
||||
// 更新工作
|
||||
appWorkService.updateBatchById(works);
|
||||
List<TAppWork> updateWorks = works.stream().map(work -> {
|
||||
TAppWork updateWork = new TAppWork();
|
||||
updateWork.setWorkIndex(work.getWorkIndex());
|
||||
updateWork.setWorkStatus(work.getWorkStatus());
|
||||
updateWork.setLackStatus(work.getLackStatus());
|
||||
if (work.getWorkStatus() == 1) {
|
||||
updateWork.setDistributeNum(work.getDistributeNum());
|
||||
}
|
||||
if (work.getFinishTime() != null) {
|
||||
updateWork.setFinishTime(work.getFinishTime());
|
||||
}
|
||||
return updateWork;
|
||||
}).toList();
|
||||
appWorkService.updateBatchById(updateWorks);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ spring:
|
|||
# username: developer
|
||||
# password: developer
|
||||
# 本地
|
||||
url: jdbc:mysql://localhost:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: liangzhou
|
||||
# url: jdbc:mysql://localhost:3306/wms_kate_wuxi_test?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
# username: root
|
||||
# password: liangzhou
|
||||
# 卡特服务器
|
||||
# url: jdbc:mysql://10.90.83.37:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
# username: developer
|
||||
# password: baokai
|
||||
url: jdbc:mysql://10.90.83.37:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
username: developer
|
||||
password: baokai
|
||||
|
||||
profiles:
|
||||
active: online
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user