#
luxiaotao1123
2024-09-23 19c74dc7fc321baa85ab9fc7c9bb1244dcc2005a
#
2个文件已修改
45 ■■■■ 已修改文件
zy-acs-flow/src/page/bus/BusCreate.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/BusServiceImpl.java 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/bus/BusCreate.jsx
@@ -131,12 +131,12 @@
                                            validate={required()}
                                        />
                                    </Grid>
                                    <Grid item xs={6} display="flex" gap={1}>
                                    {/* <Grid item xs={6} display="flex" gap={1}>
                                        <DateTimeInput
                                            label="table.field.bus.startTime"
                                            source="startTime"
                                        />
                                    </Grid>
                                    </Grid> */}
                                    <Grid item xs={12} display="flex" gap={1}>
                                        <ArrayInput
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/BusServiceImpl.java
@@ -16,7 +16,9 @@
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Slf4j
@Service("busService")
@@ -38,27 +40,52 @@
        if (Cools.isEmpty(param.getBatch())) {
            return "Batch cannot be empty!";
        }
        Set<String> oriStaNoSet = new HashSet<>();
        Set<String> oriLocNoSet = new HashSet<>();
        Set<String> destStaNoSet = new HashSet<>();
        Set<String> destLocNoSet = new HashSet<>();
        for (TaskDto dto : param.getTaskList()) {
            if (!Cools.isEmpty(dto.getOriSta()) && !Cools.isEmpty(dto.getOriLoc())) {
                return "OriSta and OriLoc cannot exist at the same time!";
            }
            if (!Cools.isEmpty(dto.getOriSta())) {
                if (!Cools.isEmpty(dto.getOriLoc())) {
                    return "OriSta and OriLoc cannot exist at the same time!";
                }
                if (Cools.isEmpty(dto.getDestSta()) && Cools.isEmpty(dto.getDestLoc())) {
                    return "Destination cannot be empty!";
                }
            }
            if (!Cools.isEmpty(dto.getDestSta())) {
                if (!Cools.isEmpty(dto.getDestLoc())) {
                    return "DestSta and DestLoc cannot exist at the same time!";
            if (!Cools.isEmpty(dto.getOriLoc())) {
                if (Cools.isEmpty(dto.getDestSta()) && Cools.isEmpty(dto.getDestLoc())) {
                    return "Destination cannot be empty!";
                }
                if (oriLocNoSet.contains(dto.getOriLoc())) {
                    return "OriLoc cannot be repeated";
                } else {
                    oriLocNoSet.add(dto.getOriLoc());
                }
            }
            if (!Cools.isEmpty(dto.getDestSta()) && !Cools.isEmpty(dto.getDestLoc())) {
                return "DestSta and DestLoc cannot exist at the same time!";
            }
            if (!Cools.isEmpty(dto.getDestSta())) {
                if (Cools.isEmpty(dto.getOriSta()) && Cools.isEmpty(dto.getOriLoc())) {
                    return "Origin cannot be empty!";
                }
            }
            if (!Cools.isEmpty(dto.getDestLoc())) {
                if (Cools.isEmpty(dto.getOriSta()) && Cools.isEmpty(dto.getOriLoc())) {
                    return "Origin cannot be empty!";
                }
                if (destLocNoSet.contains(dto.getDestLoc())) {
                    return "DestLoc cannot be repeated";
                } else {
                    destLocNoSet.add(dto.getDestLoc());
                }
            }
            if (Cools.isEmpty(dto.getSeqNum())) {
                dto.setSeqNum(taskService.generateSeqNum());
            }
        }
        return null;
    }