Commit 16210dee authored by zhangsen's avatar zhangsen

Y J Y A BUG

parent 6d62a21a
......@@ -50,4 +50,6 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<Map<String, Object>> getStationSignInfo(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getUsrSignInfoByBizOrgCode(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getUserInfoByYJYA(String bizOrgCode);
}
......@@ -38,4 +38,6 @@ public interface IFirefightersService {
BigScreen1VO getFireForceInfoByCode(String companyCode);
String getCompanyName(String bizOrgCode);
List<Map<String, Object>> getUserInfoByYJYA(String bizOrgCode);
}
......@@ -597,4 +597,102 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
AND u.`biz_org_code` LIKE concat(#{bizOrgCode}, '%')
</if>
</select>
<select id="getUserInfoByYJYA" resultType="java.util.Map">
SELECT
'运行人员' AS departmentName,
(
SELECT
count( 1 )
FROM
(
SELECT
IFNULL( max( CASE WHEN fi.field_code = 'userId' THEN fi.field_value END ), ps.instance_id ) AS id
FROM
cb_duty_person_shift ps
LEFT JOIN cb_dynamic_form_instance fi ON fi.instance_id = ps.instance_id
WHERE
ps.duty_date = CURRENT_DATE
GROUP BY
fi.instance_id
) a
LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id
LEFT JOIN ( SELECT * FROM cb_dynamic_form_instance WHERE field_code = 'peopleType' ) cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.biz_org_code LIKE concat(#{bizOrgCode}, '%')
and cfi.field_value = 1602
AND ou.biz_org_type = 'PERSON'
AND ou.is_delete = 0
) onDuty,
(
SELECT
count( 1 )
FROM
(
SELECT
ou.*
FROM
cb_org_usr ou
LEFT JOIN ( SELECT * FROM cb_dynamic_form_instance WHERE field_code = 'peopleType' ) cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
cfi.field_value = 1602
AND ou.is_delete = 0
AND ou.biz_org_type = 'PERSON'
and ou.biz_org_code like CONCAT(#{bizOrgCode}, '%')
GROUP BY
ou.sequence_nbr
) a
) total
union all
SELECT
'驻站消防队' AS departmentName,
(
SELECT
count( 1 )
FROM
(
SELECT
IFNULL( max( CASE WHEN fi.field_code = 'userId' THEN fi.field_value END ), ps.instance_id ) AS id
FROM
cb_duty_person_shift ps
LEFT JOIN cb_dynamic_form_instance fi ON fi.instance_id = ps.instance_id
WHERE
ps.duty_date = CURRENT_DATE
GROUP BY
fi.instance_id
) a
LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id
LEFT JOIN ( SELECT * FROM cb_dynamic_form_instance WHERE field_code = 'peopleType' ) cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.biz_org_code LIKE concat(#{bizOrgCode}, '%')
and cfi.field_value = 1601
AND ou.biz_org_type = 'PERSON'
AND ou.is_delete = 0
) onDuty,
(
SELECT
count( 1 )
FROM
(
SELECT
ou.*
FROM
cb_org_usr ou
LEFT JOIN ( SELECT * FROM cb_dynamic_form_instance WHERE field_code = 'peopleType' ) cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
cfi.field_value = 1601
AND ou.is_delete = 0
AND ou.biz_org_type = 'PERSON'
and ou.biz_org_code like CONCAT(#{bizOrgCode}, '%')
GROUP BY
ou.sequence_nbr
) a
) total
</select>
</mapper>
......@@ -356,4 +356,9 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
}
}
@Override
public List<Map<String, Object>> getUserInfoByYJYA(String bizOrgCode) {
return firefightersMapper.getUserInfoByYJYA(bizOrgCode);
}
}
......@@ -800,4 +800,18 @@ public class ConfigureController extends AbstractBaseController {
page.setRecords(iFireFightingSystemService.getStockEquipStatistics(bizOrgCode));
return CommonResponseUtil.success(page);
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急预案车辆信息")
@GetMapping("/getFireCarInfoByYJYA")
public ResponseModel getFireCarInfoByYJYA() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
if (StringUtils.isEmpty(bizOrgCode)) {
return CommonResponseUtil.success(null);
}
return CommonResponseUtil.success(fireFightingSystemMapper.getFireCarInfoByYJYA(bizOrgCode));
}
}
......@@ -621,4 +621,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> getSystemCountInfo();
Map<String, Object> getSystemRunningInfoList();
List<Map<String, Object>> getFireCarInfoByYJYA(@Param("bizOrgCode") String bizOrgCode);
}
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.service.IFirefightersService;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -16,15 +24,36 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
@RestController
@Api(tags = "一张图大屏Api")
@RequestMapping(value = "/bigScreen")
public class BigScreenController {
public class BigScreenController extends BaseController {
@Autowired
private IFirefightersService iFirefightersService;
@Autowired
private RedisUtils redisUtils;
@GetMapping(value = "/getFireForceInfoByCode")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防车、消防力量信息(专职消防队、运维人员)、人员出勤", notes = "消防车、消防力量信息(专职消防队、运维人员、人员出勤)")
public ResponseModel getFireForceInfoByCode(@RequestParam(required = false, value = "companyCode") String companyCode) {
return CommonResponseUtil.success(iFirefightersService.getFireForceInfoByCode(companyCode));
}
@PersonIdentify
@GetMapping(value = "/getUserInfo")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "应急预案页面消防力量人员信息", notes = "应急预案页面消防力量人员信息")
public ResponseModel getUserInfoByYJYA() {
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String bizOrgCode = null;
if(null != reginParam) {
bizOrgCode = reginParam.getPersonIdentity().getBizOrgCode();
if (StringUtils.isEmpty(bizOrgCode)) {
return CommonResponseUtil.success(null);
}
} else {
return CommonResponseUtil.success(null);
}
return CommonResponseUtil.success(iFirefightersService.getUserInfoByYJYA(bizOrgCode));
}
}
......@@ -5267,4 +5267,24 @@
AND ( wesi.is_alarm = 1 AND wesi.`value` = 'true' OR wesi.is_alarm = 0 AND wesi.`value` = 'false' )
) onlSysNum
</select>
<select id="getFireCarInfoByYJYA" resultType="java.util.Map">
SELECT
`wc`.`id` AS `id`,
`wc`.`iot_code` AS `iot_code`,
`wc`.`name` AS `name`,
IFNULL( max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_WaterCapacity' ) THEN `wcp`.`value` END ), 0 ) AS `waterCapacity`,
IFNULL( max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_FoamCapacity' ) THEN `wcp`.`value` END ), 0 ) AS `foamCapacity`
FROM
`wl_car` `wc`
LEFT JOIN `wl_car_property` `wcp` ON `wcp`.`car_id` = `wc`.`id`
<where>
1=1
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND wc.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
</where>
GROUP BY
`wc`.`id`
</select>
</mapper>
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