认证清单,认证进度排序。

This commit is contained in:
wangzhijiang
2023-04-18 16:04:50 +08:00
parent 02e8921fac
commit ac40a86ba8
3 changed files with 55 additions and 10 deletions
@@ -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)
@@ -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;
}
}
@@ -1000,6 +1000,11 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
String attestationTypeName = this.sysDictItemService.disposeShowDictItemValue(sysDictItems,data.getAttestationType(),cut, "ren4_zheng4_qing1_dan1_-_ren4_zheng4_lei4_xing2");
data.setAttestationTypeName(attestationTypeName);
}
if(StringUtils.isNotEmpty(data.getCertificationProgress())){
String cpNumber = CertificationProgressEnum.getNumberByValue(data.getCertificationProgress());
data.setCertificationProgressNumber(cpNumber);
}
}
}
}
@@ -1575,6 +1580,23 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
});
}
}
// 认证进度 certificationProgress
if(StringUtils.equals("certificationProgress",orderByField)){
if(OrderEnum.POSITIVE.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(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;
}