Commit 40f05770 authored by chenzhao's avatar chenzhao

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents 79d346d9 349e3ee5
......@@ -26,16 +26,18 @@ spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
localhost=${spring.cloud.client.ip-address}
#注册中心地址
eureka.client.service-url.defaultZone =http://172.16.10.243:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.89:${server.port}${server.servlet.context-path}/swagger-ui.html
eureka.instance.ip-address=172.16.3.89
eureka.instance.status-page-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://${localhost}:${server.port}${server.servlet.context-path}/swagger-ui.html
eureka.instance.ip-address=${localhost}
eureka.instance.instance-id=${eureka.instance.ip-address}:${server.port}
##emqx
......
......@@ -128,6 +128,9 @@ public class JgChangeRegistrationUnitDto extends BaseDto {
@ApiModelProperty(value = "使用登记证列表")
private List<Map<String, Object>> registrationList;
@ApiModelProperty(value = "装置列表")
private List<Map<String, Object>> projectContraptionList;
@ApiModelProperty(value = "设备类别")
private String equType;
......
......@@ -181,6 +181,12 @@ public class JgReformNoticeDto extends BaseDto {
@ApiModelProperty (value = "告知设备列表")
private List<Map<String, Object>> deviceList;
@ApiModelProperty(value = "管道列表")
private List<Map<String, Object>> pipelineList;
@ApiModelProperty(value = "删除的管道列表")
private List<Map<String, Object>> delPipelineList;
@ApiModelProperty (value = "区名字")
private String countyName;
......
......@@ -70,4 +70,9 @@ public class JgChangeRegistrationUnitEq extends BaseEntity {
@TableField("create_user_name")
private String createUserName;
/**
* 装置Id
*/
@TableField("project_contraption_id")
private String projectContraptionId;
}
package com.yeejoin.amos.boot.module.jg.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum RegistrationTypeEnum {
新设备首次启用("新设备首次启用","DJ_SY"),
历史无证设备登记("历史无证设备登记","SP_TT");
private String name;
private String code;
public static String getNameByType(String code) {
String name = null;
for (RegistrationTypeEnum enumOne : RegistrationTypeEnum.values()) {
if (enumOne.getCode().equals(code)) {
name = enumOne.getName();
break;
}
}
return name;
}
}
......@@ -4,6 +4,7 @@ import lombok.Getter;
/**
* 业务类型枚举
* 枚举code需同字典表中问题类型(type=ISSUE_TYPE)code保持一致
*
* @author Administrator
*/
......@@ -18,7 +19,7 @@ public enum SafetyProblemTypeEnum {
WBCQ("1", "维保超期", "设备维保超期", "safetyProblemTracing/wb/cq", "outOfMaintenanceRecords"),
WBBA("11", "维保合同备案", "设备维保合同备案", "safetyProblemTracing/wb/ba", null),
XKCQ("3", "许可超期", "企业许可超期", "safetyProblemTracing/xk/cq", null),
ZZCQ("4", "人员资质超期", "人员资质超期", "safetyProblemTracing/zz/cq", null);
ZZCQ("9", "资质超期", "人员资质超期", "safetyProblemTracing/zz/cq", null);
private final String code;
......
......@@ -44,7 +44,13 @@ public interface JgChangeRegistrationReformMapper extends BaseMapper<JgChangeReg
@Select("select name from tz_equipment_category where code=#{code}")
String getEquiplistNameByEquiplist(String code);
List<Map<String, Object>> getDetailById(@Param("id") Long id);
/**
*
* @param id 主键
* @param equListCode 设备种类
* @return 压力管道或者其他详情
*/
List<Map<String, Object>> getDetailById(@Param("id") Long id, @Param("equListCode") String equListCode);
List<CompanyEquipCountDto> queryForFlowingEquipList();
......
......@@ -6,8 +6,9 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.CertificateVo;
import org.apache.ibatis.annotations.MapKey;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -37,4 +38,10 @@ public interface JgUseRegistrationManageMapper extends BaseMapper<JgUseRegistrat
List<Map<String, String>> initUseRegistrationCodeIntoRedis(@Param("year") String year);
List<Map<String, String>> initVehicleUseRegCodeIntoRedis(@Param("year") String year);
Page<IdxBizJgProjectContraption> queryForUnitByProjectContraptionPage(@Param("page") Page<IdxBizJgProjectContraption> page,
@Param("dto") Map<String, String> params,
@Param("sort") SortVo sortMap);
JgUseRegistrationManage getLatestJgUseRegistrationManage(@Param("useUnitCreditCode")String useUnitCreditCode, @Param("equDefineCode")String equDefineCode);
}
......@@ -92,6 +92,8 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
List<Map<String,Object>> getUseRegisterCount(@Param("orgCode")String orgCode);
List<Map<String,Object>> getUseRegisterCountTotal();
List<Map<String, Object>> getElevatorModeList(@Param("equIds") List<String> equIds);
List<Map<String, Object>> getCylinderInfoList(@Param("records") List<String> records);
......
......@@ -33,7 +33,7 @@ public interface IJgReformNoticeService extends IService<JgReformNotice> {
* @param noticeDto 改造告知
* @param op 操作类型
*/
JgReformNoticeDto updateInstallationNotice(String submitType, JgReformNoticeDto noticeDto, String op);
JgReformNoticeDto updateNotice(String submitType, Map<String, Object> noticeMap, String op);
/**
* 分页查询
......
......@@ -2561,7 +2561,7 @@
ei.unit_type unitType,
ei.supervise_org_code superviseOrgCode,
ei.supervise_org_name superviseOrgName,
ul.sequence_nbr licenceSeq,
ul.sequence_nbr problemSourceId,
ul.cert_no certNo,
ul.expiry_date expiryDate,
ul.item_code itemCode,
......@@ -2625,7 +2625,7 @@
ei.unit_type unitType,
ei.supervise_org_code superviseOrgCode,
ei.supervise_org_name superviseOrgName,
tup.sequence_nbr permissionSeq,
tup.sequence_nbr problemSourceId,
tup.cert_no certNo,
tup.expiry_date expiryDate,
tui.name userName,
......
......@@ -241,31 +241,60 @@
<select id="getDetailById" resultType="java.util.Map">
select ur.sequence_nbr as sequenceNbr,
ur.audit_status as auditStatus,
ur.use_unit_name as useUnitName,
ur.use_registration_code as useRegistrationCode,
ur.status,
ur.receive_org_name as receiveOrgName,
DATE_FORMAT(ur.reg_date,'%Y-%m-%d') as regDate,
DATE_FORMAT(ur.audit_pass_date,'%Y-%m-%d') as auditPassDate,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
jri.PRODUCT_NAME as productName,
jri.EQU_CODE as equCode,
use.USE_INNER_CODE as innerCode,
concat(use.PROVINCE_NAME,use.CITY_NAME,use.COUNTY_NAME,use.STREET_NAME,use.ADDRESS) as place,
ifnull(ur.instance_id, '') as instanceId,
re.equ_id as equipId,
ur.apply_no as applyNo,
ifnull(ur.next_executor_ids,'') as nextExecutorIds,
ur.promoter,
ur.supervisory_code as supervisoryCode,
ur.next_execute_user_ids as nextExecuteUserIds
from tzs_jg_change_registration_reform ur
LEFT JOIN tzs_jg_change_registration_reform_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
where ur.sequence_nbr = #{id}
<choose>
<when test='equListCode != null and equListCode == "8000"'>
select ur.sequence_nbr as sequenceNbr,
ur.audit_status as auditStatus,
ur.use_unit_name as useUnitName,
ur.use_registration_code as useRegistrationCode,
ur.status,
ur.receive_org_name as receiveOrgName,
DATE_FORMAT(ur.reg_date,'%Y-%m-%d') as regDate,
DATE_FORMAT(ur.audit_pass_date,'%Y-%m-%d') as auditPassDate,
pc.equ_category_name as equCategory,
pc.project_contraption as productName,
pc.equ_code as equCode,
concat_ws('',pc.PROVINCE_NAME,pc.CITY_NAME,pc.COUNTY_NAME,pc.STREET_NAME, pc."ADDRESS") as place,
ifnull(ur.instance_id, '') as instanceId,
ur.apply_no as applyNo,
ifnull(ur.next_executor_ids,'') as nextExecutorIds,
ur.promoter,
ur.supervisory_code as supervisoryCode,
ur.next_execute_user_ids as nextExecuteUserIds
from tzs_jg_change_registration_reform ur,
idx_biz_jg_project_contraption pc
where
ur.project_contraption_id = pc.sequence_nbr
and ur.sequence_nbr = #{id}
</when>
<otherwise>
select ur.sequence_nbr as sequenceNbr,
ur.audit_status as auditStatus,
ur.use_unit_name as useUnitName,
ur.use_registration_code as useRegistrationCode,
ur.status,
ur.receive_org_name as receiveOrgName,
DATE_FORMAT(ur.reg_date,'%Y-%m-%d') as regDate,
DATE_FORMAT(ur.audit_pass_date,'%Y-%m-%d') as auditPassDate,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
jri.PRODUCT_NAME as productName,
jri.EQU_CODE as equCode,
use.USE_INNER_CODE as innerCode,
concat(use.PROVINCE_NAME,use.CITY_NAME,use.COUNTY_NAME,use.STREET_NAME,use.ADDRESS) as place,
ifnull(ur.instance_id, '') as instanceId,
re.equ_id as equipId,
ur.apply_no as applyNo,
ifnull(ur.next_executor_ids,'') as nextExecutorIds,
ur.promoter,
ur.supervisory_code as supervisoryCode,
ur.next_execute_user_ids as nextExecuteUserIds
from tzs_jg_change_registration_reform ur
LEFT JOIN tzs_jg_change_registration_reform_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
where ur.sequence_nbr = #{id}
</otherwise>
</choose>
</select>
<select id="queryForFlowingEquipList"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
......
......@@ -75,14 +75,14 @@
AND isn.use_unit_credit_code = #{param.useUnitCreditCode}
</if>
<if test="param.orgBranchCode != null and param.orgBranchCode != ''">
<choose>
<when test="client == 'jgAudit'">
AND isn.org_branch_code= #{param.orgBranchCode}
</when>
<otherwise>
AND isn.org_branch_code LIKE concat(#{param.orgBranchCode},'%')
</otherwise>
</choose>
<choose>
<when test="client == 'jgLook'">
AND isn.org_branch_code LIKE concat(#{param.orgBranchCode},'%')
</when>
<otherwise>
AND isn.org_branch_code= #{param.orgBranchCode}
</otherwise>
</choose>
</if>
</if>
<if test="type == 'supervision'">
......
......@@ -35,6 +35,7 @@
isn.inform_number AS informNumber,
isn.next_task_id as nextTaskId,
isn.cancel_reason as cancelReason,
isn.project_contraption_id as projectContraptionId,
DATE_FORMAT(isn.plan_date,'%Y-%m-%d') AS planDate,
DATE_FORMAT(isn.notice_date,'%Y-%m-%d') AS noticeDate,
DATE_FORMAT(isn.accept_date,'%Y-%m-%d') AS acceptDate,
......
......@@ -267,13 +267,11 @@
</if>
<if test="dto.orgBranchCode != null and dto.orgBranchCode != ''">
<choose>
<when test="client == 'jgAudit'">
and supervisionOrgCode = #{dto.orgBranchCode}
<when test="client == 'jgLook'">
and supervisionOrgCode like concat(#{dto.orgBranchCode},'%')
</when>
<otherwise>
and supervisionOrgCode like concat(#{dto.orgBranchCode},'%')
and supervisionOrgCode = #{dto.orgBranchCode}
</otherwise>
</choose>
</if>
......@@ -350,11 +348,11 @@
</if>
<if test="dto.orgBranchCode != null and dto.orgBranchCode != ''">
<choose>
<when test="client == 'jgAudit'">
and supervision_org_code = #{dto.orgBranchCode}
<when test="client == 'jgLook'">
and supervisionOrgCode like concat(#{dto.orgBranchCode},'%')
</when>
<otherwise>
and supervision_org_code like concat(#{dto.orgBranchCode},'%')
and supervisionOrgCode = #{dto.orgBranchCode}
</otherwise>
</choose>
</if>
......@@ -524,6 +522,7 @@
NEXT_INSPECT_DATE as nextInspectDate,
INSPECT_REPORT as inspectReport,
INSPECT_ORG_CODE as inspectOrgCode,
INSPECT_REPORT_NO as inspectReportNo,
SEQUENCE_NBR as jySeq
from idx_biz_jg_inspection_detection_info
where
......@@ -606,7 +605,8 @@
INSPECT_DATE as inspectDate,
INSPECT_STAFF as inspectStaff,
NEXT_INSPECT_DATE as nextInspectDate,
INSPECT_REPORT as inspectReport
INSPECT_REPORT as inspectReport,
INSPECT_REPORT_NO as inspectReportNo
FROM "idx_biz_jg_inspection_detection_info"
where
RECORD = #{id}
......@@ -940,16 +940,24 @@
ri."EQU_CATEGORY" = '2300'
and ui."DATA_SOURCE" like 'jg%'
and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1)
<if test="jsonObject.DATA_SOURCE != null and jsonObject.DATA_SOURCE != 'jg_his'">
and ui."DATA_SOURCE" like 'jg%'
and ui."DATA_SOURCE" not like 'jg_his%'
</if>
<if test="jsonObject.DATA_SOURCE != null and jsonObject.DATA_SOURCE == 'jg_his'">
and ui."DATA_SOURCE" like 'jg_his%'
</if>
<if test="jsonObject.DATA_SOURCE == null or jsonObject.DATA_SOURCE == ''">
and ui."DATA_SOURCE" like 'jg%'
</if>
<if test="jsonObject.DATA_SOURCE != null">
<choose>
<when test="jsonObject.DATA_SOURCE == 'jg_his_black'">
and ui."DATA_SOURCE" like 'jg_his_black%'
</when>
<when test="jsonObject.DATA_SOURCE == 'jg_his'">
and ui."DATA_SOURCE" like 'jg_his%'
and ui."DATA_SOURCE" not like 'jg_his_black%'
</when>
<otherwise>
and ui."DATA_SOURCE" like 'jg%'
and ui."DATA_SOURCE" not like 'jg_his%'
</otherwise>
</choose>
</if>
-- 保证使用单位选择设备时(record为null) 能选择到本单位的设备 并且 监管单位在查看时(record 不为null)可以匹配到所有的设备
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null">
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
......@@ -1242,7 +1250,7 @@
<foreach collection="projectContraptionSeqList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
AND ui.IS_INTO_MANAGEMENT = true
--AND ui.IS_INTO_MANAGEMENT = true
ORDER BY ui.REC_DATE DESC
)
</select>
......@@ -1298,4 +1306,20 @@
)
</update>
<select id="getUseRegisterCountTotal" resultType="java.util.Map">
SELECT
date_format(A.audit_pass_date, '%Y-%m') AS time,
A.supervision_org_code AS supervisionOrgCode
FROM
"tzs_jg_use_registration_eq" ae
JOIN tzs_jg_use_registration A ON A.sequence_nbr = ae.equip_transfer_id
JOIN "idx_biz_jg_use_info" u ON ae.equ_id = u."RECORD"
JOIN idx_biz_jg_register_info ri ON u."RECORD" = ri."RECORD"
WHERE
ae.equ_id = u."RECORD"
AND ri.EQU_CATEGORY = '2300'
AND A.status = '已完成'
AND A.is_delete = 0
AND A.supervision_org_code is not null
</select>
</mapper>
......@@ -48,7 +48,7 @@
and tjvi.org_branch_code = #{dto.orgBranchCode}
</when>
<otherwise>
AND tjvi.org_branch_codeLIKE CONCAT(#{dto.orgBranchCode}, '%')
AND tjvi.org_branch_code LIKE CONCAT(#{dto.orgBranchCode}, '%')
</otherwise>
</choose>
</if>
......
......@@ -55,7 +55,7 @@
and spt.principal_unit like CONCAT('%', #{problemModel.principalUnit}, '%')
</if>
<if test="problemModel.principalUnitType != null and problemModel.principalUnitType != ''">
and spt.principal_unit_type = #{problemModel.principalUnitType}
and spt.principal_unit_type = like CONCAT('%', #{problemModel.principalUnitType}, '%')
</if>
<if test="problemModel.hiddenDangersLevel != null and problemModel.hiddenDangersLevel != ''">
and spt.problem_status_code = #{problemModel.hiddenDangersLevel}
......
......@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.EquipmentClassifyDto;
import com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
......@@ -446,6 +447,26 @@ public class CommonController extends BaseController {
/**
* 获取当前登录人单位及以下管辖分局树
*
* @return result
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getOrgTreeByCompanyLevel")
@ApiOperation(httpMethod = "GET", value = "按照当前登录人单位类型返回管辖机构树", notes = "按照当前登录人单位类型返回管辖机构树,")
public ResponseModel<Object> getOrgTreeByCompanyLevel() {
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = reginParams.getCompany().getOrgCode();
if (reginParams.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)) { // 公司类型人员返回全部树
return getCreatTree();
} else { // 监管机构返回当前登录人机构及一下(只考虑非审批机构使用)
return ResponseHelper.buildResponse(commonService.loginUnitAndBelowGetTree(orgCode));
}
}
/**
* 获取管辖分局树
*
* @return
......
......@@ -122,6 +122,20 @@ public class JgChangeRegistrationUnitController extends BaseController {
/**
* 根据sequenceNbr查询详情
*
* @param sequenceNbr 主键
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/projectContraption/details")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个管道工程装置表", notes = "根据sequenceNbr查询单个管道工程装置表")
public ResponseModel<Map<String, Map<String, Object>>> detailsByProjectContraption(@RequestParam("sequenceNbr") String sequenceNbr,
@RequestParam("applyNo")String applyNo) {
return ResponseHelper.buildResponse(jgChangeRegistrationUnitServiceImpl.detailsByProjectContraption(sequenceNbr,applyNo));
}
/**
* 列表分页查询
*
* @param current 当前页
......
......@@ -65,13 +65,9 @@ public class JgReformNoticeController extends BaseController {
@PutMapping(value = "/update")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新改造告知", notes = "根据sequenceNbr更新改造告知")
public ResponseModel<JgReformNoticeDto> updateBySequenceNbrJgReformNotice(@RequestParam String submitType,
@RequestBody JgReformNoticeDto installationInfo,
@RequestBody Map<String, Object> noticeMap,
@RequestParam(value = "op", required = false) String op) {
if (Objects.isNull(installationInfo)) {
throw new IllegalArgumentException("参数installationInfo不能为空");
}
return ResponseHelper.buildResponse(jgReformNoticeService.updateInstallationNotice(submitType, installationInfo, op));
return ResponseHelper.buildResponse(jgReformNoticeService.updateNotice(submitType, noticeMap, op));
}
/**
......
......@@ -363,13 +363,14 @@ public class JgUseRegistrationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jgProjectContraptionPage")
@ApiOperation(value = "查询指定使用单位下的可用装置,已纳管且使用登记证编号为空或者null", notes = "不包括流程中的")
public ResponseModel<IPage<IdxBizJgProjectContraption>> getJgProjectContraptionPage(@RequestParam String useUnitCreditCode,
public ResponseModel<IPage<IdxBizJgProjectContraption>> getJgProjectContraptionPage(@RequestParam(value = "useUnitCreditCode") String useUnitCreditCode,
@RequestParam(value = "dataSource") String dataSource,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<IdxBizJgProjectContraption> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
IPage<IdxBizJgProjectContraption> re = jgUseRegistrationServiceImpl.getJgProjectContraptionPage(useUnitCreditCode, page);
IPage<IdxBizJgProjectContraption> re = jgUseRegistrationServiceImpl.getJgProjectContraptionPage(useUnitCreditCode, dataSource, page);
return ResponseHelper.buildResponse(re);
}
......
......@@ -6,9 +6,9 @@ import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationManageServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -287,14 +287,40 @@ public class JgUseRegistrationManageController extends BaseController {
Page<JgUseRegistrationManageDto> page = new Page<JgUseRegistrationManageDto>();
page.setCurrent(current);
page.setSize(size);
if (!ValidationUtil.isEmpty(dto.getOriginalUseUnitCreditCode())) {
dto.setUseUnitCreditCodeForSearch(dto.getOriginalUseUnitCreditCode());
String originalUseUnitCreditCode = dto.getOriginalUseUnitCreditCode();
if (!ValidationUtil.isEmpty(originalUseUnitCreditCode)) {
if(originalUseUnitCreditCode.contains("_")){
dto.setUseUnitCreditCodeForSearch(originalUseUnitCreditCode.split("_")[0]);
} else {
dto.setUseUnitCreditCodeForSearch(originalUseUnitCreditCode);
}
} else {
return ResponseHelper.buildResponse(page);
}
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePage(page, dto, sort));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/unitChangeByProjectContraption/page")
@ApiOperation(httpMethod = "GET", value = "单位变更选择工程/装置分页查询", notes = "单位变更选择工程/装置分页查询")
public ResponseModel<Page<IdxBizJgProjectContraption>> queryForUnitByProjectContraptionPage(@RequestParam Map<String, String> params,
@RequestParam(value = "sort", required = false) String sort,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<IdxBizJgProjectContraption> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
String originalUseUnitCreditCode = params.get("originalUseUnitCreditCode");
if (ValidationUtil.isEmpty(originalUseUnitCreditCode)) {
return ResponseHelper.buildResponse(page);
}else {
if(originalUseUnitCreditCode.contains("_")){
params.put("originalUseUnitCreditCode",originalUseUnitCreditCode.split("_")[0]);
}
}
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForUnitByProjectContraptionPage(page, params, sort));
}
/**
* 根据sequenceNbr查询---大屏使用
*
......
......@@ -144,7 +144,9 @@ public class JgVehicleInformationController extends BaseController {
dto.setDataType(BaseController.COMPANY_TYPE_COMPANY);
} else {
dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION);
dto.setOrgBranchCode(dto.getOrgBranchCode() != null ? dto.getOrgBranchCode() : info.getCompany().getOrgCode());
if("jgLook".equals(client)){
dto.setOrgBranchCode(dto.getOrgBranchCode() != null ? dto.getOrgBranchCode() : info.getCompany().getOrgCode());
}
}
Page<Map<String, Object>> list = jgVehicleInformationServiceImpl.getPageList(dto,sort, page, dto.getRoleIds(), client);
list.getRecords().forEach(x -> {
......
......@@ -251,20 +251,19 @@ public class SafetyProblemTracingController extends BaseController {
safetyProblemTracingGenService.executeMaintenanceCheck();
return ResponseHelper.buildResponse("success");
}
/**
* test3
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "生成维保超期数据", notes = "生成维保超期数据")
@ApiOperation(httpMethod = "GET", value = "生成人员资质超期数据", notes = "生成人员资质超期数据")
@GetMapping(value = "/gen/test4")
public ResponseModel<String> test4() {
safetyProblemTracingGenService.executePersonnalCertificationCheck();
return ResponseHelper.buildResponse("success");
}
/**
* update3 -- 修复
*
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.handler;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemSourceTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent;
import com.yeejoin.amos.boot.module.jg.api.event.handler.SafetyProblemEventHandler;
......@@ -38,6 +39,12 @@ public class XKCQEventHandler implements SafetyProblemEventHandler {
}
private void generateProblem(JSONArray jsonArray) {
jsonArray.forEach(item -> {
JSONObject problemObj = (JSONObject) item;
problemObj.put("sourceType", SafetyProblemSourceTypeEnum.UNIT.getName());
problemObj.put("sourceTypeCode", SafetyProblemSourceTypeEnum.UNIT.getCode());
problemObj.put("problemDesc", "证书编号:" + problemObj.get("certNo") + SafetyProblemTypeEnum.XKCQ.getName());
});
SafetyProblemTopicMessage.generateUnitProblem(jsonArray, SafetyProblemTypeEnum.XKCQ, safetyProblemTracingService);
}
}
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.handler;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemSourceTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent;
import com.yeejoin.amos.boot.module.jg.api.event.handler.SafetyProblemEventHandler;
......@@ -38,6 +39,12 @@ public class ZZCQEventHandler implements SafetyProblemEventHandler {
}
private void generateProblem(JSONArray jsonArray) {
jsonArray.forEach(item -> {
JSONObject problemObj = (JSONObject) item;
problemObj.put("sourceType", SafetyProblemSourceTypeEnum.PERSONNEL.getName());
problemObj.put("sourceTypeCode", SafetyProblemSourceTypeEnum.PERSONNEL.getCode());
problemObj.put("problemDesc", "证书编号:" + problemObj.getOrDefault("certNo", "") + SafetyProblemTypeEnum.ZZCQ.getName());
});
SafetyProblemTopicMessage.generatePersonnelProblem(jsonArray, SafetyProblemTypeEnum.ZZCQ, safetyProblemTracingService);
}
}
......
......@@ -151,6 +151,10 @@ public class SafetyProblemTopicMessage extends EmqxListener {
}
public static void generateUnitProblem(JSONArray jsonArray, SafetyProblemTypeEnum problemTypeEnum, SafetyProblemTracingServiceImpl safetyProblemTracingService) {
generateProblem2(jsonArray, problemTypeEnum, safetyProblemTracingService);
}
private static void generateProblem2(JSONArray jsonArray, SafetyProblemTypeEnum problemTypeEnum, SafetyProblemTracingServiceImpl safetyProblemTracingService) {
if (jsonArray == null || problemTypeEnum == null) {
throw new IllegalArgumentException("jsonObject and problemTypeEnum must not be null.");
}
......@@ -163,10 +167,10 @@ public class SafetyProblemTopicMessage extends EmqxListener {
SafetyProblemTracing safetyProblemTracing = new SafetyProblemTracing();
safetyProblemTracing.setProblemType(problemTypeEnum.getName());
safetyProblemTracing.setProblemTypeCode(problemTypeEnum.getCode());
safetyProblemTracing.setProblemDesc(problemTypeEnum.getDesc() + "-" + json.getOrDefault("itemName", "") + "-" + json.getOrDefault("subItemName", ""));
safetyProblemTracing.setSourceType(SafetyProblemSourceTypeEnum.UNIT.getName());
safetyProblemTracing.setSourceTypeCode(SafetyProblemSourceTypeEnum.UNIT.getCode());
safetyProblemTracing.setSourceId(json.getOrDefault("licenceSeq", "").toString());
safetyProblemTracing.setProblemDesc(json.getString("problemDesc"));
safetyProblemTracing.setSourceType(json.getString("sourceType"));
safetyProblemTracing.setSourceTypeCode(json.getString("sourceTypeCode"));
safetyProblemTracing.setSourceId(json.getString("problemSourceId"));
safetyProblemTracing.setProblemTime(new Date());
safetyProblemTracing.setPrincipalUnit(json.getOrDefault("useUnit", "").toString());
safetyProblemTracing.setPrincipalUnitCode(json.getOrDefault("useUnitCode", "").toString());
......@@ -187,39 +191,7 @@ public class SafetyProblemTopicMessage extends EmqxListener {
}
public static void generatePersonnelProblem(JSONArray jsonArray, SafetyProblemTypeEnum problemTypeEnum, SafetyProblemTracingServiceImpl safetyProblemTracingService) {
if (jsonArray == null || problemTypeEnum == null) {
throw new IllegalArgumentException("jsonObject and problemTypeEnum must not be null.");
}
if (!ValidationUtil.isEmpty(jsonArray)) {
List<SafetyProblemTracing> safetyProblemTracingList = jsonArray.stream().map(item -> {
if (!(item instanceof JSONObject)) {
throw new IllegalArgumentException("item is not a JSONObject.");
}
JSONObject json = (JSONObject) item;
SafetyProblemTracing safetyProblemTracing = new SafetyProblemTracing();
safetyProblemTracing.setProblemType(problemTypeEnum.getName());
safetyProblemTracing.setProblemTypeCode(problemTypeEnum.getCode());
safetyProblemTracing.setProblemDesc(problemTypeEnum.getDesc() + "-" + json.getOrDefault("userName", "") + "-" + json.getOrDefault("certNo", ""));
safetyProblemTracing.setSourceType(SafetyProblemSourceTypeEnum.PERSONNEL.getName());
safetyProblemTracing.setSourceTypeCode(SafetyProblemSourceTypeEnum.PERSONNEL.getCode());
safetyProblemTracing.setSourceId(json.getOrDefault("permissionSeq", "").toString());
safetyProblemTracing.setProblemTime(new Date());
safetyProblemTracing.setPrincipalUnit(json.getOrDefault("useUnit", "").toString());
safetyProblemTracing.setPrincipalUnitCode(json.getOrDefault("useUnitCode", "").toString());
safetyProblemTracing.setPrincipalUnitType(json.getOrDefault("unitType", "").toString());
safetyProblemTracing.setGoverningBody(json.getOrDefault("superviseOrgName", "").toString());
safetyProblemTracing.setGoverningBodyCode(json.getOrDefault("useUnitCode", "").toString());
safetyProblemTracing.setGoverningBodyOrgCode(json.getOrDefault("superviseOrgCode", "").toString());
safetyProblemTracing.setCreateDate(new Date());
safetyProblemTracing.setProblemStatus(SafetyProblemStatusEnum.UNHANDLED.getName());
safetyProblemTracing.setProblemStatusCode(SafetyProblemStatusEnum.UNHANDLED.getCode());
return safetyProblemTracing;
}).collect(Collectors.toList());
safetyProblemTracingService.saveOrUpdateBatchByColumns(safetyProblemTracingList,
safetyProblemTracing -> new QueryWrapper<>()
.eq("problem_type_code", safetyProblemTracing.getProblemTypeCode())
.eq("source_id", safetyProblemTracing.getSourceId())
.eq("problem_status_code", SafetyProblemStatusEnum.UNHANDLED.getCode()));}
generateProblem2(jsonArray, problemTypeEnum, safetyProblemTracingService);
}
public String buildTopic(String topic) {
......
......@@ -13,6 +13,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum;
......@@ -33,11 +35,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
......@@ -116,6 +118,8 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
private ESEquipmentCategory esEquipmentCategory;
@Autowired
private DataDictionaryServiceImpl dataDictionaryServiceImpl;
@Autowired
private RedisUtils redisUtils;
@Override
public boolean saveOrUpdateData(IdxBizJgProjectContraption projectContraption) {
......@@ -192,14 +196,15 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
.eq(BaseController.COMPANY_TYPE_COMPANY.equals(companyLevel) && CompanyTypeEnum.CONSTRUCTION.getName().equals(companyType), IdxBizJgProjectContraption::getUscUnitCreditCode, companyCode)
.eq(BaseController.COMPANY_TYPE_COMPANY.equals(companyLevel) && CompanyTypeEnum.USE.getName().equals(companyType), IdxBizJgProjectContraption::getUseUnitCreditCode, companyCode)
.eq(BaseController.COMPANY_TYPE_COMPANY.equals(companyLevel) && CompanyTypeEnum.INDIVIDUAL.getName().equals(companyType), IdxBizJgProjectContraption::getUseUnitCreditCode, companyCode.split("_").length > 1 ? companyCode.split("_")[1] : companyCode)
// 监管机构按照属地监管部门orgCode进行过滤
// 监管机构按照属地监管部门orgCode进行过滤【最大数据集合】
.likeRight(ValidationUtil.isEmpty(useRegDetail) && BaseController.COMPANY_TYPE_SUPERVISION.equals(companyLevel), IdxBizJgProjectContraption::getOrgCode, company.getOrgCode())
.eq(!ValidationUtil.isEmpty(params.get(IS_INTO_MANAGEMENT)), IdxBizJgProjectContraption::getIsIntoManagement, isIntoManagement)
.eq(!ValidationUtil.isEmpty(useRegistrationCode), IdxBizJgProjectContraption::getUseRegistrationCode, useRegistrationCode)
.eq(!ValidationUtil.isEmpty(equCategory), IdxBizJgProjectContraption::getEquCategory, equCategory)
.eq(!ValidationUtil.isEmpty(equDefine), IdxBizJgProjectContraption::getEquDefine, equDefine)
.like(!ValidationUtil.isEmpty(projectContraption), IdxBizJgProjectContraption::getProjectContraption, projectContraption)
.eq(!ValidationUtil.isEmpty(orgBranchCode), IdxBizJgProjectContraption::getOrgCode, orgBranchCode)
.eq(!ValidationUtil.isEmpty(orgBranchCode) && BaseController.COMPANY_TYPE_COMPANY.equals(companyLevel), IdxBizJgProjectContraption::getOrgCode, orgBranchCode) // 企业 等于匹配
.likeRight(!ValidationUtil.isEmpty(orgBranchCode) && BaseController.COMPANY_TYPE_SUPERVISION.equals(companyLevel), IdxBizJgProjectContraption::getOrgCode, orgBranchCode) // 监管 右模糊匹配
.like(!ValidationUtil.isEmpty(projectContraptionNo), IdxBizJgProjectContraption::getProjectContraptionNo, projectContraptionNo)
.isNull(!ValidationUtil.isEmpty(regCodeIsNull) && Boolean.TRUE.equals(Boolean.valueOf(regCodeIsNull)), IdxBizJgProjectContraption::getUseRegistrationCode)
.isNotNull(!ValidationUtil.isEmpty(regCodeIsNull) && Boolean.FALSE.equals(Boolean.valueOf(regCodeIsNull)), IdxBizJgProjectContraption::getUseRegistrationCode)
......@@ -222,9 +227,9 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
List<Long> projectContraptionIdList = pageList.getRecords().stream().map(IdxBizJgProjectContraption::getSequenceNbr).collect(Collectors.toList());
Map<String, Boolean> canEditMap = this.checkContraptionIsCanEdit(projectContraptionIdList);
pageList.getRecords().forEach(record -> record.setCanEdit(canEditMap.get(record.getSequenceNbr())));
pageList.getRecords().forEach(record -> record.setCanEdit(canEditMap.get(record.getSequenceNbr()+"")));
Map<String, Boolean> canDeleteMap = this.checkContraptionIsCanDelete(projectContraptionIdList, isIntoManagement);
pageList.getRecords().forEach(record -> record.setCanDelete(canDeleteMap.get(record.getSequenceNbr())));
pageList.getRecords().forEach(record -> record.setCanDelete(canDeleteMap.get(record.getSequenceNbr()+"")));
//判断是否有检验结果录入
judgeCheckResult(pageList.getRecords());
}
......@@ -339,6 +344,8 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
}
public Map<String, Map<String, Object>> details(String sequenceNbr) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())) + "", ReginParams.class);
CompanyBo company = reginParams.getCompany();
Map<String, Map<String, Object>> resultMap = new HashMap<>();
if (ObjectUtils.isEmpty(sequenceNbr)) {
resultMap.put(EQUIP_INFO_FORM_ID, Collections.emptyMap());
......@@ -348,6 +355,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
Map<String, Object> projectContraptionMap = Optional.ofNullable(baseMapper.getDetail(sequenceNbr))
.map(map -> {
commonServiceImpl.convertStringToJsonobject(map, jsonFields);
map.put("unitType", company.getCompanyType());
map.put("pipelineList", baseMapper.selectEquipList((String) map.get("SEQUENCE_NBR")));
return map;
})
......@@ -667,6 +675,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
result.put("inspectConclusionCode", info.getInspectConclusion());
result.put("inspectConclusion", Optional.ofNullable(dataDictionaryServiceImpl.getByCode(info.getInspectConclusion(), "JYJL"))
.map(DataDictionary::getName).orElse(""));
result.put("jySeq", info.getSequenceNbr());
return result;
}
}
\ No newline at end of file
......@@ -513,8 +513,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.doubleValue()
);
projectContraption.setUscUnitName(companyInfoMap.get("companyName").toString());
projectContraption.setUscUnitCreditCode(companyInfoMap.get("creditCode").toString());
// 历史黑设备新增由使用单位新增
if(dataSource.contains("black")){
projectContraption.setUseUnitName(companyInfoMap.get("companyName").toString());
projectContraption.setUseUnitCreditCode(companyInfoMap.get("creditCode").toString());
} else {
projectContraption.setUscUnitName(companyInfoMap.get("companyName").toString());
projectContraption.setUscUnitCreditCode(companyInfoMap.get("creditCode").toString());
}
projectContraption.setIsFirstMerge(false);
idxBizJgProjectContraptionService.saveOrUpdateData(projectContraption);
......@@ -685,6 +691,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
esEquipmentDto.setSTATUS("已认领");
esEquipmentDto.setUSC_UNIT_CREDIT_CODE(projectContraption.getUscUnitCreditCode());
esEquipmentDto.setUSC_UNIT_NAME(projectContraption.getUscUnitName());
esEquipmentDto.setUSE_UNIT_CREDIT_CODE(projectContraption.getUseUnitCreditCode());
esEquipmentDto.setUSE_UNIT_NAME(projectContraption.getUseUnitName());
esEquipmentDto.setPROJECT_CONTRAPTION(projectContraption.getProjectContraption());
esEquipmentDto.setPRODUCT_NAME(pipelineInfo.getPipeName());
esEquipmentDto.setProjectContraptionId(String.valueOf(sequenceNbr));
......@@ -1166,11 +1174,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.filter(x -> "8300".equals(x.getDictDataKey()))
.collect(Collectors.toList());
}
// if (EquipmentClassifityEnum.YLGD.getCode().equals(equList) && "black".equals(dataSource)) {
// return this.baseMapper.queryAllEquCategoriesUnderTheEquList(equList).stream()
// .filter(x -> !"8300".equals(x.getDictDataKey()))
// .collect(Collectors.toList());
// }
if (EquipmentClassifityEnum.YLGD.getCode().equals(equList)) {
return this.baseMapper.queryAllEquCategoriesUnderTheEquList(equList).stream()
.filter(x -> !"8300".equals(x.getDictDataKey()))
.collect(Collectors.toList());
}
}
return this.baseMapper.queryAllEquCategoriesUnderTheEquList(equList);
}
......@@ -2588,7 +2596,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
// 增加监管端查询, 查询规则看到本级及之下的设备
if(!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))){
boolMust.must(QueryBuilders.termQuery("ORG_BRANCH_CODE.keyword", map.getString("ORG_BRANCH_CODE")));
if(companyLevel.equals(BaseController.COMPANY_TYPE_SUPERVISION)) { // 监管 右模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(company.getString("ORG_BRANCH_CODE")) + "*"));
} else { // 企业 等于查询
boolMust.must(QueryBuilders.termQuery("ORG_BRANCH_CODE.keyword", map.getString("ORG_BRANCH_CODE")));
}
}
builder.query(boolMust);
builder.sort("REC_DATE", SortOrder.DESC);
......
......@@ -316,11 +316,15 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
*/
private void delRepeatUseEquipData(JgChangeRegistrationName notice) {
if (NOT_FLOWING_STATE.contains(notice.getAuditStatus())) {
LambdaQueryWrapper<JgChangeRegistrationNameEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgChangeRegistrationNameEq::getNameChangeRegistrationId, notice.getSequenceNbr());
List<JgChangeRegistrationNameEq> noticeEqList = jgChangeRegistrationNameEqMapper.selectList(queryWrapper);
noticeEqList.forEach(noticeEq -> EquipUsedCheckStrategyContext.getUsedStrategy(CHANGE_NAME_KEY)
.delDataForCheckEquipRepeatUsed(Collections.singletonList(noticeEq.getCertificateSeq()), notice.getUseUnitCreditCode())
final String creditCode = notice.getUseUnitCreditCode().contains("_")
? notice.getUseUnitCreditCode().substring(notice.getUseUnitCreditCode().indexOf("_") + 1)
: notice.getUseUnitCreditCode();
jgChangeRegistrationNameEqMapper.selectList(
new LambdaQueryWrapper<JgChangeRegistrationNameEq>()
.eq(JgChangeRegistrationNameEq::getNameChangeRegistrationId, notice.getSequenceNbr())
).forEach(noticeEq ->
EquipUsedCheckStrategyContext.getUsedStrategy(CHANGE_NAME_KEY)
.delDataForCheckEquipRepeatUsed(Collections.singletonList(noticeEq.getCertificateSeq()), creditCode)
);
}
}
......@@ -955,9 +959,9 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
equList.forEach(info -> {
JSONObject equInfo = JSONObject.parseObject(info.toString());
JgCertificateChangeRecordEq jgCertificateChangeRecordEq = new JgCertificateChangeRecordEq();
jgCertificateChangeRecordEq.setEquId(equInfo.get("SEQUENCE_NBR").toString());
jgCertificateChangeRecordEq.setEquId(Objects.isNull(equInfo.get("SEQUENCE_NBR"))? null : equInfo.get("SEQUENCE_NBR").toString());
jgCertificateChangeRecordEq.setChangeRecordId(jgCertificateChangeRecord.getSequenceNbr().toString());
jgCertificateChangeRecordEq.setProductCode(equInfo.get("FACTORY_NUM").toString());
jgCertificateChangeRecordEq.setProductCode(Objects.isNull(equInfo.get("FACTORY_NUM"))? null : equInfo.get("FACTORY_NUM").toString());
jgCertificateChangeRecordEqs.add(jgCertificateChangeRecordEq);
});
}
......
......@@ -914,7 +914,16 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
useUnitCreditCode = useUnitCreditCode.split("_")[1];
}
LambdaQueryWrapper<IdxBizJgProjectContraption> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IdxBizJgProjectContraption::getUseUnitCreditCode, useUnitCreditCode).eq(IdxBizJgProjectContraption::getIsIntoManagement, true).eq(IdxBizJgProjectContraption::getEquList, "8000").isNotNull(IdxBizJgProjectContraption::getUseRegistrationCode).ne(IdxBizJgProjectContraption::getUseRegistrationCode, "");
wrapper.eq(IdxBizJgProjectContraption::getUseUnitCreditCode, useUnitCreditCode)
.eq(IdxBizJgProjectContraption::getIsIntoManagement, true)
.eq(IdxBizJgProjectContraption::getEquList, "8000")
.and(w -> w
.isNull(IdxBizJgProjectContraption::getProjectContraptionParentId)
.or()
.eq(IdxBizJgProjectContraption::getProjectContraptionParentId, "")
)
.isNotNull(IdxBizJgProjectContraption::getUseRegistrationCode)
.ne(IdxBizJgProjectContraption::getUseRegistrationCode, "");
return jgProjectContraptionService.page(page, wrapper);
}
......
......@@ -306,12 +306,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 兼容老数据
if (hisData == null) {
Map<String, Object> detail = setNewEquipData(companyLevel, installationInfo);
this.fillingEquCategoryNameForHisData(detail, notice);
return new HashMap<String, Map<String, Object>>() {{
this.put("installationInfo", detail);
}};
} else {
hisData.putAll(installationInfo);
CommonServiceImpl.formatTime2StrDateForEquip(hisData);
this.fillingEquCategoryNameForHisData(hisData, notice);
return new HashMap<String, Map<String, Object>>() {{
this.put("installationInfo", hisData);
}};
......@@ -327,6 +329,25 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
}
/**
* 历史数据填充设备种类、设备类别、设备品种
* @param detail 返回json
* @param notice 当前单据
*/
private void fillingEquCategoryNameForHisData(Map<String, Object> detail, JgInstallationNotice notice) {
if(!StringUtils.isEmpty(notice.getProjectContraptionId())){
LambdaQueryWrapper<IdxBizJgProjectContraption> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BaseEntity::getSequenceNbr, notice.getProjectContraptionId());
queryWrapper.select(IdxBizJgProjectContraption::getEquListName,IdxBizJgProjectContraption::getEquCategoryName,IdxBizJgProjectContraption::getEquDefineName,BaseEntity::getSequenceNbr);
IdxBizJgProjectContraption projectContraption = projectContraptionService.getBaseMapper().selectOne(queryWrapper);
if(projectContraption != null){
detail.put("equListName", projectContraption.getEquListName());
detail.put("equCategoryName", projectContraption.getEquCategoryName());
detail.put("equDefineName", projectContraption.getEquDefineName());
}
}
}
private List<Map<String, Object>> getEquipListMaps(Iterable<ESEquipmentCategoryDto> equips) {
List<Map<String, Object>> arrayList = new ArrayList<>();
equips.forEach(equip -> {
......@@ -362,6 +383,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
installationInfo.put("pipelineLength", projectContraption.getPipelineLength());
installationInfo.put("projectContraptionNo", projectContraption.getProjectContraptionNo());
installationInfo.put("projectContraption", projectContraption.getProjectContraption());
installationInfo.put("equListName", projectContraption.getEquListName());
installationInfo.put("equCategoryName", projectContraption.getEquCategoryName());
installationInfo.put("equDefineName", projectContraption.getEquDefineName());
equipListMaps = projectContraptionService.getBaseMapper().selectEquipList(projectContraptionId);
equipListMaps.forEach(item ->
item.put("deviceLevel", Optional.ofNullable(dataDictionaryMapper.selectById(String.valueOf(item.get("deviceLevel"))))
......@@ -1941,6 +1965,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if (!ValidationUtil.isEmpty(projectContraption.getAddress())) {
result.fluentPut("address", projectContraption.getAddress());
}
result.put("equListName", projectContraption.getEquListName());
result.put("equCategoryName", projectContraption.getEquCategoryName());
result.put("equDefineName", projectContraption.getEquDefineName());
return result;
}
......
......@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CertificateStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransferService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationManageService;
......@@ -21,6 +22,7 @@ import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.ymt.api.common.StringUtil;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
......@@ -59,6 +61,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -68,6 +72,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.alibaba.fastjson.JSON.parseArray;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl.isValidCreditCode;
......@@ -858,4 +863,32 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
}
return "修复成功!";
}
/**
* 工程/装置分页查询
* @param page
* @param params
* @param sort
* @return
*/
public Page<IdxBizJgProjectContraption> queryForUnitByProjectContraptionPage(Page<IdxBizJgProjectContraption> page, Map<String, String> params, String sort) {
SortVo sortMap = commonServiceImpl.sortFieldConversion(sort);
Page<IdxBizJgProjectContraption> projectContraptionPage = this.baseMapper.queryForUnitByProjectContraptionPage(page, params, sortMap);
List<IdxBizJgProjectContraption> records = projectContraptionPage.getRecords();
if (!ValidationUtil.isEmpty(records)) {
records.forEach(item -> {
BigDecimal pipelineLength = BigDecimal.valueOf(item.getPipelineLength());
BigDecimal roundedValue = pipelineLength.setScale(3, RoundingMode.HALF_UP);
BigDecimal strippedValue = roundedValue.stripTrailingZeros();
item.setPipelineLength(Double.valueOf(strippedValue.toPlainString()));
item.setDataSourceName(EquipSourceEnum.getDataSourceName(item.getDataSource()));
item.setFullAddress(
Stream.of(item.getProvinceName(), item.getCityName(), item.getCountyName(), item.getStreetName(), item.getAddress())
.map(value -> value == null ? "" : value)
.collect(Collectors.joining())
);
});
}
return projectContraptionPage;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -14,7 +15,6 @@ import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper;
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
import org.eclipse.paho.client.mqttv3.MqttException;
......@@ -57,8 +57,6 @@ public class SafetyProblemTracingGenServiceImpl{
private SafetyProblemTracingServiceImpl safetyProblemTracingService;
@Autowired
TzBaseEnterpriseInfoMapper baseEnterpriseInfoMapper;
@Autowired
TzsUserInfoMapper tzsUserInfoMapper;
@Scheduled(cron = "0 0 1 * * ?")
@SchedulerLock(name = "executeSafetyProblemCheck", lockAtMostFor = "PT5H", lockAtLeastFor = "PT10M")
......@@ -67,8 +65,9 @@ public class SafetyProblemTracingGenServiceImpl{
executeInspectionCheck();
executeEnterpriseQualificationCheck();
}
@Scheduled(cron = "0 0 1 * * ?")
@SchedulerLock(name = "executeSafetyProblemCheck", lockAtMostFor = "PT5H", lockAtLeastFor = "PT10M")
@SchedulerLock(name = "executePersonnalCertification", lockAtMostFor = "PT5H", lockAtLeastFor = "PT10M")
public void executePersonnalCertification() {
executePersonnalCertificationCheck();
}
......@@ -185,11 +184,13 @@ public class SafetyProblemTracingGenServiceImpl{
*/
private void sendSafetyProblemMessage(List<Map<String, Object>> mapList, SafetyProblemTypeEnum safetyProblemTypeEnum) {
JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(mapList));
try {
emqKeeper.getMqttClient().publish(safetyProblemTypeEnum.getTopic(), jsonArray.toString().getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) {
logger.error("发送安全追溯问题设备信息消息失败---->{}", e.getMessage());
throw new RuntimeException(e);
if (CollectionUtil.isNotEmpty(jsonArray)){
try {
emqKeeper.getMqttClient().publish(safetyProblemTypeEnum.getTopic(), jsonArray.toString().getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) {
logger.error("发送安全追溯问题设备信息消息失败---->{}", e.getMessage());
throw new RuntimeException(e);
}
}
}
}
\ No newline at end of file
localhost=${spring.cloud.client.ip-address}
#DB properties:
spring.datasource.url=jdbc:postgresql://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
spring.datasource.username=admin
......@@ -6,11 +7,11 @@ eureka.client.service-url.defaultZone=http://172.16.10.243:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.6:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.6:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.6:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.6
eureka.instance.status-page-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://${localhost}:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=${localhost}
## ES properties:
elasticsearch.username=elastic
elasticsearch.password=a123456
......
......@@ -2191,7 +2191,7 @@
<w:spacing w:val="-1"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
<w:t>${(resultNo)!''}</w:t>
<w:t>${(inspectReportNo)!''}</w:t>
</w:r>
</w:p>
</w:tc>
......
......@@ -543,7 +543,7 @@
<w:sz w:val="21"/>
<w:sz-cs w:val="21"/>
</w:rPr>
<w:t>${(registrationType)!''}</w:t>
<w:t>${(registrationType)!'新设备首次启用'}</w:t>
</w:r>
</w:p>
<w:p>
......
......@@ -2122,37 +2122,9 @@
<w:lang w:fareast="ZH-CN" w:bidi="AR-SA"/>
</w:rPr>
<w:t>${(year)!''}</w:t>
<w:t>${(useDate)!''}</w:t>
</w:r>
<w:r>
<w:t></w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:h-ansi="Calibri" w:fareast="宋体"
w:cs="Times New Roman" w:hint="default"/>
<w:kern w:val="0"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN" w:bidi="AR-SA"/>
</w:rPr>
<w:t>${(mon)!''}</w:t>
</w:r>
<w:r>
<w:t></w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:h-ansi="Calibri" w:fareast="宋体"
w:cs="Times New Roman" w:hint="default"/>
<w:kern w:val="0"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN" w:bidi="AR-SA"/>
</w:rPr>
<w:t>${(day)!''}</w:t>
</w:r>
<w:r>
<w:t></w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
......
......@@ -1344,7 +1344,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
String test = QueryParser.escape(map.getString("USE_INNER_CODE"));
boolMust.must(QueryBuilders.matchPhraseQuery("USE_INNER_CODE", test));
}
this.setFilterOfInFlowing(boolMust, map.getString("EQU_LIST_CODE"), map.getString("inspectionType"));
this.setFilterOfInFlowing(boolMust, map.getString("EQU_LIST_CODE"), map.getString("inspectionType"), map.getString("EQU_CATEGORY_CODE"));
builder.query(boolMust);
builder.sort("REC_DATE", SortOrder.DESC);
builder.from((pageNumber - 1) * size);
......@@ -1382,14 +1382,16 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
/**
* 过滤条件去掉流程中的设备,
*
* @param boolMust 条件
* @param boolMust 条件
* @param equCategoryCode
*/
private void setFilterOfInFlowing(BoolQueryBuilder boolMust, String equListCode, String inspectionType) {
private void setFilterOfInFlowing(BoolQueryBuilder boolMust, String equListCode, String inspectionType, String equCategoryCode) {
Set<String> records = this.getEquipInFlowing();
if (records != null && !records.isEmpty()) {
boolMust.mustNot(QueryBuilders.termsQuery("SEQUENCE_NBR.keyword", records));
}
if ("5000".equals(equListCode) && JYJCBusinessTypeEnum.SCJY.getCode().equals(inspectionType)) {
// 流动时起重机械及厂车可直接做首检
if (("5000".equals(equListCode) || "4400".equals(equCategoryCode)) && JYJCBusinessTypeEnum.SCJY.getCode().equals(inspectionType)) {
boolMust.must(QueryBuilders.termQuery("IS_INTO_MANAGEMENT", false));
} else {
BoolQueryBuilder shouldBuilder = QueryBuilders.boolQuery();
......
package com.yeejoin.amos.boot.module.statistics.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*
* @author system_generator
* @date 2025-02-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="CylinderBusinessStatisticsDto", description="")
public class CylinderBusinessStatisticsDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "年月")
private String time;
@ApiModelProperty(value = "总数")
private Long num;
@ApiModelProperty(value = "机构代码")
private String supervisionOrgCode;
}
package com.yeejoin.amos.boot.module.statistics.api.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
*
*
* @author system_generator
* @date 2025-02-21
*/
@Data
@Accessors(chain = true)
@TableName("tzs_cylinder_business_statistics")
public class CylinderBusinessStatistics implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(
value = "SEQUENCE_NBR",
type = IdType.ID_WORKER
)
protected Long sequenceNbr;
/**
* 年月
*/
@TableField("time")
private String time;
/**
* 总数
*/
@TableField("num")
private Long num;
/**
* 机构代码
*/
@TableField("supervision_org_code")
private String supervisionOrgCode;
public CylinderBusinessStatistics(String time, String supervisionOrgCode) {
this.time = time;
this.supervisionOrgCode = supervisionOrgCode;
}
}
package com.yeejoin.amos.boot.module.statistics.api.mapper;
import com.yeejoin.amos.boot.module.statistics.api.entity.CylinderBusinessStatistics;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* Mapper 接口
*
* @author system_generator
* @date 2025-02-21
*/
public interface CylinderBusinessStatisticsMapper extends BaseMapper<CylinderBusinessStatistics> {
void deleteAll();
void insertBatch(@Param("list") List<CylinderBusinessStatistics> cylinderBusinessStatisticsList);
List<Map<String,Object>> getUseRegisterCount(@Param("orgCode")String orgCode);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderBusinessStatisticsMapper">
<insert id="insertBatch" parameterType="com.yeejoin.amos.boot.module.statistics.api.entity.CylinderBusinessStatistics">
insert into tzs_cylinder_business_statistics
(sequence_nbr, time, supervision_org_code, update_time) values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.sequenceNbr},
#{item.time},
#{item.supervisionOrgCode},
CURRENT_TIMESTAMP
)
</foreach>
</insert>
<delete id="deleteAll">
delete from tzs_cylinder_business_statistics
</delete>
<select id="getUseRegisterCount" resultType="java.util.Map">
SELECT
C.time, -- 月份
COUNT(1) AS num -- 每月的记录数
FROM
tzs_cylinder_business_statistics C
WHERE
C.supervision_org_code LIKE '50%' -- 仅过滤 '50%' 开头的监管机构代码
GROUP BY
C.time -- 按月份分组
</select>
</mapper>
package com.yeejoin.amos.boot.module.statistcs.biz.job;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.statistics.api.entity.CylinderBusinessStatistics;
import com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderBusinessStatisticsMapper;
import lombok.extern.slf4j.Slf4j;
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 定时任务统计
*
* @author LiuLin
*/
@EnableScheduling
@Component
@Slf4j
public class MonthCylinderBusinessStatisticsJob {
private final JgUseRegistrationMapper useRegistrationMapper;
private final CylinderBusinessStatisticsMapper businessStatisticsMapper;
public MonthCylinderBusinessStatisticsJob(JgUseRegistrationMapper useRegistrationMapper,
CylinderBusinessStatisticsMapper businessStatisticsMapper) {
this.useRegistrationMapper = useRegistrationMapper;
this.businessStatisticsMapper = businessStatisticsMapper;
}
@Scheduled(cron = "0 */5 * * * ?")
@SchedulerLock(name = "cylinderBusinessStatisticsJob", lockAtMostFor = "PT1H")
public void cylinderBusinessStatisticsJob() {
List<Map<String, Object>> useRegisterCountList = useRegistrationMapper.getUseRegisterCountTotal();
if (!CollectionUtils.isEmpty(useRegisterCountList)) {
businessStatisticsMapper.deleteAll();
List<CylinderBusinessStatistics> statisticsList = useRegisterCountList.stream()
.map(item -> new CylinderBusinessStatistics(
(String) item.get("time"),
(String) item.get("supervisionOrgCode")
))
.collect(Collectors.toList());
businessStatisticsMapper.insertBatch(statisticsList);
}
}
}
......@@ -306,11 +306,11 @@ public class CylinderDPStatisticsServiceImpl {
public Map<String, Object> getCylinderStatisticsDataByCityForTotal(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> result = new HashMap<>();
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
getCylinderMapCount(orgCode, result);
getCylinderMapCount(orgCode, result, dpFilterParamDto.getCityCode());
return result;
}
private Map<String, Object> getCylinderMapCount(String orgCode, Map<String, Object> result) {
private void getCylinderMapCount(String orgCode, Map<String, Object> result, String cityCode) {
if (StringUtils.isNotEmpty(orgCode)) {
Long cylindersCount = this.countForCylinderNum(orgCode);
Long automotiveGasCount = this.countForCylinderNumForVehicleUsed(orgCode);
......@@ -330,15 +330,38 @@ public class CylinderDPStatisticsServiceImpl {
// 检验超期气瓶数
result.put("jycqsbCount", this.countForCylinderOverdueInspect(orgCode));
// 充气量
Long fillingVolumeCount = cylinderStatisticsMapper.countFillingVolumeCount(orgCode);
result.put("fillingVolumeCount", fillingVolumeCount == null ? 0L : new BigDecimal(fillingVolumeCount).divide(new BigDecimal("10000000")).setScale(3,RoundingMode.HALF_UP).toString());
// Long fillingVolumeCount = cylinderStatisticsMapper.countFillingVolumeCount(orgCode);
Double fillingVolumeCount = this.countFillingVolumeCount(cityCode);
BigDecimal value = new BigDecimal(fillingVolumeCount);
value = value.divide(new BigDecimal("1000"), 3, RoundingMode.HALF_UP);
String unit = (fillingVolumeCount == 0) ? "吨" : (fillingVolumeCount > 10000 ? "万吨" : "吨");
BigDecimal resultValue = (fillingVolumeCount > 10000000) ? value.divide(new BigDecimal("10000000"), 3, RoundingMode.HALF_UP) : value;
result.put("fillingVolumeCount", resultValue );
// 卸液量
Long dischargeVolumeCount = cylinderStatisticsMapper.countDischargeVolumeCount(orgCode);
result.put("dischargeVolumeCount", dischargeVolumeCount == null ? 0L : new BigDecimal(dischargeVolumeCount).divide(new BigDecimal("10000000")).setScale(3,RoundingMode.HALF_UP).toString());
} else {
this.setDefaultValueIfNoData(result, "cylindersCount", "stationCount", "operatorCount", "liquefiedGasCount", "automotiveGasCount", "industrialGasCount", "useRegistrationQuantityCount", "jylqsbCount", "jycqsbCount","fillingVolumeCount","dischargeVolumeCount");
}
return result;
}
/**
* 从ES查询总量
* @param cityCode
* @return
*/
private Double countFillingVolumeCount(String cityCode) {
DPFilterParamForDetailDto dpFilterParamForDetailDto = new DPFilterParamForDetailDto();
dpFilterParamForDetailDto.setCityCode(cityCode);
List<Map<String, Object>> list = this.getFillingQuantity(dpFilterParamForDetailDto, null, null);
return list.isEmpty()
? 0L
: list.stream()
.mapToDouble(e -> Optional.ofNullable(e.get("fillingQuantity"))
.map(f -> Double.parseDouble(f.toString()))
.orElse(0.0))
.sum();
}
/**
......@@ -422,7 +445,7 @@ public class CylinderDPStatisticsServiceImpl {
Map<String, Object> item = new HashMap<>();
item.put("regionCode", r.getRegionCode());
item.put("regionName", r.getRegionName());
getCylinderMapCount(orgCode, item);
getCylinderMapCount(orgCode, item, dpFilterParamDto.getCityCode());
return item;
}).collect(Collectors.toList());
}
......
......@@ -35,6 +35,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.SafetyProblemTracing;
import com.yeejoin.amos.boot.module.jg.api.enums.*;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderBusinessStatisticsMapper;
import com.yeejoin.amos.boot.module.statistics.api.mapper.JGStatisticsMapper;
import com.yeejoin.amos.boot.module.statistics.api.mapper.ZLStatisticsMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
......@@ -180,6 +181,8 @@ public class JGDPStatisticsServiceImpl {
private JgUseRegistrationMapper useRegistrationMapper;
private CylinderBusinessStatisticsMapper businessStatisticsMapper;
private JgEnableDisableMapper enableDisableMapper;
private JgScrapCancelMapper scrapCancelMapper;
......@@ -277,8 +280,10 @@ public class JGDPStatisticsServiceImpl {
IdxBizJgTechParamsPipelineMapper idxBizJgTechParamsPipelineMapper,
IdxBizJgTechParamsElevatorMapper idxBizJgTechParamsElevatorMapper,
DataDictionaryServiceImpl iDataDictionaryService,
SafetyProblemTracingMapper safetyProblemTracingMapper) {
SafetyProblemTracingMapper safetyProblemTracingMapper,
CylinderBusinessStatisticsMapper businessStatisticsMapper) {
this.useRegistrationMapper = useRegistrationMapper;
this.businessStatisticsMapper = businessStatisticsMapper;
this.enableDisableMapper = enableDisableMapper;
this.scrapCancelMapper = scrapCancelMapper;
this.restHighLevelClient = restHighLevelClient;
......@@ -512,7 +517,7 @@ public class JGDPStatisticsServiceImpl {
List<Object> scrappedDeviceList = new ArrayList();
DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM");
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
List<Map<String,Object>> useRegisterCountList = useRegistrationMapper.getUseRegisterCount(orgCode);
List<Map<String,Object>> useRegisterCountList = businessStatisticsMapper.getUseRegisterCount(orgCode);
List<Map<String,Object>> scrappedDeviceCountList = scrapCancelMapper.getScrappedDeviceCount(dpFilterParamDto);
Map<String,Object> useRegisterCount = new HashMap<>();
Map<String,Object> scrappedDeviceCount = new HashMap<>();
......
......@@ -29,16 +29,18 @@ spring.datasource.dynamic.datasource.cyl.hikari.max-lifetime=120000
spring.datasource.dynamic.datasource.cyl.hikari.connection-timeout=30000
spring.datasource.dynamic.datasource.cyl.hikari.connection-test-query=SELECT 1
localhost=${spring.cloud.client.ip-address}
## eureka properties:
eureka.client.service-url.defaultZone=http://172.16.10.243:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.20:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.20:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.20:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.20
eureka.instance.status-page-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://${localhost}:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=${localhost}
#redis properties:
spring.redis.database=1
......@@ -72,4 +74,6 @@ eureka.instance.metadata-map.user.name=admin
eureka.instance.metadata-map.user.password=a1234560
spring.security.user.name=admin
spring.security.user.password=a1234560
management.security.enabled=true
\ No newline at end of file
management.security.enabled=true
regulatory_code_prefix=https://sxtzsb.sxsei.com:19435/tzs?code=
\ No newline at end of file
localhost=${spring.cloud.client.ip-address}
#DB properties:
spring.datasource.url=jdbc:vastbase://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
spring.datasource.username=admin
......@@ -6,11 +8,11 @@ eureka.client.service-url.defaultZone=http://172.16.10.243:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.20:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.20:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.20:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.20
eureka.instance.status-page-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://${localhost}:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=${localhost}
## ES properties:
elasticsearch.username=elastic
elasticsearch.password=a123456
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
......@@ -286,4 +287,5 @@ public class IdxBizJgProjectContraption extends BaseEntity {
*/
@TableField(exist = false)
private Boolean disableBasicButton;
}
......@@ -23,7 +23,7 @@ public interface IdxBizJgRegisterInfoMapper extends BaseMapper<IdxBizJgRegisterI
@Select("update idx_biz_jg_register_info set \"USE_ORG_CODE\" = #{useOrgCode} where \"RECORD\" = #{equipCode}")
Boolean updateUseOrgCodeByEquip(@Param("equipCode") String equipCode,@Param("useOrgCode") String useOrgCode);
@Select("select code as dictDataKey,name as dictDataValue from tz_equipment_category where parent_id = ( SELECT sub.id from tz_equipment_category as sub where sub.code = #{equipCode})")
@Select("select code as dictDataKey,name as dictDataValue from tz_equipment_category where parent_id = ( SELECT sub.id from tz_equipment_category as sub where sub.code = #{equipCode}) order by dictDataKey desc")
List<DictionarieValueModel> queryAllEquCategoriesUnderTheEquList(@Param("equipCode") String equipCode);
@MapKey("uscUnitCreditCode")
......
......@@ -5,6 +5,7 @@
<select id="getDetail" resultType="java.util.Map">
SELECT
SEQUENCE_NBR,
SEQUENCE_NBR as projectContraptionId,
USE_UNIT_CREDIT_CODE,
EQU_LIST,
EQU_CATEGORY,
......@@ -73,7 +74,8 @@
(select USC_DATE from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."USC_DATE" DESC limit 1) as uscDate,
ibjdi."DESIGN_UNIT_NAME" AS designUnitName,
ibjui."USE_DATE" AS useDate,
ibjui."RECORD" AS record
ibjui."RECORD" AS record,
ibjui.project_contraption_id AS projectContraptionId
FROM idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD
LEFT JOIN idx_biz_jg_design_info ibjdi ON ibjui.RECORD = ibjdi.RECORD
......@@ -313,48 +315,96 @@
</select>
<select id="countContraptionInUseTimesForDeleteByIntoManagement" resultType="java.lang.Integer">
SELECT SUM(inUseNumber) FROM (
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_equip_transfer A
LEFT JOIN tzs_jg_equip_transfer_eq b ON b.equip_transfer_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.apply_status != '6617'
UNION
SELECT COUNT(1) AS inUseNumber FROM tzs_jg_use_registration A
WHERE A.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.status != '已作废'
UNION
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_change_registration_unit A
LEFT JOIN tzs_jg_change_registration_unit_eq b ON b.unit_change_registration_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.status != '已作废'
UNION
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_enable_disable A
LEFT JOIN tzs_jg_enable_disable_eq b ON b.enable_disable_apply_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.audit_status != '已作废'
UNION
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_scrap_cancel A
LEFT JOIN tzs_jg_scrap_cancel_eq b ON b.equip_transfer_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.audit_status != '使用单位已撤回'
UNION
SELECT COUNT(1) AS inUseNumber FROM tzs_jg_installation_notice A
WHERE A.project_contraption_id = #{projectContraptionId}
AND A.notice_status != '6617'
UNION
SELECT COUNT(1) AS inUseNumber FROM tz_jyjc_inspection_application A
WHERE A.project_contraption_id = #{projectContraptionId}
AND A.status != '6617'
) AS result
SELECT SUM(inUseNumber)
FROM (
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_equip_transfer a
JOIN tzs_jg_equip_transfer_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.apply_status != '6617'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_use_registration a
WHERE a.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.status != '已作废'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_change_registration_unit a
JOIN tzs_jg_change_registration_unit_eq b ON b.unit_change_registration_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.status != '已作废'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_enable_disable a
JOIN tzs_jg_enable_disable_eq b ON b.enable_disable_apply_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.audit_status != '已作废'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_scrap_cancel a
JOIN tzs_jg_scrap_cancel_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.audit_status != '使用单位已撤回'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_change_registration_transfer a
JOIN tzs_jg_change_registration_transfer_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.audit_status != '使用单位已撤回'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_change_registration_name a
JOIN tzs_jg_change_registration_name_eq b ON b.name_change_registration_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.audit_status != '使用单位已撤回'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_installation_notice a
WHERE a.project_contraption_id = #{projectContraptionId}
AND a.notice_status != '6617'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_maintain_notice a
JOIN tzs_jg_maintain_notice_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.notice_status != '6617'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_reform_notice a
JOIN tzs_jg_reform_notice_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.notice_status != '6617'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_transfer_notice a
JOIN tzs_jg_transfer_notice_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.notice_status != '6617'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tz_jyjc_inspection_application a
WHERE a.project_contraption_id = #{projectContraptionId}
AND a.status != '6617'
) AS subquery
</select>
<select id="countContraptionInUseTimesForDeleteByIntoManagementBatch" resultMap="projectContraptionResultMap">
......
......@@ -154,7 +154,7 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "装备分类列表全部数据查询", notes = "装备分类列表全部数据查询")
@GetMapping(value = "/tree")
public ResponseModel<Object> tree(@RequestParam(value = "code", required = false) String code) throws Exception {
public ResponseModel<Object> tree(@RequestParam(value = "code", required = false) String code,@RequestParam(value = "dataSource", required = false) String dataSource) throws Exception {
if (ObjectUtils.isEmpty(code)) {
return ResponseHelper.buildResponse(new ArrayList<>());
}
......@@ -165,6 +165,13 @@ public class EquipmentCategoryController extends BaseController {
Menu menu = new Menu(root.getId(), root.getName(), 0L, 0);
List<Menu> menus = TreeParser.getTree(root.getId(), list, EquipmentCategory.class.getName(), "getId", 0, "getName",
"getParentId", null, "getCode");
if (Objects.nonNull(dataSource)&&"jg_his_black".equals(dataSource)){
for (Menu menu1 : menus) {
if (menu1.getName().equals("特种气瓶")){
menu1.setName("特种气瓶"+"(非车用气瓶)");
}
}
}
menu.setChildren(menus);
List<Menu> tree = new ArrayList<>();
tree.add(menu);
......
......@@ -2538,60 +2538,112 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*
* @param paramMap 更新的参数
*/
@Override
// @Override
// public Map<String, Object> commonUpdateEsDataByIds(Map<String, Map<String, Object>> paramMap) {
// if (paramMap.isEmpty()) {
// return null;
// }
// String oldUscUnitCreditCode = "";
// String oldUscUnitName = "";
// Map<String, Object> resultMap = new HashMap<>();
// for (Map.Entry<String, Map<String, Object>> entry : paramMap.entrySet()) {
// String record = entry.getKey();
// Map<String, Object> childMap = entry.getValue();
// if (!childMap.isEmpty()) {
// ESEquipmentCategoryDto oldData = null;
// // 获取Es中旧的数据
// Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
// if (!ObjectUtils.isEmpty(optional)) {
// oldData = optional.get();
// oldUscUnitCreditCode = oldData.getUSC_UNIT_CREDIT_CODE();
// oldUscUnitName = oldData.getUSC_UNIT_NAME();
// }
// // 获取Es中新的参数
// ESEquipmentCategoryDto newData = JSON.parseObject(toJSONString(childMap), ESEquipmentCategoryDto.class);
// String newUscUnitCreditCode = newData.getUSC_UNIT_CREDIT_CODE();
// String newUscUnitName = newData.getUSC_UNIT_NAME();
//
// // 删除Es中旧的数据
// if (!ObjectUtils.isEmpty(oldData)) {
// esEquipmentCategory.deleteById(record);
// // 整合新旧数据
// Bean.copyExistPropertis(newData, oldData);
// // 处理施工单位信息[去重]
// if (!ValidationUtil.isEmpty(newUscUnitCreditCode)) {
// // if (!ValidationUtil.isEmpty(oldUscUnitCreditCode)) {
// // if (!oldUscUnitCreditCode.contains(newUscUnitCreditCode)) {
// // oldData.setUSC_UNIT_CREDIT_CODE(oldUscUnitCreditCode + "," + newUscUnitCreditCode);
// // oldData.setUSC_UNIT_NAME(oldUscUnitName + "," + newUscUnitName);
// // }
// // } else {
// oldData.setUSC_UNIT_CREDIT_CODE(newUscUnitCreditCode);
// oldData.setUSC_UNIT_NAME(newUscUnitName);
// // }
// }
//
// }
// if (!ObjectUtils.isEmpty(oldData)) {
// oldData.setREC_DATE(System.currentTimeMillis());
// ESEquipmentCategoryDto saveData = esEquipmentCategory.save(oldData);
//
// // 组装返回数据
// resultMap.put(record, saveData);
// }
// }
//
// }
// return resultMap;
// }
@Override
public Map<String, Object> commonUpdateEsDataByIds(Map<String, Map<String, Object>> paramMap) {
if (paramMap.isEmpty()) {
return null;
}
String oldUscUnitCreditCode = "";
String oldUscUnitName = "";
Map<String, Object> resultMap = new HashMap<>();
Map<String, ESEquipmentCategoryDto> oldDataMap = new HashMap<>();
List<ESEquipmentCategoryDto> saveList = new ArrayList<>();
// 批量获取旧数据
for (String record : paramMap.keySet()) {
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
optional.ifPresent(dto -> oldDataMap.put(record, dto));
}
for (Map.Entry<String, Map<String, Object>> entry : paramMap.entrySet()) {
String record = entry.getKey();
Map<String, Object> childMap = entry.getValue();
if (!childMap.isEmpty()) {
ESEquipmentCategoryDto oldData = null;
// 获取Es中旧的数据
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
if (!ObjectUtils.isEmpty(optional)) {
oldData = optional.get();
oldUscUnitCreditCode = oldData.getUSC_UNIT_CREDIT_CODE();
oldUscUnitName = oldData.getUSC_UNIT_NAME();
}
// 获取Es中新的参数
ESEquipmentCategoryDto newData = JSON.parseObject(toJSONString(childMap), ESEquipmentCategoryDto.class);
String newUscUnitCreditCode = newData.getUSC_UNIT_CREDIT_CODE();
String newUscUnitName = newData.getUSC_UNIT_NAME();
// 删除Es中旧的数据
if (!ObjectUtils.isEmpty(oldData)) {
esEquipmentCategory.deleteById(record);
// 整合新旧数据
ESEquipmentCategoryDto oldData = oldDataMap.get(record);
ESEquipmentCategoryDto newData = JSON.parseObject(JSON.toJSONString(childMap), ESEquipmentCategoryDto.class);
if (oldData != null) {
Bean.copyExistPropertis(newData, oldData);
// 处理施工单位信息[去重]
String newUscUnitCreditCode = newData.getUSC_UNIT_CREDIT_CODE();
String newUscUnitName = newData.getUSC_UNIT_NAME();
if (!ValidationUtil.isEmpty(newUscUnitCreditCode)) {
// if (!ValidationUtil.isEmpty(oldUscUnitCreditCode)) {
// if (!oldUscUnitCreditCode.contains(newUscUnitCreditCode)) {
// oldData.setUSC_UNIT_CREDIT_CODE(oldUscUnitCreditCode + "," + newUscUnitCreditCode);
// oldData.setUSC_UNIT_NAME(oldUscUnitName + "," + newUscUnitName);
// }
// } else {
oldData.setUSC_UNIT_CREDIT_CODE(newUscUnitCreditCode);
oldData.setUSC_UNIT_NAME(newUscUnitName);
// }
oldData.setUSC_UNIT_CREDIT_CODE(newUscUnitCreditCode);
oldData.setUSC_UNIT_NAME(newUscUnitName);
}
}
if (!ObjectUtils.isEmpty(oldData)) {
oldData.setREC_DATE(System.currentTimeMillis());
ESEquipmentCategoryDto saveData = esEquipmentCategory.save(oldData);
// 组装返回数据
resultMap.put(record, saveData);
saveList.add(oldData);
}
}
}
// 批量删除旧数据
esEquipmentCategory.deleteAll(oldDataMap.values());
// 批量保存新数据
Iterable<ESEquipmentCategoryDto> savedData = esEquipmentCategory.saveAll(saveList);
// 组装返回数据
Map<String, Object> resultMap = new HashMap<>();
savedData.forEach(dto -> resultMap.put(dto.getSEQUENCE_NBR(), dto));
return resultMap;
}
......
localhost=${spring.cloud.client.ip-address}
#DB properties:
spring.datasource.url=jdbc:vastbase://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
spring.datasource.username=admin
......@@ -6,11 +8,11 @@ eureka.client.service-url.defaultZone=http://172.16.10.243:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.68:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.68:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.68:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.68
eureka.instance.status-page-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://${localhost}:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=${localhost}
## ES properties:
elasticsearch.username=elastic
elasticsearch.password=a123456
......
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