Commit 6d90b8330a6a7760ca56e769a5d0295a02445056
1 parent
9d57d6c7
review(mes):cal-plan 的代码实现,功能测试
Showing
21 changed files
with
887 additions
and
6 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/plan/MesCalPlanTeamController.java
| 1 | 1 | package cn.iocoder.yudao.module.mes.controller.admin.cal.plan; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 3 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 4 | 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 5 | 7 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.team.MesCalPlanTeamRespVO; |
| 6 | 8 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.team.MesCalPlanTeamSaveReqVO; |
| 7 | 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanTeamDO; |
| 10 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.team.MesCalTeamDO; | |
| 8 | 11 | import cn.iocoder.yudao.module.mes.service.cal.plan.MesCalPlanTeamService; |
| 12 | +import cn.iocoder.yudao.module.mes.service.cal.team.MesCalTeamService; | |
| 9 | 13 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 14 | import io.swagger.v3.oas.annotations.Parameter; |
| 11 | 15 | import io.swagger.v3.oas.annotations.tags.Tag; |
| ... | ... | @@ -16,6 +20,7 @@ import org.springframework.validation.annotation.Validated; |
| 16 | 20 | import org.springframework.web.bind.annotation.*; |
| 17 | 21 | |
| 18 | 22 | import java.util.List; |
| 23 | +import java.util.Map; | |
| 19 | 24 | |
| 20 | 25 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | 26 | |
| ... | ... | @@ -27,6 +32,8 @@ public class MesCalPlanTeamController { |
| 27 | 32 | |
| 28 | 33 | @Resource |
| 29 | 34 | private MesCalPlanTeamService planTeamService; |
| 35 | + @Resource | |
| 36 | + private MesCalTeamService teamService; | |
| 30 | 37 | |
| 31 | 38 | @PostMapping("/create") |
| 32 | 39 | @Operation(summary = "创建计划班组关联") |
| ... | ... | @@ -50,8 +57,22 @@ public class MesCalPlanTeamController { |
| 50 | 57 | @PreAuthorize("@ss.hasPermission('mes:cal-plan:query')") |
| 51 | 58 | public CommonResult<List<MesCalPlanTeamRespVO>> getPlanTeamListByPlan(@RequestParam("planId") Long planId) { |
| 52 | 59 | List<MesCalPlanTeamDO> list = planTeamService.getPlanTeamListByPlanId(planId); |
| 53 | - // TODO @芋艿:拼装班组编码/名称,等 cal_team 迁移后对接 | |
| 54 | - return success(BeanUtils.toBean(list, MesCalPlanTeamRespVO.class)); | |
| 60 | + List<MesCalPlanTeamRespVO> respList = BeanUtils.toBean(list, MesCalPlanTeamRespVO.class); | |
| 61 | + // 拼装班组编码/名称 | |
| 62 | + if (CollUtil.isNotEmpty(respList)) { | |
| 63 | + // TODO @AI:teamService.getTeamMap(ids),里面调用 teamService.getTeamList(ids) | |
| 64 | + List<Long> teamIds = CollectionUtils.convertList(respList, MesCalPlanTeamRespVO::getTeamId); | |
| 65 | + Map<Long, MesCalTeamDO> teamMap = CollectionUtils.convertMap( | |
| 66 | + teamService.getTeamList(), MesCalTeamDO::getId); | |
| 67 | + respList.forEach(resp -> { | |
| 68 | + MesCalTeamDO team = teamMap.get(resp.getTeamId()); | |
| 69 | + if (team != null) { | |
| 70 | + resp.setTeamCode(team.getCode()); | |
| 71 | + resp.setTeamName(team.getName()); | |
| 72 | + } | |
| 73 | + }); | |
| 74 | + } | |
| 75 | + return success(respList); | |
| 55 | 76 | } |
| 56 | 77 | |
| 57 | 78 | } | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/plan/vo/team/MesCalPlanTeamRespVO.java
| ... | ... | @@ -18,11 +18,9 @@ public class MesCalPlanTeamRespVO { |
| 18 | 18 | @Schema(description = "班组编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 19 | 19 | private Long teamId; |
| 20 | 20 | |
| 21 | - // TODO @芋艿:等 cal_team 迁移后,通过 teamId 关联查询填充 | |
| 22 | 21 | @Schema(description = "班组编码", example = "T001") |
| 23 | 22 | private String teamCode; |
| 24 | 23 | |
| 25 | - // TODO @芋艿:等 cal_team 迁移后,通过 teamId 关联查询填充 | |
| 26 | 24 | @Schema(description = "班组名称", example = "A组") |
| 27 | 25 | private String teamName; |
| 28 | 26 | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/team/MesCalTeamController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.cal.team; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 6 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 7 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | |
| 8 | +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | |
| 9 | +import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.MesCalTeamPageReqVO; | |
| 10 | +import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.MesCalTeamRespVO; | |
| 11 | +import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.MesCalTeamSaveReqVO; | |
| 12 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.team.MesCalTeamDO; | |
| 13 | +import cn.iocoder.yudao.module.mes.service.cal.team.MesCalTeamService; | |
| 14 | +import io.swagger.v3.oas.annotations.Operation; | |
| 15 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 16 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 17 | +import jakarta.annotation.Resource; | |
| 18 | +import jakarta.servlet.http.HttpServletResponse; | |
| 19 | +import jakarta.validation.Valid; | |
| 20 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 21 | +import org.springframework.validation.annotation.Validated; | |
| 22 | +import org.springframework.web.bind.annotation.*; | |
| 23 | + | |
| 24 | +import java.io.IOException; | |
| 25 | +import java.util.List; | |
| 26 | + | |
| 27 | +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | |
| 28 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 29 | + | |
| 30 | +@Tag(name = "管理后台 - MES 班组") | |
| 31 | +@RestController | |
| 32 | +@RequestMapping("/mes/cal/team") | |
| 33 | +@Validated | |
| 34 | +public class MesCalTeamController { | |
| 35 | + | |
| 36 | + @Resource | |
| 37 | + private MesCalTeamService teamService; | |
| 38 | + | |
| 39 | + @PostMapping("/create") | |
| 40 | + @Operation(summary = "创建班组") | |
| 41 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:create')") | |
| 42 | + public CommonResult<Long> createTeam(@Valid @RequestBody MesCalTeamSaveReqVO createReqVO) { | |
| 43 | + return success(teamService.createTeam(createReqVO)); | |
| 44 | + } | |
| 45 | + | |
| 46 | + @PutMapping("/update") | |
| 47 | + @Operation(summary = "更新班组") | |
| 48 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:update')") | |
| 49 | + public CommonResult<Boolean> updateTeam(@Valid @RequestBody MesCalTeamSaveReqVO updateReqVO) { | |
| 50 | + teamService.updateTeam(updateReqVO); | |
| 51 | + return success(true); | |
| 52 | + } | |
| 53 | + | |
| 54 | + @DeleteMapping("/delete") | |
| 55 | + @Operation(summary = "删除班组") | |
| 56 | + @Parameter(name = "id", description = "编号", required = true) | |
| 57 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:delete')") | |
| 58 | + public CommonResult<Boolean> deleteTeam(@RequestParam("id") Long id) { | |
| 59 | + teamService.deleteTeam(id); | |
| 60 | + return success(true); | |
| 61 | + } | |
| 62 | + | |
| 63 | + @GetMapping("/get") | |
| 64 | + @Operation(summary = "获得班组") | |
| 65 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 66 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:query')") | |
| 67 | + public CommonResult<MesCalTeamRespVO> getTeam(@RequestParam("id") Long id) { | |
| 68 | + MesCalTeamDO team = teamService.getTeam(id); | |
| 69 | + return success(BeanUtils.toBean(team, MesCalTeamRespVO.class)); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @GetMapping("/page") | |
| 73 | + @Operation(summary = "获得班组分页") | |
| 74 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:query')") | |
| 75 | + public CommonResult<PageResult<MesCalTeamRespVO>> getTeamPage(@Valid MesCalTeamPageReqVO pageReqVO) { | |
| 76 | + PageResult<MesCalTeamDO> pageResult = teamService.getTeamPage(pageReqVO); | |
| 77 | + return success(BeanUtils.toBean(pageResult, MesCalTeamRespVO.class)); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @GetMapping("/list") | |
| 81 | + @Operation(summary = "获得班组列表") | |
| 82 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:query')") | |
| 83 | + public CommonResult<List<MesCalTeamRespVO>> getTeamList() { | |
| 84 | + List<MesCalTeamDO> list = teamService.getTeamList(); | |
| 85 | + return success(BeanUtils.toBean(list, MesCalTeamRespVO.class)); | |
| 86 | + } | |
| 87 | + | |
| 88 | + @GetMapping("/export-excel") | |
| 89 | + @Operation(summary = "导出班组 Excel") | |
| 90 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:export')") | |
| 91 | + @ApiAccessLog(operateType = EXPORT) | |
| 92 | + public void exportTeamExcel(@Valid MesCalTeamPageReqVO pageReqVO, | |
| 93 | + HttpServletResponse response) throws IOException { | |
| 94 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | |
| 95 | + List<MesCalTeamDO> list = teamService.getTeamPage(pageReqVO).getList(); | |
| 96 | + // 导出 Excel | |
| 97 | + ExcelUtils.write(response, "班组.xls", "数据", MesCalTeamRespVO.class, | |
| 98 | + BeanUtils.toBean(list, MesCalTeamRespVO.class)); | |
| 99 | + } | |
| 100 | + | |
| 101 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/team/MesCalTeamMemberController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.cal.team; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 5 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | |
| 6 | +import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.member.MesCalTeamMemberPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.member.MesCalTeamMemberRespVO; | |
| 8 | +import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.member.MesCalTeamMemberSaveReqVO; | |
| 9 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.team.MesCalTeamMemberDO; | |
| 10 | +import cn.iocoder.yudao.module.mes.service.cal.team.MesCalTeamMemberService; | |
| 11 | +import io.swagger.v3.oas.annotations.Operation; | |
| 12 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 13 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 14 | +import jakarta.annotation.Resource; | |
| 15 | +import jakarta.validation.Valid; | |
| 16 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 17 | +import org.springframework.validation.annotation.Validated; | |
| 18 | +import org.springframework.web.bind.annotation.*; | |
| 19 | + | |
| 20 | +import java.util.Collection; | |
| 21 | +import java.util.List; | |
| 22 | + | |
| 23 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 24 | + | |
| 25 | +@Tag(name = "管理后台 - MES 班组成员") | |
| 26 | +@RestController | |
| 27 | +@RequestMapping("/mes/cal/team-member") | |
| 28 | +@Validated | |
| 29 | +public class MesCalTeamMemberController { | |
| 30 | + | |
| 31 | + @Resource | |
| 32 | + private MesCalTeamMemberService teamMemberService; | |
| 33 | + | |
| 34 | + @PostMapping("/create") | |
| 35 | + @Operation(summary = "创建班组成员") | |
| 36 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:create')") | |
| 37 | + public CommonResult<Long> createTeamMember(@Valid @RequestBody MesCalTeamMemberSaveReqVO createReqVO) { | |
| 38 | + return success(teamMemberService.createTeamMember(createReqVO)); | |
| 39 | + } | |
| 40 | + | |
| 41 | + @DeleteMapping("/delete") | |
| 42 | + @Operation(summary = "删除班组成员") | |
| 43 | + @Parameter(name = "id", description = "编号", required = true) | |
| 44 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:delete')") | |
| 45 | + public CommonResult<Boolean> deleteTeamMember(@RequestParam("id") Long id) { | |
| 46 | + teamMemberService.deleteTeamMember(id); | |
| 47 | + return success(true); | |
| 48 | + } | |
| 49 | + | |
| 50 | + @GetMapping("/get") | |
| 51 | + @Operation(summary = "获得班组成员") | |
| 52 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 53 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:query')") | |
| 54 | + public CommonResult<MesCalTeamMemberRespVO> getTeamMember(@RequestParam("id") Long id) { | |
| 55 | + MesCalTeamMemberDO member = teamMemberService.getTeamMember(id); | |
| 56 | + return success(BeanUtils.toBean(member, MesCalTeamMemberRespVO.class)); | |
| 57 | + } | |
| 58 | + | |
| 59 | + @GetMapping("/page") | |
| 60 | + @Operation(summary = "获得班组成员分页") | |
| 61 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:query')") | |
| 62 | + public CommonResult<PageResult<MesCalTeamMemberRespVO>> getTeamMemberPage(@Valid MesCalTeamMemberPageReqVO pageReqVO) { | |
| 63 | + PageResult<MesCalTeamMemberDO> pageResult = teamMemberService.getTeamMemberPage(pageReqVO); | |
| 64 | + return success(BeanUtils.toBean(pageResult, MesCalTeamMemberRespVO.class)); | |
| 65 | + } | |
| 66 | + | |
| 67 | + // TODO @AI:getTeamMemberListByTeam、getTeamMemberListByTeamIds 融合下,允许传递 teamId、teamIds; | |
| 68 | + | |
| 69 | + @GetMapping("/list-by-team") | |
| 70 | + @Operation(summary = "获得指定班组的成员列表") | |
| 71 | + @Parameter(name = "teamId", description = "班组编号", required = true) | |
| 72 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:query')") | |
| 73 | + public CommonResult<List<MesCalTeamMemberRespVO>> getTeamMemberListByTeam(@RequestParam("teamId") Long teamId) { | |
| 74 | + List<MesCalTeamMemberDO> list = teamMemberService.getTeamMemberListByTeamId(teamId); | |
| 75 | + return success(BeanUtils.toBean(list, MesCalTeamMemberRespVO.class)); | |
| 76 | + } | |
| 77 | + | |
| 78 | + @GetMapping("/list-by-team-ids") | |
| 79 | + @Operation(summary = "获得指定多个班组的成员列表") | |
| 80 | + @Parameter(name = "teamIds", description = "班组编号列表", required = true) | |
| 81 | + @PreAuthorize("@ss.hasPermission('mes:cal-team:query')") | |
| 82 | + public CommonResult<List<MesCalTeamMemberRespVO>> getTeamMemberListByTeamIds( | |
| 83 | + @RequestParam("teamIds") Collection<Long> teamIds) { | |
| 84 | + List<MesCalTeamMemberDO> list = teamMemberService.getTeamMemberListByTeamIds(teamIds); | |
| 85 | + return success(BeanUtils.toBean(list, MesCalTeamMemberRespVO.class)); | |
| 86 | + } | |
| 87 | + | |
| 88 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/team/MesCalTeamShiftController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.cal.team; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 4 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | |
| 5 | +import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.shift.MesCalTeamShiftListReqVO; | |
| 6 | +import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.shift.MesCalTeamShiftRespVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.team.MesCalTeamShiftDO; | |
| 8 | +import cn.iocoder.yudao.module.mes.service.cal.team.MesCalTeamShiftService; | |
| 9 | +import io.swagger.v3.oas.annotations.Operation; | |
| 10 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 11 | +import jakarta.annotation.Resource; | |
| 12 | +import jakarta.validation.Valid; | |
| 13 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 14 | +import org.springframework.validation.annotation.Validated; | |
| 15 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 16 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 17 | +import org.springframework.web.bind.annotation.RestController; | |
| 18 | + | |
| 19 | +import java.util.List; | |
| 20 | + | |
| 21 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 22 | + | |
| 23 | +@Tag(name = "管理后台 - MES 班组排班") | |
| 24 | +@RestController | |
| 25 | +@RequestMapping("/mes/cal/team-shift") | |
| 26 | +@Validated | |
| 27 | +public class MesCalTeamShiftController { | |
| 28 | + | |
| 29 | + @Resource | |
| 30 | + private MesCalTeamShiftService teamShiftService; | |
| 31 | + | |
| 32 | + @GetMapping("/list") | |
| 33 | + @Operation(summary = "获得班组排班列表") | |
| 34 | + @PreAuthorize("@ss.hasPermission('mes:cal-team-shift:query')") | |
| 35 | + public CommonResult<List<MesCalTeamShiftRespVO>> getTeamShiftList(@Valid MesCalTeamShiftListReqVO reqVO) { | |
| 36 | + List<MesCalTeamShiftDO> list = teamShiftService.getTeamShiftList(reqVO); | |
| 37 | + return success(BeanUtils.toBean(list, MesCalTeamShiftRespVO.class)); | |
| 38 | + } | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/team/vo/MesCalTeamPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | +import lombok.ToString; | |
| 8 | + | |
| 9 | +@Schema(description = "管理后台 - MES 班组分页 Request VO") | |
| 10 | +@Data | |
| 11 | +@EqualsAndHashCode(callSuper = true) | |
| 12 | +@ToString(callSuper = true) | |
| 13 | +public class MesCalTeamPageReqVO extends PageParam { | |
| 14 | + | |
| 15 | + @Schema(description = "班组编码", example = "TEAM-A") | |
| 16 | + private String code; | |
| 17 | + | |
| 18 | + @Schema(description = "班组名称", example = "注塑") | |
| 19 | + private String name; | |
| 20 | + | |
| 21 | + @Schema(description = "班组类型", example = "1") | |
| 22 | + private Integer calendarType; | |
| 23 | + | |
| 24 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/team/vo/MesCalTeamRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo; | |
| 2 | + | |
| 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import lombok.Data; | |
| 7 | + | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | + | |
| 10 | +@Schema(description = "管理后台 - MES 班组 Response VO") | |
| 11 | +@Data | |
| 12 | +@ExcelIgnoreUnannotated | |
| 13 | +public class MesCalTeamRespVO { | |
| 14 | + | |
| 15 | + @Schema(description = "班组编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 16 | + @ExcelProperty("班组编号") | |
| 17 | + private Long id; | |
| 18 | + | |
| 19 | + @Schema(description = "班组编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "TEAM-A") | |
| 20 | + @ExcelProperty("班组编码") | |
| 21 | + private String code; | |
| 22 | + | |
| 23 | + @Schema(description = "班组名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "注塑A组") | |
| 24 | + @ExcelProperty("班组名称") | |
| 25 | + private String name; | |
| 26 | + | |
| 27 | + @Schema(description = "班组类型", example = "1") | |
| 28 | + @ExcelProperty("班组类型") | |
| 29 | + private Integer calendarType; | |
| 30 | + | |
| 31 | + @Schema(description = "备注") | |
| 32 | + @ExcelProperty("备注") | |
| 33 | + private String remark; | |
| 34 | + | |
| 35 | + @Schema(description = "预留字段1") | |
| 36 | + private String attribute1; | |
| 37 | + | |
| 38 | + @Schema(description = "预留字段2") | |
| 39 | + private String attribute2; | |
| 40 | + | |
| 41 | + @Schema(description = "预留字段3") | |
| 42 | + private Integer attribute3; | |
| 43 | + | |
| 44 | + @Schema(description = "预留字段4") | |
| 45 | + private Integer attribute4; | |
| 46 | + | |
| 47 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 48 | + @ExcelProperty("创建时间") | |
| 49 | + private LocalDateTime createTime; | |
| 50 | + | |
| 51 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/team/vo/MesCalTeamSaveReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.constraints.NotEmpty; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +@Schema(description = "管理后台 - MES 班组新增/修改 Request VO") | |
| 8 | +@Data | |
| 9 | +public class MesCalTeamSaveReqVO { | |
| 10 | + | |
| 11 | + @Schema(description = "班组编号", example = "1024") | |
| 12 | + private Long id; | |
| 13 | + | |
| 14 | + @Schema(description = "班组编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "TEAM-A") | |
| 15 | + @NotEmpty(message = "班组编码不能为空") | |
| 16 | + private String code; | |
| 17 | + | |
| 18 | + @Schema(description = "班组名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "注塑A组") | |
| 19 | + @NotEmpty(message = "班组名称不能为空") | |
| 20 | + private String name; | |
| 21 | + | |
| 22 | + @Schema(description = "班组类型", example = "1") | |
| 23 | + private Integer calendarType; | |
| 24 | + | |
| 25 | + @Schema(description = "备注") | |
| 26 | + private String remark; | |
| 27 | + | |
| 28 | + @Schema(description = "预留字段1") | |
| 29 | + private String attribute1; | |
| 30 | + | |
| 31 | + @Schema(description = "预留字段2") | |
| 32 | + private String attribute2; | |
| 33 | + | |
| 34 | + @Schema(description = "预留字段3") | |
| 35 | + private Integer attribute3; | |
| 36 | + | |
| 37 | + @Schema(description = "预留字段4") | |
| 38 | + private Integer attribute4; | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/team/vo/member/MesCalTeamMemberPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.member; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import jakarta.validation.constraints.NotNull; | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.EqualsAndHashCode; | |
| 8 | +import lombok.ToString; | |
| 9 | + | |
| 10 | +@Schema(description = "管理后台 - MES 班组成员分页 Request VO") | |
| 11 | +@Data | |
| 12 | +@EqualsAndHashCode(callSuper = true) | |
| 13 | +@ToString(callSuper = true) | |
| 14 | +public class MesCalTeamMemberPageReqVO extends PageParam { | |
| 15 | + | |
| 16 | + @Schema(description = "班组编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "201") | |
| 17 | + @NotNull(message = "班组编号不能为空") | |
| 18 | + private Long teamId; | |
| 19 | + | |
| 20 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/team/vo/member/MesCalTeamMemberRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.member; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import java.time.LocalDateTime; | |
| 7 | + | |
| 8 | +@Schema(description = "管理后台 - MES 班组成员 Response VO") | |
| 9 | +@Data | |
| 10 | +public class MesCalTeamMemberRespVO { | |
| 11 | + | |
| 12 | + @Schema(description = "班组成员编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 13 | + private Long id; | |
| 14 | + | |
| 15 | + @Schema(description = "班组编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "201") | |
| 16 | + private Long teamId; | |
| 17 | + | |
| 18 | + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 19 | + private Long userId; | |
| 20 | + | |
| 21 | + @Schema(description = "用户名", example = "admin") | |
| 22 | + private String userName; | |
| 23 | + | |
| 24 | + @Schema(description = "用户昵称", example = "管理员") | |
| 25 | + private String nickname; | |
| 26 | + | |
| 27 | + @Schema(description = "电话", example = "13800138000") | |
| 28 | + private String telephone; | |
| 29 | + | |
| 30 | + @Schema(description = "备注") | |
| 31 | + private String remark; | |
| 32 | + | |
| 33 | + @Schema(description = "预留字段1") | |
| 34 | + private String attribute1; | |
| 35 | + | |
| 36 | + @Schema(description = "预留字段2") | |
| 37 | + private String attribute2; | |
| 38 | + | |
| 39 | + @Schema(description = "预留字段3") | |
| 40 | + private Integer attribute3; | |
| 41 | + | |
| 42 | + @Schema(description = "预留字段4") | |
| 43 | + private Integer attribute4; | |
| 44 | + | |
| 45 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 46 | + private LocalDateTime createTime; | |
| 47 | + | |
| 48 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/team/vo/member/MesCalTeamMemberSaveReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.member; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.constraints.NotNull; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +@Schema(description = "管理后台 - MES 班组成员新增 Request VO") | |
| 8 | +@Data | |
| 9 | +public class MesCalTeamMemberSaveReqVO { | |
| 10 | + | |
| 11 | + @Schema(description = "班组成员编号", example = "1024") | |
| 12 | + private Long id; | |
| 13 | + | |
| 14 | + @Schema(description = "班组编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "201") | |
| 15 | + @NotNull(message = "班组编号不能为空") | |
| 16 | + private Long teamId; | |
| 17 | + | |
| 18 | + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 19 | + @NotNull(message = "用户编号不能为空") | |
| 20 | + private Long userId; | |
| 21 | + | |
| 22 | + @Schema(description = "备注") | |
| 23 | + private String remark; | |
| 24 | + | |
| 25 | + @Schema(description = "预留字段1") | |
| 26 | + private String attribute1; | |
| 27 | + | |
| 28 | + @Schema(description = "预留字段2") | |
| 29 | + private String attribute2; | |
| 30 | + | |
| 31 | + @Schema(description = "预留字段3") | |
| 32 | + private Integer attribute3; | |
| 33 | + | |
| 34 | + @Schema(description = "预留字段4") | |
| 35 | + private Integer attribute4; | |
| 36 | + | |
| 37 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/team/vo/shift/MesCalTeamShiftListReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.shift; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.Data; | |
| 5 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 6 | + | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | + | |
| 9 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 10 | + | |
| 11 | +@Schema(description = "管理后台 - MES 班组排班列表 Request VO") | |
| 12 | +@Data | |
| 13 | +public class MesCalTeamShiftListReqVO { | |
| 14 | + | |
| 15 | + @Schema(description = "班组编号", example = "201") | |
| 16 | + private Long teamId; | |
| 17 | + | |
| 18 | + @Schema(description = "排班计划编号", example = "1") | |
| 19 | + private Long planId; | |
| 20 | + | |
| 21 | + @Schema(description = "开始日期") | |
| 22 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 23 | + private LocalDateTime startDay; | |
| 24 | + | |
| 25 | + @Schema(description = "结束日期") | |
| 26 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 27 | + private LocalDateTime endDay; | |
| 28 | + | |
| 29 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/team/vo/shift/MesCalTeamShiftRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.shift; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import java.time.LocalDateTime; | |
| 7 | + | |
| 8 | +@Schema(description = "管理后台 - MES 班组排班 Response VO") | |
| 9 | +@Data | |
| 10 | +public class MesCalTeamShiftRespVO { | |
| 11 | + | |
| 12 | + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 13 | + private Long id; | |
| 14 | + | |
| 15 | + @Schema(description = "排班计划编号", example = "1") | |
| 16 | + private Long planId; | |
| 17 | + | |
| 18 | + @Schema(description = "班组编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "201") | |
| 19 | + private Long teamId; | |
| 20 | + | |
| 21 | + @Schema(description = "班组名称", example = "注塑A组") | |
| 22 | + private String teamName; | |
| 23 | + | |
| 24 | + @Schema(description = "班次编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 25 | + private Long shiftId; | |
| 26 | + | |
| 27 | + @Schema(description = "班次名称", example = "白班") | |
| 28 | + private String shiftName; | |
| 29 | + | |
| 30 | + @Schema(description = "日期", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 31 | + private LocalDateTime day; | |
| 32 | + | |
| 33 | + @Schema(description = "排序", example = "1") | |
| 34 | + private Integer sort; | |
| 35 | + | |
| 36 | + @Schema(description = "备注") | |
| 37 | + private String remark; | |
| 38 | + | |
| 39 | + @Schema(description = "预留字段1") | |
| 40 | + private String attribute1; | |
| 41 | + | |
| 42 | + @Schema(description = "预留字段2") | |
| 43 | + private String attribute2; | |
| 44 | + | |
| 45 | + @Schema(description = "预留字段3") | |
| 46 | + private Integer attribute3; | |
| 47 | + | |
| 48 | + @Schema(description = "预留字段4") | |
| 49 | + private Integer attribute4; | |
| 50 | + | |
| 51 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 52 | + private LocalDateTime createTime; | |
| 53 | + | |
| 54 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/plan/MesCalPlanTeamDO.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.dal.dataobject.cal.team.MesCalTeamDO; | |
| 4 | 5 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 5 | 6 | import com.baomidou.mybatisplus.annotation.TableId; |
| 6 | 7 | import com.baomidou.mybatisplus.annotation.TableName; |
| ... | ... | @@ -35,7 +36,7 @@ public class MesCalPlanTeamDO extends BaseDO { |
| 35 | 36 | /** |
| 36 | 37 | * 班组编号 |
| 37 | 38 | * |
| 38 | - * TODO @AI:关联 cal_team 表,等 cal_team 迁移后补充 | |
| 39 | + * 关联 {@link MesCalTeamDO#getId()} | |
| 39 | 40 | */ |
| 40 | 41 | private Long teamId; |
| 41 | 42 | /** | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/team/MesCalTeamDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.dataobject.cal.team; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import cn.iocoder.yudao.module.mes.enums.cal.MesCalCalendarTypeEnum; | |
| 5 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 7 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 8 | +import lombok.*; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * MES 班组 DO | |
| 12 | + * | |
| 13 | + * @author 芋道源码 | |
| 14 | + */ | |
| 15 | +@TableName("mes_cal_team") | |
| 16 | +@KeySequence("mes_cal_team_seq") | |
| 17 | +@Data | |
| 18 | +@EqualsAndHashCode(callSuper = true) | |
| 19 | +@ToString(callSuper = true) | |
| 20 | +@Builder | |
| 21 | +@NoArgsConstructor | |
| 22 | +@AllArgsConstructor | |
| 23 | +public class MesCalTeamDO extends BaseDO { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 班组编号 | |
| 27 | + */ | |
| 28 | + @TableId | |
| 29 | + private Long id; | |
| 30 | + /** | |
| 31 | + * 班组编码 | |
| 32 | + */ | |
| 33 | + private String code; | |
| 34 | + /** | |
| 35 | + * 班组名称 | |
| 36 | + */ | |
| 37 | + private String name; | |
| 38 | + /** | |
| 39 | + * 班组类型 | |
| 40 | + * | |
| 41 | + * 枚举 {@link MesCalCalendarTypeEnum} | |
| 42 | + */ | |
| 43 | + private Integer calendarType; | |
| 44 | + /** | |
| 45 | + * 备注 | |
| 46 | + */ | |
| 47 | + private String remark; | |
| 48 | + /** | |
| 49 | + * 预留字段1 | |
| 50 | + */ | |
| 51 | + private String attribute1; | |
| 52 | + /** | |
| 53 | + * 预留字段2 | |
| 54 | + */ | |
| 55 | + private String attribute2; | |
| 56 | + /** | |
| 57 | + * 预留字段3 | |
| 58 | + */ | |
| 59 | + private Integer attribute3; | |
| 60 | + /** | |
| 61 | + * 预留字段4 | |
| 62 | + */ | |
| 63 | + private Integer attribute4; | |
| 64 | + | |
| 65 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/team/MesCalTeamMemberDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.dataobject.cal.team; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import lombok.*; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * MES 班组成员 DO | |
| 11 | + * | |
| 12 | + * @author 芋道源码 | |
| 13 | + */ | |
| 14 | +@TableName("mes_cal_team_member") | |
| 15 | +@KeySequence("mes_cal_team_member_seq") | |
| 16 | +@Data | |
| 17 | +@EqualsAndHashCode(callSuper = true) | |
| 18 | +@ToString(callSuper = true) | |
| 19 | +@Builder | |
| 20 | +@NoArgsConstructor | |
| 21 | +@AllArgsConstructor | |
| 22 | +public class MesCalTeamMemberDO extends BaseDO { | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 班组成员编号 | |
| 26 | + */ | |
| 27 | + @TableId | |
| 28 | + private Long id; | |
| 29 | + /** | |
| 30 | + * 班组编号 | |
| 31 | + * | |
| 32 | + * 关联 {@link MesCalTeamDO#getId()} | |
| 33 | + */ | |
| 34 | + private Long teamId; | |
| 35 | + /** | |
| 36 | + * 用户编号 | |
| 37 | + * | |
| 38 | + * 关联 system_users 表 | |
| 39 | + */ | |
| 40 | + private Long userId; | |
| 41 | + /** | |
| 42 | + * 备注 | |
| 43 | + */ | |
| 44 | + private String remark; | |
| 45 | + /** | |
| 46 | + * 预留字段1 | |
| 47 | + */ | |
| 48 | + private String attribute1; | |
| 49 | + /** | |
| 50 | + * 预留字段2 | |
| 51 | + */ | |
| 52 | + private String attribute2; | |
| 53 | + /** | |
| 54 | + * 预留字段3 | |
| 55 | + */ | |
| 56 | + private Integer attribute3; | |
| 57 | + /** | |
| 58 | + * 预留字段4 | |
| 59 | + */ | |
| 60 | + private Integer attribute4; | |
| 61 | + | |
| 62 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/team/MesCalTeamShiftDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.dataobject.cal.team; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanDO; | |
| 5 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanShiftDO; | |
| 6 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 7 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 8 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 9 | +import lombok.*; | |
| 10 | + | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * MES 班组排班 DO | |
| 15 | + * | |
| 16 | + * @author 芋道源码 | |
| 17 | + */ | |
| 18 | +@TableName("mes_cal_team_shift") | |
| 19 | +@KeySequence("mes_cal_team_shift_seq") | |
| 20 | +@Data | |
| 21 | +@EqualsAndHashCode(callSuper = true) | |
| 22 | +@ToString(callSuper = true) | |
| 23 | +@Builder | |
| 24 | +@NoArgsConstructor | |
| 25 | +@AllArgsConstructor | |
| 26 | +public class MesCalTeamShiftDO extends BaseDO { | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 编号 | |
| 30 | + */ | |
| 31 | + @TableId | |
| 32 | + private Long id; | |
| 33 | + /** | |
| 34 | + * 排班计划编号 | |
| 35 | + * | |
| 36 | + * 关联 {@link MesCalPlanDO#getId()} | |
| 37 | + */ | |
| 38 | + private Long planId; | |
| 39 | + /** | |
| 40 | + * 班组编号 | |
| 41 | + * | |
| 42 | + * 关联 {@link MesCalTeamDO#getId()} | |
| 43 | + */ | |
| 44 | + private Long teamId; | |
| 45 | + /** | |
| 46 | + * 班次编号 | |
| 47 | + * | |
| 48 | + * 关联 {@link MesCalPlanShiftDO#getId()} | |
| 49 | + */ | |
| 50 | + private Long shiftId; | |
| 51 | + /** | |
| 52 | + * 日期 | |
| 53 | + */ | |
| 54 | + private LocalDateTime day; | |
| 55 | + /** | |
| 56 | + * 排序 | |
| 57 | + */ | |
| 58 | + private Integer sort; | |
| 59 | + /** | |
| 60 | + * 备注 | |
| 61 | + */ | |
| 62 | + private String remark; | |
| 63 | + /** | |
| 64 | + * 预留字段1 | |
| 65 | + */ | |
| 66 | + private String attribute1; | |
| 67 | + /** | |
| 68 | + * 预留字段2 | |
| 69 | + */ | |
| 70 | + private String attribute2; | |
| 71 | + /** | |
| 72 | + * 预留字段3 | |
| 73 | + */ | |
| 74 | + private Integer attribute3; | |
| 75 | + /** | |
| 76 | + * 预留字段4 | |
| 77 | + */ | |
| 78 | + private Integer attribute4; | |
| 79 | + | |
| 80 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/cal/team/MesCalTeamMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.mysql.cal.team; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.MesCalTeamPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.team.MesCalTeamDO; | |
| 8 | +import org.apache.ibatis.annotations.Mapper; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * MES 班组 Mapper | |
| 12 | + * | |
| 13 | + * @author 芋道源码 | |
| 14 | + */ | |
| 15 | +@Mapper | |
| 16 | +public interface MesCalTeamMapper extends BaseMapperX<MesCalTeamDO> { | |
| 17 | + | |
| 18 | + default PageResult<MesCalTeamDO> selectPage(MesCalTeamPageReqVO reqVO) { | |
| 19 | + return selectPage(reqVO, new LambdaQueryWrapperX<MesCalTeamDO>() | |
| 20 | + .likeIfPresent(MesCalTeamDO::getCode, reqVO.getCode()) | |
| 21 | + .likeIfPresent(MesCalTeamDO::getName, reqVO.getName()) | |
| 22 | + .eqIfPresent(MesCalTeamDO::getCalendarType, reqVO.getCalendarType()) | |
| 23 | + .orderByDesc(MesCalTeamDO::getId)); | |
| 24 | + } | |
| 25 | + | |
| 26 | + default MesCalTeamDO selectByCode(String code) { | |
| 27 | + return selectOne(MesCalTeamDO::getCode, code); | |
| 28 | + } | |
| 29 | + | |
| 30 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/cal/team/MesCalTeamMemberMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.mysql.cal.team; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.member.MesCalTeamMemberPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.team.MesCalTeamMemberDO; | |
| 8 | +import org.apache.ibatis.annotations.Mapper; | |
| 9 | + | |
| 10 | +import java.util.Collection; | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * MES 班组成员 Mapper | |
| 15 | + * | |
| 16 | + * @author 芋道源码 | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface MesCalTeamMemberMapper extends BaseMapperX<MesCalTeamMemberDO> { | |
| 20 | + | |
| 21 | + default PageResult<MesCalTeamMemberDO> selectPage(MesCalTeamMemberPageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<MesCalTeamMemberDO>() | |
| 23 | + .eqIfPresent(MesCalTeamMemberDO::getTeamId, reqVO.getTeamId()) | |
| 24 | + .orderByDesc(MesCalTeamMemberDO::getId)); | |
| 25 | + } | |
| 26 | + | |
| 27 | + default List<MesCalTeamMemberDO> selectListByTeamId(Long teamId) { | |
| 28 | + return selectList(MesCalTeamMemberDO::getTeamId, teamId); | |
| 29 | + } | |
| 30 | + | |
| 31 | + default List<MesCalTeamMemberDO> selectListByTeamIds(Collection<Long> teamIds) { | |
| 32 | + return selectList(MesCalTeamMemberDO::getTeamId, teamIds); | |
| 33 | + } | |
| 34 | + | |
| 35 | + default MesCalTeamMemberDO selectByUserIdExcludeId(Long userId, Long excludeId) { | |
| 36 | + return selectOne(new LambdaQueryWrapperX<MesCalTeamMemberDO>() | |
| 37 | + .eq(MesCalTeamMemberDO::getUserId, userId) | |
| 38 | + .neIfPresent(MesCalTeamMemberDO::getId, excludeId)); | |
| 39 | + } | |
| 40 | + | |
| 41 | + default void deleteByTeamId(Long teamId) { | |
| 42 | + delete(MesCalTeamMemberDO::getTeamId, teamId); | |
| 43 | + } | |
| 44 | + | |
| 45 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/cal/team/MesCalTeamShiftMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.mysql.cal.team; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 5 | +import cn.iocoder.yudao.module.mes.controller.admin.cal.team.vo.shift.MesCalTeamShiftListReqVO; | |
| 6 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.team.MesCalTeamShiftDO; | |
| 7 | +import org.apache.ibatis.annotations.Mapper; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * MES 班组排班 Mapper | |
| 14 | + * | |
| 15 | + * @author 芋道源码 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface MesCalTeamShiftMapper extends BaseMapperX<MesCalTeamShiftDO> { | |
| 19 | + | |
| 20 | + default List<MesCalTeamShiftDO> selectList(MesCalTeamShiftListReqVO reqVO) { | |
| 21 | + return selectList(new LambdaQueryWrapperX<MesCalTeamShiftDO>() | |
| 22 | + .eqIfPresent(MesCalTeamShiftDO::getTeamId, reqVO.getTeamId()) | |
| 23 | + .eqIfPresent(MesCalTeamShiftDO::getPlanId, reqVO.getPlanId()) | |
| 24 | + .geIfPresent(MesCalTeamShiftDO::getDay, reqVO.getStartDay()) | |
| 25 | + .leIfPresent(MesCalTeamShiftDO::getDay, reqVO.getEndDay()) | |
| 26 | + .orderByAsc(MesCalTeamShiftDO::getDay) | |
| 27 | + .orderByAsc(MesCalTeamShiftDO::getSort)); | |
| 28 | + } | |
| 29 | + | |
| 30 | + default MesCalTeamShiftDO selectByDayAndTeamId(LocalDateTime day, Long teamId) { | |
| 31 | + return selectOne(new LambdaQueryWrapperX<MesCalTeamShiftDO>() | |
| 32 | + .eq(MesCalTeamShiftDO::getDay, day) | |
| 33 | + .eq(MesCalTeamShiftDO::getTeamId, teamId)); | |
| 34 | + } | |
| 35 | + | |
| 36 | + default void deleteByPlanId(Long planId) { | |
| 37 | + delete(MesCalTeamShiftDO::getPlanId, planId); | |
| 38 | + } | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/cal/plan/MesCalPlanServiceImpl.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanDO; |
| 8 | 8 | import cn.iocoder.yudao.module.mes.dal.mysql.cal.plan.MesCalPlanMapper; |
| 9 | 9 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalPlanStatusEnum; |
| 10 | 10 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalShiftTypeEnum; |
| 11 | +import cn.iocoder.yudao.module.mes.service.cal.team.MesCalTeamShiftService; | |
| 11 | 12 | import cn.hutool.core.util.ObjUtil; |
| 12 | 13 | import jakarta.annotation.Resource; |
| 13 | 14 | import org.springframework.context.annotation.Lazy; |
| ... | ... | @@ -35,6 +36,9 @@ public class MesCalPlanServiceImpl implements MesCalPlanService { |
| 35 | 36 | @Resource |
| 36 | 37 | @Lazy |
| 37 | 38 | private MesCalPlanTeamService planTeamService; |
| 39 | + @Resource | |
| 40 | + @Lazy | |
| 41 | + private MesCalTeamShiftService teamShiftService; | |
| 38 | 42 | |
| 39 | 43 | @Override |
| 40 | 44 | @Transactional(rollbackFor = Exception.class) |
| ... | ... | @@ -85,7 +89,10 @@ public class MesCalPlanServiceImpl implements MesCalPlanService { |
| 85 | 89 | updateObj.setId(id); |
| 86 | 90 | updateObj.setStatus(MesCalPlanStatusEnum.CONFIRMED.getStatus()); |
| 87 | 91 | planMapper.updateById(updateObj); |
| 88 | - // TODO @芋艿:确认时调用 calTeamshiftService.genRecords(planId) 生成排班记录,等 cal_team_shift 迁移后 | |
| 92 | + | |
| 93 | + // 3. 生成班组排班记录 | |
| 94 | + // TODO @AI:方法名,不要缩写; | |
| 95 | + teamShiftService.genRecords(id); | |
| 89 | 96 | } |
| 90 | 97 | |
| 91 | 98 | @Override | ... | ... |