Commit 5be100dd authored by 韩桐桐's avatar 韩桐桐

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into…

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into develop_tzs_register_to_0715
parents 075daa37 99eb353c
......@@ -26,4 +26,14 @@ public class DPFilterParamDto {
* 数据统计的结束日期
*/
private String endDate;
/**
* 业务类型0告知管理,1使用登记,2变更登记,3停用启用,4注销报废
*/
private String businessKey;
/**
* month , year
*/
private String searchType;
}
......@@ -28,7 +28,9 @@ public enum DPMapStatisticsItemEnum {
CONSTRUCTION_UNITS("安改维单位 (家)", "constructionUnits", ""),
USERS_UNITS("使用单位 (家)", "usersUnits", ""),
GAS_UNITS("充装单位 (家)", "gasUnits", ""),
OPERATORS("作业人员 (人)", "operators", "");
OPERATORS("作业人员 (人)", "operators", ""),
DEVICE_COUNT("已纳管设备数", "deviceCount", ""),
CERTIFICATE_COUNT("登记证总量", "certificateCount", "");
private String label;
private String code;
private String category;
......
package com.yeejoin.amos.boot.module.jg.api.enums;
import java.util.HashMap;
import java.util.Map;
/**
* 问题状态
*/
public enum ProblemStatusEnum {
NORMAL("正常", "0", "已处理"),
ABNORMAL("异常", "1", "未处理");
private String name;
private String code;
private String desc;
ProblemStatusEnum(String name, String code, String desc) {
this.name = name;
this.code = code;
this.desc = desc;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static Map<String, String> getNameByCode = new HashMap<>();
public static Map<String, String> getCodeByName = new HashMap<>();
public static Map<String, String> getDescByCode = new HashMap<>();
public static Map<String, String> getNameByDesc = new HashMap<>();
static {
for (ProblemStatusEnum e : ProblemStatusEnum.values()) {
getNameByCode.put(e.code, e.name);
getNameByDesc.put(e.desc, e.name);
getDescByCode.put(e.code, e.desc);
getCodeByName.put(e.name, e.code);
}
}
}
......@@ -131,6 +131,6 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
* @param dpFilterParamDto 过滤条件
* @return 统计数量数组
*/
List<Long> countAllBizDataInFlowingForDP(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Long> countAllInFlowingForDPNoFinishedBizData(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
}
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface DPStatisticsMapper {
List<Map<String, Object>> maintenanceCountTopTen(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto);
List<Map<String, Object>> maintenanceCount(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto);
List<Map<String, Object>> installCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> maintenanceNoticeCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> reformCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> transferCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> useCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> vehicleCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> changeNameCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> changeReformCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> changeTransferCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> changeUnitCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> changeVehicleCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> disableCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> cancelCount(@Param("cityCode") String cityCode);
List<Map<String, Object>> installEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> maintenanceEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> reformEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> transferEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> useEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> changeReformEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> changeTransferEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> changeUnitEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> vehicleEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> newRegEquCountByMonth(@Param("cityCode") String cityCode);
List<Map<String, Object>> newVehicleEquCountByMonth(@Param("cityCode") String cityCode);
List<Map<String, Object>> newRegEquCountByYear(@Param("cityCode") String cityCode);
List<Map<String, Object>> newVehicleEquCountByYear(@Param("cityCode") String cityCode);
String newVehicleCountByYear(@Param("cityCode") String cityCode);
String newVehicleCountByMonth(@Param("cityCode") String cityCode);
}
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationReformDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationReform;
......@@ -40,4 +41,6 @@ public interface JgChangeRegistrationReformMapper extends BaseMapper<JgChangeReg
String getEquiplistNameByEquiplist(String code);
List<Map<String, Object>> getDetailById(@Param("id") Long id);
List<CompanyEquipCountDto> queryForFlowingEquipList();
}
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgEquipTransferDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEquipTransfer;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -23,4 +25,6 @@ public interface JgEquipTransferMapper extends CustomBaseMapper<JgEquipTransfer>
@MapKey("sequenceNbr")
List<Map<String, Object>> queryEquipInformation(Long sequenceNbr);
List<CompanyEquipCountDto> queryForFlowingEquipList();
}
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgMaintainNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNotice;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
......@@ -44,4 +45,5 @@ public interface JgMaintainNoticeMapper extends CustomBaseMapper<JgMaintainNotic
Map<String, Object> getEquipInfoByRecord(String record);
List<CompanyEquipCountDto> queryForFlowingEquipList();
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgMaintenanceContractDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContract;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
......@@ -30,4 +31,6 @@ public interface JgMaintenanceContractMapper extends BaseMapper<JgMaintenanceCon
void updatePromoter(@Param("id") Long id);
List<Map<String, Object>> selectEquipList(@Param("id") Long id);
List<CompanyEquipCountDto> queryForFlowingEquipList();
}
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgReformNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgReformNotice;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
......@@ -40,4 +41,6 @@ public interface JgReformNoticeMapper extends CustomBaseMapper<JgReformNotice> {
List<Map<String, Object>> queryEquipInformation(@Param("sequenceNbr") long sequenceNbr);
void updatePromoter(@Param("id") Long id);
List<CompanyEquipCountDto> queryForFlowingEquipList();
}
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
......@@ -26,4 +27,6 @@ public interface JgTransferNoticeMapper extends CustomBaseMapper<JgTransferNotic
@MapKey("sequenceNbr")
List<Map<String, Object>> queryEquipInformation(@Param("sequenceNbr") long sequenceNbr);
List<CompanyEquipCountDto> queryForFlowingEquipList();
}
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
......@@ -25,4 +23,6 @@ public interface JgUseRegistrationManageMapper extends BaseMapper<JgUseRegistrat
Page<JgUseRegistrationManageDto> queryForPage(@Param("page") Page<JgUseRegistrationManageDto> page,
@Param("dto") JgUseRegistrationManageDto dto,
@Param("sort") SortVo sortMap);
Long countCertificateByReginCode(String orgCode);
}
......@@ -33,7 +33,7 @@ public interface IJgChangeRegistrationUnitService {
* @param noticeDto 安装告知
* @param op 操作类型
*/
JgChangeRegistrationUnitDto updateInstallationNotice(String submitType, JgChangeRegistrationUnitDto noticeDto, String op);
JgChangeRegistrationUnitDto updateInstallationNotice(String submitType, JgChangeRegistrationUnitDto noticeDto, String op, ReginParams reginParams);
/**
* 分页查询
......
......@@ -204,5 +204,16 @@
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
where ur.sequence_nbr = #{id}
</select>
<select id="queryForFlowingEquipList"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
select
a.use_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from
tzs_jg_change_registration_reform a,
tzs_jg_change_registration_reform_eq b
where
a.sequence_nbr = b.equip_transfer_id
and a.status not in('使用单位待提交','一级受理已驳回','使用单位已撤回','已作废','已完成')
</select>
</mapper>
......@@ -210,4 +210,14 @@
jet.sequence_nbr = #{sequenceNbr}
LIMIT 1
</select>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
select a.use_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from tzs_jg_equip_transfer a,
tzs_jg_equip_transfer_eq b
where a.sequence_nbr = b.equip_transfer_id
and a.apply_status = '6612'
GROUP BY a.use_unit_credit_code
</select>
</mapper>
......@@ -274,5 +274,16 @@
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = oi.record
WHERE oi.record = #{record} ORDER BY oi."rec_date" DESC LIMIT 1
</select>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
select
a.install_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from
tzs_jg_maintain_notice a,
tzs_jg_maintain_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and a.notice_status not in('6614','6615','6610','6617','6616')
GROUP BY a.install_unit_credit_code
</select>
</mapper>
......@@ -155,4 +155,14 @@
left JOIN idx_biz_jg_register_info jri on mc.equ_id = jri.RECORD
WHERE mc.equip_transfer_id = #{id}
</select>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
select a.use_unit_code as companyCode,
group_concat(b.equ_id) as records
from tzs_jg_maintenance_contract a,
tzs_jg_maintenance_contract_eq b
where a.sequence_nbr = b.equip_transfer_id
and a.status in ('监管单位待受理','维保单位待受理')
GROUP BY a.use_unit_code
</select>
</mapper>
......@@ -203,4 +203,16 @@
set promoter = null
where sequence_nbr = #{id}
</update>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
select
a.install_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from
tzs_jg_reform_notice a,
tzs_jg_reform_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and a.notice_status not in('6614','6615','6610','6617','6616')
GROUP BY a.install_unit_credit_code
</select>
</mapper>
......@@ -217,4 +217,16 @@
tjtn.sequence_nbr = #{sequenceNbr}
LIMIT 1
</select>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
select
a.install_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from
tzs_jg_transfer_notice a,
tzs_jg_transfer_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and a.notice_status not in('6614','6615','6610','6617','6616')
GROUP BY a.install_unit_credit_code
</select>
</mapper>
......@@ -134,4 +134,16 @@
tjurm.rec_date DESC
</where>
</select>
<select id="countCertificateByReginCode" resultType="java.lang.Long">
select
count(1)
from
tzs_jg_use_registration_manage tjurm
left join
privilege_company pc
on tjurm.receive_company_code = pc.company_code
where
pc.org_code like concat (#{reginCode},'%')
and tjurm.certificate_status = '已登记'
</select>
</mapper>
......@@ -451,9 +451,9 @@
pp."TEMPERATURE" temperature,
pp."MEDIUM" medium,
pp."REMARKS" remarks,
(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 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
(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 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"
......@@ -523,8 +523,8 @@
(select name from cb_data_dictionary where code = pv."CHARGING_MEDIUM" and type = 'FILLING_MEDIUM') chargingMedium,
pv."NOMINAL_WORKING_PRESSURE" nominalWorkingPressure,
pv."SINGLE_BOTTLE_VOLUME" singleBottleVolume,
to_char((select INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1), 'YYYY-MM-DD') inspectDate,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1), 'YYYY-MM-DD') nextInspectDate
to_char((select INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY REC_DATE DESC limit 1), 'YYYY-MM-DD') inspectDate,
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"
......@@ -566,27 +566,6 @@
ORDER BY ui.REC_DATE DESC
</select>
<select id="queryForEquipUsedByVehiclePage" resultType="com.alibaba.fastjson.JSONObject">
<include refid="page-list-vessel"/>
WHERE
ri."EQU_DEFINE" = '23T0'
and ui."DATA_SOURCE" like 'jg%'
-- and ui."DATA_SOURCE" not like 'jg_his%'
and ri.whether_vehicle_cylinder = 1
-- 保证使用单位选择设备时(record为null) 能选择到本单位的设备 并且 监管单位在查看时(record 不为null)可以匹配到所有的设备
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null">
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if>
<if test="jsonObject.record != null and jsonObject.record != ''">
and ui."RECORD" = #{jsonObject.record}
</if>
<if test="jsonObject.record == null">
and not exists(SELECT 1 FROM tzs_jg_vehicle_information v, tzs_jg_vehicle_information_eq ve WHERE
v.sequence_nbr = ve.vehicle_id AND ve.equ_id = ui."RECORD" and v.status !='使用单位待提交' and v.status
!='一级受理已驳回' and v.status !='使用单位已撤回' and v.status !='已作废' )
</if>
ORDER BY ui.REC_DATE DESC
</select>
<select id="queryForEquipUsedByVehiclePageHistory" resultType="com.alibaba.fastjson.JSONObject">
<include refid="page-list-vessel"/>
WHERE
......@@ -642,11 +621,11 @@
a.use_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from
tzs_jg_use_registration a,
tzs_jg_use_registration_eq b
tzs_jg_use_registration a,
tzs_jg_use_registration_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
a.sequence_nbr = b.equip_transfer_id
and a.status not in('使用单位待提交','一级受理已驳回','使用单位已撤回','已作废')
</select>
<select id="getEquTypeByUseRegSeq" resultType="java.util.Map">
select ur.sequence_nbr as sequenceNbr,
......
......@@ -9,10 +9,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.exception.instance.BadRequest;
......@@ -115,4 +112,135 @@ public class DPStatisticsController {
}
return ResponseHelper.buildResponse(statisticsService.queryBizCycleData(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-左侧设备状态情况统计", notes = "监管大屏-左侧设备状态情况统计")
@PostMapping(value = "/equStateCount")
public ResponseModel<List<Map<String,Object>>> equStateCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.equStateCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-右侧停用、注销、报废设备状态情况统计", notes = "监管大屏-右侧停用、注销、报废设备状态情况统计")
@PostMapping(value = "/equStopStateCount")
public ResponseModel<Map<String,Object>> equStopStateCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.equStopStateCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-维保电梯数量TOP10", notes = "监管大屏-维保电梯数量TOP10")
@PostMapping(value = "/maintenanceCountTopTen")
public ResponseModel<List<Map<String,Object>>> maintenanceCountTopTen(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.maintenanceCountTopTen(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-维保电梯数量", notes = "监管大屏-维保电梯数量")
@PostMapping(value = "/maintenanceCount")
public ResponseModel<Map<String,Object>> maintenanceCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.maintenanceCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-左侧各地市业务办理平均时效", notes = "监管大屏-左侧各地市业务办理平均时效")
@PostMapping(value = "/cityBusinessCount")
public ResponseModel<Map<String,Object>> cityBusinessCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.cityBusinessCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-左侧获取业务类型", notes = "监管大屏-左侧获取业务类型")
@PostMapping(value = "/getBusinessKey")
public ResponseModel<List<Map<String,Object>>> getBusinessKey(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.getBusinessKey(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-右侧施工告知的设备数办理情况统计", notes = "监管大屏-右侧施工告知的设备数办理情况统计")
@PostMapping(value = "/getNoticeEquCount")
public ResponseModel<Map<String,Object>> getNoticeEquCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.getNoticeEquCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-右侧使用办理的设备数量情况统计", notes = "监管大屏-右侧使用办理的设备数量情况统计")
@PostMapping(value = "/getRegEquCount")
public ResponseModel<Map<String,Object>> getRegEquCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.getRegEquCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-左侧新增情况", notes = "监管大屏-左侧新增情况")
@PostMapping(value = "/newRegEquCount")
public ResponseModel<Map<String,Object>> newRegEquCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.newRegEquCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-新增登记新增设备统计", notes = "监管大屏-新增登记新增设备统计")
@PostMapping(value = "/newRegCount")
public ResponseModel<List<Map<String,Object>>> newRegCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.newRegCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏监管-中屏-各地市数据统计", notes = "大屏监管-中屏-各地市数据统计")
@PostMapping(value = "/jg/centre/dataStatistic")
public ResponseModel<List<Map<String, Object>>> dataStatisticByReginCode(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.dataStatisticByReginCode(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏监管-中屏-当前区域数据统计", notes = "大屏监管-中屏-当前区域数据统计")
@PostMapping(value = "/jg/centre/dataStatisticCount")
public ResponseModel<Map<String, Object>> dataStatisticCountByReginCode(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.dataStatisticCountByReginCode(dpFilterParamDto));
}
}
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.common.BaseException;
import com.yeejoin.amos.boot.module.jg.api.dto.JgEquipTransferDto;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEquipTransferServiceImpl;
import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
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.*;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEquipTransferServiceImpl;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgEquipTransferDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.context.RequestContext;
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.HashMap;
import java.util.List;
import java.util.Map;
/**
* 设备移交
......@@ -54,9 +53,9 @@ public class JgEquipTransferController extends BaseController {
@PutMapping(value = "/update")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新设备移交", notes = "根据sequenceNbr更新设备移交")
public ResponseModel<Object> updateBySequenceNbr(@RequestParam("submitType") String submitType,
@RequestBody JgEquipTransferDto equipTransferDto,
@RequestParam(value = "op", required = false) String op) {
return ResponseHelper.buildResponse(jgEquipTransferServiceImpl.updateEquipTransfer(submitType, equipTransferDto, op));
@RequestBody JgEquipTransferDto equipTransferDto,
@RequestParam(value = "op", required = false) String op) {
return ResponseHelper.buildResponse(jgEquipTransferServiceImpl.updateEquipTransfer(submitType, equipTransferDto, op, getSelectedOrgInfo()));
}
/**
......@@ -112,10 +111,10 @@ public class JgEquipTransferController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "设备移交分页查询", notes = "设备移交分页查询")
public ResponseModel<Page<JgEquipTransferDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "sort",required = false) String sort,
@RequestParam(value = "sort", required = false) String sort,
@RequestBody(required = false) JgEquipTransferDto dto) {
Page<JgEquipTransferDto> page = new Page<>(current, size);
return ResponseHelper.buildResponse(jgEquipTransferServiceImpl.queryForJgEquipTransferPage(page,sort, dto, getSelectedOrgInfo()));
return ResponseHelper.buildResponse(jgEquipTransferServiceImpl.queryForJgEquipTransferPage(page, sort, dto, getSelectedOrgInfo()));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -13,8 +13,6 @@ import com.yeejoin.amos.boot.module.jg.api.vo.JgMaintenanceContractVo;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgMaintenanceContractServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
......@@ -23,6 +21,7 @@ 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.Map;
/**
......@@ -176,8 +175,8 @@ public class JgMaintenanceContractController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/cancelApplication")
@ApiOperation(httpMethod = "POST", value = "维保备案作废", notes = "维保备案作废")
public ResponseModel<JgMaintenanceContract> cancelApplication(@RequestBody JgMaintenanceContractDto dto){
JgMaintenanceContract result = jgMaintenanceContractServiceImpl.cancelApplication(dto.getSequenceNbr(),dto.getCancelReason());
public ResponseModel<JgMaintenanceContract> cancelApplication(@RequestBody JgMaintenanceContractDto dto) {
JgMaintenanceContract result = jgMaintenanceContractServiceImpl.cancelApplication(dto.getSequenceNbr(), dto.getCancelReason());
return ResponseHelper.buildResponse(result);
}
}
......@@ -44,7 +44,7 @@ public class ChangeUnitEquipUsedCheckImpl extends BaseEquipUsedCheckService {
@Override
public void init() {
// 初始化已经完成或者在流程中安装告知的设备数据
// 初始化在流程中设备数据
List<CompanyEquipCountDto> companyEquipCountDtos = changeRegistrationUnitMapper.queryForFlowingEquipList();
companyEquipCountDtos.forEach(c -> {
RBucket<Set<String>> rBucket = redissonClient.getBucket(getFlowingEquipRedisKey(c.getCompanyCode(), bizType));
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferMapper;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author Administrator
*/
@Component
@Slf4j
public class EquipTransferEquipUsedCheckImpl extends BaseEquipUsedCheckService {
private RedissonClient redissonClient;
private String bizType = "equipmentHandover";
private JgEquipTransferMapper equipTransferMapper;
public EquipTransferEquipUsedCheckImpl(RedissonClient redissonClient, JgEquipTransferMapper equipTransferMapper) {
this.redissonClient = redissonClient;
this.equipTransferMapper = equipTransferMapper;
}
@Override
public RedissonClient getRedisClient() {
return redissonClient;
}
@Override
public String getApplyBizType() {
return bizType;
}
@Override
public void init() {
// 初始化在流程中的设备数据
List<CompanyEquipCountDto> companyEquipCountDtos = equipTransferMapper.queryForFlowingEquipList();
companyEquipCountDtos.forEach(c -> {
RBucket<Set<String>> rBucket = redissonClient.getBucket(getFlowingEquipRedisKey(c.getCompanyCode(), bizType));
rBucket.set(Arrays.stream(c.getRecords().split(",")).collect(Collectors.toSet()));
});
}
}
......@@ -28,10 +28,12 @@ import com.yeejoin.amos.boot.module.jg.api.dto.EquipmentInfoDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgCertificateChangeRecord;
import com.yeejoin.amos.boot.module.jg.api.entity.JgCertificateChangeRecordEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.entity.SafetyProblemTracing;
import com.yeejoin.amos.boot.module.jg.api.enums.*;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgVehicleInformationMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.SafetyProblemTracingMapper;
import com.yeejoin.amos.boot.module.jg.biz.config.PressureVesselListener;
import com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
......@@ -654,7 +656,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
return objMap;
}
@Autowired
private SafetyProblemTracingMapper safetyProblemTracingMapper;
/**
* 查询设备基本信息
*
......@@ -669,6 +672,17 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String county = "";
String street = "";
String fullAddress = "";
// 设备问题信息(大屏二级页面使用)
LambdaQueryWrapper<SafetyProblemTracing> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(SafetyProblemTracing::getSourceId, record);
lambdaQueryWrapper.orderByDesc(SafetyProblemTracing::getRecDate);
List<SafetyProblemTracing> safetyProblemTracings = safetyProblemTracingMapper.selectList(lambdaQueryWrapper);
if (!ObjectUtils.isEmpty(safetyProblemTracings)) {
objMap.put("problemStatus", ProblemStatusEnum.getNameByDesc.get(safetyProblemTracings.get(0).getProblemStatus()));
objMap.put("problemTime", safetyProblemTracings.get(0).getProblemTime());
}
// 使用信息
IdxBizJgUseInfo useInfo = idxBizJgUseInfoService.getOneData(record);
if (!ValidationUtil.isEmpty(useInfo)) {
......@@ -738,12 +752,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
useInfoMap.put("FULLADDRESS", fullAddress);
}
useInfoMap.put("USEINFO_SEQ", useInfo.getSequenceNbr());
useInfoMap.put("USE_PLACE", useInfo.getUsePlace());
if (!ValidationUtil.isEmpty(useInfo.getLongitudeLatitude())) {
useInfoMap.put("LONGITUDE_LATITUDE", JSON.parseObject(useInfo.getLongitudeLatitude()));
useInfoMap.put("USE_LONGITUDE_LATITUDE", JSON.parseObject(useInfo.getLongitudeLatitude()));
}
if (!ValidationUtil.isEmpty(useInfo.getAddress())) {
useInfoMap.put("USE_ADDRESS", useInfo.getAddress());
useInfoMap.put("FULL_ADDRESS", useInfo.getAddress());
}
}
if (!useInfoMap.isEmpty()) {
......@@ -2041,7 +2057,18 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String dataSource = OPERATESAVE.equals(operateType) ? ("new".equals(equipSource) ? "jg" : "jg_his") : equipmentInfoForm.get("DATA_SOURCE").toString();
if (isCopy) {
String sourceRecord = equipmentClassForm.get(RECORD).toString();
dataSource = "new".equals(equipSource) ? ("jg_" + sourceRecord) : ("jg_his_" + sourceRecord);
// dataSource = "new".equals(equipSource) ? ("jg_" + sourceRecord) : ("jg_his_" + sourceRecord);
// bug-21203
if (equipmentInfoForm.containsKey("DATA_SOURCE")){
String dataSourceCopy = equipmentInfoForm.get("DATA_SOURCE").toString();
if (dataSourceCopy.startsWith("jg_his")){
dataSource = "jg_his_" + sourceRecord;
}else {
dataSource = "jg_" + sourceRecord;
}
}else {
throw new BadRequest("数据异常,请联系管理员");
}
}
record = OPERATESAVE.equals(operateType) ? UUID.randomUUID().toString() : equipmentInfoForm.get(RECORD).toString();
......@@ -2170,17 +2197,18 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
iIdxBizJgOtherInfoService.saveOrUpdateData(otherInfo);
// 检验检测
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgInspectionDetectionInfo.class);
List<Map<String, Object>> inspectionAndTestingInstitutions = commonMapper.getUnitListByType(INSPECTION_AND_TESTING_INSTITUTIONS);
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.setInspectConclusion(null);
inspectionDetectionInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("INSPECTIONDETECTIONINFO_SEQ")));
iIdxBizJgInspectionDetectionInfoService.saveOrUpdateData(inspectionDetectionInfo);
if(CylinderTypeEnum.CYLINDER.getCode().equals(equCategory) || "2100".equals(equCategory)){
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgInspectionDetectionInfo.class);
List<Map<String, Object>> inspectionAndTestingInstitutions = commonMapper.getUnitListByType(INSPECTION_AND_TESTING_INSTITUTIONS);
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.setInspectConclusion(null);
inspectionDetectionInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("INSPECTIONDETECTIONINFO_SEQ")));
iIdxBizJgInspectionDetectionInfoService.saveOrUpdateData(inspectionDetectionInfo);
}
// 八大类技术参数和主要零部件和安全附件表
List<IdxBizJgMainParts> mainPartsList = new ArrayList<>();
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationReformEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationReformMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author Administrator
*/
@Component
@Slf4j
public class JgChangeRegistrationEquipUsedCheckImpl extends BaseEquipUsedCheckService {
private RedissonClient redissonClient;
private String bizType = "changeRegistration";
private JgChangeRegistrationReformMapper mapper;
public JgChangeRegistrationEquipUsedCheckImpl(RedissonClient redissonClient, JgChangeRegistrationReformMapper mapper) {
this.redissonClient = redissonClient;
this.mapper = mapper;
}
@Override
public RedissonClient getRedisClient() {
return redissonClient;
}
@Override
public String getApplyBizType() {
return bizType;
}
@Override
public void init() {
// 初始化已经完成或者在流程中使用登记的设备数据
List<CompanyEquipCountDto> companyEquipCountDtos = mapper.queryForFlowingEquipList();
companyEquipCountDtos.forEach(c -> {
RBucket<Set<String>> rBucket = redissonClient.getBucket(this.getFlowingEquipRedisKey(c.getCompanyCode(), bizType));
rBucket.set(Arrays.stream(c.getRecords().split(",")).collect(Collectors.toSet()));
});
}
}
......@@ -96,6 +96,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private static final String SUBMIT_TYPE_FLOW = "1";
private static final String PROCESS_DEFINITION_KEY = "installationNotificationNew";
private static final String PROCESS_INSTALL_NOTICE_KEY = "installNotice";
private static final String TABLE_PAGE_ID = "1734141426742095873";
private static final String CONSTRUCTION_TYPE = "SGLX";
private static final String CONSTRUCTION_TYPE_NAME = "安装";
......@@ -115,6 +117,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired
JgUseRegistrationMapper jgUseRegistrationMapper;
@Autowired
IdxBizJgUseInfoServiceImpl idxBizJgUseInfoService;
@Autowired
IdxBizJgRegisterInfoServiceImpl idxBizJgRegisterInfoService;
@Autowired
IdxBizJgRegisterInfoMapper tzsJgRegistrationInfoMapper;
......@@ -429,7 +433,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
LambdaQueryWrapper<JgInstallationNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgInstallationNoticeEq::getEquipTransferId, jgInstallationNotice.getSequenceNbr());
JgInstallationNoticeEq jgRelationEquip = jgInstallationNoticeEqMapper.selectOne(queryWrapper);
EquipUsedCheckStrategyContext.getUsedStrategy("installNotice").equipRepeatUsedCheck(jgRelationEquip.getEquId(), jgInstallationNotice.getInstallUnitCreditCode());
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_INSTALL_NOTICE_KEY).equipRepeatUsedCheck(jgRelationEquip.getEquId(), jgInstallationNotice.getInstallUnitCreditCode());
}
}
......@@ -646,12 +650,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private void rollBackForDelRedisData() {
FlowingEquipRedisContext.getContext().forEach(e -> {
EquipUsedCheckStrategyContext.getUsedStrategy("installNotice").delDataForCheckWithKey(e.getData(), e.getRedisKey());
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_INSTALL_NOTICE_KEY).delDataForCheckWithKey(e.getData(), e.getRedisKey());
});
}
private void repeatUsedEquipCheck(List<Map<String, Object>> equipList, String companyCode) {
equipList.forEach(equipMap -> EquipUsedCheckStrategyContext.getUsedStrategy("installNotice").equipRepeatUsedCheck(String.valueOf(equipMap.get("SEQUENCE_NBR")), companyCode));
equipList.forEach(equipMap -> EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_INSTALL_NOTICE_KEY).equipRepeatUsedCheck(String.valueOf(equipMap.get("SEQUENCE_NBR")), companyCode));
}
private void updateRedisBatch(List<JgInstallationNotice> jgInstallationNotices) {
......@@ -953,7 +957,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
LambdaQueryWrapper<JgInstallationNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgInstallationNoticeEq::getEquipTransferId, jgInstallationNotice.getSequenceNbr());
JgInstallationNoticeEq jgRelationEquip = jgInstallationNoticeEqMapper.selectOne(queryWrapper);
EquipUsedCheckStrategyContext.getUsedStrategy("installNotice").delDataForCheckEquipRepeatUsed(Collections.singletonList(jgRelationEquip.getEquId()), jgInstallationNotice.getInstallUnitCreditCode());
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_INSTALL_NOTICE_KEY).delDataForCheckEquipRepeatUsed(Collections.singletonList(jgRelationEquip.getEquId()), jgInstallationNotice.getInstallUnitCreditCode());
}
@GlobalTransactional(rollbackFor = Exception.class)
......@@ -1394,6 +1398,28 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
this.updateById(installationNotice);
// 2.更新关联的业务
this.processElseDataByStatus(Objects.requireNonNull(FlowStatusEnum.getEumByCode(Integer.parseInt(oldNoticeStatus))), installationNotice);
// 3.更新ES、IdxBizJgUseInfo中关联设备为未纳管
Map<String, Map<String, Object>> objMap = new HashMap<>();
LambdaQueryWrapper<JgInstallationNoticeEq> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(JgInstallationNoticeEq::getEquipTransferId, installationNotice.getSequenceNbr());
List<JgInstallationNoticeEq> jgInstallationNoticeEqs = jgInstallationNoticeEqMapper.selectList(lambdaQueryWrapper);
if (!ObjectUtils.isEmpty(jgInstallationNoticeEqs) && jgInstallationNoticeEqs.size() > 0) {
for (JgInstallationNoticeEq jgInstallationNoticeEq : jgInstallationNoticeEqs) {
// 组装修改es条件及数据
Map<String, Object> map = new HashMap<>();
map.put("IS_INTO_MANAGEMENT", Boolean.FALSE);
objMap.put(jgInstallationNoticeEq.getEquId(), map);
}
}
// 组装更新IdxBizJgUseInfo条件
LambdaQueryWrapper<IdxBizJgUseInfo> jgUseInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
jgUseInfoLambdaQueryWrapper.in(IdxBizJgUseInfo::getRecord, jgInstallationNoticeEqs.stream().map(JgInstallationNoticeEq::getEquId).collect(Collectors.toList()));
List<IdxBizJgUseInfo> list = idxBizJgUseInfoMapper.selectList(jgUseInfoLambdaQueryWrapper);
for (IdxBizJgUseInfo useInfo : list) {
useInfo.setIsIntoManagement(Boolean.FALSE);
}
idxBizJgUseInfoService.saveOrUpdateBatch(list);
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
return installationNotice;
}
......
......@@ -25,6 +25,7 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintenanceContractService;
import com.yeejoin.amos.boot.module.jg.api.vo.JgMaintenanceContractVo;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext;
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.IIdxBizJgUseInfoService;
......@@ -72,6 +73,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
public static final String SUBMIT_DATA = "0";
public static final String SUBMIT_TYPE_FLOW = "1";
public static final String WB_PROCESS_DEFINITION_KEY = "maintenanceFiling";
private final List<String> NOT_FLOWING_STATE = Arrays.asList("使用单位待提交", "维保单位已驳回", "使用单位已撤回", "已作废", "已完成");
@Autowired
TzsServiceFeignClient tzsServiceFeignClient;
......@@ -211,6 +213,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
ProcessTaskDTO complete = workflowService.completeOrReject(taskId, dto, operate);
// 更新下一步执行人、创建待办
updateExecuteIds(instanceId, id, operate, complete);
this.delRepeatUseEquipData(contract.getSequenceNbr(), contract.getStatus(), contract.getUseUnitCode());
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
......@@ -220,6 +223,22 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
}
}
/**
* 删除 redis校验重复引用设备的数据
*/
private void delRepeatUseEquipData(Long id, String status, String companyCode) {
List<JgMaintenanceContractEq> list = jgMaintenanceContractEqService.lambdaQuery().eq(JgMaintenanceContractEq::getEquipTransferId, id).list();
// 获取单位变更设备列表
if (CollectionUtils.isEmpty(list)) {
return;
}
List<String> records = list.stream().map(JgMaintenanceContractEq::getEquId).collect(Collectors.toList());
if (NOT_FLOWING_STATE.contains(status)) {
EquipUsedCheckStrategyContext.getUsedStrategy(WB_PROCESS_DEFINITION_KEY)
.delDataForCheckEquipRepeatUsed(records, companyCode);
}
}
public InstanceRuntimeData buildInstanceRuntimeData(JgMaintenanceContract jgMaintenanceContract) {
return InstanceRuntimeData.builder()
.nextExecuteUserIds(jgMaintenanceContract.getNextExecuteUserIds())
......@@ -256,7 +275,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
list.forEach(seq -> {
JgMaintenanceContract jgMaintenanceContract = this.baseMapper.selectById(seq);
// 删除待办 及 中止流程
commonService.deleteTaskModel(String.valueOf(jgMaintenanceContract.getSequenceNbr()),jgMaintenanceContract.getInstanceId());
commonService.deleteTaskModel(String.valueOf(jgMaintenanceContract.getSequenceNbr()), jgMaintenanceContract.getInstanceId());
// 删除业务单
this.baseMapper.deleteById(seq);
// 删除对应eq
......@@ -370,6 +389,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
// redis流程实时数据更新
commonService.saveExecuteFlowData2Redis(instanceId, this.buildInstanceRuntimeData(contract));
this.delRepeatUseEquipData(contract.getSequenceNbr(), contract.getStatus(), contract.getUseUnitCode());
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
......@@ -441,9 +461,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
jgMaintenanceContractEqService.getBaseMapper().delete(lambda);
}
// 更新关联设备信息
List<JgMaintenanceContractEq> equipList = new ArrayList<>();
if (!CollectionUtils.isEmpty(equipmentLists)) {
contract.setEquNum(equipmentLists.size());
List<JgMaintenanceContractEq> equipList = new ArrayList<>();
equipmentLists.forEach(x -> {
JgMaintenanceContractEq equip = new JgMaintenanceContractEq();
equip.setEquId(String.valueOf(x.get("SEQUENCE_NBR")));
......@@ -546,6 +566,11 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
updateById(contract);
// 设备数据存历史数据,在流程完成时使用
commonService.saveOrUpdateHistory(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getName(), JSON.parseArray(JSON.toJSONString(equipmentLists)), null, contract.getSequenceNbr().toString());
if (SUBMIT_TYPE_FLOW.equals(submit)) {//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
equipList.forEach(equip -> EquipUsedCheckStrategyContext.getUsedStrategy(WB_PROCESS_DEFINITION_KEY)
.equipRepeatUsedCheck(String.valueOf(equip.getEquId()), reginParams.getCompany().getCompanyCode()));
}
return Collections.singletonList(contract);
}
......@@ -784,37 +809,39 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
return null;
}
private void processElseDataByStatus(FlowStatusEnum oldNoticeStatus, JgMaintenanceContract maintenanceContract) {
private void processElseDataByStatus(FlowStatusEnum oldNoticeStatus, JgMaintenanceContract contract) {
switch (oldNoticeStatus) {
case TO_BE_SUBMITTED:
// 1.写入历史表
this.saveHisDataBeforeUpdate(maintenanceContract);
this.saveHisDataBeforeUpdate(contract);
// 2.删除暂存时生成的待办
commonService.deleteTasksAndStopProcess(maintenanceContract.getInstanceId(),"监管单位主动作废");
commonService.deleteTasksAndStopProcess(contract.getInstanceId(), "监管单位主动作废");
break;
case TO_BE_FINISHED:
// 1.回退表单
updateIdxBizJgRegisterInfo(maintenanceContract);
updateIdxBizJgRegisterInfo(contract);
break;
default:
// 流程中(驳回、撤回等)
// 1.待办任务更新为已完成
this.finishedTask(maintenanceContract);
this.finishedTask(contract);
// 2.终止流程-工作流报错暂时注释掉
iCmWorkflowService.stopProcess(maintenanceContract.getInstanceId(), maintenanceContract.getCancelReason());
iCmWorkflowService.stopProcess(contract.getInstanceId(), contract.getCancelReason());
// 3.写入历史表
this.saveHisDataBeforeUpdate(maintenanceContract);
this.saveHisDataBeforeUpdate(contract);
// 4、释放流程中设备
this.delRepeatUseEquipData(contract.getSequenceNbr(), contract.getStatus(), contract.getUseUnitCode());
}
}
private void updateIdxBizJgRegisterInfo(JgMaintenanceContract maintenanceContract) {
LambdaQueryWrapper<JgMaintenanceContractEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgMaintenanceContractEq::getEquipTransferId, maintenanceContract.getSequenceNbr());
List<JgMaintenanceContractEq> equipmentLists = maintenanceContractEqMapper.selectList(queryWrapper);
if(!CollectionUtils.isEmpty(equipmentLists)){
List<String> list = equipmentLists.stream().filter(t->t.getEquId() != null).map(JgMaintenanceContractEq::getEquId).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(equipmentLists)) {
List<String> list = equipmentLists.stream().filter(t -> t.getEquId() != null).map(JgMaintenanceContractEq::getEquId).collect(Collectors.toList());
maintenanceContractEqMapper.updateIdxBizJgRegisterInfo(list);
}
}
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeMapper;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author Administrator
*/
@Component
@Slf4j
public class MaintainNoticeEquipUsedCheckImpl extends BaseEquipUsedCheckService {
private RedissonClient redissonClient;
private String bizType = "maintainNotice";
private JgMaintainNoticeMapper maintainNoticeMapper;
public MaintainNoticeEquipUsedCheckImpl(RedissonClient redissonClient, JgMaintainNoticeMapper maintainNoticeMapper) {
this.redissonClient = redissonClient;
this.maintainNoticeMapper = maintainNoticeMapper;
}
@Override
public RedissonClient getRedisClient() {
return redissonClient;
}
@Override
public String getApplyBizType() {
return bizType;
}
@Override
public void init() {
// 初始化已经完成或者在流程中安装告知的设备数据
List<CompanyEquipCountDto> companyEquipCountDtos = maintainNoticeMapper.queryForFlowingEquipList();
companyEquipCountDtos.forEach(c -> {
RBucket<Set<String>> rBucket = redissonClient.getBucket(getFlowingEquipRedisKey(c.getCompanyCode(), bizType));
rBucket.set(Arrays.stream(c.getRecords().split(",")).collect(Collectors.toSet()));
});
}
}
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintenanceContractMapper;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author Administrator
*/
@Component
@Slf4j
public class MaintenanceContractEquipUsedCheckImpl extends BaseEquipUsedCheckService {
private RedissonClient redissonClient;
private String bizType = "maintenanceFiling";
private JgMaintenanceContractMapper maintenanceContractMapper;
public MaintenanceContractEquipUsedCheckImpl(RedissonClient redissonClient, JgMaintenanceContractMapper maintenanceContractMapper) {
this.redissonClient = redissonClient;
this.maintenanceContractMapper = maintenanceContractMapper;
}
@Override
public RedissonClient getRedisClient() {
return redissonClient;
}
@Override
public String getApplyBizType() {
return bizType;
}
@Override
public void init() {
// 初始化在流程中的设备数据
List<CompanyEquipCountDto> companyEquipCountDtos = maintenanceContractMapper.queryForFlowingEquipList();
companyEquipCountDtos.forEach(c -> {
RBucket<Set<String>> rBucket = redissonClient.getBucket(getFlowingEquipRedisKey(c.getCompanyCode(), bizType));
rBucket.set(Arrays.stream(c.getRecords().split(",")).collect(Collectors.toSet()));
});
}
}
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeMapper;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author Administrator
*/
@Component
@Slf4j
public class ReformNoticeEquipUsedCheckImpl extends BaseEquipUsedCheckService {
private RedissonClient redissonClient;
private String bizType = "renovationNoticeNew";
private JgReformNoticeMapper reformNoticeMapper;
public ReformNoticeEquipUsedCheckImpl(RedissonClient redissonClient, JgReformNoticeMapper reformNoticeMapper) {
this.redissonClient = redissonClient;
this.reformNoticeMapper = reformNoticeMapper;
}
@Override
public RedissonClient getRedisClient() {
return redissonClient;
}
@Override
public String getApplyBizType() {
return bizType;
}
@Override
public void init() {
// 初始化已经完成或者在流程中安装告知的设备数据
List<CompanyEquipCountDto> companyEquipCountDtos = reformNoticeMapper.queryForFlowingEquipList();
companyEquipCountDtos.forEach(c -> {
RBucket<Set<String>> rBucket = redissonClient.getBucket(getFlowingEquipRedisKey(c.getCompanyCode(), bizType));
rBucket.set(Arrays.stream(c.getRecords().split(",")).collect(Collectors.toSet()));
});
}
}
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgTransferNoticeMapper;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author Administrator
*/
@Component
@Slf4j
public class TransferNoticeEquipUsedCheckImpl extends BaseEquipUsedCheckService {
private RedissonClient redissonClient;
private String bizType = "transferNotice";
private JgTransferNoticeMapper noticeMapper;
public TransferNoticeEquipUsedCheckImpl(RedissonClient redissonClient, JgTransferNoticeMapper noticeMapper) {
this.redissonClient = redissonClient;
this.noticeMapper = noticeMapper;
}
@Override
public RedissonClient getRedisClient() {
return redissonClient;
}
@Override
public String getApplyBizType() {
return bizType;
}
@Override
public void init() {
// 初始化已经完成或者在流程中安装告知的设备数据
List<CompanyEquipCountDto> companyEquipCountDtos = noticeMapper.queryForFlowingEquipList();
companyEquipCountDtos.forEach(c -> {
RBucket<Set<String>> rBucket = redissonClient.getBucket(getFlowingEquipRedisKey(c.getCompanyCode(), bizType));
rBucket.set(Arrays.stream(c.getRecords().split(",")).collect(Collectors.toSet()));
});
}
}
......@@ -31,7 +31,7 @@
"name": "移装告知",
"code": "GZ_YZ",
"image": "upload/tzs/common/image/移装告知.png",
"disabled": true
"disabled": false
}
],
"DJGL": [
......@@ -49,7 +49,7 @@
"name": "移装变更登记",
"code": "DJ_YZ",
"image": "upload/tzs/common/image/移装变更登记.png",
"disabled": true
"disabled": false
},
{
"name": "单位变更登记",
......@@ -88,16 +88,16 @@
"image": "upload/tzs/common/image/注销报废.png"
},
{
"name": "设备启用",
"name": "启用",
"code": "SB_QY",
"image": "upload/tzs/common/image/设备启用.png",
"disabled": true
"disabled": false
},
{
"name": "设备停用",
"name": "停用",
"code": "SB_TY",
"image": "upload/tzs/common/image/设备停用.png",
"disabled": true
"disabled": false
}
],
"XZSB": [
......
package com.yeejoin.amos.boot.module.jyjc.api.dto;
import lombok.Data;
/**
* 机构进行检验时效统计对象
*
* @author Administrator
*/
@Data
public class InspectionTimelinesDto {
private String city;
private String name;
private String unitCode;
private Long count;
}
package com.yeejoin.amos.boot.module.jyjc.api.dto;
import lombok.Data;
/**
* 检验机构公示
*
* @author Administrator
*/
@Data
public class PublicityInspectOrgInfoDto {
/**
* 单位名称
*/
private String unitName;
/**
* 单位编码
*/
private String unitCode;
/**
* 核准代码
*/
private String approvalNumber;
/**
* 核准有效期
*/
private String aapprovalDeadline;
/**
* 业务有限期
*/
private String businessDeadline;
}
......@@ -219,6 +219,12 @@ public class JyjcInspectionApplication extends BaseEntity {
private JSONObject planData;
/**
* 计划下发日期,统计办理时效使用
*/
@TableField(value = "plan_create_date")
private Date planCreateDate;
/**
* 是否必须处理: true-必须处理,false-可不予受理
*/
@TableField(value = "is_must_accept")
......
......@@ -215,4 +215,11 @@ public class JyjcInspectionResult extends BaseEntity {
*/
@TableField(value = "safety_level")
private String safetyLevel;
/**
* 计划下发日期,,统计办理时效使用"
*/
@TableField(value = "plan_create_date")
private Date planCreateDate;
}
......@@ -19,12 +19,12 @@ public enum JYJCTypeEnum {
/**
* 检验检测类型
*/
DTJC("DTJC", "电梯检测", "jc", BizTypeEnum.DETECTION.getCode()),
DQJY("DQJY", "定期检验", "jy", BizTypeEnum.FIRST_INSPECTION.getCode()),
SCJY("SCJY", "首次检验", "jy", BizTypeEnum.FIRST_INSPECTION.getCode()),
WXJDJY("WXJDJY", "维修监督检验", "jy", BizTypeEnum.SUPERVISE.getCode()),
AZJDJY("AZJDJY", "安装监督检验", "jy", BizTypeEnum.SUPERVISE.getCode()),
GZJDJY("GZJDJY", "改造监督检验", "jy", BizTypeEnum.SUPERVISE.getCode()),
AZJDJY("AZJDJY", "安装监督检验", "jy", BizTypeEnum.SUPERVISE.getCode());
WXJDJY("WXJDJY", "维修监督检验", "jy", BizTypeEnum.SUPERVISE.getCode()),
SCJY("SCJY", "首次检验", "jy", BizTypeEnum.FIRST_INSPECTION.getCode()),
DQJY("DQJY", "定期检验", "jy", BizTypeEnum.FIRST_INSPECTION.getCode()),
DTJC("DTJC", "电梯检测", "jc", BizTypeEnum.DETECTION.getCode());
private final String code;
private final String name;
......
......@@ -42,4 +42,6 @@ public interface JyjcBaseMapper {
List<TzsUserInfoDto> selectUserByCompanyCodes(@Param("companyCodes") List<String> companyCodes);
CompanyModel selectOneCompanyByCode(String companyCode);
String getOrgCodeByCompanyCode(String companyCode);
}
......@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipDto;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel;
import org.springframework.data.repository.query.Param;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
......@@ -44,5 +46,41 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti
* @param equips 需要判断的设备
* @return 在流程中的设备records
*/
List<String> queryRecordListInFlowing(@org.apache.ibatis.annotations.Param("equips") List<JyjcInspectionApplicationEquipDto> equips);
List<String> queryRecordListInFlowing(@Param("equips") List<JyjcInspectionApplicationEquipDto> equips);
/**
* 按照检验类型、机构、时间统计检验数量(流程中及已完成的)
*
* @param orgCode 区域对应公司orgCode
* @param dpFilterParamDto 过滤条件
* @return 统计信息
*/
List<CountDto> queryAllFlowingAndFinishedInspectApp(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
/**
* 查询待出结果的报检单据数量
*
* @param orgCode 区域对应公司orgCode
* @param dpFilterParamDto 过滤条件
* @return 统计信息
*/
List<CountDto> queryAllPendingResultInspectApp(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
/**
* 按照8大类,查询指定区域下的报检数量、待检数量
* @param orgCode 指定区域对应的公司
* @param dpFilterParamDto 时间过滤条件
* @return List<CountDto>
*/
List<CountDto> queryAppByEquListForDP(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
/**
* 按照8大类,统计
* @param orgCode 指定区域对应的公司
* @param dpFilterParamDto 时间过滤条件
* @return CountDto
*/
CountDto queryAppByEquListForReporting(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
}
......@@ -2,10 +2,14 @@ package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 业务开通申请表 Mapper 接口
*
......@@ -18,4 +22,5 @@ public interface JyjcInspectionResultMapper extends BaseMapper<JyjcInspectionRes
Page<JyjcInspectionResultModel> selectForPage(@Param("page") Page<JyjcInspectionResultModel> page, @Param("jyjcInspectionResultModel") JyjcInspectionResultModel jyjcInspectionResultModel,@Param("identity") String identity);
List<InspectionTimelinesDto> queryInspectionTimelinessTopXX(@Param("top") String top, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
}
package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.PublicityInspectOrgInfoDto;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationModel;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -26,4 +28,12 @@ public interface JyjcOpeningApplicationMapper extends BaseMapper<JyjcOpeningAppl
void updatePromoter(@Param("id") Long id);
List<Long> selectOverdueData();
/**
* 检验机构公示
* @param orgCode 区域对应的orgCode
* @param dpFilterParamDto 过滤条件
* @return List<PublicityInspectOrgInfoDto>
*/
List<PublicityInspectOrgInfoDto> queryInspectionOrgListForPublicity(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
}
......@@ -166,6 +166,9 @@ public class JyjcInspectionApplicationModel extends BaseModel {
@ApiModelProperty(value = "是否已经进行计划排期")
private Boolean isExistPlanData;
@ApiModelProperty(value = "计划下发日期,统计办理时效使用,来源JyjcInspectionApplication.planCreateDate")
private Date planCreateDate;
/**
* 是否必须处理: true-必须处理,false-可不予受理
*/
......
......@@ -150,6 +150,11 @@ public class JyjcInspectionResultModel extends BaseModel {
@ApiModelProperty(value = "监管码")
private String supervisoryCode;
@ApiModelProperty(value = "计划下发日期,统计办理时效使用")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date planCreateDate;
/**
* 校验检验系统唯一流水号,排查问题,跟踪问题使用
*/
......
......@@ -85,6 +85,9 @@
WHERE
c.company_code =#{companyCode}
</select>
<select id="getOrgCodeByCompanyCode" resultType="java.lang.String">
select org_code from privilege_company where company_code = #{companyCode} limit 1
</select>
</mapper>
......@@ -216,4 +216,83 @@
UPDATE tz_jyjc_inspection_application set promoter = null
where sequence_nbr = #{id}
</update>
<select id="queryAllFlowingAndFinishedInspectApp" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
count(1) as longValue,
a.inspection_type as keyStr
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
and a.status != '6610' and a.status != '6615'
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
and date_le(CAST(a.application_date as date),#{dto.endDate})
group by a.inspection_type
</select>
<select id="queryAllPendingResultInspectApp" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
count(1) as longValue,
a.inspection_type as keyStr
FROM
tz_jyjc_inspection_application a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
and a.status = '6616'
and EXISTS (select 1 from tz_jyjc_inspection_result r where r.result_status='1' and a.application_no = r.application_no)
and date_ge(CAST(a.accept_date as date),#{dto.beginDate}) and date_le(CAST(a.accept_date as date),#{dto.endDate})
group by a.inspection_type
</select>
<select id="queryAppByEquListForDP" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
-- 8大类 待检数量
SELECT
count(1) as longValue,
a.equip_classify as keyStr,
'pending' as label
FROM
tz_jyjc_inspection_application a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
and a.status = '6616'
and EXISTS (select 1 from tz_jyjc_inspection_result r where r.result_status='1' and a.application_no = r.application_no)
and date_ge(CAST(a.accept_date as date),#{dto.beginDate}) and date_le(CAST(a.accept_date as date),#{dto.endDate})
GROUP BY a.equip_classify
-- 8大类 报检数量统计
union all
SELECT
count(1) as longValue,
a.equip_classify as keyStr,
'reporting' as label
FROM
tz_jyjc_inspection_application a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
and a.status != '6610' and a.status != '6615'
and date_ge(CAST(a.application_date as date),#{dto.beginDate}) and date_le(CAST(a.application_date as date),#{dto.endDate})
GROUP BY a.equip_classify
</select>
<select id="queryAppByEquListForReporting" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
count(1) as longValue
FROM
tz_jyjc_inspection_application a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
and a.status != '6610' and a.status != '6615'
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(a.application_date as date),#{dto.endDate})
</if>
</select>
</mapper>
......@@ -157,4 +157,28 @@
</where>
ORDER BY res.sequence_nbr DESC
</select>
<select id="queryInspectionTimelinessTopXX" resultType="com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto">
select
a1.avgtime as count,
a1.inspection_unit_code as unitCode,
b1.use_unit as name,
b1.city
from
(SELECT
ROUND(avg(EXTRACT(EPOCH FROM ( r.rec_date - r.plan_create_date)) / 60),0) as avgtime,
r.inspection_unit_code
FROM
tz_jyjc_inspection_result r,
tz_base_enterprise_info b
where
r.result_status ='2'
and r.inspection_unit_code= b.use_unit_code
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
GROUP BY r.inspection_unit_code ORDER BY avgtime
limit #{top}
) a1,
tz_base_enterprise_info b1
WHERE
a1.inspection_unit_code = b1.use_unit_code
</select>
</mapper>
......@@ -50,4 +50,37 @@
UPDATE tz_jyjc_opening_application set promoter = null
where sequence_nbr = #{id}
</update>
<select id="queryInspectionOrgListForPublicity" resultType="com.yeejoin.amos.boot.module.jyjc.api.dto.PublicityInspectOrgInfoDto">
select
b.use_unit as unitName,
l.cert_no as approvalNumber,
l.expiry_date as aapprovalDeadline,
b.use_code as unitCode,
a.expiry_date as businessDeadline,
a.licenceType
from
(SELECT
unit_code,
expiry_date,
unit_code_name,
case when
open_biz_type = 'jy' then '1233-1'
when
open_biz_type = 'jc' then '1233-2'
end as open_biz_type,
open_biz_type as licenceType
FROM
"tz_jyjc_opening_application"
where
status = '6616') a,
tz_base_enterprise_info b,
(select cert_no, min(expiry_date) as expiry_date, unit_code, cert_type_code from tz_base_unit_licence GROUP BY cert_no,unit_code,cert_type_code) l
where
a.unit_code= b.use_unit_code
and a.unit_code=l.unit_code
and l.cert_type_code = a.open_biz_type
and b.supervise_org_code like CONCAT(#{orgCode}, '%')
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
ORDER BY unitName
</select>
</mapper>
......@@ -34,6 +34,11 @@
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-redis-spring</artifactId>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>visual-feign-morphic</artifactId>
<version>1.9.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
......
package com.yeejoin.amos.boot.module.jyjc.biz.config;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
/**
* @Author: xl
* @Description:
* @Date: 2022/9/21 18:04
*/
@Configuration
public class RestTemplateConfig {
@Bean
@LoadBalanced
public RestTemplate getRestTemplate() {
return new RestTemplate();
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jyjc.biz.controller;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.PublicityInspectOrgInfoDto;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.DPStatisticsServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.exception.instance.BadRequest;
......@@ -42,8 +41,8 @@ public class DPStatisticsController {
@PostMapping(value = "/inspectTime/count/byEquListAndInspectType")
public ResponseModel<Map<String, Object>> inspectTimeCountByTypeAndEquList(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if(!fieldErrors.isEmpty()){
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.inspectTimeCountByTypeAndEquList(dpFilterParamDto));
}
......@@ -53,10 +52,110 @@ public class DPStatisticsController {
@PostMapping(value = "/inspectTimeCount")
public ResponseModel<Map<String, Object>> inspectTimeCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if(!fieldErrors.isEmpty()){
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.inspectTimeCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-检验检测-左侧检验检测人员统计", notes = "大屏-检验检测-左侧检验检测人员统计")
@PostMapping(value = "/jy/person/count")
public ResponseModel<Map<String, Object>> inspectPersonCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.inspectPersonCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-检验检测-各检验类型业务数量统计", notes = "大屏-检验检测-各检验类型业务数量统计")
@PostMapping(value = "/jy/allApp/countByType")
public ResponseModel<Map<String, Object>> inspectBizNumCountByType(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.queryAllFlowingAndFinishedInspectApp(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-检验检测-各检验类型待检数量统计", notes = "大屏-检验检测-各检验类型待检数量统计")
@PostMapping(value = "/jy/pendingApp/countByType")
public ResponseModel<Map<String, Object>> queryAllFlowingAndFinishedInspectApp(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.queryAllPendingResultInspectApp(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-检验检测-按机构进行检验时效统计Top10排名", notes = "大屏-检验检测-按机构进行检验时效统计Top10排名")
@PostMapping(value = "/jy/timeliness/top")
public ResponseModel<List<InspectionTimelinesDto>> inspectionTimelinessTopXX(@RequestParam(required = false, defaultValue = "10") String top, @Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.queryInspectionTimelinessTopXX(top, dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-检验检测-检验检测机构公示", notes = "大屏-检验检测-检验检测机构公示")
@PostMapping(value = "/jy/inspectionOrgList/publicity")
public ResponseModel<List<PublicityInspectOrgInfoDto>> inspectionOrgListForPublicity(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.queryInspectionOrgListForPublicity(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-检验检测-八大类设备报检/待检数量统计", notes = "大屏-检验检测-八大类设备报检/待检数量统计")
@PostMapping(value = "/jy/inspectionEquip/countByEquList")
public ResponseModel<Map<String, Object>> inspectionEquipCountByEquList(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.queryInspectionEquipByEquList(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-检验检测-中间地图左侧全局统计", notes = "大屏-检验检测-中间地图左侧全局统计")
@PostMapping(value = "/jy/center-map/legend")
public ResponseModel<Map<String, Object>> centerMapCountForGlobal(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.getCenterMapCountDataForGlobal(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-检验检测-中间地图地市统计", notes = "大屏-检验检测-中间-地图地市统计")
@PostMapping(value = "/jy/center-map/overview")
public ResponseModel<List<Map<String, Object>>> centerMapCountForOverview(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.getCenterMapCountDataForOverview(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-检验检测-八大类设备检验临期、超期统计", notes = "大屏-检验检测-八大类设备检验临期、超期统计")
@PostMapping(value = "/jy/equipInspectTime/countByEquList")
public ResponseModel<Map<String, Object>> equipInspectTimeCountByEquList(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.equipInspectTimeCountByEquList(dpFilterParamDto));
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.DPSubServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.util.Assert;
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.Map;
/**
* 大屏统计controller
*
* @author Administrator
*/
@RestController
@RequestMapping("/dp/sub")
@Api(tags = "大屏二级弹窗")
public class DPSubController {
private DPSubServiceImpl subService;
public DPSubController(DPSubServiceImpl subService) {
this.subService = subService;
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "动态详情页", notes = "动态详情页")
@PostMapping(value = "/{template}")
public ResponseModel<JSONObject> commonQuery(@PathVariable String template, @RequestBody Map<String, Object> param) {
if (template.equals("company")){
Assert.notNull(param.get("useUnitCode"), "企业统一信用代码不能为空");
} else if (template.equals("equip")){
param.put("record", param.get("SEQUENCE_NBR"));
param.put("equList", param.get("EQU_LIST_CODE"));
Assert.notNull(param.get("record"), "设备ID不能为空");
Assert.notNull(param.get("equList"), "设备种类不能为空");
template = template + "_" + param.get("equList");
} else {
throw new RuntimeException("暂无模板");
}
return ResponseHelper.buildResponse(subService.commonQuery(template, param));
}
}
......@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
......@@ -25,13 +26,16 @@ public class InspectionPlanServiceImpl {
private JyjcInspectionApplicationEquipServiceImpl applicationEquipService;
private JyjcInspectionResultServiceImpl inspectionResultService;
private ESEquipmentCategory esEquipmentCategory;
public InspectionPlanServiceImpl(JyjcInspectionApplicationServiceImpl inspectionApplicationService,
JyjcInspectionApplicationEquipServiceImpl applicationEquipService,
ESEquipmentCategory esEquipmentCategory) {
JyjcInspectionResultServiceImpl inspectionResultService, ESEquipmentCategory esEquipmentCategory) {
this.inspectionApplicationService = inspectionApplicationService;
this.applicationEquipService = applicationEquipService;
this.inspectionResultService = inspectionResultService;
this.esEquipmentCategory = esEquipmentCategory;
}
......@@ -40,15 +44,23 @@ public class InspectionPlanServiceImpl {
LambdaUpdateWrapper<JyjcInspectionApplication> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(JyjcInspectionApplication::getPlanData, JSONObject.toJSONString(model));
updateWrapper.eq(BaseEntity::getSequenceNbr, applicationSeq);
updateWrapper.set(JyjcInspectionApplication::getPlanCreateDate, new Date());
inspectionApplicationService.update(updateWrapper);
// 异步写入计划排期日期,统计办理时效使用
this.updatePlanCreateDate(applicationSeq);
return model;
}
private void updatePlanCreateDate(String applicationSeq) {
JyjcInspectionApplication inspectionApplication = inspectionApplicationService.getById(applicationSeq);
inspectionResultService.updatePlanCreateDateByAppNo(inspectionApplication.getApplicationNo());
}
public JSONObject getDetail(String applicationSeq) {
JyjcInspectionApplication inspectionApplication = inspectionApplicationService.getById(applicationSeq);
// 初始时查询设备地址关联设备表
JSONObject jsonObject = inspectionApplication.getPlanData();
if(jsonObject == null){
if (jsonObject == null) {
jsonObject = new JSONObject();
String address = this.getOneEquipAddress(applicationSeq);
jsonObject.put("address", address);
......@@ -61,10 +73,10 @@ public class InspectionPlanServiceImpl {
List<JyjcInspectionApplicationEquip> applicationEquips = applicationEquipService.list(new LambdaQueryWrapper<JyjcInspectionApplicationEquip>().eq(JyjcInspectionApplicationEquip::getApplicationSeq, applicationSeq));
// 拼接地址
List<String> allAddress = new ArrayList<>();
applicationEquips.forEach(e->{
applicationEquips.forEach(e -> {
String record = e.getEquipUnicode();
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
if(optional.isPresent()){
if (optional.isPresent()) {
ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get();
allAddress.add(this.concatDetailAddress(esEquipmentCategoryDto));
}
......@@ -77,6 +89,6 @@ public class InspectionPlanServiceImpl {
String usePlace = esEquipmentCategoryDto.getUSE_PLACE();
// 详细地址
String address = esEquipmentCategoryDto.getADDRESS();
return String.format("%s%s",usePlace, address);
return String.format("%s%s", usePlace, address);
}
}
......@@ -1289,7 +1289,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
}
// 只有纳管的设备才能做业务 TODO
boolMust.must(QueryBuilders.existsQuery("IS_INTO_MANAGEMENT"));
boolMust.must(QueryBuilders.termsQuery("IS_INTO_MANAGEMENT", true));
boolMust.must(QueryBuilders.termQuery("IS_INTO_MANAGEMENT", true));
}
private Set<String> getEquipInFlowing() {
......
......@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
......@@ -39,6 +40,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
......@@ -504,4 +506,12 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
String group = getPersonIdentityByType(selectedOrgInfo.getCompany().getCompanyType());
return JyjcInspectionApplicationServiceImpl.getDictionarieModels(group);
}
@Async
public void updatePlanCreateDateByAppNo(String appNo) {
LambdaUpdateWrapper<JyjcInspectionResult> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(JyjcInspectionResult::getApplicationNo, appNo);
updateWrapper.set(JyjcInspectionResult::getPlanCreateDate, new Date());
this.update(updateWrapper);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jyjc.biz.util;
import org.springframework.core.io.ClassPathResource;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class DpSubUtils {
public static String companyJson = null;
public static String textJson = null;
public static String imageJson = null;
public static String circleJson = null;
public static String rectJson = null;
static {
// companyJson = getFileContent("company.json");
// textJson = getFileContent("text.json");
// imageJson = getFileContent("image.json");
// circleJson = getFileContent("circle.json");
// rectJson = getFileContent("rect.json");
}
public static String getFileContent(String filename){
try {
BufferedReader br = new BufferedReader(new InputStreamReader(new ClassPathResource("json/"+filename).getInputStream()));
StringBuffer sb = new StringBuffer();
String line = null;
while((line = br.readLine())!=null){
if(line.trim().length()>0)
sb.append(line);
}
br.close();
return sb.toString();
} catch (Exception e) {
throw new RuntimeException(e);
// return null;
}
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.util;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Strings;
/**
* @Author: xl
* @Description: json快速取值
* @Date: 2022/5/12 11:11
*/
public class JsonValueUtils {
public static Object getValueByKey(Object originObject, String startKey,
String targetKey) {
if (Strings.isNullOrEmpty(startKey)) {
return originObject;
}
if (originObject instanceof JSONObject) {
return getValueFromJSONObjectByKey((JSONObject) originObject, startKey,
targetKey);
}
if (originObject instanceof JSONArray) {
return getValueFromJSONArrayByKey((JSONArray) originObject, startKey,
targetKey);
}
return null;
}
private static String getNextKey(String startKey, String targetKey) {
if (Strings.isNullOrEmpty(targetKey)) {
return null;
}
String[] keys = targetKey.split("\\.");
for (int i = 0; i < keys.length; i++) {
if (keys[i].equals(startKey) && (i < keys.length - 1)) {
return keys[i + 1];
}
}
return null;
}
private static Object getValueFromJSONArrayByKey(JSONArray originObject,
String startKey,
String targetKey) {
try {
Integer integer = Integer.valueOf(startKey);
JSONObject jsonObject = originObject.getJSONObject(integer);
Object targetObject = getValueFromJSONObjectByKey(jsonObject, getNextKey(startKey, targetKey),
targetKey);
if (targetObject != null) {
return targetObject;
}
} catch (NumberFormatException e) {
e.printStackTrace();
}
return null;
}
private static Object getValueFromJSONObjectByKey(JSONObject originObject,
String startKey,
String targetKey) {
Object object = originObject.get(startKey);
return object != null
? getValueByKey(object, getNextKey(startKey, targetKey),
targetKey)
: null;
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.util;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import java.net.URI;
import java.util.Map;
/**
* @Author: xl
* @Description: 远程调用工具类
* @Date: 2021/10/8 13:46
*/
public class RestTemplateUtils {
private static class SingletonRestTemplate {
static final RestTemplate INSTANCE = new RestTemplate();
}
private RestTemplateUtils() {
}
public static RestTemplate getInstance() {
return SingletonRestTemplate.INSTANCE;
}
/**
* 带请求头的GET请求调用方式
*
* @param uri 请求URL
* @param headers 请求头参数
* @param responseType 返回对象类型
* @param uriVariables URL中的变量,与Map中的key对应
* @return ResponseEntity 响应对象封装类
*/
public static <T> ResponseEntity<T> get(URI uri, HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpEntity<?> requestEntity = new HttpEntity<>(headers);
return RestTemplateUtils.getInstance().exchange(uri, HttpMethod.GET, requestEntity, responseType);
}
/**
* @param restTemplate 可传入负载均衡的restTemplate
* @param uri
* @param headers
* @param responseType
* @param uriVariables
* @param <T>
* @return
*/
public static <T> ResponseEntity<T> get(RestTemplate restTemplate, URI uri, HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpEntity<?> requestEntity = new HttpEntity<>(headers);
return restTemplate.exchange(uri, HttpMethod.GET, requestEntity, responseType);
}
/**
* 带请求头的POST请求调用方式
*
* @param uri 请求URL
* @param headers 请求头参数
* @param requestBody 请求参数体
* @param responseType 返回对象类型
* @param uriVariables URL中的变量,与Map中的key对应
* @return ResponseEntity 响应对象封装类
*/
public static <T> ResponseEntity<T> post(URI uri, HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return RestTemplateUtils.getInstance().postForEntity(uri, requestEntity, responseType);
}
/**
* @param restTemplate 可传入负载均衡的restTemplate
* @param uri
* @param headers
* @param requestBody
* @param responseType
* @param uriVariables
* @param <T>
* @return
*/
public static <T> ResponseEntity<T> post(RestTemplate restTemplate, URI uri, HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return restTemplate.postForEntity(uri, requestEntity, responseType);
}
/**
* 带请求头的PUT请求调用方式
*
* @param uri 请求URL
* @param headers 请求头参数
* @param requestBody 请求参数体
* @param responseType 返回对象类型
* @return ResponseEntity 响应对象封装类
*/
public static <T> ResponseEntity<T> put(URI uri, HttpHeaders headers, Object requestBody, Class<T> responseType) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return RestTemplateUtils.getInstance().exchange(uri, HttpMethod.PUT, requestEntity, responseType);
}
/**
* @param restTemplate 可传入负载均衡的restTemplate
* @param uri
* @param headers
* @param requestBody
* @param responseType
* @param <T>
* @return
*/
public static <T> ResponseEntity<T> put(RestTemplate restTemplate, URI uri, HttpHeaders headers, Object requestBody, Class<T> responseType) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return restTemplate.exchange(uri, HttpMethod.PUT, requestEntity, responseType);
}
/**
* 带请求头的DELETE请求调用方式
*
* @param uri 请求URL
* @param headers 请求头参数
* @param requestBody 请求参数体
* @param responseType 返回对象类型
* @return ResponseEntity 响应对象封装类
*/
public static <T> ResponseEntity<T> delete(URI uri, HttpHeaders headers, Object requestBody, Class<T> responseType) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return RestTemplateUtils.getInstance().exchange(uri, HttpMethod.DELETE, requestEntity, responseType);
}
/**
* @param restTemplate 可传入负载均衡的restTemplate
* @param uri
* @param headers
* @param requestBody
* @param responseType
* @param <T>
* @return
*/
public static <T> ResponseEntity<T> delete(RestTemplate restTemplate, URI uri, HttpHeaders headers, Object requestBody, Class<T> responseType) {
HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
return restTemplate.exchange(uri, HttpMethod.DELETE, requestEntity, responseType);
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
/**
* @Author: xinglei
* @Description:
* @Date: 2020/8/24 9:58
*/
public class StringUtils {
public static boolean contrastLowerStr(String str1, String str2) {
boolean flag = false;
if (str1.toLowerCase().equals(str2.toLowerCase())) {
flag = true;
}
return flag;
}
/**
* 将map转换成url
*
* @param map
* @return
*/
public static String transMap2UrlParam(Map<String, Object> map) {
StringBuilder stringBuilder = new StringBuilder();
for (Map.Entry entry : map.entrySet()) {
// 值为空或匹配total不拼接
if (ValidationUtil.isEmpty(entry.getValue()) || "total".equals(entry.getKey()))
continue;
try {
stringBuilder.append("&").append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue().toString(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return stringBuilder.toString();
}
/**
* 将list转换成url
*
* @param list
* @return
*/
public static String transList2UrlParam(List<Map<String, Object>> list) {
StringBuilder stringBuilder = new StringBuilder();
list.forEach(x -> {
Map<String, Object> map = JSONObject.parseObject(JSON.toJSONString(x));
try {
stringBuilder.append("&").append(map.get("key")).append("=").append(URLEncoder.encode(map.get("value").toString(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
});
return stringBuilder.toString();
}
}
{
"name": "检验检测机构模板",
"tabs": [
{
"key": "basic",
"displayName": "基本信息",
"renderType": "basic",
"formSeq": "1793454184889085953",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/tcm/baseEnterprise/getInfoByUseCode/map",
"params": {
"useCode": "{useUnitCode}"
}
},
"resultConvert": ""
}
},
{
"key": "devtable",
"displayName": "设备列表",
"renderType": "table",
"formSeq": "1792821076963651585",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/page",
"params": {
"number": 1,
"size": 14,
"USE_UNIT_CREDIT_CODE": "{useUnitCode}"
}
},
"columnWidth": {
"EQU_LIST": 150,
"EQU_CATEGORY": 160,
"EQU_DEFINE": 150,
"PRODUCT_NAME": 180,
"EQU_CODE": 180,
"FACTORY_NUM": 180,
"PRODUCE_UNIT_NAME": 180,
"USE_UNIT_NAME": 180
}
}
}
],
"content": {
"basic": {
"columns": 2,
"datas": [],
"qrcode": {},
"subs": []
}
}
}
\ No newline at end of file
{
"name": "设备-锅炉",
"tabs": [
{
"key": "basic",
"displayName": "设备信息",
"renderType": "basic",
"formSeq": "1793458381554479105",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipInfo"
}
}
}
},
{
"key": "gl",
"displayName": "锅炉技术参数",
"renderType": "basic",
"formSeq": "1734819004637278210",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
}
},
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline",
"formSeq": "",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "1793458819301404673",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"record": "{record}"
}
},
"columnWidth": {
}
}
}
],
"content": {
"basic": {
"columns": 3,
"datas": [],
"qrcode": {},
"subs": []
},
"gl": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "设备-压力容器",
"tabs": [
{
"key": "basic",
"displayName": "设备信息",
"renderType": "basic",
"formSeq": "1793458381554479105",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipInfo"
}
}
}
},
{
"key": "ylrq",
"displayName": "压力容器技术参数",
"renderType": "basic",
"formSeq": "1734818687287848961",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
}
},
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline",
"formSeq": "",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "1793458819301404673",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"record": "{record}"
}
},
"columnWidth": {
}
}
}
],
"content": {
"basic": {
"columns": 3,
"datas": [],
"qrcode": {},
"subs": []
},
"ylrq": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "设备-电梯",
"tabs": [
{
"key": "basic",
"displayName": "设备信息",
"renderType": "basic",
"formSeq": "1793458381554479105",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipInfo"
}
}
}
},
{
"key": "dt",
"displayName": "电梯技术参数",
"renderType": "basic",
"formSeq": "1734504628768239617",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
}
},
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline",
"formSeq": "",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "1793458819301404673",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"record": "{record}"
}
},
"columnWidth": {
}
}
}
],
"content": {
"basic": {
"columns": 3,
"datas": [],
"qrcode": {},
"subs": []
},
"dt": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "设备-起重机械",
"tabs": [
{
"key": "basic",
"displayName": "设备信息",
"renderType": "basic",
"formSeq": "1793458381554479105",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipInfo"
}
}
}
},
{
"key": "qzqx",
"displayName": "起重机械技术参数",
"renderType": "basic",
"formSeq": "1734818709194698753",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
}
},
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline",
"formSeq": "",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "1793458819301404673",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"record": "{record}"
}
},
"columnWidth": {
}
}
}
],
"content": {
"basic": {
"columns": 3,
"datas": [],
"qrcode": {},
"subs": []
},
"qzqx": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "设备-场(厂)内机动车",
"tabs": [
{
"key": "basic",
"displayName": "设备信息",
"renderType": "basic",
"formSeq": "1793458381554479105",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipInfo"
}
}
}
},
{
"key": "cnjdc",
"displayName": "场(厂)内机动车技术参数",
"renderType": "basic",
"formSeq": "1734818684284727297",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
}
},
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline",
"formSeq": "",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "1793458819301404673",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"record": "{record}"
}
},
"columnWidth": {
}
}
}
],
"content": {
"basic": {
"columns": 3,
"datas": [],
"qrcode": {},
"subs": []
},
"cnjdc": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "设备-大型游乐设施",
"tabs": [
{
"key": "basic",
"displayName": "设备信息",
"renderType": "basic",
"formSeq": "1793458381554479105",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipInfo"
}
}
}
},
{
"key": "dxylss",
"displayName": "大型游乐设施技术参数",
"renderType": "basic",
"formSeq": "1734818700369883137",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
}
},
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline",
"formSeq": "",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "1793458819301404673",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"record": "{record}"
}
},
"columnWidth": {
}
}
}
],
"content": {
"basic": {
"columns": 3,
"datas": [],
"qrcode": {},
"subs": []
},
"dxylss": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "设备-压力管道",
"tabs": [
{
"key": "basic",
"displayName": "设备信息",
"renderType": "basic",
"formSeq": "1793458381554479105",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipInfo"
}
}
}
},
{
"key": "ylgd",
"displayName": "压力管道",
"renderType": "basic",
"formSeq": "1734818687287848961",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
}
},
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline",
"formSeq": "",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "1793458819301404673",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"record": "{record}"
}
},
"columnWidth": {
}
}
}
],
"content": {
"basic": {
"columns": 3,
"datas": [],
"qrcode": {},
"subs": []
},
"ylgd": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "设备-客运索道",
"tabs": [
{
"key": "basic",
"displayName": "设备信息",
"renderType": "basic",
"formSeq": "1793458381554479105",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipInfo"
}
}
}
},
{
"key": "kysd",
"displayName": "客运索道",
"renderType": "basic",
"formSeq": "1734818694514634753",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/equipment-register/{record}",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
}
},
{
"key": "reghistory",
"displayName": "监管履历信息",
"renderType": "timeline",
"formSeq": "",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/common/equOnJgServiceOperationRecords",
"params": {
"record": "{record}"
},
"ruleData": {
"responseSuccess": "data.result",
"operater": "content"
}
}
}
},
{
"key": "devtable",
"displayName": "问题列表",
"renderType": "table",
"formSeq": "1793458819301404673",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/safety-problem-tracing/equipId/page",
"params": {
"number": 1,
"size": 10,
"record": "{record}"
}
},
"columnWidth": {
}
}
}
],
"content": {
"basic": {
"columns": 3,
"datas": [],
"qrcode": {},
"subs": []
},
"kysd": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "非检验检测机构模板",
"tabs": [
{
"key": "basic",
"displayName": "基本信息",
"renderType": "basic",
"formSeq": "1793454184889085953",
"dataConfig": {
"api": {
"reqType":"GET",
"url":"/tcm/baseEnterprise/getInfoByUseCode",
"params": {
"useCode": "{useUnitCode}"
}
}
}
},
{
"key": "devtable",
"displayName": "设备列表",
"renderType": "table",
"formSeq": "1792821076963651585",
"dataConfig": {
"api": {
"reqType":"GET",
"url":"/jg/equipment-register/page",
"params": {
"number": 1,
"size": 10,
"USE_UNIT_CREDIT_CODE": "{useUnitCode}"
}
}
}
}
],
"content": {
"basic": {
"columns": 2,
"datas": [],
"qrcode": {
"src": "/public/ag/zongshu.png",
"text": "2023/12/26",
"subtext": "23:10:16"
},
"subs": []
}
}
}
\ No newline at end of file
......@@ -289,6 +289,9 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
@ApiModelProperty(value = "行业主管部门")
private String industrySupervisor;
@ApiModelProperty(value = "企业问题状态")
private String status;
private String region;
......
package com.yeejoin.amos.boot.module.tcm.api.enums;
import java.util.HashMap;
import java.util.Map;
/**
* 问题状态
*/
public enum ProblemStatusEnum {
NORMAL("正常", "0"),
ABNORMAL("异常", "1");
private String name;
private String code;
ProblemStatusEnum(String name, String code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setStatus(String code) {
this.code = code;
}
public static Map<String, String> getName = new HashMap<>();
public static Map<String, String> getCode = new HashMap<>();
static {
for (ProblemStatusEnum e : ProblemStatusEnum.values()) {
getName.put(e.code, e.name);
getCode.put(e.name, e.code);
}
}
}
package com.yeejoin.amos.boot.module.tcm.api.mapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -11,6 +8,9 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 企业数据信息 Mapper 接口
*
......@@ -54,4 +54,6 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
List<TzBaseEnterpriseInfo> listNoQrCode();
List<Map<String, Object>> getEquipType(@Param("type")String type);
Map<String, Object> getProblemInfoBySourceId(@Param("sourceId")String sourceId);
}
......@@ -48,4 +48,6 @@ public interface ITzBaseEnterpriseInfoService extends IService<TzBaseEnterpriseI
String setLabel(List<Long> enterpriseIds, List<String> enterpriseLabels);
BaseUnitLicence getUnitLicenceMessage(String unitCode);
Map<String, Object> getInfoByUseCodeMap(String useCode);
}
......@@ -172,5 +172,8 @@
</if>
</where>
</select>
<select id="getProblemInfoBySourceId" resultType="java.util.Map">
select * from tzs_safety_problem_tracing where source_id = #{sourceId} order by rec_date desc limit 1
</select>
</mapper>
......@@ -200,6 +200,13 @@ public class TzBaseEnterpriseInfoController extends BaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/getInfoByUseCode/map", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据统一信用代码查询企业详情返回map", notes = "根据统一信用代码查询企业详情返回map")
public ResponseModel<Map<String, Object>> getInfoByUseCodeMap(String useCode) {
return ResponseHelper.buildResponse(iTzBaseEnterpriseInfoService.getInfoByUseCodeMap(useCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/getInfoByUseCodeList", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据统一信用代码查询企业详情", notes = "根据统一信用代码查询企业详情")
public ResponseModel<IPage<TzBaseEnterpriseInfoDto>> getInfoByUseCodeList(String useCode) {
......
......@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.ObjectMapper;
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.service.impl.DataDictionaryServiceImpl;
......@@ -21,6 +22,7 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.TzsBaseInstitutionDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.*;
import com.yeejoin.amos.boot.module.tcm.api.enums.EnterpriseEnums;
import com.yeejoin.amos.boot.module.tcm.api.enums.LicenceTypeEnum;
import com.yeejoin.amos.boot.module.tcm.api.enums.ProblemStatusEnum;
import com.yeejoin.amos.boot.module.tcm.api.enums.UnitTypeEnum;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper;
......@@ -237,6 +239,57 @@ public class TzBaseEnterpriseInfoServiceImpl
}
@Override
public Map<String, Object> getInfoByUseCodeMap(String useCode) {
TzBaseEnterpriseInfoDto infoByUseCode = getInfoByUseCode(useCode);
// 通过sourceId获取问题信息
Map<String,Object> problemInfo = baseMapper.getProblemInfoBySourceId(infoByUseCode.getSequenceNbr().toString());
ObjectMapper objectMapper = new ObjectMapper();
Map<String,Object> resultMap = new HashMap<>();
RegUnitIcDto regUnitIcDto = infoByUseCode.getRegUnitIcDto();
RegUnitInfoDto regUnitInfoDto = infoByUseCode.getRegUnitInfoDto();
TzsBaseInstitution tzsBaseInstitution = infoByUseCode.getRegUnitMessage();
Map<String,Object> regUnitIcDtoMap = new HashMap<>();
Map<String,Object> regUnitInfoDtoMap = new HashMap<>();
Map<String,Object> tzsBaseInstitutionMap = new HashMap<>();
try {
resultMap = objectMapper.convertValue(infoByUseCode, Map.class);
regUnitIcDtoMap = objectMapper.convertValue(regUnitIcDto, Map.class);
regUnitInfoDtoMap = objectMapper.convertValue(regUnitInfoDto, Map.class);
tzsBaseInstitutionMap = objectMapper.convertValue(tzsBaseInstitution, Map.class);
} catch (Exception e) {
e.printStackTrace();
}
if(!ObjectUtils.isEmpty(regUnitIcDtoMap)){
resultMap.putAll(regUnitIcDtoMap);
}
if(!ObjectUtils.isEmpty(regUnitInfoDtoMap)){
regUnitInfoDtoMap.remove("unitLicences");
resultMap.putAll(regUnitInfoDtoMap);
}
if(!ObjectUtils.isEmpty(tzsBaseInstitutionMap)){
resultMap.putAll(tzsBaseInstitutionMap);
}
resultMap.remove("regUnitIcDto");
resultMap.remove("regUnitInfoDto");
resultMap.remove("tzsBaseInstitution");
resultMap.put("unitAddress", resultMap.get("province") + "/" + resultMap.get("city") + "/" + resultMap.get("district"));
Map<String,Object> longitudeLatitudeMap = new HashMap<>();
longitudeLatitudeMap.put("address", resultMap.get("address"));
longitudeLatitudeMap.put("latitude", resultMap.get("latitude"));
longitudeLatitudeMap.put("longitude", resultMap.get("longitude"));
resultMap.put("longitudeLatitude", longitudeLatitudeMap);
resultMap.put("problemTime", ObjectUtils.isEmpty(problemInfo) ? null : problemInfo.get("problem_time"));
resultMap.put("problemStatus", (ObjectUtils.isEmpty(resultMap.get("status")) || "null".equals(resultMap.get("status"))) ? ProblemStatusEnum.NORMAL.getName() : ProblemStatusEnum.getName.get(resultMap.get("status")));
return resultMap;
}
@Override
public TzBaseEnterpriseInfoDto getInfoByUseCode(String useCode) {
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = tzBaseEnterpriseInfoMapper.selectOne(new QueryWrapper<TzBaseEnterpriseInfo>().eq("use_code", useCode));
......@@ -869,4 +922,6 @@ public class TzBaseEnterpriseInfoServiceImpl
return baseUnitLicenceService.getBaseMapper().selectOne(lambda);
}
}
......@@ -452,7 +452,7 @@ public class ScreenImpl implements IScreenService {
//设置模糊搜索
searchSourceBuilder.query(QueryBuilders.boolQuery()
.must(QueryBuilders.wildcardQuery("USE_PLACE_CODE", "*"+screenDto.getCityCode()+"*"))
.must(QueryBuilders.termsQuery("IS_INTO_MANAGEMENT", true)));
.must(QueryBuilders.termQuery("IS_INTO_MANAGEMENT", true)));
searchSourceBuilder.aggregation(
AggregationBuilders.terms("USE_SITE_CODE").field("USE_SITE_CODE")
);
......
......@@ -89,5 +89,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
List<String> selectXiXianNew();
Long countEquipByReginCode(String orgCode);
}
......@@ -6,11 +6,8 @@ import com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
Page<TzsUserInfoDto> selectPageMessage(@Param("page") Page<TzsUserInfoDto> page, @Param("dto") TzsUserInfoDto dto);
Long countUserByPostAndAreaCode(@Param("orgCode") String orgCode, @Param("post") String post);
Long countUserByPostAndAreaCode(@Param("orgCode") String orgCode, @Param("post") String post, @Param("regionCode") String regionCode);
}
......@@ -680,4 +680,15 @@
AND ( ibjoi."CODE96333" NOT LIKE'31%' OR ibjoi."CODE96333" IS NULL )
AND "CLAIM_STATUS" = '已认领';
</select>
<select id="countEquipByReginCode" resultType="java.lang.Long">
select
count(1)
from
idx_biz_jg_use_info ibjui,
idx_biz_jg_supervision_info ibjsi
where
ibjui."RECORD" = ibjsi."RECORD"
and ibjsi."ORG_BRANCH_CODE" like concat (#{reginCode},'%')
and ibjui."IS_INTO_MANAGEMENT" = true
</select>
</mapper>
......@@ -57,7 +57,7 @@
WHERE
tui.unit_code = bi.use_unit_code
and tui.post LIKE concat ( '%', #{post}, '%' )
and bi.supervise_org_code LIKE CONCAT ( #{orgCode}, '%' )
and ((bi.supervise_org_code != '50' and bi.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (bi.supervise_org_code = '50' and bi.office_region LIKE CONCAT ('%', #{regionCode}, '%')))
and tui.is_delete=false
</select>
</mapper>
\ 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