Commit a18b3cf1 authored by KeYong's avatar KeYong

修改bug

parent 4ffaaaa0
......@@ -95,7 +95,7 @@ public interface View3dMapper extends BaseMapper {
* @param orgCode
* @return
*/
List<HashMap<String, Object>> getStatisticsCheck(String orgCode);
HashMap<String, Object> getStatisticsCheck(@Param("orgCode") String orgCode);
/**
* 风险异常显示最新5条
......
package com.yeejoin.amos.fas.business.feign;
import com.yeejoin.amos.fas.business.jpush.PushMsgParam;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.ResponseModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
......@@ -34,7 +35,7 @@ public interface JcsFeign {
* 查询当前值班人信息列表
* @return
*/
@RequestMapping(value = "/jcs/common/duty-person/person/on_duty/list", method = RequestMethod.GET,consumes = "application/json")
@RequestMapping(value = "/jcs/common/duty-person/duty/list", method = RequestMethod.GET,consumes = "application/json")
ResponseModel dutyPersonList();
......
......@@ -423,20 +423,19 @@ public class View3dServiceImpl implements IView3dService {
@Override
public List<Map<String, Object>> getStatisticsCheck(String orgCode) {
List<HashMap<String, Object>> statisticsCheck = view3dMapper.getStatisticsCheck(orgCode);
HashMap<String, Object> statisticsCheck = view3dMapper.getStatisticsCheck(orgCode);
List<Map<String, Object>> stateList = PlanTaskDetailStatusEnum.getEnumList();
stateList.forEach(s -> {
if (statisticsCheck != null) {
Long value = 0L;
for (HashMap<String, Object> sc : statisticsCheck) {
String typeString = sc.get("type").toString();
String enumType = s.get("type").toString();
if (typeString.equals(enumType)) {
value = (Long) sc.get("value");
break;
}
if ("未开始".equals(String.valueOf(s.get("name")))) {
s.put("value", statisticsCheck.get("notStart_num"));
} else if ("合格".equals(String.valueOf(s.get("name")))) {
s.put("value", statisticsCheck.get("ok_num"));
} else if ("不合格".equals(String.valueOf(s.get("name")))) {
s.put("value", statisticsCheck.get("notOk_num"));
} else if ("漏检".equals(String.valueOf(s.get("name")))) {
s.put("value", statisticsCheck.get("miss_num"));
}
s.put("value", value);
}
});
return stateList;
......
......@@ -126,20 +126,67 @@
<select id="getStatisticsCheck" resultType="java.util.HashMap">
<![CDATA[
SELECT IFNULL(d.STATUS,'') AS type, count(1) as value
FROM p_plan_task_detail d
left JOIN p_plan_task t on t.id=d.task_no
WHERE
DATEDIFF(t.begin_time,CURRENT_DATE) <= 0 AND DATEDIFF(t.end_time,CURRENT_DATE) >= 0
AND (t.org_code like CONCAT(#{orgCode},'-%') OR t.org_code = #{orgCode})
AND d.status = 0
UNION ALL
select
is_ok as type,count(1) as value
from p_check a
where (a.org_code like CONCAT(#{orgCode},'-%') OR a.org_code = #{orgCode})
and TO_DAYS(a.check_time) = TO_DAYS(CURRENT_DATE)
GROUP BY a.is_ok
SELECT
(
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 )
FROM
`p_plan_task`
WHERE
(
`p_plan_task`.`check_date` LIKE concat( curdate(), '%' ))) AS `point_num`,(
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 )
FROM
`p_plan_task`
WHERE
((
`p_plan_task`.`finish_status` = 3
)
AND (
`p_plan_task`.`check_date` LIKE concat( curdate(), '%' )))) AS `miss_num`,(
SELECT
count( 1 ) AS `total_num`
FROM
(
SELECT
`b`.`id` AS `id`
FROM
`p_plan_task_detail` `b`
LEFT JOIN `p_plan_task` `a` ON `a`.`id` = `b`.`task_no`
LEFT JOIN `p_point` `d` ON `d`.`id` = `b`.`point_id`
LEFT JOIN p_check c ON c.plan_task_detail_id = b.id
WHERE
`b`.`is_finish` = 1 AND c.is_ok = 1 AND `a`.`check_date` = curdate()
ORDER BY
`b`.`id`
) `t` ) AS `ok_num`,(
SELECT
count( 1 ) AS `total_num`
FROM
(
SELECT
`b`.`id` AS `id`
FROM
`p_plan_task_detail` `b`
LEFT JOIN `p_plan_task` `a` ON `a`.`id` = `b`.`task_no`
LEFT JOIN `p_point` `d` ON `d`.`id` = `b`.`point_id`
LEFT JOIN p_check c ON c.plan_task_detail_id = b.id
WHERE
`b`.`is_finish` = 1 AND c.is_ok = 2 AND `a`.`check_date` = curdate()
ORDER BY
`b`.`id`
) `t` ) AS `notOk_num`,(
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 )
FROM
`p_plan_task`
WHERE
((
`p_plan_task`.`finish_status` = 0
)
AND (
`p_plan_task`.`check_date` LIKE concat( curdate(), '%' )))) AS `notStart_num`
]]>
</select>
......@@ -213,9 +260,9 @@
<select id="getEquipStatusTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT
wlesi.id,
wlesi.`value` STATUS,
wlesi.`value` `status`,
wlesi.update_date changeDate,
CONCAT(ed. NAME, ' ', wlei. NAME,IF((ISNULL(ws.full_name) AND ISNULL(sd.description)),'',CONCAT(
CONCAT(ed.NAME, ' ', wlei.NAME,IF((ISNULL(ws.full_name) AND ISNULL(sd.description)),'',CONCAT(
'【',
IFNULL(ws.full_name, ''),
' ',
......@@ -230,15 +277,10 @@
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
WHERE
wlei.type_code != 'FIREALARM'
AND (
wlesi.`value` = 'true'
OR wlesi.`value` = 'false'
)
wlei.is_alarm = false
ORDER BY
wlesi.update_date DESC
LIMIT 0,
5
LIMIT 0,5
</select>
<select id="initViewErrorNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">
......
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