Commit 16be5c57 authored by 麻笑宇's avatar 麻笑宇

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

parents 95295847 34a74c9d
...@@ -79,4 +79,8 @@ public interface AQZSDPStatisticsMapper { ...@@ -79,4 +79,8 @@ public interface AQZSDPStatisticsMapper {
List<CountDto> selectByOrgAndProblemTypeForCy(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<CountDto> selectByOrgAndProblemTypeForCy(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
Page<SafetyProblemTracingDto> queryForSafetyProblemTracingPage(Page<SafetyProblemTracingDto> page, SafetyProblemTracingDto problemModel); Page<SafetyProblemTracingDto> queryForSafetyProblemTracingPage(Page<SafetyProblemTracingDto> page, SafetyProblemTracingDto problemModel);
CountDto selectByOrgAndProblemTypeForWb(@Param("orgCode") String orgCode, @Param("problemTypeCode") String problemTypeCode,
@Param("dto") DPFilterParamDto dpFilterParamDto, @Param("sourceTypeCode") String sourceTypeCode, @Param("equListCode") String equListCode);
} }
...@@ -422,6 +422,33 @@ ...@@ -422,6 +422,33 @@
</where> </where>
order by spt.create_date desc order by spt.create_date desc
</select> </select>
<select id="selectByOrgAndProblemTypeForWb" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
COUNT(1) as longValue,
t.problem_type AS keyStr
FROM
(SELECT problem_type FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(problem_time as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(problem_time as date),#{dto.endDate})
</if>
<if test="null != sourceTypeCode">
AND source_type_code = #{sourceTypeCode}
</if>
<if test="null != equListCode">
AND equip_list_code = #{equListCode}
</if>
<if test="null != problemTypeCode">
AND problem_type_code = #{problemTypeCode}
</if>
GROUP BY
principal_unit_code) t
</select>
</mapper> </mapper>
...@@ -454,6 +454,9 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -454,6 +454,9 @@ public class AQZSDPStatisticsServiceImpl {
if (orgCode != null) { if (orgCode != null) {
List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.COMPANY.getCode(), null); List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.COMPANY.getCode(), null);
countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue())); countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue()));
// 企业维保合同过期单独查询(企业下有设备维保超期就算)
CountDto wbCountDto = statisticsMapper.selectByOrgAndProblemTypeForWb(orgCode, IssueTypeEnum.MAINTENANCE_OVERDUE_EQUMENT.getCode(), dpFilterParamDto, IssueMainBodyEnum.EQUIPMENT.getCode(), "3000");
dataMap.put(IssueTypeEnum.MAINTENANCE_RECORD_OVERDUE_COMPANY.getName(), wbCountDto == null ? 0 : wbCountDto.getLongValue());
} }
for (int i = 0; i < enumNameList.size(); i++) { for (int i = 0; i < enumNameList.size(); i++) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
......
...@@ -525,7 +525,7 @@ public class DPSubServiceImpl { ...@@ -525,7 +525,7 @@ public class DPSubServiceImpl {
e.printStackTrace(); e.printStackTrace();
} }
} }
String color = null; String color = "green";
if (!ValidationUtil.isEmpty(problemTime)) { if (!ValidationUtil.isEmpty(problemTime)) {
try { try {
qrcode.put("text", DateUtil.formatDate(DateUtil.smartFormat(problemTime), "yyyy-MM-dd")); qrcode.put("text", DateUtil.formatDate(DateUtil.smartFormat(problemTime), "yyyy-MM-dd"));
...@@ -539,6 +539,11 @@ public class DPSubServiceImpl { ...@@ -539,6 +539,11 @@ public class DPSubServiceImpl {
} else if ("异常".equals(problemStatus) || "未处理".equals(problemStatus)) { } else if ("异常".equals(problemStatus) || "未处理".equals(problemStatus)) {
color = "red"; color = "red";
} }
// 处理隐患和企业详情码:改为固定图片。后期待定义二维码及页面内容后再改为二维码
if (!ValidationUtil.isEmpty(qrcode.getString("picUrl"))) {
JSONObject picUrls = qrcode.getJSONObject("picUrl");
qrcode.put("url", picUrls.getString(color));
}
qrcode.put("value", !ValidationUtil.isEmpty(result.get("SUPERVISORY_CODE")) ? supervisionCodePrefix + result.get("SUPERVISORY_CODE") : result.get("USE_ORG_CODE")); qrcode.put("value", !ValidationUtil.isEmpty(result.get("SUPERVISORY_CODE")) ? supervisionCodePrefix + result.get("SUPERVISORY_CODE") : result.get("USE_ORG_CODE"));
qrcode.put("status", problemStatus); qrcode.put("status", problemStatus);
qrcode.put("color", color); qrcode.put("color", color);
......
...@@ -78,8 +78,14 @@ ...@@ -78,8 +78,14 @@
"title": "{useUnit}", "title": "{useUnit}",
"status": [], "status": [],
"qrcode": { "qrcode": {
"title": "企业二维码", "title": "",
"problem": [] "problem": [],
"picUrl": {
"red": "/upload/tzs/dpscreen/images/安全守护-红.png",
"grey": "/upload/tzs/dpscreen/images/安全守护-灰.png",
"orange": "/upload/tzs/dpscreen/images/安全守护-橙.png",
"green": "/upload/tzs/dpscreen/images/安全守护-绿.png"
}
}, },
"keyParams": [ "keyParams": [
{ "key": "unitType", "label": "单位类型" }, { "key": "unitType", "label": "单位类型" },
......
...@@ -78,8 +78,14 @@ ...@@ -78,8 +78,14 @@
"keyinfo": { "keyinfo": {
"title": "{principalUnit}", "title": "{principalUnit}",
"qrcode": { "qrcode": {
"title": "监管码", "title": "",
"problem": [] "problem": [],
"picUrl": {
"red": "/upload/tzs/dpscreen/images/安全守护-红.png",
"grey": "/upload/tzs/dpscreen/images/安全守护-灰.png",
"orange": "/upload/tzs/dpscreen/images/安全守护-橙.png",
"green": "/upload/tzs/dpscreen/images/安全守护-绿.png"
}
}, },
"keyParams": [ "keyParams": [
{ "key": "sourceType", "label": "隐患主体类型" }, { "key": "sourceType", "label": "隐患主体类型" },
......
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