Commit ccc3d1e45084d0c3204c22fbb3eb382fe8922d3e
1 parent
478bf399
✨ feat(mes): 移除冗余的班组类型枚举引用及相关注释
Showing
5 changed files
with
3 additions
and
51 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/plan/MesCalPlanDO.java
| 1 | 1 | package cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | -import cn.iocoder.yudao.module.mes.enums.cal.MesCalCalendarTypeEnum; | |
| 5 | 4 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalPlanStatusEnum; |
| 6 | 5 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalShiftMethodEnum; |
| 7 | 6 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalShiftTypeEnum; |
| ... | ... | @@ -42,8 +41,6 @@ public class MesCalPlanDO extends BaseDO { |
| 42 | 41 | private String name; |
| 43 | 42 | /** |
| 44 | 43 | * 班组类型 |
| 45 | - * | |
| 46 | - * 枚举 {@link MesCalCalendarTypeEnum} | |
| 47 | 44 | */ |
| 48 | 45 | private Integer calendarType; |
| 49 | 46 | /** | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/team/MesCalTeamDO.java
| 1 | 1 | package cn.iocoder.yudao.module.mes.dal.dataobject.cal.team; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | -import cn.iocoder.yudao.module.mes.enums.cal.MesCalCalendarTypeEnum; | |
| 5 | 4 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 6 | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
| 7 | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| ... | ... | @@ -37,8 +36,6 @@ public class MesCalTeamDO extends BaseDO { |
| 37 | 36 | private String name; |
| 38 | 37 | /** |
| 39 | 38 | * 班组类型 |
| 40 | - * | |
| 41 | - * 枚举 {@link MesCalCalendarTypeEnum} | |
| 42 | 39 | */ |
| 43 | 40 | private Integer calendarType; |
| 44 | 41 | /** | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/cal/team/MesCalTeamShiftMapper.java
| ... | ... | @@ -6,7 +6,6 @@ import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.shift.MesCalTeam |
| 6 | 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.cal.team.MesCalTeamShiftDO; |
| 7 | 7 | import org.apache.ibatis.annotations.Mapper; |
| 8 | 8 | |
| 9 | -import java.time.LocalDateTime; | |
| 10 | 9 | import java.util.List; |
| 11 | 10 | |
| 12 | 11 | /** |
| ... | ... | @@ -27,10 +26,8 @@ public interface MesCalTeamShiftMapper extends BaseMapperX<MesCalTeamShiftDO> { |
| 27 | 26 | .orderByAsc(MesCalTeamShiftDO::getSort)); |
| 28 | 27 | } |
| 29 | 28 | |
| 30 | - default MesCalTeamShiftDO selectByDayAndTeamId(LocalDateTime day, Long teamId) { | |
| 31 | - return selectOne(new LambdaQueryWrapperX<MesCalTeamShiftDO>() | |
| 32 | - .eq(MesCalTeamShiftDO::getDay, day) | |
| 33 | - .eq(MesCalTeamShiftDO::getTeamId, teamId)); | |
| 29 | + default List<MesCalTeamShiftDO> selectListByPlanId(Long planId) { | |
| 30 | + return selectList(MesCalTeamShiftDO::getPlanId, planId); | |
| 34 | 31 | } |
| 35 | 32 | |
| 36 | 33 | default void deleteByPlanId(Long planId) { | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/cal/MesCalCalendarTypeEnum.java deleted
| 1 | -package cn.iocoder.yudao.module.mes.enums.cal; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.framework.common.core.ArrayValuable; | |
| 4 | -import lombok.AllArgsConstructor; | |
| 5 | -import lombok.Getter; | |
| 6 | - | |
| 7 | -import java.util.Arrays; | |
| 8 | - | |
| 9 | -/** | |
| 10 | - * MES 班组类型(日历类型)枚举 | |
| 11 | - * | |
| 12 | - * @author 芋道源码 | |
| 13 | - */ | |
| 14 | -@Getter | |
| 15 | -@AllArgsConstructor | |
| 16 | -public enum MesCalCalendarTypeEnum implements ArrayValuable<Integer> { | |
| 17 | - | |
| 18 | - GROUP_ROTATION(1, "分组轮班"), | |
| 19 | - FIXED_TEAM(2, "固定班组"); | |
| 20 | - | |
| 21 | - public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesCalCalendarTypeEnum::getType).toArray(Integer[]::new); | |
| 22 | - | |
| 23 | - /** | |
| 24 | - * 类型值 | |
| 25 | - */ | |
| 26 | - private final Integer type; | |
| 27 | - /** | |
| 28 | - * 类型名 | |
| 29 | - */ | |
| 30 | - private final String name; | |
| 31 | - | |
| 32 | - @Override | |
| 33 | - public Integer[] array() { | |
| 34 | - return ARRAYS; | |
| 35 | - } | |
| 36 | - | |
| 37 | -} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/cal/team/MesCalTeamShiftServiceImpl.java
| ... | ... | @@ -83,9 +83,7 @@ public class MesCalTeamShiftServiceImpl implements MesCalTeamShiftService { |
| 83 | 83 | buildRecordsForDay(allRecords, planId, currentDay, shiftIndex, plan.getShiftType(), teams, shifts); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - // 3. 先删除该计划的旧排班记录,再批量插入新记录 | |
| 87 | - // TODO @AI:能不能过有个 diff 的做法,insert、update、delete 这样? | |
| 88 | - teamShiftMapper.deleteByPlanId(planId); | |
| 86 | + // 3. 批量插入排班记录 | |
| 89 | 87 | teamShiftMapper.insertBatch(allRecords); |
| 90 | 88 | } |
| 91 | 89 | ... | ... |