diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java index 0b9b7985a..81f7d6d4b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java @@ -188,10 +188,13 @@ public class ProjectCertificationInventoryEO implements Serializable { private String productionEnterpriseName; /**认证进度*/ - @ApiModelProperty(value = "认证进度") private String certificationProgress; + // 认证进度排序字段 + @TableField(exist = false) + private String certificationProgressNumber; + /**认证进度展示名称**/ @Excel(name = "认证进度", width = 20) @TableField(exist = false) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationProgressEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationProgressEnum.java index 12fa19212..3eb8ffd21 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationProgressEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationProgressEnum.java @@ -7,22 +7,24 @@ import com.jero.common.constant.enums.CutEnum; * 认证进度枚举类 */ public enum CertificationProgressEnum { - TEST_PASSED("实验通过","Test passed"), - TEST_FAILED("实验失败","Test failed"), - NOT_START("未开始","Not start"), - IN_PROGRESS("进行中","In progress"), + NOT_START("未开始","Not start","1"), + IN_PROGRESS("进行中","In progress","2"), + TEST_PASSED("实验通过","Test passed","3"), + TEST_FAILED("实验失败","Test failed","4"), // NA("不涉及","NA"),// 04-12弃用, - COMPONENT_REPORT_NOT_SUBMITTED("部件报告未提交","Component report not submitted"), - COMPONENT_REPORT_SUBMITTED("部件报告已提交","Component report submitted"), - COMPONENT_REPORT_HAS_BEEN_STORED("部件报告已入库","Component report has been stored"), + COMPONENT_REPORT_NOT_SUBMITTED("部件报告未提交","Component report not submitted","5"), + COMPONENT_REPORT_SUBMITTED("部件报告已提交","Component report submitted","6"), + COMPONENT_REPORT_HAS_BEEN_STORED("部件报告已入库","Component report has been stored","7"), ; String name; String value; + String number; - private CertificationProgressEnum(String name, String value) { + private CertificationProgressEnum(String name, String value,String number) { this.name = name; this.value = value; + this.number = number; } public String getName() { @@ -41,7 +43,15 @@ public enum CertificationProgressEnum { this.value = value; } - public static String getTextByValue(String value,String cut) { + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public static String getTextByValue(String value, String cut) { CertificationProgressEnum[] values = values(); for (CertificationProgressEnum certificationProgressEnum : values) { if (certificationProgressEnum.value.equals(value)) { @@ -54,4 +64,14 @@ public enum CertificationProgressEnum { } return null; } + + public static String getNumberByValue(String value) { + CertificationProgressEnum[] values = values(); + for (CertificationProgressEnum certificationProgressEnum : values) { + if (certificationProgressEnum.value.equals(value)) { + return certificationProgressEnum.number; + } + } + return null; + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 43d6398f5..b9c33963b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -1000,6 +1000,11 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl{ + String e1CertificationProgressNumber = (StringUtils.isNotEmpty(e1.getCertificationProgressNumber()) ? e1.getCertificationProgressNumber() : ""); + String e2CertificationProgressNumber = (StringUtils.isNotEmpty(e2.getCertificationProgressNumber()) ? e2.getCertificationProgressNumber() : ""); + return comparator.compare(e1CertificationProgressNumber,e2CertificationProgressNumber); + }); + }else if(OrderEnum.REVERSE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1,e2)->{ + String e1CertificationProgressNumber = (StringUtils.isNotEmpty(e1.getCertificationProgressNumber()) ? e1.getCertificationProgressNumber() : ""); + String e2CertificationProgressNumber = (StringUtils.isNotEmpty(e2.getCertificationProgressNumber()) ? e2.getCertificationProgressNumber() : ""); + return comparator.compare(e2CertificationProgressNumber,e1CertificationProgressNumber); + }); + } + } } return datas; }