Commit d63d85f1 authored by 刘林's avatar 刘林

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

parent 94a1b9bc
...@@ -134,6 +134,9 @@ public class ESEquipmentCategoryDto { ...@@ -134,6 +134,9 @@ public class ESEquipmentCategoryDto {
@Field(type = FieldType.Text) @Field(type = FieldType.Text)
private String WHETHER_SKID_MOUNTED_PRESSURE_VESSEL; 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
...@@ -168,4 +168,7 @@ public class JgUseRegistrationDto extends BaseDto { ...@@ -168,4 +168,7 @@ public class JgUseRegistrationDto extends BaseDto {
@ApiModelProperty(value = "工程装置名称") @ApiModelProperty(value = "工程装置名称")
private String projectContraption; private String projectContraption;
@ApiModelProperty(value = "气瓶类别(0液化石油气瓶、1工业气瓶、2其他)")
private String cylinderCategory;
} }
...@@ -246,4 +246,13 @@ public class JgUseRegistration extends BaseEntity { ...@@ -246,4 +246,13 @@ public class JgUseRegistration extends BaseEntity {
*/ */
@TableField("project_contraption") @TableField("project_contraption")
private String projectContraption; private String projectContraption;
/**
* 气瓶类别(液化石油气瓶、工业气瓶、其他)
* 0:液化石油气瓶
* 1:工业气瓶
* 2:其他
*/
@TableField("cylinder_category")
private String cylinderCategory;
} }
...@@ -94,4 +94,14 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> { ...@@ -94,4 +94,14 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
List<Map<String, Object>> getElevatorModeList(@Param("equIds") List<String> equIds); List<Map<String, Object>> getElevatorModeList(@Param("equIds") List<String> equIds);
List<Map<String, Object>> getCylinderInfoList(@Param("records") List<String> records); 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 @@ ...@@ -814,4 +814,19 @@
LEFT JOIN idx_biz_jg_factory_info fi on ri."RECORD" = fi."RECORD" 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" LEFT JOIN idx_biz_jg_tech_params_vessel pv ON pv."RECORD" = ui."RECORD"
</sql> </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> </mapper>
...@@ -287,4 +287,20 @@ public class JgUseRegistrationController extends BaseController { ...@@ -287,4 +287,20 @@ public class JgUseRegistrationController extends BaseController {
map.put("useUnitCreditCode", useUnitCreditCode); map.put("useUnitCreditCode", useUnitCreditCode);
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.queryByRegistrationCode(map)); 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 ...@@ -2828,6 +2828,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
registerInfo.setProductPhoto(productPhoto); registerInfo.setProductPhoto(productPhoto);
registerInfo.setOtherAccessoriesReg(otherAccessoriesReg); registerInfo.setOtherAccessoriesReg(otherAccessoriesReg);
registerInfo.setUseOrgCode(equipInfoDto.getUseOrgCode()); registerInfo.setUseOrgCode(equipInfoDto.getUseOrgCode());
registerInfo.setCylinderCategory(data.getCylinderCategory());
if ("his".equals(equipInfoDto.getDataSource())) { if ("his".equals(equipInfoDto.getDataSource())) {
registerInfo.setEquCode(this.getEquCode(registerInfo, factoryInfo, equipInfoDto.getReceiveOrgCode())); registerInfo.setEquCode(this.getEquCode(registerInfo, factoryInfo, equipInfoDto.getReceiveOrgCode()));
} }
...@@ -3076,8 +3077,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3076,8 +3077,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
checkNotBlank(data.getProduceUnitName(), "制造单位名称不能为空;", result); checkNotBlank(data.getProduceUnitName(), "制造单位名称不能为空;", result);
checkNotBlank(data.getProduceLicenseNum(), "制造许可编号不能为空;", result); checkNotBlank(data.getProduceLicenseNum(), "制造许可编号不能为空;", result);
checkNotBlank(data.getFactoryNum(), "出厂编号/产品编码不能为空;", result); checkNotBlank(data.getFactoryNum(), "出厂编号/产品编码不能为空;", result);
if ("0".equals(data.getWhetherVehicleCylinder()) && factoryNumList.contains(data.getFactoryNum())) if ("0".equals(data.getWhetherVehicleCylinder())) {
result.append("出厂编号/产品编码不能重复;"); if (factoryNumList.contains(data.getFactoryNum())) {
result.append("出厂编号/产品编码不能重复;");
}
checkNotBlank(data.getCylinderCategory(), "气瓶分类不能为空;", result);
}
checkFactoryNumUniqueness(data.getFactoryNum(), null, result); checkFactoryNumUniqueness(data.getFactoryNum(), null, result);
checkNotBlank(data.getProduceDate(), "制造日期不能为空;", result); checkNotBlank(data.getProduceDate(), "制造日期不能为空;", result);
Optional.ofNullable(data.getProduceDate()).ifPresent(v -> checkDateFormatCorrect(v, "制造日期格式不正确;", result)); Optional.ofNullable(data.getProduceDate()).ifPresent(v -> checkDateFormatCorrect(v, "制造日期格式不正确;", result));
......
...@@ -334,7 +334,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -334,7 +334,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
this.updateOrCreateInspectionDetection(map); this.updateOrCreateInspectionDetection(map);
// 更新注册登记信息表 // 更新注册登记信息表
LambdaUpdateWrapper<IdxBizJgRegisterInfo> IdxBizJgRegLambda = new UpdateWrapper<IdxBizJgRegisterInfo>().lambda(); 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); idxBizJgRegisterInfoService.update(IdxBizJgRegLambda);
// 更新设备监管部门 // 更新设备监管部门
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo(); IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo();
...@@ -705,6 +706,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -705,6 +706,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useRegistration.setPromoter(reginParams.getUserModel().getUserId()); useRegistration.setPromoter(reginParams.getUserModel().getUserId());
useRegistration.setCreateUserId(reginParams.getUserModel().getUserId()); useRegistration.setCreateUserId(reginParams.getUserModel().getUserId());
useRegistration.setCreateUserName(reginParams.getUserModel().getUserName()); useRegistration.setCreateUserName(reginParams.getUserModel().getUserName());
useRegistration.setCylinderCategory(map.getString("cylinderCategory"));//气瓶分类
// 使用单位信息 // 使用单位信息
useRegistration.setUseUnitName(CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ? useRegistration.setUseUnitName(CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyName().split("_")[1] : company.getCompanyName()); company.getCompanyName().split("_")[1] : company.getCompanyName());
...@@ -1409,6 +1411,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1409,6 +1411,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
param.put("USC_UNIT_NAME", ""); param.put("USC_UNIT_NAME", "");
param.put("EQU_CODE", dataMap.get("equCode")); param.put("EQU_CODE", dataMap.get("equCode"));
param.put("USE_ORG_CODE", jgUseRegistration.getUseRegistrationCode()); param.put("USE_ORG_CODE", jgUseRegistration.getUseRegistrationCode());
param.put("CYLINDER_CATEGORY", dataMap.get("cylinderCategory"));
objMap.put((String) dataMap.get("equipId"), param); objMap.put((String) dataMap.get("equipId"), param);
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap); tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
} }
...@@ -3236,4 +3239,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -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 { ...@@ -200,4 +200,13 @@ public class IdxBizJgRegisterInfo extends TzsBaseEntity {
@TableField("\"WHETHER_SPHERICAL_TANK\"") @TableField("\"WHETHER_SPHERICAL_TANK\"")
private String whetherSphericalTank; private String whetherSphericalTank;
/**
* 气瓶类别(液化石油气瓶、工业气瓶、其他)
* 0:液化石油气瓶
* 1:工业气瓶
* 2:其他
*/
@TableField("\"CYLINDER_CATEGORY\"")
private String cylinderCategory;
} }
...@@ -45,4 +45,15 @@ public interface IdxBizJgRegisterInfoMapper extends BaseMapper<IdxBizJgRegisterI ...@@ -45,4 +45,15 @@ public interface IdxBizJgRegisterInfoMapper extends BaseMapper<IdxBizJgRegisterI
"GROUP BY " + "GROUP BY " +
"jui.PROJECT_CONTRAPTION") "jui.PROJECT_CONTRAPTION")
List<Map<String, Object>> getProjectContraptionList(String useUnitCreditCode); 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 @@ ...@@ -17,6 +17,24 @@
</where> </where>
GROUP BY jui.PROJECT_CONTRAPTION GROUP BY jui.PROJECT_CONTRAPTION
</select> </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> </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