Commit fa203a76 authored by suhuiguang's avatar suhuiguang

fix(监管):业务自测bug

1.审核通过后,车牌号字段未写入气瓶的carNumber字段 2.注销后,属地监管部门被清空,导致大编辑时检验必输,检验不通过,综合搜索无数据
parent d28b1d6c
package com.yeejoin.amos.boot.biz.common.annotation; package com.yeejoin.amos.boot.biz.common.annotation;
import com.baomidou.mybatisplus.annotation.TableField;
import java.lang.annotation.*; import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
...@@ -20,6 +22,20 @@ public @interface TechnicalParameter { ...@@ -20,6 +22,20 @@ public @interface TechnicalParameter {
String unit() default ""; String unit() default "";
/**
* 设备类别code
* @return 设备类别
*/
String[] equCategory() default {};
/**
* 设备品种code,设备品种配置空时代表,全部都有
* @return 设备品种
*/
String[] equDefine() default {};
enum ParamType { enum ParamType {
STRING, INTEGER, FLOAT, BIG_DECIMAL, BOOLEAN, OBJECT, DATE STRING, INTEGER, FLOAT, BIG_DECIMAL, BOOLEAN, OBJECT, DATE
} }
......
...@@ -4,13 +4,11 @@ import com.yeejoin.amos.boot.biz.common.annotation.Group; ...@@ -4,13 +4,11 @@ import com.yeejoin.amos.boot.biz.common.annotation.Group;
import com.yeejoin.amos.boot.biz.common.annotation.TechnicalParameter; import com.yeejoin.amos.boot.biz.common.annotation.TechnicalParameter;
import com.yeejoin.amos.boot.module.common.api.dto.ITechParamDefine; import com.yeejoin.amos.boot.module.common.api.dto.ITechParamDefine;
import com.yeejoin.amos.boot.module.common.api.dto.TechParamItem; import com.yeejoin.amos.boot.module.common.api.dto.TechParamItem;
import org.apache.commons.lang3.StringUtils;
import org.reflections.Reflections; import org.reflections.Reflections;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
public class TechParamUtil { public class TechParamUtil {
...@@ -33,14 +31,7 @@ public class TechParamUtil { ...@@ -33,14 +31,7 @@ public class TechParamUtil {
if (group != null && equListCode.equals(group.value())) { if (group != null && equListCode.equals(group.value())) {
for (Field field : fields) { for (Field field : fields) {
field.setAccessible(true); field.setAccessible(true);
TechnicalParameter technicalParameter = field.getAnnotation(TechnicalParameter.class); TechParamItem techParamItem = getTechParamItem(equListCode, field);
TechParamItem techParamItem = new TechParamItem();
techParamItem.setParamKey(technicalParameter.key());
techParamItem.setParamLabel(technicalParameter.label());
techParamItem.setEquListCode(equListCode);
techParamItem.setParamType(technicalParameter.type());
techParamItem.setDictCode(technicalParameter.dictCode());
techParamItem.setUnit(technicalParameter.unit());
techParamItems.add(techParamItem); techParamItems.add(techParamItem);
} }
} }
...@@ -49,6 +40,43 @@ public class TechParamUtil { ...@@ -49,6 +40,43 @@ public class TechParamUtil {
}); });
} }
private static TechParamItem getTechParamItem(String equListCode, Field field) {
TechnicalParameter technicalParameter = field.getAnnotation(TechnicalParameter.class);
TechParamItem techParamItem = new TechParamItem();
techParamItem.setParamKey(technicalParameter.key());
techParamItem.setParamLabel(technicalParameter.label());
techParamItem.setEquListCode(equListCode);
techParamItem.setParamType(technicalParameter.type());
techParamItem.setDictCode(technicalParameter.dictCode());
techParamItem.setUnit(technicalParameter.unit());
return techParamItem;
}
public static List<TechParamItem> getParamMetaList(String equListCode, String equCategoryCode, String equDefineCode) {
return techParamsMetaMap.computeIfAbsent(equListCode, (key) -> {
List<TechParamItem> techParamItems = new ArrayList<>();
for (Class<? extends ITechParamDefine> subClass : subClasses) {
Field[] fields = subClass.getDeclaredFields();
Group group = subClass.getAnnotation(Group.class);
if (group != null && equListCode.equals(group.value())) {
for (Field field : fields) {
field.setAccessible(true);
TechnicalParameter technicalParameter = field.getAnnotation(TechnicalParameter.class);
// 设备类别配置空时代表,全部都有
boolean equCategoryMatch = technicalParameter.equCategory().length == 0 || StringUtils.isEmpty(equCategoryCode) || Arrays.asList(technicalParameter.equCategory()).contains(equCategoryCode);
// 设备品种配置空时代表,全部都有
boolean equDefineMatch = technicalParameter.equDefine().length == 0 || StringUtils.isEmpty(equDefineCode) || Arrays.asList(technicalParameter.equDefine()).contains(equDefineCode);
if(equCategoryMatch && equDefineMatch) {
TechParamItem techParamItem = getTechParamItem(equListCode, field);
techParamItems.add(techParamItem);
}
}
}
}
return techParamItems;
});
}
public static Class<? extends ITechParamDefine> getParamClazz(String equListCode) { public static Class<? extends ITechParamDefine> getParamClazz(String equListCode) {
for (Class<? extends ITechParamDefine> subClass : subClasses) { for (Class<? extends ITechParamDefine> subClass : subClasses) {
Group group = subClass.getAnnotation(Group.class); Group group = subClass.getAnnotation(Group.class);
......
...@@ -602,6 +602,13 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh ...@@ -602,6 +602,13 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
jgCertificateChangeRecordEq.setProductCode(Objects.toString(object.get("factoryNum"),"")); jgCertificateChangeRecordEq.setProductCode(Objects.toString(object.get("factoryNum"),""));
jgCertificateChangeRecordEqs.add(jgCertificateChangeRecordEq); jgCertificateChangeRecordEqs.add(jgCertificateChangeRecordEq);
}); });
// 新车牌号写入
LambdaUpdateWrapper<IdxBizJgRegisterInfo> updateWrapper = new LambdaUpdateWrapper<IdxBizJgRegisterInfo>();
updateWrapper.in(IdxBizJgRegisterInfo::getRecord, collect);
updateWrapper.set(IdxBizJgRegisterInfo::getCarNumber, jgChangeVehicleRegistrationUnit.getNewCarNumber() != null ? jgChangeVehicleRegistrationUnit.getNewCarNumber() : jgChangeVehicleRegistrationUnit.getCarNumber());
idxBizJgRegisterInfoService.update(updateWrapper);
// 保存设备流水信息 // 保存设备流水信息
jgCertificateChangeRecordEqService.saveBatch(jgCertificateChangeRecordEqs); jgCertificateChangeRecordEqService.saveBatch(jgCertificateChangeRecordEqs);
......
...@@ -1005,14 +1005,6 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -1005,14 +1005,6 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
jgUseRegistrationManageService.updateBatchById(jgUseRegistrationManageList); jgUseRegistrationManageService.updateBatchById(jgUseRegistrationManageList);
} }
} else { } else {
SuperviseInfo superviseInfo = new SuperviseInfo();
superviseInfo.setOrgBranchCode("");
superviseInfo.setOrgBranchName("");
LambdaQueryWrapper<SuperviseInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SuperviseInfo::getRecord, equipIds);
superviseInfoMapper.update(superviseInfo, wrapper);
map1.put("ORG_BRANCH_CODE", "");
map1.put("ORG_BRANCH_NAME", "");
map1.put("EQU_STATE", String.valueOf(EquimentEnum.ZHUXIAO.getCode())); map1.put("EQU_STATE", String.valueOf(EquimentEnum.ZHUXIAO.getCode()));
idxBizJgUseInfoMapper.batchUpdateUseInfo(equipIds, EquimentEnum.ZHUXIAO.getCode()); idxBizJgUseInfoMapper.batchUpdateUseInfo(equipIds, EquimentEnum.ZHUXIAO.getCode());
// 修改证管理表中的证的状态 // 修改证管理表中的证的状态
......
...@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModel; ...@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -20,7 +21,7 @@ import java.util.List; ...@@ -20,7 +21,7 @@ import java.util.List;
*/ */
@Data @Data
@ApiModel(value = "JyjcInspectionResultDataModel", description = "检验检测结果数据接收") @ApiModel(value = "JyjcInspectionResultDataModel", description = "检验检测结果数据接收")
public class JyjcInspectionResultDataModel { public class JyjcInspectionResultDataModel implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.yeejoin.amos.boot.module.statistcs.biz.utils;
import com.yeejoin.amos.boot.biz.common.annotation.TechnicalParameter;
import com.yeejoin.amos.boot.module.common.api.dto.ITechParamDefine;
import org.reflections.Reflections;
import java.lang.reflect.Field;
import java.util.AbstractMap;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class TechParamUtil {
private static final Set<Class<? extends ITechParamDefine>> subClasses;
private static final ConcurrentHashMap<String, String> allTechParamsMap = new ConcurrentHashMap<>();
static {
//▼ 指定扫描包路径(根据实际项目调整)
Reflections reflections = new Reflections("com.yeejoin.amos.boot.module.common.api.dto");
//▼ 获取所有继承ITechParamsMeta的类
subClasses = reflections.getSubTypesOf(ITechParamDefine.class);
for (Class<? extends ITechParamDefine> subClass : subClasses) {
Field[] fields = subClass.getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
TechnicalParameter technicalParameter = field.getAnnotation(TechnicalParameter.class);
allTechParamsMap.put(technicalParameter.key(), technicalParameter.label());
}
}
}
/**
* 获取所有设备类型的技术参数
*
* @return result
*/
public static AbstractMap<String, String> getAllTechParams() {
return allTechParamsMap;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment