Commit 44fb5774 authored by suhuiguang's avatar suhuiguang

1.需求3005开发

parent cbb8844b
package com.yeejoin.amos.boot.module.jg.api.converter;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
public class InformationSituationConverter implements Converter<String> {
private static final String TYPE_QR_CODE = "二维码";
private static final String TYPE_STAMP = "电子标签";
private static final String TYPE_NO = "无";
@Override
public Class<?> supportJavaTypeKey() {
// 实体类中对象属性类型
return String.class;
}
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
@Override
public String convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty,
GlobalConfiguration globalConfiguration) {
// 从Cell中读取数据
String cellValue = cellData.getStringValue();
// 判断Excel中的值,将其转换为预期的数值
if (TYPE_QR_CODE.equals(cellValue)) {
return "1";
} else if (TYPE_STAMP.equals(cellValue)) {
return "2";
}
return "99";
}
@Override
public CellData convertToExcelData(String o, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
// 判断实体类中获取的值,转换为Excel预期的值,并封装为CellData对象
if (o == null) {
return new CellData("");
} else if (o.equals("1")) {
return new CellData(TYPE_QR_CODE);
} else if (o.equals("2")) {
return new CellData(TYPE_STAMP);
}
return new CellData(TYPE_NO);
}
}
\ No newline at end of file
...@@ -269,6 +269,18 @@ public class EquipInfoCylinderExcelDto extends BaseDto { ...@@ -269,6 +269,18 @@ public class EquipInfoCylinderExcelDto extends BaseDto {
@ApiModelProperty(value = "热处理温度(℃)") @ApiModelProperty(value = "热处理温度(℃)")
private String qpHeatTreatmentTemperature; private String qpHeatTreatmentTemperature;
/**
* 信息化管理字段-信息化管理情况
*/
@ExcelProperty(value = "信息化管理情况",index = 53, converter = InformationSituationConverter.class)
private String informationSituation;
/**
* 信息化管理字段-二维码或者电子标签编号
*/
@ExcelProperty(value = "二维码或者电子标签编号",index = 54)
private String informationManageCode;
@ExcelIgnore @ExcelIgnore
private List fileData; private List fileData;
} }
\ No newline at end of file
...@@ -177,7 +177,7 @@ public class PressureVesselListener extends AnalysisEventListener<EquipInfoCylin ...@@ -177,7 +177,7 @@ public class PressureVesselListener extends AnalysisEventListener<EquipInfoCylin
} }
private void checkInspectOrg(String inspectOrgCode){ private void checkInspectOrg(String inspectOrgCode){
List<Map<String, Object>> InspectOrgList = commonService.getAllInspectionInfo("inspection"); List<Map<String, Object>> InspectOrgList = commonService.getAllInspectionInfo("检验检测机构");
if (findUseCode(InspectOrgList, inspectOrgCode) == null) { if (findUseCode(InspectOrgList, inspectOrgCode) == null) {
result.append("未查询到该检验机构"); result.append("未查询到该检验机构");
} }
......
...@@ -791,7 +791,7 @@ public class CommonServiceImpl implements ICommonService { ...@@ -791,7 +791,7 @@ public class CommonServiceImpl implements ICommonService {
@Override @Override
public List<Map<String, Object>> getAllInspectionInfo(String type) { public List<Map<String, Object>> getAllInspectionInfo(String type) {
List<Map<String, Object>> unitList = new ArrayList<>(); List<Map<String, Object>> unitList = new ArrayList<>();
if ("inspection".equals(type)) { if ("检验检测机构".equals(type)) {
Systemctl.dictionarieClient.dictValues("OLD_INSPECTION_TESTING_UNIT").getResult() Systemctl.dictionarieClient.dictValues("OLD_INSPECTION_TESTING_UNIT").getResult()
.forEach(x -> convertAndAddToUnitList(x, unitList)); .forEach(x -> convertAndAddToUnitList(x, unitList));
} }
......
...@@ -499,7 +499,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -499,7 +499,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
equipInfoMap.put("EQU_CODE_TYPE", "1"); equipInfoMap.put("EQU_CODE_TYPE", "1");
equipInfoMap.put("SUPERVISORY_CODE", null); equipInfoMap.put("SUPERVISORY_CODE", null);
equipInfoMap.put("CAR_NUMBER", null); equipInfoMap.put("CAR_NUMBER", null);
equIpClassMap.put("CAR_NUMBER", null); // 气瓶的部分信息赋空
equipInfoMap.put("INFORMATION_SITUATION", null);
equipInfoMap.put("INFORMATION_MANAGE_CODE", null);
equipInfoMap.put("CYLINDER_STAMP_ATTACHMENT", null);
} }
return resultMap; return resultMap;
} }
...@@ -984,9 +987,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -984,9 +987,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (!ValidationUtil.isEmpty(fieldType)) { if (!ValidationUtil.isEmpty(fieldType)) {
otherInfoMap = Bean.BeantoMap(otherInfo); otherInfoMap = Bean.BeantoMap(otherInfo);
otherInfoMap.put("otherinfoSeq", otherInfo.getSequenceNbr()); otherInfoMap.put("otherinfoSeq", otherInfo.getSequenceNbr());
otherInfoMap.put("cylinderStampAttachment", JSON.parse(otherInfo.getCylinderStampAttachment()));
} else { } else {
otherInfoMap = convertCamelToUnderscore(otherInfo, null); otherInfoMap = convertCamelToUnderscore(otherInfo, null);
otherInfoMap.put("OTHERINFO_SEQ", otherInfo.getSequenceNbr()); otherInfoMap.put("OTHERINFO_SEQ", otherInfo.getSequenceNbr());
otherInfoMap.put("CYLINDER_STAMP_ATTACHMENT", JSON.parse(otherInfo.getCylinderStampAttachment()));
} }
if (!otherInfoMap.isEmpty()) { if (!otherInfoMap.isEmpty()) {
Map<String, Object> filterMap = otherInfoMap.entrySet() Map<String, Object> filterMap = otherInfoMap.entrySet()
...@@ -2368,6 +2373,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2368,6 +2373,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 96333码和监管码置空 // 96333码和监管码置空
otherInfo.setCode96333(null); otherInfo.setCode96333(null);
otherInfo.setSupervisoryCode(null); otherInfo.setSupervisoryCode(null);
otherInfo.setCylinderStampAttachment(null);
otherInfo.setInformationSituation(null);
otherInfo.setInformationManageCode(null);
} }
iIdxBizJgOtherInfoService.saveOrUpdateData(otherInfo); iIdxBizJgOtherInfoService.saveOrUpdateData(otherInfo);
...@@ -3082,6 +3090,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3082,6 +3090,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
checkNotBlank(data.getSingleBottleVolume(), "单瓶容积不能为空;", result); checkNotBlank(data.getSingleBottleVolume(), "单瓶容积不能为空;", result);
checkNotBlank(data.getChargingMedium(), "充装介质不能为空;", result); checkNotBlank(data.getChargingMedium(), "充装介质不能为空;", result);
checkNotBlank(data.getNominalWorkingPressure(), "公称工作压力不能为空;", result); checkNotBlank(data.getNominalWorkingPressure(), "公称工作压力不能为空;", result);
checkNotBlank(data.getInformationSituation(), "信息化管理情况(二维码、电子标签、无)不能为空;", result);
// 信息化管理情况校验
checkInformatManageInfo(data, result);
// 如果存在错误信息,则抛出 BadRequest 异常 // 如果存在错误信息,则抛出 BadRequest 异常
if (result.length() > 0) { if (result.length() > 0) {
result.insert(0, "Excel第[" + rowIndex + "]行 -> "); result.insert(0, "Excel第[" + rowIndex + "]行 -> ");
...@@ -3094,6 +3105,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3094,6 +3105,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return result; return result;
} }
private void checkInformatManageInfo(EquipInfoCylinderExcelDto data, StringBuilder result) {
// 非车用气瓶时(0)时且信息化管理情况非无时检验二维码编号/电子标签编号必填
if(data.getInformationSituation() != null && !"99".equals(data.getInformationSituation()) && "0".equals(data.getWhetherVehicleCylinder())){
checkNotBlank(data.getInformationManageCode(), "二维码编号/电子标签编号不能为空;", result);
}
}
private void checkEquCodeUniqueness(String equCode, StringBuilder result) { private void checkEquCodeUniqueness(String equCode, StringBuilder result) {
// 根据设备代码检查唯一性 // 根据设备代码检查唯一性
LambdaQueryWrapper<RegistrationInfo> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<RegistrationInfo> wrapper = new LambdaQueryWrapper<>();
...@@ -3112,7 +3130,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3112,7 +3130,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
private void checkInspectOrg(String inspectOrgCode, StringBuilder result) { private void checkInspectOrg(String inspectOrgCode, StringBuilder result) {
List<Map<String, Object>> InspectOrgList = commonService.getAllInspectionInfo("inspection"); List<Map<String, Object>> InspectOrgList = commonService.getAllInspectionInfo("检验检测机构");
if (findUseCode(InspectOrgList, inspectOrgCode) == null) { if (findUseCode(InspectOrgList, inspectOrgCode) == null) {
result.append("未查询到该检验机构;"); result.append("未查询到该检验机构;");
} }
......
...@@ -111,4 +111,23 @@ public class IdxBizJgOtherInfo extends TzsBaseEntity { ...@@ -111,4 +111,23 @@ public class IdxBizJgOtherInfo extends TzsBaseEntity {
@TableField("\"EDIT_STATUS\"") @TableField("\"EDIT_STATUS\"")
private String editStatus; private String editStatus;
/**
* 信息化管理情况:1-二维码;2-电子标签;99-无
*/
@TableField(value = "\"INFORMATION_SITUATION\"")
private String informationSituation;
/**
* 信息化管理二维码或者电子标签编号
*/
@TableField(value = "\"INFORMATION_MANAGE_CODE\"")
private String informationManageCode;
/**
* 气瓶钢印标识
*/
@TableField(value = "\"CYLINDER_STAMP_ATTACHMENT\"")
private String cylinderStampAttachment;
} }
...@@ -64,5 +64,24 @@ public class OtherInfo extends AbstractEquipBaseEntity { ...@@ -64,5 +64,24 @@ public class OtherInfo extends AbstractEquipBaseEntity {
@TableField(value ="\"SUPERVISORY_CODE\"") @TableField(value ="\"SUPERVISORY_CODE\"")
private String supervisoryCode; private String supervisoryCode;
/**
* 信息化管理情况:1-二维码;2-电子标签;99-无
*/
@TableField(value = "\"INFORMATION_SITUATION\"")
private String informationSituation;
/**
* 信息化管理二维码或者电子标签编号
*/
@TableField(value = "\"INFORMATION_MANAGE_CODE\"")
private String informationManageCode;
/**
* 气瓶钢印标识
*/
@TableField(value = "\"CYLINDER_STAMP_ATTACHMENT\"")
private String cylinderStampAttachment;
} }
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