Commit cb54b46c authored by suhuiguang's avatar suhuiguang

1.西安数据补充使用单位信用代码接口

parent a180c222
...@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper; ...@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.dto.KeyValueDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jg.api.bo.JgBizCountDataBO; import com.yeejoin.amos.boot.module.jg.api.bo.JgBizCountDataBO;
import com.yeejoin.amos.boot.module.jg.api.dto.DynamicColumnDto; import com.yeejoin.amos.boot.module.jg.api.dto.DynamicColumnDto;
...@@ -32,13 +33,13 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -32,13 +33,13 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
Map<String, Object> getUserInfo(String sequenceNbr); Map<String, Object> getUserInfo(String sequenceNbr);
Map<String,Object> getEnterpriseInfo(String useCode); Map<String, Object> getEnterpriseInfo(String useCode);
List<Map<String,Object>> getCylinderStationInfo(String orgCode); List<Map<String, Object>> getCylinderStationInfo(String orgCode);
List<Map<String, Object>> getVehicleCylinderInfo(String useCode); List<Map<String, Object>> getVehicleCylinderInfo(String useCode);
List<Map<String,Object>> getEnterpriseEmployee(String unitCode); List<Map<String, Object>> getEnterpriseEmployee(String unitCode);
String getOrgCodeByCompanyCode(String companyCode); String getOrgCodeByCompanyCode(String companyCode);
...@@ -46,15 +47,16 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -46,15 +47,16 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
String selectPromoterData(String tableName, String instanceId); String selectPromoterData(String tableName, String instanceId);
void updateBusinessData(String tableName,String assignee, String transferToUserIds, String instanceId,String nextTaskId); void updateBusinessData(String tableName, String assignee, String transferToUserIds, String instanceId, String nextTaskId);
Map<String, Object> getUserPhone(String name ,String companyCode); Map<String, Object> getUserPhone(String name, String companyCode);
List<Map<String, String>> equOnJgServiceOperationRecords(String record); List<Map<String, String>> equOnJgServiceOperationRecords(String record);
/** /**
* 统计指定设备流程中的引用次数(12个流程中,非待提交、非已撤回、非已驳回) * 统计指定设备流程中的引用次数(12个流程中,非待提交、非已撤回、非已驳回)
*
* @param record 设备唯一标识 * @param record 设备唯一标识
* @return 被引用次数 > 0 则设备不可编辑 * @return 被引用次数 > 0 则设备不可编辑
*/ */
...@@ -63,6 +65,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -63,6 +65,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/** /**
* 统计设备被引用的次数(只有存在就算引用-作废除外) * 统计设备被引用的次数(只有存在就算引用-作废除外)
*
* @param record 设备唯一标识 * @param record 设备唯一标识
* @return 被引用次数 > 0 则设备不可删除 * @return 被引用次数 > 0 则设备不可删除
*/ */
...@@ -73,6 +76,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -73,6 +76,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/** /**
* 按照 地市或者区县查询所在的地市code * 按照 地市或者区县查询所在的地市code
*
* @param receiveCompanyCode 地市或者区县code * @param receiveCompanyCode 地市或者区县code
* @param exclusionIds 需要排除的区县 * @param exclusionIds 需要排除的区县
* @return 地市code * @return 地市code
...@@ -82,6 +86,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -82,6 +86,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/** /**
* 告知业务统计 * 告知业务统计
*
* @param reportAnalysisSearchDTO 条件 * @param reportAnalysisSearchDTO 条件
* @return 过程数据 * @return 过程数据
*/ */
...@@ -91,6 +96,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -91,6 +96,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/** /**
* 维保备案统计数据查询 * 维保备案统计数据查询
*
* @param reportAnalysisSearchDTO 检索条件 * @param reportAnalysisSearchDTO 检索条件
* @return List<JgBizCountDataBO> * @return List<JgBizCountDataBO>
*/ */
...@@ -98,6 +104,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -98,6 +104,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/** /**
* 登记类统计数据查询 * 登记类统计数据查询
*
* @param reportAnalysisSearchDTO 检索条件 * @param reportAnalysisSearchDTO 检索条件
* @return List<JgBizCountDataBO> * @return List<JgBizCountDataBO>
*/ */
...@@ -106,6 +113,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -106,6 +113,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/** /**
* 单位详情 * 单位详情
*
* @param companyCode * @param companyCode
* @return CompanyBo * @return CompanyBo
*/ */
...@@ -113,13 +121,15 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -113,13 +121,15 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/** /**
* 车用气瓶登记业务办理里面的 出厂编号/产品编码 要校验唯一性(产品编号在车用气瓶范围内全局唯一) * 车用气瓶登记业务办理里面的 出厂编号/产品编码 要校验唯一性(产品编号在车用气瓶范围内全局唯一)
*
* @param factoryNum * @param factoryNum
* @return * @return
*/ */
Integer checkFactoryNumUniquenessForVehicleCylinder(String factoryNum,String sequenceNbr); Integer checkFactoryNumUniquenessForVehicleCylinder(String factoryNum, String sequenceNbr);
/** /**
* 查询出厂编码是否重复 * 查询出厂编码是否重复
*
* @param factoryNum 出厂编码 * @param factoryNum 出厂编码
* @param record 设备record * @param record 设备record
* @return Integer * @return Integer
...@@ -130,26 +140,29 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -130,26 +140,29 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/** /**
* 使用登记证编号全库唯一校验 * 使用登记证编号全库唯一校验
*
* @param useRegistrationCode * @param useRegistrationCode
* @return * @return
*/ */
Integer useRegistrationCertificateAccountUnique(@Param("useRegistrationCode") String useRegistrationCode,@Param("equipId") String equipId); Integer useRegistrationCertificateAccountUnique(@Param("useRegistrationCode") String useRegistrationCode, @Param("equipId") String equipId);
/** /**
* 查询维保超期的设备 * 查询维保超期的设备
* */ */
List<Map<String, Object>> queryOutOfMaintenanceRecord(); List<Map<String, Object>> queryOutOfMaintenanceRecord();
List<Map<String, Object>> queryOutOfInspectionRecord(); List<Map<String, Object>> queryOutOfInspectionRecord();
/** /**
* 查询许可超期的企业 * 查询许可超期的企业
* */ */
List<Map<String, Object>> queryOutOfQualificationRecord(); List<Map<String, Object>> queryOutOfQualificationRecord();
/** /**
* 查询资质超期的证书 * 查询资质超期的证书
**/ **/
List<Map<String, Object>> queryOutOfCertificationRecord(); List<Map<String, Object>> queryOutOfCertificationRecord();
/** /**
* 大屏业务全过程统计已经完成的单据 * 大屏业务全过程统计已经完成的单据
* *
...@@ -158,11 +171,17 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -158,11 +171,17 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
* @return 统计数量数组 * @return 统计数量数组
*/ */
List<Long> countBizFinishedNumForDP(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countBizFinishedNumForDP(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countBizFinishedNumForDPAZGZ(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countBizFinishedNumForDPAZGZ(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countBizFinishedNumForDPJDJY(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countBizFinishedNumForDPJDJY(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countBizFinishedNumForDPSYDJ(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countBizFinishedNumForDPSYDJ(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countBizFinishedNumForDPDQJY(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countBizFinishedNumForDPDQJY(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countBizFinishedNumForDPBGDJ(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countBizFinishedNumForDPBGDJ(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countBizFinishedNumForDPZXBX(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countBizFinishedNumForDPZXBX(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
/** /**
...@@ -172,13 +191,19 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -172,13 +191,19 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
* @param dpFilterParamDto 过滤条件 * @param dpFilterParamDto 过滤条件
* @return 统计数量数组 * @return 统计数量数组
*/ */
List<Long> countAllInFlowingForDPNoFinishedBizData(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countAllInFlowingForDPNoFinishedBizData(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countAllInFlowingForDPNoFinishedBizDataAZGZ(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countAllInFlowingForDPNoFinishedBizDataJDJY(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countAllInFlowingForDPNoFinishedBizDataAZGZ(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countAllInFlowingForDPNoFinishedBizDataSYDJ(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countAllInFlowingForDPNoFinishedBizDataDQJY(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countAllInFlowingForDPNoFinishedBizDataJDJY(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countAllInFlowingForDPNoFinishedBizDataBGDJ(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countAllInFlowingForDPNoFinishedBizDataZXBX(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countAllInFlowingForDPNoFinishedBizDataSYDJ(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countAllInFlowingForDPNoFinishedBizDataDQJY(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countAllInFlowingForDPNoFinishedBizDataBGDJ(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countAllInFlowingForDPNoFinishedBizDataZXBX(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
/** /**
* 大屏业务全过程统计已经完成的列表 * 大屏业务全过程统计已经完成的列表
...@@ -187,19 +212,26 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -187,19 +212,26 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
* @param dpFilterParamForDetailDto 过滤条件 * @param dpFilterParamForDetailDto 过滤条件
* @return 统计数量数组 * @return 统计数量数组
*/ */
Page<Map<String,Object>> countBizFinishedNumForDPList(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto); Page<Map<String, Object>> countBizFinishedNumForDPList(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String,Object>> countBizFinishedNumForDPListAZGZ(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String,Object>> countBizFinishedNumForDPListJDJY(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto); Page<Map<String, Object>> countBizFinishedNumForDPListAZGZ(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String,Object>> countBizFinishedNumForDPListSYDJ(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String,Object>> countBizFinishedNumForDPListDQJY(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto); Page<Map<String, Object>> countBizFinishedNumForDPListJDJY(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String,Object>> countBizFinishedNumForDPListBGDJ(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String,Object>> countBizFinishedNumForDPListZXBX(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String, Object>> countBizFinishedNumForDPListSYDJ(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
void updateTechParamDynamic(@Param(value = "tableName") String tableName,@Param(value = "record") String record, @Param(value = "columns") List<DynamicColumnDto> columns); Page<Map<String, Object>> countBizFinishedNumForDPListDQJY(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String, Object>> countBizFinishedNumForDPListBGDJ(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String, Object>> countBizFinishedNumForDPListZXBX(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
void updateTechParamDynamic(@Param(value = "tableName") String tableName, @Param(value = "record") String record, @Param(value = "columns") List<DynamicColumnDto> columns);
/** /**
* 当前设备在流程中的申请单号 * 当前设备在流程中的申请单号
*
* @param record 设备id * @param record 设备id
* @return 申请单号 * @return 申请单号
*/ */
...@@ -208,6 +240,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -208,6 +240,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/** /**
* 查询指定设备,使用登记后,后续业务的数据 * 查询指定设备,使用登记后,后续业务的数据
*
* @param record 设备标识 * @param record 设备标识
* @return 后续业务数量 * @return 后续业务数量
*/ */
...@@ -237,6 +270,10 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -237,6 +270,10 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
List<EquipmentClassifyDto> getEquClassifyByCode(@Param("parentCode") String parentCode); List<EquipmentClassifyDto> getEquClassifyByCode(@Param("parentCode") String parentCode);
/**
* 查询通过企查查查询的公司信息代码字典
* @return 公司对象集合
*/
List<KeyValueDto> queryAllCompanyDict();
} }
...@@ -2638,4 +2638,13 @@ ...@@ -2638,4 +2638,13 @@
tup.expiry_date <![CDATA[<]]> CURRENT_DATE AND tup.permission_post IN ('permissionData66151', 'permissionData66152', 'permissionData6552'); tup.expiry_date <![CDATA[<]]> CURRENT_DATE AND tup.permission_post IN ('permissionData66151', 'permissionData66152', 'permissionData6552');
</select> </select>
<select id="queryAllCompanyDict" resultType="com.yeejoin.amos.boot.biz.common.dto.KeyValueDto">
select
company_name as strKey,
company_code as strValue
from
tzs_jg_unit_import
where
company_code <![CDATA[<>]]> ''
</select>
</mapper> </mapper>
...@@ -176,4 +176,14 @@ public class DataHandlerController extends BaseController { ...@@ -176,4 +176,14 @@ public class DataHandlerController extends BaseController {
watch.stop(); watch.stop();
return ResponseHelper.buildResponse(String.format("同步成功,耗时:%s", watch.getTotalTimeSeconds())); return ResponseHelper.buildResponse(String.format("同步成功,耗时:%s", watch.getTotalTimeSeconds()));
} }
@ApiOperation(httpMethod = "PUT", value = "补充西安导入数据的使用信用代码,压力管道除外", notes = "补充西安导入数据的使用信用代码,压力管道除外")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/v1/xa/useInfo")
public ResponseModel<Boolean> updateUseInfoOfCompanyV1(){
dataHandlerService.updateUseInfoOfCompanyV1();
return ResponseHelper.buildResponse(true);
}
} }
...@@ -13,8 +13,10 @@ import com.fasterxml.jackson.core.type.TypeReference; ...@@ -13,8 +13,10 @@ 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.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper; import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.dto.KeyValueDto;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
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;
...@@ -23,6 +25,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.PieLineEquipContraptionDto; ...@@ -23,6 +25,7 @@ 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.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
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.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.DataHandlerMapper; 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.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
...@@ -91,7 +94,7 @@ public class DataHandlerServiceImpl { ...@@ -91,7 +94,7 @@ public class DataHandlerServiceImpl {
private final JgInstallationNoticeMapper jgInstallationNoticeMapper; private final JgInstallationNoticeMapper jgInstallationNoticeMapper;
private final DataHandlerMapper dataHandlerMapper; private final DataHandlerMapper dataHandlerMapper;
private final CategoryOtherInfoMapper categoryOtherInfoMapper; private final CategoryOtherInfoMapper categoryOtherInfoMapper;
; private final CommonMapper commonMapper;
/** /**
...@@ -1029,4 +1032,36 @@ public class DataHandlerServiceImpl { ...@@ -1029,4 +1032,36 @@ public class DataHandlerServiceImpl {
} }
} }
} }
/**
* 查询公司代码为空的设备西安设备,以tzs_jg_unit_import为准【按照单位名称】更新使用信息表的【使用单位编码】、es的【使用单位编码】
*/
public void updateUseInfoOfCompanyV1() {
List<IdxBizJgUseInfo> useInfos = useInfoService.getBaseMapper().selectXAList();
Map<String, String> companynameCodeMap = getCompanyNameCodeMap();
useInfos.forEach(e->{
String companyCode = companynameCodeMap.get(e.getUseUnitName());
if(companyCode != null){
// 1.数据库更新
LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TzsBaseEntity::getSequenceNbr, e.getSequenceNbr());
updateWrapper.set(IdxBizJgUseInfo::getUseUnitCreditCode, companyCode);
updateWrapper.set(TzsBaseEntity::getRecDate, new Date());
useInfoService.update(updateWrapper);
// 2.es 更新
Optional<ESEquipmentCategoryDto> categoryDto = esEquipmentCategory.findById(e.getRecord());
categoryDto.ifPresent(categoryEs -> {
categoryEs.setUSE_UNIT_CREDIT_CODE(companyCode);
// 捎带更新单位名称保持数据库和es一致
categoryEs.setUSC_UNIT_NAME(e.getUseUnitName());
esEquipmentCategory.save(categoryEs);
});
}
});
}
private Map<String, String> getCompanyNameCodeMap() {
List<KeyValueDto> companyList = commonMapper.queryAllCompanyDict();
return companyList.stream().collect(Collectors.toMap(KeyValueDto::getStrKey, KeyValueDto::getStrValue, (k1, k2)->k1));
}
} }
...@@ -13,4 +13,6 @@ import java.util.List; ...@@ -13,4 +13,6 @@ import java.util.List;
*/ */
public interface IdxBizJgUseInfoMapper extends BaseMapper<IdxBizJgUseInfo> { public interface IdxBizJgUseInfoMapper extends BaseMapper<IdxBizJgUseInfo> {
void batchUpdateUseInfo(@Param("records") List<String> records, Integer code); void batchUpdateUseInfo(@Param("records") List<String> records, Integer code);
List<IdxBizJgUseInfo> selectXAList();
} }
...@@ -8,4 +8,19 @@ ...@@ -8,4 +8,19 @@
#{record} #{record}
</foreach> </foreach>
</update> </update>
<select id="selectXAList" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo"> select
select
u."SEQUENCE_NBR",
u."RECORD",
u."USE_UNIT_CREDIT_CODE",
u."USE_UNIT_NAME"
from
idx_biz_jg_use_info u
where
u.DATA_SOURCE = 'jg_his_xa'
and (
u."USE_UNIT_CREDIT_CODE" is null or length(u."USE_UNIT_CREDIT_CODE") <![CDATA[ < ]]> 15
)
and u."USE_UNIT_NAME" <![CDATA[ <> ]]> ''
</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