Commit d63d85f1 authored by 刘林's avatar 刘林

fix(jg):气瓶添加气瓶分类

parent 94a1b9bc
......@@ -134,6 +134,9 @@ public class ESEquipmentCategoryDto {
@Field(type = FieldType.Text)
private String WHETHER_SKID_MOUNTED_PRESSURE_VESSEL;
@Field(type = FieldType.Text)
private String CYLINDER_CATEGORY;
/**
* 问题状态
*/
......
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 CylinderCategoryConverter implements Converter<String> {
private static final String LPG_CYLINDER = "液化石油气瓶";
private static final String INDUSTRY_CYLINDER = "工业气瓶";
private static final String OTHER = "其他";
@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 (LPG_CYLINDER.equals(cellValue)) {
return "0";
} else if (INDUSTRY_CYLINDER.equals(cellValue)) {
return "1";
}else if (OTHER.equals(cellValue)){
return "2";
}
return null;
}
@Override
public CellData convertToExcelData(String o, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
// 判断实体类中获取的值,转换为Excel预期的值,并封装为CellData对象
if (o == null) {
return new CellData("");
} else if (o.equals("0")) {
return new CellData(LPG_CYLINDER);
} else if (o.equals("1")) {
return new CellData(INDUSTRY_CYLINDER);
}else if (o.equals("2")) {
return new CellData(OTHER);
}
return new CellData("");
}
}
\ No newline at end of file
......@@ -61,224 +61,228 @@ public class EquipInfoCylinderExcelDto extends BaseDto {
@ExcelProperty(value = "设备代码", index = 6)
private String equCode;//判断是否必填和位数
@ApiModelProperty(value = "气瓶分类")
@ExcelProperty(value = "气瓶分类", index = 7, converter = CylinderCategoryConverter.class)
private String cylinderCategory;
@ApiModelProperty(value = "设备总价值(万元)")
@ExcelProperty(value = "设备总价值(万元)", index = 7)
@ExcelProperty(value = "设备总价值(万元)", index = 8)
@NotBlank(message = "设备总价值(万元)不能为空")
private String equPrice;
//设计信息
@ApiModelProperty(value = "设计单位统一社会信用代码")
@ExcelProperty(value = "设计单位统一社会信用代码", index = 8)
@ExcelProperty(value = "设计单位统一社会信用代码", index = 9)
@NotBlank(message = "设计单位统一社会信用代码不能为空")
private String designUnitCreditCode;
@ApiModelProperty(value = "设计单位名称")
@ExcelProperty(value = "设计单位名称", index = 9)
@ExcelProperty(value = "设计单位名称", index = 10)
@NotBlank(message = "设计单位名称不能为空")
private String designUnitName;
@ApiModelProperty(value = "设计许可编号")
@ExcelProperty(value = "设计许可编号", index = 10)
@ExcelProperty(value = "设计许可编号", index = 11)
private String designLicenseNum;
@ApiModelProperty(value = "设计使用年限(年)")
@ExcelProperty(value = "设计使用年限(年)", index = 11)
@ExcelProperty(value = "设计使用年限(年)", index = 12)
private String designUseDate;
@ApiModelProperty(value = "设计日期")
@ExcelProperty(value = "设计日期", index = 12)
@ExcelProperty(value = "设计日期", index = 13)
@DateTimeFormat("yyyy-MM-dd")
private String designDate;
@ApiModelProperty(value = "总图图号")
@ExcelProperty(value = "总图图号", index = 13)
@ExcelProperty(value = "总图图号", index = 14)
private String drawingDo;
@ApiModelProperty(value = "设计文件鉴定单位")
@ExcelProperty(value = "设计文件鉴定单位", index = 14)
@ExcelProperty(value = "设计文件鉴定单位", index = 15)
private String appraisalUnit;
@ApiModelProperty(value = "设计文件鉴定日期")
@ExcelProperty(value = "设计文件鉴定日期", index = 15)
@ExcelProperty(value = "设计文件鉴定日期", index = 16)
@DateTimeFormat("yyyy-MM-dd")
private String appraisalDate;
//制造信息
@ApiModelProperty(value = "制造单位统一社会信用代码")
@ExcelProperty(value = "制造单位统一社会信用代码", index = 16)
@ExcelProperty(value = "制造单位统一社会信用代码", index = 17)
@NotBlank(message = "制造单位统一社会信用代码不能为空")
private String produceUnitCreditCode;
@ApiModelProperty(value = "制造单位名称")
@ExcelProperty(value = "制造单位名称", index = 17)
@ExcelProperty(value = "制造单位名称", index = 18)
@NotBlank(message = "制造单位名称不能为空")
private String produceUnitName;
@ApiModelProperty(value = "制造许可编号")
@ExcelProperty(value = "制造许可编号", index = 18)
@ExcelProperty(value = "制造许可编号", index = 19)
@NotBlank(message = "制造许可编号不能为空")
private String produceLicenseNum;
@ApiModelProperty(value = "出厂编号/产品编码")
@ExcelProperty(value = "出厂编号/产品编码", index = 19)
@ExcelProperty(value = "出厂编号/产品编码", index = 20)
@NotBlank(message = "出厂编号/产品编码不能为空")
private String factoryNum;
@ApiModelProperty(value = "制造日期")
@ExcelProperty(value = "制造日期", index = 20)
@ExcelProperty(value = "制造日期", index = 21)
@NotBlank(message = "制造日期不能为空")
@DateTimeFormat("yyyy-MM-dd")
private String produceDate;
@ApiModelProperty(value = "是否进口")
@ExcelProperty(value = "是否进口", index = 21, converter = ImportedConverter.class)
@ExcelProperty(value = "是否进口", index = 22, converter = ImportedConverter.class)
private String imported;
@ApiModelProperty(value = "制造国")
@ExcelProperty(value = "制造国", index = 22)
@ExcelProperty(value = "制造国", index = 23)
private String produceCountry;
//检验检测
@ApiModelProperty(value = "检测机构名称")
@ExcelProperty(value = "检测机构名称", index = 23)
@ExcelProperty(value = "检测机构名称", index = 24)
@NotBlank(message = "检测机构名称不能为空")
private String inspectOrgName;
@ApiModelProperty(value = "检测机构代码")
@ExcelProperty(value = "检测机构代码", index = 24)
@ExcelProperty(value = "检测机构代码", index = 25)
@NotBlank(message = "检测机构代码不能为空")
private String inspectOrgCode;
@ApiModelProperty(value = "检测人员名称")
@ExcelProperty(value = "检测人员名称", index = 25)
@ExcelProperty(value = "检测人员名称", index = 26)
@NotBlank(message = "检测人员名称不能为空")
private String inspectStaff;
@ApiModelProperty(value = "检测日期")
@ExcelProperty(value = "检测日期", index = 26)
@ExcelProperty(value = "检测日期", index = 27)
@NotBlank(message = "检测日期不能为空")
@DateTimeFormat("yyyy-MM-dd")
private String inspectDate;
//技术参数
@ExcelProperty(value = "额定质量(kg)", index = 27)
@ExcelProperty(value = "额定质量(kg)", index = 28)
@ApiModelProperty(value = "额定质量(kg)")
private String ratedQuality;
@ExcelProperty(value = "使用环境温度(℃)", index = 28)
@ExcelProperty(value = "使用环境温度(℃)", index = 29)
@ApiModelProperty(value = "使用环境温度(℃)")
private String ambientTemperature;
@ExcelProperty(value = "单瓶容积(m3)", index = 29)
@ExcelProperty(value = "单瓶容积(m3)", index = 30)
@ApiModelProperty(value = "单瓶容积(m3)")
@NotBlank(message = "单瓶容积(m3)不能为空")
private String singleBottleVolume;
@ExcelProperty(value = "型号", index = 30)
@ExcelProperty(value = "型号", index = 31)
@ApiModelProperty(value = "型号")
private String modelNumber;
@ExcelProperty(value = "充装介质", index = 31)
@ExcelProperty(value = "充装介质", index = 32)
@ApiModelProperty(value = "充装介质")
@NotBlank(message = "充装介质不能为空")
private String chargingMedium;
@ExcelProperty(value = "规格", index = 32)
@ExcelProperty(value = "规格", index = 33)
@ApiModelProperty(value = "规格")
private String specification;
@ExcelProperty(value = "外径", index = 33)
@ExcelProperty(value = "外径", index = 34)
@ApiModelProperty(value = "外径")
private String outsideDiameter;
@ExcelProperty(value = "壁厚", index = 34)
@ExcelProperty(value = "壁厚", index = 35)
@ApiModelProperty(value = "壁厚")
private String wallThickness;
@ExcelProperty(value = "长度", index = 35)
@ExcelProperty(value = "长度", index = 36)
@ApiModelProperty(value = "长度")
private String length;
@ExcelProperty(value = "公称工作压力(MPa)", index = 36)
@ExcelProperty(value = "公称工作压力(MPa)", index = 37)
@ApiModelProperty(value = "公称工作压力(MPa)")
@NotBlank(message = "公称工作压力(MPa)不能为空")
private String nominalWorkingPressure;
@ExcelProperty(value = "材料(管路)", index = 37)
@ExcelProperty(value = "材料(管路)", index = 38)
@ApiModelProperty(value = "材料(管路)")
private String piping;
@ExcelProperty(value = "无损检测方法(气瓶)", index = 38, converter = NondestructConverter.class)
@ExcelProperty(value = "无损检测方法(气瓶)", index = 39, converter = NondestructConverter.class)
@ApiModelProperty(value = "无损检测方法(气瓶)")
private String qpLossless;//5988
@ExcelProperty(value = "材料(瓶体)", index = 39)
@ExcelProperty(value = "材料(瓶体)", index = 40)
@ApiModelProperty(value = "材料(瓶体)")
private String bottleBody;
@ExcelProperty(value = "材料(端塞)", index = 40)
@ExcelProperty(value = "材料(端塞)", index = 41)
@ApiModelProperty(value = "材料(端塞)")
private String endPlug;
@ExcelProperty(value = "无损检测比例(管路)(%)", index = 41)
@ExcelProperty(value = "无损检测比例(管路)(%)", index = 42)
@ApiModelProperty(value = "无损检测比例(管路)(%)")
private String glRatio;
@ExcelProperty(value = "无损检测比例(气瓶)(%)", index = 42)
@ExcelProperty(value = "无损检测比例(气瓶)(%)", index = 43)
@ApiModelProperty(value = "无损检测比例(气瓶)(%)")
private String qpRatio;
@ExcelProperty(value = "无损检测方法(管路)", index = 43, converter = NondestructConverter.class)
@ExcelProperty(value = "无损检测方法(管路)", index = 44, converter = NondestructConverter.class)
@ApiModelProperty(value = "无损检测方法(管路)")
private String glLossless;
@ExcelProperty(value = "耐压实验压力(气瓶)(Mpa)", index = 44)
@ExcelProperty(value = "耐压实验压力(气瓶)(Mpa)", index = 45)
@ApiModelProperty(value = "耐压实验压力(气瓶)(Mpa)")
private String qpPressure;
@ExcelProperty(value = "耐压实验压力(管路)(Mpa)", index = 45)
@ExcelProperty(value = "耐压实验压力(管路)(Mpa)", index = 46)
@ApiModelProperty(value = "耐压实验压力(管路)(Mpa)")
private String glPressure;
@ExcelProperty(value = "气密性试验压力(气瓶)(Mpa)", index = 46)
@ExcelProperty(value = "气密性试验压力(气瓶)(Mpa)", index = 47)
@ApiModelProperty(value = "气密性试验压力(气瓶)(Mpa)")
private String qpAirTightness;
@ExcelProperty(value = "气体置换后压力(MPa)", index = 47)
@ExcelProperty(value = "气体置换后压力(MPa)", index = 48)
@ApiModelProperty(value = "气体置换后压力(MPa)")
private String displacementPressure;
@ExcelProperty(value = "热处理方式", index = 48)
@ExcelProperty(value = "热处理方式", index = 49)
@ApiModelProperty(value = "热处理方式")
private String heatTreatmentMethod;
@ExcelProperty(value = "气密性实验压力(管路)(MPa)", index = 49)
@ExcelProperty(value = "气密性实验压力(管路)(MPa)", index = 50)
@ApiModelProperty(value = "气密性实验压力(管路)(MPa)")
private String glAirTightness;
@ExcelProperty(value = "气瓶安装位置", index = 50)
@ExcelProperty(value = "气瓶安装位置", index = 51)
@ApiModelProperty(value = "气瓶安装位置")
private String installationPosition;
@ExcelProperty(value = "瓶体内含氧量(%)", index = 51)
@ExcelProperty(value = "瓶体内含氧量(%)", index = 52)
@ApiModelProperty(value = "瓶体内含氧量(%)")
private String oxygen;
@ExcelProperty(value = "热处理温度(℃)", index = 52)
@ExcelProperty(value = "热处理温度(℃)", index = 53)
@ApiModelProperty(value = "热处理温度(℃)")
private String qpHeatTreatmentTemperature;
/**
* 信息化管理字段-信息化管理情况
*/
@ExcelProperty(value = "信息化管理情况",index = 53, converter = InformationSituationConverter.class)
@ExcelProperty(value = "信息化管理情况",index = 54, converter = InformationSituationConverter.class)
private String informationSituation;
/**
* 信息化管理字段-二维码或者电子标签编号
*/
@ExcelProperty(value = "二维码或者电子标签编号",index = 54)
@ExcelProperty(value = "二维码或者电子标签编号",index = 55)
private String informationManageCode;
@ExcelIgnore
......
......@@ -168,4 +168,7 @@ public class JgUseRegistrationDto extends BaseDto {
@ApiModelProperty(value = "工程装置名称")
private String projectContraption;
@ApiModelProperty(value = "气瓶类别(0液化石油气瓶、1工业气瓶、2其他)")
private String cylinderCategory;
}
......@@ -246,4 +246,13 @@ public class JgUseRegistration extends BaseEntity {
*/
@TableField("project_contraption")
private String projectContraption;
/**
* 气瓶类别(液化石油气瓶、工业气瓶、其他)
* 0:液化石油气瓶
* 1:工业气瓶
* 2:其他
*/
@TableField("cylinder_category")
private String cylinderCategory;
}
......@@ -94,4 +94,14 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
List<Map<String, Object>> getElevatorModeList(@Param("equIds") List<String> equIds);
List<Map<String, Object>> getCylinderInfoList(@Param("records") List<String> records);
/**
* 批量更新 CYLINDER_CATEGORY 根据 equCode
*
* @param cylinderCategory 需要更新的参数列表
* @param equCodeList equCode列表
* @return 更新成功返回 true,失败返回 false
*/
Boolean updateByEquCodeList(@Param("cylinderCategory") String cylinderCategory, @Param("equCodeList") List<String> equCodeList);
}
......@@ -814,4 +814,19 @@
LEFT JOIN idx_biz_jg_factory_info fi on ri."RECORD" = fi."RECORD"
LEFT JOIN idx_biz_jg_tech_params_vessel pv ON pv."RECORD" = ui."RECORD"
</sql>
<update id="updateByEquCodeList" parameterType="java.util.Map">
UPDATE "tzs_jg_use_registration" tjur
SET tjur."cylinderCategory" = #{cylinderCategory}
WHERE tjur."sequence_nbr" IN (
SELECT tjure."equip_transfer_id"
FROM "tzs_jg_use_registration_eq" tjure
LEFT JOIN idx_biz_jg_register_info ri ON ri."RECORD" = tjure."equ_id"
WHERE ri."EQU_CODE" IN
<foreach collection="equCodeList" separator="," item="equCode" open="(" close=")">
#{equCode}
</foreach>
)
</update>
</mapper>
......@@ -287,4 +287,20 @@ public class JgUseRegistrationController extends BaseController {
map.put("useUnitCreditCode", useUnitCreditCode);
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.queryByRegistrationCode(map));
}
/**
* 根据equCode更新气瓶分类历史数据
* @param cylinderCategory 气瓶类别(0:液化石油气瓶、1:工业气瓶、2其他)
* @param equCodeList 设备代码集合
* @return o
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/updateCylinderCategory")
@ApiOperation(httpMethod = "POST", value = "根据equCode更新气瓶分类历史数据", notes = "根据equCode更新气瓶分类历史数据")
public ResponseModel<Object> handleErrorForm(@RequestParam("cylinderCategory") String cylinderCategory,
@RequestParam("equCodeList") List<String> equCodeList) {
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.updateCylinderCategoryByEquCodeBatch(cylinderCategory, equCodeList));
}
}
......@@ -2828,6 +2828,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
registerInfo.setProductPhoto(productPhoto);
registerInfo.setOtherAccessoriesReg(otherAccessoriesReg);
registerInfo.setUseOrgCode(equipInfoDto.getUseOrgCode());
registerInfo.setCylinderCategory(data.getCylinderCategory());
if ("his".equals(equipInfoDto.getDataSource())) {
registerInfo.setEquCode(this.getEquCode(registerInfo, factoryInfo, equipInfoDto.getReceiveOrgCode()));
}
......@@ -3076,8 +3077,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
checkNotBlank(data.getProduceUnitName(), "制造单位名称不能为空;", result);
checkNotBlank(data.getProduceLicenseNum(), "制造许可编号不能为空;", result);
checkNotBlank(data.getFactoryNum(), "出厂编号/产品编码不能为空;", result);
if ("0".equals(data.getWhetherVehicleCylinder()) && factoryNumList.contains(data.getFactoryNum()))
result.append("出厂编号/产品编码不能重复;");
if ("0".equals(data.getWhetherVehicleCylinder())) {
if (factoryNumList.contains(data.getFactoryNum())) {
result.append("出厂编号/产品编码不能重复;");
}
checkNotBlank(data.getCylinderCategory(), "气瓶分类不能为空;", result);
}
checkFactoryNumUniqueness(data.getFactoryNum(), null, result);
checkNotBlank(data.getProduceDate(), "制造日期不能为空;", result);
Optional.ofNullable(data.getProduceDate()).ifPresent(v -> checkDateFormatCorrect(v, "制造日期格式不正确;", result));
......
......@@ -334,7 +334,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
this.updateOrCreateInspectionDetection(map);
// 更新注册登记信息表
LambdaUpdateWrapper<IdxBizJgRegisterInfo> IdxBizJgRegLambda = new UpdateWrapper<IdxBizJgRegisterInfo>().lambda();
IdxBizJgRegLambda.eq(IdxBizJgRegisterInfo::getRecord, map.get("equipId")).set(IdxBizJgRegisterInfo::getRegisterState, this.getRegCode());
IdxBizJgRegLambda.eq(IdxBizJgRegisterInfo::getRecord, map.get("equipId"))
.set(IdxBizJgRegisterInfo::getRegisterState, this.getRegCode()).set(IdxBizJgRegisterInfo::getCylinderCategory, map.get("cylinderCategory"));
idxBizJgRegisterInfoService.update(IdxBizJgRegLambda);
// 更新设备监管部门
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo();
......@@ -705,6 +706,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useRegistration.setPromoter(reginParams.getUserModel().getUserId());
useRegistration.setCreateUserId(reginParams.getUserModel().getUserId());
useRegistration.setCreateUserName(reginParams.getUserModel().getUserName());
useRegistration.setCylinderCategory(map.getString("cylinderCategory"));//气瓶分类
// 使用单位信息
useRegistration.setUseUnitName(CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyName().split("_")[1] : company.getCompanyName());
......@@ -1409,6 +1411,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
param.put("USC_UNIT_NAME", "");
param.put("EQU_CODE", dataMap.get("equCode"));
param.put("USE_ORG_CODE", jgUseRegistration.getUseRegistrationCode());
param.put("CYLINDER_CATEGORY", dataMap.get("cylinderCategory"));
objMap.put((String) dataMap.get("equipId"), param);
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
}
......@@ -3236,4 +3239,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
@Transactional
public Object updateCylinderCategoryByEquCodeBatch(String cylinderCategory, List<String> equCodeList) {
if (idxBizJgRegisterInfoMapper.updateCylinderCategoryByEquCodeBatch(cylinderCategory, equCodeList)){
return this.baseMapper.updateByEquCodeList(cylinderCategory, equCodeList);
}
return true;
}
}
\ No newline at end of file
......@@ -200,4 +200,13 @@ public class IdxBizJgRegisterInfo extends TzsBaseEntity {
@TableField("\"WHETHER_SPHERICAL_TANK\"")
private String whetherSphericalTank;
/**
* 气瓶类别(液化石油气瓶、工业气瓶、其他)
* 0:液化石油气瓶
* 1:工业气瓶
* 2:其他
*/
@TableField("\"CYLINDER_CATEGORY\"")
private String cylinderCategory;
}
......@@ -45,4 +45,15 @@ public interface IdxBizJgRegisterInfoMapper extends BaseMapper<IdxBizJgRegisterI
"GROUP BY " +
"jui.PROJECT_CONTRAPTION")
List<Map<String, Object>> getProjectContraptionList(String useUnitCreditCode);
void updateCylinderCategoryByRecordBatch(@Param("recordList") List<String> recordList, @Param("cylinderCategory") String cylinderCategory);
/**
* 批量更新 CYLINDER_CATEGORY 根据 equCode
*
* @param cylinderCategory 需要更新的参数列表
* @param equCodeList equCode列表
* @return 更新成功返回 true,失败返回 false
*/
Boolean updateCylinderCategoryByEquCodeBatch(@Param("cylinderCategory") String cylinderCategory, @Param("equCodeList") List<String> equCodeList);
}
......@@ -17,6 +17,24 @@
</where>
GROUP BY jui.PROJECT_CONTRAPTION
</select>
<update id="updateCylinderCategoryByRecordBatch">
UPDATE idx_biz_jg_register_info
SET "CYLINDER_CATEGORY" = #{cylinderCategory}
WHERE "RECORD" IN
<foreach collection="recordList" separator="," item="record" open="(" close=")">
#{record}
</foreach>
</update>
<update id="updateCylinderCategoryByEquCodeBatch" parameterType="java.util.List">
UPDATE idx_biz_jg_register_info
SET "CYLINDER_CATEGORY" = #{cylinderCategory}
WHERE "EQU_CODE" IN
<foreach collection="equCodeList" separator="," item="equCode" open="(" close=")">
#{equCode}
</foreach>
</update>
</mapper>
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