Commit 24938828 authored by suhuiguang's avatar suhuiguang

1.新增监管端使用登记证功能

2.历史数据刷库
parent 449ccdfa
......@@ -184,6 +184,9 @@ public class JgUseRegistrationDto extends BaseDto {
@ApiModelProperty(value = " 监察处置机构代码")
private String supervisionOrgCode;
@ApiModelProperty(value = "属地监管机构代码名称")
private String supervisionOrgName;
@ApiModelProperty(value = "属地监管机构代码")
private String orgBranchCode;
......
......@@ -34,4 +34,6 @@ public interface JgChangeRegistrationTransferMapper extends BaseMapper<JgChangeR
String getEquiplistNameByEquiplist(String code);
List<String> queryForFlowingEquipList();
List<JgChangeRegistrationTransfer> getListOfPass();
}
......@@ -31,4 +31,6 @@ public interface JgChangeVehicleRegistrationUnitMapper extends BaseMapper<JgChan
List<ChangeVehicleRegistrationUnitVo> queryChangeVehicleRegistrationUnitInIds(@Param("ids") List<String> ids);
List<CompanyEquipCountDto> queryForFlowingEquipList();
List<JgChangeVehicleRegistrationUnit> getListOfPass();
}
......@@ -23,9 +23,16 @@ public interface JgUseRegistrationManageMapper extends BaseMapper<JgUseRegistrat
List<JgUseRegistrationManageDto> queryByUseUnitCreditCode(@Param("dto") JgUseRegistrationManageDto dto);
Page<JgUseRegistrationManageDto> queryForPage(@Param("page") Page<JgUseRegistrationManageDto> page,
@Param("dto") JgUseRegistrationManageDto dto,
@Param("sort") SortVo sortMap);
@Param("dto") JgUseRegistrationManageDto dto,
@Param("sort") SortVo sortMap);
Page<JgUseRegistrationManageDto> queryForPageForJG(@Param("page") Page<JgUseRegistrationManageDto> page,
@Param("dto") JgUseRegistrationManageDto dto,
@Param("sort") SortVo sortMap, @Param("orgCode") String orgCode);
Long countCertificateByReginCode(String orgCode);
......
......@@ -120,4 +120,6 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
List<Map<String, Object>> selectPieLineListByOfCanReg(@Param("projectContraptionSeqList") List<String> projectContraptionSeqList);
Integer countUseTimesForInvalid(@Param("code") Object code);
List<JgUseRegistrationDto> getListOfPass();
}
......@@ -48,4 +48,6 @@ public interface JgVehicleInformationMapper extends BaseMapper<JgVehicleInformat
List<CompanyEquipCountDto> queryForFlowingEquipList();
Integer countUseTimesForInvalid(@Param("code") Object code);
List<JgVehicleInformation> getListOfPass();
}
......@@ -137,4 +137,18 @@
and crt.audit_status in ('三级待受理', '二级待受理', '一级待受理')
and his.registration_class = '移装变更登记'
</select>
<select id="getListOfPass"
resultType="com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationTransfer">
SELECT
u.sequence_nbr,
u.use_registration_code,
h.change_data::json->>'orgBranchCode' as remark
FROM
"tzs_jg_change_registration_transfer" u,
tzs_jg_registration_history h
where
u.status='已完成'
and u.apply_no = h.current_document_id
</select>
</mapper>
......@@ -126,5 +126,18 @@
and a.status in ('三级待受理', '二级待受理', '一级待受理')
GROUP BY a.use_unit_credit_code
</select>
<select id="getListOfPass"
resultType="com.yeejoin.amos.boot.module.jg.api.entity.JgChangeVehicleRegistrationUnit">
SELECT
u.sequence_nbr,
u.org_branch_code,
u.org_branch_name,
u.use_regist_code
FROM
"tzs_jg_change_vehicle_registration_unit" u
where
u.status='已完成'
</select>
</mapper>
......@@ -32,7 +32,8 @@
tjurm.use_unit_address AS useUnitAddress,
tjurm.manage_type AS manageType,
tjurm.car_number AS carNumber,
tjurm.is_scrap AS isScrap
tjurm.is_scrap AS isScrap,
tjurm.supervise_org_name
</sql>
......@@ -151,6 +152,80 @@
tjurm.rec_date DESC
</where>
</select>
<select id="queryForPageForJG" resultType="com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto">
<include refid="page_list"/>
from tzs_jg_use_registration_manage tjurm
<where>
tjurm.is_delete = 0
<if test="dto.equList != null and dto.equList != ''">
and tjurm.equ_list = #{dto.equList}
</if>
<if test="dto.equListCode != null and dto.equListCode != ''">
and tjurm.equ_list_code = #{dto.equListCode}
</if>
<if test="dto.equCategory != null and dto.equCategory != ''">
and tjurm.equ_category = #{dto.equCategory}
</if>
<if test="dto.equCategoryCode != null and dto.equCategoryCode != ''">
and tjurm.equ_category_code = #{dto.equCategoryCode}
</if>
<if test="dto.equDefine != null and dto.equDefine != ''">
and tjurm.equ_define = #{dto.equDefine}
</if>
<if test="dto.equDefineCode != null and dto.equDefineCode != ''">
and tjurm.equ_define_code = #{dto.equDefineCode}
</if>
-- 使用登记证编号
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and tjurm.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
-- 申请单号
<if test="dto.applyNo != null and dto.applyNo != ''">
and tjurm.apply_no like concat('%',#{dto.applyNo},'%')
</if>
-- 登记证书唯一码
<if test="dto.certificateNo != null and dto.certificateNo != ''">
and tjurm.certificate_no = #{dto.certificateNo}
</if>
<if test="dto.auditPassDate != null and dto.auditPassDate != ''">
and tjurm.audit_pass_date like concat('%',DATE_FORMAT(#{dto.auditPassDate},'%Y-%m-%d'),'%')
</if>
<if test="dto.certificateStatus != null and dto.certificateStatus != ''">
and tjurm.certificate_status = #{dto.certificateStatus}
</if>
<if test="dto.useUnitCreditCodeForSearch != null and dto.useUnitCreditCodeForSearch != ''">
and tjurm.use_unit_credit_code = #{dto.useUnitCreditCodeForSearch}
</if>
<if test="dto.receiveCompanyCode != null and dto.receiveCompanyCode != ''">
and tjurm.receive_company_code = #{dto.receiveCompanyCode}
</if>
-- 是否车用气瓶(whetherVehicleCylinder)= 1 ,过滤出车用气瓶使用登记证数据
<if test="dto.whetherVehicleCylinder != null and dto.whetherVehicleCylinder == 1 ">
AND tjurm.reg_type = '车用气瓶登记'
</if>
<if test="dto.isScrap != null and dto.isScrap != ''">
and tjurm.is_scrap = #{dto.isScrap}
</if>
<if test="dto.cityName != null and dto.cityName != ''">
and tjurm.equ_use_address LIKE CONCAT('%', #{dto.cityName}, '%')
</if>
<if test="dto.carNumber != null and dto.carNumber != ''">
and tjurm.car_number LIKE CONCAT('%', #{dto.carNumber}, '%')
</if>
<if test="dto.certInBusinessFlag != null and dto.certInBusinessFlag != '' and dto.certInBusinessFlag == 'false'">
and NOT EXISTS ( <include refid="useRegCertInBusiness"/> )
</if>
<if test="dto.superviseOrgCode != null and dto.superviseOrgCode != ''">
and tjurm.supervise_org_code LIKE CONCAT(#{dto.superviseOrgCode}, '%')
</if>
AND tjurm.supervise_org_code LIKE CONCAT(#{orgCode}, '%')
ORDER BY
<if test="sort != null">
tjurm.${sort.field} ${sort.sortType},
</if>
tjurm.rec_date DESC
</where>
</select>
<select id="checkUseRegCertInBusiness"
resultType="java.lang.Integer">
......
......@@ -1468,4 +1468,18 @@
AND a.status != '已作废'
)
</select>
<select id="getListOfPass" resultType="com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto">
SELECT
u.sequence_nbr,
u.supervision_org_code,
c.company_name as supervision_org_name
FROM
"tzs_jg_use_registration" u ,
privilege_company c
where
u.supervision_org_code = c.org_code
and u.is_delete = '0'
AND c.is_deleted = FALSE
and u.status='已完成'
</select>
</mapper>
......@@ -322,4 +322,17 @@
AND b.use_registration_code = #{code}
AND a.status != '已作废')
</select>
<select id="getListOfPass" resultType="com.yeejoin.amos.boot.module.jg.api.entity.JgVehicleInformation">
SELECT
u.sequence_nbr,
u.org_branch_code,
u.org_branch_name,
u.use_registration_code
FROM
"tzs_jg_vehicle_information" u
where
u.is_delete = '0'
and u.status='已完成'
</select>
</mapper>
......@@ -193,4 +193,12 @@ public class DataHandlerController extends BaseController {
dataHandlerService.restore();
return ResponseHelper.buildResponse(true);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "存量数据刷属地监管部门到证管理表", notes = "存量数据刷属地监管部门到证管理表")
@PutMapping(value = "supervise2UseRegManage")
public ResponseModel<Long> saveSupervise2UseRegManage(){
return ResponseHelper.buildResponse(dataHandlerService.saveSupervise2UseRegManage());
}
}
......@@ -161,6 +161,28 @@ public class JgUseRegistrationManageController extends BaseController {
}
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePage(page, dto, sort));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jg/page")
@ApiOperation(httpMethod = "GET", value = "分页查询", notes = "分页查询")
public ResponseModel<Page<JgUseRegistrationManageDto>> queryForPageJG(JgUseRegistrationManageDto dto,
@RequestParam(value = "sort", required = false) String sort,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<JgUseRegistrationManageDto> page = new Page<JgUseRegistrationManageDto>();
page.setCurrent(current);
page.setSize(size);
ReginParams info = getSelectedOrgInfo();
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePageForJG(page, dto, sort, info.getCompany().getOrgCode()));
}
/**
* 列表分页查询-大屏监督管理使用
*
......
......@@ -20,13 +20,11 @@ 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.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeEqDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.dto.PieLineEquipContraptionDto;
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.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.DataHandlerMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.*;
......@@ -96,6 +94,9 @@ public class DataHandlerServiceImpl {
private final JgChangeRegistrationUnitEqServiceImpl jgChangeRegistrationUnitEqService;
private final UseInfoMapper useInfoMapper;
private final TzsServiceFeignClient tzsServiceFeignClient;
private final JgChangeVehicleRegistrationUnitMapper jgChangeVehicleRegistrationUnitMapper;
private final JgChangeRegistrationTransferMapper jgChangeRegistrationTransferMapper;
private final JgUseRegistrationManageServiceImpl jgUseRegistrationManageServiceImpl;
/**
* 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式
......@@ -1110,4 +1111,65 @@ public class DataHandlerServiceImpl {
}
}
}
/**
* 存量数据刷属地监管部门到证管理表-无事务,每条可单独处理
* 1.使用登记--tzs_jg_use_registration->supervision_org_code
* 2.车用气瓶登记--tzs_jg_vehicle_information->org_branch_code|org_branch_name
* 3.车用气瓶单位变更登记--tzs_jg_change_vehicle_registration_unit>org_branch_code|org_branch_name
* 4.移装变更登记--tzs_jg_change_registration_transfer->tzs_jg_registration_history.change_data->>orgBranchCode
* 5.历史有证气瓶导入--tzs_jg_use_registration->supervision_org_code
* 6.历史有证压力管道-管道导入-工业管道--tzs_jg_use_registration->supervision_org_code
* @return 成功数量数量
*/
public Long saveSupervise2UseRegManage() {
log.info("存量数据刷属地监管部门到证管理表处理开始--->");
// 1|5|6 处理
AtomicReference<Long> dealNum = new AtomicReference<>(0L);
List<JgUseRegistrationDto> useRegistrations = useRegistrationService.getBaseMapper().getListOfPass();
useRegistrations.forEach(u->{
LambdaUpdateWrapper<JgUseRegistrationManage> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(JgUseRegistrationManage::getUseRegistrationCode,u.getUseRegistrationCode());
updateWrapper.set(JgUseRegistrationManage::getSuperviseOrgCode,u.getSupervisionOrgCode());
updateWrapper.set(JgUseRegistrationManage::getSuperviseOrgName,u.getSupervisionOrgName());
dealNum.getAndSet(dealNum.get() + 1);
jgUseRegistrationManageServiceImpl.update(updateWrapper);
});
// 2 处理
List<JgVehicleInformation> vehicleUseRegs = jgVehicleInformationService.getBaseMapper().getListOfPass();
vehicleUseRegs.forEach(u->{
LambdaUpdateWrapper<JgUseRegistrationManage> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(JgUseRegistrationManage::getUseRegistrationCode,u.getUseRegistrationCode());
updateWrapper.set(JgUseRegistrationManage::getSuperviseOrgCode,u.getOrgBranchCode());
updateWrapper.set(JgUseRegistrationManage::getSuperviseOrgName,u.getOrgBranchName());
dealNum.getAndSet(dealNum.get() + 1);
jgUseRegistrationManageServiceImpl.update(updateWrapper);
});
// 3 处理
List<JgChangeVehicleRegistrationUnit> vehicleRegistrationUnits = jgChangeVehicleRegistrationUnitMapper.getListOfPass();
vehicleRegistrationUnits.forEach(u->{
LambdaUpdateWrapper<JgUseRegistrationManage> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(JgUseRegistrationManage::getUseRegistrationCode,u.getUseRegistCode());
updateWrapper.set(JgUseRegistrationManage::getSuperviseOrgCode,u.getOrgBranchCode());
updateWrapper.set(JgUseRegistrationManage::getSuperviseOrgName,u.getOrgBranchName());
dealNum.getAndSet(dealNum.get() + 1);
jgUseRegistrationManageServiceImpl.update(updateWrapper);
});
// 4 处理
List<JgChangeRegistrationTransfer> transfers = jgChangeRegistrationTransferMapper.getListOfPass();
transfers.forEach(u->{
if(StringUtils.isNotEmpty(u.getRemark()) && u.getRemark().split("_").length > 1){
String[] orgCodeNameArray = u.getRemark().split("_");
LambdaUpdateWrapper<JgUseRegistrationManage> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(JgUseRegistrationManage::getUseRegistrationCode, u.getUseRegistrationCode());
updateWrapper.set(JgUseRegistrationManage::getSuperviseOrgCode, orgCodeNameArray[0]);
updateWrapper.set(JgUseRegistrationManage::getSuperviseOrgName, orgCodeNameArray[1]);
dealNum.getAndSet(dealNum.get() + 1);
jgUseRegistrationManageServiceImpl.update(updateWrapper);
}
});
log.info("存量数据刷属地监管部门到证管理表处理结束,处理数据数量:{}", dealNum.get());
return dealNum.get();
}
}
......@@ -284,7 +284,17 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
dto.setIsScrap("0");
}
return jgUseRegistrationManageMapper.queryForPage(page, dto, sortMap);
}
public Page<JgUseRegistrationManageDto> queryForJgUseRegistrationManagePageForJG(Page<JgUseRegistrationManageDto> page,
JgUseRegistrationManageDto dto,
String sort, String orgCode) {
SortVo sortMap = commonServiceImpl.sortFieldConversion(sort);
if (ApplicationFormTypeEnum.BF.getBusinessCode().equals(dto.getApplyType()) && (!CylinderTypeEnum.CYLINDER.getCode().equals(dto.getEquCategoryCode()) || dto.getRegType().equals(BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName()))){
dto.setCertificateStatus(null);
dto.setIsScrap("0");
}
return jgUseRegistrationManageMapper.queryForPageForJG(page, dto, sortMap, orgCode);
}
public Page<JgUseRegistrationManageDto> getRecords(Page<JgUseRegistrationManageDto> page, JgUseRegistrationManageDto dto, String cityCode) {
......
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