Commit 1675b6a3 authored by tianbo's avatar tianbo

Merge branch 'develop_tzs_register' into develop_tzs_bugfix

parents 09a0b393 9440143b
...@@ -5,6 +5,9 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; ...@@ -5,6 +5,9 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
@Repository @Repository
public interface ESEquipmentCategory extends PagingAndSortingRepository<ESEquipmentCategoryDto, String> { public interface ESEquipmentCategory extends PagingAndSortingRepository<ESEquipmentCategoryDto, String> {
List<ESEquipmentCategoryDto> findAllByProjectContraptionId(String PROJECT_CONTRAPTION_ID);
} }
...@@ -173,4 +173,10 @@ public class ESEquipmentCategoryDto { ...@@ -173,4 +173,10 @@ public class ESEquipmentCategoryDto {
@Field(type = FieldType.Text) @Field(type = FieldType.Text)
private String INFORMATION_SITUATION; private String INFORMATION_SITUATION;
/**
* 工程装置id(工业管道使用)
*/
@Field(type = FieldType.Keyword, name = "PROJECT_CONTRAPTION_ID")
private String projectContraptionId;
} }
package com.yeejoin.amos.boot.module.jg.api.dto; package com.yeejoin.amos.boot.module.jg.api.dto;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
...@@ -323,4 +324,31 @@ public class JgInstallationNoticeDto extends BaseDto { ...@@ -323,4 +324,31 @@ public class JgInstallationNoticeDto extends BaseDto {
* 冗余设备种类 * 冗余设备种类
*/ */
private String equListCode; private String equListCode;
/**
* 管道工程装置编号
*/
private String projectContraptionNo;
/**
* 管道工程装置设备数量(m)
*/
private String pipelineLength;
/**
* 管道工程装置id
*/
private String projectContraptionId;
/**
* 装置起始位置-压力管道使用
*/
@ApiModelProperty("start_latitude_longitude")
private JSONObject startLatitudeLongitude;
/**
* 装置结束位置-压力管道使用
*/
@ApiModelProperty("end_latitude_longitude")
private JSONObject endLatitudeLongitude;
} }
package com.yeejoin.amos.boot.module.jg.api.dto;
import com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine;
import com.yeejoin.amos.boot.biz.common.annotation.Group;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
@Group(value = "equip_design_info")
public class PieLineDesignChangeDataDto extends BaseChangeDataDto {
@FieldDisplayDefine(value = "设计单位名称")
private String designUnitName;
}
package com.yeejoin.amos.boot.module.jg.api.dto;
import com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine;
import com.yeejoin.amos.boot.biz.common.annotation.Group;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 安全追溯-压力管道
*
* @author system_generator
* @date 2023-08-17
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@Group(value = "PipelineChangeItemDto")
public class PipelineChangeItemDto extends TechParamsPipelineChangeFieldDto {
@FieldDisplayDefine(value = "设计单位名称")
private String designUnitName;
}
package com.yeejoin.amos.boot.module.jg.api.dto;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine;
import com.yeejoin.amos.boot.biz.common.annotation.Group;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 管道工程装置表
*
* @author system_generator
* @date 2024-12-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Group(value = "idx_biz_jg_project_contraption")
@ApiModel(value = "ProjectContraptionChangeFieldDto", description = "管道工程装置表")
public class ProjectContraptionChangeDataDto extends BaseChangeDataDto {
@FieldDisplayDefine(value = "主键", isExist = false)
private String projectContraptionId;
private static final long serialVersionUID = 1L;
@FieldDisplayDefine(value = "工程装置名称")
private String projectContraption;
@FieldDisplayDefine(value = "工程装置编号")
private String projectContraptionNo;
@FieldDisplayDefine(value = "设备品种代码")
private String equDefineCode;
@FieldDisplayDefine(value = "设备品种名称")
private String equDefine;
@FieldDisplayDefine(value = "装置管道总长度(m)", isExist = false)
private Double pipelineLength;
@FieldDisplayDefine(value = "产品照片附件", type = JSON.class)
private String productPhoto;
@FieldDisplayDefine(value = "其他附件", type = JSON.class)
private String otherAccessories;
@FieldDisplayDefine(value = "产品质量合格证明", type = JSON.class)
private String productQualificationCertificate;
}
...@@ -69,4 +69,11 @@ public class TaskMessageDto { ...@@ -69,4 +69,11 @@ public class TaskMessageDto {
* 登记类型(新增使用登记,历史使用登记,特殊使用登记) * 登记类型(新增使用登记,历史使用登记,特殊使用登记)
*/ */
String regType; String regType;
/**
* 设备种类code
*/
String EQU_LIST_CODE;
} }
package com.yeejoin.amos.boot.module.jg.api.dto; package com.yeejoin.amos.boot.module.jg.api.dto;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine; import com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine;
import com.yeejoin.amos.boot.biz.common.annotation.Group; import com.yeejoin.amos.boot.biz.common.annotation.Group;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
/** /**
...@@ -12,14 +12,19 @@ import lombok.experimental.Accessors; ...@@ -12,14 +12,19 @@ import lombok.experimental.Accessors;
* @author system_generator * @author system_generator
* @date 2023-08-17 * @date 2023-08-17
*/ */
@EqualsAndHashCode(callSuper = true)
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@Group(value = "tech_params_pipeline") @Group(value = "tech_params_pipeline")
public class TechParamsPipelineChangeFieldDto extends BaseTechParamsFieldDto { public class TechParamsPipelineChangeFieldDto extends BaseTechParamsFieldDto {
@FieldDisplayDefine(value = "管道类别") @FieldDisplayDefine(value = "w唯一标识", isExist = false)
private String pipelineClass; private String record;
@FieldDisplayDefine(value = "管道名称(登记单元)")
private String pipeName;
@FieldDisplayDefine(value = "管道编号") @FieldDisplayDefine(value = "管道编号")
...@@ -39,27 +44,31 @@ public class TechParamsPipelineChangeFieldDto extends BaseTechParamsFieldDto { ...@@ -39,27 +44,31 @@ public class TechParamsPipelineChangeFieldDto extends BaseTechParamsFieldDto {
@FieldDisplayDefine(value = "管道长度") @FieldDisplayDefine(value = "管道长度")
private String pipeLength; private Double pipeLength;
@FieldDisplayDefine(value = "起/始位置", type = JSON.class)
private String startePosition;
@FieldDisplayDefine(value = "压力") @FieldDisplayDefine(value = "设计压力")
private String pressure; private String pressure;
@FieldDisplayDefine(value = "温度") @FieldDisplayDefine(value = "设计温度")
private String temperature; private String temperature;
@FieldDisplayDefine(value = "介质") @FieldDisplayDefine(value = "设计介质")
private String medium; private String medium;
@FieldDisplayDefine(value = "工作压力")
private String workPressure;
@FieldDisplayDefine(value = "工作温度")
private String workTemperature;
@FieldDisplayDefine(value = "工作介质")
private String workMedium;
@FieldDisplayDefine(value = "备注") @FieldDisplayDefine(value = "备注")
private String remarks; private String remarks;
} }
...@@ -487,4 +487,21 @@ public class JgInstallationNotice extends BaseEntity { ...@@ -487,4 +487,21 @@ public class JgInstallationNotice extends BaseEntity {
*/ */
@TableField("equ_list_code") @TableField("equ_list_code")
private String equListCode; private String equListCode;
/**
* 工程装置主键-压力管道使用
*/
@TableField("project_contraption_id")
private String projectContraptionId;
/**
* 装置起始位置-压力管道使用
*/
@TableField("start_latitude_longitude")
private String startLatitudeLongitude;
/**
* 装置结束位置-压力管道使用
*/
@TableField("end_latitude_longitude")
private String endLatitudeLongitude;
} }
...@@ -261,4 +261,10 @@ public class JgUseRegistration extends BaseEntity { ...@@ -261,4 +261,10 @@ public class JgUseRegistration extends BaseEntity {
*/ */
@TableField("supervision_org_code") @TableField("supervision_org_code")
private String supervisionOrgCode; private String supervisionOrgCode;
/**
* 工程装置id
*/
@TableField("project_contraption_id")
private String projectContraptionId;
} }
...@@ -44,4 +44,8 @@ public interface JgInstallationNoticeMapper extends CustomBaseMapper<JgInstallat ...@@ -44,4 +44,8 @@ public interface JgInstallationNoticeMapper extends CustomBaseMapper<JgInstallat
List<CompanyEquipCountDto> queryForFlowingEquipList(); List<CompanyEquipCountDto> queryForFlowingEquipList();
List<InstallationVo> queryInstallationInIds(@Param("ids") List<String> ids); List<InstallationVo> queryInstallationInIds(@Param("ids") List<String> ids);
List<Map<String, Object>> getDeviceListByProjectContraption(@Param("projectContraptionSeq") String projectContraptionSeq);
List<Map<String, Object>> getPipelineEquInfoByRecords(@Param("records") List<String> records);
} }
package com.yeejoin.amos.boot.module.jg.api.mapper; package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/** /**
* Mapper 接口 * Mapper 接口
...@@ -13,5 +14,5 @@ import java.util.List; ...@@ -13,5 +14,5 @@ import java.util.List;
*/ */
public interface JgResumeInfoMapper extends BaseMapper<JgResumeInfo> { public interface JgResumeInfoMapper extends BaseMapper<JgResumeInfo> {
void deleteBatchByBusinessId(@Param("idList") List<String> idList); void deleteBatchByBusinessId(@Param("idList") Set<String> idList);
} }
...@@ -77,6 +77,8 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> { ...@@ -77,6 +77,8 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
@MapKey("records") @MapKey("records")
List<Map<String, Object>> queryForUnitPipelineEquipment(@Param("records") List<String> records); List<Map<String, Object>> queryForUnitPipelineEquipment(@Param("records") List<String> records);
List<Map<String, Object>> queryForUnitPipelineEquipmentForEdit(@Param("records") List<String> records);
@MapKey("id") @MapKey("id")
List<Map<String, Object>> selectEquipList(@Param("id") Long id); List<Map<String, Object>> selectEquipList(@Param("id") Long id);
...@@ -110,4 +112,11 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> { ...@@ -110,4 +112,11 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
List<Map> stopStateCount(@Param("orgCode") String orgCode); List<Map> stopStateCount(@Param("orgCode") String orgCode);
List<Map> cancelStateCount(@Param("orgCode") String orgCode, @Param("cancelType") int cancelType); List<Map> cancelStateCount(@Param("orgCode") String orgCode, @Param("cancelType") int cancelType);
/**
* 查询指定装置下可做使用登记的的管道,样式为汇总表样式
* @param projectContraptionSeq 装置id
* @return List<Map<String, Object>>
*/
List<Map<String, Object>> selectPieLineListByOfCanReg(@Param("projectContraptionSeq") String projectContraptionSeq);
} }
...@@ -85,5 +85,5 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot ...@@ -85,5 +85,5 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot
*/ */
JgInstallationNotice cancelApplication(Long sequenceNbr, String cancelReason); JgInstallationNotice cancelApplication(Long sequenceNbr, String cancelReason);
Boolean historyDataRepair(); Object getDeviceListByProjectContraption(String projectContraptionSeq);
} }
...@@ -200,4 +200,114 @@ ...@@ -200,4 +200,114 @@
isn.create_date DESC, isn.apply_no DESC isn.create_date DESC, isn.apply_no DESC
</select> </select>
<sql id="page-list-pipeline">
SELECT ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
to_char(ui."USE_DATE", 'YYYY-MM') useDate,
(SELECT DESIGN_UNIT_NAME from idx_biz_jg_design_info where "RECORD" = ui."RECORD") designUnitName,
(SELECT USC_UNIT_NAME
from idx_biz_jg_construction_info
where "RECORD" = ui."RECORD"
ORDER BY USC_DATE DESC
limit 1) uscUnitName,
to_char((SELECT USC_DATE
from idx_biz_jg_construction_info
where "RECORD" = ui."RECORD"
ORDER BY USC_DATE DESC
limit 1), 'YYYY-MM') uscDate,
ui."RECORD" record,
ri."EQU_CODE" equCode,
ri."EQU_LIST" equList,
(select name from tz_equipment_category where code = ri."EQU_LIST") equListName,
ri."EQU_CATEGORY" equCategory,
(select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName,
ri."EQU_DEFINE" equDefine,
(select name from tz_equipment_category where code = ri."EQU_DEFINE") equDefineName,
ri."PRODUCT_NAME" productName,
ri."BRAND_NAME" brandName,
ri."EQU_TYPE" equType,
ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
pp."DEVICE_NAME" deviceName,
(select name from cb_data_dictionary where code = pp."DEVICE_LEVEL" and type = 'GBI') deviceLevel,
pp."PIPE_NAME" pipeName,
pp."PIPELINE_NUMBER" pipelineNumber,
pp."NOMINAL_DIAMETER" nominalDiameter,
pp."WALL_THICKNESS" wallThickness,
pp."PIPE_LENGTH" pipeLength,
pp."PRESSURE" pressure,
pp."TEMPERATURE" temperature,
pp."MEDIUM" medium,
pp."WORK_PRESSURE" workPressure,
pp."WORK_TEMPERATURE" workTemperature,
pp."WORK_MEDIUM" workMedium,
pp."REMARKS" remarks,
(select INSPECT_ORG_NAME
from idx_biz_jg_inspection_detection_info
where "RECORD" = ui."RECORD"
ORDER BY REC_DATE DESC
limit 1) inspectOrgName,
(select name
from cb_data_dictionary
where type = 'JYJL'
and code = (select INSPECT_CONCLUSION
from idx_biz_jg_inspection_detection_info
where "RECORD" = ui."RECORD"
ORDER BY REC_DATE DESC
limit 1)) inspectConclusion,
to_char((select NEXT_INSPECT_DATE
from idx_biz_jg_inspection_detection_info
where "RECORD" = ui."RECORD"
ORDER BY REC_DATE DESC
limit 1), 'YYYY-MM-DD') nextInspectDate
FROM idx_biz_jg_use_info ui
LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD"
LEFT JOIN idx_biz_jg_tech_params_pipeline pp ON pp."RECORD" = ui."RECORD"
</sql>
<select id="getDeviceListByProjectContraption" resultType="java.util.Map">
<include refid="page-list-pipeline"/>
<where>
ri."EQU_CATEGORY" = '8300'
and ui."DATA_SOURCE" like 'jg%' and ui."DATA_SOURCE" not like 'jg_his%'
<if test="projectContraptionSeq != null and projectContraptionSeq != ''">
and ui."PROJECT_CONTRAPTION_ID" = #{projectContraptionSeq}
</if>
-- 排除 已经做过安装告知的
AND NOT EXISTS (
SELECT 1
FROM
tzs_jg_installation_notice n,
tzs_jg_installation_notice_eq ne
WHERE
n.sequence_nbr = ne.equip_transfer_id
AND ne.equ_id = ui."RECORD"
AND (
n.notice_status = '6621'
OR n.notice_status = '6612'
OR n.notice_status = '6614'
OR n.notice_status = '6615'
OR n.notice_status = '6616'
OR n.notice_status = '6618'
)
AND n.is_delete = 0
)
</where>
</select>
<select id="getPipelineEquInfoByRecords" resultType="java.util.Map">
<include refid="page-list-pipeline"/>
<where>
<if test="records != null and !records.isEmpty()">
and ui."RECORD" in
<foreach collection="records" item="record" open="(" close=")" separator=",">
#{record}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>
...@@ -223,8 +223,8 @@ ...@@ -223,8 +223,8 @@
WHERE LENGTH(t.use_registration_code) = 14 WHERE LENGTH(t.use_registration_code) = 14
AND SUBSTR(t.use_registration_code, 1, 1) IN ('容', '锅', '管', '瓶', '梯', '起', '索', '游', '车') AND SUBSTR(t.use_registration_code, 1, 1) IN ('容', '锅', '管', '瓶', '梯', '起', '索', '游', '车')
AND TRIM(t.use_registration_code) LIKE concat('%(',#{year},')') AND TRIM(t.use_registration_code) LIKE concat('%(',#{year},')')
and tjur.reg_type is null AND (tjur.reg_type IS NULL OR tjur.reg_type = 2)
and tjur.is_delete = 0 AND tjur.is_delete = 0
GROUP BY SUBSTR(t.use_registration_code, 1, 5) GROUP BY SUBSTR(t.use_registration_code, 1, 5)
HAVING code <![CDATA[ <> ]]> '00000' HAVING code <![CDATA[ <> ]]> '00000'
ORDER BY prefix ORDER BY prefix
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
ur.cancel_reason as cancelReason, ur.cancel_reason as cancelReason,
(select group_concat(re.equ_id) from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id) as equipId, (select group_concat(re.equ_id) from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id) as equipId,
(SELECT (SELECT
group_concat(other.supervisory_code) group_concat(DISTINCT other.supervisory_code)
from from
idx_biz_jg_register_info jri idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_other_info other on jri.RECORD = other.RECORD where jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as supervisoryCode , LEFT JOIN idx_biz_jg_other_info other on jri.RECORD = other.RECORD where jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as supervisoryCode ,
...@@ -500,9 +500,11 @@ ...@@ -500,9 +500,11 @@
ibjui."CITY_NAME" as installCity, ibjui."CITY_NAME" as installCity,
ibjui."COUNTY_NAME" as installCounty, ibjui."COUNTY_NAME" as installCounty,
ibjci."USC_UNIT_CREDIT_CODE" as uscUnitCreditCode, ibjci."USC_UNIT_CREDIT_CODE" as uscUnitCreditCode,
ibjci."USC_UNIT_NAME" as uscUnitName ibjci."USC_UNIT_NAME" as uscUnitName,
re."INSTALLATION_IS_COMPLETE" as installationIsComplete
FROM "idx_biz_jg_construction_info" AS ibjci FROM "idx_biz_jg_construction_info" AS ibjci
left join "idx_biz_jg_use_info" as ibjui on ibjui."RECORD" = ibjci."RECORD" left join "idx_biz_jg_use_info" as ibjui on ibjui."RECORD" = ibjci."RECORD"
left join "idx_biz_jg_register_info" as re on re."RECORD" = ibjci."RECORD"
WHERE ibjci."RECORD" = #{id} WHERE ibjci."RECORD" = #{id}
ORDER BY ibjci."rec_date" desc ORDER BY ibjci."rec_date" desc
LIMIT 1 LIMIT 1
...@@ -590,11 +592,13 @@ ...@@ -590,11 +592,13 @@
SELECT SELECT
ui."USE_UNIT_NAME" useUnitName, ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode, ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
ui."PROJECT_CONTRAPTION_ID" as projectContraptionId,
to_char(ui."USE_DATE", 'YYYY-MM') useDate, to_char(ui."USE_DATE", 'YYYY-MM') useDate,
(SELECT DESIGN_UNIT_NAME from idx_biz_jg_design_info where "RECORD" = ui."RECORD") designUnitName, (SELECT DESIGN_UNIT_NAME from idx_biz_jg_design_info where "RECORD" = ui."RECORD") designUnitName,
(SELECT USC_UNIT_NAME from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE DESC limit 1) uscUnitName, (SELECT USC_UNIT_NAME from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE DESC limit 1) uscUnitName,
to_char((SELECT USC_DATE from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE DESC limit 1), 'YYYY-MM') uscDate, to_char((SELECT USC_DATE from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE DESC limit 1), 'YYYY-MM') uscDate,
ui."RECORD" record, ui."RECORD" record,
ui.IS_INTO_MANAGEMENT as isIntoManagement,
ri."EQU_CODE" equCode, ri."EQU_CODE" equCode,
ri."EQU_LIST" equList, ri."EQU_LIST" equList,
(select name from tz_equipment_category where code = ri."EQU_LIST") equListName, (select name from tz_equipment_category where code = ri."EQU_LIST") equListName,
...@@ -602,11 +606,13 @@ ...@@ -602,11 +606,13 @@
(select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName, (select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName,
ri."EQU_DEFINE" equDefine, ri."EQU_DEFINE" equDefine,
(select name from tz_equipment_category where code = ri."EQU_DEFINE") equDefineName, (select name from tz_equipment_category where code = ri."EQU_DEFINE") equDefineName,
ri."PRODUCT_NAME" productName, -- 历史遗留问题 故 as
pp."PIPE_NAME" as productName,
ri."BRAND_NAME" brandName, ri."BRAND_NAME" brandName,
ri."EQU_TYPE" equType, ri."EQU_TYPE" equType,
ri."EQU_CODE_TYPE" equCodeType, ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder, ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
ri."USE_ORG_CODE" useOrgCode,
pp."DEVICE_NAME" deviceName, pp."DEVICE_NAME" deviceName,
(select name from cb_data_dictionary where code = pp."DEVICE_LEVEL" and type = 'GBI') deviceLevel, (select name from cb_data_dictionary where code = pp."DEVICE_LEVEL" and type = 'GBI') deviceLevel,
pp."PIPE_NAME" pipeName, pp."PIPE_NAME" pipeName,
...@@ -618,9 +624,12 @@ ...@@ -618,9 +624,12 @@
pp."TEMPERATURE" temperature, pp."TEMPERATURE" temperature,
pp."MEDIUM" medium, pp."MEDIUM" medium,
pp."REMARKS" remarks, pp."REMARKS" remarks,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY REC_DATE DESC limit 1) inspectOrgName, pp."WORK_PRESSURE" AS workPressure,
(select name from cb_data_dictionary where type = 'JYJL' and code = (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY REC_DATE DESC limit 1)) inspectConclusion, pp."WORK_TEMPERATURE" AS workTemperature,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY REC_DATE DESC limit 1), 'YYYY-MM-DD') nextInspectDate pp."WORK_MEDIUM" AS workMedium,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectOrgName,
(select name from cb_data_dictionary where type = 'JYJL' and code = (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1)) inspectConclusion,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1), 'YYYY-MM-DD') nextInspectDate
FROM FROM
idx_biz_jg_use_info ui idx_biz_jg_use_info ui
LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD" LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD"
...@@ -669,6 +678,34 @@ ...@@ -669,6 +678,34 @@
</foreach> </foreach>
ORDER BY ui.REC_DATE DESC ORDER BY ui.REC_DATE DESC
</select> </select>
<select id="queryForUnitPipelineEquipmentForEdit" resultType="java.util.Map">
SELECT
ibjtpp."PIPE_NAME" AS pipeName,
ibjtpp."PIPELINE_NUMBER" AS pipelineNumber,
ibjtpp."DEVICE_LEVEL" AS deviceLevel,
ibjtpp."NOMINAL_DIAMETER" AS nominalDiameter,
ibjtpp."WALL_THICKNESS" AS wallThickness,
ibjtpp."PIPE_LENGTH" AS pipeLength,
ibjtpp."PRESSURE" AS pressure,
ibjtpp."TEMPERATURE" AS temperature,
ibjtpp."MEDIUM" AS medium,
ibjtpp."WORK_PRESSURE" AS workPressure,
ibjtpp."WORK_TEMPERATURE" AS workTemperature,
ibjtpp."WORK_MEDIUM" AS workMedium,
ibjtpp."REMARKS" AS remarks,
ibjdi."DESIGN_UNIT_NAME" AS designUnitName,
ibjui."USE_DATE" AS useDate,
ibjui."RECORD" AS record
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
WHERE
ibjui.record in
<foreach collection="records" item="record" open="(" close=")" separator=",">
#{record}
</foreach>
ORDER BY ibjui.REC_DATE DESC
</select>
<sql id="page-list-vessel"> <sql id="page-list-vessel">
SELECT SELECT
ui."USE_UNIT_NAME" useUnitName, ui."USE_UNIT_NAME" useUnitName,
...@@ -1009,6 +1046,17 @@ ...@@ -1009,6 +1046,17 @@
GROUP BY GROUP BY
EQU_CATEGORY EQU_CATEGORY
</select> </select>
<select id="selectPieLineListByOfCanReg" resultType="java.util.Map">
select * from (
<include refid="page-list-pipeline"/>
WHERE
ri."EQU_CATEGORY" = '8300'
and ui."PROJECT_CONTRAPTION_ID" = #{projectContraptionSeq}
AND ui.IS_INTO_MANAGEMENT = true
and (length(ri.USE_ORG_CODE) = 0 or ri.USE_ORG_CODE is null)
ORDER BY ui.REC_DATE DESC
)
</select>
<sql id="list-cylinder"> <sql id="list-cylinder">
SELECT SELECT
......
...@@ -45,6 +45,4 @@ public class BizDataChangeController { ...@@ -45,6 +45,4 @@ public class BizDataChangeController {
@RequestParam(required = false) String bizId) { @RequestParam(required = false) String bizId) {
return ResponseHelper.buildResponse(bizDataChangeService.queryDetail(applyNo, bizType, model, bizId)); return ResponseHelper.buildResponse(bizDataChangeService.queryDetail(applyNo, bizType, model, bizId));
} }
} }
...@@ -196,6 +196,31 @@ public class CommonController extends BaseController { ...@@ -196,6 +196,31 @@ public class CommonController extends BaseController {
return ResponseHelper.buildResponse(commonService.equipmentClassification(type)); return ResponseHelper.buildResponse(commonService.equipmentClassification(type));
} }
/**
* 设备分类 去掉管道分类
*
* @param type 1,设备种类 2,设备类别 3,设备品种
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/equipmentClassificationNoPipeline")
@ApiOperation(httpMethod = "GET", value = "设备分类", notes = "1,设备种类 2,设备类别 3,设备品种")
public ResponseModel<List<EquipmentCategoryDto>> equipmentClassificationNoPipeline(@RequestParam(value = "type") String type) {
return ResponseHelper.buildResponse(commonService.equipmentClassificationNoPipeline(type));
}
/**
* 设备品种
*
* @param parentId 父级ID
* @return list
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getEquDefineByParentId")
@ApiOperation(httpMethod = "GET", value = "根据父级ID查询设备品种", notes = "根据父级ID查询设备品种")
public ResponseModel<List<EquipmentCategoryDto>> getEquDefineByParentId(@RequestParam(value = "parentId") String parentId) {
return ResponseHelper.buildResponse(commonService.getEquDefineByParentId(parentId));
}
/** /**
* 查询安全管理员的基本信息 * 查询安全管理员的基本信息
......
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.DataHandlerServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource;
/**
* 用于业务变更过程中历史数据处理的控制层
*/
@Api(tags = "用于业务变更过程中历史数据处理的控制层")
@RestController
@RequestMapping(value = "/dataHandler")
public class DataHandlerController extends BaseController {
@Resource
private DataHandlerServiceImpl dataHandlerService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式", notes = "安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式")
@GetMapping(value = "/installNotice/deviceListInForm")
public ResponseModel<Boolean> deviceListInFormWithInstallNotice() {
return ResponseHelper.buildResponse(dataHandlerService.deviceListInFormWithInstallNotice());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "向新增的工程装置表刷入数据", notes = "向新增的工程装置表刷入数据")
@GetMapping(value = "/projectContraption/writeData")
public ResponseModel<Boolean> writeData2ProjectContraption() {
return ResponseHelper.buildResponse(dataHandlerService.writeData2ProjectContraption());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "刷入工程装置id到es的idx_biz_view_jg_all索引", notes = "刷入工程装置id到es的idx_biz_view_jg_all索引")
@GetMapping(value = "/jgAllIndex/writeProjectContraptionId")
public ResponseModel<String> writeProjectContraptionId() {
return ResponseHelper.buildResponse(dataHandlerService.writeProjectContraptionId());
}
}
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.biz.service.impl.IdxBizJgProjectContraptionServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto;
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;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
/**
* 管道工程装置表
*
* @author system_generator
* @date 2024-12-11
*/
@RestController
@Api(tags = "管道工程装置表Api")
@RequestMapping(value = "/idx-biz-jg-project-contraption")
public class IdxBizJgProjectContraptionController extends BaseController {
@Autowired
IdxBizJgProjectContraptionServiceImpl idxBizJgProjectContraptionServiceImpl;
/**
* 新增管道工程装置表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增管道工程装置表", notes = "新增管道工程装置表")
public ResponseModel<IdxBizJgProjectContraptionDto> save(@RequestBody IdxBizJgProjectContraptionDto model) {
model = idxBizJgProjectContraptionServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新管道工程装置表", notes = "根据sequenceNbr更新管道工程装置表")
public ResponseModel<IdxBizJgProjectContraptionDto> updateBySequenceNbrIdxBizJgProjectContraption(@RequestBody IdxBizJgProjectContraptionDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除管道工程装置表及设备信息", notes = "根据sequenceNbr删除管道工程装置表及设备信息")
public ResponseModel<Boolean> deleteBySequenceNbr(@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.deleteProjectAndEquInfoBySeq(sequenceNbr));
}
/**
* 根据入参 分页查询(当前)单位下的工程管道
*
* @param params - isIntoManagement 是否是否纳管 true/false
* - useRegistrationCode 使用登记编号 string()
* - regCodeIsNull 使用登记编号是否为空 true/false
* @param current 当前页
* @param size 每页大小
* @return result
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/pageByParams")
@ApiOperation(httpMethod = "GET", value = "根据入参 分页查询(当前)单位下的工程管道", notes = "根据入参 分页查询(当前)单位下的工程管道")
public ResponseModel<IPage<IdxBizJgProjectContraption>> proConPageByParams(
@RequestParam Map<String, String> params,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<IdxBizJgProjectContraption> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
ReginParams reginParams = getSelectedOrgInfo();
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.proConPageByParams(params, page, reginParams));
}
/**
* 根据入参 列表查询(当前)单位下的工程管道
*
* @param params - isIntoManagement 是否是否纳管 true/false
* - useRegistrationCode 使用登记编号 string()
* - regCodeIsNull 使用登记编号是否为空 true/false
* @return result
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/listByParams")
@ApiOperation(httpMethod = "GET", value = "根据入参 列表查询(当前)单位下的工程管道", notes = "根据入参 列表查询(当前)单位下的工程管道")
public ResponseModel<List<IdxBizJgProjectContraption>> proConListByParams(@RequestParam Map<String, String> params) {
ReginParams reginParams = getSelectedOrgInfo();
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.proConListByParams(params, reginParams));
}
/**
* 根据sequenceNbr查询详情
*
* @param sequenceNbr 主键
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/details")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个管道工程装置表", notes = "根据sequenceNbr查询单个管道工程装置表")
public ResponseModel<Map<String, Map<String, Object>>> selectOne(@RequestParam("sequenceNbr") String sequenceNbr) {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.details(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "管道工程装置表分页查询", notes = "管道工程装置表分页查询")
public ResponseModel<Page<IdxBizJgProjectContraptionDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<IdxBizJgProjectContraptionDto> page = new Page<IdxBizJgProjectContraptionDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.queryForIdxBizJgProjectContraptionPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "管道工程装置表列表全部数据查询", notes = "管道工程装置表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<IdxBizJgProjectContraptionDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.queryForIdxBizJgProjectContraptionList());
}
}
...@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.component.event.RestEventTrigger; import org.typroject.tyboot.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -162,11 +163,12 @@ public class JgInstallationNoticeController extends BaseController { ...@@ -162,11 +163,12 @@ public class JgInstallationNoticeController extends BaseController {
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "安装告知历史数据修复", notes = "安装告知历史数据修复") @ApiOperation(httpMethod = "GET", value = "查询工程装置下的所有未做安装告知、不在安装告知流程、安装告知作废的设备",
@GetMapping(value = "/historyDataRepair") notes = "查询工程装置下的所有未做安装告知、不在安装告知流程、安装告知作废的设备")
public ResponseModel<Boolean> historyDataRepair() { @GetMapping(value = "/getDeviceListByProjectContraptionSeq")
return ResponseHelper.buildResponse(iJgInstallationNoticeService.historyDataRepair()); public ResponseModel<Object> getDeviceListByProjectContraption(@RequestParam Map<String, Object> params) {
String projectContraptionSeq = ValidationUtil.isEmpty(params.get("sequenceNbr")) ? String.valueOf(params.get("record")) : params.get("sequenceNbr").toString();
return ResponseHelper.buildResponse(iJgInstallationNoticeService.getDeviceListByProjectContraption(projectContraptionSeq));
} }
} }
package com.yeejoin.amos.boot.module.jg.biz.controller; package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; 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.controller.BaseController;
...@@ -8,6 +9,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto; ...@@ -8,6 +9,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration; import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.feign.utils.FeignUtil; import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
...@@ -25,6 +27,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -25,6 +27,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.ParseException; import java.text.ParseException;
...@@ -341,4 +344,25 @@ public class JgUseRegistrationController extends BaseController { ...@@ -341,4 +344,25 @@ public class JgUseRegistrationController extends BaseController {
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.updateCylinderCategoryByEquCodeBatch(cylinderCategory, equCodeList)); return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.updateCylinderCategoryByEquCodeBatch(cylinderCategory, equCodeList));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jgProjectContraptionPage")
@ApiOperation(value = "查询指定使用单位下的可用装置,已纳管且使用登记证编号为空或者null", notes = "不包括流程中的")
public ResponseModel<IPage<IdxBizJgProjectContraption>> getJgProjectContraptionPage(@RequestParam String useUnitCreditCode,
@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);
return ResponseHelper.buildResponse(re);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询工程装置下的所有做过安装告知但是为做使用登记的管道", notes = "查询工程装置下的所有做过安装告知但是为做使用登记的管道")
@GetMapping(value = "/getDeviceListByProjectContraptionSeq")
public ResponseModel<Object> getDeviceListByProjectContraption(@RequestParam("record") String projectContraptionSeq) {
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.getDeviceListByProjectContraption(projectContraptionSeq));
}
} }
...@@ -17,7 +17,7 @@ public interface IChangeDataProcessStrategy { ...@@ -17,7 +17,7 @@ public interface IChangeDataProcessStrategy {
List<ChangeDataDto> handle(Map<String, Object> changeData, String defaultChangeId); List<ChangeDataDto> handle(Map<String, Object> changeData, String defaultChangeId);
Map<String, ?> getDetail(String applyNo, String bizId); Map<String, Object> getDetail(String applyNo, String bizId);
/** /**
* 可处理类型 * 可处理类型
......
...@@ -237,4 +237,8 @@ public interface ICommonService { ...@@ -237,4 +237,8 @@ public interface ICommonService {
* @return * @return
*/ */
Boolean useRegistrationCertificateAccountUnique(String useRegistrationCode, String equipId); Boolean useRegistrationCertificateAccountUnique(String useRegistrationCode, String equipId);
List<EquipmentCategoryDto> equipmentClassificationNoPipeline(String type);
List<EquipmentCategoryDto> getEquDefineByParentId(String parentId);
} }
...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jg.biz.service; ...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo;
import java.util.List;
/** /**
* 施工信息表接口类 * 施工信息表接口类
* *
...@@ -13,5 +15,7 @@ public interface IIdxBizJgConstructionInfoService extends IService<IdxBizJgConst ...@@ -13,5 +15,7 @@ public interface IIdxBizJgConstructionInfoService extends IService<IdxBizJgConst
boolean saveOrUpdateData(IdxBizJgConstructionInfo constructionInfo); boolean saveOrUpdateData(IdxBizJgConstructionInfo constructionInfo);
boolean saveOrUpdateBatch(List<IdxBizJgConstructionInfo> constructionInfoList);
IdxBizJgConstructionInfo queryNewestDetailByRecord(String record); IdxBizJgConstructionInfo queryNewestDetailByRecord(String record);
} }
...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jg.biz.service; ...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgDesignInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgDesignInfo;
import java.util.List;
/** /**
* 安全追溯-设计信息表接口类 * 安全追溯-设计信息表接口类
* *
...@@ -13,5 +15,7 @@ public interface IIdxBizJgDesignInfoService { ...@@ -13,5 +15,7 @@ public interface IIdxBizJgDesignInfoService {
boolean saveOrUpdateData(IdxBizJgDesignInfo designInfo); boolean saveOrUpdateData(IdxBizJgDesignInfo designInfo);
boolean saveOrUpdateBatch(List<IdxBizJgDesignInfo> designInfoList);
IdxBizJgDesignInfo getOneData(String record); IdxBizJgDesignInfo getOneData(String record);
} }
...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jg.biz.service; ...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgFactoryInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgFactoryInfo;
import java.util.List;
/** /**
* 安全追溯-制造信息接口类 * 安全追溯-制造信息接口类
* *
...@@ -14,4 +16,6 @@ public interface IIdxBizJgFactoryInfoService { ...@@ -14,4 +16,6 @@ public interface IIdxBizJgFactoryInfoService {
boolean saveOrUpdateData(IdxBizJgFactoryInfo factoryInfo); boolean saveOrUpdateData(IdxBizJgFactoryInfo factoryInfo);
IdxBizJgFactoryInfo getOneData(String record); IdxBizJgFactoryInfo getOneData(String record);
boolean saveOrUpdateBatch(List<IdxBizJgFactoryInfo> factoryInfoList);
} }
...@@ -15,4 +15,6 @@ public interface IIdxBizJgInspectionDetectionInfoService { ...@@ -15,4 +15,6 @@ public interface IIdxBizJgInspectionDetectionInfoService {
IdxBizJgInspectionDetectionInfo queryNewestDetailByRecord(String record); IdxBizJgInspectionDetectionInfo queryNewestDetailByRecord(String record);
List<IdxBizJgInspectionDetectionInfo> checkInspectionInfo(List<String> records); List<IdxBizJgInspectionDetectionInfo> checkInspectionInfo(List<String> records);
boolean saveOrUpdateBatch(List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList);
} }
...@@ -17,4 +17,6 @@ public interface IIdxBizJgOtherInfoService { ...@@ -17,4 +17,6 @@ public interface IIdxBizJgOtherInfoService {
IdxBizJgOtherInfo getOneData(String record); IdxBizJgOtherInfo getOneData(String record);
void saveBatch(List<IdxBizJgOtherInfo> otherInfoList); void saveBatch(List<IdxBizJgOtherInfo> otherInfoList);
boolean saveOrUpdateBatch(List<IdxBizJgOtherInfo> otherInfoList);
} }
package com.yeejoin.amos.boot.module.jg.biz.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import java.util.List;
import java.util.Map;
/**
* 管道工程装置表接口类
*
* @author system_generator
* @date 2024-12-11
*/
public interface IIdxBizJgProjectContraptionService {
boolean saveOrUpdateData(IdxBizJgProjectContraption projectContraption);
Boolean deleteProjectAndEquInfoBySeq(Long sequenceNbr);
IPage<IdxBizJgProjectContraption> proConPageByParams(Map<String, String> params, Page<IdxBizJgProjectContraption> page, ReginParams reginParams);
List<IdxBizJgProjectContraption> proConListByParams(Map<String, String> params, ReginParams reginParams);
}
\ No newline at end of file
...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jg.biz.service; ...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgSupervisionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgSupervisionInfo;
import java.util.List;
/** /**
* 监督管理信息表接口类 * 监督管理信息表接口类
* *
...@@ -14,4 +16,6 @@ public interface IIdxBizJgSupervisionInfoService { ...@@ -14,4 +16,6 @@ public interface IIdxBizJgSupervisionInfoService {
boolean saveOrUpdateData(IdxBizJgSupervisionInfo supervisionInfo); boolean saveOrUpdateData(IdxBizJgSupervisionInfo supervisionInfo);
IdxBizJgSupervisionInfo getOneData(String record); IdxBizJgSupervisionInfo getOneData(String record);
boolean saveOrUpdateBatch(List<IdxBizJgSupervisionInfo> supervisionInfoList);
} }
...@@ -21,4 +21,6 @@ public interface IIdxBizJgUseInfoService extends IService<IdxBizJgUseInfo> { ...@@ -21,4 +21,6 @@ public interface IIdxBizJgUseInfoService extends IService<IdxBizJgUseInfo> {
List<IdxBizJgUseInfo> getUseInfoListByEquIds(List<String> equIds); List<IdxBizJgUseInfo> getUseInfoListByEquIds(List<String> equIds);
boolean saveBatch(List<IdxBizJgUseInfo> useInfoList); boolean saveBatch(List<IdxBizJgUseInfo> useInfoList);
boolean saveOrUpdateBatch(List<IdxBizJgUseInfo> useInfoList);
} }
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.text.CharSequenceUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration; import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IBizDataChangeHandleStrategy; import com.yeejoin.amos.boot.module.jg.api.service.IBizDataChangeHandleStrategy;
import com.yeejoin.amos.boot.module.jg.biz.service.IChangeDataProcessStrategy; import com.yeejoin.amos.boot.module.jg.biz.service.IChangeDataProcessStrategy;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -32,86 +40,146 @@ public class BatchDataChangeProcessStrategy implements IChangeDataProcessStrateg ...@@ -32,86 +40,146 @@ public class BatchDataChangeProcessStrategy implements IChangeDataProcessStrateg
private final JgUseRegistrationServiceImpl useRegistrationService; private final JgUseRegistrationServiceImpl useRegistrationService;
private final JgRegistrationHistoryServiceImpl jgRegistrationHistoryService; private final JgUseRegistrationEqServiceImpl useRegistrationEqService;
private final JgUseRegistrationMapper jgUseRegistrationMapper; private final JgUseRegistrationMapper jgUseRegistrationMapper;
private final CommonEquipDataProcessService commonEquipDataProcessService; private final CommonEquipDataProcessService commonEquipDataProcessService;
public BatchDataChangeProcessStrategy(JgUseRegistrationServiceImpl useRegistrationService, JgRegistrationHistoryServiceImpl jgRegistrationHistoryService, JgUseRegistrationMapper jgUseRegistrationMapper, CommonEquipDataProcessService commonEquipDataProcessService) { private final PieLineDataChangeServiceImpl pieLineDataChangeService;
private final IdxBizJgProjectContraptionServiceImpl idxBizJgProjectContraptionService;
public BatchDataChangeProcessStrategy(JgUseRegistrationServiceImpl useRegistrationService, JgUseRegistrationEqServiceImpl useRegistrationEqService, JgUseRegistrationMapper jgUseRegistrationMapper, CommonEquipDataProcessService commonEquipDataProcessService, PieLineDataChangeServiceImpl pieLineDataChangeService, IdxBizJgProjectContraptionServiceImpl idxBizJgProjectContraptionService) {
this.useRegistrationService = useRegistrationService; this.useRegistrationService = useRegistrationService;
this.jgRegistrationHistoryService = jgRegistrationHistoryService; this.useRegistrationEqService = useRegistrationEqService;
this.jgUseRegistrationMapper = jgUseRegistrationMapper; this.jgUseRegistrationMapper = jgUseRegistrationMapper;
this.commonEquipDataProcessService = commonEquipDataProcessService; this.commonEquipDataProcessService = commonEquipDataProcessService;
this.pieLineDataChangeService = pieLineDataChangeService;
this.idxBizJgProjectContraptionService = idxBizJgProjectContraptionService;
} }
@Override @Override
public List<ChangeDataDto> handle(Map<String, Object> changeData, String defaultChangeId) { public List<ChangeDataDto> handle(Map<String, Object> changeData, String defaultChangeId) {
JSONObject data = (JSONObject) changeData; JSONObject data = (JSONObject) changeData;
JSONArray equips = data.getJSONArray(RequestChangeData.multiDataKey); JSONArray equips = data.getJSONArray(RequestChangeData.multiDataKey);
List<MultiChangeItemData> items = equips.toJavaList(MultiChangeItemData.class);
List<ChangeDataDto> allChangeColumns = new ArrayList<>(); List<ChangeDataDto> allChangeColumns = new ArrayList<>();
// 校验 JgUseRegistration jgUseRegistration = useRegistrationService.getOne(new LambdaQueryWrapper<JgUseRegistration>().eq(JgUseRegistration::getApplyNo, defaultChangeId));
items.forEach(item -> { // 判断是压力管道还是气瓶
String record = item.getRecord(); IdxBizJgRegisterInfo jgRegisterInfo = useRegistrationService.getRegisterInfo(jgUseRegistration);
Map<String, Object> itemData = item.getDetail(); if (EquipmentClassifityEnum.YLGD.getCode().equals(jgRegisterInfo.getEquList())) { // 管道逻辑
if (itemData != null) { List<PipelineChangeItemDto> items = equips.toJavaList(PipelineChangeItemDto.class);
EquipRegisterChangeDataDto registerChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipRegisterChangeDataDto.class); // 1.装置基本信息校验、保存(前端返回的装置信息为大写 需注意)
EquipFactoryChangeDataDto factoryChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipFactoryChangeDataDto.class); ProjectContraptionChangeDataDto projectContraptionChangeDataDto = commonEquipDataProcessService.castMap2Bean(changeData, ProjectContraptionChangeDataDto.class);
EquipDesignChangeDataDto designChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipDesignChangeDataDto.class); this.calTotalPieLineLength(projectContraptionChangeDataDto, items);
// 前置检验 pieLineDataChangeService.update(projectContraptionChangeDataDto, allChangeColumns);
commonEquipDataProcessService.checkValidField(record, registerChangeDataDto, null, null, null); // 2.使用登记表的装置名称更新
commonEquipDataProcessService.checkValidField(record, factoryChangeDataDto, registerChangeDataDto.getEquList(), registerChangeDataDto.getEquCategory(), registerChangeDataDto.getEquDefine()); updateUseRegisterProjectInfo(jgUseRegistration, projectContraptionChangeDataDto);
commonEquipDataProcessService.checkValidField(record, designChangeDataDto, registerChangeDataDto.getEquList(), registerChangeDataDto.getEquCategory(), registerChangeDataDto.getEquDefine()); // 设备技术参数入库前校验,约束:同一个装置下的管道编号不能重复
if (items.size() != items.stream().map(TechParamsPipelineChangeFieldDto::getPipelineNumber).distinct().count()) {
throw new BadRequest("同一工程装置下管道编号不能重复!");
} }
}); // 3.管道信息入库保存
// 入库 items.forEach(item -> {
items.forEach(item -> { String record = item.getRecord();
String record = item.getRecord(); // 设计信息更新
Map<String, Object> itemData = item.getDetail(); pieLineDataChangeService.saveDesignForPieLine(record, allChangeColumns, item);
if (itemData != null) { // 技术参数入库保存
EquipRegisterChangeDataDto registerChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipRegisterChangeDataDto.class); TechParamsPipelineChangeFieldDto paramsPipelineChangeFieldDto = new TechParamsPipelineChangeFieldDto();
EquipFactoryChangeDataDto factoryChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipFactoryChangeDataDto.class); BeanUtil.copyProperties(item, paramsPipelineChangeFieldDto, false);
EquipDesignChangeDataDto designChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipDesignChangeDataDto.class); commonEquipDataProcessService.savePieLineTechParam(record, allChangeColumns, paramsPipelineChangeFieldDto);
commonEquipDataProcessService.buildChangeFields(record, designChangeDataDto, factoryChangeDataDto, registerChangeDataDto, allChangeColumns); });
// 设备制造、设计、注册信息业务处理落库 // 4.更新所有管道的的冗余的管道名称字段(重点注意包括本次没做使用登记的管道也要更新)
commonEquipDataProcessService.dealBizDataForEquip(record, registerChangeDataDto); pieLineDataChangeService.updateEs(projectContraptionChangeDataDto);
commonEquipDataProcessService.dealBizDataForEquip(record, factoryChangeDataDto); } else { // 气瓶逻辑
commonEquipDataProcessService.dealBizDataForEquip(record, designChangeDataDto); List<MultiChangeItemData> items = equips.toJavaList(MultiChangeItemData.class);
// 设备技术参数入库处理 // 校验
commonEquipDataProcessService.updateTechParamInfo(registerChangeDataDto, record, itemData, allChangeColumns); items.forEach(item -> {
} String record = item.getRecord();
}); Map<String, Object> itemData = item.getDetail();
if (itemData != null) {
EquipRegisterChangeDataDto registerChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipRegisterChangeDataDto.class);
EquipFactoryChangeDataDto factoryChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipFactoryChangeDataDto.class);
EquipDesignChangeDataDto designChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipDesignChangeDataDto.class);
// 前置检验
commonEquipDataProcessService.checkValidField(record, registerChangeDataDto, null, null, null);
commonEquipDataProcessService.checkValidField(record, factoryChangeDataDto, registerChangeDataDto.getEquList(), registerChangeDataDto.getEquCategory(), registerChangeDataDto.getEquDefine());
commonEquipDataProcessService.checkValidField(record, designChangeDataDto, registerChangeDataDto.getEquList(), registerChangeDataDto.getEquCategory(), registerChangeDataDto.getEquDefine());
}
});
// 入库
items.forEach(item -> {
String record = item.getRecord();
Map<String, Object> itemData = item.getDetail();
if (itemData != null) {
EquipRegisterChangeDataDto registerChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipRegisterChangeDataDto.class);
EquipFactoryChangeDataDto factoryChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipFactoryChangeDataDto.class);
EquipDesignChangeDataDto designChangeDataDto = commonEquipDataProcessService.castMap2Bean(itemData, EquipDesignChangeDataDto.class);
commonEquipDataProcessService.buildChangeFields(record, designChangeDataDto, factoryChangeDataDto, registerChangeDataDto, allChangeColumns);
// 设备制造、设计、注册信息业务处理落库
commonEquipDataProcessService.dealBizDataForEquip(record, registerChangeDataDto);
commonEquipDataProcessService.dealBizDataForEquip(record, factoryChangeDataDto);
commonEquipDataProcessService.dealBizDataForEquip(record, designChangeDataDto);
// 设备技术参数入库处理
commonEquipDataProcessService.updateTechParamInfo(registerChangeDataDto, record, itemData, allChangeColumns);
}
});
}
// 单位办理不能修改设备品种,如果修改无法保证单据下的所有设备都一致 // 单位办理不能修改设备品种,如果修改无法保证单据下的所有设备都一致
return allChangeColumns; return allChangeColumns;
} }
private void updateUseRegisterProjectInfo(JgUseRegistration jgUseRegistration, ProjectContraptionChangeDataDto projectContraptionChangeDataDto) {
LambdaUpdateWrapper<JgUseRegistration> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(JgUseRegistration::getSequenceNbr, jgUseRegistration.getSequenceNbr());
updateWrapper.set(JgUseRegistration::getProjectContraption, projectContraptionChangeDataDto.getProjectContraption());
useRegistrationService.update(null, updateWrapper);
}
private void calTotalPieLineLength(ProjectContraptionChangeDataDto projectContraptionChangeDataDto, List<PipelineChangeItemDto> items) {
projectContraptionChangeDataDto.setPipelineLength(items.stream().filter(i -> i.getPipeLength() != null).mapToDouble(TechParamsPipelineChangeFieldDto::getPipeLength).sum());
}
@Override @Override
public Map<String, List<Map<String, Object>>> getDetail(String applyNo, String bizId) { public Map<String, Object> getDetail(String applyNo, String bizId) {
Map<String, List<Map<String, Object>>> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
JgUseRegistration jgUseRegistration = useRegistrationService.getOne(new LambdaQueryWrapper<JgUseRegistration>() JgUseRegistration jgUseRegistration = useRegistrationService.getOne(new LambdaQueryWrapper<JgUseRegistration>()
.eq(JgUseRegistration::getApplyNo, applyNo).select(BaseEntity::getSequenceNbr)); .eq(JgUseRegistration::getApplyNo, applyNo).select(BaseEntity::getSequenceNbr, JgUseRegistration::getProjectContraptionId));
LambdaQueryWrapper<JgRegistrationHistory> lambda = new QueryWrapper<JgRegistrationHistory>().lambda(); LambdaQueryWrapper<JgUseRegistrationEq> lambda = new QueryWrapper<JgUseRegistrationEq>().lambda();
lambda.eq(JgRegistrationHistory::getCurrentDocumentId, jgUseRegistration.getSequenceNbr()); lambda.eq(JgUseRegistrationEq::getEquipTransferId, jgUseRegistration.getSequenceNbr());
lambda.eq(JgRegistrationHistory::getIsDelete, false); lambda.select(JgUseRegistrationEq::getEquId);
JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryService.getBaseMapper().selectOne(lambda); List<JgUseRegistrationEq> eqs = useRegistrationEqService.getBaseMapper().selectList(lambda);
JSONObject jsonObject = JSONObject.parseObject(jgRegistrationHistory.getChangeData()); List<String> records = eqs.stream().map(JgUseRegistrationEq::getEquId).collect(toList());
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) jsonObject.get("equipmentLists"); IdxBizJgRegisterInfo registerInfo = useRegistrationService.getRegisterInfo(jgUseRegistration);
List<String> records = equipmentLists.stream().map(v -> (String) v.get("record")).collect(toList());
List<Map<String, Object>> tableData; List<Map<String, Object>> tableData;
if (CylinderTypeEnum.CYLINDER.getCode().equals(jsonObject.get("EQU_CATEGORY_CODE"))) { if (CylinderTypeEnum.CYLINDER.getCode().equals(registerInfo.getEquCategory())) {
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult(); List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue)); Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
tableData = jgUseRegistrationMapper.queryForUnitVesselEquipment(records); tableData = jgUseRegistrationMapper.queryForUnitVesselEquipment(records);
tableData.forEach(i -> i.put("chargingMedium", fillingMediumMap.get(i.get("chargingMedium")))); tableData.forEach(i -> i.put("chargingMedium", fillingMediumMap.get(i.get("chargingMedium"))));
} else { } else {
tableData = jgUseRegistrationMapper.queryForUnitPipelineEquipment(records); IdxBizJgProjectContraption idxBizJgProjectContraption = idxBizJgProjectContraptionService.getById(jgUseRegistration.getProjectContraptionId());
Map<String, Object> map = IdxBizJgRegisterInfoServiceImpl.convertCamelToUnderscore(idxBizJgProjectContraption, IdxBizJgProjectContraptionServiceImpl.jsonFields);
result.putAll(map);
result.put("projectContraptionId", idxBizJgProjectContraption.getSequenceNbr());
tableData = jgUseRegistrationMapper.queryForUnitPipelineEquipmentForEdit(records);
} }
result.put("tableData", tableData); result.put("tableData", tableData);
return result; return result;
} }
private Map<String, Object> cast2UnderCase(Map<String, Object> re) {
// 由于历史遗留问题,和前端保存统一,要转成大写下滑线驼峰
Map<String, Object> result = new HashMap<>();
re.forEach((k, v) -> {
result.put(CharSequenceUtil.toUnderlineCase(k).toUpperCase(), v);
});
return result;
}
@Override @Override
public IBizDataChangeHandleStrategy.ModelType canHandleMode() { public IBizDataChangeHandleStrategy.ModelType canHandleMode() {
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.api.dto.RequestChangeData; import com.yeejoin.amos.boot.module.jg.api.dto.RequestChangeData;
import com.yeejoin.amos.boot.module.jg.biz.context.BizDataHandleStrategyContext;
import com.yeejoin.amos.boot.module.jg.api.service.IBizDataChangeHandleStrategy; import com.yeejoin.amos.boot.module.jg.api.service.IBizDataChangeHandleStrategy;
import com.yeejoin.amos.boot.module.jg.biz.context.BizDataHandleStrategyContext;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -11,6 +11,7 @@ import java.util.Map; ...@@ -11,6 +11,7 @@ import java.util.Map;
@Service @Service
public class BizDataChangeServiceImpl { public class BizDataChangeServiceImpl {
/** /**
* 变更保存 * 变更保存
* *
...@@ -31,4 +32,5 @@ public class BizDataChangeServiceImpl { ...@@ -31,4 +32,5 @@ public class BizDataChangeServiceImpl {
IBizDataChangeHandleStrategy handleStrategy = BizDataHandleStrategyContext.getStrategy(bizType); IBizDataChangeHandleStrategy handleStrategy = BizDataHandleStrategyContext.getStrategy(bizType);
return handleStrategy.getDetail(applyNo, model, bizId); return handleStrategy.getDetail(applyNo, model, bizId);
} }
} }
...@@ -68,7 +68,6 @@ public class CommonEquipDataProcessService { ...@@ -68,7 +68,6 @@ public class CommonEquipDataProcessService {
this.equipChangeDataUpdateService = equipChangeDataUpdateService; this.equipChangeDataUpdateService = equipChangeDataUpdateService;
} }
public <T extends BaseChangeDataDto> T castMap2Bean(Map<String, Object> map, Class<T> clazz) { public <T extends BaseChangeDataDto> T castMap2Bean(Map<String, Object> map, Class<T> clazz) {
try { try {
T t = clazz.newInstance(); T t = clazz.newInstance();
...@@ -80,6 +79,7 @@ public class CommonEquipDataProcessService { ...@@ -80,6 +79,7 @@ public class CommonEquipDataProcessService {
} }
public void checkValidField(String record, BaseChangeDataDto changeDataDto, String equList, String equCategory, String equDefine) { public void checkValidField(String record, BaseChangeDataDto changeDataDto, String equList, String equCategory, String equDefine) {
// 注册信息 // 注册信息
if (changeDataDto instanceof EquipRegisterChangeDataDto) { if (changeDataDto instanceof EquipRegisterChangeDataDto) {
...@@ -142,7 +142,7 @@ public class CommonEquipDataProcessService { ...@@ -142,7 +142,7 @@ public class CommonEquipDataProcessService {
} }
private List<ChangeDataDto> mergeChangeFields(List<ChangeDataDto> changeDataNew, List<ChangeDataDto> changeDataOld) { public List<ChangeDataDto> mergeChangeFields(List<ChangeDataDto> changeDataNew, List<ChangeDataDto> changeDataOld) {
Map<String, ChangeDataDto> oldKv = changeDataOld.stream().collect(Collectors.toMap(ChangeDataDto::getColumnKey, Function.identity())); Map<String, ChangeDataDto> oldKv = changeDataOld.stream().collect(Collectors.toMap(ChangeDataDto::getColumnKey, Function.identity()));
changeDataNew.forEach(o -> { changeDataNew.forEach(o -> {
// 正常不会出现此情况,old数据 大于等于 new 数据的key // 正常不会出现此情况,old数据 大于等于 new 数据的key
...@@ -323,19 +323,7 @@ public class CommonEquipDataProcessService { ...@@ -323,19 +323,7 @@ public class CommonEquipDataProcessService {
// 压力管道 // 压力管道
TechParamsPipelineChangeFieldDto newPipeline = new TechParamsPipelineChangeFieldDto(); TechParamsPipelineChangeFieldDto newPipeline = new TechParamsPipelineChangeFieldDto();
BeanUtil.copyProperties(JSON.parse(JSONObject.toJSONString(changeData)), newPipeline, true); BeanUtil.copyProperties(JSON.parse(JSONObject.toJSONString(changeData)), newPipeline, true);
savePieLineTechParam(record, allChange, newPipeline);
IdxBizJgTechParamsPipeline techParamsPipeline = iIdxBizJgTechParamsPipelineService.getOneData(record);
// 技术参数对象转换为全部技术参数 ,其他无用字段去掉
TechParamsPipelineChangeFieldDto oldPipeline = BeanUtil.copyProperties(techParamsPipeline, TechParamsPipelineChangeFieldDto.class);
// 字段行转列
List<ChangeDataDto> newPipelineChangeData = this.convertBeanField2Column2(newPipeline, record);
List<ChangeDataDto> oldPipelineChangeData = this.convertBeanField2Column2(oldPipeline, record);
// 比对
List<ChangeDataDto> pipelineChangeFields = this.mergeChangeFields(newPipelineChangeData, oldPipelineChangeData);
// 业务处理
equipChangeDataUpdateService.updateTechParamByRecord(this.buildTableName(TechParamsPipelineChangeFieldDto.class), record, pipelineChangeFields);
// 日志数据记录
allChange.addAll(pipelineChangeFields);
break; break;
case KYSD: case KYSD:
// 客运索道 // 客运索道
...@@ -360,7 +348,22 @@ public class CommonEquipDataProcessService { ...@@ -360,7 +348,22 @@ public class CommonEquipDataProcessService {
} }
} }
private List<ChangeDataDto> convertBeanField2Column2(Object beanData, String record) { public void savePieLineTechParam(String record, List<ChangeDataDto> allChange, TechParamsPipelineChangeFieldDto newPipeline) {
IdxBizJgTechParamsPipeline techParamsPipeline = iIdxBizJgTechParamsPipelineService.getOneData(record);
// 技术参数对象转换为全部技术参数 ,其他无用字段去掉
TechParamsPipelineChangeFieldDto oldPipeline = BeanUtil.copyProperties(techParamsPipeline, TechParamsPipelineChangeFieldDto.class);
// 字段行转列
List<ChangeDataDto> newPipelineChangeData = this.convertBeanField2Column2(newPipeline, record);
List<ChangeDataDto> oldPipelineChangeData = this.convertBeanField2Column2(oldPipeline, record);
// 比对
List<ChangeDataDto> pipelineChangeFields = this.mergeChangeFields(newPipelineChangeData, oldPipelineChangeData);
// 业务处理
equipChangeDataUpdateService.updateTechParamByRecord(this.buildTableName(TechParamsPipelineChangeFieldDto.class), record, pipelineChangeFields);
// 日志数据记录
allChange.addAll(pipelineChangeFields);
}
public List<ChangeDataDto> convertBeanField2Column2(Object beanData, String changeId) {
List<ChangeDataDto> changeData = new ArrayList<>(); List<ChangeDataDto> changeData = new ArrayList<>();
Group group = beanData.getClass().getAnnotation(Group.class); Group group = beanData.getClass().getAnnotation(Group.class);
Field[] fields = beanData.getClass().getDeclaredFields(); Field[] fields = beanData.getClass().getDeclaredFields();
...@@ -374,7 +377,7 @@ public class CommonEquipDataProcessService { ...@@ -374,7 +377,7 @@ public class CommonEquipDataProcessService {
changeDataDto.setColumnKey(field.getName()); changeDataDto.setColumnKey(field.getName());
changeDataDto.setColumnFamily(group.value()); changeDataDto.setColumnFamily(group.value());
changeDataDto.setColumnLabel(fieldName); changeDataDto.setColumnLabel(fieldName);
changeDataDto.setChangeId(record); changeDataDto.setChangeId(changeId);
Object oV = field.get(beanData); Object oV = field.get(beanData);
if (oV instanceof String) { if (oV instanceof String) {
String value = (String) field.get(beanData); String value = (String) field.get(beanData);
...@@ -395,7 +398,7 @@ public class CommonEquipDataProcessService { ...@@ -395,7 +398,7 @@ public class CommonEquipDataProcessService {
} }
private List<ChangeDataDto> buildDesignInfoNew(EquipDesignChangeDataDto changeDataDto, String record) { public List<ChangeDataDto> buildDesignInfoNew(Object changeDataDto, String record) {
return this.convertBeanField2Column2(changeDataDto, record); return this.convertBeanField2Column2(changeDataDto, record);
} }
...@@ -407,7 +410,7 @@ public class CommonEquipDataProcessService { ...@@ -407,7 +410,7 @@ public class CommonEquipDataProcessService {
return this.convertBeanField2Column2(changeDataDto, record); return this.convertBeanField2Column2(changeDataDto, record);
} }
private List<ChangeDataDto> buildDesignInfoOld(String record) { public List<ChangeDataDto> buildDesignInfoOld(String record) {
EquipDesignChangeDataDto changeDataDto = new EquipDesignChangeDataDto(); EquipDesignChangeDataDto changeDataDto = new EquipDesignChangeDataDto();
IdxBizJgDesignInfo designInfo = idxBizJgDesignInfoMapper.selectOne(new LambdaQueryWrapper<IdxBizJgDesignInfo>().eq(IdxBizJgDesignInfo::getRecord, record)); IdxBizJgDesignInfo designInfo = idxBizJgDesignInfoMapper.selectOne(new LambdaQueryWrapper<IdxBizJgDesignInfo>().eq(IdxBizJgDesignInfo::getRecord, record));
BeanUtil.copyProperties(designInfo, changeDataDto); BeanUtil.copyProperties(designInfo, changeDataDto);
......
...@@ -1348,8 +1348,7 @@ public class CommonServiceImpl implements ICommonService { ...@@ -1348,8 +1348,7 @@ public class CommonServiceImpl implements ICommonService {
flowTaskVo.setAssignee(assignee); flowTaskVo.setAssignee(assignee);
ProcessTaskDTO processTaskDTO = cmWorkflowService.assign(flowTaskVo); ProcessTaskDTO processTaskDTO = cmWorkflowService.assign(flowTaskVo);
// 修改待办 // 修改待办
List<TaskV2Model> result = taskV2FeignService.selectListByRelationId(instanceId).getResult(); List<TaskV2Model> collect = taskV2FeignService.selectListByRelationId(instanceId).getResult();
List<TaskV2Model> collect = result.stream().sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r1.getSequenceNbr())).collect(Collectors.toList());
if (collect.isEmpty()) { if (collect.isEmpty()) {
return null; return null;
} }
...@@ -1648,8 +1647,7 @@ public class CommonServiceImpl implements ICommonService { ...@@ -1648,8 +1647,7 @@ public class CommonServiceImpl implements ICommonService {
*/ */
public void rollbackTask(String id, JSONObject obj) { public void rollbackTask(String id, JSONObject obj) {
List<TaskV2Model> result = taskV2FeignService.selectListByRelationId(id).getResult(); List<TaskV2Model> list = taskV2FeignService.selectListByRelationId(id).getResult();
List<TaskV2Model> list = result.stream().sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r1.getSequenceNbr())).collect(Collectors.toList());
TaskV2Model model = list.get(0); TaskV2Model model = list.get(0);
taskV2FeignService.delete(String.valueOf(model.getSequenceNbr())); taskV2FeignService.delete(String.valueOf(model.getSequenceNbr()));
...@@ -2070,12 +2068,34 @@ public class CommonServiceImpl implements ICommonService { ...@@ -2070,12 +2068,34 @@ public class CommonServiceImpl implements ICommonService {
result = categoryList.stream().filter(category -> Pattern.compile("^[^\\D0]*00$").matcher(category.getCode()).matches()).collect(Collectors.toList()); result = categoryList.stream().filter(category -> Pattern.compile("^[^\\D0]*00$").matcher(category.getCode()).matches()).collect(Collectors.toList());
break; break;
case "3": case "3":
result = categoryList.stream().filter(category -> Pattern.compile("^[^\\D0]*0$").matcher(category.getCode()).matches()).collect(Collectors.toList()); result = categoryList.stream().filter(category -> Pattern.compile("^[^\\D0A-Za-z]*[A-Za-z0-9]*[^0]0$").matcher(category.getCode()).matches()).collect(Collectors.toList());
break; break;
} }
return result; return result;
} }
@Override
public List<EquipmentCategoryDto> equipmentClassificationNoPipeline(String type) {
List<EquipmentCategoryDto> categoryList = equipmentCategoryMapper.selectClassifyNoStart7And8();
List<EquipmentCategoryDto> result = Collections.emptyList();
switch (type) {
case "1":
result = categoryList.stream().filter(category -> Pattern.compile("^[^\\D0]*000$").matcher(category.getCode()).matches()).collect(Collectors.toList());
break;
case "2":
result = categoryList.stream().filter(category -> Pattern.compile("^[^\\D0]*00$").matcher(category.getCode()).matches()).collect(Collectors.toList());
break;
case "3":
result = categoryList.stream().filter(category -> Pattern.compile("^[^\\D0A-Za-z]*[A-Za-z0-9]*[^0]0$").matcher(category.getCode()).matches()).collect(Collectors.toList());
break;
}
return result;
}
@Override
public List<EquipmentCategoryDto> getEquDefineByParentId(String parentId) {
return equipmentCategoryMapper.getEquDefineByParentId(parentId);
}
/** /**
* 排序 :页面列表排序功能支持,将 "字段,ascend" 或 "字段,descend" 转化为对应JSONObject * 排序 :页面列表排序功能支持,将 "字段,ascend" 或 "字段,descend" 转化为对应JSONObject
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum;
import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import lombok.extern.slf4j.Slf4j;
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.utils.ValidationUtil;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
* 用于业务变更过程中的历史数据处理的service层
*/
@Slf4j
@Service
public class DataHandlerServiceImpl {
@Resource
private ObjectMapper objectMapper;
@Resource
private JgRegistrationHistoryServiceImpl registrationHistoryService;
@Resource
private JgInstallationNoticeServiceImpl installationNoticeService;
@Resource
private JgUseRegistrationServiceImpl useRegistrationService;
@Resource
private JgUseRegistrationEqServiceImpl useRegistrationEqService;
@Resource
private JgInstallationNoticeEqServiceImpl installationNoticeEqService;
@Resource
private IdxBizJgUseInfoServiceImpl useInfoService;
@Resource
private SnowflakeIdUtil sequence;
@Resource
private IdxBizJgProjectContraptionServiceImpl projectContraptionService;
@Resource
private IdxBizJgTechParamsPipelineServiceImpl techParamsPipelineService;
@Resource
private EquipmentCategoryMapper equipmentCategoryMapper;
@Resource
private IdxBizJgRegisterInfoServiceImpl registerInfoService;
@Resource
private IdxBizJgSupervisionInfoServiceImpl supervisionInfoService;
@Resource
private IdxBizJgFactoryInfoServiceImpl factoryInfoService;
@Resource
private ESEquipmentCategory esEquipmentCategory;
/**
* 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式
*
* @return result
*/
@Transactional(rollbackFor = Exception.class)
public Boolean deviceListInFormWithInstallNotice() {
List<JgInstallationNotice> noticeList = installationNoticeService.list(new LambdaQueryWrapper<JgInstallationNotice>()
.eq(JgInstallationNotice::getEquCategoryCode, "8300"));
List<JgRegistrationHistory> jgRegistrationHistories = noticeList.stream()
.map(notice -> {
JgRegistrationHistory history = getRegistrationHistory(String.valueOf(notice.getSequenceNbr()));
if (history == null) return null;
try {
Map<String, Object> hisData = objectMapper.readValue(
history.getChangeData(),
new TypeReference<Map<String, Object>>() {
}
);
// 获取设备列表并处理每个设备信息
List<Map<String, Object>> deviceList = objectMapper.readValue(
objectMapper.writeValueAsString(hisData.get("deviceList")),
new TypeReference<ArrayList<Map<String, Object>>>() {
}
);
if (!ValidationUtil.isEmpty(deviceList)) {
List<Map<String, Object>> pipelineListInfo = installationNoticeService.getBaseMapper().getPipelineEquInfoByRecords(deviceList.stream().map(device -> String.valueOf(device.get("record"))).collect(Collectors.toList()));
// 更新处理后的数据回到 history 对象
hisData.put("deviceList", pipelineListInfo);
}
history.setChangeData(objectMapper.writeValueAsString(hisData)); // 更新 changeData 字段
} catch (Exception e) {
log.error("JSON 数据处理失败!", e);
throw new RuntimeException(e.getMessage());
}
return history;
})
.filter(Objects::nonNull)
.collect(Collectors.toList());
// 批量更新历史表数据
registrationHistoryService.updateBatchById(jgRegistrationHistories);
return Boolean.TRUE;
}
// 辅助方法:根据 DocumentId 获取历史记录
private JgRegistrationHistory getRegistrationHistory(String documentId) {
return registrationHistoryService.getBaseMapper().selectOne(
new QueryWrapper<JgRegistrationHistory>().lambda()
.eq(JgRegistrationHistory::getCurrentDocumentId, documentId)
.eq(JgRegistrationHistory::getIsDelete, false)
);
}
/**
* 向新增的工程装置表刷入数据
*
* @return result
*/
@Transactional(rollbackFor = Exception.class)
public Boolean writeData2ProjectContraption() {
// projectContraptionService.getBaseMapper().delete(null);
List<IdxBizJgUseInfo> collect = useInfoService.lambdaQuery()
.select(IdxBizJgUseInfo::getRecord, IdxBizJgUseInfo::getProjectContraption, IdxBizJgUseInfo::getUseUnitCreditCode, IdxBizJgUseInfo::getUseUnitName, IdxBizJgUseInfo::getIsIntoManagement)
.isNotNull(IdxBizJgUseInfo::getProjectContraption)
.ne(IdxBizJgUseInfo::getProjectContraption, "")
.groupBy(IdxBizJgUseInfo::getProjectContraption, IdxBizJgUseInfo::getUseUnitCreditCode)
.list().stream()
.filter(Objects::nonNull)
.collect(Collectors.toList());
log.info("查询到的工程装置集合: {}", JSON.toJSONString(collect));
List<IdxBizJgProjectContraption> projectContraptionList = new ArrayList<>();
Iterator<IdxBizJgUseInfo> iterator = collect.iterator();
while (iterator.hasNext()) {
IdxBizJgUseInfo useInfo = iterator.next();
boolean isLast = !iterator.hasNext();
String record = useInfo.getRecord();
Boolean isIntoManagement = ObjectUtils.isEmpty(useInfo.getIsIntoManagement()) ? Boolean.FALSE : useInfo.getIsIntoManagement();
String projectContraption = useInfo.getProjectContraption();
String useUnitCreditCode = useInfo.getUseUnitCreditCode();
Long sequenceNbr = sequence.nextId();
List<String> installNotSeqs = installationNoticeEqService.lambdaQuery()
.eq(JgInstallationNoticeEq::getEquId, record)
.list().stream()
.filter(Objects::nonNull)
.map(JgInstallationNoticeEq::getEquipTransferId)
.collect(Collectors.toList());
JgInstallationNotice installationNotice = installNotSeqs.isEmpty() ? null : installationNoticeService.lambdaQuery()
.in(JgInstallationNotice::getSequenceNbr, installNotSeqs)
.eq(JgInstallationNotice::getUseUnitCreditCode, useUnitCreditCode)
.eq(JgInstallationNotice::getNoticeStatus, FlowStatusEnum.TO_BE_FINISHED.getCode())
.list().stream()
.findFirst().orElse(null);
List<String> useRegSeqs = useRegistrationEqService.lambdaQuery()
.eq(JgUseRegistrationEq::getEquId, record)
.list().stream()
.filter(Objects::nonNull)
.map(JgUseRegistrationEq::getEquipTransferId)
.collect(Collectors.toList());
JgUseRegistration useRegistration = useRegSeqs.isEmpty() ? null : useRegistrationService.lambdaQuery()
.in(JgUseRegistration::getSequenceNbr, useRegSeqs)
.eq(JgUseRegistration::getUseUnitCreditCode, useUnitCreditCode)
.eq(JgUseRegistration::getStatus, FlowStatusEnum.TO_BE_FINISHED.getName())
.list().stream()
.findFirst().orElse(null);
List<IdxBizJgUseInfo> useInfos = useInfoService.lambdaQuery()
.eq(IdxBizJgUseInfo::getProjectContraption, projectContraption)
.eq(IdxBizJgUseInfo::getUseUnitCreditCode, useUnitCreditCode)
.list();
List<IdxBizJgTechParamsPipeline> idxBizJgTechParamsPipelines = useInfos.isEmpty() ? new ArrayList<>() : techParamsPipelineService
.lambdaQuery()
.in(IdxBizJgTechParamsPipeline::getRecord, useInfos.stream()
.map(IdxBizJgUseInfo::getRecord)
.collect(Collectors.toList()))
.list();
double pipeLengthSum = idxBizJgTechParamsPipelines.stream()
.filter(Objects::nonNull)
.filter(pip -> Objects.nonNull(pip.getPipeLength()))
.mapToDouble(pipeline -> Double.parseDouble(pipeline.getPipeLength()))
.sum();
IdxBizJgRegisterInfo registerInfo = registerInfoService.lambdaQuery()
.eq(IdxBizJgRegisterInfo::getRecord, useInfos
.stream().findFirst().orElse(new IdxBizJgUseInfo())
.getRecord())
.one();
IdxBizJgSupervisionInfo supervisionInfo = supervisionInfoService.lambdaQuery()
.eq(IdxBizJgSupervisionInfo::getRecord, useInfos
.stream()
.findFirst().orElse(new IdxBizJgUseInfo())
.getRecord())
.one();
IdxBizJgFactoryInfo factoryInfo = factoryInfoService.lambdaQuery()
.eq(IdxBizJgFactoryInfo::getRecord, useInfos
.stream()
.findFirst().orElse(new IdxBizJgUseInfo())
.getRecord())
.one();
IdxBizJgProjectContraption idxBizJgProjectContraption = IdxBizJgProjectContraption.builder()
.projectContraption(projectContraption)
.projectContraptionNo(projectContraption)
.useUnitCreditCode(isIntoManagement ? (ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getUseUnitCreditCode()) : null)
.useUnitName(isIntoManagement ? (ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getUseUnitName()) : null)
.uscUnitCreditCode(isIntoManagement ? (ObjectUtils.isEmpty(useRegistration) ? (ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getInstallUnitCreditCode()) : null) : null)
.uscUnitName(isIntoManagement ? (ObjectUtils.isEmpty(useRegistration) ? (ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getInstallUnitName()) : null) : null)
.equList(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getEquListCode())
.equListName(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getEquList())
.equCategory(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getEquCategoryCode())
.equCategoryName(ObjectUtils.isEmpty(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getEquCategoryCode()) ? null : equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, (ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getEquCategoryCode()))).getName())
.equDefine(ObjectUtils.isEmpty(registerInfo) ? null : registerInfo.getEquDefine())
.equDefineName(ObjectUtils.isEmpty(ObjectUtils.isEmpty(registerInfo) ? null : registerInfo.getEquDefine()) ? null : equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, (ObjectUtils.isEmpty(registerInfo) ? null : registerInfo.getEquDefine()))).getName())
.content(null)
.pipelineLength(pipeLengthSum)
.productPhoto(ObjectUtils.isEmpty(registerInfo) ? null : registerInfo.getProductPhoto())
.otherAccessories(null)
.orgCode(ObjectUtils.isEmpty(supervisionInfo) ? null : supervisionInfo.getOrgBranchCode())
.orgName(ObjectUtils.isEmpty(supervisionInfo) ? null : supervisionInfo.getOrgBranchName())
.productQualificationCertificate(ObjectUtils.isEmpty(factoryInfo) ? null : factoryInfo.getProductQualityYieldProve())
.province(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getProvince())
.provinceName(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getProvinceName())
.city(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getCity())
.cityName(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getCityName())
.county(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getCounty())
.countyName(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getCountyName())
.street(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getStreet())
.streetName(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getStreetName())
.address(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getAddress())
.startLatitudeLongitude(ObjectUtils.isEmpty(idxBizJgTechParamsPipelines) ? null : idxBizJgTechParamsPipelines.get(0).getStartePosition())
.endLatitudeLongitude(ObjectUtils.isEmpty(idxBizJgTechParamsPipelines) ? null : idxBizJgTechParamsPipelines.get(0).getEndPosition())
.supervisoryCode(ObjectUtils.isEmpty(installationNotice) ? null : installationNotice.getSupervisoryCode())
.useRegistrationCode(ObjectUtils.isEmpty(useRegistration) ? null : useRegistration.getUseRegistrationCode())
.isIntoManagement(isIntoManagement)
.dataSource("jg")
.build();
idxBizJgProjectContraption.setSequenceNbr(sequenceNbr);
idxBizJgProjectContraption.setRecDate(new Date());
idxBizJgProjectContraption.setIsDelete(Boolean.FALSE);
projectContraptionList.add(idxBizJgProjectContraption);
if (projectContraptionList.size() % 1000 == 0 || isLast) {
projectContraptionService.saveBatch(projectContraptionList);
projectContraptionList.clear();
}
useInfoService.lambdaUpdate()
.set(IdxBizJgUseInfo::getProjectContraptionId, sequenceNbr)
.eq(IdxBizJgUseInfo::getProjectContraption, projectContraption)
.eq(IdxBizJgUseInfo::getUseUnitCreditCode, useUnitCreditCode)
.update();
if (!installNotSeqs.isEmpty()) {
installationNoticeService.lambdaUpdate()
.set(JgInstallationNotice::getProjectContraptionId, sequenceNbr)
.in(JgInstallationNotice::getSequenceNbr, installNotSeqs)
.eq(JgInstallationNotice::getProjectContraption, projectContraption)
.eq(JgInstallationNotice::getUseUnitCreditCode, useUnitCreditCode)
.update();
}
if (!useRegSeqs.isEmpty()) {
useRegistrationService.lambdaUpdate()
.set(JgUseRegistration::getProjectContraptionId, sequenceNbr)
.in(JgUseRegistration::getSequenceNbr, useRegSeqs)
.eq(JgUseRegistration::getProjectContraption, projectContraption)
.eq(JgUseRegistration::getUseUnitCreditCode, useUnitCreditCode)
.update();
}
}
return Boolean.TRUE;
}
/**
* 刷入工程装置id到es的idx_biz_view_jg_all索引
*
* @return result
*/
public String writeProjectContraptionId() {
AtomicReference<Long> size = new AtomicReference<>(0L);
StopWatch stopWatch = new StopWatch("writeProjectContraptionId");
stopWatch.start();
List<IdxBizJgUseInfo> useInfos = useInfoService.lambdaQuery()
.select(IdxBizJgUseInfo::getRecord, IdxBizJgUseInfo::getProjectContraptionId)
.isNotNull(IdxBizJgUseInfo::getProjectContraptionId)
.list();
for (IdxBizJgUseInfo useInfo : useInfos) {
Optional<ESEquipmentCategoryDto> equInfosWithEs = esEquipmentCategory.findById(useInfo.getRecord());
equInfosWithEs.ifPresent(equInfoEs -> {
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equInfoEs.getEQU_CATEGORY_CODE())) {
equInfoEs.setProjectContraptionId(useInfo.getProjectContraptionId());
esEquipmentCategory.save(equInfoEs);
size.getAndSet(size.get() + 1);
}
});
}
stopWatch.stop();
return String.format("接口调用成功,更新数据:%s条,耗时:%s s", size.get(), stopWatch.getTotalTimeSeconds());
}
}
...@@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -136,6 +137,17 @@ public class EquipChangeDataUpdateService { ...@@ -136,6 +137,17 @@ public class EquipChangeDataUpdateService {
} }
} }
public void updateRegisterEsDataPieLine(ProjectContraptionChangeDataDto registerChangeDataDto) {
// es 数据更新
List<ESEquipmentCategoryDto> pieLines = esEquipmentCategory.findAllByProjectContraptionId(registerChangeDataDto.getProjectContraptionId());
for(ESEquipmentCategoryDto esEquipmentCategoryDto: pieLines) {
esEquipmentCategoryDto.setPROJECT_CONTRAPTION(registerChangeDataDto.getProjectContraption());
}
if(!pieLines.isEmpty()){
esEquipmentCategory.saveAll(pieLines);
}
}
private EquipmentCategory getEquipmentCategory(EquipRegisterChangeDataDto registerChangeDataDto) { private EquipmentCategory getEquipmentCategory(EquipRegisterChangeDataDto registerChangeDataDto) {
return equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, registerChangeDataDto.getEquDefine())); return equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, registerChangeDataDto.getEquDefine()));
} }
...@@ -191,4 +203,12 @@ public class EquipChangeDataUpdateService { ...@@ -191,4 +203,12 @@ public class EquipChangeDataUpdateService {
public void checkDesignChangeData(String record, EquipDesignChangeDataDto equipDesignChangeDataDto) { public void checkDesignChangeData(String record, EquipDesignChangeDataDto equipDesignChangeDataDto) {
} }
public void updatePieLineDesignData(String record, PieLineDesignChangeDataDto equipDesignChangeDataDto) {
LambdaUpdateWrapper<IdxBizJgDesignInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgDesignInfo::getRecord, record);
updateWrapper.set(IdxBizJgDesignInfo::getDesignUnitName, equipDesignChangeDataDto.getDesignUnitName());
updateWrapper.set(IdxBizJgDesignInfo::getRecDate, new Date());
idxBizJgDesignInfoMapper.update(null, updateWrapper);
}
} }
...@@ -25,6 +25,11 @@ public class IdxBizJgConstructionInfoServiceImpl extends BaseService<IdxBizJgCon ...@@ -25,6 +25,11 @@ public class IdxBizJgConstructionInfoServiceImpl extends BaseService<IdxBizJgCon
return this.saveOrUpdate(constructionInfo); return this.saveOrUpdate(constructionInfo);
} }
@Override
public boolean saveOrUpdateBatch(List<IdxBizJgConstructionInfo> constructionInfoList) {
return super.saveOrUpdateBatch(constructionInfoList);
}
//查询最新的记录 //查询最新的记录
public IdxBizJgConstructionInfo queryNewestDetailByRecord(String record) { public IdxBizJgConstructionInfo queryNewestDetailByRecord(String record) {
IdxBizJgConstructionInfo result = new IdxBizJgConstructionInfo(); IdxBizJgConstructionInfo result = new IdxBizJgConstructionInfo();
......
...@@ -24,6 +24,11 @@ public class IdxBizJgDesignInfoServiceImpl extends BaseService<IdxBizJgDesignInf ...@@ -24,6 +24,11 @@ public class IdxBizJgDesignInfoServiceImpl extends BaseService<IdxBizJgDesignInf
} }
@Override @Override
public boolean saveOrUpdateBatch(List<IdxBizJgDesignInfo> designInfoList) {
return super.saveOrUpdateBatch(designInfoList);
}
@Override
public IdxBizJgDesignInfo getOneData(String record) { public IdxBizJgDesignInfo getOneData(String record) {
return this.getOne(new QueryWrapper<IdxBizJgDesignInfo>().eq("RECORD", record)); return this.getOne(new QueryWrapper<IdxBizJgDesignInfo>().eq("RECORD", record));
} }
......
...@@ -27,4 +27,9 @@ public class IdxBizJgFactoryInfoServiceImpl extends BaseService<IdxBizJgFactoryI ...@@ -27,4 +27,9 @@ public class IdxBizJgFactoryInfoServiceImpl extends BaseService<IdxBizJgFactoryI
public IdxBizJgFactoryInfo getOneData(String record) { public IdxBizJgFactoryInfo getOneData(String record) {
return this.getOne(new QueryWrapper<IdxBizJgFactoryInfo>().eq("RECORD", record)); return this.getOne(new QueryWrapper<IdxBizJgFactoryInfo>().eq("RECORD", record));
} }
@Override
public boolean saveOrUpdateBatch(List<IdxBizJgFactoryInfo> factoryInfoList) {
return super.saveOrUpdateBatch(factoryInfoList);
}
} }
\ No newline at end of file
...@@ -52,4 +52,9 @@ public class IdxBizJgInspectionDetectionInfoServiceImpl extends BaseService<IdxB ...@@ -52,4 +52,9 @@ public class IdxBizJgInspectionDetectionInfoServiceImpl extends BaseService<IdxB
} }
return result; return result;
} }
@Override
public boolean saveOrUpdateBatch(List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList) {
return super.saveOrUpdateBatch(inspectionDetectionInfoList);
}
} }
\ No newline at end of file
...@@ -32,4 +32,9 @@ public class IdxBizJgOtherInfoServiceImpl extends BaseService<IdxBizJgOtherInfoD ...@@ -32,4 +32,9 @@ public class IdxBizJgOtherInfoServiceImpl extends BaseService<IdxBizJgOtherInfoD
public void saveBatch(List<IdxBizJgOtherInfo> otherInfoList) { public void saveBatch(List<IdxBizJgOtherInfo> otherInfoList) {
super.saveBatch(otherInfoList); super.saveBatch(otherInfoList);
} }
@Override
public boolean saveOrUpdateBatch(List<IdxBizJgOtherInfo> otherInfoList) {
return super.saveOrUpdateBatch(otherInfoList);
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import java.util.stream.Stream;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgProjectContraptionService;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto;
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.mapper.IdxBizJgProjectContraptionMapper;
import lombok.var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.annotation.Resource;
import java.util.*;
/**
* 管道工程装置表服务实现类
*
* @author system_generator
* @date 2024-12-11
*/
@Service
public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgProjectContraptionDto, IdxBizJgProjectContraption, IdxBizJgProjectContraptionMapper> implements IIdxBizJgProjectContraptionService {
public static final String[] jsonFields = {"PRODUCT_PHOTO", "OTHER_ACCESSORIES", "PRODUCT_QUALIFICATION_CERTIFICATE", "START_LATITUDE_LONGITUDE",
"END_LATITUDE_LONGITUDE"};
public static final String IS_INTO_MANAGEMENT = "isIntoManagement";
public static final String USE_REGISTRATION_CODE = "useRegistrationCode";
public static final String REG_CODE_IS_NULL = "regCodeIsNull";
public static final String PROJECT_CONTRAPTION = "projectContraption";
public static final String EQU_CATEGORY = "equCategory";
public static final String EQU_DEFINE = "equDefine";
public static final String PROJECT_CONTRAPTION_NO = "projectContraptionNo";
// 设备基本信息表单id
private static final String EQUIP_INFO_FORM_ID = "equipInfo";
@Resource
private IdxBizJgUseInfoServiceImpl useInfoService;
@Resource
private IdxBizJgRegisterInfoServiceImpl registerInfoService;
@Autowired
private CommonServiceImpl commonServiceImpl;
@Override
public boolean saveOrUpdateData(IdxBizJgProjectContraption projectContraption) {
return this.saveOrUpdate(projectContraption);
}
/**
* 根据工程装置seq物理删除装置表数据和对应设备信息(数据库+es)
*
* @param sequenceNbr 工程装置表seq
* @return result
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean deleteProjectAndEquInfoBySeq(Long sequenceNbr) {
List<IdxBizJgUseInfo> useInfos = useInfoService.lambdaQuery().select(IdxBizJgUseInfo::getRecord).eq(IdxBizJgUseInfo::getProjectContraptionId, sequenceNbr).list();
// 删除idx设备表信息 + 删除对应es数据
List<String> records = useInfos.stream().map(IdxBizJgUseInfo::getRecord).collect(Collectors.toList());
if (records.isEmpty()) return Boolean.TRUE;
Map<String, Object> map = new HashMap<>();
map.put("recordList", records);
registerInfoService.batchDeleteByRecord(map);
// 删除装置表信息
this.removeById(sequenceNbr);
return Boolean.TRUE;
}
/**
* 根据入参 分页查询(当前)单位下的工程管道
*
* @param params 查询参数 Map
* @param page 分页
* @param reginParams 当前登录人信息
* @return result
*/
@Override
public IPage<IdxBizJgProjectContraption> proConPageByParams(Map<String, String> params, Page<IdxBizJgProjectContraption> page, ReginParams reginParams) {
CompanyBo company = reginParams.getCompany();
String companyType = company.getCompanyType();
String companyCode = company.getCompanyCode();
// 是否是否纳管:true - 已纳管 false-未纳管
boolean isIntoManagement = Boolean.parseBoolean(params.get(IS_INTO_MANAGEMENT));
// 使用登记编号
String useRegistrationCode = params.get(USE_REGISTRATION_CODE);
// 使用登记编号是否为空 true/false
String regCodeIsNull = params.get(REG_CODE_IS_NULL);
// 工程装置名称
String projectContraption = params.get(PROJECT_CONTRAPTION);
// 工程装置编号
String projectContraptionNo = params.get(PROJECT_CONTRAPTION_NO);
// 设备类别code
String equCategory = params.get(EQU_CATEGORY);
// 设备类品种code
String equDefine = params.get(EQU_DEFINE);
IPage<IdxBizJgProjectContraption> pageList = lambdaQuery()
.eq(CompanyTypeEnum.CONSTRUCTION.getName().equals(companyType), IdxBizJgProjectContraption::getUscUnitCreditCode, companyCode)
.eq(CompanyTypeEnum.USE.getName().equals(companyType), IdxBizJgProjectContraption::getUseUnitCreditCode, companyCode)
.eq(CompanyTypeEnum.INDIVIDUAL.getName().equals(companyType), IdxBizJgProjectContraption::getUseUnitCreditCode, companyCode.split("_").length > 1 ? companyCode.split("_")[1] : companyCode)
.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)
.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)
.orderByDesc(IdxBizJgProjectContraption::getRecDate)
.page(page);
pageList.getRecords().forEach(record -> {
record.setDataSourceName(EquipSourceEnum.getDataSourceName(record.getDataSource()));
record.setFullAddress(
Stream.of(record.getProvinceName(), record.getCityName(), record.getCountyName(), record.getStreetName(), record.getAddress())
.map(value -> value == null ? "" : value)
.collect(Collectors.joining())
);
record.setCanEdit(this.checkContraptionIsCanEdit(record.getSequenceNbr()));
record.setCanDelete(this.checkContraptionIsCanDelete(record.getSequenceNbr()));
});
return pageList;
}
private Boolean checkContraptionIsCanEdit(Long projectContraptionId) {
Integer inUseTime = this.baseMapper.countContraptionInUseTimesForEdit(projectContraptionId);
return inUseTime <= 0;
}
private Boolean checkContraptionIsCanDelete(Long projectContraptionId) {
Integer inUseTime = this.baseMapper.countContraptionInUseTimesForDelete(projectContraptionId);
return inUseTime <= 0;
}
@Override
public List<IdxBizJgProjectContraption> proConListByParams(Map<String, String> params, ReginParams reginParams) {
CompanyBo company = reginParams.getCompany();
String companyType = company.getCompanyType();
String companyCode = company.getCompanyCode();
// 是否是否纳管:true - 已纳管 false-未纳管
boolean isIntoManagement = Boolean.parseBoolean(params.get(IS_INTO_MANAGEMENT));
// 使用登记编号
String useRegistrationCode = params.get(USE_REGISTRATION_CODE);
// 使用登记编号是否为空 true/false
String regCodeIsNull = params.get(REG_CODE_IS_NULL);
return lambdaQuery()
.eq(CompanyTypeEnum.CONSTRUCTION.getName().equals(companyType), IdxBizJgProjectContraption::getUscUnitCreditCode, companyCode)
.eq(CompanyTypeEnum.USE.getName().equals(companyType), IdxBizJgProjectContraption::getUseUnitCreditCode, companyCode)
.eq(CompanyTypeEnum.INDIVIDUAL.getName().equals(companyType), IdxBizJgProjectContraption::getUseUnitCreditCode, companyCode.split("_").length > 1 ? companyCode.split("_")[1] : companyCode)
.eq(!ValidationUtil.isEmpty(params.get(IS_INTO_MANAGEMENT)), IdxBizJgProjectContraption::getIsIntoManagement, isIntoManagement)
.eq(!ValidationUtil.isEmpty(useRegistrationCode), IdxBizJgProjectContraption::getUseRegistrationCode, useRegistrationCode)
.isNull(!ValidationUtil.isEmpty(regCodeIsNull) && Boolean.TRUE.equals(Boolean.valueOf(regCodeIsNull)), IdxBizJgProjectContraption::getUseRegistrationCode)
.isNotNull(!ValidationUtil.isEmpty(regCodeIsNull) && Boolean.FALSE.equals(Boolean.valueOf(regCodeIsNull)), IdxBizJgProjectContraption::getUseRegistrationCode)
.list();
}
/**
* 分页查询
*/
public Page<IdxBizJgProjectContraptionDto> queryForIdxBizJgProjectContraptionPage(Page<IdxBizJgProjectContraptionDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<IdxBizJgProjectContraptionDto> queryForIdxBizJgProjectContraptionList() {
return this.queryForList("", false);
}
public Map<String, Map<String, Object>> details(String sequenceNbr) {
Map<String, Map<String, Object>> resultMap = new HashMap<>();
if (ObjectUtils.isEmpty(sequenceNbr)) {
resultMap.put(EQUIP_INFO_FORM_ID, Collections.emptyMap());
return resultMap;
}
var baseMapper = this.getBaseMapper();
Map<String, Object> projectContraptionMap = Optional.ofNullable(baseMapper.getDetail(sequenceNbr))
.map(map -> {
commonServiceImpl.convertStringToJsonobject(map, jsonFields);
map.put("pipelineList", baseMapper.selectEquipList((String) map.get("SEQUENCE_NBR")));
return map;
})
.orElse(Collections.emptyMap());
resultMap.put(EQUIP_INFO_FORM_ID, projectContraptionMap);
return resultMap;
}
}
\ No newline at end of file
...@@ -94,7 +94,6 @@ import java.util.*; ...@@ -94,7 +94,6 @@ import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import static com.alibaba.fastjson.JSON.toJSONString; import static com.alibaba.fastjson.JSON.toJSONString;
import static com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum.SPECIAL_CYLINDER; import static com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum.SPECIAL_CYLINDER;
import static com.yeejoin.amos.boot.module.jg.api.enums.VehicleApanageEnum.XIAN_YANG; import static com.yeejoin.amos.boot.module.jg.api.enums.VehicleApanageEnum.XIAN_YANG;
...@@ -115,6 +114,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -115,6 +114,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
public final static String MAINTENANCE_TYPE_NAME = "安装改造维修单位"; public final static String MAINTENANCE_TYPE_NAME = "安装改造维修单位";
// 设备种类 // 设备种类
public static final String EQU_LIST = "EQU_LIST"; public static final String EQU_LIST = "EQU_LIST";
// 管道信息
public static final String PIPELINE_LIST = "pipelineList";
// 模版上传集合 // 模版上传集合
public static final String EQU_LISTS = "equLists"; public static final String EQU_LISTS = "equLists";
// 设备类别 // 设备类别
...@@ -155,6 +156,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -155,6 +156,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 新增修改标识 // 新增修改标识
private static final String OPERATESAVE = "save"; private static final String OPERATESAVE = "save";
private static final String OPERATEEDIT = "edit"; private static final String OPERATEEDIT = "edit";
//市区县
private static final String CITY = "CITY";
private static final String COUNTY = "COUNTY";
private static final String REGION = "REGION";
private static final String STREET = "STREET";
// 单位办理类型 // 单位办理类型
private static final String MANAGE_TYPE_UNIT = "unit"; private static final String MANAGE_TYPE_UNIT = "unit";
private static final String RECORD = "RECORD"; private static final String RECORD = "RECORD";
...@@ -284,6 +290,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -284,6 +290,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private ShCarEquServiceImpl shCarEquService; private ShCarEquServiceImpl shCarEquService;
@Autowired @Autowired
private ShCarServiceImpl shCarService; private ShCarServiceImpl shCarService;
@Autowired
private IIdxBizJgProjectContraptionService idxBizJgProjectContraptionService;
/** /**
* 将对象的属性由驼峰转为纯大写下划线格式 * 将对象的属性由驼峰转为纯大写下划线格式
...@@ -303,8 +311,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -303,8 +311,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
try { try {
value = field.get(object); value = field.get(object);
// 需要转为jsonArray的字段 // 需要转为jsonArray的字段
if (!ValidationUtil.isEmpty(strToJsonArrayFields) && Arrays.asList(strToJsonArrayFields).contains(underscoreFieldName)) { if (!ValidationUtil.isEmpty(strToJsonArrayFields) && Arrays.asList(strToJsonArrayFields).contains(underscoreFieldName) && value instanceof String) {
value = JSON.parseArray((String) field.get(object)); value = JSON.parse((String) field.get(object));
} }
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
...@@ -382,6 +390,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -382,6 +390,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
LinkedHashMap equipmentInfoForm = (LinkedHashMap) checkAndCast(paramMap.get(EQUIP_INFO_FORM_ID)); LinkedHashMap equipmentInfoForm = (LinkedHashMap) checkAndCast(paramMap.get(EQUIP_INFO_FORM_ID));
String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE); String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE);
String equCategory = (String) equipmentInfoForm.get(EQU_CATEGORY);
//管道添加设备
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategory)) {
return this.pipelineEquipCreateOrUpdate(paramMap);
}
if(dataSource.contains("black")){ if(dataSource.contains("black")){
return this.blackEquipCreateOrUpdate(paramMap); return this.blackEquipCreateOrUpdate(paramMap);
} else { } else {
...@@ -389,6 +402,313 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -389,6 +402,313 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
} }
/**
* 管道设备新增或更新
*
* @param paramMap 前端参数
* @return record
*/
private ResponseModel pipelineEquipCreateOrUpdate(Map<String, Object> paramMap) {
try {
// 获取表单数据并进行类型检查
LinkedHashMap equipmentInfoForm = castToLinkedHashMap(paramMap.get(EQUIP_INFO_FORM_ID));
String submitType = String.valueOf(paramMap.get("submitType"));
return ResponseHelper.buildResponse(batchSubmitOrUpdatePipeline(equipmentInfoForm, submitType));
} catch (Exception e) {
log.error("操作失败,数据异常: {}", e.getMessage(), e);
handleError(e, String.valueOf(paramMap.getOrDefault(SEQUENCE_NBR, "未知序号")));
return ResponseHelper.buildResponse(null);
}
}
/**
* 检查并转换对象为 LinkedHashMap
*
* @param obj 要转换的对象
* @return LinkedHashMap
* @throws IllegalArgumentException 如果类型不匹配
*/
@SuppressWarnings("unchecked")
private LinkedHashMap castToLinkedHashMap(Object obj) {
if (obj instanceof LinkedHashMap) {
return (LinkedHashMap) obj;
}
throw new IllegalArgumentException("参数类型错误,期望 LinkedHashMap 类型: " + obj);
}
private Long batchSubmitOrUpdatePipeline(LinkedHashMap equipmentInfoForm, String submitType) {
Date date = new Date();
String operateType = ValidationUtil.isEmpty(equipmentInfoForm.get(SEQUENCE_NBR)) ? OPERATESAVE : OPERATEEDIT;
// 设备是否复制而来,复制来的设备走新增
boolean isCopy = !ValidationUtil.isEmpty(equipmentInfoForm.get(IS_COPY));
operateType = isCopy ? OPERATESAVE : operateType;
// 新增设备保存时 : 历史设备=》dataSource为"his" jg新录入设备dataSource为"jg"
String dataSource = this.getDataSource(operateType, equipmentInfoForm);
Long sequenceNbr = OPERATESAVE.equals(operateType)
? sequence.nextId()
: Optional.ofNullable(equipmentInfoForm.get(SEQUENCE_NBR))
.map(String::valueOf)
.map(Long::valueOf)
.orElseThrow(() -> new IllegalArgumentException("Invalid SEQUENCE_NBR value"));
if ("edit".equals(submitType)) {
List<String> records = idxBizJgUseInfoService.lambdaQuery()
.select(IdxBizJgUseInfo::getRecord)
.eq(IdxBizJgUseInfo::getProjectContraptionId, sequenceNbr)
.list()
.stream()
.map(IdxBizJgUseInfo::getRecord)
.collect(Collectors.toList());
idxBizJgRegisterInfoService.batchDeleteByRecord(MapBuilder.<String, Object>create()
.put("recordList", records)
.put("equCategory", equipmentInfoForm.get("EQU_CATEGORY"))
.build());
}
List<Map<String, Object>> pipelineList = (List<Map<String, Object>>) equipmentInfoForm.get(PIPELINE_LIST);
String equListName = jgVehicleInformationMapper.getEquCategoryNameByCode((String) equipmentInfoForm.get("EQU_LIST"));
String equCategoryName = jgVehicleInformationMapper.getEquCategoryNameByCode( (String) equipmentInfoForm.get("EQU_CATEGORY"));
String equDefineName = jgVehicleInformationMapper.getEquCategoryNameByCode((String) equipmentInfoForm.get("EQU_DEFINE"));
// 单位类型
Map<String, Object> companyInfoMap = jgInstallationNoticeService.getCompanyType();
String companyTypeStr = companyInfoMap.get("companyType").toString();
if (CollectionUtils.isEmpty(pipelineList) || pipelineList.size() != pipelineList.stream()
.map(v -> (String) v.get("pipelineNumber")).distinct().count()) {
throw new BadRequest(CollectionUtils.isEmpty(pipelineList) ? "请填写管道信息!" : "同一工程装置下管道编号不能重复!");
}
// 工程装置信息
IdxBizJgProjectContraption projectContraption = JSON.parseObject(toJSONString(equipmentInfoForm), IdxBizJgProjectContraption.class);
projectContraption.setSequenceNbr(sequenceNbr);
projectContraption.setDataSource(dataSource);
projectContraption.setIsIntoManagement(false);
projectContraption.setProvinceName("陕西省");
projectContraption.setCityName(getRegionName(CITY, CITY, equipmentInfoForm));
projectContraption.setCountyName(getRegionName(REGION, COUNTY, equipmentInfoForm));
projectContraption.setStreetName(getRegionName(STREET, STREET, equipmentInfoForm));
projectContraption.setEquListName(equListName);
projectContraption.setEquCategoryName(equCategoryName);
projectContraption.setEquDefineName(equDefineName);
projectContraption.setPipelineLength(
pipelineList.stream()
.map(pipeline -> pipeline.get("pipeLength"))
.filter(Objects::nonNull)
.mapToDouble(pipeLength -> Double.parseDouble(String.valueOf(pipeLength)))
.sum()
);
projectContraption.setUscUnitName(companyInfoMap.get("companyName").toString());
projectContraption.setUscUnitCreditCode(companyInfoMap.get("creditCode").toString());
idxBizJgProjectContraptionService.saveOrUpdateData(projectContraption);
List<IdxBizJgUseInfo> useInfoList = new ArrayList<>(10);
List<IdxBizJgDesignInfo> designInfoList = new ArrayList<>(10);
List<IdxBizJgFactoryInfo> factoryInfoList = new ArrayList<>(10);
List<IdxBizJgConstructionInfo> constructionInfoList = new ArrayList<>(10);
List<IdxBizJgRegisterInfo> registerInfoList = new ArrayList<>(10);
List<IdxBizJgSupervisionInfo> supervisionInfoList = new ArrayList<>(10);
List<IdxBizJgOtherInfo> otherInfoList = new ArrayList<>(10);
List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList = new ArrayList<>(10);
List<IdxBizJgTechParamsPipeline> paramsPipelineList = new ArrayList<>(10);
List<ESEquipmentCategoryDto> esEquipmentCategoryList = new ArrayList<>(10);
//设备信息
for (Map<String, Object> pipeline : pipelineList) {
String record = UUID.randomUUID().toString();
if (isCopy) {
String sourceRecord = pipeline.get(RECORD).toString();
// bug-21203
if (equipmentInfoForm.containsKey("DATA_SOURCE")) {
String dataSourceCopy = equipmentInfoForm.get("DATA_SOURCE").toString();
if (dataSourceCopy.startsWith("jg_his_black")) {
dataSource = "jg_his_black_" + sourceRecord;
} else if (dataSourceCopy.startsWith("jg_his")) {
dataSource = "jg_his_" + sourceRecord;
} else {
dataSource = "jg_" + sourceRecord;
}
} else {
throw new BadRequest("数据异常,请联系管理员");
}
}
//更新时工业管道(8300)检验检测信息
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = JSON.parseObject(toJSONString(pipeline), IdxBizJgInspectionDetectionInfo.class);
if (!ValidationUtil.isEmpty(inspectionDetectionInfo)) {
List<Map<String, Object>> inspectionAndTestingInstitutions = commonService.getUnitListByType("inspection", "gasCylindersForCars");
Optional<Map<String, Object>> optional = inspectionAndTestingInstitutions.stream().filter(x -> x.get("useCode").equals(inspectionDetectionInfo.getInspectOrgCode())).findFirst();
Map<String, Object> mapOrDefault = optional.orElse(Collections.emptyMap());
inspectionDetectionInfo.setInspectOrgName((String) mapOrDefault.getOrDefault("useUnit", inspectionDetectionInfo.getInspectOrgName()));
inspectionDetectionInfo.setRecord(record);
inspectionDetectionInfo.setRecDate(date);
inspectionDetectionInfo.setSequenceNbr(null);
if (inspectionDetectionInfo.getNextInspectDate() != null) {
inspectionDetectionInfo.setNextInspectDate(DateUtil.parse(DateUtil.format(inspectionDetectionInfo.getNextInspectDate(), DatePattern.NORM_DATE_PATTERN)));
}
inspectionDetectionInfoList.add(inspectionDetectionInfo);
}
// 使用信息
IdxBizJgUseInfo useInfo = JSON.parseObject(toJSONString(pipeline), IdxBizJgUseInfo.class);
// 使用信息
useInfo.setRecord(record);
useInfo.setSequenceNbr(null);
useInfo.setRecDate(date);
useInfo.setDataSource(dataSource);
useInfo.setIsIntoManagement(Boolean.FALSE);
if (companyTypeStr.contains(CompanyTypeEnum.USE.getCode()) || companyTypeStr.contains(CompanyTypeEnum.INDIVIDUAL.getCode())) {
useInfo.setUseUnitCreditCode(companyInfoMap.get("creditCode").toString());
useInfo.setUseUnitName(companyInfoMap.get("companyName").toString());
}
if (isCopy) {
// 设备状态置空
useInfo.setEquState("");
// 如果为安改维单位复制设备,则将使用单位信息置空
if (companyTypeStr.equals(CompanyTypeEnum.CONSTRUCTION.getCode())) {
useInfo.setUseUnitCreditCode("");
useInfo.setUseUnitName("");
}
}
useInfo.setProjectContraption(((String) equipmentInfoForm.get("PROJECT_CONTRAPTION")).trim());
useInfo.setProjectContraptionId(String.valueOf(sequenceNbr));
useInfoList.add(useInfo);
// 设计信息
IdxBizJgDesignInfo designInfo = JSON.parseObject(toJSONString(pipeline), IdxBizJgDesignInfo.class);
designInfo.setRecord(record);
designInfo.setRecDate(date);
designInfo.setSequenceNbr(null);
designInfoList.add(designInfo);
// 制造信息
IdxBizJgFactoryInfo factoryInfo = JSON.parseObject(toJSONString(pipeline), IdxBizJgFactoryInfo.class);
factoryInfo.setRecord(record);
factoryInfo.setRecDate(date);
factoryInfo.setSequenceNbr(null);
factoryInfoList.add(factoryInfo);
// 施工信息
IdxBizJgConstructionInfo constructionInfo = JSON.parseObject(toJSONString(pipeline), IdxBizJgConstructionInfo.class);
String companyName = companyInfoMap.get("companyName").toString();
String companyCode = companyInfoMap.get("creditCode").toString();
constructionInfo.setRecord(record);
constructionInfo.setRecDate(date);
if (companyTypeStr.contains(CompanyTypeEnum.CONSTRUCTION.getCode())) {
constructionInfo.setUscUnitCreditCode(companyCode);
constructionInfo.setUscUnitName(companyName);
}
if (isCopy) {
if (companyTypeStr.equals(CompanyTypeEnum.USE.getCode()) || companyTypeStr.equals(CompanyTypeEnum.INDIVIDUAL.getCode())) {
constructionInfo.setUscUnitCreditCode("");
constructionInfo.setUscUnitName("");
}
}
constructionInfo.setSequenceNbr(null);
constructionInfoList.add(constructionInfo);
// 注册登记信息
IdxBizJgRegisterInfo registerInfo = JSON.parseObject(toJSONString(equipmentInfoForm), IdxBizJgRegisterInfo.class);
registerInfo.setRecord(record);
registerInfo.setRecDate(date);
registerInfo.setSequenceNbr(null);
registerInfo.setEquCodeType("2");
registerInfo.setRegisterState(this.getRegCode());
// 补丁:saveOrUpdate在update数据时不会更新字段为null的字段,但是编辑设备的代码时,从有改成无,equCode解析成null,但是此时需要将equcode删掉
registerInfo.setEquCode(ObjectUtils.isEmpty(registerInfo.getEquCode()) ? "" : registerInfo.getEquCode());
// 监督管理
IdxBizJgSupervisionInfo supervisionInfo = JSON.parseObject(toJSONString(pipeline), IdxBizJgSupervisionInfo.class);
supervisionInfo.setRecord(record);
supervisionInfo.setRecDate(date);
supervisionInfo.setSequenceNbr(null);
supervisionInfoList.add(supervisionInfo);
// 其他信息
IdxBizJgOtherInfo otherInfo = JSON.parseObject(toJSONString(pipeline), IdxBizJgOtherInfo.class);
otherInfo.setRecord(record);
otherInfo.setSequenceNbr(null);
otherInfo.setClaimStatus("已认领");
otherInfo.setRecDate(date);
if (isCopy) {
// 监管码置空
otherInfo.setSupervisoryCode("");
otherInfo.setCylinderStampAttachment("");
otherInfo.setInformationSituation("");
otherInfo.setInformationManageCode("");
}
otherInfoList.add(otherInfo);
//管道技术参数
IdxBizJgTechParamsPipeline pipelineInfo = JSON.parseObject(toJSONString(pipeline), IdxBizJgTechParamsPipeline.class);
if (!ValidationUtil.isEmpty(pipelineInfo)) {
pipelineInfo.setRecord(record);
pipelineInfo.setRecDate(date);
pipelineInfo.setSequenceNbr(null);
paramsPipelineList.add(pipelineInfo);
}
registerInfo.setProductName(pipelineInfo.getPipeName());
registerInfoList.add(registerInfo);
ESEquipmentCategoryDto esEquipmentDto = JSON.parseObject(toJSONString(equipmentInfoForm), ESEquipmentCategoryDto.class);
esEquipmentDto.setDATA_SOURCE(useInfo.getDataSource());
if (inspectionDetectionInfo.getNextInspectDate() != null) {
esEquipmentDto.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getNextInspectDate().getTime());
}
esEquipmentDto.setREC_DATE(System.currentTimeMillis());
esEquipmentDto.setSEQUENCE_NBR(record);
esEquipmentDto.setIS_INTO_MANAGEMENT(false);
esEquipmentDto.setEQU_CATEGORY_CODE(registerInfo.getEquCategory());
esEquipmentDto.setEQU_CATEGORY(equCategoryName);
esEquipmentDto.setEQU_LIST_CODE(registerInfo.getEquList());
esEquipmentDto.setEQU_LIST(equListName);
esEquipmentDto.setEQU_DEFINE_CODE(registerInfo.getEquDefine());
esEquipmentDto.setEQU_DEFINE(equListName);
esEquipmentDto.setSTATUS("已认领");
esEquipmentDto.setUSC_UNIT_CREDIT_CODE(projectContraption.getUscUnitCreditCode());
esEquipmentDto.setUSC_UNIT_NAME(projectContraption.getUscUnitName());
esEquipmentDto.setPROJECT_CONTRAPTION(projectContraption.getProjectContraption());
esEquipmentDto.setPRODUCT_NAME(pipelineInfo.getPipeName());
esEquipmentDto.setProjectContraptionId(String.valueOf(sequenceNbr));
if (inspectionDetectionInfo.getNextInspectDate() != null) {
esEquipmentDto.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getNextInspectDate().getTime());
}
esEquipmentCategoryList.add(esEquipmentDto);
}
idxBizJgUseInfoService.saveOrUpdateBatch(useInfoList);
iIdxBizJgDesignInfoService.saveOrUpdateBatch(designInfoList);
iIdxBizJgConstructionInfoService.saveOrUpdateBatch(constructionInfoList);
iIdxBizJgFactoryInfoService.saveOrUpdateBatch(factoryInfoList);
this.saveOrUpdateBatch(registerInfoList);
iIdxBizJgOtherInfoService.saveOrUpdateBatch(otherInfoList);
iIdxBizJgSupervisionInfoService.saveOrUpdateBatch(supervisionInfoList);
iIdxBizJgInspectionDetectionInfoService.saveOrUpdateBatch(inspectionDetectionInfoList);
iIdxBizJgTechParamsPipelineService.saveOrUpdateBatch(paramsPipelineList);
esEquipmentCategory.saveAll(esEquipmentCategoryList);
return sequenceNbr;
}
/**
* 根据code获取市区县名字
* @param key key
* @param codeKey codeKey
* @param equipmentInfoForm 表单信息
* @return name
*/
private String getRegionName(String key, String codeKey, Map<String, Object> equipmentInfoForm) {
return Optional.ofNullable((List<LinkedHashMap>) redisUtils.get(key))
.flatMap(list -> list.stream()
.filter(item -> String.valueOf(item.get("regionCode"))
.equals(String.valueOf(equipmentInfoForm.get(codeKey))))
.map(item -> (String) item.get("regionName"))
.findFirst())
.orElse("");
}
private ResponseModel blackEquipCreateOrUpdate(Map<String, Object> paramMap) { private ResponseModel blackEquipCreateOrUpdate(Map<String, Object> paramMap) {
LinkedHashMap equipmentClassForm = (LinkedHashMap) checkAndCast(paramMap.get(EQUIP_CLASS_FORM_ID)); LinkedHashMap equipmentClassForm = (LinkedHashMap) checkAndCast(paramMap.get(EQUIP_CLASS_FORM_ID));
LinkedHashMap equipmentInfoForm = (LinkedHashMap) checkAndCast(paramMap.get(EQUIP_INFO_FORM_ID)); LinkedHashMap equipmentInfoForm = (LinkedHashMap) checkAndCast(paramMap.get(EQUIP_INFO_FORM_ID));
...@@ -431,6 +751,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -431,6 +751,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String record = (String) equipmentInfoForm.get(RECORD); String record = (String) equipmentInfoForm.get(RECORD);
String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE); String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE);
if (dataSource.contains("his")) {
String useRegistrationCode = String.valueOf(equipmentInfoForm.get("useRegistrationCode")).trim();
String equipId = String.valueOf(equipmentInfoForm.get("RECORD"));
// 校验使用登记证编号的唯一性
if (commonService.useRegistrationCertificateAccountUnique(useRegistrationCode, equipId)) {
throw new BadRequest("使用登记证编号已存在!");
}
String regType = Optional.ofNullable(equipmentInfoForm.get("EQU_LIST"))
.filter(code -> CylinderTypeEnum.CYLINDER.getCode().equals(code))
.map(code -> "1".equals(equipmentInfoForm.get("WHETHER_VEHICLE_CYLINDER")) ? "vehicle" : "cylinder")
.orElse("set");
// 判断是否使用未来系统生成编号
idxBizJgRegisterInfoService.checkUseRegistrationCode(useRegistrationCode, regType);
}
try { try {
// 设备代码 字段的唯一性校验 // 设备代码 字段的唯一性校验
checkEquCodeUniqueness(equipmentInfoForm); checkEquCodeUniqueness(equipmentInfoForm);
...@@ -670,9 +1005,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -670,9 +1005,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
esEquipmentCategoryDto.setSEQUENCE_NBR(recordList.toString()); esEquipmentCategoryDto.setSEQUENCE_NBR(recordList.toString());
list.add(esEquipmentCategoryDto); list.add(esEquipmentCategoryDto);
} }
// 删除校验,被引用时不可删除 // 删除校验,被引用时不可删除,管道排除在外
this.checkForDelete(records); if(!PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(map.get("equCategory"))) {
this.checkForDelete(records);
}
// 删除涉及的19张表的数据 // 删除涉及的19张表的数据
superviseInfoMapper.deleteDataAll(records); superviseInfoMapper.deleteDataAll(records);
// 删除es中的数据 // 删除es中的数据
...@@ -2095,7 +2431,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2095,7 +2431,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String param = QueryParser.escape(map.getString(EQU_CATEGORY)); String param = QueryParser.escape(map.getString(EQU_CATEGORY));
pBuilder.must(QueryBuilders.matchPhraseQuery(EQU_CATEGORY, "*" + param + "*")); pBuilder.must(QueryBuilders.matchPhraseQuery(EQU_CATEGORY, "*" + param + "*"));
boolMust.must(pBuilder); boolMust.must(pBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("USE_PLACE"))) { if (!ObjectUtils.isEmpty(map.getString("USE_PLACE"))) {
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder pBuilder = QueryBuilders.boolQuery();
...@@ -2174,6 +2509,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2174,6 +2509,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String test = QueryParser.escape(map.getString(EQU_CATEGORY_CODE)); String test = QueryParser.escape(map.getString(EQU_CATEGORY_CODE));
pBuilder.must(QueryBuilders.termQuery(EQU_CATEGORY_CODE, test)); pBuilder.must(QueryBuilders.termQuery(EQU_CATEGORY_CODE, test));
boolMust.must(pBuilder); boolMust.must(pBuilder);
} else {
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape("8300");//不查管道,管道新菜单查询
pBuilder.mustNot(QueryBuilders.termQuery(EQU_CATEGORY_CODE, test));
boolMust.must(pBuilder);
} }
// 是否车用气瓶 // 是否车用气瓶
if (!ObjectUtils.isEmpty(map.getString(WHETHER_VEHICLE_CYLINDER))) { if (!ObjectUtils.isEmpty(map.getString(WHETHER_VEHICLE_CYLINDER))) {
......
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgSupervisionInfo; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgSupervisionInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgSupervisionInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgSupervisionInfoMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/** /**
* 监督管理信息表服务实现类 * 监督管理信息表服务实现类
...@@ -26,4 +27,8 @@ public class IdxBizJgSupervisionInfoServiceImpl extends BaseService<IdxBizJgSupe ...@@ -26,4 +27,8 @@ public class IdxBizJgSupervisionInfoServiceImpl extends BaseService<IdxBizJgSupe
return this.getOne(new QueryWrapper<IdxBizJgSupervisionInfo>().eq("RECORD", record)); return this.getOne(new QueryWrapper<IdxBizJgSupervisionInfo>().eq("RECORD", record));
} }
@Override
public boolean saveOrUpdateBatch(List<IdxBizJgSupervisionInfo> supervisionInfoList) {
return super.saveOrUpdateBatch(supervisionInfoList);
}
} }
\ No newline at end of file
...@@ -39,4 +39,9 @@ public class IdxBizJgUseInfoServiceImpl extends BaseService<IdxBizJgUseInfoDto,I ...@@ -39,4 +39,9 @@ public class IdxBizJgUseInfoServiceImpl extends BaseService<IdxBizJgUseInfoDto,I
public boolean saveBatch(List<IdxBizJgUseInfo> useInfoList) { public boolean saveBatch(List<IdxBizJgUseInfo> useInfoList) {
return super.saveBatch(useInfoList); return super.saveBatch(useInfoList);
} }
@Override
public boolean saveOrUpdateBatch(List<IdxBizJgUseInfo> useInfoList) {
return super.saveOrUpdateBatch(useInfoList);
}
} }
\ No newline at end of file
...@@ -7,9 +7,10 @@ import com.alibaba.fastjson.JSONObject; ...@@ -7,9 +7,10 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.util.StringUtil; import com.github.pagehelper.util.StringUtil;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper; import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
...@@ -19,16 +20,17 @@ import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity; ...@@ -19,16 +20,17 @@ import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.*; import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
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.api.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo; import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.InstallationVo; import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.InstallationVo;
...@@ -51,7 +53,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquCodeTypeEnum; ...@@ -51,7 +53,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquCodeTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*; import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
...@@ -69,7 +70,6 @@ import org.redisson.api.RedissonClient; ...@@ -69,7 +70,6 @@ import org.redisson.api.RedissonClient;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -112,7 +112,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -112,7 +112,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private static final String CONSTRUCTION_TYPE = "SGLX"; private static final String CONSTRUCTION_TYPE = "SGLX";
private static final String CONSTRUCTION_TYPE_NAME = "安装"; private static final String CONSTRUCTION_TYPE_NAME = "安装";
@Autowired @Autowired
JgInstallationNoticeEqMapper jgInstallationNoticeEqMapper; JgInstallationNoticeEqMapper jgInstallationNoticeEqMapper;
@Autowired @Autowired
...@@ -173,13 +172,15 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -173,13 +172,15 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper; private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
@Autowired @Autowired
private IdxBizJgFactoryInfoServiceImpl idxBizJgFactoryInfoService; private IdxBizJgFactoryInfoServiceImpl idxBizJgFactoryInfoService;
@Autowired @Autowired
private JgRegistrationHistoryServiceImpl jgRegistrationHistoryService; private IdxBizJgProjectContraptionServiceImpl projectContraptionService;
@Autowired @Autowired
private EquipTechParamPipelineMapper equipTechParamPipelineMapper; private ObjectMapper objectMapper;
@Autowired
private IdxBizJgProjectConstructionMapper projectConstructionMapper;
@Autowired
private IdxBizJgProjectContraptionMapper projectContraptionMapper;
@Autowired @Autowired
EventPublisher eventPublisher; EventPublisher eventPublisher;
...@@ -220,6 +221,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -220,6 +221,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 处理设备筛选默认值 // 处理设备筛选默认值
installationInfo.put("QUERY_TYPE", "AZ"); installationInfo.put("QUERY_TYPE", "AZ");
installationInfo.put("IS_INTO_MANAGEMENT", "false"); installationInfo.put("IS_INTO_MANAGEMENT", "false");
installationInfo.put("isIntoManagement", "false");
// 处理图片 // 处理图片
if (!ValidationUtil.isEmpty(installationInfo.get("proxyStatementAttachment"))) { if (!ValidationUtil.isEmpty(installationInfo.get("proxyStatementAttachment"))) {
installationInfo.put("proxyStatementAttachmentList", JSONObject.parseArray(installationInfo.get("proxyStatementAttachment").toString())); installationInfo.put("proxyStatementAttachmentList", JSONObject.parseArray(installationInfo.get("proxyStatementAttachment").toString()));
...@@ -280,6 +282,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -280,6 +282,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
installationInfo.put(s, ObjectUtils.isEmpty(installationInfo.get(s)) ? new JSONArray() : parseArray(installationInfo.get(s).toString())); installationInfo.put(s, ObjectUtils.isEmpty(installationInfo.get(s)) ? new JSONArray() : parseArray(installationInfo.get(s).toString()));
} }
} }
String[] jsonObjFields = {"startLatitudeLongitude", "endLatitudeLongitude"};
for (String s : jsonObjFields) {
if (installationInfo.containsKey(s)) {
installationInfo.put(s, ObjectUtils.isEmpty(installationInfo.get(s)) ? null : JSON.parseObject(installationInfo.get(s).toString()));
}
}
if (Integer.parseInt(notice.getNoticeStatus()) >= FlowStatusEnum.TO_BE_FINISHED.getCode()) { if (Integer.parseInt(notice.getNoticeStatus()) >= FlowStatusEnum.TO_BE_FINISHED.getCode()) {
// 完成及作废时显示历史数据 // 完成及作废时显示历史数据
JSONObject hisData = commonService.queryHistoryData(notice.getSequenceNbr()); JSONObject hisData = commonService.queryHistoryData(notice.getSequenceNbr());
...@@ -299,6 +307,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -299,6 +307,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
} else { } else {
// 显示最新的设备信息 // 显示最新的设备信息
Map<String, Object> detail = setNewEquipData(companyLevel, installationInfo); Map<String, Object> detail = setNewEquipData(companyLevel, installationInfo);
detail.put("startLatitudeLongitude", JSON.parseObject(notice.getStartLatitudeLongitude()));
detail.put("endLatitudeLongitude", JSON.parseObject(notice.getEndLatitudeLongitude()));
return new HashMap<String, Map<String, Object>>() {{ return new HashMap<String, Map<String, Object>>() {{
this.put("installationInfo", detail); this.put("installationInfo", detail);
}}; }};
...@@ -327,12 +337,26 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -327,12 +337,26 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private Map<String, Object> setNewEquipData(String companyLevel, Map<String, Object> installationInfo) { private Map<String, Object> setNewEquipData(String companyLevel, Map<String, Object> installationInfo) {
List<Map<String, Object>> equipListMaps = Lists.newArrayList();
String equCategory = (String) installationInfo.get("equCategoryCode");
LambdaQueryWrapper<JgInstallationNoticeEq> lambda = new QueryWrapper<JgInstallationNoticeEq>().lambda(); LambdaQueryWrapper<JgInstallationNoticeEq> lambda = new QueryWrapper<JgInstallationNoticeEq>().lambda();
lambda.eq(JgInstallationNoticeEq::getEquipTransferId, installationInfo.get("sequenceNbr")); lambda.eq(JgInstallationNoticeEq::getEquipTransferId, installationInfo.get("sequenceNbr"));
List<JgInstallationNoticeEq> jgInstallationNoticeEqs = jgInstallationNoticeEqMapper.selectList(lambda); List<JgInstallationNoticeEq> jgInstallationNoticeEqs = jgInstallationNoticeEqMapper.selectList(lambda);
List<String> ids = jgInstallationNoticeEqs.stream().map(item -> item.getEquId()).collect(Collectors.toList()); if (!ValidationUtil.isEmpty(jgInstallationNoticeEqs)) {
Iterable<ESEquipmentCategoryDto> equips = esEquipmentCategory.findAllById(ids); // 压力管道从工程装置表查询设备信息
List<Map<String, Object>> equipListMaps = getEquipListMaps(equips); if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategory)) {
String projectContraptionId = (String) installationInfo.get("projectContraptionId");
IdxBizJgProjectContraption projectContraption = projectContraptionService.getById(projectContraptionId);
installationInfo.put("pipelineLength", projectContraption.getPipelineLength());
installationInfo.put("projectContraptionNo", projectContraption.getProjectContraptionNo());
installationInfo.put("projectContraption", projectContraption.getProjectContraption());
equipListMaps = projectContraptionService.getBaseMapper().selectEquipList(projectContraptionId);
} else {
List<String> ids = jgInstallationNoticeEqs.stream().map(JgInstallationNoticeEq::getEquId).collect(Collectors.toList());
Iterable<ESEquipmentCategoryDto> equips = esEquipmentCategory.findAllById(ids);
equipListMaps = getEquipListMaps(equips);
}
}
// Map<String, Object> detail = equipmentInfos.get(0); // Map<String, Object> detail = equipmentInfos.get(0);
// Map<String, Object> equInfo = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(detail.get("equId").toString()); // Map<String, Object> equInfo = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(detail.get("equId").toString());
...@@ -401,6 +425,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -401,6 +425,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 提取节点等信息 // 提取节点等信息
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
BeanUtils.copyProperties(noticeDto, notice); BeanUtils.copyProperties(noticeDto, notice);
notice.setStartLatitudeLongitude(JSON.toJSONString(noticeDto.getStartLatitudeLongitude()));
notice.setEndLatitudeLongitude(JSON.toJSONString(noticeDto.getEndLatitudeLongitude()));
if (!ObjectUtils.isEmpty(notice.getInstanceStatus())) { if (!ObjectUtils.isEmpty(notice.getInstanceStatus())) {
notice.setInstanceStatus(notice.getInstanceStatus() + "," + workflowResultDto.getNextExecutorRoleIds()); notice.setInstanceStatus(notice.getInstanceStatus() + "," + workflowResultDto.getNextExecutorRoleIds());
} else { } else {
...@@ -436,6 +462,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -436,6 +462,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 提取节点等信息 // 提取节点等信息
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
BeanUtils.copyProperties(noticeDto, notice); BeanUtils.copyProperties(noticeDto, notice);
notice.setStartLatitudeLongitude(JSON.toJSONString(noticeDto.getStartLatitudeLongitude()));
notice.setEndLatitudeLongitude(JSON.toJSONString(noticeDto.getEndLatitudeLongitude()));
if (!ObjectUtils.isEmpty(notice.getInstanceStatus())) { if (!ObjectUtils.isEmpty(notice.getInstanceStatus())) {
notice.setInstanceStatus(notice.getInstanceStatus() + "," + workflowResultDto.getNextExecutorRoleIds()); notice.setInstanceStatus(notice.getInstanceStatus() + "," + workflowResultDto.getNextExecutorRoleIds());
} else { } else {
...@@ -487,9 +515,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -487,9 +515,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
ArrayList<JgInstallationNoticeEq> jgInstallationNoticeEqs = new ArrayList<>(); ArrayList<JgInstallationNoticeEq> jgInstallationNoticeEqs = new ArrayList<>();
noticeDto.getDeviceList().forEach(item -> { noticeDto.getDeviceList().forEach(item -> {
JgInstallationNoticeEq jgInstallationNoticeEq = new JgInstallationNoticeEq(); JgInstallationNoticeEq jgInstallationNoticeEq = new JgInstallationNoticeEq();
jgInstallationNoticeEq.setEquId(String.valueOf(item.get("SEQUENCE_NBR"))); jgInstallationNoticeEq.setEquId(!ValidationUtil.isEmpty(item.get("SEQUENCE_NBR")) ? String.valueOf(item.get("SEQUENCE_NBR")) : String.valueOf(item.get("record")));
jgInstallationNoticeEq.setEquCategoryCode(String.valueOf(item.get("EQU_CATEGORY_CODE"))); jgInstallationNoticeEq.setEquCategoryCode(!ValidationUtil.isEmpty(item.get("EQU_CATEGORY_CODE")) ? String.valueOf(item.get("EQU_CATEGORY_CODE")) : String.valueOf(item.get("equCategory")));
jgInstallationNoticeEq.setEquListCode(String.valueOf(item.get("EQU_LIST_CODE"))); jgInstallationNoticeEq.setEquListCode(!ValidationUtil.isEmpty(item.get("EQU_LIST_CODE")) ? String.valueOf(item.get("EQU_LIST_CODE")) : String.valueOf(item.get("equList")));
jgInstallationNoticeEq.setEquipTransferId(noticeDto.getSequenceNbr().toString()); jgInstallationNoticeEq.setEquipTransferId(noticeDto.getSequenceNbr().toString());
jgInstallationNoticeEqs.add(jgInstallationNoticeEq); jgInstallationNoticeEqs.add(jgInstallationNoticeEq);
}); });
...@@ -595,14 +623,25 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -595,14 +623,25 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
List<JgInstallationNoticeEq> equList = jgInstallationNoticeEqService.lambdaQuery().eq(JgInstallationNoticeEq::getEquipTransferId, jgInstallationNotice.getSequenceNbr()).list(); List<JgInstallationNoticeEq> equList = jgInstallationNoticeEqService.lambdaQuery().eq(JgInstallationNoticeEq::getEquipTransferId, jgInstallationNotice.getSequenceNbr()).list();
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
ArrayList<Map<String, Object>> maps = new ArrayList<>(); ArrayList<Map<String, Object>> maps = new ArrayList<>();
equList.forEach(equ -> { // 管道按照装置打一份告知书
List<Map<String, Object>> informationList = jgInstallationNoticeMapper.queryEquipInformation(equ.getSequenceNbr()); if ("8000".equals(jgInstallationNotice.getEquListCode()) && !equList.isEmpty()) {
List<Map<String, Object>> informationList = jgInstallationNoticeMapper.queryEquipInformation(equList.get(0).getSequenceNbr());
if (CollectionUtils.isEmpty(informationList)) { if (CollectionUtils.isEmpty(informationList)) {
throw new IllegalArgumentException("安装告知单不存在"); throw new IllegalArgumentException("安装告知单不存在");
} }
Map<String, Object> placeholders = fullFillTemplateObj(informationList, BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName().substring(0, 2)); Map<String, Object> placeholders = fullFillTemplateObj(informationList, BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName().substring(0, 2));
maps.add(placeholders); maps.add(placeholders);
}); } else {
equList.forEach(equ -> {
List<Map<String, Object>> informationList = jgInstallationNoticeMapper.queryEquipInformation(equ.getSequenceNbr());
if (CollectionUtils.isEmpty(informationList)) {
throw new IllegalArgumentException("安装告知单不存在");
}
Map<String, Object> placeholders = fullFillTemplateObj(informationList, BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName().substring(0, 2));
maps.add(placeholders);
});
}
String tempFileName = "安装告知单_" + System.currentTimeMillis() + "_temp"; String tempFileName = "安装告知单_" + System.currentTimeMillis() + "_temp";
// String url = WordTemplateUtils.templateToPdf(tempFileName, "installation-notification-report.ftl", placeholders); // String url = WordTemplateUtils.templateToPdf(tempFileName, "installation-notification-report.ftl", placeholders);
...@@ -616,7 +655,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -616,7 +655,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
public Map<String, Object> fullFillTemplateObj(List<Map<String, Object>> informationList, String businessType) { public Map<String, Object> fullFillTemplateObj(List<Map<String, Object>> informationList, String businessType) {
Map<String, Object> informObj = informationList.get(0); Map<String, Object> informObj = informationList.get(0);
String sequenceNbr = String.valueOf(informObj.get("sequenceNbr"));
String useCode = String.valueOf(informObj.get("installUnitCreditCode")); String useCode = String.valueOf(informObj.get("installUnitCreditCode"));
LambdaQueryWrapper<TzBaseUnitLicence> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TzBaseUnitLicence> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TzBaseUnitLicence::getUnitCode, useCode); wrapper.eq(TzBaseUnitLicence::getUnitCode, useCode);
...@@ -652,12 +691,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -652,12 +691,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 组装模板变量 // 组装模板变量
Map<String, Object> placeholders = new HashMap<>(); Map<String, Object> placeholders = new HashMap<>();
placeholders.put("doMain", TZSDOMAIN); placeholders.put("doMain", TZSDOMAIN);
placeholders.put("equList", getValue.apply("equList"));
placeholders.put("installUnitName", getValue.apply("installUnitName")); placeholders.put("installUnitName", getValue.apply("installUnitName"));
placeholders.put("informNumber", getValue.apply("informNumber")); placeholders.put("informNumber", getValue.apply("informNumber"));
placeholders.put("productName", getValue.apply("productName"));
placeholders.put("equipType", getValue.apply("equType"));
placeholders.put("equipCode", getValue.apply("equRegisterCode")); placeholders.put("equipCode", getValue.apply("equRegisterCode"));
placeholders.put("produceCode", getValue.apply("factoryNum")); // 出厂编号
placeholders.put("produceUnitName", getValue.apply("produceUnitName")); placeholders.put("produceUnitName", getValue.apply("produceUnitName"));
placeholders.put("produceLicenseNum", getValue.apply("produceLicenseNum")); placeholders.put("produceLicenseNum", getValue.apply("produceLicenseNum"));
placeholders.put("installUnitAddress", getValue.apply("installUnitAddress")); // 施工单位地址 placeholders.put("installUnitAddress", getValue.apply("installUnitAddress")); // 施工单位地址
...@@ -670,6 +707,21 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -670,6 +707,21 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
placeholders.put("useUnitLeaderName", getValue.apply("safetyManager")); placeholders.put("useUnitLeaderName", getValue.apply("safetyManager"));
placeholders.put("useUnitLeaderPhone", getValue.apply("safetyManagerPhone")); placeholders.put("useUnitLeaderPhone", getValue.apply("safetyManagerPhone"));
placeholders.put("useUnitLeaderAddress", getValue.apply("useUnitLeaderAddress")); placeholders.put("useUnitLeaderAddress", getValue.apply("useUnitLeaderAddress"));
if ("压力管道".equals(getValue.apply("equList"))) {
JgRegistrationHistory history = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>().eq(JgRegistrationHistory::getCurrentDocumentId, sequenceNbr));
JSONObject historyJson = JSON.parseObject(history.getChangeData());
List<Map<String, Object>> deviceList = (List<Map<String, Object>>) historyJson.get("deviceList");
List<Object> equipTypeList = deviceList.stream().limit(3).map(item -> item.get("pipelineNumber") + "(" + item.get("nominalDiameter") + "/" + item.get("wallThickness") + "/" + item.get("pipeLength") + ")").collect(Collectors.toList());
List<Object> factoryNumList = deviceList.stream().limit(3).map(item -> item.get("pipelineNumber")).collect(Collectors.toList());
placeholders.put("equipTypeList", equipTypeList);
placeholders.put("produceCodeList", factoryNumList);
placeholders.put("productName", historyJson.get("projectContraption"));
} else {
placeholders.put("equipType", getValue.apply("equType"));
placeholders.put("produceCode", getValue.apply("factoryNum"));
placeholders.put("productName", getValue.apply("productName"));
}
// 安装单位许可信息 // 安装单位许可信息
placeholders.put("installLicenseNoList", installLicenseNoList); placeholders.put("installLicenseNoList", installLicenseNoList);
...@@ -755,7 +807,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -755,7 +807,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
} }
private void repeatUsedEquipCheck(List<Map<String, Object>> equipList, String companyCode) { private void repeatUsedEquipCheck(List<Map<String, Object>> equipList, String companyCode) {
equipList.forEach(equipMap -> EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_INSTALL_NOTICE_KEY).equipRepeatUsedCheck(String.valueOf(equipMap.get("SEQUENCE_NBR")), companyCode)); equipList.forEach(equipMap -> EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_INSTALL_NOTICE_KEY).equipRepeatUsedCheck(!ValidationUtil.isEmpty(equipMap.get("SEQUENCE_NBR")) ? String.valueOf(equipMap.get("SEQUENCE_NBR")) : String.valueOf(equipMap.get("record")), companyCode));
} }
private void updateRedisBatch(List<JgInstallationNotice> jgInstallationNotices) { private void updateRedisBatch(List<JgInstallationNotice> jgInstallationNotices) {
...@@ -829,12 +881,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -829,12 +881,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
JgInstallationNotice dto = new JgInstallationNotice(); JgInstallationNotice dto = new JgInstallationNotice();
BeanUtils.copyProperties(model, dto); BeanUtils.copyProperties(model, dto);
// int i = deviceList.indexOf(obj); // int i = deviceList.indexOf(obj);
dto.setStartLatitudeLongitude(JSON.toJSONString(model.getStartLatitudeLongitude()));
dto.setEndLatitudeLongitude(JSON.toJSONString(model.getEndLatitudeLongitude()));
String applyNo = applyNoList.get(0); String applyNo = applyNoList.get(0);
dto.setApplyNo(applyNo); dto.setApplyNo(applyNo);
dto.setNoticeDate(new Date()); dto.setNoticeDate(new Date());
// 统计使用 // 统计使用
dto.setReceiveCompanyOrgCode(companyBo.getOrgCode()); dto.setReceiveCompanyOrgCode(companyBo.getOrgCode());
dto.setEquList(String.valueOf(deviceList.get(0).get("EQU_LIST"))); dto.setEquList(Optional.ofNullable(deviceList.get(0).get("EQU_LIST")).map(String::valueOf).orElse(String.valueOf(deviceList.get(0).get("equListName"))));
if (SUBMIT_TYPE_FLOW.equals(submitType)) { if (SUBMIT_TYPE_FLOW.equals(submitType)) {
dto.setNextExecuteIds(workflowResultList.get(0).getNextExecutorRoleIds()); dto.setNextExecuteIds(workflowResultList.get(0).getNextExecutorRoleIds());
dto.setNextExecuteUserIds(workflowResultList.get(0).getNextExecutorUserIds()); dto.setNextExecuteUserIds(workflowResultList.get(0).getNextExecutorUserIds());
...@@ -846,11 +900,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -846,11 +900,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
} }
dto.setInstallUnitName(reginParams.getCompany().getCompanyName()); dto.setInstallUnitName(reginParams.getCompany().getCompanyName());
dto.setInstallUnitCreditCode(reginParams.getCompany().getCompanyCode()); dto.setInstallUnitCreditCode(reginParams.getCompany().getCompanyCode());
// dto.setEquList((String.valueOf(obj.get("EQU_LIST"))));
dto.setEntrustingUnitName(dto.getUseUnitName()); dto.setEntrustingUnitName(dto.getUseUnitName());
dto.setCreateUserCompanyName(reginParams.getCompany().getCompanyName()); dto.setCreateUserCompanyName(reginParams.getCompany().getCompanyName());
// dto.setEquRegisterCode(String.valueOf(obj.get("EQU_CODE")));
// dto.setFactoryNum(String.valueOf(obj.get("FACTORY_NUM")));
if (!CollectionUtils.isEmpty(workflowResultList)) { if (!CollectionUtils.isEmpty(workflowResultList)) {
dto.setInstanceId(workflowResultList.get(0).getInstanceId()); dto.setInstanceId(workflowResultList.get(0).getInstanceId());
...@@ -860,13 +911,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -860,13 +911,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
} }
dto.setCreateUserName(reginParams.getUserModel().getRealName()); dto.setCreateUserName(reginParams.getUserModel().getRealName());
dto.setCreateUserId(reginParams.getUserModel().getUserId()); dto.setCreateUserId(reginParams.getUserModel().getUserId());
// dto.setEquAddress(obj.getOrDefault("ADDRESS", "").toString());
list.add(dto); list.add(dto);
deviceList.forEach(obj -> { deviceList.forEach(obj -> {
JgInstallationNoticeEq jgRelationEquip = new JgInstallationNoticeEq(); JgInstallationNoticeEq jgRelationEquip = new JgInstallationNoticeEq();
jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR"))); jgRelationEquip.setEquId(!ValidationUtil.isEmpty(obj.get("SEQUENCE_NBR")) ? String.valueOf(obj.get("SEQUENCE_NBR")) : String.valueOf(obj.get("record")));
jgRelationEquip.setEquCategoryCode(String.valueOf(obj.get("EQU_CATEGORY_CODE"))); jgRelationEquip.setEquCategoryCode(!ValidationUtil.isEmpty(obj.get("EQU_CATEGORY_CODE")) ? String.valueOf(obj.get("EQU_CATEGORY_CODE")) : String.valueOf(obj.get("equCategory")));
jgRelationEquip.setEquListCode(String.valueOf(obj.get("EQU_LIST_CODE"))); jgRelationEquip.setEquListCode(!ValidationUtil.isEmpty(obj.get("EQU_LIST_CODE")) ? String.valueOf(obj.get("EQU_LIST_CODE")) : String.valueOf(obj.get("equList")));
jgRelationEquip.setEquipTransferId(applyNo); jgRelationEquip.setEquipTransferId(applyNo);
equipList.add(jgRelationEquip); equipList.add(jgRelationEquip);
}); });
...@@ -1110,7 +1160,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1110,7 +1160,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
jgInstallationNotice.setNextTaskId(workflowResultDto.getNextTaskId()); jgInstallationNotice.setNextTaskId(workflowResultDto.getNextTaskId());
TaskV2Model taskV2Model = new TaskV2Model(); TaskV2Model taskV2Model = new TaskV2Model();
if ("0".equals(op)) { if ("0".equals(op)) {
if (StringUtils.isEmpty(workflowResultDto.getNextExecutorRoleIds())) { if (StringUtils.isEmpty(workflowResultDto.getNextExecutorRoleIds())) { // 审批通过
LambdaQueryWrapper<JgInstallationNoticeEq> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JgInstallationNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgInstallationNoticeEq::getEquipTransferId, dto.getSequenceNbr()); queryWrapper.eq(JgInstallationNoticeEq::getEquipTransferId, dto.getSequenceNbr());
List<JgInstallationNoticeEq> jgRelationEquips = jgInstallationNoticeEqMapper.selectList(queryWrapper); List<JgInstallationNoticeEq> jgRelationEquips = jgInstallationNoticeEqMapper.selectList(queryWrapper);
...@@ -1129,95 +1179,114 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1129,95 +1179,114 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
taskMap.put("model", taskMessageDto); taskMap.put("model", taskMessageDto);
TaskV2Model taskV2Model1 = commonService.updateTaskModel(taskMap); TaskV2Model taskV2Model1 = commonService.updateTaskModel(taskMap);
String finalYm = ym; String finalYm = ym;
jgRelationEquips.forEach(jgRelationEquip -> { // 工程装置id
LambdaQueryWrapper<OtherInfo> queryWrapper1 = new LambdaQueryWrapper<>(); String projectContraptionId = jgInstallationNotice.getProjectContraptionId();
queryWrapper1.eq(OtherInfo::getRecord, jgRelationEquip.getEquId()); if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(jgInstallationNotice.getEquCategoryCode())) {
OtherInfo tzsJgOtherInfo = tzsJgOtherInfoMapper.selectOne(queryWrapper1); // 处理工业管道审批后业务数据保存
IdxBizJgRegisterInfo idxBizJgRegisterInfo = getIdxBizJgRegisterInfo(jgRelationEquip); this.savePipelineData(jgInstallationNotice, jgRelationEquips, finalYm, dto, taskV2Model1);
String equCode = Optional.ofNullable(idxBizJgRegisterInfo.getEquDefine()) jgResumeInfoService.saveBatchResume(
.orElse(idxBizJgRegisterInfo.getEquCategory()); Lists.newArrayList(JgResumeInfoDto.builder()
String registrationCode = equCode + jgInstallationNotice.getReceiveOrgCreditCode() + finalYm; .applyNo(jgInstallationNotice.getApplyNo())
ResponseModel<String> responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode); .businessType(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getName())
String deviceRegistrationCode = responseModel.getResult(); .businessId(String.valueOf(jgInstallationNotice.getSequenceNbr()))
Map<String, Object> map = new HashMap<>(); .equId(String.valueOf(jgInstallationNotice.getProjectContraptionId()))
map.put("cityCode", jgInstallationNotice.getCity()); .approvalUnit(jgInstallationNotice.getReceiveOrgName())
map.put("countyCode", jgInstallationNotice.getCounty()); .approvalUnitCode(jgInstallationNotice.getReceiveOrgCreditCode())
map.put("equCategory", idxBizJgRegisterInfo.getEquCategory()); .status("正常")
map.put("isXiXian", jgInstallationNotice.getIsXixian() == null ? "null" : jgInstallationNotice.getIsXixian().equals("0") ? "null" : "1"); .routePath(taskV2Model1.getRoutePath())
Map<String, Object> mapCode; .build()));
ResponseModel<Map<String, Object>> code = tzsServiceFeignClient.createCode(map); } else {
mapCode = code.getResult(); jgRelationEquips.forEach(jgRelationEquip -> {
supervisoryCodeInfoMapper.updateStatusBySuperviseCode(mapCode.get("superviseCode").toString()); LambdaQueryWrapper<OtherInfo> queryWrapper1 = new LambdaQueryWrapper<>();
jgInstallationNotice.setHandleDate(new Date()); queryWrapper1.eq(OtherInfo::getRecord, jgRelationEquip.getEquId());
//jgInstallationNotice.setInformNumber(deviceRegistrationCode); OtherInfo tzsJgOtherInfo = tzsJgOtherInfoMapper.selectOne(queryWrapper1);
jgRelationEquip.setInformNumber(deviceRegistrationCode); IdxBizJgRegisterInfo idxBizJgRegisterInfo = getIdxBizJgRegisterInfo(jgRelationEquip);
jgInstallationNotice.setSupervisoryCode(mapCode.get("superviseCode").toString()); String equCode = Optional.ofNullable(idxBizJgRegisterInfo.getEquDefine())
jgInstallationNotice.setPromoter(""); .orElse(idxBizJgRegisterInfo.getEquCategory());
String registrationCode = equCode + jgInstallationNotice.getReceiveOrgCreditCode() + finalYm;
Map<String, Object> map1 = new HashMap<>(); ResponseModel<String> responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode);
// 更新其他业务表 String deviceRegistrationCode = responseModel.getResult();
if (!ValidationUtil.isEmpty(mapCode.get("code96333"))) { Map<String, Object> map = new HashMap<>();
tzsJgOtherInfo.setCode96333(mapCode.get("code96333").toString()); map.put("cityCode", jgInstallationNotice.getCity());
map1.put("CODE96333", tzsJgOtherInfo.getCode96333()); map.put("countyCode", jgInstallationNotice.getCounty());
} map.put("equCategory", idxBizJgRegisterInfo.getEquCategory());
tzsJgOtherInfo.setSupervisoryCode(mapCode.get("superviseCode").toString()); map.put("isXiXian", jgInstallationNotice.getIsXixian() == null ? "null" : jgInstallationNotice.getIsXixian().equals("0") ? "null" : "1");
tzsJgOtherInfoMapper.updateById(tzsJgOtherInfo); Map<String, Object> mapCode;
// 更新设备监管部门信息 ResponseModel<Map<String, Object>> code = tzsServiceFeignClient.createCode(map);
LambdaQueryWrapper<IdxBizJgSupervisionInfo> eq = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda() mapCode = code.getResult();
.eq(IdxBizJgSupervisionInfo::getRecord, jgRelationEquip.getEquId()); supervisoryCodeInfoMapper.updateStatusBySuperviseCode(mapCode.get("superviseCode").toString());
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = idxBizJgSupervisionInfoMapper.selectOne(eq); jgInstallationNotice.setHandleDate(new Date());
if (!ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchCode()) && !ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchName())) { //jgInstallationNotice.setInformNumber(deviceRegistrationCode);
HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(jgInstallationNotice.getOrgBranchCode()).getResult(); jgRelationEquip.setInformNumber(deviceRegistrationCode);
// 目前平台返回key为compnay(存在拼写错误) jgInstallationNotice.setSupervisoryCode(mapCode.get("superviseCode").toString());
CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class); jgInstallationNotice.setPromoter("");
idxBizJgSupervisionInfo.setOrgBranchCode(parentModel.getOrgCode());
idxBizJgSupervisionInfo.setOrgBranchName(parentModel.getCompanyName()); Map<String, Object> map1 = new HashMap<>();
idxBizJgSupervisionInfo.setCompanyOrgBranchCode(parentModel.getCompanyCode()); // 更新其他业务表
idxBizJgSupervisionInfoMapper.updateById(idxBizJgSupervisionInfo); if (!ValidationUtil.isEmpty(mapCode.get("code96333"))) {
} tzsJgOtherInfo.setCode96333(mapCode.get("code96333").toString());
map1.put("CODE96333", tzsJgOtherInfo.getCode96333());
// 生成设备代码及更新历史表的的设备代码字段 }
this.justGenerateEquCode(idxBizJgRegisterInfo, jgInstallationNotice.getReceiveOrgCreditCode(), jgInstallationNotice); tzsJgOtherInfo.setSupervisoryCode(mapCode.get("superviseCode").toString());
tzsJgRegistrationInfoMapper.updateById(idxBizJgRegisterInfo); tzsJgOtherInfoMapper.updateById(tzsJgOtherInfo);
// 更新es // 更新设备监管部门信息
updateEquipEs(jgInstallationNotice, tzsJgOtherInfo, idxBizJgRegisterInfo, idxBizJgSupervisionInfo, map1, dto); LambdaQueryWrapper<IdxBizJgSupervisionInfo> eq = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda()
// 记录施工信息表 .eq(IdxBizJgSupervisionInfo::getRecord, jgRelationEquip.getEquId());
createConstruction2Db(jgInstallationNotice, jgRelationEquip); IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = idxBizJgSupervisionInfoMapper.selectOne(eq);
if (!ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchCode()) && !ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchName())) {
// 更新使用信息 HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(jgInstallationNotice.getOrgBranchCode()).getResult();
updateJgUseInfo(jgInstallationNotice, jgRelationEquip); // 目前平台返回key为compnay(存在拼写错误)
// 生成证记录表主键 CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
long certChangeSeq = sequence.nextId(); idxBizJgSupervisionInfo.setOrgBranchCode(parentModel.getOrgCode());
// 生成jg证书变更记录 idxBizJgSupervisionInfo.setOrgBranchName(parentModel.getCompanyName());
genJgCertificateChangeRecord(jgInstallationNotice, certChangeSeq, registrationCode, idxBizJgRegisterInfo, taskV2Model1); idxBizJgSupervisionInfo.setCompanyOrgBranchCode(parentModel.getCompanyCode());
// 查询设备制造信息 idxBizJgSupervisionInfoMapper.updateById(idxBizJgSupervisionInfo);
LambdaQueryWrapper<IdxBizJgFactoryInfo> factoryInfoWrapper = new LambdaQueryWrapper<>(); }
factoryInfoWrapper.eq(IdxBizJgFactoryInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgFactoryInfo idxBizJgFactoryInfo = idxBizJgFactoryInfoService.getOne(factoryInfoWrapper); // 生成设备代码及更新历史表的的设备代码字段
this.justGenerateEquCode(idxBizJgRegisterInfo, jgInstallationNotice.getReceiveOrgCreditCode(), jgInstallationNotice);
// 生成tzs_jg_certificate_change_record_eq记录 tzsJgRegistrationInfoMapper.updateById(idxBizJgRegisterInfo);
JgCertificateChangeRecordEq changeRecordEq = new JgCertificateChangeRecordEq(); // 更新es
changeRecordEq.setChangeRecordId(String.valueOf(certChangeSeq));//登记证记录主键 updateEquipEs(jgInstallationNotice, tzsJgOtherInfo, idxBizJgRegisterInfo, idxBizJgSupervisionInfo, map1, dto);
changeRecordEq.setEquId(jgRelationEquip.getEquId());//设备主键 // 记录施工信息表
changeRecordEq.setProductCode(idxBizJgFactoryInfo.getFactoryNum()); createConstruction2Db(jgInstallationNotice, jgRelationEquip);
certificateChangeRecordEqService.save(changeRecordEq);
}); // 更新使用信息
updateJgUseInfo(jgInstallationNotice, jgRelationEquip);
// 生成证记录表主键
long certChangeSeq = sequence.nextId();
// 生成jg证书变更记录
genJgCertificateChangeRecord(jgInstallationNotice, certChangeSeq, registrationCode, idxBizJgRegisterInfo.getEquCategory(), taskV2Model1);
// 查询设备制造信息
LambdaQueryWrapper<IdxBizJgFactoryInfo> factoryInfoWrapper = new LambdaQueryWrapper<>();
factoryInfoWrapper.eq(IdxBizJgFactoryInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgFactoryInfo idxBizJgFactoryInfo = idxBizJgFactoryInfoService.getOne(factoryInfoWrapper);
// 生成tzs_jg_certificate_change_record_eq记录
JgCertificateChangeRecordEq changeRecordEq = new JgCertificateChangeRecordEq();
changeRecordEq.setChangeRecordId(String.valueOf(certChangeSeq));//登记证记录主键
changeRecordEq.setEquId(jgRelationEquip.getEquId());//设备主键
changeRecordEq.setProductCode(idxBizJgFactoryInfo.getFactoryNum());
certificateChangeRecordEqService.save(changeRecordEq);
});
jgResumeInfoService.saveBatchResume(
jgRelationEquips.stream()
.map(v -> JgResumeInfoDto.builder()
.applyNo(jgInstallationNotice.getApplyNo())
.businessType(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getName())
.businessId(String.valueOf(jgInstallationNotice.getSequenceNbr()))
.equId(String.valueOf(v.getEquId()))
.approvalUnit(jgInstallationNotice.getReceiveOrgName())
.approvalUnitCode(jgInstallationNotice.getReceiveOrgCreditCode())
.status("正常")
.routePath(taskV2Model1.getRoutePath())
.build())
.collect(Collectors.toList())
);
}
// 更新关联设备表 // 更新关联设备表
jgInstallationNoticeEqService.updateBatchById(jgRelationEquips); jgInstallationNoticeEqService.updateBatchById(jgRelationEquips);
jgResumeInfoService.saveBatchResume(
jgRelationEquips.stream()
.map(v -> JgResumeInfoDto.builder()
.applyNo(jgInstallationNotice.getApplyNo())
.businessType(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getName())
.businessId(String.valueOf(jgInstallationNotice.getSequenceNbr()))
.equId(String.valueOf(v.getEquId()))
.approvalUnit(jgInstallationNotice.getReceiveOrgName())
.approvalUnitCode(jgInstallationNotice.getReceiveOrgCreditCode())
.status("正常")
.routePath(taskV2Model1.getRoutePath())
.build())
.collect(Collectors.toList())
);
} else { } else {
jgInstallationNotice.setNextExecuteIds(workflowResultDto.getNextExecutorRoleIds()); jgInstallationNotice.setNextExecuteIds(workflowResultDto.getNextExecutorRoleIds());
jgInstallationNotice.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds()); jgInstallationNotice.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
...@@ -1303,7 +1372,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1303,7 +1372,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
return tzsJgRegistrationInfoMapper.selectOne(queryWrapper2); return tzsJgRegistrationInfoMapper.selectOne(queryWrapper2);
} }
private void genJgCertificateChangeRecord(JgInstallationNotice jgInstallationNotice, Long sequenceNbr, String registrationCode, IdxBizJgRegisterInfo idxBizJgRegisterInfo, TaskV2Model taskV2Model1) { private void genJgCertificateChangeRecord(JgInstallationNotice jgInstallationNotice, Long sequenceNbr, String registrationCode, String equCategory, TaskV2Model taskV2Model1) {
// 生成一条tzs_jg_certificate_change_record记录 // 生成一条tzs_jg_certificate_change_record记录
JgCertificateChangeRecord jgCertificateChangeRecord = new JgCertificateChangeRecord(); JgCertificateChangeRecord jgCertificateChangeRecord = new JgCertificateChangeRecord();
jgCertificateChangeRecord.setApplyNo(jgInstallationNotice.getApplyNo()); jgCertificateChangeRecord.setApplyNo(jgInstallationNotice.getApplyNo());
...@@ -1317,7 +1386,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1317,7 +1386,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
jgCertificateChangeRecord.setCertificateNo("");//登记证书唯一码 jgCertificateChangeRecord.setCertificateNo("");//登记证书唯一码
jgCertificateChangeRecord.setUseUnitCreditCode(jgInstallationNotice.getUseUnitCreditCode());//使用单位统一信用代码 jgCertificateChangeRecord.setUseUnitCreditCode(jgInstallationNotice.getUseUnitCreditCode());//使用单位统一信用代码
jgCertificateChangeRecord.setUseUnitName(jgInstallationNotice.getUseUnitName());//使用单位名称 jgCertificateChangeRecord.setUseUnitName(jgInstallationNotice.getUseUnitName());//使用单位名称
jgCertificateChangeRecord.setEquCategory(idxBizJgRegisterInfo.getEquCategory());//设备类别编码 jgCertificateChangeRecord.setEquCategory(equCategory);//设备类别编码
jgCertificateChangeRecord.setCreateDate(new Date()); jgCertificateChangeRecord.setCreateDate(new Date());
jgCertificateChangeRecord.setRoutePath(taskV2Model1.getRoutePath()); jgCertificateChangeRecord.setRoutePath(taskV2Model1.getRoutePath());
jgCertificateChangeRecord.setCreateUserId(jgInstallationNotice.getCreateUserId()); jgCertificateChangeRecord.setCreateUserId(jgInstallationNotice.getCreateUserId());
...@@ -1433,10 +1502,24 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1433,10 +1502,24 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
queryWrapper.eq(JgInstallationNoticeEq::getEquipTransferId, jgInstallationNotice.getSequenceNbr()); queryWrapper.eq(JgInstallationNoticeEq::getEquipTransferId, jgInstallationNotice.getSequenceNbr());
List<JgInstallationNoticeEq> jgInstallationNoticeEqs = jgInstallationNoticeEqMapper.selectList(queryWrapper); List<JgInstallationNoticeEq> jgInstallationNoticeEqs = jgInstallationNoticeEqMapper.selectList(queryWrapper);
List<String> ids = jgInstallationNoticeEqs.stream().map(item -> item.getEquId()).collect(Collectors.toList()); List<String> ids = jgInstallationNoticeEqs.stream().map(item -> item.getEquId()).collect(Collectors.toList());
// Map<String, Object> map = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(jgRelationEquip.getEquId()); List<Map<String, Object>> equipListMaps;
Iterable<ESEquipmentCategoryDto> equips = esEquipmentCategory.findAllById(ids); String equCategoryCode = jgInstallationNotice.getEquCategoryCode();
List<Map<String, Object>> equipListMaps = getEquipListMaps(equips);
Map<String, Object> installationInfo = BeanUtil.beanToMap(jgInstallationNotice, false, true); Map<String, Object> installationInfo = BeanUtil.beanToMap(jgInstallationNotice, false, true);
// 压力管道从工程装置表查询设备信息
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategoryCode)) {
String projectContraptionId = jgInstallationNotice.getProjectContraptionId();
IdxBizJgProjectContraption projectContraption = projectContraptionService.getById(projectContraptionId);
if (!ValidationUtil.isEmpty(projectContraption)) {
installationInfo.put("pipelineLength", projectContraption.getPipelineLength());
installationInfo.put("projectContraptionNo", projectContraption.getProjectContraptionNo());
installationInfo.put("projectContraption", projectContraption.getProjectContraption());
}
equipListMaps = jgInstallationNoticeMapper.getPipelineEquInfoByRecords(ids);
} else {
Iterable<ESEquipmentCategoryDto> equips = esEquipmentCategory.findAllById(ids);
equipListMaps = getEquipListMaps(equips);
}
installationInfo.put("deviceList", equipListMaps); installationInfo.put("deviceList", equipListMaps);
commonService.saveOrUpdateHistory(BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName(), new JSONObject(installationInfo), null, jgInstallationNotice.getSequenceNbr().toString()); commonService.saveOrUpdateHistory(BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName(), new JSONObject(installationInfo), null, jgInstallationNotice.getSequenceNbr().toString());
} }
...@@ -1592,6 +1675,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1592,6 +1675,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private void deleteConstructionInfo(JgInstallationNotice installationNotice) { private void deleteConstructionInfo(JgInstallationNotice installationNotice) {
constructionInfoMapper.delete(new LambdaQueryWrapper<IdxBizJgConstructionInfo>().eq(IdxBizJgConstructionInfo::getNoticeId, installationNotice.getSequenceNbr())); constructionInfoMapper.delete(new LambdaQueryWrapper<IdxBizJgConstructionInfo>().eq(IdxBizJgConstructionInfo::getNoticeId, installationNotice.getSequenceNbr()));
// 如果设备类型是工业管道,则还需删除工程装置施工信息
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(installationNotice.getEquCategoryCode())) {
LambdaQueryWrapper<IdxBizJgProjectConstruction> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IdxBizJgProjectConstruction::getNoticeId, installationNotice.getSequenceNbr());
projectConstructionMapper.delete(queryWrapper);
}
} }
private void clearUseInfoOfEquip(JgInstallationNotice installationNotice) { private void clearUseInfoOfEquip(JgInstallationNotice installationNotice) {
...@@ -1614,17 +1703,40 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1614,17 +1703,40 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 6.es 回退 // 6.es 回退
this.rollBackEsInfo(jgRelationEquip, idxBizJgRegisterInfo); this.rollBackEsInfo(jgRelationEquip, idxBizJgRegisterInfo);
}); });
// 如果是工业管道,则回滚工程装置表信息
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(installationNotice.getEquCategoryCode())) {
this.rollBackProjectContraptionInfo(installationNotice);
}
//删除设备履历信息 //删除设备履历信息
List<String> equipTransferIds = jgInstallationNoticeEqs.stream() Set<String> equipTransferIds = jgInstallationNoticeEqs.stream()
.map(JgInstallationNoticeEq::getEquipTransferId) .map(JgInstallationNoticeEq::getEquipTransferId)
.filter(Objects::nonNull) .filter(Objects::nonNull)
.collect(Collectors.toList()); .collect(Collectors.toSet());
if (!equipTransferIds.isEmpty()) { if (!equipTransferIds.isEmpty()) {
jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds); jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds);
} }
} }
/** /**
* 回滚工程装置表信息
* @param installationNotice installationNotice
*/
private void rollBackProjectContraptionInfo(JgInstallationNotice installationNotice) {
LambdaUpdateWrapper<IdxBizJgProjectContraption> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgProjectContraption::getSequenceNbr, installationNotice.getProjectContraptionId()); // 设置更新条件
// 强制更新字段为 NULL
updateWrapper.set(IdxBizJgProjectContraption::getUseUnitCreditCode, null);
updateWrapper.set(IdxBizJgProjectContraption::getUseUnitName, null);
updateWrapper.set(IdxBizJgProjectContraption::getOrgCode, null);
updateWrapper.set(IdxBizJgProjectContraption::getOrgName, null);
updateWrapper.set(IdxBizJgProjectContraption::getUseRegistrationCode, null);
updateWrapper.set(IdxBizJgProjectContraption::getSupervisoryCode, null);
updateWrapper.set(IdxBizJgProjectContraption::getEquCode, null);
updateWrapper.set(IdxBizJgProjectContraption::getIsIntoManagement, false);
projectContraptionMapper.update(null, updateWrapper);
}
/**
* 释放96333码为未使用状态 * 释放96333码为未使用状态
* @param jgRelationEquip jgRelationEquip * @param jgRelationEquip jgRelationEquip
*/ */
...@@ -1708,58 +1820,45 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1708,58 +1820,45 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
useInfoService.update(updateWrapper); useInfoService.update(updateWrapper);
} }
@Transactional
@Override
public Boolean historyDataRepair() {
List<JgInstallationNotice> list = this.lambdaQuery().list();
ArrayList<JgInstallationNoticeEq> jgInstallationNoticeEqs = new ArrayList<>();
ArrayList<JgRegistrationHistory> jgRegistrationHistories = new ArrayList<>();
list.forEach(item -> {
// 设备信息
List<JgInstallationNoticeEq> equList = jgInstallationNoticeEqService.lambdaQuery().eq(JgInstallationNoticeEq::getEquipTransferId, item.getSequenceNbr()).list();
JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryService.lambdaQuery()
.eq(JgRegistrationHistory::getCurrentDocumentId, item.getSequenceNbr())
.eq(JgRegistrationHistory::getIsDelete, false)
.one();
if (!ObjectUtils.isEmpty(jgRegistrationHistory) && !ObjectUtils.isEmpty(jgRegistrationHistory.getChangeData())) {
List<String> ids = equList.stream().map(JgInstallationNoticeEq::getEquId).collect(Collectors.toList());
Iterable<ESEquipmentCategoryDto> equips = esEquipmentCategory.findAllById(ids);
List<Map<String, Object>> equipListMaps = getEquipListMaps(equips);
JSONObject object = JSONObject.parseObject(jgRegistrationHistory.getChangeData());
object.put("deviceList", equipListMaps);
jgRegistrationHistory.setChangeData(JSONObject.toJSONString(object));
jgRegistrationHistories.add(jgRegistrationHistory);
}
equList.forEach(equ -> {
if (!ObjectUtils.isEmpty(item.getInformNumber())) {
equ.setInformNumber(item.getInformNumber());
}
IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoService.lambdaQuery().eq(IdxBizJgRegisterInfo::getRecord, equ.getEquId()).one();
if (!ObjectUtils.isEmpty(registerInfo) && !ObjectUtils.isEmpty(registerInfo.getEquList()) && !ObjectUtils.isEmpty(registerInfo.getEquCategory())) {
equ.setEquListCode(registerInfo.getEquList());
equ.setEquCategoryCode(registerInfo.getEquCategory());
if (ObjectUtils.isEmpty(item.getEquListCode()) || ObjectUtils.isEmpty(item.getEquCategoryCode())) {
item.setEquListCode(registerInfo.getEquList());
item.setEquCategoryCode(registerInfo.getEquCategory());
if ("8300".equals(item.getEquCategoryCode())) {
LambdaQueryWrapper<EquipTechParamPipeline> lambda = new QueryWrapper<EquipTechParamPipeline>().lambda();
lambda.eq(EquipTechParamPipeline::getRecord, equ.getEquId());
EquipTechParamPipeline equipTechParamPipeline = equipTechParamPipelineMapper.selectOne(lambda);
if (!ObjectUtils.isEmpty(equipTechParamPipeline) && !ObjectUtils.isEmpty(equipTechParamPipeline.getDeviceName())) {
item.setProjectContraption(equipTechParamPipeline.getDeviceName());
}
}
}
}
jgInstallationNoticeEqs.add(equ);
});
/**
* 查询工程装置下的所有未做安装告知、不在安装告知流程、安装告知作废的设备
*
* @param projectContraptionSeq 工程装置seq
* @return 设备列表
*/
@Override
public Object getDeviceListByProjectContraption(String projectContraptionSeq) {
IdxBizJgProjectContraption projectContraption = projectContraptionService.getById(projectContraptionSeq);
if (ValidationUtil.isEmpty(projectContraption)) {
return null;
}
List<Map<String, Object>> deviceList = projectContraptionService.getBaseMapper().selectEquipList(projectContraptionSeq);
deviceList.forEach(device -> {
String deviceLevel = String.valueOf(device.get("deviceLevel"));
device.put("deviceLevel", dataDictionaryMapper.selectById(deviceLevel).getName());
device.put("sequenceNbr", projectContraptionSeq);
device.put("equListName", projectContraption.getEquListName());
}); });
// 修改历史表数据 JSONObject result = new JSONObject();
jgRegistrationHistoryService.updateBatchById(jgRegistrationHistories); result.fluentPut("deviceList", deviceList)
this.updateBatchById(list); .fluentPut("projectContraption", projectContraption.getProjectContraption())
jgInstallationNoticeEqService.updateBatchById(jgInstallationNoticeEqs); .fluentPut("projectContraptionNo", projectContraption.getProjectContraptionNo())
return Boolean.TRUE; .fluentPut("pipelineLength", projectContraption.getPipelineLength())
.fluentPut("projectContraptionId", projectContraptionSeq);
if (!ValidationUtil.isEmpty(projectContraption.getCity())) {
result.fluentPut("city", projectContraption.getCity() + "_" + projectContraption.getCityName());
}
if (!ValidationUtil.isEmpty(projectContraption.getCounty())) {
result.fluentPut("county", projectContraption.getCounty() + "_" + projectContraption.getCountyName());
}
if (!ValidationUtil.isEmpty(projectContraption.getStreet())) {
result.fluentPut("factoryUseSiteStreet", projectContraption.getStreet() + "_" + projectContraption.getStreetName());
}
if (!ValidationUtil.isEmpty(projectContraption.getAddress())) {
result.fluentPut("address", projectContraption.getAddress());
}
return result;
} }
@Override @Override
...@@ -1785,4 +1884,167 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1785,4 +1884,167 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
noticeStatusOpt.ifPresent(status -> notice.setNoticeStatus(FlowStatusEnum.getNameByType(Long.valueOf(status)))); noticeStatusOpt.ifPresent(status -> notice.setNoticeStatus(FlowStatusEnum.getNameByType(Long.valueOf(status))));
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
private void savePipelineData(JgInstallationNotice jgInstallationNotice, List<JgInstallationNoticeEq> noticeRelationEquips, String finalYm, JgInstallationNoticeDto dto, TaskV2Model taskV2Model1) {
IdxBizJgProjectContraption projectContraption = projectContraptionService.getById(jgInstallationNotice.getProjectContraptionId());
// 生成监管码
Map<String, Object> createCodeMap = new HashMap<>();
createCodeMap.put("cityCode", jgInstallationNotice.getCity());
createCodeMap.put("countyCode", jgInstallationNotice.getCounty());
createCodeMap.put("equCategory", jgInstallationNotice.getEquCategoryCode());
createCodeMap.put("isXiXian", jgInstallationNotice.getIsXixian() == null ? "null" : jgInstallationNotice.getIsXixian().equals("0") ? "null" : "1");
ResponseModel<Map<String, Object>> resultModel = tzsServiceFeignClient.createCode(createCodeMap);
String superviseCode = resultModel.getResult().get("superviseCode").toString();
supervisoryCodeInfoMapper.updateStatusBySuperviseCode(superviseCode);
// 生成告知单编号
String noticeCode = Optional.ofNullable(projectContraption.getEquDefine())
.orElse(projectContraption.getEquCategory());
String registrationCode = noticeCode + jgInstallationNotice.getReceiveOrgCreditCode() + finalYm;
ResponseModel<String> responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode);
String deviceRegistrationCode = responseModel.getResult();
// 更新所属监管部门信息
String orgBranchCode = "";
String orgBranchName = "";
String companyCode = "";
if (!ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchCode()) && !ObjectUtils.isEmpty(jgInstallationNotice.getOrgBranchName())) {
HashMap<String, Object> parentMessage = (HashMap<String, Object>) Privilege.companyClient.queryByOrgcode(jgInstallationNotice.getOrgBranchCode()).getResult();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel parentModel = JSON.parseObject(JSON.toJSONString(parentMessage.get("compnay")), CompanyModel.class);
orgBranchCode = parentModel.getOrgCode();
orgBranchName = parentModel.getCompanyName();
companyCode = parentModel.getCompanyCode();
}
// 生成设备代码
String equCode = generateEquCode(projectContraption.getEquList(), projectContraption.getEquCategory(), projectContraption.getEquDefine(), new Date(), jgInstallationNotice.getReceiveOrgCreditCode());
// 更新工程装置信息
projectContraption.setEquCode(equCode);
projectContraption.setSupervisoryCode(superviseCode);
projectContraption.setOrgCode(orgBranchCode);
projectContraption.setOrgName(orgBranchName);
projectContraption.setIsIntoManagement(true);
projectContraption.setUscUnitCreditCode(jgInstallationNotice.getInstallUnitCreditCode());
projectContraption.setUscUnitName(jgInstallationNotice.getInstallUnitName());
projectContraption.setUseUnitName(jgInstallationNotice.getUseUnitName());
projectContraption.setUseUnitCreditCode(jgInstallationNotice.getUseUnitCreditCode());
projectContraption.setStartLatitudeLongitude(jgInstallationNotice.getStartLatitudeLongitude());
projectContraption.setEndLatitudeLongitude(jgInstallationNotice.getEndLatitudeLongitude());
projectContraption.setProvinceName(jgInstallationNotice.getProvinceName());
projectContraption.setCityName(jgInstallationNotice.getCityName());
projectContraption.setCountyName(jgInstallationNotice.getCountyName());
projectContraption.setStreetName(jgInstallationNotice.getStreetName());
projectContraption.setProvince(jgInstallationNotice.getProvince());
projectContraption.setCity(jgInstallationNotice.getCity());
projectContraption.setCounty(jgInstallationNotice.getCounty());
projectContraption.setStreet(jgInstallationNotice.getFactoryUseSiteStreet());
projectContraption.setAddress(jgInstallationNotice.getAddress());
projectContraptionService.updateById(projectContraption);
// 更新安装告知业务表信息
jgInstallationNotice.setHandleDate(new Date());
jgInstallationNotice.setSupervisoryCode(superviseCode);
jgInstallationNotice.setPromoter("");
// 生成证记录表主键
long certChangeSeq = sequence.nextId();
// 生成jg证书变更记录
genJgCertificateChangeRecord(jgInstallationNotice, certChangeSeq, registrationCode, projectContraption.getEquCategory(), taskV2Model1);
// 生成tzs_jg_certificate_change_record_eq记录
JgCertificateChangeRecordEq changeRecordEq = new JgCertificateChangeRecordEq();
changeRecordEq.setChangeRecordId(String.valueOf(certChangeSeq));//登记证记录主键
changeRecordEq.setEquId(String.valueOf(projectContraption.getSequenceNbr()));//工程装置主键
certificateChangeRecordEqService.save(changeRecordEq);
// 更新工程装置下设备信息
String finalOrgBranchCode = orgBranchCode;
String finalOrgBranchName = orgBranchName;
String finalCompanyCode = companyCode;
noticeRelationEquips.forEach(installationNoticeEq -> {
LambdaQueryWrapper<OtherInfo> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(OtherInfo::getRecord, installationNoticeEq.getEquId());
OtherInfo tzsJgOtherInfo = tzsJgOtherInfoMapper.selectOne(queryWrapper1);
IdxBizJgRegisterInfo idxBizJgRegisterInfo = getIdxBizJgRegisterInfo(installationNoticeEq);
installationNoticeEq.setInformNumber(deviceRegistrationCode);
// 更新其他业务表
tzsJgOtherInfo.setSupervisoryCode(superviseCode); // 工程装置下的管道设备共享监管码
tzsJgOtherInfoMapper.updateById(tzsJgOtherInfo);
// 更新设备监管部门信息
LambdaQueryWrapper<IdxBizJgSupervisionInfo> eq = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda()
.eq(IdxBizJgSupervisionInfo::getRecord, installationNoticeEq.getEquId());
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = idxBizJgSupervisionInfoMapper.selectOne(eq);
idxBizJgSupervisionInfo.setOrgBranchCode(finalOrgBranchCode);
idxBizJgSupervisionInfo.setOrgBranchName(finalOrgBranchName);
idxBizJgSupervisionInfo.setCompanyOrgBranchCode(finalCompanyCode);
idxBizJgSupervisionInfoMapper.updateById(idxBizJgSupervisionInfo);
// 和工程装置共享设备代码
idxBizJgRegisterInfo.setEquCode(equCode);
tzsJgRegistrationInfoMapper.updateById(idxBizJgRegisterInfo);
// 更新es
updateEquipEs(jgInstallationNotice, tzsJgOtherInfo, idxBizJgRegisterInfo, idxBizJgSupervisionInfo, new HashMap<>(), dto);
// 记录管道施工信息表
createConstruction2Db(jgInstallationNotice, installationNoticeEq);
// 更新使用信息
updateJgUseInfo(jgInstallationNotice, installationNoticeEq);
});
// 记录工程装置施工信息表
createProjectConstruction2Db(jgInstallationNotice, projectContraption, deviceRegistrationCode, noticeRelationEquips);
}
private String generateEquCode(String equListCode, String equCategoryCode, String equDefineCode, Date now, String receiveCompanyCode) {
CodeGenerateDto codeGenerateDto = new CodeGenerateDto();
codeGenerateDto.setEquList(equListCode);
codeGenerateDto.setEquCategory(equCategoryCode);
codeGenerateDto.setEquDefine(equDefineCode);
codeGenerateDto.setProduceDate(now);
codeGenerateDto.setReceiveCompanyCode(receiveCompanyCode);
return codeUtil.generateEquipmentCode(codeGenerateDto);
}
private void createProjectConstruction2Db(JgInstallationNotice jgInstallationNotice, IdxBizJgProjectContraption projectContraption, String deviceRegistrationCode, List<JgInstallationNoticeEq> noticeRelationEquips) {
IdxBizJgProjectConstruction idxBizJgProjectConstruction = new IdxBizJgProjectConstruction();
idxBizJgProjectConstruction.setUscUnitCreditCode(jgInstallationNotice.getInstallUnitCreditCode());
idxBizJgProjectConstruction.setUscUnitName(jgInstallationNotice.getInstallUnitName());
idxBizJgProjectConstruction.setUscDate(jgInstallationNotice.getInstallStartDate());
idxBizJgProjectConstruction.setRecord(String.valueOf(projectContraption.getSequenceNbr()));
idxBizJgProjectConstruction.setSequenceCode(String.valueOf(projectContraption.getSequenceNbr()));
idxBizJgProjectConstruction.setNoticeId(String.valueOf(jgInstallationNotice.getSequenceNbr()));
idxBizJgProjectConstruction.setInformCode(deviceRegistrationCode);
idxBizJgProjectConstruction.setConstructionLeaderId(jgInstallationNotice.getInstallLeaderId());
idxBizJgProjectConstruction.setConstructionLeaderName(jgInstallationNotice.getInstallLeaderName());
idxBizJgProjectConstruction.setConstructionLeaderPhone(jgInstallationNotice.getInstallLeaderPhone());
idxBizJgProjectConstruction.setAddress(jgInstallationNotice.getAddress());
idxBizJgProjectConstruction.setProvinceName(jgInstallationNotice.getProvinceName());
idxBizJgProjectConstruction.setCityName(jgInstallationNotice.getCityName());
idxBizJgProjectConstruction.setCountyName(jgInstallationNotice.getCountyName());
idxBizJgProjectConstruction.setStreetName(jgInstallationNotice.getStreetName());
idxBizJgProjectConstruction.setIsXixian(jgInstallationNotice.getIsXixian());
idxBizJgProjectConstruction.setProjectContraptionId(String.valueOf(projectContraption.getSequenceNbr()));
idxBizJgProjectConstruction.setEquipRecords(noticeRelationEquips.stream().map(JgInstallationNoticeEq::getEquId).collect(Collectors.joining(",")));
idxBizJgProjectConstruction.setConstructionContractAttachment(jgInstallationNotice.getInstallContractAttachment());
idxBizJgProjectConstruction.setProxyStatementAttachment(jgInstallationNotice.getProxyStatementAttachment());
idxBizJgProjectConstruction.setConstructionOtherAccessories(jgInstallationNotice.getOtherAccessories());
idxBizJgProjectConstruction.setRecDate(new Date());
idxBizJgProjectConstruction.setRecUserId(RequestContext.getExeUserId());
// 获取施工类型id
LambdaQueryWrapper<DataDictionary> lambda = new LambdaQueryWrapper<>();
lambda.eq(DataDictionary::getType, CONSTRUCTION_TYPE);
lambda.eq(DataDictionary::getName, CONSTRUCTION_TYPE_NAME);
List<DataDictionary> dataDictionaries = dataDictionaryMapper.selectList(lambda);
if (!CollectionUtils.isEmpty(dataDictionaries)) {
idxBizJgProjectConstruction.setConstructionType(String.valueOf(dataDictionaries.get(0).getSequenceNbr()));
}
projectConstructionMapper.insert(idxBizJgProjectConstruction);
}
} }
\ No newline at end of file
...@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContract; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContract;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContractEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContractEq;
...@@ -31,7 +30,6 @@ import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher; ...@@ -31,7 +30,6 @@ import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService; import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis; import com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
...@@ -42,7 +40,6 @@ import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO; ...@@ -42,7 +40,6 @@ import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO; import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import io.seata.spring.annotation.GlobalTransactional; import io.seata.spring.annotation.GlobalTransactional;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.elasticsearch.client.RestHighLevelClient;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -894,9 +891,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -894,9 +891,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
// 删除在审批完成时写入的设备维保记录 // 删除在审批完成时写入的设备维保记录
idxBizJgMaintenanceRecordInfoService.remove(new LambdaQueryWrapper<IdxBizJgMaintenanceRecordInfo>().eq(IdxBizJgMaintenanceRecordInfo::getSourceId, maintenanceContract.getSequenceNbr())); idxBizJgMaintenanceRecordInfoService.remove(new LambdaQueryWrapper<IdxBizJgMaintenanceRecordInfo>().eq(IdxBizJgMaintenanceRecordInfo::getSourceId, maintenanceContract.getSequenceNbr()));
// 删除批量业务ID信息 // 删除批量业务ID信息
List<String> equipTransferIds = Collections.singletonList(maintenanceContract.getSequenceNbr().toString()); Set<String> equipTransferIds = Collections.singleton(maintenanceContract.getSequenceNbr().toString());
jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds); jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds);
jgResumeInfoService.deleteBatchByBusinessId(equipmentLists.stream().filter(t -> t.getEquipTransferId() != null).map(JgMaintenanceContractEq::getEquId).collect(Collectors.toList())); jgResumeInfoService.deleteBatchByBusinessId(equipmentLists.stream().filter(t -> t.getEquipTransferId() != null).map(JgMaintenanceContractEq::getEquId).collect(Collectors.toSet()));
} }
} }
......
...@@ -9,8 +9,10 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgResumeInfoService; ...@@ -9,8 +9,10 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgResumeInfoService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -58,7 +60,7 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto, JgResu ...@@ -58,7 +60,7 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto, JgResu
* 根据业务id进行删除 * 根据业务id进行删除
* @param idList 业务id * @param idList 业务id
*/ */
public void deleteBatchByBusinessId(List<String> idList) { public void deleteBatchByBusinessId(Set<String> idList) {
this.baseMapper.deleteBatchByBusinessId(idList); this.baseMapper.deleteBatchByBusinessId(idList);
} }
} }
\ No newline at end of file
...@@ -44,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -44,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -61,6 +62,7 @@ import java.text.SimpleDateFormat; ...@@ -61,6 +62,7 @@ import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.alibaba.fastjson.JSON.parseArray; import static com.alibaba.fastjson.JSON.parseArray;
...@@ -765,8 +767,30 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr ...@@ -765,8 +767,30 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
} }
public void initUseRegistrationCodeIntoRedis() { public void initUseRegistrationCodeIntoRedis() {
jgUseRegistrationManageMapper.initUseRegistrationCodeIntoRedis(String.valueOf(LocalDate.now().getYear() % 100)) // 获取当前年份的两位数
.forEach(resultMap -> redisTemplate.opsForValue().set(resultMap.get("prefix"), resultMap.get("code"))); String currentYearSuffix = String.valueOf(LocalDate.now().getYear() % 100);
Date endOfYear = com.yeejoin.amos.boot.module.ymt.api.common.DateUtils.calculateEndOfYear(new Date());
// 从数据库中加载数据并批量设置到 Redis
jgUseRegistrationManageMapper.initUseRegistrationCodeIntoRedis(currentYearSuffix)
.forEach(resultMap ->
Optional.ofNullable(resultMap)
.ifPresent(map -> setValueWithExpiration(map.get("prefix"), map.get("code"), endOfYear))
);
}
/**
* redis设置key
*
* @param key key
* @param value value
* @param expirationDate 过期时间
*/
public void setValueWithExpiration(String key, String value, Date expirationDate) {
ValueOperations<String, String> valueOps = redisTemplate.opsForValue();
valueOps.set(key, value);
long expirationTimeInSeconds = expirationDate.getTime() - System.currentTimeMillis();
redisTemplate.expire(key, expirationTimeInSeconds, TimeUnit.MILLISECONDS);
} }
public Object handleErrorDeviceCode(String applyNo) { public Object handleErrorDeviceCode(String applyNo) {
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapBuilder; import cn.hutool.core.map.MapBuilder;
import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -10,10 +11,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -10,10 +11,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity; import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
...@@ -101,6 +104,7 @@ import java.util.zip.ZipEntry; ...@@ -101,6 +104,7 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toSet;
/** /**
* 服务实现类 * 服务实现类
...@@ -114,7 +118,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -114,7 +118,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private static final String DEFINITION_KEY = "useRegistration"; private static final String DEFINITION_KEY = "useRegistration";
private final List<String> NOT_FLOWING_STATE = Arrays.asList("使用单位待提交", "一级受理已驳回", "使用单位已撤回", "已作废"); private final List<String> NOT_FLOWING_STATE = Arrays.asList("使用单位待提交", "一级受理已驳回", "使用单位已撤回", "已作废");
private static final String CITY = "CITY";
private static final String COUNTY = "COUNTY";
private static final String REGION = "REGION";
private static final String STREET = "STREET";
private ApplicationContext applicationContext; private ApplicationContext applicationContext;
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
...@@ -184,8 +191,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -184,8 +191,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired @Autowired
private JgUseRegistrationEqServiceImpl jgUseRegistrationEqService; private JgUseRegistrationEqServiceImpl jgUseRegistrationEqService;
@Autowired @Autowired
private IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService;
@Autowired
private JgUseRegistrationMapper jgUseRegistrationMapper; private JgUseRegistrationMapper jgUseRegistrationMapper;
@Autowired @Autowired
private ESEquipmentCategory esEquipmentCategory; private ESEquipmentCategory esEquipmentCategory;
...@@ -202,14 +207,27 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -202,14 +207,27 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired @Autowired
private IdxBizJgConstructionInfoServiceImpl idxBizJgConstructionInfoService; private IdxBizJgConstructionInfoServiceImpl idxBizJgConstructionInfoService;
@Autowired @Autowired
private JgInstallationNoticeServiceImpl jgInstallationNoticeService;
@Autowired
private IdxBizJgConstructionInfoMapper constructionInfoMapper; private IdxBizJgConstructionInfoMapper constructionInfoMapper;
@Autowired @Autowired
private SuperviseInfoMapper superviseInfoMapper; private SuperviseInfoMapper superviseInfoMapper;
@Autowired @Autowired
SupervisoryCodeInfoMapper supervisoryCodeInfoMapper; SupervisoryCodeInfoMapper supervisoryCodeInfoMapper;
@Autowired
IdxBizJgProjectContraptionServiceImpl jgProjectContraptionService;
@Autowired
IdxBizJgProjectConstructionMapper idxBizJgProjectConstructionMapper;
@Autowired
IdxBizJgProjectInspectionMapper projectInspectionMapper;
@Autowired
private DataDictionaryServiceImpl dataDictionaryServiceImpl;
@Autowired
private IdxBizJgProjectContraptionMapper idxBizJgProjectContraptionMapper;
@Autowired
private RegistrationInfoMapper registrationInfoMapper;
/** /**
...@@ -348,7 +366,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -348,7 +366,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 更新使用信息 // 更新使用信息
useInfoMapper.update(useInfo, lambda); useInfoMapper.update(useInfo, lambda);
// 更新检验检测信息 // 更新检验检测信息
this.updateOrCreateInspectionDetection(map); this.updateOrCreateInspectionDetection(map, jgUseRegistration, registerInfo);
// 更新注册登记信息表 // 更新注册登记信息表
LambdaUpdateWrapper<IdxBizJgRegisterInfo> IdxBizJgRegLambda = new UpdateWrapper<IdxBizJgRegisterInfo>().lambda(); LambdaUpdateWrapper<IdxBizJgRegisterInfo> IdxBizJgRegLambda = new UpdateWrapper<IdxBizJgRegisterInfo>().lambda();
IdxBizJgRegLambda.eq(IdxBizJgRegisterInfo::getRecord, map.get("equipId")) IdxBizJgRegLambda.eq(IdxBizJgRegisterInfo::getRecord, map.get("equipId"))
...@@ -375,21 +393,50 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -375,21 +393,50 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
createCode(map, jgUseRegistration, registerInfo, useInfo, otherInfo); createCode(map, jgUseRegistration, registerInfo, useInfo, otherInfo);
} }
private void updateOrCreateInspectionDetection(JSONObject map) { private void updateOrCreateInspectionDetection(JSONObject map, JgUseRegistration jgUseRegistration, IdxBizJgRegisterInfo registerInfo) {
InspectionDetectionInfo inspectionDetectionInfo = new InspectionDetectionInfo(); InspectionDetectionInfo inspectionDetectionInfo = new InspectionDetectionInfo();
BeanUtil.copyProperties(map, inspectionDetectionInfo); BeanUtil.copyProperties(map, inspectionDetectionInfo);
if (map.get("jySeq") != null) { String record = map.get("equipId").toString();
// 更新逻辑
InspectionDetectionInfo inspectionDetectionInfoDb = inspectionDetectionInfoMapper.selectById(map.get("jySeq").toString()); if("unit".equals(jgUseRegistration.getManageType()) && registerInfo.getEquList().equals(EquipmentClassifityEnum.YLGD.getCode())){
Bean.copyExistPropertis(inspectionDetectionInfo, inspectionDetectionInfoDb); // 压力管道逻辑,根据设备record + 检验报告编号判定唯一一条检验流水,有进行更新,无则进行插入
inspectionDetectionInfoMapper.updateById(inspectionDetectionInfo); saveEquipOfPieLineInspectData(record, inspectionDetectionInfo);
} else { } else {
// 插入逻辑 // 其他逻辑
if (inspectionDetectionInfo.getInspectType() != null && inspectionDetectionInfo.getInspectConclusion() != null) { if (map.get("jySeq") != null) {
inspectionDetectionInfo.setRecord(map.get("equipId").toString()); // 更新逻辑
inspectionDetectionInfo.setRecDate(new Date()); InspectionDetectionInfo inspectionDetectionInfoDb = inspectionDetectionInfoMapper.selectById(map.get("jySeq").toString());
inspectionDetectionInfo.setSequenceNbr(sequence.nextId() + ""); Bean.copyExistPropertis(inspectionDetectionInfo, inspectionDetectionInfoDb);
inspectionDetectionInfoMapper.insert(inspectionDetectionInfo); inspectionDetectionInfoMapper.updateById(inspectionDetectionInfo);
} else {
// 插入逻辑
if (inspectionDetectionInfo.getInspectType() != null && inspectionDetectionInfo.getInspectConclusion() != null) {
inspectionDetectionInfo.setRecord(record);
inspectionDetectionInfo.setRecDate(new Date());
inspectionDetectionInfo.setSequenceNbr(sequence.nextId() + "");
inspectionDetectionInfoMapper.insert(inspectionDetectionInfo);
}
}
}
}
private void saveEquipOfPieLineInspectData(String record, InspectionDetectionInfo inspectionDetectionInfo) {
// 检验机构 + 设备+ 检验报告编号时 , 是唯一的为了防止老数据有重复的,程序健壮,故使用list进行处理
LambdaQueryWrapper<InspectionDetectionInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(AbstractEquipBaseEntity::getRecord, record)
.eq(!StringUtils.isEmpty(inspectionDetectionInfo.getInspectReportNo()), InspectionDetectionInfo::getInspectReportNo, inspectionDetectionInfo.getInspectReportNo())
.eq(InspectionDetectionInfo::getInspectOrgCode, inspectionDetectionInfo.getInspectOrgCode());
List<InspectionDetectionInfo> inspectionDetectionInfos = inspectionDetectionInfoMapper.selectList(wrapper);
if(inspectionDetectionInfos.isEmpty()){
inspectionDetectionInfo.setRecord(record);
inspectionDetectionInfo.setRecDate(new Date());
inspectionDetectionInfo.setSequenceNbr(sequence.nextId() + "");
inspectionDetectionInfoMapper.insert(inspectionDetectionInfo);
} else {
for (InspectionDetectionInfo inspectionDetectionInfo1 : inspectionDetectionInfos) {
Bean.copyExistPropertis(inspectionDetectionInfo, inspectionDetectionInfo1);
inspectionDetectionInfo1.setRecDate(new Date());
inspectionDetectionInfoMapper.updateById(inspectionDetectionInfo1);
} }
} }
} }
...@@ -615,6 +662,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -615,6 +662,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
TaskMessageDto taskMessageDto = new TaskMessageDto(); TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtil.copyProperties(jgUseRegistration, taskMessageDto); BeanUtil.copyProperties(jgUseRegistration, taskMessageDto);
taskMessageDto.setEquipId(String.valueOf(map.get("equipId"))); taskMessageDto.setEquipId(String.valueOf(map.get("equipId")));
taskMessageDto.setEQU_LIST_CODE(String.valueOf(map.get("EQU_LIST_CODE")));
// 数据参数 // 数据参数
dto.setModel(taskMessageDto); dto.setModel(taskMessageDto);
// 摘要 // 摘要
...@@ -697,7 +745,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -697,7 +745,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
try { try {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())) + "", ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())) + "", ReginParams.class);
CompanyBo company = reginParams.getCompany(); CompanyBo company = reginParams.getCompany();
String equListCode = String.valueOf(map.get("EQU_LIST_CODE"));
// 压力管道逻辑
// EquipmentClassifityEnum.YLGD.getCode().equals(equListCode)
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) map.get("equipmentLists"); List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) map.get("equipmentLists");
if (CollectionUtils.isEmpty(equipmentLists)) { if (CollectionUtils.isEmpty(equipmentLists)) {
throw new BadRequest("请选择设备信息!"); throw new BadRequest("请选择设备信息!");
...@@ -718,12 +768,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -718,12 +768,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 提交时进行校验设备是否在流程中使用(并发及同时打开多个相同的页面时才会出现此种情况) // 提交时进行校验设备是否在流程中使用(并发及同时打开多个相同的页面时才会出现此种情况)
checkForRepeatUsedEquip(map, equipmentLists, company); checkForRepeatUsedEquip(map, equipmentLists, company);
List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList = idxBizJgInspectionDetectionInfoService.checkInspectionInfo(
equipmentLists.stream()
.map(v -> (String) v.get("record"))
.collect(Collectors.toList())
);
JgUseRegistration useRegistration = JSON.parseObject(JSON.toJSONString(map), JgUseRegistration.class); JgUseRegistration useRegistration = JSON.parseObject(JSON.toJSONString(map), JgUseRegistration.class);
useRegistration.setRegDate(new Date()); useRegistration.setRegDate(new Date());
useRegistration.setCreateDate(new Date()); useRegistration.setCreateDate(new Date());
...@@ -837,7 +881,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -837,7 +881,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
flowExecute(useRegistration.getSequenceNbr(), useRegistration.getInstanceId(), "0", "", "", map.getString("manageType"), String.valueOf(map.get("nextTaskId")), map); flowExecute(useRegistration.getSequenceNbr(), useRegistration.getInstanceId(), "0", "", "", map.getString("manageType"), String.valueOf(map.get("nextTaskId")), map);
} }
} else { } else {
String equType = this.baseMapper.getEquType(String.valueOf(map.get("EQU_LIST_CODE"))); String equType = this.baseMapper.getEquType(equListCode);
TaskMessageDto messageDto = BeanUtil.copyProperties(useRegistration, TaskMessageDto.class);
messageDto.setEQU_LIST_CODE(equListCode);
TaskModelDto dto = TaskModelDto.builder() TaskModelDto dto = TaskModelDto.builder()
.model(BeanUtil.copyProperties(useRegistration, TaskMessageDto.class)) .model(BeanUtil.copyProperties(useRegistration, TaskMessageDto.class))
.taskContent("来自" + equType + "的业务办理," .taskContent("来自" + equType + "的业务办理,"
...@@ -847,7 +893,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -847,7 +893,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.relationId(String.valueOf(useRegistration.getSequenceNbr())) .relationId(String.valueOf(useRegistration.getSequenceNbr()))
.nextExecuteUser("") .nextExecuteUser("")
.build(); .build();
commonServiceImpl.buildTaskModel(Collections.singletonList(dto)); commonServiceImpl.buildTaskModel(Collections.singletonList(dto));
} }
// 设备数据存历史数据,在流程完成时使用 // 设备数据存历史数据,在流程完成时使用
...@@ -913,15 +958,19 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -913,15 +958,19 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
params.put("flowStatusLabel", jgUseRegistration.getStatus()); params.put("flowStatusLabel", jgUseRegistration.getStatus());
params.put("taskStatus", commonServiceImpl.getDictionaryCodeByName(jgUseRegistration.getStatus())); params.put("taskStatus", commonServiceImpl.getDictionaryCodeByName(jgUseRegistration.getStatus()));
params.put("taskStatusLabel", jgUseRegistration.getStatus()); params.put("taskStatusLabel", jgUseRegistration.getStatus());
TaskMessageDto taskMessageDto = new TaskMessageDto();
this.setEquListForWorkSpace(jgUseRegistration, taskMessageDto);
params.put("model", taskMessageDto);
TaskV2Model taskV2Model = commonServiceImpl.updateTaskModel(params); TaskV2Model taskV2Model = commonServiceImpl.updateTaskModel(params);
// 创建新的代办 // 创建新的代办
if (!ObjectUtils.isEmpty(taskV2Model)) { if (!ObjectUtils.isEmpty(taskV2Model)) {
TaskModelDto taskModelDto = new TaskModelDto(); TaskModelDto taskModelDto = new TaskModelDto();
BeanUtils.copyProperties(taskV2Model, taskModelDto); BeanUtils.copyProperties(taskV2Model, taskModelDto);
TaskMessageDto taskMessageDto = new TaskMessageDto(); TaskMessageDto taskMessageDto1 = new TaskMessageDto();
BeanUtil.copyProperties(jgUseRegistration, taskMessageDto); BeanUtil.copyProperties(jgUseRegistration, taskMessageDto1);
this.setEquListForWorkSpace(jgUseRegistration, taskMessageDto1);
// taskMessageDto.setEquipId(jgUseRegistrationEq.getEquId()); // taskMessageDto.setEquipId(jgUseRegistrationEq.getEquId());
taskModelDto.setModel(taskMessageDto); taskModelDto.setModel(taskMessageDto1);
taskModelDto.setTaskName(workflowResultDto.getNextTaskName()); taskModelDto.setTaskName(workflowResultDto.getNextTaskName());
taskModelDto.setExecuteUserIds(workflowResultDto.getNextExecutorUserIds()); taskModelDto.setExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
taskModelDto.setTaskStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName()); taskModelDto.setTaskStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName());
...@@ -976,6 +1025,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -976,6 +1025,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
} }
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) mapData.get("equipmentLists"); List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) mapData.get("equipmentLists");
String inspectConclusionName = getInspectConclusionName(mapData);
if (!CollectionUtils.isEmpty(equipmentLists)) { if (!CollectionUtils.isEmpty(equipmentLists)) {
for (int i = 0; i < equipmentLists.size(); i++) { for (int i = 0; i < equipmentLists.size(); i++) {
Map<String, Object> equipment = equipmentLists.get(i); Map<String, Object> equipment = equipmentLists.get(i);
...@@ -988,6 +1038,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -988,6 +1038,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
lambdaReg.eq(IdxBizJgRegisterInfo::getRecord, equId); lambdaReg.eq(IdxBizJgRegisterInfo::getRecord, equId);
IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoMapper.selectOne(lambdaReg); IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoMapper.selectOne(lambdaReg);
// 压力管道:[更新的原始引用]更新检验日期-nextInspectDate、检验结论-inspectConclusion、检验机构名称-inspectOrgName
equipment.put("nextInspectDate", mapData.getOrDefault("nextInspectDate", ""));
equipment.put("inspectOrgName", mapData.getOrDefault("inspectOrgName", ""));
equipment.put("inspectConclusion", inspectConclusionName);
// 更新设备信息 && 生成使用登记证编号 && 同步es // 更新设备信息 && 生成使用登记证编号 && 同步es
processMapData(sequenceNbr, mapData, jgUseRegistration, jgRegistrationHistory, registerInfo, taskV2Model, jsonObject, flag, useRegistrationCode); processMapData(sequenceNbr, mapData, jgUseRegistration, jgRegistrationHistory, registerInfo, taskV2Model, jsonObject, flag, useRegistrationCode);
// 查询设备制造信息 // 查询设备制造信息
...@@ -1003,22 +1057,96 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1003,22 +1057,96 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
certificateChangeRecordEqService.save(changeRecordEq); certificateChangeRecordEqService.save(changeRecordEq);
} }
} }
// 取第一条设备的注册消息--用来获取这一批设备的设备种类/类别/品种 // 取第一条设备的注册消息--用来获取这一批设备的设备种类/类别/品种
LambdaQueryWrapper<IdxBizJgRegisterInfo> lambdaReg = new QueryWrapper<IdxBizJgRegisterInfo>().lambda(); LambdaQueryWrapper<IdxBizJgRegisterInfo> lambdaReg = new QueryWrapper<IdxBizJgRegisterInfo>().lambda();
lambdaReg.eq(IdxBizJgRegisterInfo::getRecord, String.valueOf(mapData.get("equipId"))); lambdaReg.eq(IdxBizJgRegisterInfo::getRecord, String.valueOf(mapData.get("equipId")));
IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoMapper.selectOne(lambdaReg); IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoMapper.selectOne(lambdaReg);
// 单位办理的压力管道,在完成审批时,将检验信息写入到装置检验信息表
savePieLineProjectInspectData(jgUseRegistration, registerInfo, mapData);
// 生成证书管理表 // 生成证书管理表
generateRegistrationManage(jgUseRegistration, registerInfo, flag, useRegistrationManageSeq); generateRegistrationManage(jgUseRegistration, registerInfo, flag, useRegistrationManageSeq);
// 生成一条tzs_jg_certificate_change_record记录 // 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord(jgUseRegistration, registerInfo, changeRecordId, taskV2Model, flag); generateCertificateChangeRecord(jgUseRegistration, registerInfo, changeRecordId, taskV2Model, flag);
// 更新历史表:下次检验日期、检验机构名称、检验结论在压力管道、气瓶时更新子表单的数据
jgRegistrationHistory.setChangeData(JSON.toJSONString(mapData));
jgRegistrationHistoryService.updateById(jgRegistrationHistory);
// 装置表写入使用登记证编号、将装置名称写入到使用登记表
updateRegAndProjectContraption(jgUseRegistration, mapData);
} }
this.getBaseMapper().updateById(jgUseRegistration); this.getBaseMapper().updateById(jgUseRegistration);
commonServiceImpl.saveExecuteFlowData2Redis(jgUseRegistration.getInstanceId(), this.buildInstanceRuntimeData(jgUseRegistration)); commonServiceImpl.saveExecuteFlowData2Redis(jgUseRegistration.getInstanceId(), this.buildInstanceRuntimeData(jgUseRegistration));
} }
private void updateRegAndProjectContraption(JgUseRegistration jgUseRegistration, JSONObject mapData) {
if(!StringUtils.isEmpty(jgUseRegistration.getProjectContraptionId())){
IdxBizJgProjectContraption jgProjectContraption = jgProjectContraptionService.getById(jgUseRegistration.getProjectContraptionId());
jgUseRegistration.setProjectContraption(jgProjectContraption.getProjectContraption());
jgProjectContraption.setUseRegistrationCode(jgUseRegistration.getUseRegistrationCode());
jgProjectContraption.setUseDate(String.valueOf(mapData.get("useDate")));
jgProjectContraption.setCity(String.valueOf(mapData.get("city")));
jgProjectContraption.setCounty(String.valueOf(mapData.get("county")));
jgProjectContraption.setStreet(String.valueOf(mapData.get("factoryUseSiteStreet")));
jgProjectContraption.setAddress(String.valueOf(mapData.get("address")));
jgProjectContraption.setCityName(getRegionName(CITY, CITY.toLowerCase(), mapData));
jgProjectContraption.setCountyName(getRegionName(REGION, COUNTY.toLowerCase(), mapData));
jgProjectContraption.setStreetName(getRegionName(STREET, "factoryUseSiteStreet", mapData));
if (!StringUtils.isEmpty(mapData.get("orgBranchCode"))) {
jgProjectContraption.setOrgName(String.valueOf(mapData.getString("orgBranchCode")).split("_")[1]);
jgProjectContraption.setOrgCode(String.valueOf(mapData.getString("orgBranchCode")).split("_")[0]);
}
jgProjectContraptionService.updateById(jgProjectContraption);
}
}
/**
* 根据code获取市区县名字
* @param key key
* @param codeKey codeKey
* @param mapData 表单信息
* @return name
*/
private String getRegionName(String key, String codeKey, JSONObject mapData) {
return Optional.ofNullable((List<LinkedHashMap>) redisUtils.get(key))
.flatMap(list -> list.stream()
.filter(item -> String.valueOf(item.get("regionCode"))
.equals(String.valueOf(mapData.get(codeKey))))
.map(item -> (String) item.get("regionName"))
.findFirst())
.orElse("");
}
private String getInspectConclusionName(JSONObject mapData) {
if( !ObjectUtils.isEmpty(mapData.get("inspectConclusion"))) {
String code = mapData.get("inspectConclusion").toString();
DataDictionary conclusionDict = dataDictionaryServiceImpl.getByCode( code,"JYJL");
if(conclusionDict != null) {
return conclusionDict.getName();
}
}
return "";
}
private void savePieLineProjectInspectData(JgUseRegistration jgUseRegistration, IdxBizJgRegisterInfo registerInfo, JSONObject mapData) {
// 单位办理的压力管道,在完成审批时,将检验信息写入到装置检验信息表
if("unit".equals(jgUseRegistration.getManageType()) && registerInfo.getEquList().equals(EquipmentClassifityEnum.YLGD.getCode())){
IdxBizJgProjectInspection inspectionDetectionInfo = new IdxBizJgProjectInspection();
BeanUtil.copyProperties(mapData, inspectionDetectionInfo);
if (mapData.get("jySeq") != null) {
// 更新逻辑
IdxBizJgProjectInspection inspectionDetectionInfoDb = projectInspectionMapper.selectById(mapData.get("jySeq").toString());
Bean.copyExistPropertis(inspectionDetectionInfo, inspectionDetectionInfoDb);
projectInspectionMapper.updateById(inspectionDetectionInfo);
} else {
inspectionDetectionInfo.setProjectContraptionId(jgUseRegistration.getProjectContraptionId());
inspectionDetectionInfo.setRecDate(new Date());
// 使用登记创建新增的检验信息id设置为使用登记的主键id,在作废时级联作废
inspectionDetectionInfo.setSequenceNbr(jgUseRegistration.getSequenceNbr() + "");
projectInspectionMapper.insert(inspectionDetectionInfo);
}
}
}
/** /**
* 生成使用登记证变更记录 * 生成使用登记证变更记录
* *
...@@ -1203,6 +1331,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1203,6 +1331,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
params.put("flowStatusLabel", jgUseRegistration.getStatus()); params.put("flowStatusLabel", jgUseRegistration.getStatus());
params.put("taskStatus", commonServiceImpl.getDictionaryCodeByName(jgUseRegistration.getStatus())); params.put("taskStatus", commonServiceImpl.getDictionaryCodeByName(jgUseRegistration.getStatus()));
params.put("taskStatusLabel", jgUseRegistration.getStatus()); params.put("taskStatusLabel", jgUseRegistration.getStatus());
TaskMessageDto taskMessageDto1 = new TaskMessageDto();
this.setEquListForWorkSpace(jgUseRegistration, taskMessageDto1);
params.put("model", taskMessageDto1);
TaskV2Model taskV2Model = commonServiceImpl.updateTaskModel(params); TaskV2Model taskV2Model = commonServiceImpl.updateTaskModel(params);
// 创建新的代办 // 创建新的代办
if (!ObjectUtils.isEmpty(taskV2Model)) { if (!ObjectUtils.isEmpty(taskV2Model)) {
...@@ -1211,6 +1342,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1211,6 +1342,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
TaskMessageDto taskMessageDto = new TaskMessageDto(); TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtil.copyProperties(jgUseRegistration, taskMessageDto); BeanUtil.copyProperties(jgUseRegistration, taskMessageDto);
taskMessageDto.setEquipId(jgUseRegistrationEq.getEquId()); taskMessageDto.setEquipId(jgUseRegistrationEq.getEquId());
this.setEquListForWorkSpace(jgUseRegistration, taskMessageDto);
taskModelDto.setModel(taskMessageDto); taskModelDto.setModel(taskMessageDto);
taskModelDto.setTaskName(workflowResultDto.getNextTaskName()); taskModelDto.setTaskName(workflowResultDto.getNextTaskName());
taskModelDto.setExecuteUserIds(workflowResultDto.getNextExecutorUserIds()); taskModelDto.setExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
...@@ -1359,6 +1491,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1359,6 +1491,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
params.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName()); params.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
TaskMessageDto taskMessageDto = new TaskMessageDto(); TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtil.copyProperties(jgUseRegistration, taskMessageDto); BeanUtil.copyProperties(jgUseRegistration, taskMessageDto);
this.setEquListForWorkSpace(jgUseRegistration, taskMessageDto);
params.put("model", taskMessageDto); params.put("model", taskMessageDto);
return commonServiceImpl.updateTaskModel(params); return commonServiceImpl.updateTaskModel(params);
} }
...@@ -1524,7 +1657,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1524,7 +1657,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgUseRegistration.setNextExecuteIds(workflowResultDto.getNextExecutorRoleIds()); jgUseRegistration.setNextExecuteIds(workflowResultDto.getNextExecutorRoleIds());
TaskMessageDto taskMessageDto = new TaskMessageDto(); TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtil.copyProperties(jgUseRegistration, taskMessageDto); BeanUtil.copyProperties(jgUseRegistration, taskMessageDto);
LambdaQueryWrapper<JgUseRegistrationEq> jgUseRegEqWrapper = new QueryWrapper<JgUseRegistrationEq>().lambda(); LambdaQueryWrapper<JgUseRegistrationEq> jgUseRegEqWrapper = new QueryWrapper<JgUseRegistrationEq>().lambda();
jgUseRegEqWrapper.eq(JgUseRegistrationEq::getEquipTransferId, String.valueOf(jgUseRegistration.getSequenceNbr())); jgUseRegEqWrapper.eq(JgUseRegistrationEq::getEquipTransferId, String.valueOf(jgUseRegistration.getSequenceNbr()));
List<JgUseRegistrationEq> jgUseRegistrationEqList = jgRelationEquipMapper.selectList(jgUseRegEqWrapper); List<JgUseRegistrationEq> jgUseRegistrationEqList = jgRelationEquipMapper.selectList(jgUseRegEqWrapper);
...@@ -1532,6 +1664,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1532,6 +1664,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if (!jgUseRegistrationEqList.isEmpty()) { if (!jgUseRegistrationEqList.isEmpty()) {
String equId = jgUseRegistrationEqList.get(0).getEquId(); String equId = jgUseRegistrationEqList.get(0).getEquId();
taskMessageDto.setEquipId(equId); taskMessageDto.setEquipId(equId);
taskMessageDto.setEQU_LIST_CODE(this.getEquipListCode(equId));
// dto.setTaskContent("来自" + this.getBaseMapper().getEquType(equId) + "【" + (ObjectUtils.isEmpty(jgUseRegistration.getSupervisoryCode()) ? "无" : jgUseRegistration.getSupervisoryCode()) + "】的业务办理," + "【申请单号:" + jgUseRegistration.getApplyNo() + "】"); // dto.setTaskContent("来自" + this.getBaseMapper().getEquType(equId) + "【" + (ObjectUtils.isEmpty(jgUseRegistration.getSupervisoryCode()) ? "无" : jgUseRegistration.getSupervisoryCode()) + "】的业务办理," + "【申请单号:" + jgUseRegistration.getApplyNo() + "】");
dto.setTaskContent("来自" + this.getBaseMapper().getEquType(equId) + "的业务办理," + "【申请单号:" + jgUseRegistration.getApplyNo() + "】"); dto.setTaskContent("来自" + this.getBaseMapper().getEquType(equId) + "的业务办理," + "【申请单号:" + jgUseRegistration.getApplyNo() + "】");
} }
...@@ -1542,6 +1675,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1542,6 +1675,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
commonServiceImpl.buildTaskModel(list); commonServiceImpl.buildTaskModel(list);
} }
public String getEquipListCode(String record) {
IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoService.getOne(new LambdaQueryWrapper<IdxBizJgRegisterInfo>().eq(IdxBizJgRegisterInfo::getRecord, record).select(TzsBaseEntity::getSequenceNbr,IdxBizJgRegisterInfo::getEquList));
if(registerInfo != null){
return registerInfo.getEquList();
}
return null;
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 6000000) @GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 6000000)
public void flowExecute(Long id, String instanceId, String operate, String comment, String carNumber, String manageType, String nextTaskId, JSONObject jsonObject) { public void flowExecute(Long id, String instanceId, String operate, String comment, String carNumber, String manageType, String nextTaskId, JSONObject jsonObject) {
...@@ -1710,6 +1851,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1710,6 +1851,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jsonObject.put("taskType", BusinessTypeEnum.JG_USAGE_REGISTRATION.getCode()); jsonObject.put("taskType", BusinessTypeEnum.JG_USAGE_REGISTRATION.getCode());
jsonObject.put("flowStatus", commonServiceImpl.getDictionaryCodeByName(jgUseRegistration.getStatus())); jsonObject.put("flowStatus", commonServiceImpl.getDictionaryCodeByName(jgUseRegistration.getStatus()));
jsonObject.put("flowStatusLabel", jgUseRegistration.getStatus()); jsonObject.put("flowStatusLabel", jgUseRegistration.getStatus());
jsonObject.remove("otherAccessories");
jsonObject.remove("instanceStatus");
setEquListCode2Json(data, jsonObject);
// 非单位办理 // 非单位办理
if (!"unit".equals(manageType)) { if (!"unit".equals(manageType)) {
LambdaQueryWrapper<JgUseRegistrationEq> lambda1 = new QueryWrapper<JgUseRegistrationEq>().lambda(); LambdaQueryWrapper<JgUseRegistrationEq> lambda1 = new QueryWrapper<JgUseRegistrationEq>().lambda();
...@@ -1735,6 +1879,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1735,6 +1879,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
} }
private void setEquListCode2Json(JgUseRegistration jgUseRegistration, JSONObject jsonObject) {
TaskMessageDto taskMessageDto = new TaskMessageDto();
this.setEquListForWorkSpace(jgUseRegistration, taskMessageDto);
jsonObject.put("EQU_LIST_CODE", taskMessageDto.getEQU_LIST_CODE());
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void deleteBatch(List<Long> ids) { public void deleteBatch(List<Long> ids) {
...@@ -1797,6 +1947,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1797,6 +1947,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) jsonObject.get("equipmentLists"); List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) jsonObject.get("equipmentLists");
List<String> records = equipmentLists.stream().map(v -> (String) v.get("record")).collect(toList()); List<String> records = equipmentLists.stream().map(v -> (String) v.get("record")).collect(toList());
jsonObject.remove("equipmentLists"); jsonObject.remove("equipmentLists");
// 查询气瓶设备详情
if (CylinderTypeEnum.CYLINDER.getCode().equals(jsonObject.get("EQU_CATEGORY_CODE"))) { if (CylinderTypeEnum.CYLINDER.getCode().equals(jsonObject.get("EQU_CATEGORY_CODE"))) {
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult(); List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue)); Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
...@@ -1806,6 +1957,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1806,6 +1957,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}); });
jsonObject.put("equipmentLists", result); jsonObject.put("equipmentLists", result);
} else { } else {
// 查询管道设备详情
jsonObject.put("equipmentLists", jgUseRegistrationMapper.queryForUnitPipelineEquipment(records)); jsonObject.put("equipmentLists", jgUseRegistrationMapper.queryForUnitPipelineEquipment(records));
} }
} }
...@@ -2291,8 +2443,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2291,8 +2443,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
exportParamsMap.put("useUnitName", jsonObject.get("useUnitName")); exportParamsMap.put("useUnitName", jsonObject.get("useUnitName"));
// 使用单位地址 // 使用单位地址
String useUnitCreditCode = String.valueOf(jsonObject.get("useUnitCreditCode")); String useUnitCreditCode = String.valueOf(jsonObject.get("useUnitCreditCode"));
CompanyModel companyModel = Privilege.companyClient.queryByCompanyCode(useUnitCreditCode).getResult(); TzBaseEnterpriseInfo enterpriseInfo = tzBaseEnterpriseInfoMapper.selectOne(new LambdaQueryWrapper<TzBaseEnterpriseInfo>().eq(TzBaseEnterpriseInfo::getUseCode, useUnitCreditCode));
exportParamsMap.put("fullAddress", companyModel.getAddress()); exportParamsMap.put("fullAddress", enterpriseInfo.getAddress());
// 工程(装置)名称 取第一个设备的技术参数”工程装置名称“ // 工程(装置)名称 取第一个设备的技术参数”工程装置名称“
JSONObject eqJSON = (JSONObject) equipmentLists.get(0); JSONObject eqJSON = (JSONObject) equipmentLists.get(0);
String eqId = !ValidationUtil.isEmpty(eqJSON) ? String.valueOf(eqJSON.get("record")) : ""; String eqId = !ValidationUtil.isEmpty(eqJSON) ? String.valueOf(eqJSON.get("record")) : "";
...@@ -2301,7 +2453,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2301,7 +2453,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 安全管理部门 // 安全管理部门
exportParamsMap.put("orgBranchName", String.valueOf(jsonObject.get("orgBranchCode")).split("_")[1]); exportParamsMap.put("orgBranchName", String.valueOf(jsonObject.get("orgBranchCode")).split("_")[1]);
// 安全管理员 // 安全管理员
exportParamsMap.put("safetyManager", String.valueOf(jsonObject.get("safetyManager")).split("_")[1]); exportParamsMap.put("safetyManager", String.valueOf(jsonObject.get("safetyManager")).contains("_") ? String.valueOf(jsonObject.get("safetyManager")).split("_")[1] : String.valueOf(jsonObject.get("safetyManager")));
// 联系电话 // 联系电话
exportParamsMap.put("phone", ValidationUtil.isEmpty(result.getMobile()) ? "" : result.getMobile()); exportParamsMap.put("phone", ValidationUtil.isEmpty(result.getMobile()) ? "" : result.getMobile());
// 经办人 // 经办人
...@@ -2311,20 +2463,33 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2311,20 +2463,33 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
List<CompletableFuture<byte[]>> futures = IntStream.rangeClosed(1, page) List<CompletableFuture<byte[]>> futures = IntStream.rangeClosed(1, page)
.mapToObj(current -> CompletableFuture.supplyAsync(() -> { .mapToObj(current -> CompletableFuture.supplyAsync(() -> {
exportParamsMap.put("current", current); // 创建独立的参数副本
Map<String, Object> currentExportParamsMap = new HashMap<>(exportParamsMap);
currentExportParamsMap.put("current", current);
// 数据分页 // 数据分页
int start = (current - 1) * size; int start = (current - 1) * size;
int end = ((current - 1) * size + size) < total ? (current - 1) * size + size : (int) total; int end = ((current - 1) * size + size) < total ? (current - 1) * size + size : (int) total;
// 数据截取 // 数据截取
List<Object> equData = equipmentLists.subList(start, end); List<Object> equData = equipmentLists.subList(start, end);
// 设备数据填充 // 设备数据填充
this.pressurePipeEquData(exportParamsMap, equData, current, size); this.pressurePipeEquData(currentExportParamsMap, equData, current, size);
return commonService.generateSummaryOfCylinderInfo(exportParamsMap, wordPath, filePrefix); return commonService.generateSummaryOfCylinderInfo(currentExportParamsMap, wordPath, filePrefix);
})).collect(Collectors.toList()); })).collect(Collectors.toList());
CompletableFuture.allOf(futures.toArray(new CompletableFuture[page])).join(); CompletableFuture.allOf(futures.toArray(new CompletableFuture[page])).join();
return futures; return futures;
} }
private String spliceFullAddress(TzBaseEnterpriseInfo enterpriseInfo) {
String address = enterpriseInfo.getAddress();
boolean hasProvince = address.contains("省");
boolean hasCity = address.contains("市");
boolean hasDistrict = address.contains("区");
if (hasProvince || hasCity || hasDistrict) {
return address;
}
return enterpriseInfo.getProvince() + enterpriseInfo.getCity() + enterpriseInfo.getDistrict() + enterpriseInfo.getStreet() + enterpriseInfo.getCommunity() + enterpriseInfo.getAddress();
}
/** /**
* 气瓶设备数据填充 * 气瓶设备数据填充
*/ */
...@@ -2360,14 +2525,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2360,14 +2525,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
String[] fieldNames = {"productName", "pipelineNumber", "deviceLevel", "designUnitName", "uscUnitName", String[] fieldNames = {"productName", "pipelineNumber", "deviceLevel", "designUnitName", "uscUnitName",
"uscDate", "useDate", "nominalDiameter", "wallThickness", "pipeLength", "pressure", "temperature", "uscDate", "useDate", "nominalDiameter", "wallThickness", "pipeLength", "pressure", "temperature",
"medium", "inspectConclusion", "inspectOrgName", "nextInspectDate", "inspectConclusion", "remarks"}; "medium", "inspectConclusion", "inspectOrgName", "nextInspectDate", "remarks"};
// 填充有效数据 // 填充有效数据
for (int curr = 0; curr < equData.size(); curr++) { for (int curr = 0; curr < equData.size(); curr++) {
JSONObject obj = (JSONObject) equData.get(curr); JSONObject obj = (JSONObject) equData.get(curr);
int serialNum = curr + 1; int serialNum = curr + 1;
for (String fieldName : fieldNames) { for (String fieldName : fieldNames) {
exportParamsMap.put("num" + serialNum, (current - 1) * size + (curr + 1)); exportParamsMap.put("num" + serialNum, (current - 1) * size + (curr + 1));
exportParamsMap.put(fieldName + serialNum, ValidationUtil.isEmpty(obj.get(fieldName)) ? "" : obj.get(fieldName)); exportParamsMap.put(fieldName + serialNum, setSpecialParamFields(fieldName, obj));
} }
} }
...@@ -2381,6 +2547,24 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2381,6 +2547,24 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
} }
private Object trimIfEmpty(Object obj) {
return ValidationUtil.isEmpty(obj) ? "" : obj;
}
private Object setSpecialParamFields(String fieldName, JSONObject equip){
switch (fieldName) {
case "pressure":
return trimIfEmpty(equip.get(fieldName)) + "/" + trimIfEmpty(equip.get("workPressure"));
case "temperature":
return trimIfEmpty(equip.get(fieldName)) + "/" + trimIfEmpty(equip.get("workTemperature"));
case "medium":
return trimIfEmpty(equip.get(fieldName)) + "/" + trimIfEmpty(equip.get("workMedium"));
default:
return ValidationUtil.isEmpty(equip.get(fieldName)) ? "" : equip.get(fieldName);
}
}
/** /**
* 填充设备最新的数据至历史json * 填充设备最新的数据至历史json
...@@ -2599,6 +2783,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2599,6 +2783,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private void clearUseInfoOfEquip(JgUseRegistration jgUseRegistration) { private void clearUseInfoOfEquip(JgUseRegistration jgUseRegistration) {
List<JgUseRegistrationEq> eqList = getJgUseRegistrationEqs(jgUseRegistration); List<JgUseRegistrationEq> eqList = getJgUseRegistrationEqs(jgUseRegistration);
// 0.压力管道 清空装置表的使用登记证编号、删除装置的检验信息
this.rollBackForPieLine(jgUseRegistration);
eqList.forEach(e -> { eqList.forEach(e -> {
String record = e.getEquId(); String record = e.getEquId();
Boolean flag = Boolean.FALSE; Boolean flag = Boolean.FALSE;
...@@ -2623,15 +2809,27 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2623,15 +2809,27 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 5.历史设备处理 // 5.历史设备处理
this.dealHisRegEquipData(jgUseRegistration, record); this.dealHisRegEquipData(jgUseRegistration, record);
}); });
List<String> equipTransferIds = eqList.stream() Set<String> equipTransferIds = eqList.stream()
.map(JgUseRegistrationEq::getEquipTransferId) .map(JgUseRegistrationEq::getEquipTransferId)
.filter(Objects::nonNull) .filter(Objects::nonNull)
.collect(Collectors.toList()); .collect(Collectors.toSet());
if (!equipTransferIds.isEmpty()) { if (!equipTransferIds.isEmpty()) {
jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds); jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds);
} }
} }
private void rollBackForPieLine(JgUseRegistration jgUseRegistration) {
if(!StringUtils.isEmpty(jgUseRegistration.getProjectContraptionId())){
// 清除使用登记证编号
LambdaUpdateWrapper<IdxBizJgProjectContraption> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(BaseEntity::getSequenceNbr, jgUseRegistration.getProjectContraptionId());
updateWrapper.set(IdxBizJgProjectContraption::getUseRegistrationCode, null);
idxBizJgProjectContraptionMapper.update(null, updateWrapper);
// 删除改装置的检验信息【只有是在使用登记页面新增的才会删除,使用登记终审通过时,插入的检验信息id为使用登记的主键】
projectInspectionMapper.deleteById(jgUseRegistration.getSequenceNbr());
}
}
private void dealHisRegEquipData(JgUseRegistration jgUseRegistration, String record) { private void dealHisRegEquipData(JgUseRegistration jgUseRegistration, String record) {
// 历史登记时处理 // 历史登记时处理
if("1".equals(jgUseRegistration.getRegType())){ if("1".equals(jgUseRegistration.getRegType())){
...@@ -2824,6 +3022,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2824,6 +3022,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
TaskMessageDto taskMessageDto = new TaskMessageDto(); TaskMessageDto taskMessageDto = new TaskMessageDto();
jgUseRegistration.setOtherAccessories(null); jgUseRegistration.setOtherAccessories(null);
BeanUtils.copyProperties(jgUseRegistration, taskMessageDto); BeanUtils.copyProperties(jgUseRegistration, taskMessageDto);
this.setEquListForWorkSpace(jgUseRegistration, taskMessageDto);
taskMap.put("model", taskMessageDto); taskMap.put("model", taskMessageDto);
commonServiceImpl.updateTaskModel(taskMap); commonServiceImpl.updateTaskModel(taskMap);
} }
...@@ -2844,6 +3043,28 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2844,6 +3043,28 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}); });
} }
private void setEquListForWorkSpace(JgUseRegistration jgUseRegistration, TaskMessageDto taskMessageDto) {
LambdaQueryWrapper<JgUseRegistrationEq> jgUseRegEqWrapper = new QueryWrapper<JgUseRegistrationEq>().lambda();
jgUseRegEqWrapper.eq(JgUseRegistrationEq::getEquipTransferId, String.valueOf(jgUseRegistration.getSequenceNbr()));
List<JgUseRegistrationEq> jgUseRegistrationEqList = jgRelationEquipMapper.selectList(jgUseRegEqWrapper);
if (!jgUseRegistrationEqList.isEmpty()) {
String equId = jgUseRegistrationEqList.get(0).getEquId();
taskMessageDto.setEQU_LIST_CODE(this.getEquipListCode(equId));
}
}
public IdxBizJgRegisterInfo getRegisterInfo(JgUseRegistration jgUseRegistration) {
LambdaQueryWrapper<JgUseRegistrationEq> jgUseRegEqWrapper = new QueryWrapper<JgUseRegistrationEq>().lambda();
jgUseRegEqWrapper.eq(JgUseRegistrationEq::getEquipTransferId, String.valueOf(jgUseRegistration.getSequenceNbr()));
List<JgUseRegistrationEq> jgUseRegistrationEqList = jgRelationEquipMapper.selectList(jgUseRegEqWrapper);
if (!jgUseRegistrationEqList.isEmpty()) {
String record = jgUseRegistrationEqList.get(0).getEquId();
return idxBizJgRegisterInfoService.getOne(new LambdaQueryWrapper<IdxBizJgRegisterInfo>().eq(IdxBizJgRegisterInfo::getRecord, record).select(TzsBaseEntity::getSequenceNbr,IdxBizJgRegisterInfo::getEquList));
}
return null;
}
/** /**
* 处理历史错误单子 * 处理历史错误单子
* *
...@@ -2898,6 +3119,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2898,6 +3119,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
params.put("flowStatusLabel", jgUseRegistration.getStatus()); params.put("flowStatusLabel", jgUseRegistration.getStatus());
params.put("taskStatus", commonServiceImpl.getDictionaryCodeByName(jgUseRegistration.getStatus())); params.put("taskStatus", commonServiceImpl.getDictionaryCodeByName(jgUseRegistration.getStatus()));
params.put("taskStatusLabel", jgUseRegistration.getStatus()); params.put("taskStatusLabel", jgUseRegistration.getStatus());
TaskMessageDto taskMessageDto1 = new TaskMessageDto();
this.setEquListForWorkSpace(jgUseRegistration, taskMessageDto1);
params.put("model", taskMessageDto1);
TaskV2Model taskV2Model = commonServiceImpl.updateTaskModel(params); TaskV2Model taskV2Model = commonServiceImpl.updateTaskModel(params);
// 创建新的代办 // 创建新的代办
if (!ObjectUtils.isEmpty(taskV2Model)) { if (!ObjectUtils.isEmpty(taskV2Model)) {
...@@ -2905,6 +3129,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2905,6 +3129,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
BeanUtils.copyProperties(taskV2Model, taskModelDto); BeanUtils.copyProperties(taskV2Model, taskModelDto);
TaskMessageDto taskMessageDto = new TaskMessageDto(); TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtil.copyProperties(jgUseRegistration, taskMessageDto); BeanUtil.copyProperties(jgUseRegistration, taskMessageDto);
setEquListForWorkSpace(jgUseRegistration, taskMessageDto);
taskModelDto.setModel(taskMessageDto); taskModelDto.setModel(taskMessageDto);
taskModelDto.setTaskName(workflowResultDto.getNextTaskName()); taskModelDto.setTaskName(workflowResultDto.getNextTaskName());
taskModelDto.setStartUserId(workflowResultDto.getExecutorId()); taskModelDto.setStartUserId(workflowResultDto.getExecutorId());
...@@ -3100,9 +3325,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3100,9 +3325,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 暂存历史表 // 暂存历史表
updateHistory(map, map.get("equipId").toString(), String.valueOf(jgUseRegistration.getSequenceNbr()), jgUseRegistration.getSupervisoryCode()); updateHistory(map, map.get("equipId").toString(), String.valueOf(jgUseRegistration.getSequenceNbr()), jgUseRegistration.getSupervisoryCode());
TaskV2Model taskV2Model = new TaskV2Model();
taskV2Model.setRoutePath("");
//监督管理信息 //监督管理信息
LambdaQueryWrapper<IdxBizJgSupervisionInfo> lambdaSup = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda(); LambdaQueryWrapper<IdxBizJgSupervisionInfo> lambdaSup = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda();
lambdaSup.eq(IdxBizJgSupervisionInfo::getRecord, jgRelationEquip.getEquId()); lambdaSup.eq(IdxBizJgSupervisionInfo::getRecord, jgRelationEquip.getEquId());
...@@ -3122,17 +3344,18 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3122,17 +3344,18 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
registerInfo.setEquPrice(String.valueOf(map.get("equPrice"))); registerInfo.setEquPrice(String.valueOf(map.get("equPrice")));
registerInfo.setProductPhoto(JSONObject.toJSONString(map.get("productPhoto"))); registerInfo.setProductPhoto(JSONObject.toJSONString(map.get("productPhoto")));
registerInfo.setOtherAccessoriesReg(JSONObject.toJSONString(map.get("otherAccessoriesReg"))); registerInfo.setOtherAccessoriesReg(JSONObject.toJSONString(map.get("otherAccessoriesReg")));
registerInfo.setInstallationIsComplete(map.getOrDefault("installationIsComplete", "1").toString());
idxBizJgRegisterInfoMapper.updateById(registerInfo); idxBizJgRegisterInfoMapper.updateById(registerInfo);
// 设计信息 // 设计信息
LambdaQueryWrapper<IdxBizJgDesignInfo> lambdaDes = new QueryWrapper<IdxBizJgDesignInfo>().lambda(); LambdaQueryWrapper<IdxBizJgDesignInfo> lambdaDes = new QueryWrapper<IdxBizJgDesignInfo>().lambda();
lambdaDes.eq(IdxBizJgDesignInfo::getRecord, jgRelationEquip.getEquId()); lambdaDes.eq(IdxBizJgDesignInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgDesignInfo designInfo = idxBizJgDesignInfoService.getOne(lambdaDes); IdxBizJgDesignInfo designInfo = idxBizJgDesignInfoService.getOne(lambdaDes);
designInfo.setDesignUnitCreditCode(String.valueOf(map.get("designUnitCreditCode"))); designInfo.setDesignUnitCreditCode(MapUtil.getStr(map,"designUnitCreditCode"));
designInfo.setDesignUnitName(String.valueOf(map.get("designUnitName"))); designInfo.setDesignUnitName(MapUtil.getStr(map,"designUnitName"));
designInfo.setDesignLicenseNum(ObjectUtils.isEmpty(map.get("designLicenseNum")) ? null : String.valueOf(map.get("designLicenseNum"))); designInfo.setDesignLicenseNum(MapUtil.getStr(map,"designLicenseNum"));
designInfo.setDesignUseDate(String.valueOf(map.get("designUseDate"))); designInfo.setDesignUseDate(MapUtil.getStr(map, "designUseDate"));
designInfo.setDesignDate(DateUtil.parse(String.valueOf(map.get("designDate")), "yyyy-MM-dd")); designInfo.setDesignDate(!StringUtils.isEmpty(map.get("designDate")) ? DateUtil.parse(String.valueOf(map.get("designDate")), "yyyy-MM-dd") : null);
designInfo.setDrawingDo(ObjectUtils.isEmpty(map.get("drawingDo")) ? null : String.valueOf(map.get("drawingDo"))); designInfo.setDrawingDo(ObjectUtils.isEmpty(map.get("drawingDo")) ? null : String.valueOf(map.get("drawingDo")));
designInfo.setAppraisalUnit(ObjectUtils.isEmpty(map.get("appraisalUnit")) ? null : String.valueOf(map.get("appraisalUnit"))); designInfo.setAppraisalUnit(ObjectUtils.isEmpty(map.get("appraisalUnit")) ? null : String.valueOf(map.get("appraisalUnit")));
designInfo.setAppraisalDate(ObjectUtils.isEmpty(map.get("appraisalDate")) ? null : String.valueOf(map.get("appraisalDate"))); designInfo.setAppraisalDate(ObjectUtils.isEmpty(map.get("appraisalDate")) ? null : String.valueOf(map.get("appraisalDate")));
...@@ -3146,11 +3369,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3146,11 +3369,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper<IdxBizJgFactoryInfo> factoryInfoWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizJgFactoryInfo> factoryInfoWrapper = new LambdaQueryWrapper<>();
factoryInfoWrapper.eq(IdxBizJgFactoryInfo::getRecord, jgRelationEquip.getEquId()); factoryInfoWrapper.eq(IdxBizJgFactoryInfo::getRecord, jgRelationEquip.getEquId());
IdxBizJgFactoryInfo idxBizJgFactoryInfo = idxBizJgFactoryInfoService.getOne(factoryInfoWrapper); IdxBizJgFactoryInfo idxBizJgFactoryInfo = idxBizJgFactoryInfoService.getOne(factoryInfoWrapper);
idxBizJgFactoryInfo.setProduceUnitCreditCode(String.valueOf(map.get("produceUnitCreditCode"))); idxBizJgFactoryInfo.setProduceUnitCreditCode(MapUtil.getStr(map, "produceUnitCreditCode"));
idxBizJgFactoryInfo.setProduceUnitName(String.valueOf(map.get("produceUnitName"))); idxBizJgFactoryInfo.setProduceUnitName(MapUtil.getStr(map, "produceUnitName"));
idxBizJgFactoryInfo.setFactoryNum(String.valueOf(map.get("factoryNum"))); idxBizJgFactoryInfo.setFactoryNum(MapUtil.getStr(map, "factoryNum"));
idxBizJgFactoryInfo.setProduceLicenseNum(String.valueOf(map.get("produceLicenseNum"))); idxBizJgFactoryInfo.setProduceLicenseNum(MapUtil.getStr(map, "produceLicenseNum"));
idxBizJgFactoryInfo.setProduceDate(DateUtil.parse(String.valueOf(map.get("produceDate")), "yyyy-MM-dd")); idxBizJgFactoryInfo.setProduceDate(!StringUtils.isEmpty(map.get("produceDate")) ? DateUtil.parse(String.valueOf(map.get("produceDate")), "yyyy-MM-dd") : null);
idxBizJgFactoryInfo.setImported(ObjectUtils.isEmpty(map.get("imported")) ? null : String.valueOf(map.get("imported"))); idxBizJgFactoryInfo.setImported(ObjectUtils.isEmpty(map.get("imported")) ? null : String.valueOf(map.get("imported")));
idxBizJgFactoryInfo.setProduceCountry(ObjectUtils.isEmpty(map.get("produceCountry")) ? null : String.valueOf(map.get("produceCountry"))); idxBizJgFactoryInfo.setProduceCountry(ObjectUtils.isEmpty(map.get("produceCountry")) ? null : String.valueOf(map.get("produceCountry")));
idxBizJgFactoryInfo.setOtherAccessoriesFact(ObjectUtils.isEmpty(map.get("otherAccessoriesFact")) ? null : JSONObject.toJSONString(map.get("otherAccessoriesFact"))); idxBizJgFactoryInfo.setOtherAccessoriesFact(ObjectUtils.isEmpty(map.get("otherAccessoriesFact")) ? null : JSONObject.toJSONString(map.get("otherAccessoriesFact")));
...@@ -3203,13 +3426,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3203,13 +3426,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if (ObjectUtils.isEmpty(inspectionDetectionInfo.getSequenceNbr())) { if (ObjectUtils.isEmpty(inspectionDetectionInfo.getSequenceNbr())) {
inspectionDetectionInfo.setRecord((String) map.get("equipId")); inspectionDetectionInfo.setRecord((String) map.get("equipId"));
} }
inspectionDetectionInfo.setInspectOrgCode(String.valueOf(map.get("inspectOrgCode"))); inspectionDetectionInfo.setInspectOrgCode(MapUtil.getStr(map, "inspectOrgCode"));
inspectionDetectionInfo.setInspectOrgName(String.valueOf(map.get("inspectOrgName"))); inspectionDetectionInfo.setInspectOrgName(MapUtil.getStr(map, "inspectOrgName"));
inspectionDetectionInfo.setInspectConclusion(String.valueOf(map.get("inspectConclusion"))); inspectionDetectionInfo.setInspectConclusion(MapUtil.getStr(map,"inspectConclusion"));
inspectionDetectionInfo.setInspectType(String.valueOf(map.get("inspectType"))); inspectionDetectionInfo.setInspectType(MapUtil.getStr(map, "inspectType"));
inspectionDetectionInfo.setInspectDate(DateUtil.parse(String.valueOf(map.get("inspectDate")), "yyyy-MM-dd")); inspectionDetectionInfo.setInspectDate(!StringUtils.isEmpty(map.get("inspectDate")) ? DateUtil.parse(String.valueOf(map.get("inspectDate")), "yyyy-MM-dd") : null);
inspectionDetectionInfo.setInspectStaff(String.valueOf(map.get("inspectStaff"))); inspectionDetectionInfo.setInspectStaff(MapUtil.getStr(map, "inspectStaff"));
inspectionDetectionInfo.setNextInspectDate(DateUtil.parse(String.valueOf(map.get("nextInspectDate")), "yyyy-MM-dd")); inspectionDetectionInfo.setNextInspectDate(!StringUtils.isEmpty(map.get("nextInspectDate")) ? DateUtil.parse(String.valueOf(map.get("nextInspectDate")), "yyyy-MM-dd") : null);
inspectionDetectionInfo.setInspectReport(JSONObject.toJSONString(map.get("inspectReport"))); inspectionDetectionInfo.setInspectReport(JSONObject.toJSONString(map.get("inspectReport")));
iIdxBizJgInspectionDetectionInfoService.saveOrUpdateData(inspectionDetectionInfo); iIdxBizJgInspectionDetectionInfoService.saveOrUpdateData(inspectionDetectionInfo);
...@@ -3553,9 +3776,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3553,9 +3776,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
inspectionDetectionInfo.setInspectOrgName(String.valueOf(map.get("inspectOrgName"))); inspectionDetectionInfo.setInspectOrgName(String.valueOf(map.get("inspectOrgName")));
inspectionDetectionInfo.setInspectConclusion(String.valueOf(map.get("inspectConclusion"))); inspectionDetectionInfo.setInspectConclusion(String.valueOf(map.get("inspectConclusion")));
inspectionDetectionInfo.setInspectType(String.valueOf(map.get("inspectType"))); inspectionDetectionInfo.setInspectType(String.valueOf(map.get("inspectType")));
inspectionDetectionInfo.setInspectDate(DateUtil.parse(String.valueOf(map.get("inspectDate")), "yyyy-MM-dd")); inspectionDetectionInfo.setInspectDate(!StringUtils.isEmpty(map.get("inspectDate")) ? DateUtil.parse(String.valueOf(map.get("inspectDate")), "yyyy-MM-dd") : null);
inspectionDetectionInfo.setInspectStaff(String.valueOf(map.get("inspectStaff"))); inspectionDetectionInfo.setInspectStaff(String.valueOf(map.get("inspectStaff")));
inspectionDetectionInfo.setNextInspectDate(DateUtil.parse(String.valueOf(map.get("nextInspectDate")), "yyyy-MM-dd")); inspectionDetectionInfo.setNextInspectDate(!StringUtils.isEmpty(map.get("nextInspectDate")) ? DateUtil.parse(String.valueOf(map.get("nextInspectDate")), "yyyy-MM-dd") : null);
inspectionDetectionInfo.setInspectReport(JSONObject.toJSONString(map.get("inspectReport"))); inspectionDetectionInfo.setInspectReport(JSONObject.toJSONString(map.get("inspectReport")));
iIdxBizJgInspectionDetectionInfoService.saveOrUpdateData(inspectionDetectionInfo); iIdxBizJgInspectionDetectionInfoService.saveOrUpdateData(inspectionDetectionInfo);
// 暂存历史表 // 暂存历史表
...@@ -3596,4 +3819,80 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3596,4 +3819,80 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
} }
public IPage<IdxBizJgProjectContraption> getJgProjectContraptionPage(String useUnitCreditCode, Page<IdxBizJgProjectContraption> page) {
// 兼容个人业务
if(useUnitCreditCode.contains("_")){
useUnitCreditCode = useUnitCreditCode.split("_")[1];
}
// 查询流程中的装置
List<JgUseRegistration> flowIngPros = this.list(new LambdaQueryWrapper<JgUseRegistration>().notIn(JgUseRegistration::getStatus, NOT_FLOWING_STATE).select(BaseEntity::getSequenceNbr, JgUseRegistration::getProjectContraptionId));
Set<String> proIds = flowIngPros.stream().map(JgUseRegistration::getProjectContraptionId).collect(toSet());
proIds.remove(null);
proIds.remove("");
// 查询已纳管且使用登记证编号为空或者null且非流程中的装置
LambdaQueryWrapper<IdxBizJgProjectContraption> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IdxBizJgProjectContraption::getUseUnitCreditCode,useUnitCreditCode);
wrapper.eq(IdxBizJgProjectContraption::getIsIntoManagement, true);
wrapper.notIn(!proIds.isEmpty(), BaseEntity::getSequenceNbr, proIds);
wrapper.last("and (length(use_registration_code) = 0 or use_registration_code is null)");
return jgProjectContraptionService.page(page, wrapper);
}
public Map<String, Object> getDeviceListByProjectContraption(String projectContraptionSeq) {
IdxBizJgProjectContraption projectContraption = jgProjectContraptionService.getById(projectContraptionSeq);
Map<String, Object> re = new HashMap<>();
List<Map<String, Object>> equList = this.getBaseMapper().selectPieLineListByOfCanReg(projectContraptionSeq);
re.put("equipmentLists", equList);
re.put("projectContraption", projectContraption.getProjectContraption());
re.put("projectContraptionId", projectContraptionSeq);
re.put("projectContraptionNo", projectContraption.getProjectContraptionNo());
re.put("pipelineLength", projectContraption.getPipelineLength());
this.setPieLineInspectInfo(projectContraptionSeq, re);
this.setConstructionInfo(projectContraptionSeq, re);
return re;
}
private void setConstructionInfo(String projectContraptionSeq, Map<String, Object> re) {
LambdaQueryWrapper<IdxBizJgProjectConstruction> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IdxBizJgProjectConstruction::getProjectContraptionId, projectContraptionSeq)
.orderByDesc(IdxBizJgProjectConstruction::getUscDate).last("limit 1");
IdxBizJgProjectConstruction construction = idxBizJgProjectConstructionMapper.selectOne(queryWrapper);
if(construction != null){
re.put("installLeaderName", construction.getConstructionLeaderName());
re.put("installLeaderPhone",construction.getConstructionLeaderPhone());
re.put("installStartDate", construction.getUscDate());
re.put("installPropertyUnitName", construction.getConstructionLeaderName());
re.put("installProxyStatementAttachment", JSON.parse(construction.getProxyStatementAttachment()));
re.put("installContractAttachment", JSON.parse(construction.getConstructionContractAttachment()));
re.put("insOtherAccessories", JSON.parse(construction.getConstructionOtherAccessories()));
re.put("installStreet", construction.getStreetName());
re.put("installProvince", construction.getProvinceName());
re.put("installAddress", construction.getAddress());
re.put("installCity", construction.getCityName());
re.put("installIsXixian", construction.getIsXixian());
re.put("installCounty", construction.getCountyName());
re.put("uscUnitCreditCode", construction.getUscUnitCreditCode());
re.put("uscUnitName", construction.getUscUnitName());
}
}
private void setPieLineInspectInfo(String projectContraptionSeq, Map<String, Object> re) {
LambdaQueryWrapper<IdxBizJgProjectInspection> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IdxBizJgProjectInspection::getProjectContraptionId, projectContraptionSeq)
.orderByDesc(IdxBizJgProjectInspection::getInspectDate).last("limit 1");
IdxBizJgProjectInspection inspection = projectInspectionMapper.selectOne(queryWrapper);
if(inspection != null){
re.put("inspectOrgCode", inspection.getInspectOrgCode());
re.put("inspectOrgName", inspection.getInspectOrgCode());
re.put("inspectConclusion", inspection.getInspectConclusion());
re.put("inspectType", inspection.getInspectType());
re.put("inspectDate", inspection.getInspectDate());
re.put("inspectStaff", inspection.getInspectStaff());
re.put("nextInspectDate", inspection.getNextInspectDate());
re.put("inspectReport", JSON.parse(inspection.getInspectReport()));
re.put("inspectReportNo",inspection.getInspectReportNo());
// 返回代表是系统的数据,前端控制系统的检验信息不让编辑
re.put("jySeq",inspection.getSequenceNbr());
}
}
} }
\ No newline at end of file
...@@ -1496,10 +1496,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -1496,10 +1496,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 4.es的EQU_STATE, USE_ORG_CODE、ORG_BRANCH_CODE、ORG_BRANCH_NAME、STATUS // 4.es的EQU_STATE, USE_ORG_CODE、ORG_BRANCH_CODE、ORG_BRANCH_NAME、STATUS
this.rollBackForEquipEsInfo(record); this.rollBackForEquipEsInfo(record);
}); });
List<String> equipTransferIds = eqList.stream() Set<String> equipTransferIds = eqList.stream()
.map(JgVehicleInformationEq::getVehicleId) .map(JgVehicleInformationEq::getVehicleId)
.filter(Objects::nonNull) .filter(Objects::nonNull)
.collect(Collectors.toList()); .collect(Collectors.toSet());
if (!equipTransferIds.isEmpty()) { if (!equipTransferIds.isEmpty()) {
jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds); jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds);
} }
...@@ -1932,6 +1932,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -1932,6 +1932,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
.map(x -> new BigDecimal(String.valueOf(x.get("singleBottleVolume")))) .map(x -> new BigDecimal(String.valueOf(x.get("singleBottleVolume"))))
.reduce(BigDecimal.ZERO, BigDecimal::add); .reduce(BigDecimal.ZERO, BigDecimal::add);
vehicleInformation.setVolume(totalVolume.toPlainString()); vehicleInformation.setVolume(totalVolume.toPlainString());
vehicleInformation.setFillingMedium(equipmentLists.stream()
.findFirst()
.map(equipment -> String.valueOf(equipment.get("chargingMedium")))
.orElse(""));
vehicleInformation.setAuditPassDate(new Date()); vehicleInformation.setAuditPassDate(new Date());
// 登记证记录表主键 // 登记证记录表主键
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jg.api.dto.ChangeDataDto;
import com.yeejoin.amos.boot.module.jg.api.dto.PieLineDesignChangeDataDto;
import com.yeejoin.amos.boot.module.jg.api.dto.PipelineChangeItemDto;
import com.yeejoin.amos.boot.module.jg.api.dto.ProjectContraptionChangeDataDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class PieLineDataChangeServiceImpl {
private final CommonEquipDataProcessService commonEquipDataProcessService;
private final IdxBizJgProjectContraptionServiceImpl idxBizJgProjectContraptionServiceImpl;
private final EquipChangeDataUpdateService equipChangeDataUpdateService;
public PieLineDataChangeServiceImpl(CommonEquipDataProcessService commonEquipDataProcessService, IdxBizJgProjectContraptionServiceImpl idxBizJgProjectContraptionServiceImpl, EquipChangeDataUpdateService equipChangeDataUpdateService) {
this.commonEquipDataProcessService = commonEquipDataProcessService;
this.idxBizJgProjectContraptionServiceImpl = idxBizJgProjectContraptionServiceImpl;
this.equipChangeDataUpdateService = equipChangeDataUpdateService;
}
public void update(ProjectContraptionChangeDataDto projectContraptionChangeDataDtoNew, List<ChangeDataDto> allChangeColumns) {
// 原有对象行转列
ProjectContraptionChangeDataDto projectContraptionChangeDataDtoOld = getOldProjectContratData(projectContraptionChangeDataDtoNew);
List<ChangeDataDto> newProjectContraptionChangeData = commonEquipDataProcessService.convertBeanField2Column2(projectContraptionChangeDataDtoNew, projectContraptionChangeDataDtoNew.getProjectContraptionId());
// 新对象构造行转列
List<ChangeDataDto> oldProjectContraptionChangeData = commonEquipDataProcessService.convertBeanField2Column2(projectContraptionChangeDataDtoOld, projectContraptionChangeDataDtoNew.getProjectContraptionId());
// 数据比对记录变化字段列表
allChangeColumns.addAll(commonEquipDataProcessService.mergeChangeFields(newProjectContraptionChangeData, oldProjectContraptionChangeData));
// 数据入库
LambdaUpdateWrapper<IdxBizJgProjectContraption> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(BaseEntity::getSequenceNbr, projectContraptionChangeDataDtoNew.getProjectContraptionId());
updateWrapper.set(IdxBizJgProjectContraption::getProjectContraption, projectContraptionChangeDataDtoNew.getProjectContraption());
updateWrapper.set(IdxBizJgProjectContraption::getProjectContraptionNo, projectContraptionChangeDataDtoNew.getProjectContraptionNo());
updateWrapper.set(IdxBizJgProjectContraption::getPipelineLength, projectContraptionChangeDataDtoNew.getPipelineLength());
updateWrapper.set(IdxBizJgProjectContraption::getProductPhoto, projectContraptionChangeDataDtoNew.getProductPhoto());
updateWrapper.set(IdxBizJgProjectContraption::getOtherAccessories, projectContraptionChangeDataDtoNew.getOtherAccessories());
updateWrapper.set(IdxBizJgProjectContraption::getProductQualificationCertificate, projectContraptionChangeDataDtoNew.getProductQualificationCertificate());
idxBizJgProjectContraptionServiceImpl.update(null, updateWrapper);
}
private ProjectContraptionChangeDataDto getOldProjectContratData(ProjectContraptionChangeDataDto projectContraptionChangeDataDtoNew) {
IdxBizJgProjectContraption projectContraption = idxBizJgProjectContraptionServiceImpl.getById(projectContraptionChangeDataDtoNew.getProjectContraptionId());
return BeanUtil.copyProperties(projectContraption, ProjectContraptionChangeDataDto.class);
}
public void saveDesignForPieLine(String record, List<ChangeDataDto> allChangeColumns, PipelineChangeItemDto pipelineChangeItemDto) {
// 1.记录变化的数据对象
PieLineDesignChangeDataDto pieLineDesignChangeDataDto = BeanUtil.copyProperties(pipelineChangeItemDto, PieLineDesignChangeDataDto.class);
// 构造新对象行转列
List<ChangeDataDto> designInfoNew = commonEquipDataProcessService.buildDesignInfoNew(pieLineDesignChangeDataDto, record);
// 老数据查询行转列
List<ChangeDataDto> designInfoOld = commonEquipDataProcessService.buildDesignInfoOld(record);
allChangeColumns.addAll(commonEquipDataProcessService.mergeChangeFields(designInfoNew, designInfoOld));
// 2.更新管道的设计单位名称
equipChangeDataUpdateService.updatePieLineDesignData(record, pieLineDesignChangeDataDto);
}
public void updateEs(ProjectContraptionChangeDataDto projectContraptionChangeDataDto) {
equipChangeDataUpdateService.updateRegisterEsDataPieLine(projectContraptionChangeDataDto);
}
}
...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory; import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration; import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
...@@ -30,10 +31,13 @@ public class UseRegisterUpdateService { ...@@ -30,10 +31,13 @@ public class UseRegisterUpdateService {
private final JgRegistrationHistoryServiceImpl jgRegistrationHistoryService; private final JgRegistrationHistoryServiceImpl jgRegistrationHistoryService;
public UseRegisterUpdateService(IdxBizJgRegisterInfoMapper idxBizJgRegisterInfoMapper, JgUseRegistrationServiceImpl useRegistrationService, JgRegistrationHistoryServiceImpl jgRegistrationHistoryService) { private final IdxBizJgProjectContraptionServiceImpl idxBizJgProjectContraptionService;
public UseRegisterUpdateService(IdxBizJgRegisterInfoMapper idxBizJgRegisterInfoMapper, JgUseRegistrationServiceImpl useRegistrationService, JgRegistrationHistoryServiceImpl jgRegistrationHistoryService, IdxBizJgProjectContraptionServiceImpl idxBizJgProjectContraptionService) {
this.idxBizJgRegisterInfoMapper = idxBizJgRegisterInfoMapper; this.idxBizJgRegisterInfoMapper = idxBizJgRegisterInfoMapper;
this.useRegistrationService = useRegistrationService; this.useRegistrationService = useRegistrationService;
this.jgRegistrationHistoryService = jgRegistrationHistoryService; this.jgRegistrationHistoryService = jgRegistrationHistoryService;
this.idxBizJgProjectContraptionService = idxBizJgProjectContraptionService;
} }
public void updateHisData(String applyNo) { public void updateHisData(String applyNo) {
...@@ -82,6 +86,11 @@ public class UseRegisterUpdateService { ...@@ -82,6 +86,11 @@ public class UseRegisterUpdateService {
}); });
jsonObject.put("equipmentLists", result); jsonObject.put("equipmentLists", result);
} else { } else {
// 管道逻辑 更新装置、管道有关数据
IdxBizJgProjectContraption projectContraption = idxBizJgProjectContraptionService.getById(jgUseRegistration.getProjectContraptionId());
jsonObject.put("pipelineLength", projectContraption.getPipelineLength());
jsonObject.put("projectContraption",projectContraption.getProjectContraption());
jsonObject.put("projectContraptionNo", projectContraption.getProjectContraptionNo());
jsonObject.put("equipmentLists", useRegistrationService.getBaseMapper().queryForUnitPipelineEquipment(records)); jsonObject.put("equipmentLists", useRegistrationService.getBaseMapper().queryForUnitPipelineEquipment(records));
} }
} }
......
...@@ -989,61 +989,277 @@ ...@@ -989,61 +989,277 @@
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
<w:tc> <#if equipList.equList?string != '压力管道'>
<w:tcPr> <w:tc>
<w:tcW w:w="1680" w:type="pct"/> <w:tcPr>
<w:gridSpan w:val="2"/> <w:tcW w:w="1680" w:type="pct"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/> <w:gridSpan w:val="2"/>
<w:noWrap w:val="0"/> <w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:vAlign w:val="center"/> <w:noWrap w:val="0"/>
</w:tcPr> <w:vAlign w:val="center"/>
<w:p> </w:tcPr>
<w:pPr> <w:p>
<w:keepNext w:val="off"/> <w:pPr>
<w:keepLines w:val="off"/> <w:keepNext w:val="off"/>
<w:pageBreakBefore w:val="off"/> <w:keepLines w:val="off"/>
<w:widowControl w:val="off"/> <w:pageBreakBefore w:val="off"/>
<w:kinsoku/> <w:widowControl w:val="off"/>
<w:wordWrap/> <w:kinsoku/>
<w:overflowPunct/> <w:wordWrap/>
<w:topLinePunct w:val="off"/> <w:overflowPunct/>
<w:autoSpaceDE/> <w:topLinePunct w:val="off"/>
<w:autoSpaceDN/> <w:autoSpaceDE/>
<w:adjustRightInd/> <w:autoSpaceDN/>
<w:snapToGrid/> <w:adjustRightInd/>
<w:spacing w:line="240" w:line-rule="auto"/> <w:snapToGrid/>
<w:jc w:val="left"/> <w:spacing w:line="240" w:line-rule="auto"/>
<w:textAlignment w:val="auto"/> <w:jc w:val="left"/>
<w:rPr> <w:textAlignment w:val="auto"/>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/> <w:rPr>
<w:b/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:i w:val="off"/> <w:b-cs/>
<w:i-cs w:val="off"/> <w:i w:val="off"/>
<w:color w:val="262626"/> <w:i-cs w:val="off"/>
<w:kern w:val="0"/> <w:color w:val="262626"/>
<w:sz w:val="21"/> <w:kern w:val="0"/>
<w:sz-cs w:val="21"/> <w:sz w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz-cs w:val="21"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:pPr> </w:rPr>
<w:r> </w:pPr>
<w:rPr> <w:r>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/> <w:rPr>
<w:b/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:i w:val="off"/> <w:b-cs/>
<w:i-cs w:val="off"/> <w:i w:val="off"/>
<w:color w:val="262626"/> <w:i-cs w:val="off"/>
<w:kern w:val="0"/> <w:color w:val="262626"/>
<w:sz w:val="21"/> <w:kern w:val="0"/>
<w:sz-cs w:val="21"/> <w:sz w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz-cs w:val="21"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
<w:t>${(equipList.equipType)!''}</w:t> </w:rPr>
</w:r> <w:t>${(equipList.equipType)!''}</w:t>
</w:p> </w:r>
</w:tc> </w:p>
</w:tc>
</#if>
<#if equipList.equList?string = '压力管道'>
<w:tc>
<w:tcPr>
<w:tcW w:w="1680" w:type="pct"/>
<w:gridSpan w:val="2"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:noWrap w:val="0"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p>
<w:pPr>
<w:keepNext w:val="off"/>
<w:keepLines w:val="off"/>
<w:pageBreakBefore w:val="off"/>
<w:widowControl w:val="off"/>
<w:kinsoku/>
<w:wordWrap/>
<w:overflowPunct/>
<w:topLinePunct w:val="off"/>
<w:autoSpaceDE/>
<w:autoSpaceDN/>
<w:adjustRightInd/>
<w:snapToGrid/>
<w:spacing w:line="240" w:line-rule="auto"/>
<w:jc w:val="left"/>
<w:textAlignment w:val="auto"/>
<w:rPr>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b/>
<w:b-cs/>
<w:i w:val="off"/>
<w:i-cs w:val="off"/>
<w:color w:val="262626"/>
<w:kern w:val="0"/>
<w:sz w:val="21"/>
<w:sz-cs w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:rPr>
</w:pPr>
<#if equipList.equipTypeList?size == 1>
<#list equipList.equipTypeList as item1>
<w:r>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体" w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
<w:t>${item1}</w:t>
</w:r>
</#list>
</#if>
<#if equipList.equipTypeList?size == 2>
<#list equipList.equipTypeList as item1>
<w:tr>
<w:tblPrEx>
<w:tblBorders>
<w:top w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:left w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:bottom w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:right w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
</w:tblBorders>
<w:tblCellMar>
<w:top w:w="0" w:type="dxa"/>
<w:left w:w="108" w:type="dxa"/>
<w:bottom w:w="0" w:type="dxa"/>
<w:right w:w="108" w:type="dxa"/>
</w:tblCellMar>
</w:tblPrEx>
<w:trPr>
<w:trHeight w:val="490" w:hRule="atLeast"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="1340" w:type="dxa"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p>
<w:pPr>
<w:spacing w:line="240" w:lineRule="auto"/>
<w:jc w:val="left"/>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
<w:t>${item1}</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</#list>
</#if>
<#if equipList.equipTypeList?size == 3>
<#list equipList.equipTypeList as item1>
<w:tr>
<w:tblPrEx>
<w:tblBorders>
<w:top w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:left w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:bottom w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:right w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
</w:tblBorders>
<w:tblCellMar>
<w:top w:w="0" w:type="dxa"/>
<w:left w:w="108" w:type="dxa"/>
<w:bottom w:w="0" w:type="dxa"/>
<w:right w:w="108" w:type="dxa"/>
</w:tblCellMar>
</w:tblPrEx>
<w:trPr>
<w:trHeight w:val="321" w:hRule="atLeast"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="1349" w:type="dxa"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p>
<w:pPr>
<w:spacing w:line="240" w:lineRule="auto"/>
<w:jc w:val="left"/>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
<w:t>${item1}</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</#list>
</#if>
</w:p>
</w:tc>
</#if>
</w:tr> </w:tr>
<w:tr> <w:tr>
<w:tblPrEx> <w:tblPrEx>
...@@ -1191,61 +1407,277 @@ ...@@ -1191,61 +1407,277 @@
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
<w:tc> <#if equipList.equList?string != '压力管道'>
<w:tcPr> <w:tc>
<w:tcW w:w="1680" w:type="pct"/> <w:tcPr>
<w:gridSpan w:val="2"/> <w:tcW w:w="1680" w:type="pct"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/> <w:gridSpan w:val="2"/>
<w:noWrap w:val="0"/> <w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:vAlign w:val="center"/> <w:noWrap w:val="0"/>
</w:tcPr> <w:vAlign w:val="center"/>
<w:p> </w:tcPr>
<w:pPr> <w:p>
<w:keepNext w:val="off"/> <w:pPr>
<w:keepLines w:val="off"/> <w:keepNext w:val="off"/>
<w:pageBreakBefore w:val="off"/> <w:keepLines w:val="off"/>
<w:widowControl w:val="off"/> <w:pageBreakBefore w:val="off"/>
<w:kinsoku/> <w:widowControl w:val="off"/>
<w:wordWrap/> <w:kinsoku/>
<w:overflowPunct/> <w:wordWrap/>
<w:topLinePunct w:val="off"/> <w:overflowPunct/>
<w:autoSpaceDE/> <w:topLinePunct w:val="off"/>
<w:autoSpaceDN/> <w:autoSpaceDE/>
<w:adjustRightInd/> <w:autoSpaceDN/>
<w:snapToGrid/> <w:adjustRightInd/>
<w:spacing w:line="240" w:line-rule="auto"/> <w:snapToGrid/>
<w:jc w:val="left"/> <w:spacing w:line="240" w:line-rule="auto"/>
<w:textAlignment w:val="auto"/> <w:jc w:val="left"/>
<w:rPr> <w:textAlignment w:val="auto"/>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/> <w:rPr>
<w:b/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:i w:val="off"/> <w:b-cs/>
<w:i-cs w:val="off"/> <w:i w:val="off"/>
<w:color w:val="262626"/> <w:i-cs w:val="off"/>
<w:kern w:val="0"/> <w:color w:val="262626"/>
<w:sz w:val="21"/> <w:kern w:val="0"/>
<w:sz-cs w:val="21"/> <w:sz w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz-cs w:val="21"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:pPr> </w:rPr>
<w:r> </w:pPr>
<w:rPr> <w:r>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/> <w:rPr>
<w:b/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:i w:val="off"/> <w:b-cs/>
<w:i-cs w:val="off"/> <w:i w:val="off"/>
<w:color w:val="262626"/> <w:i-cs w:val="off"/>
<w:kern w:val="0"/> <w:color w:val="262626"/>
<w:sz w:val="21"/> <w:kern w:val="0"/>
<w:sz-cs w:val="21"/> <w:sz w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz-cs w:val="21"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
<w:t>${(equipList.produceCode)!''}</w:t> </w:rPr>
</w:r> <w:t>${(equipList.produceCode)!''}</w:t>
</w:p> </w:r>
</w:tc> </w:p>
</w:tc>
</#if>
<#if equipList.equList?string = '压力管道'>
<w:tc>
<w:tcPr>
<w:tcW w:w="1680" w:type="pct"/>
<w:gridSpan w:val="2"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:noWrap w:val="0"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p>
<w:pPr>
<w:keepNext w:val="off"/>
<w:keepLines w:val="off"/>
<w:pageBreakBefore w:val="off"/>
<w:widowControl w:val="off"/>
<w:kinsoku/>
<w:wordWrap/>
<w:overflowPunct/>
<w:topLinePunct w:val="off"/>
<w:autoSpaceDE/>
<w:autoSpaceDN/>
<w:adjustRightInd/>
<w:snapToGrid/>
<w:spacing w:line="240" w:line-rule="auto"/>
<w:jc w:val="left"/>
<w:textAlignment w:val="auto"/>
<w:rPr>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b/>
<w:b-cs/>
<w:i w:val="off"/>
<w:i-cs w:val="off"/>
<w:color w:val="262626"/>
<w:kern w:val="0"/>
<w:sz w:val="21"/>
<w:sz-cs w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:rPr>
</w:pPr>
<#if equipList.produceCodeList?size == 1>
<#list equipList.produceCodeList as item1>
<w:r>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体" w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
<w:t>${item1}</w:t>
</w:r>
</#list>
</#if>
<#if equipList.produceCodeList?size == 2>
<#list equipList.produceCodeList as item1>
<w:tr>
<w:tblPrEx>
<w:tblBorders>
<w:top w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:left w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:bottom w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:right w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
</w:tblBorders>
<w:tblCellMar>
<w:top w:w="0" w:type="dxa"/>
<w:left w:w="108" w:type="dxa"/>
<w:bottom w:w="0" w:type="dxa"/>
<w:right w:w="108" w:type="dxa"/>
</w:tblCellMar>
</w:tblPrEx>
<w:trPr>
<w:trHeight w:val="490" w:hRule="atLeast"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="1340" w:type="dxa"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p>
<w:pPr>
<w:spacing w:line="240" w:lineRule="auto"/>
<w:jc w:val="left"/>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
<w:t>${item1}</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</#list>
</#if>
<#if equipList.produceCodeList?size == 3>
<#list equipList.produceCodeList as item1>
<w:tr>
<w:tblPrEx>
<w:tblBorders>
<w:top w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:left w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:bottom w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
<w:right w:val="none" w:color="auto" w:sz="0"
w:space="0"/>
</w:tblBorders>
<w:tblCellMar>
<w:top w:w="0" w:type="dxa"/>
<w:left w:w="108" w:type="dxa"/>
<w:bottom w:w="0" w:type="dxa"/>
<w:right w:w="108" w:type="dxa"/>
</w:tblCellMar>
</w:tblPrEx>
<w:trPr>
<w:trHeight w:val="321" w:hRule="atLeast"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="1349" w:type="dxa"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p>
<w:pPr>
<w:spacing w:line="240" w:lineRule="auto"/>
<w:jc w:val="left"/>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体"
w:hAnsi="宋体"
w:cs="宋体"/>
<w:b/>
<w:bCs/>
<w:i w:val="0"/>
<w:iCs w:val="0"/>
<w:color w:val="262626" w:themeColor="text1"
w:themeTint="D9"/>
<w:kern w:val="0"/>
<w:sz w:val="18"/>
<w:szCs w:val="18"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
<w:t>${item1}</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</#list>
</#if>
</w:p>
</w:tc>
</#if>
</w:tr> </w:tr>
<w:tr> <w:tr>
<w:tblPrEx> <w:tblPrEx>
...@@ -1268,186 +1700,188 @@ ...@@ -1268,186 +1700,188 @@
<w:trHeight w:val="1134" w:h-rule="exact"/> <w:trHeight w:val="1134" w:h-rule="exact"/>
<w:jc w:val="center"/> <w:jc w:val="center"/>
</w:trPr> </w:trPr>
<w:tc> <#if equipList.equList?string != '压力管道'>
<w:tcPr> <w:tc>
<w:tcW w:w="809" w:type="pct"/> <w:tcPr>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/> <w:tcW w:w="809" w:type="pct"/>
<w:noWrap w:val="0"/> <w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:vAlign w:val="center"/> <w:noWrap w:val="0"/>
</w:tcPr> <w:vAlign w:val="center"/>
<w:p> </w:tcPr>
<w:pPr> <w:p>
<w:spacing w:line="240" w:line-rule="auto"/> <w:pPr>
<w:jc w:val="center"/> <w:spacing w:line="240" w:line-rule="auto"/>
<w:rPr> <w:jc w:val="center"/>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:fareast="宋体" w:cs="宋体" <w:rPr>
w:hint="fareast"/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:fareast="宋体" w:cs="宋体"
<w:b/> w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:kern w:val="0"/> <w:b-cs/>
<w:sz w:val="24"/> <w:kern w:val="0"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz w:val="24"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:pPr> </w:rPr>
<w:r> </w:pPr>
<w:rPr> <w:r>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:fareast="宋体" w:cs="宋体" <w:rPr>
w:hint="fareast"/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:fareast="宋体" w:cs="宋体"
<w:b/> w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:kern w:val="0"/> <w:b-cs/>
<w:sz w:val="24"/> <w:kern w:val="0"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz w:val="24"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
<w:t>设备制造单位全称</w:t> </w:rPr>
</w:r> <w:t>设备制造单位全称</w:t>
</w:p> </w:r>
</w:tc> </w:p>
<w:tc> </w:tc>
<w:tcPr> <w:tc>
<w:tcW w:w="1700" w:type="pct"/> <w:tcPr>
<w:gridSpan w:val="2"/> <w:tcW w:w="1700" w:type="pct"/>
<w:shd w:val="clear" w:color="auto" w:fill="FFFFFF"/> <w:gridSpan w:val="2"/>
<w:noWrap w:val="0"/> <w:shd w:val="clear" w:color="auto" w:fill="FFFFFF"/>
<w:vAlign w:val="center"/> <w:noWrap w:val="0"/>
</w:tcPr> <w:vAlign w:val="center"/>
<w:p> </w:tcPr>
<w:pPr> <w:p>
<w:keepNext w:val="off"/> <w:pPr>
<w:keepLines w:val="off"/> <w:keepNext w:val="off"/>
<w:pageBreakBefore w:val="off"/> <w:keepLines w:val="off"/>
<w:widowControl w:val="off"/> <w:pageBreakBefore w:val="off"/>
<w:kinsoku/> <w:widowControl w:val="off"/>
<w:wordWrap/> <w:kinsoku/>
<w:overflowPunct/> <w:wordWrap/>
<w:topLinePunct w:val="off"/> <w:overflowPunct/>
<w:autoSpaceDE/> <w:topLinePunct w:val="off"/>
<w:autoSpaceDN/> <w:autoSpaceDE/>
<w:adjustRightInd/> <w:autoSpaceDN/>
<w:snapToGrid/> <w:adjustRightInd/>
<w:spacing w:line="240" w:line-rule="auto"/> <w:snapToGrid/>
<w:jc w:val="left"/> <w:spacing w:line="240" w:line-rule="auto"/>
<w:textAlignment w:val="auto"/> <w:jc w:val="left"/>
<w:rPr> <w:textAlignment w:val="auto"/>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/> <w:rPr>
<w:b/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:i w:val="off"/> <w:b-cs/>
<w:i-cs w:val="off"/> <w:i w:val="off"/>
<w:color w:val="262626"/> <w:i-cs w:val="off"/>
<w:kern w:val="0"/> <w:color w:val="262626"/>
<w:sz w:val="21"/> <w:kern w:val="0"/>
<w:sz-cs w:val="21"/> <w:sz w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz-cs w:val="21"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:pPr> </w:rPr>
<w:r> </w:pPr>
<w:rPr> <w:r>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/> <w:rPr>
<w:b/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:i w:val="off"/> <w:b-cs/>
<w:i-cs w:val="off"/> <w:i w:val="off"/>
<w:color w:val="262626"/> <w:i-cs w:val="off"/>
<w:kern w:val="0"/> <w:color w:val="262626"/>
<w:sz w:val="21"/> <w:kern w:val="0"/>
<w:sz-cs w:val="21"/> <w:sz w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz-cs w:val="21"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
<w:t>${(equipList.produceUnitName)!''}</w:t> </w:rPr>
</w:r> <w:t>${(equipList.produceUnitName)!''}</w:t>
</w:p> </w:r>
</w:tc> </w:p>
<w:tc> </w:tc>
<w:tcPr> <w:tc>
<w:tcW w:w="809" w:type="pct"/> <w:tcPr>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/> <w:tcW w:w="809" w:type="pct"/>
<w:noWrap w:val="0"/> <w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:vAlign w:val="center"/> <w:noWrap w:val="0"/>
</w:tcPr> <w:vAlign w:val="center"/>
<w:p> </w:tcPr>
<w:pPr> <w:p>
<w:spacing w:line="240" w:line-rule="auto"/> <w:pPr>
<w:jc w:val="center"/> <w:spacing w:line="240" w:line-rule="auto"/>
<w:rPr> <w:jc w:val="center"/>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:fareast="宋体" w:cs="宋体" <w:rPr>
w:hint="fareast"/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:fareast="宋体" w:cs="宋体"
<w:b/> w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:kern w:val="0"/> <w:b-cs/>
<w:sz w:val="24"/> <w:kern w:val="0"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz w:val="24"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:pPr> </w:rPr>
<w:r> </w:pPr>
<w:rPr> <w:r>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:fareast="宋体" w:cs="宋体" <w:rPr>
w:hint="fareast"/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:fareast="宋体" w:cs="宋体"
<w:b/> w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:kern w:val="0"/> <w:b-cs/>
<w:sz w:val="24"/> <w:kern w:val="0"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz w:val="24"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
<w:t>制造许可证编号</w:t> </w:rPr>
</w:r> <w:t>制造许可证编号</w:t>
</w:p> </w:r>
</w:tc> </w:p>
<w:tc> </w:tc>
<w:tcPr> <w:tc>
<w:tcW w:w="1680" w:type="pct"/> <w:tcPr>
<w:gridSpan w:val="2"/> <w:tcW w:w="1680" w:type="pct"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/> <w:gridSpan w:val="2"/>
<w:noWrap w:val="0"/> <w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:vAlign w:val="center"/> <w:noWrap w:val="0"/>
</w:tcPr> <w:vAlign w:val="center"/>
<w:p> </w:tcPr>
<w:pPr> <w:p>
<w:keepNext w:val="off"/> <w:pPr>
<w:keepLines w:val="off"/> <w:keepNext w:val="off"/>
<w:pageBreakBefore w:val="off"/> <w:keepLines w:val="off"/>
<w:widowControl w:val="off"/> <w:pageBreakBefore w:val="off"/>
<w:kinsoku/> <w:widowControl w:val="off"/>
<w:wordWrap/> <w:kinsoku/>
<w:overflowPunct/> <w:wordWrap/>
<w:topLinePunct w:val="off"/> <w:overflowPunct/>
<w:autoSpaceDE/> <w:topLinePunct w:val="off"/>
<w:autoSpaceDN/> <w:autoSpaceDE/>
<w:adjustRightInd/> <w:autoSpaceDN/>
<w:snapToGrid/> <w:adjustRightInd/>
<w:spacing w:line="240" w:line-rule="auto"/> <w:snapToGrid/>
<w:jc w:val="left"/> <w:spacing w:line="240" w:line-rule="auto"/>
<w:textAlignment w:val="auto"/> <w:jc w:val="left"/>
<w:rPr> <w:textAlignment w:val="auto"/>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/> <w:rPr>
<w:b/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:i w:val="off"/> <w:b-cs/>
<w:i-cs w:val="off"/> <w:i w:val="off"/>
<w:color w:val="262626"/> <w:i-cs w:val="off"/>
<w:kern w:val="0"/> <w:color w:val="262626"/>
<w:sz w:val="21"/> <w:kern w:val="0"/>
<w:sz-cs w:val="21"/> <w:sz w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz-cs w:val="21"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:pPr> </w:rPr>
<w:r> </w:pPr>
<w:rPr> <w:r>
<w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/> <w:rPr>
<w:b/> <w:rFonts w:ascii="宋体" w:h-ansi="宋体" w:cs="宋体" w:hint="fareast"/>
<w:b-cs/> <w:b/>
<w:i w:val="off"/> <w:b-cs/>
<w:i-cs w:val="off"/> <w:i w:val="off"/>
<w:color w:val="262626"/> <w:i-cs w:val="off"/>
<w:kern w:val="0"/> <w:color w:val="262626"/>
<w:sz w:val="21"/> <w:kern w:val="0"/>
<w:sz-cs w:val="21"/> <w:sz w:val="21"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:sz-cs w:val="21"/>
</w:rPr> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
<w:t>${(equipList.produceLicenseNum)!''}</w:t> </w:rPr>
</w:r> <w:t>${(equipList.produceLicenseNum)!''}</w:t>
</w:p> </w:r>
</w:tc> </w:p>
</w:tc>
</#if>
</w:tr> </w:tr>
<w:tr> <w:tr>
<w:tblPrEx> <w:tblPrEx>
......
...@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
...@@ -53,18 +52,14 @@ import org.springframework.stereotype.Service; ...@@ -53,18 +52,14 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.exception.instance.TooManyRequests; import org.typroject.tyboot.core.restful.exception.instance.TooManyRequests;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException; import java.text.ParseException;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -134,7 +129,7 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -134,7 +129,7 @@ public class TzBaseEnterpriseInfoServiceImpl
// 使用单位资质 // 使用单位资质
COMPANY_TYPE_CERT_TYPE_MAP.put("使用单位", "1232"); COMPANY_TYPE_CERT_TYPE_MAP.put("使用单位", "1232");
// 检验检测机构资质:细分为1233-1、1233-2 // 检验检测机构资质:细分为1233-1、1233-2
COMPANY_TYPE_CERT_TYPE_MAP.put("检验检测机构", "1233"); COMPANY_TYPE_CERT_TYPE_MAP.put("检验检测机构", "1233-1,1233-2");
// 安装改造维修单位身份资质:充装单位-1231 制造单位-1236 设计单位-1235 安装改造维修单位-1234 // 安装改造维修单位身份资质:充装单位-1231 制造单位-1236 设计单位-1235 安装改造维修单位-1234
COMPANY_TYPE_CERT_TYPE_MAP.put("安装改造维修单位", "1231,1234,1235,1236"); COMPANY_TYPE_CERT_TYPE_MAP.put("安装改造维修单位", "1231,1234,1235,1236");
} }
...@@ -713,14 +708,21 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -713,14 +708,21 @@ public class TzBaseEnterpriseInfoServiceImpl
private void saveLicenceData(Map<String, Object> map) { private void saveLicenceData(Map<String, Object> map) {
List<BaseUnitLicence> licences = Lists.newArrayList(); List<BaseUnitLicence> licences = Lists.newArrayList();
List<DataDictionary> dictionaries = regUnitInfoService.initAllDataDictionaryList(); List<DataDictionary> dictionaries = regUnitInfoService.initAllDataDictionaryList();
JSON.parseArray(JSON.toJSONString(map.get("unitLicences"))).forEach(obj -> { Object unitLicences = map.get("unitLicences");
BaseUnitLicence baseUnitLicence = JSON.toJavaObject((JSONObject)obj, BaseUnitLicence.class); if (unitLicences instanceof Collection && !((Collection<?>) unitLicences).isEmpty()) {
baseUnitLicence.setUnitCode(ObjectUtils.isEmpty(map.get("useCode")) ? null : (String)map.get("useCode")); JSON.parseArray(JSON.toJSONString(unitLicences)).forEach(obj -> {
baseUnitLicence.setUnitName(ObjectUtils.isEmpty(map.get("useUnit")) ? null : (String)map.get("useUnit")); BaseUnitLicence baseUnitLicence = JSON.toJavaObject((JSONObject) obj, BaseUnitLicence.class);
// 处理许可字典值对应名称 if (ObjectUtils.isEmpty(baseUnitLicence.getCertTypeCode())) {
handleDictName(baseUnitLicence, dictionaries); throw new BadRequest("请完善资质/许可信息后保存!");
licences.add(baseUnitLicence); }
}); baseUnitLicence.setUnitCode(ObjectUtils.isEmpty(map.get("useCode")) ? null : (String) map.get("useCode"));
baseUnitLicence.setUnitName(ObjectUtils.isEmpty(map.get("useUnit")) ? null : (String) map.get("useUnit"));
// 处理许可字典值对应名称
handleDictName(baseUnitLicence, dictionaries);
// 添加到结果集合
licences.add(baseUnitLicence);
});
}
if (!ValidationUtil.isEmpty(licences)){ if (!ValidationUtil.isEmpty(licences)){
baseUnitLicenceService.saveOrUpdateBatch(licences); baseUnitLicenceService.saveOrUpdateBatch(licences);
} }
......
package com.yeejoin.amos.boot.module.ymt.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 工程装置-施工信息表
*
* @author system_generator
* @date 2024-12-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "IdxBizJgProjectConstructionDto", description = "工程装置-施工信息表")
public class IdxBizJgProjectConstructionDto extends BaseDto {
private static final long serialVersionUID = 1L;
private String record;
private Date recDate;
private String recUserId;
private String instanceId;
private String status;
@ApiModelProperty(value = "施工类型")
private String constructionType;
@ApiModelProperty(value = "施工单位统一社会信用代码")
private String uscUnitCreditCode;
@ApiModelProperty(value = "施工单位名称")
private String uscUnitName;
@ApiModelProperty(value = "施工时间")
private Date uscDate;
@ApiModelProperty(value = "工程装置唯一标识")
private String sequenceCode;
@ApiModelProperty(value = "告知业务id")
private String noticeId;
@ApiModelProperty(value = "告知书编号")
private String informCode;
@ApiModelProperty(value = "告知书路径")
private String informFilePath;
@ApiModelProperty(value = "施工负责人ID")
private String constructionLeaderId;
@ApiModelProperty(value = "施工负责人")
private String constructionLeaderName;
@ApiModelProperty(value = "施工负责人手机")
private String constructionLeaderPhone;
@ApiModelProperty(value = "施工委托书图片")
private String proxyStatementAttachment;
@ApiModelProperty(value = "施工合同照片")
private String constructionContractAttachment;
@ApiModelProperty(value = "其他附件")
private String constructionOtherAccessories;
@ApiModelProperty(value = "关联设备ids")
private String equipRecords;
@ApiModelProperty(value = "工程装置ID")
private String projectContraptionId;
@ApiModelProperty(value = "使用详细地址")
private String address;
@ApiModelProperty(value = "使用地点_省")
private String provinceName;
@ApiModelProperty(value = "使用地点_市")
private String cityName;
@ApiModelProperty(value = "使用地点_区")
private String countyName;
@ApiModelProperty(value = "使用地点_街道")
private String streetName;
@ApiModelProperty(value = "是否西咸:0-否;1-是")
private String isXixian;
}
package com.yeejoin.amos.boot.module.ymt.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 2024-12-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "IdxBizJgProjectContraptionDto", description = "管道工程装置表")
public class IdxBizJgProjectContraptionDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "工程装置名称")
private String projectContraption;
@ApiModelProperty(value = "工程装置编号")
private String projectContraptionNo;
@ApiModelProperty(value = "使用单位名称")
private String useUnitCreditCode;
@ApiModelProperty(value = "使用单位统一信用代码")
private String useUnitName;
@ApiModelProperty(value = "施工单位统一信用代码")
private String uscUnitCreditCode;
@ApiModelProperty(value = "施工单位名称")
private String uscUnitName;
@ApiModelProperty(value = "设备种类代码")
private String equListCode;
@ApiModelProperty(value = "设备种类")
private String equList;
@ApiModelProperty(value = "设备类别代码")
private String equCategoryCode;
@ApiModelProperty(value = "设备代码")
private String equCategory;
@ApiModelProperty(value = "设备品种代码")
private String equDefineCode;
@ApiModelProperty(value = "设备品种")
private String equDefine;
@ApiModelProperty(value = "设备汇总表信息")
private String content;
@ApiModelProperty(value = "装置管道总长度(m)")
private Double pipelineLength;
@ApiModelProperty(value = "产品照片附件")
private String productPhoto;
@ApiModelProperty(value = "其他附件")
private String otherAccessories;
@ApiModelProperty(value = "属地监管单位代码")
private String orgCode;
@ApiModelProperty(value = "属地监管单位名称")
private String orgName;
@ApiModelProperty(value = "产品质量合格证明")
private String productQualificationCertificate;
@ApiModelProperty(value = "使用地点代码_省")
private String province;
@ApiModelProperty(value = "使用地点代码_市")
private String city;
@ApiModelProperty(value = "使用地点代码_区(县)")
private String county;
@ApiModelProperty(value = "使用地点代码_街道(镇)")
private String street;
@ApiModelProperty(value = "使用详细地址")
private String address;
@ApiModelProperty(value = "使用地点_省")
private String provinceName;
@ApiModelProperty(value = "使用地点_市")
private String cityName;
@ApiModelProperty(value = "使用地点_区")
private String countyName;
@ApiModelProperty(value = "使用地点_街道")
private String streetName;
@ApiModelProperty(value = "装置起始位置")
private String startLatitudeLongitude;
@ApiModelProperty(value = "装置结束位置")
private String endLatitudeLongitude;
@ApiModelProperty(value = "监管码")
private String supervisoryCode;
@ApiModelProperty(value = "使用登记证编号")
private String useRegistrationCode;
@ApiModelProperty("是否是否纳管:true - 已纳管 false-未纳管")
private Boolean isIntoManagement;
@ApiModelProperty("数据来源(新增:0、导入:1、复制:复制数据的id 、jg:从监管加入的设备)")
private String dataSource;
@ApiModelProperty("设备代码")
private String equCode;
@ApiModelProperty("投入日期")
private String useDate;
}
package com.yeejoin.amos.boot.module.ymt.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 工程装置-检验检测信息表
*
* @author system_generator
* @date 2024-12-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "IdxBizJgProjectInspectionDto", description = "工程装置-检验检测信息表")
public class IdxBizJgProjectInspectionDto extends BaseDto {
private static final long serialVersionUID = 1L;
private String record;
private Date recDate;
private String recUserId;
private String instanceId;
private String status;
@ApiModelProperty(value = "检验类型")
private String inspectType;
@ApiModelProperty(value = "检验机构名称")
private String inspectOrgName;
@ApiModelProperty(value = "检验报告")
private String inspectReport;
@ApiModelProperty(value = "检验人员")
private String inspectStaff;
@ApiModelProperty(value = "检验日期")
private Date inspectDate;
@ApiModelProperty(value = "检验结论")
private String inspectConclusion;
@ApiModelProperty(value = "安全状况等级")
private String safetyLevel;
@ApiModelProperty(value = "检验问题备注")
private String problemRemark;
@ApiModelProperty(value = "下次检验日期")
private Date nextInspectDate;
@ApiModelProperty(value = "工程装置唯一标识")
private String sequenceCode;
@ApiModelProperty(value = "检验机构统一信用代码")
private String inspectOrgCode;
@ApiModelProperty(value = "检验报告编号")
private String inspectReportNo;
@ApiModelProperty(value = "检验人员主键多个逗号分割")
private String inspectStaffCode;
@ApiModelProperty(value = "关联设备ids")
private String equipRecord;
@ApiModelProperty(value = "检验申请单编号")
private String inspectApplyNo;
@ApiModelProperty(value = "工程装置ID")
private String projectContraptionId;
}
package com.yeejoin.amos.boot.module.ymt.api.dto; package com.yeejoin.amos.boot.module.ymt.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -92,4 +91,8 @@ public class IdxBizJgRegisterInfoDto extends BaseDto { ...@@ -92,4 +91,8 @@ public class IdxBizJgRegisterInfoDto extends BaseDto {
@ApiModelProperty(value = "检验是否在有限期内:1-有限期内 ;2-不在有效期内【历史无证设备需要】") @ApiModelProperty(value = "检验是否在有限期内:1-有限期内 ;2-不在有效期内【历史无证设备需要】")
private String inInspectionPeriod; private String inInspectionPeriod;
@ApiModelProperty(value = "安装资料是否完整齐全:1-齐全;2-不齐全【历史无证设备需要】")
private String installationIsComplete;
} }
...@@ -34,10 +34,11 @@ public class EquipTechParamPipeline extends AbstractEquipBaseEntity { ...@@ -34,10 +34,11 @@ public class EquipTechParamPipeline extends AbstractEquipBaseEntity {
@TableField(value = "\"STATUS\"") @TableField(value = "\"STATUS\"")
private String status; private String status;
/** /**
* * 工程(装置)名称 * * 工程(装置)名称--废弃,以use_info表为准
*/ */
@Deprecated
@TableField(value = "\"DEVICE_NAME\"") @TableField(value = "\"DEVICE_NAME\"")
private String deviceName; private String deviceName;
/** /**
......
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.TzsBaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 工程装置-施工信息表
*
* @author system_generator
* @date 2024-12-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_project_construction")
public class IdxBizJgProjectConstruction extends TzsBaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField("\"RECORD\"")
private String record;
/**
*
*/
@TableField("\"INSTANCE_ID\"")
private String instanceId;
/**
*
*/
@TableField("\"STATUS\"")
private String status;
/**
* 施工类型
*/
@TableField("\"CONSTRUCTION_TYPE\"")
private String constructionType;
/**
* 施工单位统一社会信用代码
*/
@TableField("\"USC_UNIT_CREDIT_CODE\"")
private String uscUnitCreditCode;
/**
* 施工单位名称
*/
@TableField("\"USC_UNIT_NAME\"")
private String uscUnitName;
/**
* 施工时间
*/
@TableField("\"USC_DATE\"")
private Date uscDate;
/**
* 工程装置唯一标识
*/
@TableField("\"SEQUENCE_CODE\"")
private String sequenceCode;
/**
* 告知业务id
*/
@TableField("\"NOTICE_ID\"")
private String noticeId;
/**
* 告知书编号
*/
@TableField("\"INFORM_CODE\"")
private String informCode;
/**
* 告知书路径
*/
@TableField("\"INFORM_FILE_PATH\"")
private String informFilePath;
/**
* 施工负责人ID
*/
@TableField("\"CONSTRUCTION_LEADER_ID\"")
private String constructionLeaderId;
/**
* 施工负责人
*/
@TableField("\"CONSTRUCTION_LEADER_NAME\"")
private String constructionLeaderName;
/**
* 施工负责人手机
*/
@TableField("\"CONSTRUCTION_LEADER_PHONE\"")
private String constructionLeaderPhone;
/**
* 施工委托书图片
*/
@TableField("\"PROXY_STATEMENT_ATTACHMENT\"")
private String proxyStatementAttachment;
/**
* 施工合同照片
*/
@TableField("\"CONSTRUCTION_CONTRACT_ATTACHMENT\"")
private String constructionContractAttachment;
/**
* 其他附件
*/
@TableField("\"CONSTRUCTION_OTHER_ACCESSORIES\"")
private String constructionOtherAccessories;
/**
* 关联设备ids
*/
@TableField("\"EQUIP_RECORDS\"")
private String equipRecords;
/**
* 工程装置ID
*/
@TableField("\"PROJECT_CONTRAPTION_ID\"")
private String projectContraptionId;
/**
* 使用详细地址
*/
@TableField("\"ADDRESS\"")
private String address;
/**
* 使用地点_省
*/
@TableField("\"PROVINCE_NAME\"")
private String provinceName;
/**
* 使用地点_市
*/
@TableField("\"CITY_NAME\"")
private String cityName;
/**
* 使用地点_区
*/
@TableField("\"COUNTY_NAME\"")
private String countyName;
/**
* 使用地点_街道
*/
@TableField("\"STREET_NAME\"")
private String streetName;
/**
* 是否西咸:0-否;1-是
*/
@TableField("\"IS_XIXIAN\"")
private String isXixian;
}
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 lombok.*;
import lombok.experimental.Accessors;
/**
* 管道工程装置表
*
* @author system_generator
* @date 2024-12-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("idx_biz_jg_project_contraption")
public class IdxBizJgProjectContraption extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 工程装置名称
*/
@TableField("project_contraption")
private String projectContraption;
/**
* 工程装置编号
*/
@TableField("project_contraption_no")
private String projectContraptionNo;
/**
* 使用单位名称
*/
@TableField("use_unit_credit_code")
private String useUnitCreditCode;
/**
* 使用单位统一信用代码
*/
@TableField("use_unit_name")
private String useUnitName;
/**
* 施工单位统一信用代码
*/
@TableField("usc_unit_credit_code")
private String uscUnitCreditCode;
/**
* 施工单位名称
*/
@TableField("usc_unit_name")
private String uscUnitName;
/**
* 设备种类名称
*/
@TableField("equ_list_name")
private String equListName;
/**
* 设备种类
*/
@TableField("equ_list")
private String equList;
/**
* 设备类别名称
*/
@TableField("equ_category_name")
private String equCategoryName;
/**
* 设备代码
*/
@TableField("equ_category")
private String equCategory;
/**
* 设备品种名称
*/
@TableField("equ_define_name")
private String equDefineName;
/**
* 设备品种
*/
@TableField("equ_define")
private String equDefine;
/**
* 设备汇总表信息
*/
@TableField("content")
private String content;
/**
* 装置管道总长度(m)
*/
@TableField("pipeline_length")
private Double pipelineLength;
/**
* 产品照片附件
*/
@TableField("product_photo")
private String productPhoto;
/**
* 其他附件
*/
@TableField("other_accessories")
private String otherAccessories;
/**
* 属地监管单位代码
*/
@TableField("org_code")
private String orgCode;
/**
* 属地监管单位名称
*/
@TableField("org_name")
private String orgName;
/**
* 产品质量合格证明
*/
@TableField("product_qualification_certificate")
private String productQualificationCertificate;
/**
* 使用地点代码_省
*/
@TableField("province")
private String province;
/**
* 使用地点代码_市
*/
@TableField("city")
private String city;
/**
* 使用地点代码_区(县)
*/
@TableField("county")
private String county;
/**
* 使用地点代码_街道(镇)
*/
@TableField("street")
private String street;
/**
* 使用详细地址
*/
@TableField("address")
private String address;
/**
* 使用地点_省
*/
@TableField("province_name")
private String provinceName;
/**
* 使用地点_市
*/
@TableField("city_name")
private String cityName;
/**
* 使用地点_区
*/
@TableField("county_name")
private String countyName;
/**
* 使用地点_街道
*/
@TableField("street_name")
private String streetName;
/**
* 装置起始位置
*/
@TableField("start_latitude_longitude")
private String startLatitudeLongitude;
/**
* 装置结束位置
*/
@TableField("end_latitude_longitude")
private String endLatitudeLongitude;
/**
* 监管码
*/
@TableField("supervisory_code")
private String supervisoryCode;
/**
* 使用登记证编号
*/
@TableField("use_registration_code")
private String useRegistrationCode;
/**
* 是否是否纳管:true - 已纳管 false-未纳管
*/
@TableField("is_into_management")
private Boolean isIntoManagement;
/**
* 数据来源(新增:0、导入:1、复制:复制数据的id 、jg:从监管加入的设备)
*/
@TableField("data_source")
private String dataSource;
/**
* 数据来源名字
*/
@TableField(exist = false)
private String dataSourceName;
/**
* 是否可编辑
*/
@TableField(exist = false)
private Boolean canEdit;
/**
* 是否可删除
*/
@TableField(exist = false)
private Boolean canDelete;
/**
* 使用地址
*/
@TableField(exist = false)
private String fullAddress;
/**
* 工程装置设备代码
*/
@TableField("equ_code")
private String equCode;
/**
* 投入日期
*/
@TableField("use_date")
private String useDate;
}
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.TzsBaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 工程装置-检验检测信息表
*
* @author system_generator
* @date 2024-12-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_project_inspection")
public class IdxBizJgProjectInspection extends TzsBaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField("\"RECORD\"")
private String record;
/**
*
*/
@TableField("\"INSTANCE_ID\"")
private String instanceId;
/**
*
*/
@TableField("\"STATUS\"")
private String status;
/**
* 检验类型
*/
@TableField("\"INSPECT_TYPE\"")
private String inspectType;
/**
* 检验机构名称
*/
@TableField("\"INSPECT_ORG_NAME\"")
private String inspectOrgName;
/**
* 检验报告
*/
@TableField("\"INSPECT_REPORT\"")
private String inspectReport;
/**
* 检验人员
*/
@TableField("\"INSPECT_STAFF\"")
private String inspectStaff;
/**
* 检验日期
*/
@TableField("\"INSPECT_DATE\"")
private Date inspectDate;
/**
* 检验结论
*/
@TableField("\"INSPECT_CONCLUSION\"")
private String inspectConclusion;
/**
* 安全状况等级
*/
@TableField("\"SAFETY_LEVEL\"")
private String safetyLevel;
/**
* 检验问题备注
*/
@TableField("\"PROBLEM_REMARK\"")
private String problemRemark;
/**
* 下次检验日期
*/
@TableField("\"NEXT_INSPECT_DATE\"")
private Date nextInspectDate;
/**
* 工程装置唯一标识
*/
@TableField("\"SEQUENCE_CODE\"")
private String sequenceCode;
/**
* 检验机构统一信用代码
*/
@TableField("\"INSPECT_ORG_CODE\"")
private String inspectOrgCode;
/**
* 检验报告编号
*/
@TableField("\"INSPECT_REPORT_NO\"")
private String inspectReportNo;
/**
* 检验人员主键多个逗号分割
*/
@TableField("\"INSPECT_STAFF_CODE\"")
private String inspectStaffCode;
/**
* 关联设备ids
*/
@TableField("\"EQUIP_RECORD\"")
private String equipRecord;
/**
* 检验申请单编号
*/
@TableField("\"INSPECT_APPLY_NO\"")
private String inspectApplyNo;
/**
* 工程装置ID
*/
@TableField("\"PROJECT_CONTRAPTION_ID\"")
private String projectContraptionId;
}
...@@ -216,5 +216,11 @@ public class IdxBizJgRegisterInfo extends TzsBaseEntity { ...@@ -216,5 +216,11 @@ public class IdxBizJgRegisterInfo extends TzsBaseEntity {
@TableField("\"IN_INSPECTION_PERIOD\"") @TableField("\"IN_INSPECTION_PERIOD\"")
private String inInspectionPeriod; private String inInspectionPeriod;
/**
* 安装资料是否完整齐全:1-齐全;2-不齐全【历史无证设备需要】
*/
@TableField("\"INSTALLATION_IS_COMPLETE\"")
private String installationIsComplete;
} }
...@@ -111,19 +111,19 @@ public class IdxBizJgTechParamsPipeline extends TzsBaseEntity { ...@@ -111,19 +111,19 @@ public class IdxBizJgTechParamsPipeline extends TzsBaseEntity {
private String endPosition; private String endPosition;
/** /**
* * 设计-介质
*/ */
@TableField("\"PRESSURE\"") @TableField("\"PRESSURE\"")
private String pressure; private String pressure;
/** /**
* * 设计-介质
*/ */
@TableField("\"TEMPERATURE\"") @TableField("\"TEMPERATURE\"")
private String temperature; private String temperature;
/** /**
* * 设计-介质
*/ */
@TableField("\"MEDIUM\"") @TableField("\"MEDIUM\"")
private String medium; private String medium;
......
...@@ -273,4 +273,10 @@ public class IdxBizJgUseInfo extends TzsBaseEntity { ...@@ -273,4 +273,10 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
@TableField("\"O_REG_DATE\"") @TableField("\"O_REG_DATE\"")
private String oRegDate; private String oRegDate;
/**
* 工程装置ID
*/
@TableField("\"PROJECT_CONTRAPTION_ID\"")
private String projectContraptionId;
} }
...@@ -26,6 +26,8 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -26,6 +26,8 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
@Select("SELECT * FROM tz_equipment_category WHERE code NOT LIKE '7%' ORDER BY parent_id") @Select("SELECT * FROM tz_equipment_category WHERE code NOT LIKE '7%' ORDER BY parent_id")
List<EquipmentCategoryDto> selectClassifyNoStart7(); List<EquipmentCategoryDto> selectClassifyNoStart7();
@Select("SELECT * FROM tz_equipment_category WHERE code NOT LIKE '7%' AND code NOT LIKE '8%' ORDER BY parent_id")
List<EquipmentCategoryDto> selectClassifyNoStart7And8();
@Select("select * from tz_equipment_category where code in('1000','2000','3000','4000','5000','6000','8000','9000')") @Select("select * from tz_equipment_category where code in('1000','2000','3000','4000','5000','6000','8000','9000')")
List<EquipmentCategoryDto> selectClassify(); List<EquipmentCategoryDto> selectClassify();
...@@ -96,5 +98,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -96,5 +98,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
List<String> selectXiXianNew(); List<String> selectXiXianNew();
@Select("SELECT * FROM tz_equipment_category WHERE parent_id = #{parentId}")
List<EquipmentCategoryDto> getEquDefineByParentId(String parentId);
} }
package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectConstruction;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 工程装置-施工信息表 Mapper 接口
*
* @author system_generator
* @date 2024-12-12
*/
public interface IdxBizJgProjectConstructionMapper extends BaseMapper<IdxBizJgProjectConstruction> {
}
package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 管道工程装置表 Mapper 接口
*
* @author system_generator
* @date 2024-12-11
*/
public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgProjectContraption> {
Map<String, Object> getDetail(@Param("sequenceNbr") String sequenceNbr);
List<Map<String, Object>> selectEquipList(@Param("sequenceNbr") String sequenceNbr);
/**
* 统计工程装置的引用次数(非待提交、非已撤回、非已驳回)
*
* @param projectContraptionId 工程装置唯一标识
* @return 被引用次数 > 0 则设备不可编辑
*/
Integer countContraptionInUseTimesForEdit(@Param("projectContraptionId") Long projectContraptionId);
/**
* 统计设备被引用的次数(只有存在就算引用-作废除外)
* @param projectContraptionId 设备唯一标识
* @return 被引用次数 > 0 则设备不可删除
*/
Integer countContraptionInUseTimesForDelete(@Param("projectContraptionId") Long projectContraptionId);
}
package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectInspection;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 工程装置-检验检测信息表 Mapper 接口
*
* @author system_generator
* @date 2024-12-12
*/
public interface IdxBizJgProjectInspectionMapper extends BaseMapper<IdxBizJgProjectInspection> {
}
package com.yeejoin.amos.boot.module.ymt.api.service;
/**
* 工程装置-施工信息表接口类
*
* @author system_generator
* @date 2024-12-12
*/
public interface IIdxBizJgProjectConstructionService {
}
package com.yeejoin.amos.boot.module.ymt.api.service;
/**
* 工程装置-检验检测信息表接口类
*
* @author system_generator
* @date 2024-12-12
*/
public interface IIdxBizJgProjectInspectionService {
}
<?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.ymt.api.mapper.IdxBizJgProjectConstructionMapper">
</mapper>
<?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.ymt.api.mapper.IdxBizJgProjectContraptionMapper">
<select id="getDetail" resultType="java.util.Map">
SELECT
SEQUENCE_NBR,
USE_UNIT_CREDIT_CODE,
EQU_LIST,
EQU_CATEGORY,
EQU_DEFINE,
EQU_LIST_NAME,
EQU_CATEGORY_NAME,
EQU_DEFINE_NAME,
CITY,
COUNTY,
PRODUCT_QUALIFICATION_CERTIFICATE,
EQU_LIST_NAME,
CONTENT,
STREET_NAME,
OTHER_ACCESSORIES,
CITY_NAME,
PROVINCE,
STREET,
ORG_CODE,
USC_UNIT_CREDIT_CODE,
EQU_CATEGORY_NAME,
REC_USER_NAME,
COUNTY_NAME,
REC_USER_ID,
PROJECT_CONTRAPTION,
USE_REGISTRATION_CODE,
ADDRESS,
ORG_NAME,
PRODUCT_PHOTO,
IS_DELETE,
START_LATITUDE_LONGITUDE,
PIPELINE_LENGTH,
END_LATITUDE_LONGITUDE,
IS_INTO_MANAGEMENT,
REC_DATE,
PROJECT_CONTRAPTION_NO,
USC_UNIT_NAME,
SUPERVISORY_CODE,
PROVINCE_NAME,
DATA_SOURCE,
USE_UNIT_NAME,
USE_DATE
FROM
IDX_BIZ_JG_PROJECT_CONTRAPTION ibjpc
WHERE
ibjpc.SEQUENCE_NBR = #{sequenceNbr}
</select>
<select id="selectEquipList" resultType="java.util.Map">
SELECT ibjtpp."PIPE_NAME" AS pipeName,
ibjtpp."PIPELINE_NUMBER" AS pipelineNumber,
ibjtpp."DEVICE_LEVEL" AS deviceLevel,
ibjtpp."NOMINAL_DIAMETER" AS nominalDiameter,
ibjtpp."WALL_THICKNESS" AS wallThickness,
ibjtpp."PIPE_LENGTH" AS pipeLength,
ibjtpp."PRESSURE" AS pressure,
ibjtpp."TEMPERATURE" AS temperature,
ibjtpp."MEDIUM" AS medium,
ibjtpp."WORK_PRESSURE" AS workPressure,
ibjtpp."WORK_TEMPERATURE" AS workTemperature,
ibjtpp."WORK_MEDIUM" AS workMedium,
ibjtpp."REMARKS" AS remarks,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectOrgName,
(select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectConclusion,
(select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) nextInspectDate,
(select USC_UNIT_NAME from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."USC_DATE" DESC limit 1) as uscUnitName,
(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
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
WHERE ibjui.project_contraption_id = #{sequenceNbr}
</select>
<select id="countContraptionInUseTimesForEdit" resultType="java.lang.Integer">
SELECT
SUM(inUseNumber)
FROM (
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 <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
UNION
SELECT
COUNT(1) as inUseNumber
FROM
tzs_jg_installation_notice a
WHERE a.project_contraption_id = #{projectContraptionId}
AND a.notice_status <![CDATA[ <> ]]> '6610'
AND a.notice_status <![CDATA[ <> ]]> '6615'
AND a.notice_status <![CDATA[ <> ]]> '6614'
)
</select>
<select id="countContraptionInUseTimesForDelete" resultType="java.lang.Integer">
SELECT
SUM(inUseNumber)
FROM (
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 <![CDATA[ <> ]]> '已作废')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM
tzs_jg_installation_notice a
WHERE a.project_contraption_id = #{projectContraptionId}
AND (a.notice_status <![CDATA[ <> ]]> '6617')
)
</select>
</mapper>
<?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.ymt.api.mapper.IdxBizJgProjectInspectionMapper">
</mapper>
package com.yeejoin.amos.boot.module.ymt.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.ymt.biz.service.impl.IdxBizJgProjectConstructionServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectConstructionDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 工程装置-施工信息表
*
* @author system_generator
* @date 2024-12-12
*/
@RestController
@Api(tags = "工程装置-施工信息表Api")
@RequestMapping(value = "/idx-biz-jg-project-construction")
public class IdxBizJgProjectConstructionController extends BaseController {
@Autowired
IdxBizJgProjectConstructionServiceImpl idxBizJgProjectConstructionServiceImpl;
/**
* 新增工程装置-施工信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增工程装置-施工信息表", notes = "新增工程装置-施工信息表")
public ResponseModel<IdxBizJgProjectConstructionDto> save(@RequestBody IdxBizJgProjectConstructionDto model) {
model = idxBizJgProjectConstructionServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新工程装置-施工信息表", notes = "根据sequenceNbr更新工程装置-施工信息表")
public ResponseModel<IdxBizJgProjectConstructionDto> updateBySequenceNbrIdxBizJgProjectConstruction(@RequestBody IdxBizJgProjectConstructionDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(idxBizJgProjectConstructionServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除工程装置-施工信息表", notes = "根据sequenceNbr删除工程装置-施工信息表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(idxBizJgProjectConstructionServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个工程装置-施工信息表", notes = "根据sequenceNbr查询单个工程装置-施工信息表")
public ResponseModel<IdxBizJgProjectConstructionDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(idxBizJgProjectConstructionServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "工程装置-施工信息表分页查询", notes = "工程装置-施工信息表分页查询")
public ResponseModel<Page<IdxBizJgProjectConstructionDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<IdxBizJgProjectConstructionDto> page = new Page<IdxBizJgProjectConstructionDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(idxBizJgProjectConstructionServiceImpl.queryForIdxBizJgProjectConstructionPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "工程装置-施工信息表列表全部数据查询", notes = "工程装置-施工信息表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<IdxBizJgProjectConstructionDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizJgProjectConstructionServiceImpl.queryForIdxBizJgProjectConstructionList());
}
}
package com.yeejoin.amos.boot.module.ymt.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.ymt.biz.service.impl.IdxBizJgProjectInspectionServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectInspectionDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 工程装置-检验检测信息表
*
* @author system_generator
* @date 2024-12-12
*/
@RestController
@Api(tags = "工程装置-检验检测信息表Api")
@RequestMapping(value = "/idx-biz-jg-project-inspection")
public class IdxBizJgProjectInspectionController extends BaseController {
@Autowired
IdxBizJgProjectInspectionServiceImpl idxBizJgProjectInspectionServiceImpl;
/**
* 新增工程装置-检验检测信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增工程装置-检验检测信息表", notes = "新增工程装置-检验检测信息表")
public ResponseModel<IdxBizJgProjectInspectionDto> save(@RequestBody IdxBizJgProjectInspectionDto model) {
model = idxBizJgProjectInspectionServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新工程装置-检验检测信息表", notes = "根据sequenceNbr更新工程装置-检验检测信息表")
public ResponseModel<IdxBizJgProjectInspectionDto> updateBySequenceNbrIdxBizJgProjectInspection(@RequestBody IdxBizJgProjectInspectionDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(idxBizJgProjectInspectionServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除工程装置-检验检测信息表", notes = "根据sequenceNbr删除工程装置-检验检测信息表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(idxBizJgProjectInspectionServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个工程装置-检验检测信息表", notes = "根据sequenceNbr查询单个工程装置-检验检测信息表")
public ResponseModel<IdxBizJgProjectInspectionDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(idxBizJgProjectInspectionServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "工程装置-检验检测信息表分页查询", notes = "工程装置-检验检测信息表分页查询")
public ResponseModel<Page<IdxBizJgProjectInspectionDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<IdxBizJgProjectInspectionDto> page = new Page<IdxBizJgProjectInspectionDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(idxBizJgProjectInspectionServiceImpl.queryForIdxBizJgProjectInspectionPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "工程装置-检验检测信息表列表全部数据查询", notes = "工程装置-检验检测信息表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<IdxBizJgProjectInspectionDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizJgProjectInspectionServiceImpl.queryForIdxBizJgProjectInspectionList());
}
}
package com.yeejoin.amos.boot.module.ymt.biz.service.impl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectConstruction;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectConstructionMapper;
import com.yeejoin.amos.boot.module.ymt.api.service.IIdxBizJgProjectConstructionService;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectConstructionDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 工程装置-施工信息表服务实现类
*
* @author system_generator
* @date 2024-12-12
*/
@Service
public class IdxBizJgProjectConstructionServiceImpl extends BaseService<IdxBizJgProjectConstructionDto,IdxBizJgProjectConstruction,IdxBizJgProjectConstructionMapper> implements IIdxBizJgProjectConstructionService {
/**
* 分页查询
*/
public Page<IdxBizJgProjectConstructionDto> queryForIdxBizJgProjectConstructionPage(Page<IdxBizJgProjectConstructionDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<IdxBizJgProjectConstructionDto> queryForIdxBizJgProjectConstructionList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.ymt.biz.service.impl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectInspection;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectInspectionMapper;
import com.yeejoin.amos.boot.module.ymt.api.service.IIdxBizJgProjectInspectionService;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectInspectionDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 工程装置-检验检测信息表服务实现类
*
* @author system_generator
* @date 2024-12-12
*/
@Service
public class IdxBizJgProjectInspectionServiceImpl extends BaseService<IdxBizJgProjectInspectionDto,IdxBizJgProjectInspection,IdxBizJgProjectInspectionMapper> implements IIdxBizJgProjectInspectionService {
/**
* 分页查询
*/
public Page<IdxBizJgProjectInspectionDto> queryForIdxBizJgProjectInspectionPage(Page<IdxBizJgProjectInspectionDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<IdxBizJgProjectInspectionDto> queryForIdxBizJgProjectInspectionList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
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