Commit ef8e8de4 authored by suhuiguang's avatar suhuiguang

1.

使用登记列表-增加按照属地监管部门过滤 安装告知列表-增加按照属地监管部门过滤 车用气瓶列表-增加按照属地监管部门过滤
parent 818162fe
...@@ -23,4 +23,9 @@ public class EquipmentInfoDto { ...@@ -23,4 +23,9 @@ public class EquipmentInfoDto {
private String receiveOrgCode; private String receiveOrgCode;
private String receiveOrgName; private String receiveOrgName;
private String possession; private String possession;
/**
* 属地监管部门:orgCode_名称
*/
private String orgBranchCode;
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.jg.biz.service.impl.DataHandlerServiceImpl; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.jg.biz.service.impl.DataHandlerServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -58,4 +59,14 @@ public class DataHandlerController extends BaseController { ...@@ -58,4 +59,14 @@ public class DataHandlerController extends BaseController {
public ResponseModel<Boolean> writeDataUseCodeIsNull2ProjectContraption() { public ResponseModel<Boolean> writeDataUseCodeIsNull2ProjectContraption() {
return ResponseHelper.buildResponse(dataHandlerService.writeDataUseCodeIsNull2ProjectContraption()); return ResponseHelper.buildResponse(dataHandlerService.writeDataUseCodeIsNull2ProjectContraption());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "使用登记表属地监管部门历史数据处理",notes = "supervisionOrgCode在history表json数据写入,气瓶导入页面无此字段,使用单位的属地监管部门写入")
@PutMapping(value = "/useRegistration/supervisionOrgCode")
public ResponseModel<Boolean> writeSupervisionOrgCode2UseRegister(){
dataHandlerService.writeSupervisionOrgCode2UseRegister();
return ResponseHelper.buildResponse(true);
}
} }
package com.yeejoin.amos.boot.module.jg.biz.service; package com.yeejoin.amos.boot.module.jg.biz.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgSupervisionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgSupervisionInfo;
import java.util.List; import java.util.List;
...@@ -11,7 +12,7 @@ import java.util.List; ...@@ -11,7 +12,7 @@ import java.util.List;
* @author system_generator * @author system_generator
* @date 2023-08-17 * @date 2023-08-17
*/ */
public interface IIdxBizJgSupervisionInfoService { public interface IIdxBizJgSupervisionInfoService extends IService<IdxBizJgSupervisionInfo> {
boolean saveOrUpdateData(IdxBizJgSupervisionInfo supervisionInfo); boolean saveOrUpdateData(IdxBizJgSupervisionInfo supervisionInfo);
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil; import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
...@@ -12,8 +15,11 @@ import com.yeejoin.amos.boot.module.jg.api.entity.*; ...@@ -12,8 +15,11 @@ import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum; import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum;
import com.yeejoin.amos.boot.module.ymt.api.entity.*; import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.BaseUnitLicenceMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -22,6 +28,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -22,6 +28,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -77,6 +84,11 @@ public class DataHandlerServiceImpl { ...@@ -77,6 +84,11 @@ public class DataHandlerServiceImpl {
@Resource @Resource
private ESEquipmentCategory esEquipmentCategory; private ESEquipmentCategory esEquipmentCategory;
@Resource
TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
@Autowired
private BaseUnitLicenceMapper baseUnitLicenceMapper;
/** /**
* 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式 * 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式
...@@ -462,4 +474,52 @@ public class DataHandlerServiceImpl { ...@@ -462,4 +474,52 @@ public class DataHandlerServiceImpl {
} }
return Boolean.TRUE; return Boolean.TRUE;
} }
public void writeSupervisionOrgCode2UseRegister() {
// 使用历史表补充属地监管部门字段
filledDataFromHistory();
// 查询历史登记且单位办理的数据进行刷库(历史气瓶导入,manage_type=unit and reg_type=1)
filledHisRegCylinderByUnit();
}
private void filledHisRegCylinderByUnit() {
List<JgUseRegistration> useRegistrations = useRegistrationService.list(new LambdaQueryWrapper<JgUseRegistration>()
.isNull(JgUseRegistration::getSupervisionOrgCode).eq(JgUseRegistration::getManageType, "unit").eq(JgUseRegistration::getRegType, "1").
select(BaseEntity::getSequenceNbr,JgUseRegistration::getUseUnitCreditCode));
Map<String, String> unitSuperOrgCodeMap = new ConcurrentHashMap<>();
useRegistrations.parallelStream().forEach(u->{
LambdaUpdateWrapper<JgUseRegistration> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(JgUseRegistration::getSequenceNbr, u.getSequenceNbr());
if(unitSuperOrgCodeMap.get(u.getUseUnitCreditCode()) != null){
updateWrapper.set(JgUseRegistration::getSupervisionOrgCode, unitSuperOrgCodeMap.get(u.getUseUnitCreditCode()));
} else {
TzBaseEnterpriseInfo baseEnterpriseInfo = tzBaseEnterpriseInfoMapper.selectByUseUnitCode(u.getUseUnitCreditCode());
if(baseEnterpriseInfo != null){
unitSuperOrgCodeMap.put(u.getUseUnitCreditCode(), baseEnterpriseInfo.getSuperviseOrgCode());
updateWrapper.set(JgUseRegistration::getSupervisionOrgCode, baseEnterpriseInfo.getSuperviseOrgCode());
} else {
updateWrapper.set(JgUseRegistration::getSupervisionOrgCode, null);
}
}
useRegistrationService.update(null,updateWrapper);
});
}
private void filledDataFromHistory() {
List<JgUseRegistration> useRegistrations = useRegistrationService.list(new LambdaQueryWrapper<JgUseRegistration>().isNull(JgUseRegistration::getSupervisionOrgCode).select(BaseEntity::getSequenceNbr));
useRegistrations.parallelStream().forEach(u->{
JgRegistrationHistory history = getRegistrationHistory(u.getSequenceNbr() + "");
if(history != null) {
JSONObject jsonObject = JSON.parseObject(history.getChangeData());
String orgBranchCodeWithName = jsonObject.getString("orgBranchCode");
if(orgBranchCodeWithName != null && !orgBranchCodeWithName.isEmpty()) {
u.setSupervisionOrgCode(orgBranchCodeWithName.split("_")[0]);
LambdaUpdateWrapper<JgUseRegistration> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(JgUseRegistration::getSupervisionOrgCode, u.getSupervisionOrgCode());
updateWrapper.eq(JgUseRegistration::getSequenceNbr, u.getSequenceNbr());
useRegistrationService.update(null, updateWrapper);
}
}
});
}
} }
...@@ -3674,6 +3674,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3674,6 +3674,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
List<ESEquipmentCategoryDto> esEquipmentCategoryList = new ArrayList<>(); List<ESEquipmentCategoryDto> esEquipmentCategoryList = new ArrayList<>();
List<JgUseRegistrationEq> jgRelationEquipList = new ArrayList<>(); List<JgUseRegistrationEq> jgRelationEquipList = new ArrayList<>();
List<Map<String, Object>> equipmentLists = new ArrayList<>(); List<Map<String, Object>> equipmentLists = new ArrayList<>();
List<IdxBizJgSupervisionInfo> supervisionInfoList = new ArrayList<>();
if (paramMap == null) { if (paramMap == null) {
throw new IllegalArgumentException("参数Map不能为空"); throw new IllegalArgumentException("参数Map不能为空");
...@@ -3684,6 +3685,17 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3684,6 +3685,17 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 登记证记录表主键 // 登记证记录表主键
Long changeRecordId = sequence.nextId(); Long changeRecordId = sequence.nextId();
List<EquipInfoCylinderExcelDto> equipInfoCylinderExcelDtoList = JSON.parseArray(JSON.toJSONString(attachmentUpload.get(EQU_LISTS)), EquipInfoCylinderExcelDto.class); List<EquipInfoCylinderExcelDto> equipInfoCylinderExcelDtoList = JSON.parseArray(JSON.toJSONString(attachmentUpload.get(EQU_LISTS)), EquipInfoCylinderExcelDto.class);
// 属地监管部门
String orgBranchCode;
String orgBranchName;
if(equipInfoDto.getOrgBranchCode() != null){
String[] splitOrgBranchCode = equipInfoDto.getOrgBranchCode().split("_");
orgBranchCode = splitOrgBranchCode.length > 1 ? splitOrgBranchCode[0] : "";
orgBranchName = splitOrgBranchCode.length > 1 ? splitOrgBranchCode[1] : "";
} else {
orgBranchName = "";
orgBranchCode = "";
}
equipInfoCylinderExcelDtoList.forEach(data -> { equipInfoCylinderExcelDtoList.forEach(data -> {
JgUseRegistrationEq jgRelationEquip = new JgUseRegistrationEq(); JgUseRegistrationEq jgRelationEquip = new JgUseRegistrationEq();
if ("his".equals(equipInfoDto.getDataSource()) && "1".equals(data.getWhetherVehicleCylinder())) { if ("his".equals(equipInfoDto.getDataSource()) && "1".equals(data.getWhetherVehicleCylinder())) {
...@@ -3808,6 +3820,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3808,6 +3820,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
otherInfo.setClaimStatus("已认领"); otherInfo.setClaimStatus("已认领");
otherInfoList.add(otherInfo); otherInfoList.add(otherInfo);
//监督管理信息
setSupervisionInfo(orgBranchCode, orgBranchName, record, supervisionInfoList);
// 技术参数 // 技术参数
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult(); List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataValue, Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataValue,
...@@ -3837,6 +3852,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3837,6 +3852,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
esEquipmentDto.setEQU_LIST(equipInfoDto.getEquList()); esEquipmentDto.setEQU_LIST(equipInfoDto.getEquList());
esEquipmentDto.setEQU_DEFINE_CODE(equipInfoDto.getEquDefineCode()); esEquipmentDto.setEQU_DEFINE_CODE(equipInfoDto.getEquDefineCode());
esEquipmentDto.setSUPERVISORY_CODE(otherInfo.getSupervisoryCode()); esEquipmentDto.setSUPERVISORY_CODE(otherInfo.getSupervisoryCode());
esEquipmentDto.setORG_BRANCH_CODE(orgBranchCode);
esEquipmentDto.setORG_BRANCH_NAME(orgBranchName);
esEquipmentDto.setEQU_DEFINE(equipInfoDto.getEquDefine()); esEquipmentDto.setEQU_DEFINE(equipInfoDto.getEquDefine());
esEquipmentDto.setINFORMATION_SITUATION(otherInfo.getInformationSituation()); esEquipmentDto.setINFORMATION_SITUATION(otherInfo.getInformationSituation());
esEquipmentDto.setSTATUS("已认领"); esEquipmentDto.setSTATUS("已认领");
...@@ -3942,6 +3959,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3942,6 +3959,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
jgUseRegistration.setStatus(FlowStatusEnum.TO_BE_FINISHED.getName()); jgUseRegistration.setStatus(FlowStatusEnum.TO_BE_FINISHED.getName());
jgUseRegistration.setUseRegistrationCode(jgUseRegistrationManage.getUseRegistrationCode()); jgUseRegistration.setUseRegistrationCode(jgUseRegistrationManage.getUseRegistrationCode());
jgUseRegistration.setRegType("1");//历史登记 jgUseRegistration.setRegType("1");//历史登记
jgUseRegistration.setSupervisionOrgCode(orgBranchCode);
jgUseRegistrationService.save(jgUseRegistration); jgUseRegistrationService.save(jgUseRegistration);
jgRelationEquipMapper.batchInsert(String.valueOf(jgUseRegistration.getSequenceNbr()), jgRelationEquipList); jgRelationEquipMapper.batchInsert(String.valueOf(jgUseRegistration.getSequenceNbr()), jgRelationEquipList);
...@@ -3949,9 +3967,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3949,9 +3967,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
BeanUtil.beanToMap(jgUseRegistration, objectHashMap, false, false); BeanUtil.beanToMap(jgUseRegistration, objectHashMap, false, false);
objectHashMap.put("equipmentLists", equipmentLists); objectHashMap.put("equipmentLists", equipmentLists);
objectHashMap.put("EQU_CATEGORY_CODE", equipInfoDto.getEquCategoryCode()); objectHashMap.put("EQU_CATEGORY_CODE", equipInfoDto.getEquCategoryCode());
objectHashMap.put("orgBranchCode", equipInfoDto.getOrgBranchCode());
updateHistory(objectHashMap, String.valueOf(jgUseRegistration.getSequenceNbr())); updateHistory(objectHashMap, String.valueOf(jgUseRegistration.getSequenceNbr()));
} }
Optional.of(supervisionInfoList).filter(list -> !list.isEmpty()).ifPresent(iIdxBizJgSupervisionInfoService::saveBatch);
Optional.of(useInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgUseInfoService::saveBatch); Optional.of(useInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgUseInfoService::saveBatch);
Optional.of(designInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgDesignInfoService::saveBatch); Optional.of(designInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgDesignInfoService::saveBatch);
Optional.of(registerInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgRegisterInfoService::saveBatch); Optional.of(registerInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgRegisterInfoService::saveBatch);
...@@ -3963,6 +3983,16 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3963,6 +3983,16 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return String.format("导入完成,成功导入: %d 条数据!", useInfoList.size()); return String.format("导入完成,成功导入: %d 条数据!", useInfoList.size());
} }
private static void setSupervisionInfo(String orgBranchCode, String orgBranchName, String record, List<IdxBizJgSupervisionInfo> supervisionInfoList) {
IdxBizJgSupervisionInfo supervisionInfo = new IdxBizJgSupervisionInfo();
supervisionInfo.setOrgBranchCode(orgBranchCode);
supervisionInfo.setOrgBranchName(orgBranchName);
supervisionInfo.setRecord(record);
supervisionInfo.setRecDate(new Date());
supervisionInfo.setRecUserId(RequestContext.getExeUserId());
supervisionInfoList.add(supervisionInfo);
}
/** /**
* 使用登记证编号判断是否使用未来系统生成编号 * 使用登记证编号判断是否使用未来系统生成编号
* @param useRegistrationCode 使用登记证编号 * @param useRegistrationCode 使用登记证编号
......
...@@ -807,6 +807,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -807,6 +807,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if (!ObjectUtils.isEmpty(map.get("otherAccessories"))) { if (!ObjectUtils.isEmpty(map.get("otherAccessories"))) {
useRegistration.setOtherAccessories(JSONObject.toJSONString(map.get("otherAccessories"))); useRegistration.setOtherAccessories(JSONObject.toJSONString(map.get("otherAccessories")));
} }
if (map.containsKey("orgBranchCode")) {
// 监察处置机构代码
String[] splitOrgBranchCode = String.valueOf(map.getString("orgBranchCode")).split("_");
useRegistration.setSupervisionOrgCode(splitOrgBranchCode[0]);
}
// 使用地点 // 使用地点
Map<String, List<LinkedHashMap>> locationMap = MapBuilder.<String, List<LinkedHashMap>>create() Map<String, List<LinkedHashMap>> locationMap = MapBuilder.<String, List<LinkedHashMap>>create()
......
...@@ -96,4 +96,12 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI ...@@ -96,4 +96,12 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
List<TzBaseEnterpriseInfoDto> queryByUseCode(@Param("useCodes") List<String> useCode); List<TzBaseEnterpriseInfoDto> queryByUseCode(@Param("useCodes") List<String> useCode);
List<TzBaseEnterpriseInfoDto> selectExpiringUnits(@Param("operator")String operator); List<TzBaseEnterpriseInfoDto> selectExpiringUnits(@Param("operator")String operator);
/**
* 根据企业信用代码查询企业
*
* @param useUnitCode 企业信用代码
* @return TzBaseEnterpriseInfo
*/
TzBaseEnterpriseInfo selectByUseUnitCode(String useUnitCode);
} }
...@@ -339,4 +339,7 @@ ...@@ -339,4 +339,7 @@
AND tbul.expiry_date ${operator} CURRENT_DATE AND tbul.expiry_date ${operator} CURRENT_DATE
</if> </if>
</select> </select>
<select id="selectByUseUnitCode" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo">
select * from tz_base_enterprise_info where use_unit_code = #{useUnitCode}
</select>
</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