From 868e82d83a0a0a142d551fad84cb1a195f62f039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E6=B4=A5=E5=93=B2?= Date: Tue, 2 Jun 2020 18:22:58 +0800 Subject: [PATCH] Start Task #2019 Cost:16h Left:0h Finish Task #2019 Cost:16h --- .../i3plus/pojo/mes/sqlpack/MesPcnHqlPack.java | 57 ++++++++++++++++++++ .../pojo/model/mes/MesElectricDataModel.java | 54 +++++++++++++++++++ .../pojo/model/mes/MesElectricMarkUpDataModel.java | 61 ++++++++++++++++++++++ 3 files changed, 172 insertions(+) create mode 100644 modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/mes/MesElectricDataModel.java create mode 100644 modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/mes/MesElectricMarkUpDataModel.java diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/sqlpack/MesPcnHqlPack.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/sqlpack/MesPcnHqlPack.java index 6c67531..ce8771b 100644 --- a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/sqlpack/MesPcnHqlPack.java +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/sqlpack/MesPcnHqlPack.java @@ -10,6 +10,9 @@ import cn.estsh.i3plus.pojo.mes.bean.*; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import java.util.ArrayList; +import java.util.List; + /** * @Description: * @Reference: Mes 条件封装 @@ -541,4 +544,58 @@ public class MesPcnHqlPack { return packBean; } + /** + * 得到分页后的数据 + * + * @return 分页数据 + */ + public static List getPage(List totalList, int currentPage, int pageSize, int totalPage) { + if (currentPage <= 0) { + currentPage = 1; + } + + if (currentPage >= totalPage) { + currentPage = totalPage; + } + + List subList = new ArrayList<>(); + if (null != totalList) { + subList.addAll(totalList.subList(getStartIndex(totalList, currentPage, pageSize, totalPage), + getEndIndex(totalList, currentPage, pageSize, totalPage))); + } + + return subList; + } + + private static int getStartIndex(List totalList, int currentPage, int pageSize, int totalRecord) { + if (null == totalList) { + return 0; + } + int startIndex = (currentPage - 1) * pageSize; + if (startIndex > totalRecord) { + startIndex = totalRecord; + } + if (startIndex < 0) { + startIndex = 0; + } + return startIndex; + } + + private static int getEndIndex(List totalList, int currentPage, int pageSize, int totalRecord) { + if (null == totalList) { + return 0; + } + int endIndex = getStartIndex(totalList, currentPage, pageSize, totalRecord) + pageSize; + if (endIndex < 0) { + endIndex = 0; + } + if (endIndex < getStartIndex(totalList, currentPage, pageSize, totalRecord)) { + endIndex = getStartIndex(totalList, currentPage, pageSize, totalRecord); + } + if (endIndex > totalRecord) { + endIndex = totalRecord; + } + return endIndex; + } + } diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/mes/MesElectricDataModel.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/mes/MesElectricDataModel.java new file mode 100644 index 0000000..3dbf05e --- /dev/null +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/mes/MesElectricDataModel.java @@ -0,0 +1,54 @@ +package cn.estsh.i3plus.pojo.model.mes; + +import io.swagger.annotations.ApiParam; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description : Mes电检检测实体字段Model信息 + * @Reference : + * @Author : siliter.yuan + * @CreateDate : 2020-06-01 09:53 + * @Modify: + **/ +@Data +@NoArgsConstructor +public class MesElectricDataModel implements Serializable { + + private static final long serialVersionUID = -6376845639646546495L; + + @ApiParam(value = "车型") + public String carType; + + @ApiParam(value = "颜色代码") + public String colorCode; + + @ApiParam(value = "日期时间") + private String dateTime; + + @ApiParam(value = "生产序号") + private String productSeq; + + @ApiParam(value = "车型信息") + private String carTypeInfo; + + @ApiParam(value = "生产模式") + private String productModel; + + @ApiParam(value = "产品生产号") + private String productNumber; + + @ApiParam(value = "备用") + private String spare; + + @ApiParam(value = "所有零件信息包括所有选配信息") + private String other; + + @ApiParam(value = "电检结果") + private String electricResult; + + @ApiParam(value = "文件名称") + private String ftpFileName; +} \ No newline at end of file diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/mes/MesElectricMarkUpDataModel.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/mes/MesElectricMarkUpDataModel.java new file mode 100644 index 0000000..70d7af5 --- /dev/null +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/mes/MesElectricMarkUpDataModel.java @@ -0,0 +1,61 @@ +package cn.estsh.i3plus.pojo.model.mes; + +import io.swagger.annotations.ApiParam; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description : Mes电检检测补录数据实体字段Model信息 + * @Reference : + * @Author : siliter.yuan + * @CreateDate : 2020-06-02 09:53 + * @Modify: + **/ +@Data +public class MesElectricMarkUpDataModel implements Serializable { + + private static final long serialVersionUID = -6376845779646546495L; + + @ApiParam(value = "工作中心代码") + public String workCenterCode; + + @ApiParam(value = "工作单元代码") + public String workCellCode; + + @ApiParam(value = "过程条码") + private String serialNumber; + + @ApiParam(value = "产品生产号") + private String productNumber; + + @ApiParam(value = "电检结果") + private String electricResult; + + @ApiParam(value = "测试时间") + private String testDateTime; + + @ApiParam(value = "是否补录") + private Integer isMarkUp; + + @ApiParam(value = "补录时间") + private String markUpDateTime; + + @ApiParam(value = "开始时间") + private String startDateTimeStr; + + @ApiParam(value = "结束时间") + private String endDateTimeStr; + + public MesElectricMarkUpDataModel(String workCenterCode, String workCellCode, String serialNumber, String productNumber, + String electricResult, String testDateTime, Integer isMarkUp, String markUpDateTime) { + this.workCenterCode = workCenterCode; + this.workCellCode = workCellCode; + this.serialNumber = serialNumber; + this.productNumber = productNumber; + this.electricResult = electricResult; + this.testDateTime = testDateTime; + this.isMarkUp = isMarkUp; + this.markUpDateTime = markUpDateTime; + } +} \ No newline at end of file