From b6849e5a933e2636419241b26145b0588f5ee36c Mon Sep 17 00:00:00 2001 From: rui_li <877258667@qq.com> Date: Mon, 25 Oct 2021 10:32:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=E6=8E=92?= =?UTF-8?q?=E4=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ScheduleController.java | 34 ++++++++ .../modules/schedule/dao/ScheduleMapper.java | 25 ++++++ .../modules/schedule/data/BaseData.java | 78 +++++++++++++++++++ .../modules/schedule/data/ShiftInfoData.java | 59 ++++++++++++++ .../schedule/service/ScheduleService.java | 23 ++++++ .../service/impl/ScheduleServiceImpl.java | 26 +++++++ src/main/resources/application.yml | 2 +- .../mapper/schedule/ScheduleMapper.xml | 35 +++++++++ 8 files changed, 281 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/gaotao/modules/schedule/controller/ScheduleController.java create mode 100644 src/main/java/com/gaotao/modules/schedule/dao/ScheduleMapper.java create mode 100644 src/main/java/com/gaotao/modules/schedule/data/BaseData.java create mode 100644 src/main/java/com/gaotao/modules/schedule/data/ShiftInfoData.java create mode 100644 src/main/java/com/gaotao/modules/schedule/service/ScheduleService.java create mode 100644 src/main/java/com/gaotao/modules/schedule/service/impl/ScheduleServiceImpl.java create mode 100644 src/main/resources/mapper/schedule/ScheduleMapper.xml diff --git a/src/main/java/com/gaotao/modules/schedule/controller/ScheduleController.java b/src/main/java/com/gaotao/modules/schedule/controller/ScheduleController.java new file mode 100644 index 0000000..e875cc3 --- /dev/null +++ b/src/main/java/com/gaotao/modules/schedule/controller/ScheduleController.java @@ -0,0 +1,34 @@ +package com.gaotao.modules.schedule.controller; + +import com.gaotao.common.utils.R; +import com.gaotao.modules.schedule.data.ShiftInfoData; +import com.gaotao.modules.schedule.service.ScheduleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 生产订单排产 + * @author LR + * @date 2021/10/20 11:04 + **/ +@RestController +@RequestMapping(value = "/schedule") +public class ScheduleController { + + @Autowired + private ScheduleService scheduleService; + + public R getResourceRestList(@RequestBody ShiftInfoData inData){ + List resultList = scheduleService.getResourceRestList(inData); + return R.ok().put("msg", "操作成功!").put("rows", resultList).put("total", resultList.size()); + } + + + + + +} diff --git a/src/main/java/com/gaotao/modules/schedule/dao/ScheduleMapper.java b/src/main/java/com/gaotao/modules/schedule/dao/ScheduleMapper.java new file mode 100644 index 0000000..affc7bb --- /dev/null +++ b/src/main/java/com/gaotao/modules/schedule/dao/ScheduleMapper.java @@ -0,0 +1,25 @@ +package com.gaotao.modules.schedule.dao; + +import com.gaotao.modules.schedule.data.ShiftInfoData; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @author LR + * @Title: ScheduleMapper + * 生产订单排产dao + * @Date 2021/10/20 11:20 + */ +@Mapper +public interface ScheduleMapper { + + /** + * TODO 按照工厂+机台+排产日期查询休息的信息 + * @author LR + * @date 2021/10/21 13:14 + * @param inData + * @return java.util.List + **/ + List getResourceRestList(ShiftInfoData inData); +} diff --git a/src/main/java/com/gaotao/modules/schedule/data/BaseData.java b/src/main/java/com/gaotao/modules/schedule/data/BaseData.java new file mode 100644 index 0000000..583e766 --- /dev/null +++ b/src/main/java/com/gaotao/modules/schedule/data/BaseData.java @@ -0,0 +1,78 @@ +package com.gaotao.modules.schedule.data; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.ibatis.type.Alias; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author LR + * @Title: BaseInData + * 基础的入参类 + * @Date 2021/10/20 15:28 + */ +@Alias("BaseData") +public class BaseData { + private int id; + private String site; + private String createdBy; + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date createdDate; + private String updatedBy; + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date updatedDate;//更细时间 + + public BaseData() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public Date getUpdatedDate() { + return updatedDate; + } + + public void setUpdatedDate(Date updatedDate) { + this.updatedDate = updatedDate; + } +} diff --git a/src/main/java/com/gaotao/modules/schedule/data/ShiftInfoData.java b/src/main/java/com/gaotao/modules/schedule/data/ShiftInfoData.java new file mode 100644 index 0000000..46a9941 --- /dev/null +++ b/src/main/java/com/gaotao/modules/schedule/data/ShiftInfoData.java @@ -0,0 +1,59 @@ +package com.gaotao.modules.schedule.data; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.ibatis.type.Alias; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author LR + * @Title: ShiftSearchData + * 班次查询使用 + * @Date 2021/10/20 15:39 + */ +@Alias("ShiftInfoData") +public class ShiftInfoData extends BaseData { + private String resourceId; + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date scheduleDate; + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date ShiftDate; + private String ShiftInfo; + public ShiftInfoData() { + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public Date getScheduleDate() { + return scheduleDate; + } + + public void setScheduleDate(Date scheduleDate) { + this.scheduleDate = scheduleDate; + } + + public Date getShiftDate() { + return ShiftDate; + } + + public void setShiftDate(Date shiftDate) { + ShiftDate = shiftDate; + } + + public String getShiftInfo() { + return ShiftInfo; + } + + public void setShiftInfo(String shiftInfo) { + ShiftInfo = shiftInfo; + } +} diff --git a/src/main/java/com/gaotao/modules/schedule/service/ScheduleService.java b/src/main/java/com/gaotao/modules/schedule/service/ScheduleService.java new file mode 100644 index 0000000..cd63f25 --- /dev/null +++ b/src/main/java/com/gaotao/modules/schedule/service/ScheduleService.java @@ -0,0 +1,23 @@ +package com.gaotao.modules.schedule.service; + +import com.gaotao.modules.schedule.data.ShiftInfoData; + +import java.util.List; + +/** + * @author LR + * @Title: ScheduleService + * 生产订单排产 + * @Date 2021/10/21 11:26 + */ +public interface ScheduleService { + + /** + * TODO 查询工厂+排产日期下的休息信息 + * @author LR + * @date 2021/10/21 13:08 + * @param inData + * @return java.util.List + **/ + List getResourceRestList(ShiftInfoData inData); +} diff --git a/src/main/java/com/gaotao/modules/schedule/service/impl/ScheduleServiceImpl.java b/src/main/java/com/gaotao/modules/schedule/service/impl/ScheduleServiceImpl.java new file mode 100644 index 0000000..7775961 --- /dev/null +++ b/src/main/java/com/gaotao/modules/schedule/service/impl/ScheduleServiceImpl.java @@ -0,0 +1,26 @@ +package com.gaotao.modules.schedule.service.impl; + +import com.gaotao.modules.schedule.dao.ScheduleMapper; +import com.gaotao.modules.schedule.data.ShiftInfoData; +import com.gaotao.modules.schedule.service.ScheduleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author LR + * @Title: ScheduleServiceImpl + * 生产订单排产实现 + * @Date 2021/10/21 11:27 + */ +@Service +public class ScheduleServiceImpl implements ScheduleService { + @Autowired + private ScheduleMapper scheduleMapper; + + @Override + public List getResourceRestList(ShiftInfoData inData) { + return scheduleMapper.getResourceRestList(inData); + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index ea80626..c3f8f90 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -48,7 +48,7 @@ spring: mybatis-plus: mapper-locations: classpath:/mapper/**/*.xml #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.gaotao.modules.*.entity + typeAliasesPackage: com.gaotao.modules.*.entity,com.gaotao.modules.*.data global-config: #数据库相关配置 db-config: diff --git a/src/main/resources/mapper/schedule/ScheduleMapper.xml b/src/main/resources/mapper/schedule/ScheduleMapper.xml new file mode 100644 index 0000000..33c18e4 --- /dev/null +++ b/src/main/resources/mapper/schedule/ScheduleMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + \ No newline at end of file