Commit 8f2e260a authored by KeYong's avatar KeYong

更新

parent 249cf961
...@@ -174,9 +174,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -174,9 +174,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
CarMapper carMapper; CarMapper carMapper;
@Autowired @Autowired
IMainIotMonitorSerivce iMainIotMonitorSerivce;
@Autowired
private ISyncDataService syncDataService; private ISyncDataService syncDataService;
@Autowired @Autowired
......
...@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.patrol.business.service.intfc.IPlanTaskService; import com.yeejoin.amos.patrol.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.patrol.business.util.CommonResponse; import com.yeejoin.amos.patrol.business.util.CommonResponse;
import com.yeejoin.amos.patrol.business.util.CommonResponseUtil; import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;
import com.yeejoin.amos.patrol.business.util.StringUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -34,4 +35,11 @@ public class ControlScreenController extends AbstractBaseController { ...@@ -34,4 +35,11 @@ public class ControlScreenController extends AbstractBaseController {
} }
return CommonResponseUtil.success(iPlanTaskService.firePatrolStatics(bizOrgCode)); return CommonResponseUtil.success(iPlanTaskService.firePatrolStatics(bizOrgCode));
} }
@GetMapping("/statics")
@ApiOperation(value = "消防运维信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getStatics(@RequestParam(required = false) String companyCode) {
return CommonResponseUtil.success(iPlanTaskService.getStatics(companyCode));
}
} }
...@@ -197,6 +197,10 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -197,6 +197,10 @@ public interface PlanTaskMapper extends BaseMapper {
*/ */
List<Map<String, Object>> firePatrolStatics(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> firePatrolStatics(@Param("bizOrgCode") String bizOrgCode);
String queryByCompanyCode(@Param("companyCode") String companyCode);
List<Map<String, Object>> getStatics(@Param("bizOrgCode") String bizOrgCode);
long countData(@Param(value="param") PlanTaskPageParam param); long countData(@Param(value="param") PlanTaskPageParam param);
List<HashMap<String, Object>> planTaskPage(@Param(value="param") PlanTaskPageParam param); List<HashMap<String, Object>> planTaskPage(@Param(value="param") PlanTaskPageParam param);
......
...@@ -2028,6 +2028,15 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -2028,6 +2028,15 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
return map; return map;
} }
@Override
public List<Map<String, Object>> getStatics(String companyCode) {
String bizOrgCode = null;
if (StringUtil.isNotEmpty(companyCode)) {
bizOrgCode = planTaskMapper.queryByCompanyCode(companyCode);
}
return planTaskMapper.getStatics(bizOrgCode);
}
public static byte[] file2byte(File file) { public static byte[] file2byte(File file) {
try { try {
FileInputStream in = new FileInputStream(file); FileInputStream in = new FileInputStream(file);
......
...@@ -187,6 +187,8 @@ public interface IPlanTaskService { ...@@ -187,6 +187,8 @@ public interface IPlanTaskService {
*/ */
List<Map<String,Object>> firePatrolStatics(String bizOrgCode); List<Map<String,Object>> firePatrolStatics(String bizOrgCode);
List<Map<String,Object>> getStatics(String companyCode);
/** /**
* 计划执行查询 * 计划执行查询
*/ */
......
...@@ -1155,6 +1155,74 @@ ...@@ -1155,6 +1155,74 @@
</if> </if>
</select> </select>
<select id="getStatics" resultType="java.util.Map">
SELECT
'1' AS `key`,
ifnull( sum( `p_plan_task`.`finish_num` ), 0 ) AS `value`,
'' AS unit,
'今日累计巡查点位' AS `name`,
'xfxcjrljxcdw' AS code
FROM
`p_plan_task`
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
ifnull( sum( ppk.`point_num` ), 0 ) AS `value`,
'' AS unit,
'合格' AS `name`,
'xfxchg' AS code,
'2' AS `key`
FROM
`p_plan_task` ppk
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 1
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
'' AS `value`,
'%' AS unit,
'合格占比' AS `name`,
'xfxchgzb' AS code,
'3' AS `key`
UNION ALL
SELECT
'' AS `value`,
'' AS unit,
'不合格' AS `name`,
'xfxcbhg' AS code,
'4' AS `key`
UNION ALL
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
'' AS unit,
'今日漏查点位' AS `name`,
'currentDayMiss' AS `indexKey`,
'xfxcjrlcdw' AS code,
'5' AS `key`
FROM
`p_plan_task`
WHERE
`finish_status` = 3
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
'' AS `value`,
'' AS unit,
'漏查率' AS `name`,
'xfxclcl' AS code,
'6' AS `key`
</select>
<select id="countData" resultType="long"> <select id="countData" resultType="long">
SELECT SELECT
count(1) count(1)
...@@ -1354,4 +1422,13 @@ ...@@ -1354,4 +1422,13 @@
<select id="getCheckIdByDetailId" resultType="java.lang.String"> <select id="getCheckIdByDetailId" resultType="java.lang.String">
select id from p_check where plan_task_detail_id = #{taskDetailId} limit 1 select id from p_check where plan_task_detail_id = #{taskDetailId} limit 1
</select> </select>
<select id="queryByCompanyCode" resultType="java.lang.String">
SELECT biz_org_code
FROM cb_org_usr
WHERE is_delete = 0
<if test="companyCode != null and companyCode != ''">
AND code = #{companyCode}
</if>
</select>
</mapper> </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