完善市场法规库清单

This commit is contained in:
梁琦涛
2024-07-08 14:22:18 +08:00
parent f1ca5baeac
commit f7d67f44a7
6 changed files with 20 additions and 22 deletions
@@ -2837,8 +2837,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
String textValue = translateDictValue(code, text, table, key, listDict);
if(StringUtils.isBlank(textValue)){
msg.append(name).append("数据不存在;");
}else{
item.put(field.getName(), textValue);
}
}
}
@@ -2866,9 +2864,9 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
continue; //跳过循环
}
if (!org.springframework.util.StringUtils.isEmpty(table)) {
tmpValue = sysBaseAPI.queryTableDictTextByKey(table, code, text, k.trim());
tmpValue = sysBaseAPI.queryTableDictTextByKey(table, text, code, k.trim());
} else {
List<SysDictItemCore> listNew = listDict.stream().filter(o -> Objects.equals(o.getDictCode(), code) && Objects.equals(o.getItemText(), k.trim())).collect(Collectors.toList());
List<SysDictItemCore> listNew = listDict.stream().filter(o -> Objects.equals(o.getDictCode(), code) && Objects.equals(o.getItemValue(), k.trim())).collect(Collectors.toList());
if (!org.springframework.util.CollectionUtils.isEmpty(listNew)) {
tmpValue = listNew.get(0).getItemText();
}
@@ -123,7 +123,7 @@ public class LawsMarketStandardDetailExcel implements Serializable {
/**
* 国家
*/
@Excel(name = "*国家/地区", width = 15)
@Excel(name = "*国家/地区", width = 15,dicCode = "market_state")
@NotBlank(message = "国家/地区不能为空")
@ApiModelProperty(value = "国家")
@Dict(dicCode = "market_state")
@@ -132,7 +132,7 @@ public class LawsMarketStandardDetailExcel implements Serializable {
/**
* 适用车型
*/
@Excel(name = "适用车型", width = 15)
@Excel(name = "适用车型", width = 15, dicCode = "applicable_vehicle_type")
@Dict(dicCode = "applicable_vehicle_type")
@ApiModelProperty(value = "适用车型")
private String applicableVehicle;
@@ -148,7 +148,7 @@ public class LawsMarketStandardDetailExcel implements Serializable {
*/
@ApiModelProperty(value = "认证对象")
@Dict(dicCode = "authentication_object")
@Excel(name = "认证对象", width = 15)
@Excel(name = "认证对象", width = 15, dicCode = "authentication_object")
private String authenticationObject;
/**
@@ -162,7 +162,7 @@ public class LawsMarketStandardDetailExcel implements Serializable {
* 类型
*/
@Dict(dicCode = "type")
@Excel(name = "类型", width = 15)
@Excel(name = "类型", width = 15, dicCode = "type")
@ApiModelProperty(value = "类型")
private String type;
@@ -171,7 +171,7 @@ public class LawsMarketStandardDetailExcel implements Serializable {
*/
@Dict(dicCode = "dynamic_type")
@ApiModelProperty(value = "动力类型")
@Excel(name = "动力类型", width = 15)
@Excel(name = "动力类型", width = 15, dicCode = "dynamic_type")
private String dynamicType;
/**
@@ -180,7 +180,7 @@ public class LawsMarketStandardDetailExcel implements Serializable {
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
@ApiModelProperty(value = "主控部门")
@NotBlank(message = "主控部门不能为空")
@Excel(name = "*主控部门", width = 15)
@Excel(name = "*主控部门", width = 15,dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
private String mainDept;
/**
@@ -189,7 +189,7 @@ public class LawsMarketStandardDetailExcel implements Serializable {
@ApiModelProperty(value = "主控部门专业模块")
@NotBlank(message = "主控部门专业模块不能为空")
@Dict(dicCode = "professional_module")
@Excel(name = "*主控部门专业模块", width = 15)
@Excel(name = "*主控部门专业模块", width = 15, dicCode = "professional_module")
private String mainDeptProfMode;
/**
@@ -197,14 +197,14 @@ public class LawsMarketStandardDetailExcel implements Serializable {
*/
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
@ApiModelProperty(value = "关联部门")
@Excel(name = "关联部门", width = 15)
@Excel(name = "关联部门", width = 15,dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
private String associateDept;
/**
* 关联部门专业模块
*/
@ApiModelProperty(value = "关联部门专业模块")
@Excel(name = "关联部门专业模块", width = 15)
@Excel(name = "关联部门专业模块", width = 15, dicCode = "professional_module")
@Dict(dicCode = "professional_module")
private String associateDeptProfMode;
@@ -212,7 +212,7 @@ public class LawsMarketStandardDetailExcel implements Serializable {
* 批量限制
*/
@ApiModelProperty(value = "批量限制")
@Excel(name = "批量限制", width = 15)
@Excel(name = "批量限制", width = 15, dicCode = "batch_restriction")
@Dict(dicCode = "batch_restriction")
private String batchLimit;
@@ -221,7 +221,7 @@ public class LawsMarketStandardDetailExcel implements Serializable {
*/
@Dict(dicCode = "automatic_driving_level")
@ApiModelProperty(value = "自动驾驶等级")
@Excel(name = "自动驾驶等级", width = 15)
@Excel(name = "自动驾驶等级", width = 15,dicCode = "automatic_driving_level")
private String autopilotLevel;
/**
@@ -229,7 +229,7 @@ public class LawsMarketStandardDetailExcel implements Serializable {
*/
@Dict(dicCode = "requirement_type")
@ApiModelProperty(value = "要求类型")
@Excel(name = "要求类型", width = 15)
@Excel(name = "要求类型", width = 15,dicCode = "requirement_type")
private String requireType;
@@ -75,7 +75,7 @@ public class LawsMarketStandardDetailServiceImpl extends ServiceImpl<LawsMarketS
return Result.error(NOT_DATA);
}
LambdaQueryWrapper<LawsMarketStandard> queryLawsMarketStandard = new LambdaQueryWrapper<>();
queryLawsMarketStandard.eq(LawsMarketStandard::getManifestNo,lawsMarketStandardOld.getManifestNo());
queryLawsMarketStandard.eq(LawsMarketStandard::getVersionFlag,lawsMarketStandardOld.getVersionFlag());
queryLawsMarketStandard.eq(LawsMarketStandard::getManifestVersion,manifestVersion);
LawsMarketStandard lawsMarketStandard = marketStandardService.getOne(queryLawsMarketStandard,false);
if(Objects.isNull(lawsMarketStandard)){
@@ -84,6 +84,7 @@ public class LawsMarketStandardDetailServiceImpl extends ServiceImpl<LawsMarketS
manifestId = lawsMarketStandard.getId();
}
List<String> listIds = Arrays.asList(manifestId.split(","));
marketStandardDetail.setManifestId(null);
QueryWrapper<LawsMarketStandardDetail> queryWrapper =
QueryGenerator.initQueryWrapper(marketStandardDetail, request.getParameterMap());
queryWrapper.in("manifest_id",listIds);
@@ -175,7 +176,7 @@ public class LawsMarketStandardDetailServiceImpl extends ServiceImpl<LawsMarketS
// 验证标准编号
checkStandard(listIds, listStandardIds, listStandardIdRepeat, p, s);
if(!StringUtils.isBlank(s.toString())){
m.append("").append(i + 4).append("行,").append(s.toString());
m.append("").append(i + 1).append("行,").append(s.toString());
}
}
@@ -247,7 +248,7 @@ public class LawsMarketStandardDetailServiceImpl extends ServiceImpl<LawsMarketS
@Override
public void downloadTemplate(HttpServletResponse response) {
// 模板存放地址
ClassPathResource resource = new ClassPathResource("excelTemplate/导入模板-市场法规清单.xlsx");
ClassPathResource resource = new ClassPathResource("excelTemplate/导入模板-市场法规清单.xls");
try (InputStream inputStream = resource.getInputStream();
OutputStream outputStream = response.getOutputStream()
) {
@@ -330,8 +330,7 @@ public class LawsMarketStandardServiceImpl extends ServiceImpl<LawsMarketStandar
LambdaQueryWrapper<LawsMarketStandard> queryManifestNo = new LambdaQueryWrapper<>();
queryManifestNo.select(LawsMarketStandard::getManifestVersion);
queryManifestNo.isNotNull(LawsMarketStandard::getManifestNo);
queryManifestNo.eq(LawsMarketStandard::getManifestNo,manifest.getManifestNo());
queryManifestNo.eq(LawsMarketStandard::getVersionFlag,manifest.getVersionFlag());
queryManifestNo.isNotNull(LawsMarketStandard::getManifestVersion);
queryManifestNo.orderByDesc(LawsMarketStandard::getManifestVersion);
List<LawsMarketStandard> listManifestNo = list(queryManifestNo);
@@ -382,7 +381,7 @@ public class LawsMarketStandardServiceImpl extends ServiceImpl<LawsMarketStandar
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// 新数据版本设置为空,状态设置为编辑中
LambdaUpdateWrapper<LawsMarketStandard> update = new LambdaUpdateWrapper<>();
update.set(LawsMarketStandard::getManifestVersion,"");
update.set(LawsMarketStandard::getManifestVersion,null);
update.set(LawsMarketStandard::getManifestStatus,MarketStandardConstants.MANIFEST_STATUS_EDIT);
update.set(LawsMarketStandard::getUpdateTime,new Date());
update.set(LawsMarketStandard::getUpdateBy,sysUser.getUsername());