Commit 58831fa6 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 4b0ef580 05fd6a35
...@@ -55,6 +55,12 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> { ...@@ -55,6 +55,12 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
*/ */
List<Map<String, Object>> queryListByLocation(@Param("regionCode") String regionCode, @Param("dto") DPFilterParamDto filterParamDto); List<Map<String, Object>> queryListByLocation(@Param("regionCode") String regionCode, @Param("dto") DPFilterParamDto filterParamDto);
/** /**
* 接警情况统计(故障原因)
*
* @return
*/
List<Map<String, Object>> faultCauseRatio(@Param("regionCode") String regionCode);
/**
* 接警情况统计 * 接警情况统计
* *
* @param beginDate * @param beginDate
......
...@@ -160,6 +160,28 @@ ...@@ -160,6 +160,28 @@
ORDER BY ibjuj.USE_PLACE ASC ORDER BY ibjuj.USE_PLACE ASC
</select> </select>
<select id="faultCauseRatio" resultType="java.util.Map">
SELECT
tafv.field_value AS errorResult,
ifnull ( SUM ( CASE WHEN tac.father_alert IS NULL THEN 1 ELSE 0 END ), 0 ) AS majorAlertCount
FROM
tz_alert_called tac
LEFT JOIN tz_dispatch_task tdt ON tac.sequence_nbr = tdt.alert_id
LEFT JOIN tz_alert_form_value tafv ON tac.sequence_nbr = tafv.alert_called_id
LEFT JOIN cb_data_dictionary cdd ON cdd.NAME = tafv.field_value
WHERE
tac.biz_org_code LIKE concat(#{regionCode}, '%')
AND tac.alarm_type_code = '961'
AND cdd.TYPE = 'GZYY'
AND tafv.field_code = 'error_result'
AND tafv.field_value IS NOT NULL
GROUP BY
tafv.field_value
ORDER BY
majorAlertCount ASC
LIMIT 5
</select>
<select id="queryAlertListByQueryDto" resultType="java.util.Map"> <select id="queryAlertListByQueryDto" resultType="java.util.Map">
SELECT SELECT
a.sequence_nbr AS sequenceNbr, a.sequence_nbr AS sequenceNbr,
......
...@@ -76,6 +76,17 @@ public class DPStatisticsController { ...@@ -76,6 +76,17 @@ public class DPStatisticsController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-应急-故障原因占比", notes = "大屏-应急-故障原因占比")
@PostMapping(value = "/yj/faultCauseRatio")
public ResponseModel<JSONObject> faultCauseRatio(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) throws Exception {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.faultCauseRatio(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-应急-困人救援月度情况", notes = "大屏-应急-困人救援月度情况") @ApiOperation(httpMethod = "POST", value = "大屏-应急-困人救援月度情况", notes = "大屏-应急-困人救援月度情况")
@PostMapping(value = "/yj/trappedUserCount") @PostMapping(value = "/yj/trappedUserCount")
public ResponseModel<JSONObject> trappedUserCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) throws Exception { public ResponseModel<JSONObject> trappedUserCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) throws Exception {
......
...@@ -146,6 +146,19 @@ public class DPStatisticsServiceImpl { ...@@ -146,6 +146,19 @@ public class DPStatisticsServiceImpl {
return jsonObject; return jsonObject;
} }
public JSONObject faultCauseRatio(DPFilterParamDto dpFilterParamDto) throws Exception {
String orgCode = this.getAndSetOrgCode(dpFilterParamDto);
List<Map<String, Object>> maps = alertCalledMapper.faultCauseRatio(orgCode);
List<Object> xdata = maps.stream().map(item -> item.get("errorResult")).collect(Collectors.toList());
List<Object> ydata = maps.stream().map(item -> item.get("majorAlertCount")).collect(Collectors.toList());
JSONObject jsonObject = new JSONObject();
jsonObject.put("xdata", xdata);
jsonObject.put("ydata", ydata);
return jsonObject;
}
public List<AlertPaperInfoDto> instantAlert(DPFilterParamDto dpFilterParamDto) throws Exception { public List<AlertPaperInfoDto> instantAlert(DPFilterParamDto dpFilterParamDto) throws Exception {
List<String> regionCodes = new ArrayList<>(); List<String> regionCodes = new ArrayList<>();
regionCodes.add(dpFilterParamDto.getCityCode()); regionCodes.add(dpFilterParamDto.getCityCode());
......
...@@ -334,6 +334,9 @@ public class JgMaintainNotice extends BaseEntity { ...@@ -334,6 +334,9 @@ public class JgMaintainNotice extends BaseEntity {
private String equList; private String equList;
@TableField(exist = false) @TableField(exist = false)
private String equCategoryDesc;
@TableField(exist = false)
private String supervisoryCode; private String supervisoryCode;
/** /**
* 维修类型名称 * 维修类型名称
......
...@@ -6,7 +6,6 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; ...@@ -6,7 +6,6 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date;
/** /**
* 维修告知设备关系表 * 维修告知设备关系表
...@@ -34,4 +33,29 @@ public class JgMaintainNoticeEq extends BaseEntity { ...@@ -34,4 +33,29 @@ public class JgMaintainNoticeEq extends BaseEntity {
@TableField("equ_id") @TableField("equ_id")
private String equId; private String equId;
/**
* 设备代码
*/
@TableField("equ_code")
private String equCode;
/**
* 告知书编号
*/
@TableField(value = "inform_number")
private String informNumber;
/**
* 设备类别
*/
@TableField(value = "equ_list_code")
private String equListCode;
/**
* 设备类别名称
*/
@TableField(value = "equ_category_code")
private String equCategoryCode;
} }
...@@ -133,6 +133,6 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -133,6 +133,6 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
*/ */
List<Long> countAllInFlowingForDPNoFinishedBizData(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countAllInFlowingForDPNoFinishedBizData(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Map<String, String>> getOrgCodeByCompanyCodes(@Param("regionCodes") List<Integer> regionCodes); List<Map<String, String>> getOrgCodesByCompanyCodes(@Param("regionCodes") List<Integer> regionCodes);
} }
...@@ -8,8 +8,8 @@ import java.util.Map; ...@@ -8,8 +8,8 @@ import java.util.Map;
public interface DPStatisticsMapper { public interface DPStatisticsMapper {
List<Map<String, Object>> maintenanceCountTopTen(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto); List<Map<String, Object>> maintenanceCountTopTen(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto, @Param("regionCodeList") List<Integer> regionCodeList);
List<Map<String, Object>> maintenanceCount(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto); List<Map<String, Object>> maintenanceCount(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto, @Param("regionCodeList") List<Integer> regionCodeList);
List<Map<String, Object>> installEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime); List<Map<String, Object>> installEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
......
...@@ -1036,9 +1036,8 @@ ...@@ -1036,9 +1036,8 @@
union all union all
select count(1) from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成' and date_ge(CAST(a.create_date as date),#{dto.beginDate}) and date_le(CAST(a.create_date as date),#{dto.endDate}) select count(1) from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成' and date_ge(CAST(a.create_date as date),#{dto.beginDate}) and date_le(CAST(a.create_date as date),#{dto.endDate})
</select> </select>
<select id="getOrgCodeByCompanyCodes" resultType="java.util.Map"> <select id="getOrgCodesByCompanyCodes" resultType="java.util.Map">
select P.org_code AS orgCode,R.region_name AS regionName from privilege_company P select P.org_code AS orgCode,P.company_code AS companyCode from privilege_company P
INNER JOIN systemctl_region R ON P.company_code = R.region_code
where P.company_code in where P.company_code in
<foreach collection="regionCodes" item="regionCode" separator="," open="(" close=")"> <foreach collection="regionCodes" item="regionCode" separator="," open="(" close=")">
#{regionCode} :: VARCHAR #{regionCode} :: VARCHAR
......
...@@ -6,16 +6,18 @@ ...@@ -6,16 +6,18 @@
SELECT SELECT
COUNT(1), COUNT(1),
pc.company_name AS companyName, pc.company_name AS companyName,
sr.region_name AS regionName pc.company_code AS companyCode
FROM FROM
privilege_company pc privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' ) INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN ( SELECT DISTINCT record, ME_UNIT_CREDIT_CODE FROM idx_biz_jg_maintenance_record_info ) AS jri ON jri.ME_UNIT_CREDIT_CODE = bi.use_unit_code INNER JOIN ( SELECT DISTINCT record, ME_UNIT_CREDIT_CODE FROM idx_biz_jg_maintenance_record_info ) AS jri ON jri.ME_UNIT_CREDIT_CODE = bi.use_unit_code
INNER JOIN systemctl_region sr ON pc.company_code = sr.region_code
WHERE WHERE
pc.company_code IN ( SELECT region_code :: VARCHAR FROM systemctl_region WHERE parent_region_code = #{dpFilterParamDto.cityCode} ) pc.company_code IN
<foreach collection="regionCodeList" item="item" open="(" separator="," close=")">
#{item} :: VARCHAR
</foreach>
GROUP BY GROUP BY
sr.region_code pc.company_code
ORDER BY ORDER BY
COUNT DESC COUNT DESC
LIMIT 10; LIMIT 10;
...@@ -25,16 +27,18 @@ ...@@ -25,16 +27,18 @@
SELECT SELECT
COUNT(1), COUNT(1),
pc.company_name AS companyName, pc.company_name AS companyName,
sr.region_name AS regionName pc.company_code AS companyCode
FROM FROM
privilege_company pc privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' ) INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN ( SELECT DISTINCT record, ME_UNIT_CREDIT_CODE FROM idx_biz_jg_maintenance_record_info ) AS jri ON jri.ME_UNIT_CREDIT_CODE = bi.use_unit_code INNER JOIN ( SELECT DISTINCT record, ME_UNIT_CREDIT_CODE FROM idx_biz_jg_maintenance_record_info ) AS jri ON jri.ME_UNIT_CREDIT_CODE = bi.use_unit_code
INNER JOIN systemctl_region sr ON pc.company_code = sr.region_code
WHERE WHERE
pc.company_code IN ( SELECT region_code :: VARCHAR FROM systemctl_region WHERE parent_region_code = #{dpFilterParamDto.cityCode} ) pc.company_code IN
<foreach collection="regionCodeList" item="item" open="(" separator="," close=")">
#{item} :: VARCHAR
</foreach>
GROUP BY GROUP BY
sr.region_code pc.company_code
</select> </select>
<select id="installEquCount" resultType="java.util.Map"> <select id="installEquCount" resultType="java.util.Map">
SELECT COUNT SELECT COUNT
......
...@@ -67,20 +67,9 @@ ...@@ -67,20 +67,9 @@
isn.create_user_company_name AS createUserCompanyName, isn.create_user_company_name AS createUserCompanyName,
isn.next_execute_user_ids AS nextExecuteUserIds, isn.next_execute_user_ids AS nextExecuteUserIds,
isn.transfer_to_user_ids AS transferToUserIds, isn.transfer_to_user_ids AS transferToUserIds,
isn.inform_number AS informNumber, (SELECT name from tz_equipment_category ec WHERE ec.code = isn.equ_list_code) AS equListName,
ri.EQU_CODE AS equCode, (select name from tz_equipment_category ec WHERE ec.code = isn.equ_category) AS equCategoryName
(SELECT name from tz_equipment_category ec WHERE ec.code = ri.EQU_LIST) AS equListName,
(select name from tz_equipment_category ec WHERE ec.code = ri.EQU_DEFINE) AS equDefineName,
(select name from tz_equipment_category ec WHERE ec.code = ri.EQU_CATEGORY) AS equCategoryName,
concat(ibjui."PROVINCE_NAME", '', ibjui."CITY_NAME", '', ibjui."COUNTY_NAME", '', ibjui."STREET_NAME") as fullAddress,
ibjui."ADDRESS" as detailedAddress,
ibjoi.SUPERVISORY_CODE as supervisoryCode,
ibjoi.CODE96333 as code96333
FROM tzs_jg_maintain_notice isn FROM tzs_jg_maintain_notice isn
left join tzs_jg_maintain_notice_eq isneq on isn.sequence_nbr = isneq.equip_transfer_id
LEFT JOIN idx_biz_jg_use_info ibjui on isneq.equ_id = ibjui.RECORD
LEFT JOIN idx_biz_jg_register_info ri ON isneq.equ_id = ri.record
LEFT JOIN idx_biz_jg_other_info ibjoi ON isneq.equ_id = ibjoi.RECORD
<where> <where>
isn.is_delete = 0 isn.is_delete = 0
<if test="param != null "> <if test="param != null ">
...@@ -108,37 +97,17 @@ ...@@ -108,37 +97,17 @@
<if test="param.informNumber != null and param.informNumber != ''"> <if test="param.informNumber != null and param.informNumber != ''">
AND isn.inform_number like concat('%',#{param.informNumber},'%') AND isn.inform_number like concat('%',#{param.informNumber},'%')
</if> </if>
<if test="param.supervisoryCode != null and param.supervisoryCode != ''">
AND ibjoi.supervisory_code like concat('%',#{param.supervisoryCode},'%')
</if>
<if test="param.installUnitCreditCode != null and param.installUnitCreditCode != ''"> <if test="param.installUnitCreditCode != null and param.installUnitCreditCode != ''">
AND isn.install_unit_credit_code like concat('%',#{param.installUnitCreditCode},'%') AND isn.install_unit_credit_code like concat('%',#{param.installUnitCreditCode},'%')
</if> </if>
<if test="param.code96333 != null and param.code96333 != ''">
AND ibjoi.code96333 like concat('%',#{param.code96333},'%')
</if>
<if test="param.equCode != null and param.equCode != ''">
AND ri.EQU_CODE like concat('%',#{param.equCode},'%')
</if>
<if test="param.noticeDate != null"> <if test="param.noticeDate != null">
AND isn.notice_date like concat('%',DATE_FORMAT(#{param.noticeDate},'%Y-%m-%d'),'%') AND isn.notice_date like concat('%',DATE_FORMAT(#{param.noticeDate},'%Y-%m-%d'),'%')
</if> </if>
<if test="param.equListCode != null and param.equListCode != ''"> <if test="param.equListCode != null and param.equListCode != ''">
AND ri."EQU_LIST" = #{param.equListCode} AND isn."equ_list_code" = #{param.equListCode}
</if> </if>
<if test="param.equCategory != null and param.equCategory != ''"> <if test="param.equCategory != null and param.equCategory != ''">
AND ri."equ_category" = #{param.equCategory} AND isn."equ_category" = #{param.equCategory}
</if>
<if test="param.equDefine != null and param.equDefine != ''">
AND ri."EQU_DEFINE" = #{param.equDefine}
</if>
<if test="param.fullAddress != null and param.fullAddress != ''">
AND (
ibjui."PROVINCE_NAME" LIKE CONCAT('%', #{param.fullAddress}, '%')
OR ibjui."CITY_NAME" LIKE CONCAT('%', #{param.fullAddress}, '%')
OR ibjui."COUNTY_NAME" LIKE CONCAT('%', #{param.fullAddress}, '%')
OR ibjui."STREET_NAME" LIKE CONCAT('%', #{param.fullAddress}, '%')
)
</if> </if>
</if> </if>
<if test="type != 'company'"> <if test="type != 'company'">
......
...@@ -80,7 +80,7 @@ public class JgMaintainByWorkFlowController { ...@@ -80,7 +80,7 @@ public class JgMaintainByWorkFlowController {
LinkedHashMap maintainInfo = (LinkedHashMap) model1.get(TABLE_PAGE_ID); LinkedHashMap maintainInfo = (LinkedHashMap) model1.get(TABLE_PAGE_ID);
String opinion = model.get("opinion").toString(); String opinion = model.get("opinion").toString();
JgMaintainNoticeDto jgMaintainNoticeDto = JSON.parseObject(JSON.toJSONString(maintainInfo), JgMaintainNoticeDto.class); JgMaintainNoticeDto jgMaintainNoticeDto = JSON.parseObject(JSON.toJSONString(maintainInfo), JgMaintainNoticeDto.class);
jgMaintainNoticeServiceImpl.accept(jgMaintainNoticeDto, op,opinion); jgMaintainNoticeServiceImpl.accept(jgMaintainNoticeDto, op, opinion, model1);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
} }
...@@ -269,7 +269,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -269,7 +269,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(noticeParams)); JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(noticeParams));
commonService.saveExecuteFlowData2Redis(instanceId, buildInstanceRuntimeData(jgScrapCancel)); commonService.saveExecuteFlowData2Redis(instanceId, buildInstanceRuntimeData(jgScrapCancel));
String equListName = EquipmentClassifityEnum.getNameByCode(jsonObject.get("equListCode").toString()); String equListName = EquipmentClassifityEnum.getNameByCode(jsonObject.get("equListCode").toString());
save2HisData(jsonObject, jgScrapCancel.getSequenceNbr().toString()); save2HisData(jsonObject, jgScrapCancel.getSequenceNbr().toString(),jgScrapCancel.getCancelTypeDesc());
JgScrapCancelDto dto = new JgScrapCancelDto(); JgScrapCancelDto dto = new JgScrapCancelDto();
BeanUtil.copyProperties(jgScrapCancel, dto); BeanUtil.copyProperties(jgScrapCancel, dto);
dto.setEquListName(equListName); dto.setEquListName(equListName);
...@@ -419,8 +419,8 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -419,8 +419,8 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
} }
private void save2HisData(JSONObject jsonObject, String currentDocumentId) { private void save2HisData(JSONObject jsonObject, String currentDocumentId,String cancelTypeDesc) {
commonService.saveOrUpdateHistory("", jsonObject, null, currentDocumentId); commonService.saveOrUpdateHistory(cancelTypeDesc, jsonObject, null, currentDocumentId);
} }
private void createTaskModel(JgScrapCancel scrapCancel, String taskName, String submitType, String nextUserIds) { private void createTaskModel(JgScrapCancel scrapCancel, String taskName, String submitType, String nextUserIds) {
......
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