Commit 8c08ee7e authored by KeYong's avatar KeYong

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

parents bed5f414 9129635c
package com.yeejoin.equipmanage.controller;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
/**
* @author litw
* @date 2024-01-05
*/
@RestController
@Api(tags = "浙江省设备平台右屏接口")
@RequestMapping(value = "/fire-buss-platform")
@Slf4j
public class FireBussForEquPlatformController {
@Autowired
IEquipmentSpecificSerivce equipmentSpecificSerivce;
@RequestMapping(value = "/patrol",method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防巡查")
public ResponseModel<List<Map<String, Object>>> getPatrolInfo(@RequestParam(required = false) String bizOrgCode){
List<Map<String, Object>> map = equipmentSpecificSerivce.getZJPatrolStatics(bizOrgCode);
return CommonResponseUtil.success(map);
}
@RequestMapping(value = "/scrap",method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防报废信息")
public ResponseModel<List<Map<String, Object>>> getScrapInfo(@RequestParam(required = false) String bizOrgCode){
List<Map<String, Object>> map = equipmentSpecificSerivce.getZJScrapStatics(bizOrgCode);
return CommonResponseUtil.success(map);
}
}
...@@ -321,4 +321,10 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -321,4 +321,10 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
void updateEquipQrCode(List<String> ids, String status); void updateEquipQrCode(List<String> ids, String status);
String selectEquipRealtimeSignal(@Param(value = "id") long id); String selectEquipRealtimeSignal(@Param(value = "id") long id);
List<Map<String, Object>> getPatrolInfo(String bizOrgCode);
List<Map<String, Object>> getZJScrapStatics(String bizOrgCode);
} }
...@@ -301,4 +301,11 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -301,4 +301,11 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
EquipmentSpecific getEquipSpecificEntityByCode(String code); EquipmentSpecific getEquipSpecificEntityByCode(String code);
void updateCarQrCode(List<Map<String, String>> carIds, String status); void updateCarQrCode(List<Map<String, String>> carIds, String status);
List<Map<String, Object>> getZJPatrolStatics(String bizOrgCode);
List<Map<String, Object>> getZJScrapStatics(String bizOrgCode);
} }
...@@ -2180,4 +2180,17 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -2180,4 +2180,17 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
public void updateCarQrCode(List<Map<String, String>> carIds, String status) { public void updateCarQrCode(List<Map<String, String>> carIds, String status) {
carService.updateCarQrCode(carIds, status); carService.updateCarQrCode(carIds, status);
} }
@Override
public List<Map<String, Object>> getZJPatrolStatics(String bizOrgCode) {
return equipmentSpecificMapper.getPatrolInfo(bizOrgCode);
}
@Override
public List<Map<String, Object>> getZJScrapStatics(String bizOrgCode) {
return equipmentSpecificMapper.getZJScrapStatics(bizOrgCode);
}
} }
...@@ -2706,5 +2706,106 @@ ...@@ -2706,5 +2706,106 @@
esi.update_date DESC esi.update_date DESC
LIMIT 1 LIMIT 1
</select> </select>
<select id="getPatrolInfo" resultType="java.util.Map">
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
'个' AS unit,
'今日应巡查' AS `name`,
'currentDayTotal' AS `indexKey`,
'xfxc' AS type,
'1' AS `key`
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( `p_plan_task`.`point_num` ), 0 ) AS `value`,
'个' AS unit,
'执行进度' AS `name`,
'zxjd' AS `indexKey`,
'xfxc' AS type,
'2' AS `key`
FROM
`p_plan_task`
WHERE
`finish_status` = 2
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
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
'个' AS unit,
'今日漏查点位' AS `name`,
'currentDayMiss' AS `indexKey`,
'xfxc' AS type,
'3' 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>
</select>
<select id="getZJScrapStatics" resultType="java.util.Map">
SELECT
'超期未维修' AS `name`,
(
SELECT
count( es.id )
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND ( (sd.`status` != 3) or (sd.`status` is null) or (sd.`status` = ''))
AND e.expiry_date IS NOT NULL
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND 0 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
) AS `value` UNION ALL
SELECT
'超期未报废' AS `name`,
(
SELECT
count( es.id )
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = ''))
AND e.expiry_date IS NOT NULL
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND 0 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
) AS `value` UNION ALL
SELECT
'近1月临期设备' AS `name`,
(
SELECT
count( es.id )
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = ''))
AND e.expiry_date IS NOT NULL
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND 30 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
) AS `value`
</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