1. 修复完成工作发生的主键冲突

This commit is contained in:
梁州 2025-11-26 07:58:06 +08:00
parent 55dc9f1685
commit 0c82ebffc3

View File

@ -782,9 +782,6 @@ public class WorkServiceImplements implements IWorkService {
if (workFlowList.isEmpty()) {
return "没有已完成的工作流可以确认";
}
// 保存防止标签未打印
workFlowLastService.remove(new LambdaQueryWrapper<WorkFlowLast>().eq(WorkFlowLast::getWorkStation, workStation));
workFlowLastService.saveBatch(BeanUtil.copyToList(workFlowList, WorkFlowLast.class));
// workSummary列表
List<WorkSummary> workSummaryList = new ArrayList<>();
List<KateOrders> needUpdateKateOrdersList = new ArrayList<>();
@ -852,11 +849,15 @@ public class WorkServiceImplements implements IWorkService {
}
boolean doTransResult = dbTransUtils.useTran(() -> {
// 保存防止标签未打印
workFlowLastService.remove(new LambdaQueryWrapper<WorkFlowLast>().eq(WorkFlowLast::getWorkStation, workStation));
workFlowLastService.saveOrUpdateBatch(BeanUtil.copyToList(workFlowList, WorkFlowLast.class));
// 保存总结
workSummaryService.saveOrUpdateBatch(workSummaryList);
// 先清空之前的
eLocationConfigLastService.remove(new LambdaQueryWrapper<ELocationConfigLast>()
.eq(ELocationConfigLast::getWorkStation, workStation));
eLocationConfigLastService.saveBatch(eLocationConfigLastList);
eLocationConfigLastService.saveOrUpdateBatch(eLocationConfigLastList);
// 删除所有的标签配置
eLocationConfigService.remove(new LambdaQueryWrapper<ELocationConfig>()
.eq(ELocationConfig::getWorkStation, workStation));