feat(data): 新增四川园区和乌兰察布盈通能源平台枚举

- 在 BusThirdPlatformCodeEnum 中添加了四川园区和乌兰察布盈通能源的枚举值
- 为土右安全风险单元、事件、控制措施等数据实体增加了详细的字段映射转换逻辑
- 实现了多种作业票务和检查记录的数据转换功能
- 添加了员工信息、位置报警、承包商组织等数据的转换支持
- 增加了对高处作业、吊装作业、动火作业等特殊作业类型的转换处理
- 完善了作业人员、部门、审批人等复杂对象的 JSON 解析与转换逻辑
dev-sichuan
10396 2025-10-28 11:10:33 +08:00
parent bb1eea5ca2
commit 9d7f336cfe
9 changed files with 1710 additions and 5 deletions

View File

@ -22,7 +22,8 @@ public enum BusThirdPlatformCodeEnum {
NEIMENGGU("nmg", "内蒙古省平台"),
NEIMENGGUV0("nmgv0", "内蒙古省平台V0"),
YANHUA("yh", "内蒙古烟花爆竹平台"),
SICHUAN("sichuan", "四川园区"),
WULANBUCHA("wlbc", "乌兰察布盈通能源"),
;
private static final Map<String, BusThirdPlatformCodeEnum> codeMap = new HashMap<>();

View File

@ -0,0 +1,81 @@
package com.zcloud.modules.data.enums.sichuan.url;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
/**
* [V1.6.doc]:
* <a href="http://47.92.113.182:3000/docking/doc/src/branch/main/%E5%9B%AD%E5%8C%BA%E7%BA%A7%E5%AF%B9%E6%8E%A5%E6%96%87%E4%BB%B6/%E5%9C%9F%E5%8F%B3%E5%9B%AD%E5%8C%BA%E4%BC%81%E4%B8%9A%E5%B9%B3%E5%8F%B0%E6%95%B0%E6%8D%AE%E4%BA%A4%E6%8D%A2%E8%A7%84%E8%8C%83V1.6.doc">git</a>
* 1.6
*/
@Getter
public enum ScyqReportV16Enum {
secSecurityRiskUnit("0", "包头土右上报安全风险分析单元数据", "/api/sync/data/sec_security_risk_unit", "data_risk_unit","ty", "POST"),
secSecurityRiskEvents("1", "包头土右上报安全风险事件数据", "/api/sync/data/sec_security_risk_events", "data_risk_events","ty", "POST"),
secSecurityRiskControlMeasures("2", "包头土右上报安全风险管控措施数据", "/api/sync/data/sec_security_risk_control_measures", "data_risk_control_measure","ty", "POST"),
secHiddenCheckMission("3", "包头土右上报隐患排查任务数据", "/api/sync/data/sec_hidden_check_mission", "data_hidden_check_mission","ty", "POST"),
secHiddenCheckRecord("4", "包头土右上报隐患排查记录数据", "/api/sync/data/sec_hidden_check_record", "data_danger_check_record","ty", "POST"),
secHiddenDangerInfo("5", "包头土右上报隐患信息数据", "/api/sync/data/sec_hidden_danger_info", "data_danger_info","ty", "POST"),
secDeactivatedMaintenanceRecord("6", "包头土右上报停用/检修记录", "/api/sync/data/sec_deactivated_maintenance_record","", "ty", "POST"),
//TODO 不确定url
secHiddenDanerInfoCheck("7", "包头土右上报专项检查隐患信息", "/api/sync/data/sec_hidden_daner_info_check", "","ty", "POST"),
//TODO 不确定url
tbBaseCheckRecord("8", "包头土右上报专项检查情况记录", "/api/sync/data/tb_base_check_record", "","ty", "POST"),
secSpecialJobTicketInfo("9", "包头土右上报特殊作业票证信息", "/api/sync/data/sec_special_job_ticket_info", "","ty", "POST"),
secSpecialJobTicketApproval("10", "包头土右上报特殊作业审批记录", "/api/sync/data/sec_special_job_ticket_approval", "data_work_approval","ty", "POST"),
secSpecialJobTicketSafetyMeasures("11", "包头土右上报特殊作业安全措施", "/api/sync/data/sec_special_job_ticket_safety_measures","data_work_safety", "ty", "POST"),
secSpecialJobTicketGasAnalysis("12", "包头土右上报特殊作业气体分析", "/api/sync/data/sec_special_job_ticket_gas_analysis", "data_work_gas_analysis","ty", "POST"),
secProductionPromise("13", "包头土右上报安全承诺数据", "/api/sync/data/sec_production_promise", "data_production_promise","ty", "POST"),
secDeviceRunStatus("14", "包头土右上报承诺装置运行状态表", "/api/sync/data/sec_device_run_status", "data_device_run_status","ty", "POST"),
secProductionPromiseTicket("15", "包头土右上报承诺作业票详情表", "/api/sync/data/sec_production_promise_ticket", "data_promise_ticket","ty", "POST"),
//TODO 不确定url
secEmployeeFile("16", "包头土右上报人员档案数据", "/api/sync/data/sec_employee_file", "data_employee_info","ty", "POST"),
secEmployeeRealLoaction("17", "包头土右上报人员定位数据", "/api/sync/data/sec_employee_real_loaction","data_employee_location", "ty", "POST"),
//TODO 不确定url
secCarRecord("18", "包头土右卡口车辆通行记录", "/api/sync/data/sec_car_record", "data_car_record","ty", "POST"),
//TODO 不确定url
secPersonRecord("19", "包头土右卡口人员通行记录", "/api/sync/data/sec_person_record", "data_person_record","ty", "POST"),
enterpriseArea("20", "包头土右企业区域信息查询接口", "/api/sync/local/list/t_enterprise_area", "","ty", "POST"),
secEmployeeAlarmData("21", "包头土右上报人员报警数据", "/api/sync/data/sec_employee_alarm_data", "data_employee_alarm","ty", "POST"),
secSpecialJobTicketFire("22", "包头土右上报动火作业票", "/api/sync/data/sec_special_job_ticket_fire", "data_work_hot","ty", "POST"),
secSpecialJobTicketSpace("23", "包头土右上报受限空间作业票", "/api/sync/data/sec_special_job_ticket_space", "data_work_space","ty", "POST"),
secSpecialJobTicketBlindplate("24", "包头土右上报盲板抽堵作业票", "/api/sync/data/sec_special_job_ticket_blindplate", "data_work_blindplate","ty", "POST"),
secSpecialJobTicketHigh("25", "包头土右上报高处作业票", "/api/sync/data/sec_special_job_ticket_high", "data_work_high","ty", "POST"),
secSpecialJobTicketHoising ("26", "包头土右上报吊装作业票", "/api/sync/data/sec_special_job_ticket_hoising", "data_work_hoising","ty", "POST"),
secSpecialJobTicketPower("27", "包头土右上报临时用电作业票", "/api/sync/data/sec_special_job_ticket_power", "data_work_power","ty", "POST"),
secSpecialJobTicketSoil("28", "包头土右上报动土作业票", "/api/sync/data/sec_special_job_ticket_soil", "data_work_ground_break","ty", "POST"),
secSpecialJobTicketBreak("29", "包头土右上报断路作业票", "/api/sync/data/sec_special_job_ticket_break", "data_work_break","ty", "POST"),
;
private final String code;
private final String desc;
private final String url;
private final String businessType;
private final String receiver;
private final String requestType;
private static final Map<String, ScyqReportV16Enum> codeMap = new HashMap<>();
static {
for (ScyqReportV16Enum type : values()) {
codeMap.put(type.businessType, type);
}
}
ScyqReportV16Enum(String code, String desc, String url, String businessType, String receiver, String requestType) {
this.code = code;
this.desc = desc;
this.url = url;
this.businessType = businessType;
this.receiver = receiver;
this.requestType = requestType;
}
public static ScyqReportV16Enum getByBusinessType(String businessType) {
return codeMap.get(businessType);
}
}

View File

@ -132,6 +132,7 @@ public abstract class AbstractDataPushService implements DataPushService {
}
List<BusCompanyThirdRelationEntity> companyThirdRelationList;
try {
// int i = 1/0;
companyThirdRelationList = checkCompanyInfo(reqDto, corpId);
} catch (ZException e) {
log.info("接收到服务平台:{},企业信用代码:{},数据类型:{},信息异常{}", corpId, reqDto.getOrgCode(), businessDataTypeEnum.getDesc(), e.getMessage());

View File

@ -0,0 +1,646 @@
package com.zcloud.modules.data.thirdservice.data.convert;
import cn.hutool.core.collection.CollUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.zcloud.modules.data.dto.data.req.info.*;
import com.zcloud.modules.data.dto.neimenggu.ty.req.*;
import com.zcloud.modules.data.entity.data.*;
import com.zcloud.modules.data.enums.data.*;
import org.apache.commons.lang3.StringUtils;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Named;
import org.mapstruct.factory.Mappers;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Mapper
public interface ScyqDtoConvertMapper {
//转换数据,字段比较多,只能一个一个手动赋值,注意枚举信息
ScyqDtoConvertMapper INSTANCE = Mappers.getMapper(ScyqDtoConvertMapper.class);
/**
*
*
* @param dtoList
* @return DTO
*/
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "dataId", target = "id")
@Mapping(source = "riskLevel", target = "riskLevel", qualifiedByName = "convertRiskLevel")
TyRiskUnitReqDto convertSafeRiskUnitReqDto(DataRiskUnitEntity dtoList);
/**
*
*
* @param newDataRiskEventsEntity
* @return DTO
*/
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
TyRiskEventsReqDto convertSafeRiskEventsReqDto(DataRiskEventsEntity newDataRiskEventsEntity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "dataSrc", target = "dataSrc", qualifiedByName = "convertDataSrc")
@Mapping(source = "classify1", target = "classify1", qualifiedByName = "convertClassify1")
@Mapping(source = "classify2", target = "classify2", qualifiedByName = "convertClassify2")
TyRiskControlMeasuresReqDto convertControlMeasureReqDto(DataRiskControlMeasureEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "checkCycleUnit", target = "checkCycleUnit", qualifiedByName = "convertcheckCycleUnit")
@Mapping(source = "taskStartTime", target = "taskStartTime", qualifiedByName = "convertDateString")
@Mapping(source = "workType", target = "workType", qualifiedByName = "convertWorkType")
TyHiddenCheckMissionReqDto convertHiddenCheckMissionReqDto(DataHiddenCheckMissionEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "checkTime", target = "checkTime", qualifiedByName = "convertDateString")
@Mapping(source = "checkStatus", target = "checkStatus", qualifiedByName = "convertCheckStatus")
TyHiddenCheckRecordReqDto convertDangerCheckRecordReqDto(DataDangerCheckRecordEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "dangerLevel", target = "dangerLevel", qualifiedByName = "convertDangerLevel")
@Mapping(source = "registerTime", target = "registTime", qualifiedByName = "convertDateString")
@Mapping(source = "dangerManageDeadline", target = "dangerManageDeadline", qualifiedByName = "convertDateString")
@Mapping(source = "checkAcceptTime", target = "checkAcceptTime", qualifiedByName = "convertDateString")
@Mapping(source = "dangerManageType", target = "dangerManageType", qualifiedByName = "convertDangerManageType")
TyHiddenDangerInfoReqDto convertDangerInfoReqDto(DataDangerInfoEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "stopStartTime", target = "stopStartTime", qualifiedByName = "convertDateString")
@Mapping(source = "stopEndTime", target = "stopEndTime", qualifiedByName = "convertDateString")
TyMaintenanceRecordReqDto convertUnitStopReqDto(DataUnitStopEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
TyProductionPromiseReqDto convertProductionPromiseReqDto(DataProductionPromiseEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "runStatusBeginTime", target = "runStatusBeginTime", qualifiedByName = "convertDateString")
@Mapping(source = "runStatusEndTime", target = "runStatusEndTime", qualifiedByName = "convertDateString")
TyDeviceRunStatusReqDto convertDeviceRunStatusReqDto(DataDeviceRunStatusEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
TyPromiseTicketReqDto convertPromiseTicketReqDto(DataPromiseTicketEntity entity);
@Mapping(source = "dataId", target = "passId")
TyCarRecordReqDto convertCarRecordReqDto(DataCarRecordEntity entity);
@Mapping(source = "personName", target = "staffType")
TyPersonRecordReqDto convertPersonRecordReqDto(DataPersonRecordEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "gender", target = "gender", qualifiedByName = "convertGender")
@Mapping(source = "personName", target = "personName")
@Mapping(source = "positionName", target = "post")
@Mapping(source = "mobileNumber", target = "phone")
@Mapping(source = "departmentName", target = "affiliatedDepartment")
TyEmployeeFileReqDto convertEmployeeInfoReqDto(DataEmployeeInfoEntity entity);
@Mapping(source = "longitude", target = "lon")
@Mapping(source = "latitude", target = "lat")
@Mapping(source = "timeStamp", target = "time")
TyEmployeeRealLocationReqDto convertEmployeeLocationReqDto(DataEmployeeLocationEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "alarmAddress", target = "address")
@Mapping(source = "alarmType", target = "alarmType", qualifiedByName = "convertAlarmType")
TyEmployeeAlarmDataReqDto convertEmployeeAlarmReqDto(DataEmployeeAlarmEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "processTime", target = "processTime", qualifiedByName = "convertDateString")
TyJobTicketApprovalReqDto convertWorkApprovalReqDto(DataWorkApprovalEntity entity);
@Mapping(source = "dataId", target = "id")
TyJobTicketSafetyReqDto convertWorkSafetyReqDto(DataWorkSafetyEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "analystTime", target = "analystTime", qualifiedByName = "convertDateString")
@Mapping(source = "workType", target = "ticketType", qualifiedByName = "convertTicketType")
@Mapping(source = "workId", target = "ticketId")
TyJobTicketGasAnalysisReqDto convertWorkGasAnalysisReqDto(DataWorkGasAnalysisEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "workNumber", target = "ticketNo")
@Mapping(source = "workStatus", target = "ticketStatus")
@Mapping(source = "issueTime", target = "issueTime", qualifiedByName = "convertDateString")
@Mapping(source = "planStartTime", target = "planStartTime", qualifiedByName = "convertDateString")
@Mapping(source = "planEndTime", target = "planEndTime", qualifiedByName = "convertDateString")
@Mapping(source = "beginTime", target = "startTime", qualifiedByName = "convertDateString")
@Mapping(source = "endTime", target = "endTime", qualifiedByName = "convertDateString")
@Mapping(source = "workPlace", target = "ticketPosition")
@Mapping(source = "workContent", target = "ticketContent")
@Mapping(source = "finishedTime", target = "checkedTime", qualifiedByName = "convertDateString")
@Mapping(source = "finishedUser", target = "checkedPerson", qualifiedByName = "convertFinishedUser")
@Mapping(source = "mapCenter", target = "longitude", qualifiedByName = "convertLongitude")
@Mapping(source = "mapCenter", target = "latitude", qualifiedByName = "convertLatitude")
@Mapping(source = "guardianUser", target = "supervisorName", qualifiedByName = "convertFinishedUser")
@Mapping(source = "workUser", target = "workerName", qualifiedByName = "convertWorkUser")
@Mapping(source = "workDeptment", target = "workDeptment", qualifiedByName = "convertWorkDeptment")
@Mapping(source = "contractorOrg", target = "contractorOrg", qualifiedByName = "convertContractorOrg")
@Mapping(source = "relatedWorkId", target = "associationTicket")
@Mapping(source = "discloseUser", target = "disclosePerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "acceptUser", target = "acceptPerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "workHeadUser", target = "tickerResponsName", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "hotWorkLocation", target = "fireLocation")
@Mapping(source = "hotWorkLevel", target = "fireLevel", qualifiedByName = "convertHotWorkLevel")
@Mapping(source = "firePerson", target = "firePerson", qualifiedByName = "convertFirePerson")
@Mapping(source = "hotWorkMethod", target = "fireStyle")
TyJobTicketFireReqDto convertWorkHotReqDto(DataWorkHotEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "workNumber", target = "ticketNo")
@Mapping(source = "workStatus", target = "ticketStatus")
@Mapping(source = "issueTime", target = "issueTime", qualifiedByName = "convertDateString")
@Mapping(source = "planStartTime", target = "planStartTime", qualifiedByName = "convertDateString")
@Mapping(source = "planEndTime", target = "planEndTime", qualifiedByName = "convertDateString")
@Mapping(source = "beginTime", target = "startTime", qualifiedByName = "convertDateString")
@Mapping(source = "endTime", target = "endTime", qualifiedByName = "convertDateString")
@Mapping(source = "workPlace", target = "ticketPosition")
@Mapping(source = "workContent", target = "ticketContent")
@Mapping(source = "finishedTime", target = "checkedTime", qualifiedByName = "convertDateString")
@Mapping(source = "finishedUser", target = "checkedPerson", qualifiedByName = "convertFinishedUser")
@Mapping(source = "mapCenter", target = "longitude", qualifiedByName = "convertLongitude")
@Mapping(source = "mapCenter", target = "latitude", qualifiedByName = "convertLatitude")
@Mapping(source = "guardianUser", target = "supervisorName", qualifiedByName = "convertFinishedUser")
@Mapping(source = "workUser", target = "workerName", qualifiedByName = "convertWorkUser")
@Mapping(source = "workDeptment", target = "workDeptment", qualifiedByName = "convertWorkDeptment")
@Mapping(source = "contractorOrg", target = "contractorOrg", qualifiedByName = "convertContractorOrg")
@Mapping(source = "relatedWorkId", target = "associationTicket")
@Mapping(source = "discloseUser", target = "disclosePerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "acceptUser", target = "acceptPerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "workHeadUser", target = "tickerResponsName", qualifiedByName = "convertDiscloseUser")
TyJobTicketSpaceReqDto convertWorkSpaceReqDto(DataWorkSpaceEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "workNumber", target = "ticketNo")
@Mapping(source = "workStatus", target = "ticketStatus")
@Mapping(source = "issueTime", target = "issueTime", qualifiedByName = "convertDateString")
@Mapping(source = "planStartTime", target = "planStartTime", qualifiedByName = "convertDateString")
@Mapping(source = "planEndTime", target = "planEndTime", qualifiedByName = "convertDateString")
@Mapping(source = "beginTime", target = "startTime", qualifiedByName = "convertDateString")
@Mapping(source = "endTime", target = "endTime", qualifiedByName = "convertDateString")
@Mapping(source = "workPlace", target = "ticketPosition")
@Mapping(source = "workContent", target = "ticketContent")
@Mapping(source = "finishedTime", target = "checkedTime", qualifiedByName = "convertDateString")
@Mapping(source = "finishedUser", target = "checkedPerson", qualifiedByName = "convertFinishedUser")
@Mapping(source = "mapCenter", target = "longitude", qualifiedByName = "convertLongitude")
@Mapping(source = "mapCenter", target = "latitude", qualifiedByName = "convertLatitude")
@Mapping(source = "guardianUser", target = "supervisorName", qualifiedByName = "convertFinishedUser")
@Mapping(source = "workUser", target = "workerName", qualifiedByName = "convertWorkUser")
@Mapping(source = "workDeptment", target = "workDeptment", qualifiedByName = "convertWorkDeptment")
@Mapping(source = "contractorOrg", target = "contractorOrg", qualifiedByName = "convertContractorOrg")
@Mapping(source = "relatedWorkId", target = "associationTicket")
@Mapping(source = "discloseUser", target = "disclosePerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "acceptUser", target = "acceptPerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "workHeadUser", target = "tickerResponsName", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "locationMap", target = "plateImg")
TyJobTicketBlindplateReqDto convertWorkBlindplateReqDto(DataWorkBlindplateEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "workNumber", target = "ticketNo")
@Mapping(source = "workStatus", target = "ticketStatus")
@Mapping(source = "issueTime", target = "issueTime", qualifiedByName = "convertDateString")
@Mapping(source = "planStartTime", target = "planStartTime", qualifiedByName = "convertDateString")
@Mapping(source = "planEndTime", target = "planEndTime", qualifiedByName = "convertDateString")
@Mapping(source = "beginTime", target = "startTime", qualifiedByName = "convertDateString")
@Mapping(source = "endTime", target = "endTime", qualifiedByName = "convertDateString")
@Mapping(source = "workPlace", target = "ticketPosition")
@Mapping(source = "workContent", target = "ticketContent")
@Mapping(source = "finishedTime", target = "checkedTime", qualifiedByName = "convertDateString")
@Mapping(source = "finishedUser", target = "checkedPerson", qualifiedByName = "convertFinishedUser")
@Mapping(source = "mapCenter", target = "longitude", qualifiedByName = "convertLongitude")
@Mapping(source = "mapCenter", target = "latitude", qualifiedByName = "convertLatitude")
@Mapping(source = "guardianUser", target = "supervisorName", qualifiedByName = "convertFinishedUser")
@Mapping(source = "workUser", target = "workerName", qualifiedByName = "convertWorkUser")
@Mapping(source = "workDeptment", target = "workDeptment", qualifiedByName = "convertWorkDeptment")
@Mapping(source = "contractorOrg", target = "contractorOrg", qualifiedByName = "convertContractorOrg")
@Mapping(source = "relatedWorkId", target = "associationTicket")
@Mapping(source = "discloseUser", target = "disclosePerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "acceptUser", target = "acceptPerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "workHeadUser", target = "tickerResponsName", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "workHeight", target = "highHeight")
@Mapping(source = "heightWorkLevel", target = "highLevel", qualifiedByName = "convertHeightWorkLevel")
TyJobTicketHighReqDto convertWorkHighReqDto(DataWorkHighEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "workNumber", target = "ticketNo")
@Mapping(source = "workStatus", target = "ticketStatus")
@Mapping(source = "issueTime", target = "issueTime", qualifiedByName = "convertDateString")
@Mapping(source = "planStartTime", target = "planStartTime", qualifiedByName = "convertDateString")
@Mapping(source = "planEndTime", target = "planEndTime", qualifiedByName = "convertDateString")
@Mapping(source = "beginTime", target = "startTime", qualifiedByName = "convertDateString")
@Mapping(source = "endTime", target = "endTime", qualifiedByName = "convertDateString")
@Mapping(source = "workPlace", target = "ticketPosition")
@Mapping(source = "workContent", target = "ticketContent")
@Mapping(source = "finishedTime", target = "checkedTime", qualifiedByName = "convertDateString")
@Mapping(source = "finishedUser", target = "checkedPerson", qualifiedByName = "convertFinishedUser")
@Mapping(source = "mapCenter", target = "longitude", qualifiedByName = "convertLongitude")
@Mapping(source = "mapCenter", target = "latitude", qualifiedByName = "convertLatitude")
@Mapping(source = "guardianUser", target = "supervisorName", qualifiedByName = "convertFinishedUser")
@Mapping(source = "workUser", target = "workerName", qualifiedByName = "convertWorkUser")
@Mapping(source = "workDeptment", target = "workDeptment", qualifiedByName = "convertWorkDeptment")
@Mapping(source = "contractorOrg", target = "contractorOrg", qualifiedByName = "convertContractorOrg")
@Mapping(source = "relatedWorkId", target = "associationTicket")
@Mapping(source = "discloseUser", target = "disclosePerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "acceptUser", target = "acceptPerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "workHeadUser", target = "tickerResponsName", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "hoistingLevel", target = "hoistingLevel", qualifiedByName = "convertHoistingLevel")
TyJobTicketHoisingReqDto convertWorkHoisingReqDto(DataWorkHoisingEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "workNumber", target = "ticketNo")
@Mapping(source = "workStatus", target = "ticketStatus")
@Mapping(source = "issueTime", target = "issueTime", qualifiedByName = "convertDateString")
@Mapping(source = "planStartTime", target = "planStartTime", qualifiedByName = "convertDateString")
@Mapping(source = "planEndTime", target = "planEndTime", qualifiedByName = "convertDateString")
@Mapping(source = "beginTime", target = "startTime", qualifiedByName = "convertDateString")
@Mapping(source = "endTime", target = "endTime", qualifiedByName = "convertDateString")
@Mapping(source = "workPlace", target = "ticketPosition")
@Mapping(source = "workContent", target = "ticketContent")
@Mapping(source = "finishedTime", target = "checkedTime", qualifiedByName = "convertDateString")
@Mapping(source = "finishedUser", target = "checkedPerson", qualifiedByName = "convertFinishedUser")
@Mapping(source = "mapCenter", target = "longitude", qualifiedByName = "convertLongitude")
@Mapping(source = "mapCenter", target = "latitude", qualifiedByName = "convertLatitude")
@Mapping(source = "guardianUser", target = "supervisorName", qualifiedByName = "convertFinishedUser")
@Mapping(source = "workUser", target = "workerName", qualifiedByName = "convertWorkUser")
@Mapping(source = "workDeptment", target = "workDeptment", qualifiedByName = "convertWorkDeptment")
@Mapping(source = "contractorOrg", target = "contractorOrg", qualifiedByName = "convertContractorOrg")
@Mapping(source = "relatedWorkId", target = "associationTicket")
@Mapping(source = "discloseUser", target = "disclosePerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "acceptUser", target = "acceptPerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "workHeadUser", target = "tickerResponsName", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "headCode", target = "headCode", qualifiedByName = "convertHeadCode")
@Mapping(source = "workUser", target = "personCode", qualifiedByName = "convertHeadCode")
@Mapping(source = "powerAccessPoint", target = "powerStrategy")
@Mapping(source = "workingVoltage", target = "workVoltage")
TyJobTicketPowerReqDto convertWorkPowerReqDto(DataWorkPowerEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "workNumber", target = "ticketNo")
@Mapping(source = "workStatus", target = "ticketStatus")
@Mapping(source = "issueTime", target = "issueTime", qualifiedByName = "convertDateString")
@Mapping(source = "planStartTime", target = "planStartTime", qualifiedByName = "convertDateString")
@Mapping(source = "planEndTime", target = "planEndTime", qualifiedByName = "convertDateString")
@Mapping(source = "beginTime", target = "startTime", qualifiedByName = "convertDateString")
@Mapping(source = "endTime", target = "endTime", qualifiedByName = "convertDateString")
@Mapping(source = "workPlace", target = "ticketPosition")
@Mapping(source = "workContent", target = "ticketContent")
@Mapping(source = "finishedTime", target = "checkedTime", qualifiedByName = "convertDateString")
@Mapping(source = "finishedUser", target = "checkedPerson", qualifiedByName = "convertFinishedUser")
@Mapping(source = "mapCenter", target = "longitude", qualifiedByName = "convertLongitude")
@Mapping(source = "mapCenter", target = "latitude", qualifiedByName = "convertLatitude")
@Mapping(source = "guardianUser", target = "supervisorName", qualifiedByName = "convertFinishedUser")
@Mapping(source = "workUser", target = "workerName", qualifiedByName = "convertWorkUser")
@Mapping(source = "workDeptment", target = "workDeptment", qualifiedByName = "convertWorkDeptment")
@Mapping(source = "contractorOrg", target = "contractorOrg", qualifiedByName = "convertContractorOrg")
@Mapping(source = "relatedWorkId", target = "associationTicket")
@Mapping(source = "discloseUser", target = "disclosePerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "acceptUser", target = "acceptPerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "workHeadUser", target = "tickerResponsName", qualifiedByName = "convertDiscloseUser")
TyJobTicketSoilReqDto convertWorkGroundBreakReqDto(DataWorkGroundBreakEntity entity);
@Mapping(source = "dataId", target = "id")
@Mapping(source = "createDate", target = "createDate", qualifiedByName = "convertDateString")
@Mapping(source = "updateDate", target = "updateDate", qualifiedByName = "convertDateString")
@Mapping(source = "workNumber", target = "ticketNo")
@Mapping(source = "workStatus", target = "ticketStatus")
@Mapping(source = "issueTime", target = "issueTime", qualifiedByName = "convertDateString")
@Mapping(source = "planStartTime", target = "planStartTime", qualifiedByName = "convertDateString")
@Mapping(source = "planEndTime", target = "planEndTime", qualifiedByName = "convertDateString")
@Mapping(source = "beginTime", target = "startTime", qualifiedByName = "convertDateString")
@Mapping(source = "endTime", target = "endTime", qualifiedByName = "convertDateString")
@Mapping(source = "workPlace", target = "ticketPosition")
@Mapping(source = "workContent", target = "ticketContent")
@Mapping(source = "finishedTime", target = "checkedTime", qualifiedByName = "convertDateString")
@Mapping(source = "finishedUser", target = "checkedPerson", qualifiedByName = "convertFinishedUser")
@Mapping(source = "mapCenter", target = "longitude", qualifiedByName = "convertLongitude")
@Mapping(source = "mapCenter", target = "latitude", qualifiedByName = "convertLatitude")
@Mapping(source = "guardianUser", target = "supervisorName", qualifiedByName = "convertFinishedUser")
@Mapping(source = "workUser", target = "workerName", qualifiedByName = "convertWorkUser")
@Mapping(source = "workDeptment", target = "workDeptment", qualifiedByName = "convertWorkDeptment")
@Mapping(source = "contractorOrg", target = "contractorOrg", qualifiedByName = "convertContractorOrg")
@Mapping(source = "relatedWorkId", target = "associationTicket")
@Mapping(source = "discloseUser", target = "disclosePerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "acceptUser", target = "acceptPerson", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "workHeadUser", target = "tickerResponsName", qualifiedByName = "convertDiscloseUser")
@Mapping(source = "involveUnit", target = "involveUnit", qualifiedByName = "convertWorkDeptment")
TyJobTicketBreakReqDto convertWorkBreakReqDto(DataWorkBreakEntity entity);
@Mapping(source = "dataId", target = "id")
TyHiddenDangerInfoCheckReqDto convertCheckDangerReqDto(DataCheckDangerEntity entity);
@Mapping(source = "dataId", target = "id")
TyBaseCheckRecordReqDto convertCheckRecordReqDto(DataCheckRecordEntity entity);
@Named("convertHeadCode")
default String convertHeadCode(String workUser) {
ObjectMapper objectMapper = new ObjectMapper();
try {
List<DataWorkEmployeeInfoDto> dtoList = objectMapper.readValue(workUser, objectMapper.getTypeFactory().constructCollectionType(List.class, DataWorkEmployeeInfoDto.class));
if(CollUtil.isNotEmpty(dtoList)) {
// 获取 approveName 属性并转换为逗号分隔的字符串
String approveNames = dtoList.stream()
.map(DataWorkEmployeeInfoDto::getCertNum) // 假设存在 getApproveName 方法
.filter(Objects::nonNull) // 过滤掉 null 值
.collect(Collectors.joining(","));
return approveNames;
}
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return null;
}
@Named("convertHoistingLevel")
default String convertHoistingLevel(String hoistingLevel) {
return DataHoistWorkLevelEnum.getByTyCode(hoistingLevel);
}
@Named("convertHeightWorkLevel")
default String convertHeightWorkLevel(String heightWorkLevel) {
return DataWorkHeightLevelEnum.getByTyCode(heightWorkLevel);
}
@Named("convertFirePerson")
default String convertFirePerson(String firePerson) {
ObjectMapper objectMapper = new ObjectMapper();
try {
List<DataWorkEmployeeInfoDto> dtoList = objectMapper.readValue(firePerson, objectMapper.getTypeFactory().constructCollectionType(List.class, DataWorkEmployeeInfoDto.class));
if(CollUtil.isNotEmpty(dtoList)) {
return dtoList.stream()
.map(dto -> {
String name = dto.getName() != null ? dto.getName() : "";
String code = dto.getCertNum() != null ? dto.getCertNum() : "";
return name + ":" + code;
})
.collect(Collectors.joining(","));
}
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return null;
}
@Named("convertHotWorkLevel")
default String convertHotWorkLevel(String hotWorkLevel) {
return DataWorkHotLevelEnum.getByTyCode(hotWorkLevel);
}
@Named("convertDiscloseUser")
default String convertDiscloseUser(String approveInfoUser) {
ObjectMapper objectMapper = new ObjectMapper();
try {
if(StringUtils.isEmpty(approveInfoUser)){
return null;
}
List<DataWorkApproveInfoDto> dtoList = objectMapper.readValue(approveInfoUser, objectMapper.getTypeFactory().constructCollectionType(List.class, DataWorkApproveInfoDto.class));
if(CollUtil.isNotEmpty(dtoList)) {
// 获取 approveName 属性并转换为逗号分隔的字符串
String approveNames = dtoList.stream()
.map(DataWorkApproveInfoDto::getName) // 假设存在 getApproveName 方法
.filter(Objects::nonNull) // 过滤掉 null 值
.collect(Collectors.joining(","));
return approveNames;
}
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return null;
}
@Named("convertContractorOrg")
default String convertContractorOrg(String contractorOrg) {
ObjectMapper objectMapper = new ObjectMapper();
try {
if(StringUtils.isEmpty(contractorOrg)){
return null;
}
List<DataContractorInfoDto> dtoList = objectMapper.readValue(contractorOrg, objectMapper.getTypeFactory().constructCollectionType(List.class, DataContractorInfoDto.class));
if(CollUtil.isNotEmpty(dtoList)) {
return dtoList.stream()
.map(dto -> {
String name = dto.getContractorName() != null ? dto.getContractorName() : "";
String code = dto.getContractorCode() != null ? dto.getContractorCode() : "";
return name + ":" + code;
})
.collect(Collectors.joining(","));
}
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return null;
}
@Named("convertWorkDeptment")
default String convertWorkDeptment(String workDeptment) {
ObjectMapper objectMapper = new ObjectMapper();
try {
List<DataWorkDeptmentInfoDto> dtoList = objectMapper.readValue(workDeptment, objectMapper.getTypeFactory().constructCollectionType(List.class, DataWorkDeptmentInfoDto.class));
if(CollUtil.isNotEmpty(dtoList)) {
// 获取 approveName 属性并转换为逗号分隔的字符串
String approveNames = dtoList.stream()
.map(DataWorkDeptmentInfoDto::getDepartmentName) // 假设存在 getApproveName 方法
.filter(Objects::nonNull) // 过滤掉 null 值
.collect(Collectors.joining(","));
return approveNames;
}
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return null;
}
@Named("convertWorkUser")
default String convertWorkUser(String workUser) {
ObjectMapper objectMapper = new ObjectMapper();
try {
List<DataWorkEmployeeInfoDto> dtoList = objectMapper.readValue(workUser, objectMapper.getTypeFactory().constructCollectionType(List.class, DataWorkEmployeeInfoDto.class));
if(CollUtil.isNotEmpty(dtoList)) {
// 获取 approveName 属性并转换为逗号分隔的字符串
String approveNames = dtoList.stream()
.map(DataWorkEmployeeInfoDto::getName) // 假设存在 getApproveName 方法
.filter(Objects::nonNull) // 过滤掉 null 值
.collect(Collectors.joining(","));
return approveNames;
}
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return null;
}
@Named("convertLatitude")
default String convertLatitude(String mapCenter) {
ObjectMapper objectMapper = new ObjectMapper();
try {
List<DataMapDto> dtoList = objectMapper.readValue(mapCenter, objectMapper.getTypeFactory().constructCollectionType(List.class, DataMapDto.class));
if(CollUtil.isNotEmpty(dtoList)) {
return dtoList.get(0).getLat();
}
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return null;
}
@Named("convertLongitude")
default String convertLongitude(String mapCenter) {
ObjectMapper objectMapper = new ObjectMapper();
try {
List<DataMapDto> dtoList = objectMapper.readValue(mapCenter, objectMapper.getTypeFactory().constructCollectionType(List.class, DataMapDto.class));
if(CollUtil.isNotEmpty(dtoList)) {
return dtoList.get(0).getLng();
}
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return null;
}
@Named("convertFinishedUser")
default String convertFinishedUser(String finishedUser) {
ObjectMapper objectMapper = new ObjectMapper();
try {
if(StringUtils.isEmpty(finishedUser)){
return null;
}
List<DataWorkApproveInfoDto> dtoList = objectMapper.readValue(finishedUser, objectMapper.getTypeFactory().constructCollectionType(List.class, DataWorkApproveInfoDto.class));
if(CollUtil.isNotEmpty(dtoList)) {
// 获取 approveName 属性并转换为逗号分隔的字符串
String approveNames = dtoList.stream()
.map(DataWorkApproveInfoDto::getName) // 假设存在 getApproveName 方法
.filter(Objects::nonNull) // 过滤掉 null 值
.collect(Collectors.joining(","));
return approveNames;
}
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return null;
}
@Named("convertTicketType")
default String convertTicketType(String ticketType) {
return DataTicketTypeEnum.getByNum(ticketType)==null?null:DataTicketTypeEnum.getByNum(ticketType).getCode();
}
@Named("convertAlarmType")
default String convertAlarmType(String alarmType) {
return DataAlarmTypeEnum.getByDesc(alarmType);
}
@Named("convertGender")
default String convertGender(String gender) {
return DataGenderEnum.getByTyCode(gender);
}
@Named("convertDangerManageType")
default String convertDangerManageType(String dangerManageType) {
return DataDangerManageTypeEnum.getByTyCode(dangerManageType);
}
@Named("convertDangerLevel")
default String convertDangerLevel(String dangerLevel) {
return DataDangerLevelEnum.getByTyCode(dangerLevel);
}
@Named("convertCheckStatus")
default String convertCheckStatus(String checkStatus) {
return DataCheckStatusEnum.getByTyCode(checkStatus);
}
@Named("convertWorkType")
default String convertWorkType(String workType) {
return DataWorkTypeEnum.getByTyCode(workType);
}
@Named("convertcheckCycleUnit")
default String convertcheckCycleUnit(String checkCycleUnit) {
return DataCheckCycleUnitEnum.getByTyCode(checkCycleUnit);
}
@Named("convertDataSrc")
default String convertDataSrc(String dataSrc) {
return DataDataSrcEnum.getByTyCode(dataSrc);
}
@Named("convertClassify1")
default String convertClassify1(String classify1) {
return DataClassify1Enum.getByTyCode(classify1);
}
@Named("convertClassify2")
default String convertClassify2(String classify2) {
return DataClassify2Enum.getByTyCode(classify2);
}
/**
*
*
* @param riskLevel
* @return
*/
@Named("convertRiskLevel")
default String convertRiskLevel(String riskLevel) {
return DataRiskLeveEnum.getByTyCode(riskLevel);
}
@Named("convertDateString")
default String convertDateString(String sourceDate) {
if (sourceDate == null) {
return null;
}
try {
DateTimeFormatter sourceFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
DateTimeFormatter targetFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
LocalDateTime dateTime = LocalDateTime.parse(sourceDate, sourceFormatter);
return dateTime.format(targetFormatter);
} catch (DateTimeParseException e) {
return null;
}
}
}

View File

@ -0,0 +1,973 @@
package com.zcloud.modules.data.thirdservice.data.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zcloud.common.utils.R;
import com.zcloud.modules.bussiness.entity.BusCompanyThirdRelationEntity;
import com.zcloud.modules.bussiness.entity.BusThirdDataItemsRelationEntity;
import com.zcloud.modules.bussiness.entity.BusThirdPlatformEntity;
import com.zcloud.modules.bussiness.service.BusCompanyThirdRelationService;
import com.zcloud.modules.bussiness.service.BusThirdDataItemsRelationService;
import com.zcloud.modules.bussiness.service.BusThirdPlatformService;
import com.zcloud.modules.data.dao.business.DynamicTableDao;
import com.zcloud.modules.data.dto.neimenggu.ty.TyEncryptionDto;
import com.zcloud.modules.data.dto.data.req.*;
import com.zcloud.modules.data.entity.business.BusLogInfoYearEntity;
import com.zcloud.modules.data.entity.data.*;
import com.zcloud.modules.data.enums.nmg.ty.url.TyReportV16Enum;
import com.zcloud.modules.data.enums.business.BusIsRequiredEnum;
import com.zcloud.modules.data.enums.business.BusPushFrequencyEnum;
import com.zcloud.modules.data.enums.business.BusThirdPlatformCodeEnum;
import com.zcloud.modules.data.enums.common.LogInfoYearTypeEnum;
import com.zcloud.modules.data.enums.data.DataIsDeleteEnum;
import com.zcloud.modules.data.enums.data.DataPushStatusEnum;
import com.zcloud.modules.data.enums.data.DataReceiveStatusEnum;
import com.zcloud.modules.data.service.business.BusLogInfoYearService;
import com.zcloud.modules.data.service.data.DataAramService;
import com.zcloud.modules.data.service.data.DataPushScheduledService;
import com.zcloud.modules.data.service.data.DataServiceAggregate;
import com.zcloud.modules.data.thirdservice.nmg.ty.impl.TyReportUtilServiceImpl;
import com.zcloud.modules.data.thirdservice.data.ExchangeDataCommonService;
import com.zcloud.modules.data.thirdservice.data.convert.ScyqDtoConvertMapper;
import com.zcloud.modules.util.HandBeanUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
*
*
* [V1.6_new.doc]:<a href="http://47.92.113.182:3000/docking/doc/src/branch/main/%E5%9B%AD%E5%8C%BA%E7%BA%A7%E5%AF%B9%E6%8E%A5%E6%96%87%E4%BB%B6/%E5%9C%9F%E5%8F%B3%E5%9B%AD%E5%8C%BA%E4%BC%81%E4%B8%9A%E5%B9%B3%E5%8F%B0%E6%95%B0%E6%8D%AE%E4%BA%A4%E6%8D%A2%E8%A7%84%E8%8C%83V1.6_new.doc">git</a>
*/
@Service
@Slf4j
public class ScyqExchangeDataServiceImpl implements ExchangeDataCommonService {
@Autowired
private DataServiceAggregate dataServiceAggregate;
@Autowired
private BusThirdDataItemsRelationService thirdDataItemsRelationService;
@Autowired
private BusThirdPlatformService thirdPlatformService;
@Autowired
private BusCompanyThirdRelationService companyThirdRelationService;
@Autowired
private BusLogInfoYearService busLogInfoYearService;
@Autowired
private TyReportUtilServiceImpl tyReportUtilService;
@Autowired
private DataPushScheduledService dataPushScheduledService;
@Autowired
@Qualifier("dataPushThreadPool") // 通过 @Qualifier 指定 Bean 名称
private ThreadPoolTaskExecutor dataPushThreadPool;
@Autowired
private DynamicTableDao dynamicTableDao;
@Autowired
private DataAramService dataAramService;
@Override
public R pushRiskUnitData(DataRiskUnitReqDto reqDto) {
R r;
try {
r = processData(reqDto, DataRiskUnitEntity.class, TyReportV16Enum.secSecurityRiskUnit,
entity -> ScyqDtoConvertMapper.INSTANCE.convertSafeRiskUnitReqDto((DataRiskUnitEntity) entity),
dataServiceAggregate.dataRiskUnitService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushRiskUnitData,{}推送上报安全风险分析单元数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), reqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报安全风险分析单元数据异常");
}
return r;
}
@Override
public R pushRiskEventsData(DataRiskEventsReqDto reqDto) {
R r;
try {
r = processData(reqDto, DataRiskEventsEntity.class, TyReportV16Enum.secSecurityRiskEvents,
entity -> ScyqDtoConvertMapper.INSTANCE.convertSafeRiskEventsReqDto((DataRiskEventsEntity) entity),
dataServiceAggregate.dataRiskEventsService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushRiskEventsData,{}推送上报安全风险事件数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), reqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报安全风险事件数据异常");
}
return r;
}
@Override
public R pushRiskObjectData(DataRiskObjectReqDto dataRiskObjectReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushRiskObjectData,{}暂时不支持推送分享分析对象数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushRiskControlMeasureData(DataRiskControlMeasureReqDto dataRiskControlMeasureReqDto) {
R r;
try {
r = processData(dataRiskControlMeasureReqDto, DataRiskControlMeasureEntity.class, TyReportV16Enum.secSecurityRiskControlMeasures,
entity -> ScyqDtoConvertMapper.INSTANCE.convertControlMeasureReqDto((DataRiskControlMeasureEntity) entity),
dataServiceAggregate.dataRiskControlMeasureService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushRiskControlMeasureData,{}推送上报安全风险控制措施数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataRiskControlMeasureReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报安全风险控制措施数据异常");
}
return r;
}
@Override
public R pushRiskIdentificationData(DataRiskIdentificationReqDto dataRiskIdentificationReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushRiskIdentificationData,{}暂时不支持推送上报安全风险识别数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushHiddenCheckMissionData(DataHiddenCheckMissionReqDto dataHiddenCheckMissionReqDto) {
R r;
try {
r = processData(dataHiddenCheckMissionReqDto, DataHiddenCheckMissionEntity.class, TyReportV16Enum.secHiddenCheckMission,
entity -> ScyqDtoConvertMapper.INSTANCE.convertHiddenCheckMissionReqDto((DataHiddenCheckMissionEntity) entity),
dataServiceAggregate.dataHiddenCheckMissionService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushHiddenCheckMissionData,{}推送上报隐患排查任务数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataHiddenCheckMissionReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报隐患排查任务数据异常");
}
return r;
}
@Override
public R pushDangerCheckRecordData(DataDangerCheckRecordReqDto dataDangerCheckRecordReqDto) {
R r;
try {
r = processData(dataDangerCheckRecordReqDto, DataDangerCheckRecordEntity.class, TyReportV16Enum.secHiddenCheckRecord,
entity -> ScyqDtoConvertMapper.INSTANCE.convertDangerCheckRecordReqDto((DataDangerCheckRecordEntity) entity),
dataServiceAggregate.dataDangerCheckRecordService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushDangerCheckRecordData,{}推送上报隐患排查记录数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataDangerCheckRecordReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报隐患排查记录数据异常");
}
return r;
}
@Override
public R pushDangerInfoData(DataDangerInfoReqDto dangerInfoReqDto) {
R r;
try {
r = processData(dangerInfoReqDto, DataDangerInfoEntity.class, TyReportV16Enum.secHiddenDangerInfo,
entity -> ScyqDtoConvertMapper.INSTANCE.convertDangerInfoReqDto((DataDangerInfoEntity) entity),
dataServiceAggregate.dataDangerInfoService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushDangerInfoData,{}推送上报隐患信息异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dangerInfoReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报隐患信息异常");
}
return r;
}
@Override
public R pushUnitStopData(DataUnitStopReqDto dataUnitStopReqDto) {
R r;
try {
r = processData(dataUnitStopReqDto, DataUnitStopEntity.class, TyReportV16Enum.secDeactivatedMaintenanceRecord,
entity -> ScyqDtoConvertMapper.INSTANCE.convertUnitStopReqDto((DataUnitStopEntity) entity),
dataServiceAggregate.dataUnitStopService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushUnitStopData,{}推送上报停用/检修记录数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataUnitStopReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报停用/检修记录数据异常");
}
return r;
}
@Override
public R pushProductionPromiseData(DataProductionPromiseReqDto dataProductionPromiseReqDto) {
R r;
try {
r = processData(dataProductionPromiseReqDto, DataProductionPromiseEntity.class, TyReportV16Enum.secProductionPromise,
entity -> ScyqDtoConvertMapper.INSTANCE.convertProductionPromiseReqDto((DataProductionPromiseEntity) entity),
dataServiceAggregate.dataProductionPromiseService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushProductionPromiseData,{}推送上报安全承诺数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataProductionPromiseReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报安全承诺数据异常");
}
return r;
}
@Override
public R pushDeviceRunStatusData(DataDeviceRunStatusReqDto dataDeviceRunStatusReqDto) {
R r;
try {
r = processData(dataDeviceRunStatusReqDto, DataDeviceRunStatusEntity.class, TyReportV16Enum.secDeviceRunStatus,
entity -> ScyqDtoConvertMapper.INSTANCE.convertDeviceRunStatusReqDto((DataDeviceRunStatusEntity) entity),
dataServiceAggregate.dataDeviceRunStatusService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushProductionPromiseData,{}推送上报承诺装置运行状态数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataDeviceRunStatusReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报承诺装置运行状态数据异常");
}
return r;
}
@Override
public R pushPromiseTicketData(DataPromiseTicketReqDto dataPromiseTicketReqDto) {
R r;
try {
r = processData(dataPromiseTicketReqDto, DataPromiseTicketEntity.class, TyReportV16Enum.secProductionPromiseTicket,
entity -> ScyqDtoConvertMapper.INSTANCE.convertPromiseTicketReqDto((DataPromiseTicketEntity) entity),
dataServiceAggregate.dataPromiseTicketService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushPromiseTicketData,{}推送上报安全承诺作业票详情数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataPromiseTicketReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报安全承诺作业票详情数据异常");
}
return r;
}
@Override
public R pushCarRecordData(DataCarRecordReqDto dataCarRecordReqDto) {
R r;
try {
r = processData(dataCarRecordReqDto, DataCarRecordEntity.class, TyReportV16Enum.secCarRecord,
entity -> ScyqDtoConvertMapper.INSTANCE.convertCarRecordReqDto((DataCarRecordEntity) entity),
dataServiceAggregate.dataCarRecordService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushCarRecordData,{}推送上报卡口车辆通行记录数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataCarRecordReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报卡口车辆通行记录数据异常");
}
return r;
}
@Override
public R pushPersonRecordData(DataPersonRecordReqDto dataPersonRecordReqDto) {
R r;
try {
r = processData(dataPersonRecordReqDto, DataPersonRecordEntity.class, TyReportV16Enum.secPersonRecord,
entity -> ScyqDtoConvertMapper.INSTANCE.convertPersonRecordReqDto((DataPersonRecordEntity) entity),
dataServiceAggregate.dataPersonRecordService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushPersonRecordData,{}推送上报卡口人员通行记录数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataPersonRecordReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报卡口人员通行记录数据异常");
}
return r;
}
@Override
public R pushEquipDataReceivingData(DataEquipDataReceivingReqDto dataEquipDataReceivingReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushEquipDataReceivingData,{}园区暂时不支持推送雷电预警设备基础数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushPushDataReceivingData(DataPushDataReceivingReqDto dataPushDataReceivingReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushPushDataReceivingData,{}园区暂时不支持推送雷电预警预警数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushEnvironmentReceivingData(DataEnvironmentReceivingReqDto dataEnvironmentReceivingReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushEnvironmentReceivingData,{}园区暂时不支持推送雷电预警环境数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushEmployeeInfoData(DataEmployeeInfoReqDto dataEmployeeInfoReqDto) {
R r;
try {
r = processData(dataEmployeeInfoReqDto, DataEmployeeInfoEntity.class, TyReportV16Enum.secEmployeeFile,
entity -> ScyqDtoConvertMapper.INSTANCE.convertEmployeeInfoReqDto((DataEmployeeInfoEntity) entity),
dataServiceAggregate.dataEmployeeInfoService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushEmployeeInfoData,{}推送上报人员基础数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataEmployeeInfoReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报人员基础数据异常");
}
return r;
}
@Override
public R pushEmployeeLicenseData(DataEmployeeLicenseReqDto dataEmployeeLicenseReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushEmployeeLicenseData,{}暂时不支持推送人员证件信息", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushEmployeeLocationData(DataEmployeeLocationReqDto dataEmployeeLocationReqDto) {
R r;
try {
r = processData(dataEmployeeLocationReqDto, DataEmployeeLocationEntity.class, TyReportV16Enum.secEmployeeRealLoaction,
entity -> ScyqDtoConvertMapper.INSTANCE.convertEmployeeLocationReqDto((DataEmployeeLocationEntity) entity),
dataServiceAggregate.dataEmployeeLocationService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushEmployeeLocationData,{}推送上报人员实时定位数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataEmployeeLocationReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报人员实时定位数据异常");
}
return r;
}
@Override
public R pushEmployeeAlarmData(DataEmployeeAlarmReqDto dataEmployeeAlarmReqDto) {
R r;
try {
r = processData(dataEmployeeAlarmReqDto, DataEmployeeAlarmEntity.class, TyReportV16Enum.secEmployeeAlarmData,
entity -> ScyqDtoConvertMapper.INSTANCE.convertEmployeeAlarmReqDto((DataEmployeeAlarmEntity) entity),
dataServiceAggregate.dataEmployeeAlarmService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushEmployeeAlarmData,{}推送上报人员报警数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataEmployeeAlarmReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报人员报警数据异常");
}
return r;
}
@Override
public R pushEmployeeGatherData(DataEmployeeGatherReqDto dataEmployeeGatherReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushEmployeeGatherData,{}暂时不支持推送上报人员聚集数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushZoneInfoData(DataZoneInfoReqDto dataZoneInfoReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushZoneInfoData,{}暂时不支持推送上报区域边界数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushZoneAlarmData(DataZoneAlarmReqDto dataZoneAlarmReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushZoneAlarmData,{}暂时不支持推送上报区域报警数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushWorkApprovalData(DataWorkApprovalReqDto dataWorkApprovalReqDto) {
R r;
try {
r = processData(dataWorkApprovalReqDto, DataWorkApprovalEntity.class, TyReportV16Enum.secSpecialJobTicketApproval,
entity -> ScyqDtoConvertMapper.INSTANCE.convertWorkApprovalReqDto((DataWorkApprovalEntity) entity),
dataServiceAggregate.dataWorkApprovalService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushWorkApprovalData,{}推送上报特殊作业审批记录数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataWorkApprovalReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报特殊作业审批记录数据异常");
}
return r;
}
@Override
public R pushWorkSafetyData(DataWorkSafetyReqDto dataWorkSafetyReqDto) {
R r;
try {
r = processData(dataWorkSafetyReqDto, DataWorkSafetyEntity.class, TyReportV16Enum.secSpecialJobTicketSafetyMeasures,
entity -> ScyqDtoConvertMapper.INSTANCE.convertWorkSafetyReqDto((DataWorkSafetyEntity) entity),
dataServiceAggregate.dataWorkSafetyService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushWorkSafetyData,{}推送上报特殊作业安全措施记录数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataWorkSafetyReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报特殊作业安全措施记录数据异常");
}
return r;
}
@Override
public R pushWorkGasAnalysisData(DataWorkGasAnalysisReqDto dataWorkGasAnalysisReqDto) {
R r;
try {
r = processData(dataWorkGasAnalysisReqDto, DataWorkGasAnalysisEntity.class, TyReportV16Enum.secSpecialJobTicketGasAnalysis,
entity -> ScyqDtoConvertMapper.INSTANCE.convertWorkGasAnalysisReqDto((DataWorkGasAnalysisEntity) entity),
dataServiceAggregate.dataWorkGasAnalysisService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushWorkSafetyData,{}推送上报特殊作业安全措施记录数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataWorkGasAnalysisReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报特殊作业安全措施记录数据异常");
}
return r;
}
@Override
public R pushWorkCheckAcceptData(DataWorkCheckAcceptReqDto dataWorkGasAnalysisReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushWorkCheckAcceptData,{}暂时不支持推送特殊作业验收信息数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushWorkVideoData(DataWorkVideoReqDto dataWorkVideoReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushWorkVideoData,{}暂时不支持推送特殊作业和视频关联数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushWorkFileData(DataWorkFileReqDto dataWorkFileReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushWorkFileData,{}暂时不支持推送特殊作业附件数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushWorkHotData(DataWorkHotReqDto dataWorkHotReqDto) {
R r;
try {
r = processData(dataWorkHotReqDto, DataWorkHotEntity.class, TyReportV16Enum.secSpecialJobTicketFire,
entity -> ScyqDtoConvertMapper.INSTANCE.convertWorkHotReqDto((DataWorkHotEntity) entity),
dataServiceAggregate.dataWorkHotService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushWorkHotData,{}推送上报动火作业票信息数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataWorkHotReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报动火作业票信息数据异常");
}
return r;
}
@Override
public R pushWorkSpaceData(DataWorkSpaceReqDto dataWorkSpaceReqDto) {
R r;
try {
r = processData(dataWorkSpaceReqDto, DataWorkSpaceEntity.class, TyReportV16Enum.secSpecialJobTicketSpace,
entity -> ScyqDtoConvertMapper.INSTANCE.convertWorkSpaceReqDto((DataWorkSpaceEntity) entity),
dataServiceAggregate.dataWorkSpaceService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushWorkSpaceData,{}推送上报受限空间作业票信息异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataWorkSpaceReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报受限空间作业票信息异常");
}
return r;
}
@Override
public R pushWorkBlindplateData(DataWorkBlindplateReqDto dataWorkBlindplateReqDto) {
R r;
try {
r = processData(dataWorkBlindplateReqDto, DataWorkBlindplateEntity.class, TyReportV16Enum.secSpecialJobTicketBlindplate,
entity -> ScyqDtoConvertMapper.INSTANCE.convertWorkBlindplateReqDto((DataWorkBlindplateEntity) entity),
dataServiceAggregate.dataWorkBlindplateService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushWorkBlindplateData,{}推送上报盲板抽堵作业票信息异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataWorkBlindplateReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报盲板抽堵作业票信息异常");
}
return r;
}
@Override
public R pushWorkHighData(DataWorkHighReqDto dataWorkHighReqDto) {
R r;
try {
r = processData(dataWorkHighReqDto, DataWorkHighEntity.class, TyReportV16Enum.secSpecialJobTicketHigh,
entity -> ScyqDtoConvertMapper.INSTANCE.convertWorkHighReqDto((DataWorkHighEntity) entity),
dataServiceAggregate.dataWorkHighService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushWorkHighData,{}推送上报高处作业票信息异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataWorkHighReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报高处作业票信息异常");
}
return r;
}
@Override
public R pushWorkHoisingData(DataWorkHoisingReqDto dataWorkHoisingReqDto) {
R r;
try {
r = processData(dataWorkHoisingReqDto, DataWorkHoisingEntity.class, TyReportV16Enum.secSpecialJobTicketHoising,
entity -> ScyqDtoConvertMapper.INSTANCE.convertWorkHoisingReqDto((DataWorkHoisingEntity) entity),
dataServiceAggregate.dataWorkHoisingService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushWorkHoisingData,{}推送上报吊装作业票信息异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataWorkHoisingReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报吊装作业票信息异常");
}
return r;
}
@Override
public R pushWorkPowerData(DataWorkPowerReqDto dataWorkPowerReqDto) {
R r;
try {
r = processData(dataWorkPowerReqDto, DataWorkPowerEntity.class, TyReportV16Enum.secSpecialJobTicketPower,
entity -> ScyqDtoConvertMapper.INSTANCE.convertWorkPowerReqDto((DataWorkPowerEntity) entity),
dataServiceAggregate.dataWorkPowerService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushWorkPowerData,{}推送上报临时用电作业票数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataWorkPowerReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报临时用电作业票数据异常");
}
return r;
}
@Override
public R pushWorkGroundBreakData(DataWorkGroundBreakReqDto dataWorkGroundBreakReqDto) {
R r;
try {
r = processData(dataWorkGroundBreakReqDto, DataWorkGroundBreakEntity.class, TyReportV16Enum.secSpecialJobTicketSoil,
entity -> ScyqDtoConvertMapper.INSTANCE.convertWorkGroundBreakReqDto((DataWorkGroundBreakEntity) entity),
dataServiceAggregate.dataWorkGroundBreakService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushWorkPowerData,{}推送上报动土作业票信息数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataWorkGroundBreakReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报动土作业票信息数据异常");
}
return r;
}
@Override
public R pushWorkBreakData(DataWorkBreakReqDto dataWorkBreakReqDto) {
R r;
try {
r = processData(dataWorkBreakReqDto, DataWorkBreakEntity.class, TyReportV16Enum.secSpecialJobTicketBreak,
entity -> ScyqDtoConvertMapper.INSTANCE.convertWorkBreakReqDto((DataWorkBreakEntity) entity),
dataServiceAggregate.dataWorkBreakService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushWorkPowerData,{}推送上报断路作业票信息数据异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataWorkBreakReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报断路作业票信息数据异常");
}
return r;
}
@Override
public R pushWorkPouringData(DataWorkPouringReqDto dataWorkBreakReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushWorkPouringData,{}暂时不支持推送倒罐作业票信息数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushWorkTankCleaningData(DataWorkTankCleaningReqDto dataWorkTankCleaningReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushWorkTankCleaningData,{}暂时不支持推送清罐作业票信息数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushWorkWaterData(DataWorkWaterReqDto dataWorkWaterReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushWorkWaterData,{}暂时不支持推送切水作业票信息数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushWorkInspectionData(DataWorkInspectionReqDto dataWorkInspectionReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushWorkInspectionData,{}暂时不支持推送检维修作业票信息数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushWorkJobData(DataWorkJobReqDto dataWorkJobReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushWorkJobData,{}暂时不支持推送作业活动信息数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushStartStopWorkData(DataStartStopWorkReqDto dataStartStopWorkReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushStartStopWorkData,{}暂时不支持推送开停车数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushMeanwhileData(DataMeanwhileReqDto dataMeanwhileReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushMeanwhileData,{}暂时不支持推送三同数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushMaintenanceData(DataMaintenanceReqDto dataMaintenanceReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushMaintenanceData,{}暂时不支持推送上报大检修数据", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushHiddenDangerPlanData(DataHiddenDangerPlanReqDto dataHiddenDangerPlanReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushHiddenDangerPlanData,{}暂时不支持推送上报隐患排查清单", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushCheckDangerData(DataCheckDangerReqDto dataCheckDangerReqDto) {
R r;
try {
r = processData(dataCheckDangerReqDto, DataCheckDangerEntity.class, TyReportV16Enum.secHiddenDanerInfoCheck,
entity -> ScyqDtoConvertMapper.INSTANCE.convertCheckDangerReqDto((DataCheckDangerEntity) entity),
dataServiceAggregate.dataCheckDangerService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushCheckDangerData,{}推送上报专项检查隐患信息记录异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataCheckDangerReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报专项检查隐患信息记录异常");
}
return r;
}
@Override
public R pushCheckRecordData(DataCheckRecordReqDto dataCheckRecordReqDto) {
R r;
try {
r = processData(dataCheckRecordReqDto, DataCheckRecordEntity.class, TyReportV16Enum.tbBaseCheckRecord,
entity -> ScyqDtoConvertMapper.INSTANCE.convertCheckRecordReqDto((DataCheckRecordEntity) entity),
dataServiceAggregate.dataCheckRecordService);
} catch (Exception e) {
log.error("ScyqExchangeDataServiceImpl->pushCheckRecordData,{}推送上报专项检查情况记录异常,业务id={},异常信息:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataCheckRecordReqDto.getDataId(), ExceptionUtils.getStackTrace(e));
e.printStackTrace();
return R.error(500, BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"推送上报专项检查情况记录异常");
}
return r;
}
@Override
public R pushPerformanceOverview(DataPerformanceOverviewReqDto dataPerformanceOverviewReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushPerformanceOverview,{}暂时不支持新增包保责任人履职概览统计信息", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushEnterpriseInfo(DataEnterpriseInfoReqDto dataEnterpriseInfoReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushEnterpriseInfo,{}暂时不支持推送企业基本信息", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushStoreInfo(DataStoreInfoReqDto dataStoreInfoReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushStoreInfo,{}暂时不支持上报仓库基本信息", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushStoreRoomInfo(DataStoreRoomInfoReqDto dataStoreRoomInfoReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushStoreRoomInfo,{}暂时不支持上报库房基本信息", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushPersonCarCount(DataPersonCarCountReqDto dataPersonCarCountReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushPersonCarCount,{}暂时不支持上报进入企业人员车辆信息统计信息", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushDeviceInfo(DataDeviceInfoReqDto dataDeviceInfoReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushDeviceInfo,{}暂时不支持上报设备信息", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushComputerInfo(DataComputerInfoReqDto dataComputerInfoReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushComputerInfo,{}暂时不支持上报服务器信息", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushTemperatureInfo(DataTemperatureInfoReqDto dataTemperatureInfoReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushTemperatureInfo,{}暂时不支持上报温度信息", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushHumidityInfo(DataHumidityInfoReqDto dataHumidityInfoReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushHumidityInfo,{}暂时不支持上报湿度信息", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushEnterpriseAlarm(DataEnterpriseAlarmReqDto dataEnterpriseAlarmReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushEnterpriseAlarm,{}暂时不支持上报企业报警信息", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
@Override
public R pushEnterpriseAlarmRecord(DataEnterpriseAlarmRecordReqDto dataEnterpriseAlarmRecordReqDto) {
log.info("ScyqExchangeDataServiceImpl->pushEnterpriseAlarmRecord,{}暂时不支持上报企业报警信息记录", BusThirdPlatformCodeEnum.SICHUAN.getDesc());
return R.ok();
}
/**
*
*
* @param reqDto DTO
* @param entityClass Class
* @param reportEnum
* @param converter
* @param <T> DTO
* @param <E>
* @param <D> DTO
* @return
*/
private <T extends DataCommonReqDto, E, D> R processData(T reqDto, Class<E> entityClass, TyReportV16Enum reportEnum, Function<E, D> converter, Object dataService) throws Exception {
log.info("ScyqExchangeDataServiceImpl->,接收到推送{}的数据信息,数据id={},服务平台id={},企业编码={},推送类型:{},数据信息={}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), reqDto.getDataId(), reqDto.getServicePlatformId(), reqDto.getCompanyCode(), reportEnum.getDesc(), JSONUtil.toJsonStr(reqDto));
// 查找上游推送配置信息
BusCompanyThirdRelationEntity companyThirdRelation = getCompanyThirdRelation(reqDto);
// 记录请求日志信息
BusLogInfoYearEntity busLogInfoYearEntity = new BusLogInfoYearEntity();
//获取实体bean进行copyProperties及赋值服务平台id和企业编码
E entity = entityClass.getDeclaredConstructor().newInstance();
// BeanUtils.copyProperties(reqDto, entity);
HandBeanUtils.copyProperties(reqDto, entity);
//获取bean中的属性
Integer servicePlatformId = (Integer) getEntityMethodValue(entity, entityClass, "getServicePlatformId");
Object companyCode = getEntityMethodValue(entity, entityClass, "getCompanyCode");
Integer thirdPlatformId = (Integer) getEntityMethodValue(entity, entityClass, "getThirdPlatformId");
Integer companyId = (Integer) getEntityMethodValue(entity, entityClass, "getCompanyId");
// 记录推送状态
setEntityPushStatus(entity, entityClass, "setPushStatus", DataPushStatusEnum.NOT.getCode());
//赋值busLogInfoYearEntity 属性
String businessType = (String) getEntityMethodValue(entity, entityClass, "getBusinessType");
String dataId = (String) getEntityMethodValue(entity, entityClass, "getDataId");
busLogInfoYearEntity.setBusinessType(businessType);
busLogInfoYearEntity.setIndexReq(dataId);
log.info("ScyqExchangeDataServiceImpl->,接收到推送{}的数据信息,dataId={},服务平台id={},企业编码={},推送类型:{},", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataId, servicePlatformId, companyCode, reportEnum.getDesc());
busLogInfoYearEntity.setReceiver(getPlatformCode());
busLogInfoYearEntity.setReceiverUrl(companyThirdRelation.getUrl() + "/" + reportEnum.getUrl());
// 校验数据项信息
List<BusThirdDataItemsRelationEntity> dataItemsList = thirdDataItemsRelationService.getThirdDataItemlist(
thirdPlatformId,
businessType);
if (CollUtil.isEmpty(dataItemsList)) {
// 推送的数据项为空,不进行推送,记录日志
log.error("ScyqExchangeDataServiceImpl->,接收到推送{}的数据信息,dataId={},服务平台id={},企业编码={},推送类型:{},配置的推送的数据项为空,不进行推送", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataId, servicePlatformId, companyCode, reportEnum.getDesc());
busLogInfoYearEntity.setResponse("推送的数据项为空,不进行推送");
//设置推送状态和接收状态
setEntityPushStatus(entity, entityClass, "setReceiveStatus", DataReceiveStatusEnum.FAIL.getCode());
setEntityPushStatus(entity, entityClass, "setPushStatus", DataPushStatusEnum.FAILED.getCode());
//保存数据
Method saveMethod = dataService.getClass().getMethod("saveOrUpdate", Object.class);
saveMethod.invoke(dataService, entity);
//记录日志中id
Long id = (Long) getEntityMethodValue(entity, entityClass, "getId");
busLogInfoYearEntity.setDataId(id);
busLogInfoYearService.save(busLogInfoYearEntity);
return R.error(500, "推送" + BusThirdPlatformCodeEnum.SICHUAN.getDesc() + "未配置数据项,不进行推送");
}
// 校验参数是否必填
List<String> nullRequiredFieldNameList = new ArrayList<>();
E newEntity = checkFileName(entityClass, dataItemsList, reqDto, nullRequiredFieldNameList);
// 校验必填字段是否都填写
if (CollUtil.isNotEmpty(nullRequiredFieldNameList)) {
log.error("ScyqExchangeDataServiceImpl->,接收到推送{}的数据信息,dataId={},服务平台id={},企业编码={},推送类型:{},存在必填字段为空的情况,不进行推送,字段为:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataId, servicePlatformId, companyCode, reportEnum.getDesc(), nullRequiredFieldNameList);
// 存在必填字段为空的情况,不进行推送,记录日志
busLogInfoYearEntity.setResponse("存在必填字段为空的情况,不进行推送,字段为:" + nullRequiredFieldNameList);
//出现异常,设置推送状态
setEntityPushStatus(entity, entityClass, "setReceiveStatus", DataReceiveStatusEnum.FAIL.getCode());
setEntityPushStatus(entity, entityClass, "setPushStatus", DataPushStatusEnum.FAILED.getCode());
//保存数据
Method saveMethod = dataService.getClass().getMethod("saveOrUpdate", Object.class);
saveMethod.invoke(dataService, entity);
//记录日志中id
Long id = (Long) getEntityMethodValue(entity, entityClass, "getId");
busLogInfoYearEntity.setDataId(id);
busLogInfoYearService.save(busLogInfoYearEntity);
return R.error(500, "推送"+BusThirdPlatformCodeEnum.SICHUAN.getDesc()+"存在必填字段为空的情况,不进行推送,字段为:"+nullRequiredFieldNameList);
}
//说明校验没问题,接收正常,赋值
setEntityPushStatus(entity, entityClass, "setReceiveStatus", DataReceiveStatusEnum.SUCCESS.getCode());
// 保存本地信息
Method saveMethod = dataService.getClass().getMethod("saveOrUpdate", Object.class);
saveMethod.invoke(dataService, entity);
//记录日志中id
Long id = (Long) getEntityMethodValue(entity, entityClass, "getId");
busLogInfoYearEntity.setDataId(id);
// 组装业务数据
D dto = converter.apply(newEntity);
// 判断是否是定时推送
BusThirdPlatformEntity thirdPlatformInfo = thirdPlatformService.getById(thirdPlatformId);
busLogInfoYearEntity.setRequest(JSONUtil.toJsonStr(dto));
if (!BusPushFrequencyEnum.REALTIME.getCode().equals(thirdPlatformInfo.getFrequency())) {
// 定时推送,需要将数据存入数据库中,定时任务进行推送
setEntityPushStatus(entity, entityClass, "setPushStatus", DataPushStatusEnum.SCHEDULED.getCode());
Method saveOrUpdateMethod = dataService.getClass().getMethod("saveOrUpdate", Object.class);
saveOrUpdateMethod.invoke(dataService, entity);
// 异步保存定时推送数据
CompletableFuture.runAsync(() -> dataPushScheduledService.saveScheduledData(businessType, id, dataId, thirdPlatformId, dto, companyId, companyCode, thirdPlatformInfo.getFrequency(), servicePlatformId), dataPushThreadPool);
log.info("ScyqExchangeDataServiceImpl->,接收到推送{}的数据信息,dataId={},服务平台id={},企业编码={},推送类型:{},配置定时推送,暂时不推送", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataId, servicePlatformId, companyCode, reportEnum.getDesc());
} else {
log.info("ScyqExchangeDataServiceImpl->,接收到推送{}的数据信息,dataId={},服务平台id={},企业编码={},推送类型:{},配置实时推送", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataId, servicePlatformId, companyCode, reportEnum.getDesc());
//就此处和其他有区别
TyEncryptionDto configurationDto = new TyEncryptionDto();
configurationDto.setUrl(companyThirdRelation.getUrl());
if (companyThirdRelation.getCode().length() > 6) {
configurationDto.setCode(companyThirdRelation.getCode().substring(companyThirdRelation.getCode().length() - 6));
}
configurationDto.setCompanyCode(companyThirdRelation.getCompanyCode());
busLogInfoYearEntity.setType(LogInfoYearTypeEnum.SYSTEM.getCode());
Integer status = tyReportUtilService.pushData(dto, reportEnum, busLogInfoYearEntity, configurationDto, null);
// 返回的是推送状态
setEntityPushStatus(entity, entityClass, "setPushStatus", status);
setEntityPushStatus(entity, entityClass, "setPushTime", new Date());
Method updateMethod = dataService.getClass().getMethod("updateById", Object.class);
updateMethod.invoke(dataService, entity);
if (!DataPushStatusEnum.SUCCESSFUL.getCode().equals(status)) {
// 异步记录异常信息
CompletableFuture.runAsync(() -> dataAramService.saveDataAram(busLogInfoYearEntity), dataPushThreadPool);
return R.error(500, "推送" + BusThirdPlatformCodeEnum.SICHUAN.getDesc() + "推送失败");
}
}
return R.ok();
}
@Override
public void dataPushscheduled(List<DataPushScheduledEntity> dataPushScheduledEntities) {
log.info("dataPushscheduled,定时推送数据,{}数据数量:{}", BusThirdPlatformCodeEnum.SICHUAN.getDesc(), dataPushScheduledEntities.size());
//需要修改对应业务数据表状态修改log表状态修改定时表状态
for (int i = 0; i < dataPushScheduledEntities.size(); i++) {
DataPushScheduledEntity dataPushScheduledInfo = dataPushScheduledEntities.get(i);
TyReportV16Enum reportEnum = TyReportV16Enum.getByBusinessType(dataPushScheduledInfo.getBusinessType());
LambdaQueryWrapper<BusCompanyThirdRelationEntity> companyThirdRelationWrapper = new LambdaQueryWrapper<>();
companyThirdRelationWrapper.eq(BusCompanyThirdRelationEntity::getThirdPlatformId, dataPushScheduledInfo.getThirdPlatformId())
.eq(BusCompanyThirdRelationEntity::getServiceId, dataPushScheduledInfo.getServicePlatformId())
.eq(BusCompanyThirdRelationEntity::getCompanyId, dataPushScheduledInfo.getCompanyId())
.eq(BusCompanyThirdRelationEntity::getIsDelete, DataIsDeleteEnum.NO.getCode());
BusCompanyThirdRelationEntity companyThirdRelation = companyThirdRelationService.getOne(companyThirdRelationWrapper);
TyEncryptionDto configurationDto = new TyEncryptionDto();
configurationDto.setUrl(companyThirdRelation.getUrl());
configurationDto.setCode(companyThirdRelation.getCode().substring(companyThirdRelation.getCode().length() - 6));
configurationDto.setCompanyCode(companyThirdRelation.getCompanyCode());
BusLogInfoYearEntity logInfo = new BusLogInfoYearEntity();
logInfo.setBusinessType(dataPushScheduledInfo.getBusinessType());
logInfo.setDataId(dataPushScheduledInfo.getPushDataId());
logInfo.setRequest(dataPushScheduledInfo.getRequestData());
logInfo.setType(LogInfoYearTypeEnum.SCHEDULED.getCode());
logInfo.setIndexReq(dataPushScheduledInfo.getDataId());
Integer status = tyReportUtilService.pushData(logInfo.getRequest(), reportEnum, logInfo, configurationDto, null);
// 需要反查出对应的业务数据信息,修改状态 46张表怎么查动态拼接SQL
dynamicTableDao.updatePushStatus(status, dataPushScheduledInfo.getBusinessType(), dataPushScheduledInfo.getPushDataId());
if (!DataPushStatusEnum.SUCCESSFUL.getCode().equals(status)) {
// 异步记录异常信息
CompletableFuture.runAsync(() -> dataAramService.saveDataAram(logInfo), dataPushThreadPool);
}
dataPushScheduledInfo.setPushStatus(status);
dataPushScheduledInfo.setPushTime(new Date());
dataPushScheduledService.updateById(dataPushScheduledInfo);
DataAramEntity aramInfo = dataAramService.getAramInfo(dataPushScheduledInfo.getBusinessType(), dataPushScheduledInfo.getPushDataId());
if (aramInfo != null) {
aramInfo.setPushStatus(status);
dataAramService.updateById(aramInfo);
}
}
}
/**
*
*
* @param entity
* @param entityClass Class
* @param methodName
* @return
* @throws
*/
private Object getEntityMethodValue(Object entity, Class<?> entityClass, String methodName) throws Exception {
Method method = entityClass.getMethod(methodName);
return method.invoke(entity);
}
/**
*
*
* @param entity
* @param entityClass Class
* @param methodName
* @param value
* @param <T>
* @throws
*/
private <T> void setEntityPushStatus(Object entity, Class<?> entityClass, String methodName, T value) throws Exception {
// 获取属性值的类型
Class<?> valueClass = value != null ? value.getClass() : Object.class;
Method setMethod = entityClass.getMethod(methodName, valueClass);
setMethod.invoke(entity, value);
}
private BusCompanyThirdRelationEntity getCompanyThirdRelation(DataCommonReqDto reqDto) {
LambdaQueryWrapper<BusCompanyThirdRelationEntity> companyThirdRelationWrapper = new LambdaQueryWrapper<>();
companyThirdRelationWrapper.eq(BusCompanyThirdRelationEntity::getThirdPlatformId, reqDto.getThirdPlatformId())
.eq(BusCompanyThirdRelationEntity::getServiceId, reqDto.getServicePlatformId())
.eq(BusCompanyThirdRelationEntity::getCompanyId, reqDto.getCompanyId())
.eq(BusCompanyThirdRelationEntity::getIsDelete, DataIsDeleteEnum.NO.getCode());
List<BusCompanyThirdRelationEntity> companyThirdRelationList = companyThirdRelationService.list(companyThirdRelationWrapper);
//不判断为空,上层已校验
BusCompanyThirdRelationEntity companyThirdRelation = companyThirdRelationList.get(0);
return companyThirdRelation;
}
/**
*
*
* @param dataItemsList
*/
private <T> T checkFileName(Class<T> newEntityClass, List<BusThirdDataItemsRelationEntity> dataItemsList, DataCommonReqDto reqDto, List<String> nullRequiredFieldNameList) {
List<String> fieldNameList = dataItemsList.stream().map(BusThirdDataItemsRelationEntity::getFieldName).collect(Collectors.toList());
// 获取dataItemsList中所有is_required字段为1的field_name字段list
List<String> requiredFieldNameList = dataItemsList.stream().filter(item -> BusIsRequiredEnum.YES.getCode().equals(item.getIsRequired())).map(BusThirdDataItemsRelationEntity::getFieldName).collect(Collectors.toList());
// 将reqDto转成json并获取所有fieldNameList中的key重新组装成一个json对象
Map<String, Object> infoMap = JSONUtil.toBean(JSONUtil.toJsonStr(reqDto), Map.class);
// 将bean中所有key不在fieldNameList中的key移除
infoMap.keySet().removeIf(key -> !fieldNameList.contains(key));
// 验证infoMap中的 在requiredFieldNameList 总的key哪些是为空的返回list
nullRequiredFieldNameList.addAll(requiredFieldNameList.stream().filter(key -> ObjectUtil.isNull(infoMap.get(key))).collect(Collectors.toList()));
// 将infoMap转成新的实体对象
return JSONUtil.toBean(JSONUtil.toJsonStr(infoMap), newEntityClass);
}
@Override
public String getPlatformCode() {
return BusThirdPlatformCodeEnum.SICHUAN.getCode();
}
}

View File

@ -109,6 +109,7 @@ public class DsReportUtilServiceImpl implements DsReportUtilService {
logInfoYearEntity.setResponse(errmsg);
busLogInfoYearService.save(logInfoYearEntity);
// 此处出现异常需要发送mq重新推送
// 此处出现异常需要发送mq重新推送
if(number ==null){
number = tryNumberInit;
}

View File

@ -178,6 +178,7 @@ public class NmgReportUtilServiceImpl implements NmgReportUtilService {
Boolean isTryingAgain = false;
JSONObject jsonObject = JSONObject.parseObject(JSONUtil.toJsonStr(dtoList));
try {
// int i=1/0;
log.info("NmgReportUtilServiceImpl->发送请求,dataId={},参数url:{},请求参数:{}", logInfoYearEntity.getIndexReq(), url , JSONObject.toJSONString(singleItemList));
String info = encryPost(url, encryptionDto, singleItemList, String.class);

View File

@ -3,7 +3,7 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.20.230:33080/docking?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&characterEncoding=utf-8
url: jdbc:mysql://39.100.115.58:33080/docking?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&characterEncoding=utf-8
username: root
password: Mysql@zcloud33080
initial-size: 10
@ -54,8 +54,8 @@ logging:
org.springframework.kafka: ERROR
rocketmq:
# name-server: 192.168.20.230:9876
name-server: 127.0.0.1:9876
name-server: 192.168.20.230:9876
# name-server: 127.0.0.1:9876
producer:
group: docking-producer
compress-message-body-threshold: 4096

View File

@ -14,6 +14,7 @@ spring:
# 环境 dev|test|prod
profiles:
active: @spring.profiles.active@
# active: prod
# jackson时间格式化
jackson:
time-zone: GMT+8
@ -59,4 +60,4 @@ springdoc:
enabled: true # 是否启用接口文档
knife4j:
enable: true # 是否启用 knife4j 增强,如果只是使用 knife4j 的 UI,则可以关闭
production: false # 是否启用生产环境,生产环境会屏蔽 knife4j 的 UI,只暴露接口文档
production: false # 是否启用生产环境,生产环境会屏蔽 knife4j 的 UI,只暴露接口文档