分阶段实施详情-文档库导入支持分阶段详情,文档库、虚拟清单检索实施时间修改,虚拟清单列表处理分阶段实施日期。

This commit is contained in:
wangzhijiang
2023-02-27 17:56:12 +08:00
parent f71ae60908
commit ea7f2c17c9
4 changed files with 651 additions and 323 deletions
@@ -1,5 +1,6 @@
package com.jero.common.util; package com.jero.common.util;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.beans.PropertyEditorSupport; import java.beans.PropertyEditorSupport;
@@ -8,6 +9,7 @@ import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 类描述:时间操作定义类 * 类描述:时间操作定义类
@@ -614,6 +616,28 @@ public class DateUtils extends PropertyEditorSupport {
return 0; return 0;
} }
/**
* 日期数据转换字符串
* @param dateList
* @return
*/
public static String formatDateList(List<Date> dateList) {
StringBuilder strSb = new StringBuilder();
if(CollectionUtils.isNotEmpty(dateList)){
dateList = dateList.stream().distinct().sorted().collect(Collectors.toList());
for (Date date : dateList) {
strSb.append(date_sdf.get().format(date)).append(",");
}
}
String result = "";
if(!StringUtils.isEmpty(strSb.toString())){
result = strSb.substring(0,strSb.length()-1);
}
return result;
}
/** /**
* String类型 转换为Date, 如果参数长度为10 转换格式”yyyy-MM-dd“ 如果参数长度为19 转换格式”yyyy-MM-dd * String类型 转换为Date, 如果参数长度为10 转换格式”yyyy-MM-dd“ 如果参数长度为19 转换格式”yyyy-MM-dd
* HH:mm:ss“ * @param text String类型的时间值 * HH:mm:ss“ * @param text String类型的时间值
@@ -33,6 +33,7 @@ import com.jero.modules.document.entity.BussDocumentLibraryEO;
import com.jero.modules.document.entity.OSSFileForDocumentLibrary; import com.jero.modules.document.entity.OSSFileForDocumentLibrary;
import com.jero.modules.document.entity.PhasedImplementationDetailsEO; import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
import com.jero.modules.document.enums.FieldTypeEnum; import com.jero.modules.document.enums.FieldTypeEnum;
import com.jero.modules.document.enums.ImplementationTypeEnum;
import com.jero.modules.document.enums.LawsStateEnum; import com.jero.modules.document.enums.LawsStateEnum;
import com.jero.modules.document.enums.SearchEnum; import com.jero.modules.document.enums.SearchEnum;
import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper; import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
@@ -794,6 +795,12 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
areaName = onlCgformAreaTemp.getEnName(); areaName = onlCgformAreaTemp.getEnName();
} }
List<OnlCgformField> fieldListTemp = fieldList.stream().filter(e -> onlCgformAreaTemp.getId().equals(e.getShowArea())).collect(Collectors.toList()); List<OnlCgformField> fieldListTemp = fieldList.stream().filter(e -> onlCgformAreaTemp.getId().equals(e.getShowArea())).collect(Collectors.toList());
OnlCgformField phasedOnlCgformField = new OnlCgformField();
phasedOnlCgformField.setId(UUID.randomUUID().toString().replace("-", ""));
phasedOnlCgformField.setDbFieldTxt("分阶段实施详情");
phasedOnlCgformField.setDbFieldEnName("Details of the phased implementation");
phasedOnlCgformField.setDbFieldName("phasedImplDetails");
fieldListTemp.add(phasedOnlCgformField);
for (OnlCgformField onlCgformField : fieldListTemp) { for (OnlCgformField onlCgformField : fieldListTemp) {
String dictId = onlCgformField.getDictId(); String dictId = onlCgformField.getDictId();
List<SysCategoryTreeVO> sysCategoryTreeVOList = new ArrayList<>(); List<SysCategoryTreeVO> sysCategoryTreeVOList = new ArrayList<>();
@@ -4233,12 +4240,36 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
conditionSb.append(" and (" + key + " in(" + substring + ")" + condition.toString()); conditionSb.append(" and (" + key + " in(" + substring + ")" + condition.toString());
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) { } else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) {
//日期(区分单日期还时间范围) // 如果是查询实施日期,需要单独处理一下,刚加的分阶段实施详情需求
if (value.contains(",")) { if(StringUtils.equals("xin1_che1_xing2_shi2_shi1_ri4_qi1",key) || StringUtils.equals("implement_time",key)){
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'" //日期(区分单日期还时间范围)
+ " and " + "date_format(" + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'"); if (value.contains(",")) {
} else { conditionSb.append(" and (");
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') = '" + value + "'"); conditionSb.append(" (");
conditionSb.append("date_format(" + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'"
+ " and " + "date_format(" + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'");
conditionSb.append(" )");
conditionSb.append(" or id in (");
conditionSb.append("select buss_document_library_id from phased_implementation_details");
conditionSb.append(" where implementation_date >= '" + value.split(",")[0] + "' and implementation_date <= '" + value.split(",")[1] + "'");
if(StringUtils.equals("xin1_che1_xing2_shi2_shi1_ri4_qi1",key)){
conditionSb.append(" and implementation_type like concat(concat('%','" + ImplementationTypeEnum.NEW_CAR_MODEL.getItemValue() + "'),'%')");
}else if(StringUtils.equals("implement_time",key)){
conditionSb.append(" and implementation_type like concat(concat('%','" + ImplementationTypeEnum.CAR_IN_PRODUCTION.getItemValue() + "'),'%')");
}
conditionSb.append(" )");
conditionSb.append(" )");
} else {
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') = '" + value + "'");
}
}else {
//日期(区分单日期还时间范围)
if (value.contains(",")) {
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'"
+ " and " + "date_format(" + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'");
} else {
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') = '" + value + "'");
}
} }
} else if (FieldTypeEnum.PERSON.getValue().equals(fieldType)) { } else if (FieldTypeEnum.PERSON.getValue().equals(fieldType)) {
//输入框 LIKE CONCAT("%", '/%', "%") ESCAPE '/' //输入框 LIKE CONCAT("%", '/%', "%") ESCAPE '/'
@@ -5209,6 +5240,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
sbTwo.append(count++ + "." + tree); sbTwo.append(count++ + "." + tree);
} }
} }
//
if(CutEnum.CN.getValue().equals(cut)){
String tree = "分阶段实施详情字段,多行之间使用#号分隔,列之间使用<p>标签分隔,示例:法规编号/条款<p>新车型<p>2000-10-10<p>备注#";
sbTwo.append(count++ + "." + tree);
}else{
String tree = "For the field of phased implementation details, separate rows with # signs and columns with <p> labels. Example: Regulation Number/Articles <p> New model <p>2000-10-10<p> Remarks";
sbTwo.append(count++ + "." + tree);
}
List<String> list = new LinkedList<>(); List<String> list = new LinkedList<>();
list.add(title); list.add(title);
list.add(sbTwo.toString()); list.add(sbTwo.toString());
@@ -5888,327 +5927,415 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
String value = entry.getValue(); String value = entry.getValue();
String field = ""; String field = "";
for (Map<String, Object> map : fieldList) { // 如果是分阶段实施字段,单独处理,如果是其它字段,按照原有逻辑处理
String fieldNameCn = (String) map.get("db_field_txt");//中文名称 if(StringUtils.equals(key,"分阶段实施详情") || StringUtils.equals(key,"Details of the phased implementation")){
String fieldName = (String) map.get("db_field_name");//字段名 if(StringUtils.isNotEmpty(value)){
String mustInput = (String) map.get("field_must_input");//是否必填 List<PhasedImplementationDetailsEO> phasedImplementationDetailsEOList = new ArrayList<>();
String dbLength = map.get("db_length").toString();//字段长度 List<String> phasedImplDetailsList = Arrays.asList(value.split("#"));
String fieldShowType = (String) map.get("field_show_type");//字段类型 for (String phasedImplDetails : phasedImplDetailsList) {
PhasedImplementationDetailsEO phasedImplementationDetailsEO = new PhasedImplementationDetailsEO();
String[] phasedImplDetailsArr = phasedImplDetails.split("<p>");
if(phasedImplDetailsArr.length >= 1){
String standNumberOrClause = phasedImplDetailsArr[0];
if (StringUtils.isNotBlank(standNumberOrClause) && standNumberOrClause.length() > 100) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += "分阶段实施详情-法规编号/条款不能超过" + 100 + "个字符, ";
}else{
errorMsg += "Details of the phased implementation standNumberOrClause Can not be more than " + 100 + " char, ";
}
countError++;
}else {
phasedImplementationDetailsEO.setStandNumberOrClause(standNumberOrClause);
}
}
if(phasedImplDetailsArr.length >= 2){
String implementationTypeName = phasedImplDetailsArr[1];
if(StringUtils.isNotEmpty(implementationTypeName)){
String[] implementationTypeNameArr = implementationTypeName.split(",");
ImplementationTypeEnum[] implementationTypeEnums = ImplementationTypeEnum.values();
List<String> implementationTypeList = Arrays.stream(implementationTypeEnums).filter(implementationTypeEnum -> {
boolean flag = false;
for (String type : implementationTypeNameArr) {
if(StringUtils.equals(type,implementationTypeEnum.getNameCn()) || StringUtils.equals(type,implementationTypeEnum.getNameEn())){
flag = true;
}
}
return flag;
}).map(ImplementationTypeEnum::getItemValue).collect(Collectors.toList());
if (key.equals(fieldNameCn)) { if(implementationTypeNameArr.length != implementationTypeList.size()){
field = fieldName;
//验证字段是否必填,长度,下拉框和树形的值是否匹配
if (FieldTypeEnum.TREE.getValue().equals(fieldShowType)) {
//树形
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{
errorMsg += key + " Can not be more than " + dbLength + " char, ";
}
countError++;
}
//判断数据是否匹配
if (StringUtils.isNotBlank(value)) {
for (String valueTemp : value.split(",")) {
if (!treeNameList.contains(valueTemp)) {
if(CutEnum.CN.getValue().equals(cut)){ if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, "; errorMsg += "分阶段实施详情-实施类型填写有误,填写值为'新车型 或 在产车', ";
}else{ }else{
errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, "; errorMsg += "Details of the phased implementation implementationType The value is set to 'New car model or Car in production', ";
} }
countError++; countError++;
}else {
phasedImplementationDetailsEO.setImplementationType(implementationTypeList.stream().collect(Collectors.joining(",")));
} }
} }
} }
String valueId = ""; if(phasedImplDetailsArr.length >= 3){
//文字转ID Date implementationDate = null;
if (StringUtils.isNotBlank(value)) { try {
for (String valueTemp : value.split(",")) { implementationDate = DateUtils.parseDate(phasedImplDetailsArr[2], "yyyy-MM-dd");
if (treeNameList.contains(valueTemp)) { } catch (ParseException e) {
List<SysCategory> collect = new ArrayList<>(); e.printStackTrace();
if(CutEnum.CN.getValue().equals(cut)){
collect = categoryList.stream().filter(e -> e.getName().equals(valueTemp)).collect(Collectors.toList());
}else{
collect = categoryList.stream().filter(e -> e.getEnName().equals(valueTemp)).collect(Collectors.toList());
}
valueId += collect.get(0).getId()+",";
}
} }
if(StringUtils.isNotBlank(valueId)){ if(implementationDate == null){
value = valueId.substring(0, valueId.length() - 1);
}
}
} else if (FieldTypeEnum.TEXT_STRING.getValue().equals(fieldShowType)) {
//输入框
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{
errorMsg += key + " Can not be more than" + dbLength + "char, ";
}
countError++;
}
} else if (FieldTypeEnum.TEXT_NUMBER.getValue().equals(fieldShowType)) {
//正则判断仅能为 负号(-),小数点(.)和数字
} else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldShowType)) {
//下拉单选
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{
errorMsg += key + " Can not be more than" + dbLength + " char, ";
}
countError++;
}
//判断是否是单选
if (StringUtils.isNotBlank(value) && value.contains(",")) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为单选项, ";
}else{
errorMsg += key + " Is multiple choice, ";
}
countError++;
}
//判断数据是否匹配
if (StringUtils.isNotBlank(value)) {
if (!itemNameList.contains(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "中的" + value + "与数据字典不匹配, "; errorMsg += "分阶段实施详情-实施日期格式错误,正确格式为'yyyy-MM-dd', ";
}else{ }else{
errorMsg += key + " " + value + " Does not match the data dictionary, "; errorMsg += "Details of the phased implementation implementationDate format is incorrect. The correct format is 'yyyy-MM-dd', ";
}
countError++;
}else {
phasedImplementationDetailsEO.setImplementationDate(implementationDate);
}
}
if(phasedImplDetailsArr.length >= 4){
String remarks = phasedImplDetailsArr[3];
if (StringUtils.isNotBlank(remarks) && remarks.length() > 1000) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += "分阶段实施详情-备注不能超过" + 1000 + "个字符, ";
}else{
errorMsg += "Details of the phased implementation ramarks Can not be more than " + 1000 + " char, ";
}
countError++;
}else {
phasedImplementationDetailsEO.setRemarks(remarks);
}
}
phasedImplementationDetailsEOList.add(phasedImplementationDetailsEO);
}
mapResult.put("phasedImplementationDetailsEOList",phasedImplementationDetailsEOList);
}
}else {
for (Map<String, Object> map : fieldList) {
String fieldNameCn = (String) map.get("db_field_txt");//中文名称
String fieldName = (String) map.get("db_field_name");//字段名
if(StringUtils.equals(fieldName,"phasedImplDetails")){
continue;
}
String mustInput = (String) map.get("field_must_input");//是否必填
String dbLength = map.get("db_length").toString();//字段长度
String fieldShowType = (String) map.get("field_show_type");//字段类型
if (key.equals(fieldNameCn)) {
field = fieldName;
//验证字段是否必填,长度,下拉框和树形的值是否匹配
if (FieldTypeEnum.TREE.getValue().equals(fieldShowType)) {
//树形
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
} }
countError++; countError++;
} }
} //判断长度
//文字转数据字典编码 if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if (itemNameList.contains(value)) { if(CutEnum.CN.getValue().equals(cut)){
String finalValue = value; errorMsg += key + "不能超过" + dbLength + "个字符, ";
List<SysDictItem> collect = new ArrayList<>(); }else{
if(CutEnum.CN.getValue().equals(cut)){ errorMsg += key + " Can not be more than " + dbLength + " char, ";
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(finalValue)).collect(Collectors.toList());
}else{
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(finalValue)).collect(Collectors.toList());
}
if (collect.size() != 0) {
value = collect.get(0).getItemValue();
}
}
} else if (FieldTypeEnum.PULL_MORE.getValue().equals(fieldShowType)) {
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{
errorMsg += key + " Can not be more than" + dbLength + " char, ";
}
countError++;
}
//下拉多选
if (StringUtils.isNotBlank(value)) {
for (String valueTemp : value.split(",")) {
if (!itemNameList.contains(valueTemp)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, ";
}else{
errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, ";
}
countError++;
} }
countError++;
} }
} //判断数据是否匹配
if (StringUtils.isNotBlank(value)) {
String valueId = ""; for (String valueTemp : value.split(",")) {
//文字转数据字典id if (!treeNameList.contains(valueTemp)) {
if (StringUtils.isNotBlank(value)) { if(CutEnum.CN.getValue().equals(cut)){
for (String valueTemp : value.split(",")) { errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, ";
if (itemNameList.contains(valueTemp)) { }else{
List<SysDictItem> collect = new ArrayList<>(); errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, ";
if(CutEnum.CN.getValue().equals(cut)){
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(valueTemp)).collect(Collectors.toList());
}else{
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(valueTemp)).collect(Collectors.toList());
}
valueId += collect.get(0).getItemValue() + ",";
}
}
if (StringUtils.isNotBlank(valueId)) {
value = valueId.substring(0, valueId.length() - 1);
}
}
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldShowType)) {
value = value.replaceAll("/","-");
//单选日期
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//a判断是否是单日期选择
if (StringUtils.isNotBlank(value) && value.contains(",")) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为单日期选项, ";
}else{
errorMsg += key + " Is single date option, ";
}
countError++;
}
//判断格式是否正确
if (!DateUtils.isValidDate((String) value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}else{
errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}
countError++;
}
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldShowType)) {
//多选日期
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//判断格式是否正确
if (!DateUtils.isValidDate((String) value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}else{
errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}
countError++;
}
} else if (FieldTypeEnum.FILE.getValue().equals(fieldShowType)) {
//文件
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{
errorMsg += key + " Can not be more than " + dbLength + " char, ";
}
countError++;
}
if (StringUtils.isNotBlank(value)) {
StringBuilder sb = new StringBuilder();
for (String fileName : value.split(",")) {
List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,cut,errorMsg,null,key,key);
if (nowFileList.size() == 0) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + " 压缩包中没有" + fileName + "文件, ";
}else{
errorMsg += key + " Not in the zip package" + fileName + "file, ";
}
countError++;
} else {
try {
FileInputStream input = new FileInputStream(nowFileList.get(0));
MultipartFile multipartFile =
new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input);
//文件存入文件表
OSSFile ossFile = iOSSFileService.uploadLocalOfCos(multipartFile, "", null,null);
if (ObjectUtils.isNotEmpty(ossFile)) {
sb.append(ossFile.getId() + ",");
} }
} catch (IOException e) { countError++;
e.printStackTrace();
} }
} }
} }
if (StringUtils.isNotBlank(sb)) { String valueId = "";
String substring = sb.substring(0, sb.length() - 1); //文字转ID
value = substring; if (StringUtils.isNotBlank(value)) {
for (String valueTemp : value.split(",")) {
if (treeNameList.contains(valueTemp)) {
List<SysCategory> collect = new ArrayList<>();
if(CutEnum.CN.getValue().equals(cut)){
collect = categoryList.stream().filter(e -> e.getName().equals(valueTemp)).collect(Collectors.toList());
}else{
collect = categoryList.stream().filter(e -> e.getEnName().equals(valueTemp)).collect(Collectors.toList());
}
valueId += collect.get(0).getId()+",";
}
}
if(StringUtils.isNotBlank(valueId)){
value = valueId.substring(0, valueId.length() - 1);
}
} }
}
} else if (FieldTypeEnum.STANDARD.getValue().equals(fieldShowType)) { } else if (FieldTypeEnum.TEXT_STRING.getValue().equals(fieldShowType)) {
//标准选择 //输入框
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, "; errorMsg += key + "为必填项,不能为空, ";
}else{ }else{
errorMsg += key + " This parameter is mandatory and cannot be empty, "; errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
} }
countError++; //判断长度
} if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
//判断长度 if(CutEnum.CN.getValue().equals(cut)){
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { errorMsg += key + "不能超过" + dbLength + "个字符, ";
if(CutEnum.CN.getValue().equals(cut)){ }else{
errorMsg += key + "不能超过" + dbLength + "个字符, "; errorMsg += key + " Can not be more than" + dbLength + "char, ";
}else{ }
errorMsg += key + " Can not be more than " + dbLength + " char, "; countError++;
} }
countError++;
} } else if (FieldTypeEnum.TEXT_NUMBER.getValue().equals(fieldShowType)) {
//判断库中是否存在,如果存在则存id,如果不存在则存输入的值 //正则判断仅能为 负号(-),小数点(.)和数字
} else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldShowType)) {
//下拉单选
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{
errorMsg += key + " Can not be more than" + dbLength + " char, ";
}
countError++;
}
//判断是否是单选
if (StringUtils.isNotBlank(value) && value.contains(",")) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为单选项, ";
}else{
errorMsg += key + " Is multiple choice, ";
}
countError++;
}
//判断数据是否匹配
if (StringUtils.isNotBlank(value)) {
if (!itemNameList.contains(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "中的" + value + "与数据字典不匹配, ";
}else{
errorMsg += key + " " + value + " Does not match the data dictionary, ";
}
countError++;
}
}
//文字转数据字典编码
if (itemNameList.contains(value)) {
String finalValue = value;
List<SysDictItem> collect = new ArrayList<>();
if(CutEnum.CN.getValue().equals(cut)){
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(finalValue)).collect(Collectors.toList());
}else{
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(finalValue)).collect(Collectors.toList());
}
if (collect.size() != 0) {
value = collect.get(0).getItemValue();
}
}
} else if (FieldTypeEnum.PULL_MORE.getValue().equals(fieldShowType)) {
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{
errorMsg += key + " Can not be more than" + dbLength + " char, ";
}
countError++;
}
//下拉多选
if (StringUtils.isNotBlank(value)) {
for (String valueTemp : value.split(",")) {
if (!itemNameList.contains(valueTemp)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, ";
}else{
errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, ";
}
countError++;
}
}
}
String valueId = "";
//文字转数据字典id
if (StringUtils.isNotBlank(value)) {
for (String valueTemp : value.split(",")) {
if (itemNameList.contains(valueTemp)) {
List<SysDictItem> collect = new ArrayList<>();
if(CutEnum.CN.getValue().equals(cut)){
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(valueTemp)).collect(Collectors.toList());
}else{
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(valueTemp)).collect(Collectors.toList());
}
valueId += collect.get(0).getItemValue() + ",";
}
}
if (StringUtils.isNotBlank(valueId)) {
value = valueId.substring(0, valueId.length() - 1);
}
}
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldShowType)) {
value = value.replaceAll("/","-");
//单选日期
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//a判断是否是单日期选择
if (StringUtils.isNotBlank(value) && value.contains(",")) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为单日期选项, ";
}else{
errorMsg += key + " Is single date option, ";
}
countError++;
}
//判断格式是否正确
if (!DateUtils.isValidDate((String) value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}else{
errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}
countError++;
}
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldShowType)) {
//多选日期
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//判断格式是否正确
if (!DateUtils.isValidDate((String) value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}else{
errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}
countError++;
}
} else if (FieldTypeEnum.FILE.getValue().equals(fieldShowType)) {
//文件
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{
errorMsg += key + " Can not be more than " + dbLength + " char, ";
}
countError++;
}
if (StringUtils.isNotBlank(value)) {
StringBuilder sb = new StringBuilder();
for (String fileName : value.split(",")) {
List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,cut,errorMsg,null,key,key);
if (nowFileList.size() == 0) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + " 压缩包中没有" + fileName + "文件, ";
}else{
errorMsg += key + " Not in the zip package" + fileName + "file, ";
}
countError++;
} else {
try {
FileInputStream input = new FileInputStream(nowFileList.get(0));
MultipartFile multipartFile =
new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input);
//文件存入文件表
OSSFile ossFile = iOSSFileService.uploadLocalOfCos(multipartFile, "", null,null);
if (ObjectUtils.isNotEmpty(ossFile)) {
sb.append(ossFile.getId() + ",");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
if (StringUtils.isNotBlank(sb)) {
String substring = sb.substring(0, sb.length() - 1);
value = substring;
}
}
} else if (FieldTypeEnum.STANDARD.getValue().equals(fieldShowType)) {
//标准选择
//判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, ";
}else{
errorMsg += key + " This parameter is mandatory and cannot be empty, ";
}
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{
errorMsg += key + " Can not be more than " + dbLength + " char, ";
}
countError++;
}
//判断库中是否存在,如果存在则存id,如果不存在则存输入的值
// List<Map<String, Object>> listBySerialNumber = getListBySerialNumber(value); // List<Map<String, Object>> listBySerialNumber = getListBySerialNumber(value);
// String serialNumberStr = ""; // String serialNumberStr = "";
// StringBuilder sb = new StringBuilder(); // StringBuilder sb = new StringBuilder();
@@ -6231,14 +6358,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
// } // }
// value = substring; // value = substring;
// } // }
}
} }
} }
}
// if (countError > 0) { // if (countError > 0) {
// msgList.add(errorMsg); // msgList.add(errorMsg);
// } // }
mapResult.put(field, value); mapResult.put(field, value);
}
} }
if (countError > 0) { if (countError > 0) {
if(errorMsg.endsWith(", ")){ if(errorMsg.endsWith(", ")){
@@ -16,8 +16,11 @@ import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.DateUtils; import com.jero.common.util.DateUtils;
import com.jero.common.util.oss.CosBootUtil; import com.jero.common.util.oss.CosBootUtil;
import com.jero.modules.document.entity.BussDocumentLibraryEO; import com.jero.modules.document.entity.BussDocumentLibraryEO;
import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
import com.jero.modules.document.enums.ImplementationTypeEnum;
import com.jero.modules.document.enums.LawsStateEnum; import com.jero.modules.document.enums.LawsStateEnum;
import com.jero.modules.document.service.IBussDocumentLibraryEOService; import com.jero.modules.document.service.IBussDocumentLibraryEOService;
import com.jero.modules.document.service.IPhasedImplementationDetailsEOService;
import com.jero.modules.dummy.entity.DummyInventoryBaseEO; import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
import com.jero.modules.dummy.entity.DummyInventoryInfoEO; import com.jero.modules.dummy.entity.DummyInventoryInfoEO;
import com.jero.modules.dummy.entity.DummyInventoryInfoEOEn; import com.jero.modules.dummy.entity.DummyInventoryInfoEOEn;
@@ -98,6 +101,8 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
private DummyInventoryBaseEOServiceImpl dummyInventoryBaseEOService; private DummyInventoryBaseEOServiceImpl dummyInventoryBaseEOService;
@Autowired @Autowired
SysCategoryMapper sysCategoryMapper; SysCategoryMapper sysCategoryMapper;
@Autowired
private IPhasedImplementationDetailsEOService phasedImplementationDetailsEOService;
@Override @Override
public IPage<DummyInventoryInfoEO> getPageInfo(DummyInventoryInfoEO dummyInventoryInfoEO,HttpServletRequest req) { public IPage<DummyInventoryInfoEO> getPageInfo(DummyInventoryInfoEO dummyInventoryInfoEO,HttpServletRequest req) {
@@ -401,6 +406,52 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
queryWrapper.orderByDesc("create_time","serial_number"); queryWrapper.orderByDesc("create_time","serial_number");
} }
if(StringUtils.isNotEmpty(dummyInventoryInfoEO.getImplementTimeString())){
String[] implementTimeArr = dummyInventoryInfoEO.getImplementTimeString().split(",");
QueryWrapper<PhasedImplementationDetailsEO> phasedDetailsQueryWrap = new QueryWrapper<>();
phasedDetailsQueryWrap.lambda().like(PhasedImplementationDetailsEO::getImplementationType,ImplementationTypeEnum.CAR_IN_PRODUCTION.getItemValue());
phasedDetailsQueryWrap.lambda().ge(PhasedImplementationDetailsEO::getImplementationDate,implementTimeArr[0]);
phasedDetailsQueryWrap.lambda().le(PhasedImplementationDetailsEO::getImplementationDate,implementTimeArr[1]);
List<String> bussDocumentLibraryIdList = this.phasedImplementationDetailsEOService.list(phasedDetailsQueryWrap)
.stream().map(PhasedImplementationDetailsEO::getBussDocumentLibraryId).collect(Collectors.toList());
queryWrapper.and(query -> {
query.and(q -> {
q.lambda().ge(DummyInventoryInfoEO::getImplementTime,implementTimeArr[0]);
q.lambda().le(DummyInventoryInfoEO::getImplementTime,implementTimeArr[1]);
});
if(CollectionUtils.isNotEmpty(bussDocumentLibraryIdList)){
query.or(q -> {
q.lambda().in(DummyInventoryInfoEO::getBussDocumentLibraryId,bussDocumentLibraryIdList);
});
}
});
}
if(StringUtils.isNotEmpty(dummyInventoryInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String())){
String[] newCarTimeArr = dummyInventoryInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String().split(",");
QueryWrapper<PhasedImplementationDetailsEO> phasedDetailsQueryWrap = new QueryWrapper<>();
phasedDetailsQueryWrap.lambda().like(PhasedImplementationDetailsEO::getImplementationType,ImplementationTypeEnum.NEW_CAR_MODEL.getItemValue());
phasedDetailsQueryWrap.lambda().ge(PhasedImplementationDetailsEO::getImplementationDate,newCarTimeArr[0]);
phasedDetailsQueryWrap.lambda().le(PhasedImplementationDetailsEO::getImplementationDate,newCarTimeArr[1]);
List<String> bussDocumentLibraryIdList = this.phasedImplementationDetailsEOService.list(phasedDetailsQueryWrap)
.stream().map(PhasedImplementationDetailsEO::getBussDocumentLibraryId).collect(Collectors.toList());
queryWrapper.and(query -> {
query.and(q -> {
q.lambda().ge(DummyInventoryInfoEO::getXin1Che1Xing2Shi2Shi1Ri4Qi1,newCarTimeArr[0]);
q.lambda().le(DummyInventoryInfoEO::getXin1Che1Xing2Shi2Shi1Ri4Qi1,newCarTimeArr[1]);
});
if(CollectionUtils.isNotEmpty(bussDocumentLibraryIdList)){
query.or(q -> {
q.lambda().in(DummyInventoryInfoEO::getBussDocumentLibraryId,bussDocumentLibraryIdList);
});
}
});
}
List<DummyInventoryInfoEO> dummyInventoryInfoEOList = this.list(queryWrapper); List<DummyInventoryInfoEO> dummyInventoryInfoEOList = this.list(queryWrapper);
log.info("一阶段消耗时间:" + (System.currentTimeMillis() - startTime)); log.info("一阶段消耗时间:" + (System.currentTimeMillis() - startTime));
//数据字典 //数据字典
@@ -412,6 +463,9 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
log.info("三阶段消耗时间:" + (System.currentTimeMillis() - startTime)); log.info("三阶段消耗时间:" + (System.currentTimeMillis() - startTime));
treeDict(dummyInventoryInfoEO, dummyInventoryInfoEOList,sysDictItems); treeDict(dummyInventoryInfoEO, dummyInventoryInfoEOList,sysDictItems);
// 数据处理
this.disposeData(dummyInventoryInfoEOList,dummyInventoryInfoEO.getCut());
//表头排序 //表头排序
dummyInventoryInfoEOList = hearSort(orderBy, orderByField, dummyInventoryInfoEOList); dummyInventoryInfoEOList = hearSort(orderBy, orderByField, dummyInventoryInfoEOList);
@@ -419,6 +473,68 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
return dummyInventoryInfoEOList; return dummyInventoryInfoEOList;
} }
/**
* 数据处理
* @param datas
* @param cut
*/
private void disposeData(List<DummyInventoryInfoEO> datas, String cut) {
if(CollectionUtils.isNotEmpty(datas)){
List<String> bussDocumentLibraryIdList = datas.stream().map(DummyInventoryInfoEO::getBussDocumentLibraryId).distinct().collect(Collectors.toList());
QueryWrapper<PhasedImplementationDetailsEO> phasedDetailsQueryWrap = new QueryWrapper<>();
phasedDetailsQueryWrap.lambda().in(PhasedImplementationDetailsEO::getBussDocumentLibraryId,bussDocumentLibraryIdList);
List<PhasedImplementationDetailsEO> phasedDetailsList = this.phasedImplementationDetailsEOService.list(phasedDetailsQueryWrap);
// 新车型分阶段实施数据信息
List<PhasedImplementationDetailsEO> newCarModelPhasedDetailsList = phasedDetailsList.stream().filter(phasedDetails -> {
boolean flag = false;
if(StringUtils.contains(phasedDetails.getImplementationType(), ImplementationTypeEnum.NEW_CAR_MODEL.getItemValue())){
flag = true;
}
return flag;
}).collect(Collectors.toList());
// 在产车分阶段实施数据信息
List<PhasedImplementationDetailsEO> carInProductionPhasedDetailsList = phasedDetailsList.stream().filter(phasedDetails -> {
boolean flag = false;
if(StringUtils.contains(phasedDetails.getImplementationType(), ImplementationTypeEnum.CAR_IN_PRODUCTION.getItemValue())){
flag = true;
}
return flag;
}).collect(Collectors.toList());
for (DummyInventoryInfoEO data : datas) {
// 处理新车型实施日期展示
List<Date> newCarModelDateList = newCarModelPhasedDetailsList.stream().filter(phasedDetails -> {
boolean flag = false;
if (StringUtils.equals(phasedDetails.getBussDocumentLibraryId(), data.getBussDocumentLibraryId())) {
flag = true;
}
return flag;
}).map(PhasedImplementationDetailsEO::getImplementationDate).collect(Collectors.toList());
if(data.getXin1Che1Xing2Shi2Shi1Ri4Qi1() != null){
newCarModelDateList.add(data.getXin1Che1Xing2Shi2Shi1Ri4Qi1());
}
String newCarModelDateStr = DateUtils.formatDateList(newCarModelDateList);
data.setXin1Che1Xing2Shi2Shi1Ri4Qi1String(newCarModelDateStr);
// 处理在产车实施日期展示
List<Date> carInProductionDateList = carInProductionPhasedDetailsList.stream().filter(phasedDetails -> {
boolean flag = false;
if (StringUtils.equals(phasedDetails.getBussDocumentLibraryId(), data.getBussDocumentLibraryId())) {
flag = true;
}
return flag;
}).map(PhasedImplementationDetailsEO::getImplementationDate).collect(Collectors.toList());
if(data.getImplementTime() != null){
carInProductionDateList.add(data.getImplementTime());
}
String carInProductionDateStr = DateUtils.formatDateList(carInProductionDateList);
data.setImplementTimeString(carInProductionDateStr);
}
}
}
private List<DummyInventoryInfoEO> hearSort(String orderBy, String orderByField, List<DummyInventoryInfoEO> dummyInventoryInfoEOList) { private List<DummyInventoryInfoEO> hearSort(String orderBy, String orderByField, List<DummyInventoryInfoEO> dummyInventoryInfoEOList) {
if(ObjectUtils.isNotEmpty(orderByField)){ if(ObjectUtils.isNotEmpty(orderByField)){
Collator comparator = Collator.getInstance(Locale.CHINESE); Collator comparator = Collator.getInstance(Locale.CHINESE);
@@ -72,6 +72,26 @@
v-model="queryParam.subtitle"></j-input> v-model="queryParam.subtitle"></j-input>
</div> </div>
</a-col> </a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('vehicleInProductionDate')">
<span>{{$t('vehicleInProductionDate')}}</span>
</div>
<a-range-picker class="box-input" v-model="queryParam.implementTimeString"
@change="onChangedate"></a-range-picker>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('StandardImplementationDate')">
<span>{{$t('StandardImplementationDate')}}</span>
</div>
<a-range-picker class="box-input" v-model="queryParam.xin1Che1Xing2Shi2Shi1Ri4Qi1String"
@change="onChangedatet"></a-range-picker>
</div>
</a-col>
</template>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons"> <span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<globalAdvancedQuery ref="globalAdvancedQueryRef" <globalAdvancedQuery ref="globalAdvancedQueryRef"
@@ -79,6 +99,10 @@
:fieldList="fieldList"/> :fieldList="fieldList"/>
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button> <a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button> <a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ !toggleSearchStatus ? $t('open') : $t('away') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
@@ -328,6 +352,7 @@
title: '维护虚拟清单', title: '维护虚拟清单',
queryParam: {}, queryParam: {},
components: {}, components: {},
toggleSearchStatus: false,
visibleFile: false, visibleFile: false,
transferList: false, transferList: false,
orderBy: '1', orderBy: '1',
@@ -439,14 +464,16 @@
title: this.$t('ImplementationDate'), title: this.$t('ImplementationDate'),
align: 'left', align: 'left',
width: 200, width: 200,
dataIndex: 'xin1Che1Xing2Shi2Shi1Ri4Qi1', dataIndex: 'xin1Che1Xing2Shi2Shi1Ri4Qi1String',
scopedSlots: { customRender: 'titleName' },
ellipsis: true ellipsis: true
}, },
{ {
title: this.$t('vehicleInProductionDate'), title: this.$t('vehicleInProductionDate'),
align: 'left', align: 'left',
width: 220, width: 220,
dataIndex: 'implementTime', dataIndex: 'implementTimeString',
scopedSlots: { customRender: 'titleName' },
ellipsis: true ellipsis: true
}, },
{ {
@@ -981,7 +1008,7 @@
name: this.$t('ImplementationDate'), name: this.$t('ImplementationDate'),
headFieldCn:'标准实施日期', headFieldCn:'标准实施日期',
headFieldEn:'New Type Execution Date', headFieldEn:'New Type Execution Date',
field: 'xin1Che1Xing2Shi2Shi1Ri4Qi1', field: 'xin1Che1Xing2Shi2Shi1Ri4Qi1String',
key: 9, key: 9,
moduleFlag:this.$route.query.title == '虚拟清单详情' ? '虚拟清单详情' : '维护清单', moduleFlag:this.$route.query.title == '虚拟清单详情' ? '虚拟清单详情' : '维护清单',
}, },
@@ -990,7 +1017,7 @@
name: this.$t('vehicleInProductionDate'), name: this.$t('vehicleInProductionDate'),
headFieldCn:'在产车实施日期', headFieldCn:'在产车实施日期',
headFieldEn:'New Vehicle Execution Date', headFieldEn:'New Vehicle Execution Date',
field: 'implementTime', field: 'implementTimeString',
key: 10, key: 10,
moduleFlag:this.$route.query.title == '虚拟清单详情' ? '虚拟清单详情' : '维护清单', moduleFlag:this.$route.query.title == '虚拟清单详情' ? '虚拟清单详情' : '维护清单',
}, },
@@ -1271,16 +1298,16 @@
text: this.$t('implementationCategory'), text: this.$t('implementationCategory'),
dictCode: 'implement_type'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框 dictCode: 'implement_type'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
}, },
{ // {
type: 'date', // type: 'date',
value: 'xin1Che1Xing2Shi2Shi1Ri4Qi1', // value: 'xin1Che1Xing2Shi2Shi1Ri4Qi1',
text: this.$t('ImplementationDate') // text: this.$t('ImplementationDate')
}, // },
{ // {
type: 'date', // type: 'date',
value: 'implementTime', // value: 'implementTime',
text: this.$t('vehicleInProductionDate') // text: this.$t('vehicleInProductionDate')
}, // },
{ {
type: 'string', type: 'string',
value: 'wvtaId', value: 'wvtaId',
@@ -1363,9 +1390,9 @@
this.getList() this.getList()
}, },
searchReset() { searchReset() {
this.queryParam = {}
this.$refs.globalAdvancedQueryRef.resetLine() this.$refs.globalAdvancedQueryRef.resetLine()
this.$refs.globalAdvancedQueryRef.emitCallback() this.$refs.globalAdvancedQueryRef.emitCallback()
this.queryParam = {}
this.getList() this.getList()
}, },
//模板下载 //模板下载
@@ -1451,6 +1478,9 @@
} }
this.getList() this.getList()
}, },
handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus
},
getHeader(){ getHeader(){
getAction('head/headCustomEO/list', { getAction('head/headCustomEO/list', {
moduleFlag: this.$route.query.title == '虚拟清单详情' ? '虚拟清单详情' : '维护清单' moduleFlag: this.$route.query.title == '虚拟清单详情' ? '虚拟清单详情' : '维护清单'
@@ -1482,6 +1512,14 @@
item.scopedSlots = { item.scopedSlots = {
customRender: 'titleName' customRender: 'titleName'
} }
}else if(item.title == '在产车实施日期'){
item.scopedSlots = {
customRender: 'titleName'
}
}else if(item.title == '标准实施日期'){
item.scopedSlots = {
customRender: 'titleName'
}
} }
else if(item.title == '清单确认状态' || item.title == '任务确认状态' || item.title == '认证级别' || item.title == 'WVTA ID' || else if(item.title == '清单确认状态' || item.title == '任务确认状态' || item.title == '认证级别' || item.title == 'WVTA ID' ||
item.title == '责任领域' || item.title == '法规工程师' || item.title == '认证工程师' || item.title == '工程接口人'){ item.title == '责任领域' || item.title == '法规工程师' || item.title == '认证工程师' || item.title == '工程接口人'){
@@ -1516,6 +1554,12 @@
}) })
}, },
getList() { getList() {
if(this.queryParam.xin1Che1Xing2Shi2Shi1Ri4Qi1String && this.queryParam.xin1Che1Xing2Shi2Shi1Ri4Qi1String instanceof Array){
this.queryParam.xin1Che1Xing2Shi2Shi1Ri4Qi1String = this.queryParam.xin1Che1Xing2Shi2Shi1Ri4Qi1String.join(',')
}
if(this.queryParam.implementTimeString && this.queryParam.implementTimeString instanceof Array){
this.queryParam.implementTimeString = this.queryParam.implementTimeString.join(',')
}
let query = { let query = {
...this.queryParam, ...this.queryParam,
...this.queryParamQuery, ...this.queryParamQuery,
@@ -1564,6 +1608,22 @@
onChange(){ onChange(){
this.selectedValue = this.checkedList this.selectedValue = this.checkedList
}, },
onChangedatet(values){
let StartTime = values[0].format('YYYY-MM-DD')
let EndTime = values[1].format('YYYY-MM-DD')
let array = []
array.push(StartTime,EndTime)
console.log(array)
this.queryParam.xin1Che1Xing2Shi2Shi1Ri4Qi1String = array
},
onChangedate(values){
let StartTime = values[0].format('YYYY-MM-DD')
let EndTime = values[1].format('YYYY-MM-DD')
let array = []
array.push(StartTime,EndTime)
console.log(array)
this.queryParam.implementTimeString = array
},
getcustomize(){ getcustomize(){
this.customizevisible = true this.customizevisible = true
}, },