mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
优化结果保存mycat不支持update limit暂时修复
This commit is contained in:
+6
-55
@@ -1787,22 +1787,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
* @param orderIds
|
* @param orderIds
|
||||||
*/
|
*/
|
||||||
private void resetPlanPlateOptimizeStatus(Long planId, List<Long> orderIds) {
|
private void resetPlanPlateOptimizeStatus(Long planId, List<Long> orderIds) {
|
||||||
int updatedCount;
|
plateMapper.resetPlanPlateOptimizeStatus(planId, orderIds);
|
||||||
do {
|
|
||||||
// 执行批量更新,每次最多更新1000条
|
|
||||||
updatedCount = plateMapper.resetPlanPlateOptimizeStatus(planId, orderIds);
|
|
||||||
|
|
||||||
// 如果本次有更新,则继续下一轮
|
|
||||||
if (updatedCount > 0) {
|
|
||||||
try {
|
|
||||||
// 100毫秒延迟
|
|
||||||
Thread.sleep(100);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
throw new RuntimeException("轮询更新被中断", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while (updatedCount > 0); // 当返回0时表示没有更多记录需要更新
|
|
||||||
|
|
||||||
// 重置排单的已优化数量
|
// 重置排单的已优化数量
|
||||||
planMapper.update(new LambdaUpdateWrapper<PlanDO>()
|
planMapper.update(new LambdaUpdateWrapper<PlanDO>()
|
||||||
@@ -1839,30 +1824,13 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
int boardCount = layoutResultSummary.stream().mapToInt(BoardLayoutResultSummary::getBoardCount).sum();
|
int boardCount = layoutResultSummary.stream().mapToInt(BoardLayoutResultSummary::getBoardCount).sum();
|
||||||
|
|
||||||
// 更新参与优化的板材的优化状态
|
// 更新参与优化的板材的优化状态
|
||||||
int updatedCount;
|
int updatedCount = plateMapper.updatePlanPlateOptimizeStatus(planId, orderIds, optimizatePlateNoList);;
|
||||||
int optimizedCount = 0;
|
|
||||||
do {
|
|
||||||
// 执行批量更新,每次最多更新1000条
|
|
||||||
updatedCount = plateMapper.updatePlanPlateOptimizeStatus(planId, orderIds, optimizatePlateNoList);
|
|
||||||
optimizedCount += updatedCount;
|
|
||||||
|
|
||||||
// 如果本次有更新,则继续下一轮
|
if (updatedCount > 0) {
|
||||||
if (updatedCount > 0) {
|
|
||||||
try {
|
|
||||||
// 100毫秒延迟
|
|
||||||
Thread.sleep(100);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
throw new RuntimeException("轮询更新被中断", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while (updatedCount > 0); // 当返回0时表示没有更多记录需要更新
|
|
||||||
|
|
||||||
if (optimizedCount > 0) {
|
|
||||||
planMapper.update(new LambdaUpdateWrapper<PlanDO>()
|
planMapper.update(new LambdaUpdateWrapper<PlanDO>()
|
||||||
.eq(PlanDO::getId, planId)
|
.eq(PlanDO::getId, planId)
|
||||||
.eq(PlanDO::getDeleted, DeletedCodeEnum.NOT_DELETED.getStatus())
|
.eq(PlanDO::getDeleted, DeletedCodeEnum.NOT_DELETED.getStatus())
|
||||||
.set(PlanDO::getOptimizedPlateNum, optimizedCount)
|
.set(PlanDO::getOptimizedPlateNum, updatedCount)
|
||||||
.set(PlanDO::getScheduledBoardNum, boardCount)
|
.set(PlanDO::getScheduledBoardNum, boardCount)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1903,24 +1871,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
int endCutBoardCount = layoutResultSummary.stream().mapToInt(BoardLayoutResultSummary::getEndCutBoardCount).sum();
|
int endCutBoardCount = layoutResultSummary.stream().mapToInt(BoardLayoutResultSummary::getEndCutBoardCount).sum();
|
||||||
|
|
||||||
// 更新开料状态
|
// 更新开料状态
|
||||||
int updatedCount;
|
int updatedCount = plateMapper.updatePlanPlateCutStatus(planId, orderIds, optimizatePlateNoList);
|
||||||
int cuttedCount = 0;
|
|
||||||
do {
|
|
||||||
// 执行批量更新,每次最多更新1000条
|
|
||||||
updatedCount = plateMapper.updatePlanPlateCutStatus(planId, orderIds, optimizatePlateNoList);
|
|
||||||
cuttedCount += updatedCount;
|
|
||||||
|
|
||||||
// 如果本次有更新,则继续下一轮
|
|
||||||
if (updatedCount > 0) {
|
|
||||||
try {
|
|
||||||
// 100毫秒延迟
|
|
||||||
Thread.sleep(100);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
throw new RuntimeException("轮询更新被中断", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while (updatedCount > 0); // 当返回0时表示没有更多记录需要更新
|
|
||||||
|
|
||||||
// 查询已全部开料的订单号
|
// 查询已全部开料的订单号
|
||||||
List<Long> allCuttedOrderIdList = plateMapper.selectPlanAllCuttedOrderIdList(planId);
|
List<Long> allCuttedOrderIdList = plateMapper.selectPlanAllCuttedOrderIdList(planId);
|
||||||
@@ -1946,7 +1897,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
.set(PlanDO::getStatus, PlanStatusEnum.OPENED.getStatus())
|
.set(PlanDO::getStatus, PlanStatusEnum.OPENED.getStatus())
|
||||||
.set(PlanDO::getProduceTime, LocalDateTime.now())
|
.set(PlanDO::getProduceTime, LocalDateTime.now())
|
||||||
.set(PlanDO::getCuttedBoardNum, endCutBoardCount)
|
.set(PlanDO::getCuttedBoardNum, endCutBoardCount)
|
||||||
.set(PlanDO::getCuttedPlateNum, cuttedCount)
|
.set(PlanDO::getCuttedPlateNum, updatedCount)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-6
@@ -1491,8 +1491,6 @@
|
|||||||
<foreach collection="plateNos" item="plateNo" open="(" close=")" separator=",">
|
<foreach collection="plateNos" item="plateNo" open="(" close=")" separator=",">
|
||||||
#{plateNo}
|
#{plateNo}
|
||||||
</foreach>
|
</foreach>
|
||||||
ORDER BY op.id
|
|
||||||
LIMIT 1000;
|
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updatePlanPlateCutStatus">
|
<update id="updatePlanPlateCutStatus">
|
||||||
@@ -1509,8 +1507,6 @@
|
|||||||
<foreach collection="plateNos" item="plateNo" open="(" close=")" separator=",">
|
<foreach collection="plateNos" item="plateNo" open="(" close=")" separator=",">
|
||||||
#{plateNo}
|
#{plateNo}
|
||||||
</foreach>
|
</foreach>
|
||||||
ORDER BY op.id
|
|
||||||
LIMIT 1000;
|
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="resetPlanPlateOptimizeStatus">
|
<update id="resetPlanPlateOptimizeStatus">
|
||||||
@@ -1523,8 +1519,6 @@
|
|||||||
#{orderId}
|
#{orderId}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND op.plan_id = #{planId}
|
AND op.plan_id = #{planId}
|
||||||
ORDER BY op.id
|
|
||||||
LIMIT 1000;
|
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectPlanAllCuttedOrderIdList" resultType="java.lang.Long">
|
<select id="selectPlanAllCuttedOrderIdList" resultType="java.lang.Long">
|
||||||
|
|||||||
Reference in New Issue
Block a user