Pārlūkot izejas kodu

班次配置-添加增加铸机号判断

lingpeng.li 3 mēneši atpakaļ
vecāks
revīzija
7028c54226

+ 6 - 4
zgzt-sys-java/jeecg-module-conn/src/main/java/org/jeecg/modules/shiftConfiguration/controller/ShiftConfigurationController.java

@@ -92,8 +92,9 @@ public class ShiftConfigurationController extends JeecgController<ShiftConfigura
         // 参数校验
         if (shiftConfiguration.getDate() == null ||
                 StrUtil.isBlank(shiftConfiguration.getShift()) ||
-                StrUtil.isBlank(shiftConfiguration.getShiftGroup())) {
-            return Result.error("班次日期、班别、班组不能为空!");
+                StrUtil.isBlank(shiftConfiguration.getShiftGroup()) ||
+                StrUtil.isBlank(shiftConfiguration.getCcmNo())) {
+            return Result.error("班次日期、班别、班组、铸机号不能为空!");
         }
 
         Date shiftDate = shiftConfiguration.getDate();
@@ -116,11 +117,12 @@ public class ShiftConfigurationController extends JeecgController<ShiftConfigura
         LambdaQueryWrapper<ShiftConfiguration> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.between(ShiftConfiguration::getDate, start, end)
                 .eq(ShiftConfiguration::getShift, shift)
-                .eq(ShiftConfiguration::getShiftGroup, shiftGroup);
+                .eq(ShiftConfiguration::getShiftGroup, shiftGroup)
+                .eq(ShiftConfiguration::getCcmNo, shiftConfiguration.getCcmNo());
 
         boolean exists = shiftConfigurationService.count(queryWrapper) > 0;
         if (exists) {
-            return Result.error("该班别和班组在当天已存在,不能重复添加!");
+            return Result.error("该铸机号下的班别和班组在当天已存在,不能重复添加!");
         }
 
         shiftConfigurationService.save(shiftConfiguration);