|
@@ -592,13 +592,32 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Result<String> edit(@RequestBody StorageBill storageBill) {
|
|
|
StorageBill old = storageBillService.getById(storageBill.getId());
|
|
|
- // 新增判断逻辑:除车位号为 2 外,禁止修改 ccmNo
|
|
|
+ int originalAmountTotal = old.getAmountTotal();
|
|
|
+
|
|
|
+ // 若 positionNum 为 2,则从 Redis 获取班次、班组信息并赋值
|
|
|
+ if (storageBill.getPositionNum() != null && storageBill.getPositionNum() == 2) {
|
|
|
+ String ccmNo = storageBill.getCcmNo();
|
|
|
+ String classShift = String.format("class:shift:%s", ccmNo);
|
|
|
+ String classShiftGroup = String.format("class:shift:group:%s", ccmNo);
|
|
|
+
|
|
|
+ String shift = oConvertUtils.getString(redisTemplate.opsForValue().get(classShift));
|
|
|
+ String shiftGroup = oConvertUtils.getString(redisTemplate.opsForValue().get(classShiftGroup));
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(shift)) {
|
|
|
+ storageBill.setShift(shift);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(shiftGroup)) {
|
|
|
+ storageBill.setShiftGroup(shiftGroup);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 若 positionNum != 2 且 ccmNo 修改了,报错
|
|
|
if (storageBill.getPositionNum() != null
|
|
|
&& storageBill.getPositionNum() != 2
|
|
|
&& !Objects.equals(storageBill.getCcmNo(), old.getCcmNo())) {
|
|
|
return Result.error("当前车位号不是 2,不能修改铸机号!");
|
|
|
}
|
|
|
- int originalAmountTotal = old.getAmountTotal();
|
|
|
+
|
|
|
if("1024".equals(old.getTypeConfigId()) && oConvertUtils.isNotEmpty(storageBill.getDestination())){
|
|
|
try {
|
|
|
// 合并更新字段
|