禅道#1185问题修复

This commit is contained in:
gaoqr
2025-02-17 09:38:27 +08:00
parent 2e34c68a90
commit 23959e48a1
6 changed files with 13 additions and 16 deletions
@@ -98,12 +98,12 @@ public class BodyNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRuleS
OrderCustomPlateNoSeqVO orderCustomPlateNoSeqVO = JSON.parseObject(orderDO.getCustomPlatenoSeq(), OrderCustomPlateNoSeqVO.class);
if (ObjectUtil.isNotNull(orderCustomPlateNoSeqVO)) {
if (ObjectUtil.equal(ResetModeEnum.ORDER, resetModeEnum)) {
orderCustomPlateNoSeqVO.setBodyNoSeq(ruleDTO.getInitValue());
orderCustomPlateNoSeqVO.setBodyNoSeq(null);
} else if (ObjectUtil.equal(ResetModeEnum.ROOM, resetModeEnum)) {
List<OrderCustomPlateNoSeqRoomVO> rooms = orderCustomPlateNoSeqVO.getRooms();
if (CollUtil.isNotEmpty(rooms)) {
for (OrderCustomPlateNoSeqRoomVO roomVO : rooms) {
roomVO.setBodyNoSeq(ruleDTO.getInitValue());
roomVO.setBodyNoSeq(null);
}
}
}
@@ -105,7 +105,7 @@ public class OrderNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRule
for (OrderDO orderDO : orderDOS) {
OrderCustomPlateNoSeqVO orderCustomPlateNoSeqVO = JSON.parseObject(orderDO.getCustomPlatenoSeq(), OrderCustomPlateNoSeqVO.class);
if (ObjectUtil.isNotNull(orderCustomPlateNoSeqVO)) {
orderCustomPlateNoSeqVO.setOrderNoSeq(ruleDTO.getInitValue());
orderCustomPlateNoSeqVO.setOrderNoSeq(null);
orderMapper.update(new LambdaUpdateWrapper<OrderDO>().eq(OrderDO::getId, orderDO.getId()).set(OrderDO::getCustomPlatenoSeq, JsonUtils.zipString(JSON.toJSONString(orderCustomPlateNoSeqVO))));
}
}
@@ -93,18 +93,17 @@ public class PlateNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRule
List<OrderDO> orderDOS = orderMapper.selectList(
new LambdaQueryWrapper<OrderDO>().eq(OrderDO::getCustomPlatenoConfigId, configId).eq(OrderDO::getOrganId, OrganContextHolder.getOrganId()));
Integer initValue = ruleDTO.getInitValue();
ResetModeEnum resetModeEnum = ResetModeEnum.getByMode(ruleDTO.getResetMode());
// 根据复位模式更新生产单的序号
for (OrderDO orderDO : orderDOS) {
OrderCustomPlateNoSeqVO orderCustomPlateNoSeqVO = JSON.parseObject(orderDO.getCustomPlatenoSeq(), OrderCustomPlateNoSeqVO.class);
if (ObjectUtil.isNotNull(orderCustomPlateNoSeqVO)) {
if (ObjectUtil.equal(ResetModeEnum.ORDER, resetModeEnum)) {
orderCustomPlateNoSeqVO.setPlateNoSeq(initValue);
orderCustomPlateNoSeqVO.setPlateNoSeq(null);
} else if (ObjectUtil.equal(ResetModeEnum.ROOM, resetModeEnum)) {
resetRoomPlateSeq(orderCustomPlateNoSeqVO.getRooms(), initValue);
resetRoomPlateSeq(orderCustomPlateNoSeqVO.getRooms());
} else if (ObjectUtil.equal(ResetModeEnum.BODY, resetModeEnum)) {
resetBodyPlateSeq(orderCustomPlateNoSeqVO.getRooms(), initValue);
resetBodyPlateSeq(orderCustomPlateNoSeqVO.getRooms());
}
orderMapper.update(new LambdaUpdateWrapper<OrderDO>().eq(OrderDO::getId, orderDO.getId()).set(OrderDO::getCustomPlatenoSeq, JsonUtils.zipString(JSON.toJSONString(orderCustomPlateNoSeqVO))));
}
@@ -115,12 +114,11 @@ public class PlateNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRule
* 复位生产单下房间中的板件序号
*
* @param rooms
* @param initValue
*/
private void resetRoomPlateSeq(List<OrderCustomPlateNoSeqRoomVO> rooms, Integer initValue) {
private void resetRoomPlateSeq(List<OrderCustomPlateNoSeqRoomVO> rooms) {
if (CollUtil.isNotEmpty(rooms)) {
for (OrderCustomPlateNoSeqRoomVO roomVO : rooms) {
roomVO.setPlateNoSeq(initValue);
roomVO.setPlateNoSeq(null);
}
}
}
@@ -129,15 +127,14 @@ public class PlateNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRule
* 复位生产单下柜体中的板件序号
*
* @param rooms
* @param initValue
*/
private void resetBodyPlateSeq(List<OrderCustomPlateNoSeqRoomVO> rooms, Integer initValue) {
private void resetBodyPlateSeq(List<OrderCustomPlateNoSeqRoomVO> rooms) {
if (CollUtil.isNotEmpty(rooms)) {
for (OrderCustomPlateNoSeqRoomVO roomVO : rooms) {
List<OrderCustomPlateNoSeqBodyVO> bodys = roomVO.getBodys();
if (CollUtil.isNotEmpty(bodys)) {
for (OrderCustomPlateNoSeqBodyVO bodyVO : bodys) {
bodyVO.setPlateNoSeq(initValue);
bodyVO.setPlateNoSeq(null);
}
}
}
@@ -123,7 +123,7 @@ public class RoomNoGenerateRuleServiceImpl implements CustomPlateNoGenerateRuleS
for (OrderDO orderDO : orderDOS) {
OrderCustomPlateNoSeqVO orderCustomPlateNoSeqVO = JSON.parseObject(orderDO.getCustomPlatenoSeq(), OrderCustomPlateNoSeqVO.class);
if (ObjectUtil.isNotNull(orderCustomPlateNoSeqVO)) {
orderCustomPlateNoSeqVO.setRoomNoSeq(ruleDTO.getInitValue());
orderCustomPlateNoSeqVO.setRoomNoSeq(null);
orderMapper.update(new LambdaUpdateWrapper<OrderDO>().eq(OrderDO::getId, orderDO.getId()).set(OrderDO::getCustomPlatenoSeq, JsonUtils.zipString(JSON.toJSONString(orderCustomPlateNoSeqVO))));
}
}
@@ -37,7 +37,7 @@ public class OrderNoRuleResetServiceHandler extends AbstractCustomPlateNoResetSe
// 更新机构下全局序号中的生产单前序值
LambdaUpdateWrapper<CustomPlateNoSeqDO> seqLambdaUpdateWrapper = new LambdaUpdateWrapper<CustomPlateNoSeqDO>()
.eq(CustomPlateNoSeqDO::getOrganId, OrganContextHolder.getOrganId())
.set(CustomPlateNoSeqDO::getOrderNoSeq, ruleDTO.getInitValue());
.set(CustomPlateNoSeqDO::getOrderNoSeq, null);
customPlateNoSeqMapper.update(seqLambdaUpdateWrapper);
// 更新使用该配置的生产单中的orderNoSeq
@@ -42,7 +42,7 @@ public class PlateNoRuleResetServiceHandler extends AbstractCustomPlateNoResetSe
// 更新机构下全局序号中的板件序号前序值
LambdaUpdateWrapper<CustomPlateNoSeqDO> seqLambdaUpdateWrapper = new LambdaUpdateWrapper<CustomPlateNoSeqDO>()
.eq(CustomPlateNoSeqDO::getOrganId, OrganContextHolder.getOrganId())
.set(CustomPlateNoSeqDO::getPlateNoSeq, ruleDTO.getInitValue());
.set(CustomPlateNoSeqDO::getPlateNoSeq, null);
customPlateNoSeqMapper.update(seqLambdaUpdateWrapper);
}