Commit 047862f8 authored by chenzhao's avatar chenzhao

Merge branch 'develop_dl_plan6_temp' of…

Merge branch 'develop_dl_plan6_temp' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6_temp
parents 9294fce7 bebdeb71
......@@ -14,6 +14,7 @@ import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ResponseBody;
......@@ -32,6 +33,8 @@ public class PersonIdentifyAspect {
RedisUtils redisUtils;
@Autowired
private IOrgUsrService orgUsrService;
@Value("${logic}")
Boolean logic;
@Before(value = "@annotation(com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify) && @annotation(permission)")
public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException {
......@@ -41,12 +44,19 @@ public class PersonIdentifyAspect {
UserDto userDto = orgUsrService.getUserParentInfo(userId);
ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity();
// TODO 没有绑定机场单位的人员,则赋值不存在的bizOrgCode,规避查询出所有数据
personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getBizOrgCode()) ? "-1" : userDto.getBizOrgCode());
// personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getBizOrgCode()) ? "-1" : userDto.getBizOrgCode());
personIdentity.setCompanyId(userDto.getCompanyId());
personIdentity.setCompanyName(userDto.getCompanyName());
personIdentity.setPersonSeq(userDto.getPersonSeq());
personIdentity.setPersonName(userDto.getPersonName());
personIdentity.setIdentityType(userDto.getIdentityType());
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getCompanyBizOrgCode()) ? "-1" : userDto.getCompanyBizOrgCode());
}else{
personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getBizOrgCode()) ? "-1" : userDto.getBizOrgCode());
}
personIdentity.setCompanyBizOrgCode(userDto.getCompanyBizOrgCode());
reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
......
......@@ -157,6 +157,9 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
* @return
*/
Page<Map<String, Object>> getPersonInfoByPage(Page page, @Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> dutyCardCount();
List<Map<String, Object>> dutyCardList ();
}
......@@ -26,6 +26,14 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
//BUG 2880 by litw start 2021年9月16日
List<OrgUsr> selectAllChildrenList(@Param("map")Map<String, Object> map);
int getUserByPeopleTypeCount(@Param("map")Map<String, Object> map);
List<Map<String, Object>> getUserByPeopleType(@Param("map")Map<String, Object> map);
List<OrgUsr> selectCompanyDepartmentMsg();
List<Map<String, Object>> selectPersonAllList(Map<String, Object> map);
......@@ -144,4 +152,5 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> companyUserTreeByUserAndTypeALL(@Param("bizorgcode") String bizorgcode);
List<Map<String, Object>> getFireProtectionAndMaintenance();
}
......@@ -51,4 +51,6 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> {
Page<WaterResourceDto> pageByDefect(Page<WaterResourceDto> page, @Param("nameOrCode") String nameOrCode, @Param("bizOrgCode") String bizOrgCode, @Param("systemName") String systemName);
Map<String, Object> getWaterResourceInfoList(@Param("map") Map<String, Object> map);
Map<String, Object> getResourcesCount();
}
......@@ -34,6 +34,11 @@ public interface IDutyCommonService {
*/
IPage<Map<String, Object>> pageListDetail(int current, int size, String beginDate, String endDate, String bizOrgCode) throws ParseException;
List<Map<String, Object>> dutyCardCount()throws ParseException;
List<Map<String, Object>> dutyCardList()throws ParseException;
/**
* 值班明细
*
......@@ -47,7 +52,6 @@ public interface IDutyCommonService {
*
* @param beginDate
* @param endDate
* @param dutyType
* @return
* @throws ParseException
*/
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -376,4 +377,7 @@ public interface IOrgUsrService {
List<OrgMenuDto> companyUserTreeByUserAndTypeAll(String bizorgcode);
List<DynamicFormInstance> selectTelById(List<String> ids, String type);
List<FirefightersPost> selectPostById(List<String> ids);
}
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceZhDto;
import java.util.List;
import java.util.Map;
/**
* 接口类
......@@ -36,4 +37,5 @@ public interface IWaterResourceService {
* */
WaterResourceDto selectBySequenceNbr(Long id);
Map<String, Object> getResourcesCount();
}
......@@ -675,4 +675,132 @@ WHERE
HAVING
peopleType = 1602
</select>
<select id="dutyCardCount" resultType="java.util.Map">
SELECT
'fire' as peopleType,
count(*) as total
from
(SELECT
c.sequence_nbr as id,
c.biz_org_name as userName,
IFNULL( cf.mobile_phone, '' ) telephone,
'驻站消防员' as peopleType
FROM
cb_org_usr c
RIGHT JOIN cb_sign cs ON c.sequence_nbr = cs.USER_ID
LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id
AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr
AND cfp.is_delete = 0
WHERE
c.sequence_nbr IS NOT NULL
AND cs.sign_time LIKE concat( CURRENT_DATE ( ), '%' )
GROUP BY
cs.USER_ID
ORDER BY
cs.sign_time DESC) d
union all
SELECT
(CASE b.peopleType
WHEN 1602 THEN
'run'
ELSE
'overhaul'
END) peopleType,
count( * ) as total
FROM
(
SELECT
ou.sequence_nbr AS id,
ou.biz_org_name AS userName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'telephone' THEN field_value END ), '' ) AS telephone,
IF
(
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END ) = '',
NULL,
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END )
) AS postTypeName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'personImg' THEN field_value END ), '' ) AS personImg,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
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 cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
GROUP BY
a.id
) b WHERE b.peopleType in ('1602','1604')
GROUP BY
peopleType
</select>
<select id="dutyCardList" resultType="java.util.Map">
(SELECT
c.sequence_nbr as id,
c.biz_org_name as userName,
IFNULL( cf.mobile_phone, '' ) telephone,
'1601' as peopleType
FROM
cb_org_usr c
RIGHT JOIN cb_sign cs ON c.sequence_nbr = cs.USER_ID
LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id
AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr
AND cfp.is_delete = 0
WHERE
c.sequence_nbr IS NOT NULL
AND cs.sign_time LIKE concat( CURRENT_DATE ( ), '%' )
GROUP BY
cs.USER_ID
ORDER BY
cs.sign_time DESC)
UNION all
(SELECT
id,
userName,
telephone,
peopleType
FROM
(
SELECT
ou.sequence_nbr AS id,
ou.biz_org_name AS userName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'telephone' THEN field_value END ), '' ) AS telephone,
IF
(
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END ) = '',
NULL,
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END )
) AS postTypeName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'personImg' THEN field_value END ), '' ) AS personImg,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
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 cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
GROUP BY
a.id
) b WHERE b.peopleType in ('1602','1604'))
</select>
</mapper>
......@@ -1206,4 +1206,85 @@ LEFT JOIN (
GROUP BY biz_org_name
</select>
<select id="getUserByPeopleTypeCount" resultType="Integer">
select
count(*)
from (
SELECT
DISTINCT
u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName,
g.telephone,
g.positionType
FROM
cb_org_usr u
LEFT JOIN
( SELECT
v.`instance_id`,
max(case v.field_code when 'telephone' then IFNULL(v.field_value,'') end) telephone,
max(case v.field_code when 'positionType' then IFNULL(v.field_value_label,'') end) positionType,
max(case v.field_code when 'peopleType' then IFNULL(v.field_value,'') end) peopleType
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 246
GROUP BY
v.`instance_id`
) g
on u.sequence_nbr = g.instance_id
where
u.biz_org_type = 'person'
AND
u.is_delete = 0
and g.peopleType=1601
GROUP BY
u.sequence_nbr
order by u.rec_date desc
)a where a.sequenceNbr is not null
</select>
<select id="getUserByPeopleType" resultType="Map">
SET @rownum = #{map.pageNum};
select
@rownum := @rownum + 1 AS rownum,
a.* from (
SELECT
DISTINCT
u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName,
g.telephone,
g.positionType
FROM
cb_org_usr u
LEFT JOIN
( SELECT
v.`instance_id`,
max(case v.field_code when 'telephone' then IFNULL(v.field_value,'') end) telephone,
max(case v.field_code when 'positionType' then IFNULL(v.field_value_label,'') end) positionType,
max(case v.field_code when 'peopleType' then IFNULL(v.field_value,'') end) peopleType
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 246
GROUP BY
v.`instance_id`
) g
on u.sequence_nbr = g.instance_id
where
u.biz_org_type = 'person'
AND
u.is_delete = 0
and g.peopleType=1601
GROUP BY
u.sequence_nbr
order by u.rec_date desc
)a where a.sequenceNbr is not null
LIMIT #{map.pageNum}, #{map.pageSize}
</select>
</mapper>
......@@ -239,4 +239,49 @@
</if>
) AS fireWaterTank
</select>
<select id="getResourcesCount" resultType="java.util.Map">
SELECT
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'hydrant' ) AS hydrant,
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'pool' ) AS pool,
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'waterTank' ) AS waterTank,
(
SELECT
count( * ) AS total
FROM
(
SELECT
ou.biz_org_name,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) a
WHERE
a.peopleType = '1601'
) fire,
(
SELECT
count( * ) AS total
FROM
(
SELECT
ou.biz_org_name,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) a
WHERE
a.peopleType = '1602'
) run
</select>
</mapper>
......@@ -895,6 +895,75 @@ public class DateUtils {
return dates;
}
public static List<Map<String, String>> getWeeksMapInterval(String date){
List<Map<String, String>> dates = new ArrayList<>();
String year = date.substring(0,4);
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
Date date1 = null;
try {
date1 = dateFormat.parse(date);
} catch (ParseException e) {
System.out.println("获取当前月自然周,日期格式转换错误!11");
e.printStackTrace();
}
Calendar calendar = new GregorianCalendar();
calendar.setTime(date1);
int days = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
int count = 0;
for (int i = 1; i <= days; i++) {
DateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
Date date2 = null;
try {
date2 = dateFormat1.parse(date + "-" + i);
} catch (ParseException e) {
System.out.println("获取当前月自然周,日期格式转换错误!22");
e.printStackTrace();
}
calendar.clear();
calendar.setTime(date2);
int k = new Integer(calendar.get(Calendar.DAY_OF_WEEK));
int startDay = 0;
int endDay = 0;
// 若当天是周日
if (k == 1) {
count++;
if (i - 6 <= 1) {
startDay = 1;
} else {
startDay = i - 6;
}
endDay = i;
}
// 若是本月最好一天,且不是周日
if (k != 1 && i == days) {
count++;
startDay = i - k + 2;
endDay = i;
}
if(startDay != 0 && endDay != 0){
String s = "";
String weekStart = year + "-"+ date.substring(5) +"-" +startDay +" 00:00:00";
String weekEnd = year + "-"+ date.substring(5) +"-" +endDay +" 23:59:59";
if("12".equals(date.substring(5)) && weekOfYear(date2) == 1 ){
long week = Long.valueOf(dates.get(dates.size()-1).get("name").substring(5,7)) + 1;
s = year + "第" + week + "周" + "(" + date.substring(5) + "月" + startDay +
"日至" + date.substring(5) + "月" + endDay + "日" +")";
} else {
s = year + "第" + getWeekOfYear(date2) + "周" + "(" + date.substring(5) + "月" + startDay +
"日至" + date.substring(5) + "月" + endDay + "日" +")";
}
HashMap<String, String> map = new HashMap<>();
map.put("name",s);
map.put("weekStart",weekStart);
map.put("weekEnd",weekEnd);
dates.add(map);
}
}
return dates;
}
/**
* 获取一年的第几周
*
......@@ -908,6 +977,14 @@ public class DateUtils {
return week_of_year;
}
public static int weekOfYear(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
c.setFirstDayOfWeek(Calendar.MONDAY);
int week_of_year = c.get(Calendar.WEEK_OF_YEAR);
return week_of_year;
}
/**
* 获得本月的开始时间,即2012-01-01 00:00:00
*
......
......@@ -33,6 +33,7 @@
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId
WHERE cou.is_delete = 0
) AS
value
,
......@@ -64,7 +65,7 @@
cb_organization co
WHERE co.is_delete = 0
ORDER BY
co.sort
co.sort desc
LIMIT 4
)
</select>
......@@ -82,7 +83,7 @@
cb_organization co
LEFT JOIN cb_organization_user cou ON co.sequence_nbr = cou.emergency_team_id
where co.biz_org_code like concat(#{bizOrgCode}, '%') and cou.is_delete = 0
ORDER BY co.sort , cou.rec_date
ORDER BY co.sort desc , cou.rec_date
</select>
<select id="getOrganizationGroup" resultType="java.util.Map">
SELECT
......
......@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IFirefightersService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -24,6 +25,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -79,6 +81,29 @@ public class DutyPersonController extends BaseController {
return ResponseHelper.buildResponse(iDutyPersonService.pageListDetail(current, size, beginDate, endDate, bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/cardDetailCount")
@ApiOperation(httpMethod = "GET", value = "值班管理卡片人员统计", notes = "值班管理卡片人员统计")
public ResponseModel<Map<String, Object>> cardDetail() throws ParseException {
Map<String, Object> map = new HashMap<>();
List<Map<String, Object>> maps = iDutyPersonService.dutyCardCount();
maps.forEach(e->map.put(e.get("peopleType").toString(),e.get("total")));
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/cardList")
@ApiOperation(httpMethod = "GET", value = "值班管理卡片人员统计", notes = "值班管理卡片人员统计")
public ResponseModel<List<Map<String, Object>>> cardList() throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.dutyCardList());
}
/**
* 值班列表视图--不分页
*
......
......@@ -276,6 +276,19 @@ public class OrgPersonController extends BaseController {
return ResponseHelper.buildResponse(orgUsr);
}
//驻站消防人员
@TycloudOperation( ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getUserByPeopleType/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "消防人员列表分页查询", notes = "消防人员列表分页查询")
public ResponseModel<IPage<Map<String, Object>>> getUserByPeopleType(@RequestParam Map<String, Object> requestBody) {
Map<String, Object> map = new HashMap<>();
IPage<Map<String, Object>> mapIPage = iOrgUsrService.getUserByPeopleType(
requestBody.containsKey("pageNum") ? requestBody.get("pageNum").toString() : null ,
requestBody.containsKey("pageSize") ? requestBody.get("pageSize").toString() : null,map );
return ResponseHelper.buildResponse(mapIPage);
}
/**
......
package com.yeejoin.amos.boot.module.common.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -18,11 +19,14 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.CompanyInfo;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
......@@ -1188,4 +1192,20 @@ public class OrgUsrController extends BaseController {
List<DynamicFormInstance> menus = iOrgUsrService.selectTelById(ids, type);
return ResponseHelper.buildResponse(menus);
}
/**
* 获取人员电话
* @param
* @returnP
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/selectPostById", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id获取用户岗位", notes = "根据id获取用户岗位")
public ResponseModel<List<FirefightersPost>> selectPostById(@RequestParam List<String> ids) {
List<FirefightersPost> menus = iOrgUsrService.selectPostById(ids);
return ResponseHelper.buildResponse(menus);
}
}
\ No newline at end of file
......@@ -209,6 +209,17 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return dynamicFormInstanceMapper.getPersonInfoByPage(new Page(current, size), bizOrgCode);
}
public List<Map<String, Object>> dutyCardCount()
throws ParseException {
return dynamicFormInstanceMapper.dutyCardCount();
}
public List<Map<String, Object>> dutyCardList()
throws ParseException {
return dynamicFormInstanceMapper.dutyCardList();
}
private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException {
// 获取值班的实例id
String instanceId = m.get("instanceId").toString();
......
......@@ -3564,4 +3564,30 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return dynamicFormInstanceService.list(wrapper);
}
@Override
public List<FirefightersPost> selectPostById(List<String> ids) {
LambdaQueryWrapper<FirefightersPost> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(FirefightersPost::getOrgUsrId, ids);
return iFirefightersPostService.list(queryWrapper);
}
public IPage<Map<String, Object>> getUserByPeopleType(String pageNum, String pageSize, Map<String, Object> map) {
IPage<Map<String, Object>> pageBean = null;
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
} else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
pageBean.setTotal(orgUsrMapper.getUserByPeopleTypeCount(map));
map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize());
map.put("pageSize", pageBean.getSize());
List<Map<String, Object>> list = orgUsrMapper.getUserByPeopleType(map);
pageBean.setRecords(list);
return pageBean;
}
}
\ No newline at end of file
......@@ -319,6 +319,11 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
return waterResourceDto;
}
@Override
public Map<String, Object> getResourcesCount() {
return waterResourceMapper.getResourcesCount();
}
public List<WaterResourceTypeDto> getWaterResourceTypeList(Boolean isDelete) {
return waterResourceMapper.getWaterResourceTypeList(isDelete);
}
......@@ -555,4 +560,8 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
});
return list;
}
}
......@@ -14,6 +14,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
......@@ -38,6 +39,9 @@ public class PersonIdentifyAspect {
@Autowired
private JcsFeign jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Pointcut("execution(public * com.*.equipmanage.controller..*(..))")
public void userDate() {
......@@ -60,6 +64,11 @@ public class PersonIdentifyAspect {
// ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
String s = JSONObject.toJSONString(responseModel.getResult());
ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class);
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
}
......
......@@ -103,7 +103,10 @@ public class AnalysisReportLogController extends AbstractBaseController {
dto.setStartDate(startDate);
dto.setEndDate(endDate);
dto.setReportType(reportType);
dto.setStationCode(stationCode);
ReginParams reginParams = getSelectedOrgInfo();
dto.setStationCode(reginParams.getPersonIdentity().getCompanyBizOrgCode());
return iAnalysisReportLogService.iotReportPage(page, dto);
}
}
......@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -74,6 +75,43 @@ public class DCenterController extends AbstractBaseController {
return CommonResponseUtil.success(list);
}
@PersonIdentify
@RequestMapping(value = "/station-info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "站点信息查询", produces = "application/json;charset=UTF-8", notes = "站点信息查询")
public ResponseModel stationInfo() {
return CommonResponseUtil.success(equipmentSpecificAlarmService.stationInfo());
}
@PersonIdentify
@RequestMapping(value = "/fireAlarmLogPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防报警列表分页查询", produces = "application/json;charset=UTF-8", notes = "消防报警列表分页查询")
public ResponseModel pageQuery(@RequestParam(required = false) String code,
@RequestParam(required = false) String typeCode,
@RequestParam(required = false) String bizOrgCode,
CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
ReginParams reginParams = getSelectedOrgInfo();
List<CommonRequest> queryRequests = new ArrayList<>();
CommonRequest request7 = new CommonRequest();
request7.setName("system");
request7.setValue(StringUtil.isNotEmpty(code) ? StringUtils.trimToNull(code) : null);
queryRequests.add(request7);
CommonRequest request8 = new CommonRequest();
request8.setName("specificIndexKey");
request8.setValue(StringUtil.isNotEmpty(typeCode) ? StringUtils.trimToNull(typeCode) : null);
queryRequests.add(request8);
CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode");
request13.setValue(ObjectUtils.isEmpty(bizOrgCode) ? reginParams.getPersonIdentity().getBizOrgCode() : bizOrgCode);
queryRequests.add(request13);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
return CommonResponseUtil.success(equipmentSpecificAlarmService.dcFireAlarmLogPage(param));
}
/**
* 消防系统运行状态分页查询
* @param bizOrgCode
......
......@@ -193,6 +193,15 @@ public class FireFightingSystemController extends AbstractBaseController {
return fireFightingSystemService.getDetailByCode(systemCode);
}
//查询系统下设备状态
@RequestMapping(value = "/alarmSystem/info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("通过id查询消防系统信息")
public List<Map<String,Object>> getEquip() {
return fireFightingSystemService.getEquip();
}
/**
* 生产厂商列表(不分页)
*
......
......@@ -18,7 +18,7 @@ public interface EmergencyMapper extends BaseMapper{
* @param bizOrgCode
* @return
*/
Map<String, Object> selectEmergencyMaterials(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectEmergencyMaterials();
/**
* 应急物资详情
......@@ -61,4 +61,23 @@ public interface EmergencyMapper extends BaseMapper{
List<Map<String, Object>> getCAFSWaterTankInfo(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> selectAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes);
List<Map<String, Object>> selectAlarmAnalysisCount( @Param("startDate")String startDate, @Param("endDate")String endDate,@Param("list") List<String> codes);
Map<String, Object> getSystemAndCarCount();
List<String> selectSystemCodes(@Param("systemType") String systemType);
List<Map<String, Object>> selectFireCannonAlarmAnalysisPie(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("list") List<String> codes);
List<Map<String, Object>> waterSystemAlarmAnalysisPie(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("list") List<String> codes);
List<Map<String, Object>> waterSystemAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes);
List<Map<String, Object>> fireCannonSystemAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes);
}
......@@ -226,6 +226,8 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
, @Param("endTime") String endTime);
Page<Map<String, Object>> fireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param);
Page<Map<String, Object>> dcFireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param);
List<Map<String, Object>> alarmTrend(String bizOrgCode);
List<Map<String, Object>> stationInfo();
}
......@@ -640,4 +640,14 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> getStationStatusStatistics();
List<Map<String, Object>> selectAllPressurePumpInfo(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> selectAllDays();
List<Map<String, Object>> getEquip();
List<Map<String, Object>> selectPressureDetails(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectEquipmentSpecificById(@Param("id") String id);
}
......@@ -22,7 +22,7 @@ public interface IEmergencyService {
*/
List<Map<String, Object>> getCAFSWaterTankInfo(String bizOrgCode);
Map<String, Object> emergencyMaterials(String bizOrgCode);
Map<String, Object> emergencyMaterials();
Page<Map<String, Object>> emergencyMaterialsDetails(Page<Map<String, Object>> page, String bizOrgCode);
......@@ -33,4 +33,20 @@ public interface IEmergencyService {
Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode, String code);
Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode);
List<Map<String, Object>> selectAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType);
List<Map<String, Object>> selectAlarmAnalysisCount(String systemType, String startDate, String endDate);
Map<String, Object> systemAndCar();
List<Map<String, Object>> selectFireCannonAlarmAnalysisPie(String startDate, String endDate, String systemType);
List<Map<String, Object>> waterSystemAlarmAnalysisPie(String startDate, String endDate, String systemType);
List<Map<String, Object>> waterSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType);
List<Map<String, Object>> fireCannonSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType);
}
......@@ -97,6 +97,9 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
Page<Map<String, Object>> fireAlarmLogPage(CommonPageInfoParam param);
Page<Map<String, Object>> dcFireAlarmLogPage(CommonPageInfoParam param);
List<Map<String, Object>> stationInfo();
List<Map<String, Object>> alarmTrend(String bizOrgCode);
List<Map<String, Object>> allList(CommonPageInfoParam param);
......
......@@ -171,6 +171,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
*/
FireFightingSystemEntity getDetailByCode(String systemCode);
List<Map<String,Object>> getEquip();
/**
* 集成页面系统数据
*
......
package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.mapper.EmergencyMapper;
import com.yeejoin.equipmanage.service.IEmergencyService;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import static com.yeejoin.equipmanage.common.utils.DateUtils.getFirstDayOfMonth;
/**
*
* 四横八纵应急模块接口服务类
......@@ -59,8 +66,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
}
@Override
public Map<String, Object> emergencyMaterials(String bizOrgCode) {
return emergencyMapper.selectEmergencyMaterials(bizOrgCode);
public Map<String, Object> emergencyMaterials() {
return emergencyMapper.selectEmergencyMaterials();
}
@Override
......@@ -87,4 +94,68 @@ public class EmergencyServiceImpl implements IEmergencyService {
public Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectPressureFlow(page, bizOrgCode);
}
@Override
public List<Map<String, Object>> selectAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.selectAlarmAnalysis(startDate, endDate, dataType, date, strings);
}
return null;
}
@Override
public List<Map<String, Object>> selectAlarmAnalysisCount(String systemType, String startDate, String endDate) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.selectAlarmAnalysisCount( startDate, endDate,strings);
}
return null;
}
@Override
public Map<String, Object> systemAndCar() {
return emergencyMapper.getSystemAndCarCount();
}
@Override
public List<Map<String, Object>> selectFireCannonAlarmAnalysisPie(String startDate, String endDate, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.selectFireCannonAlarmAnalysisPie(startDate, endDate, strings);
}
return null;
}
@Override
public List<Map<String, Object>> waterSystemAlarmAnalysisPie(String startDate, String endDate, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.waterSystemAlarmAnalysisPie(startDate, endDate, strings);
}
return null;
}
@Override
public List<Map<String, Object>> waterSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.waterSystemAlarmAnalysis(startDate, endDate, dataType, date, strings);
}
return null;
}
@Override
public List<Map<String, Object>> fireCannonSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.fireCannonSystemAlarmAnalysis(startDate, endDate, dataType, date, strings);
}
return null;
}
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.vo.*;
......@@ -17,6 +18,7 @@ import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
......@@ -57,6 +59,9 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
@Autowired
private IEquipmentDetailService iEquipmentDetailService;
@Autowired
private RedisUtils redisUtils;
// 装备分类code长度
private static final int CATECODELEN = 8;
private String proviceCode = "44";
......@@ -111,10 +116,10 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
}
equipmentMapper.deleteById(equipment.getId());
});
refreshData();
} catch (Exception e) {
throw new RuntimeException("删除失败!");
}
}
@Override
......@@ -140,11 +145,23 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
log.error("新增装备定义操作中,检测到巡检服务未启动或启动出错!");
}
if (num > 0) {
refreshData();
return true;
}
return false;
}
@Async
public void refreshData() {
if (redisUtils.hasKey("equip_equipDefinitions")) {
redisUtils.del("equip_equipDefinitions");
}
QueryWrapper<Equipment> equipmentQueryWrapper = new QueryWrapper<>();
equipmentQueryWrapper.isNotNull("id");
List<Equipment> equipments = equipmentMapper.selectList(equipmentQueryWrapper);
redisUtils.set("equip_equipDefinitions", JSONObject.toJSONString(equipments));
}
// public void saveEquipmentQRCodes(Equipment equipment) {
// try {
// EquipmentdefQrcode code = EquipmentdefQrcode.getBuilder().withEquipmentId(() -> equipment.getId()).build();
......@@ -233,6 +250,7 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
log.error("编辑装备定义操作中,检测到巡检服务未启动或启动出错!");
}
if (savedEquipment > 0) {
refreshData();
return true;
}
return false;
......
......@@ -109,10 +109,20 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
if (0 == list.size()) {
throw new RuntimeException("导出数据列表无数据!");
}
if(alarmType.equals("FIREALARM")){
ExcelUtil.createTemplate(response, "设备火灾报警信息", "设备火灾报警信息", equipmentDownloads, EquipmentAlarmDownloadVO.class, null, false);
}else if(alarmType.equals("BREAKDOWN")){
ExcelUtil.createTemplate(response, "设备故障告警信息", "设备故障告警信息", equipmentDownloads, EquipmentAlarmDownloadVO.class, null, false);
}else{
ExcelUtil.createTemplate(response, "设备告警信息", "设备告警信息", equipmentDownloads, EquipmentAlarmDownloadVO.class, null, false);
}
}
public List<EquipmentAlarmDownloadVO> handleExportData(List<Long> ids, List<HashMap<String, Object>> list) {
List<EquipmentAlarmDownloadVO> equipmentDownloads = new ArrayList<>();
if (!ObjectUtils.isEmpty(ids) && 0 < ids.size()) {
......@@ -798,9 +808,19 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
}
@Override
public Page<Map<String, Object>> dcFireAlarmLogPage(CommonPageInfoParam param) {
Page result = new Page<>(param.getPageNumber(), param.getPageSize());
return this.baseMapper.dcFireAlarmLogPage(result, param);
}
@Override
public List<Map<String, Object>> alarmTrend(String bizOrgCode) {
return this.baseMapper.alarmTrend(bizOrgCode);
}
@Override
public List<Map<String, Object>> stationInfo() {
return this.baseMapper.stationInfo();
}
@Override
public List<Map<String, Object>> allList(CommonPageInfoParam param) {
......
......@@ -36,8 +36,9 @@ import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*;
import org.apache.commons.beanutils.BeanUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
......@@ -52,7 +53,6 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
......@@ -64,8 +64,8 @@ import java.net.SocketException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
import static java.lang.String.valueOf;
import org.apache.commons.io.IOUtils;
@Slf4j
@Service
......@@ -981,6 +981,27 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
@Override
public List<Map<String, Object>> getEquip() {
List<Map<String, Object>> list = fireFightingSystemMapper.getEquip();
List<Map<String, Object>> resList = new ArrayList<>();
int i = 1;
if (0 < list.size()) {
for (Map<String, Object> m : list) {
Map<String, Object> map = new HashMap<>();
map.put("key", i);
map.put("name", m.get("equipmentName"));
map.put("equipmentCode", m.get("equipmentCode"));
map.put("code", m.get("code"));
map.put("value", m.get("flag"));
map.put("unit", "");
resList.add(map);
i++;
}
}
return resList;
}
@Override
public List<AlarmDataVO> getSystemById(Long id) {
return this.baseMapper.getSystemById(id);
}
......
......@@ -192,6 +192,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${state.code:code}")
private String stationCode;
@Value("${system.type}")
private String system;
@Value("${state.name:name}")
private String stationName;
......@@ -485,6 +488,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 直流中心消息推送刷新
publishDataToDCCenterPage(equipmentSpecificIndexList);
if("zd".equals(system)){
System.out.println("站端系统----------------");
// 向预控系统发送消息
sendEquipSpecIndexToAutosysTopic(equipmentSpecificIndexList);
......@@ -507,9 +512,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 向其他系统推送报警
equipmentAlarmLogsToOtherSystems(alarmLogs);
// 直流中心消息推送刷新
publishDataToDCCenterPage(equipmentSpecificIndexList);
if(vo.getEcode()!=null){
String ecode= vo.getEcode();
boolean flag=false;
......@@ -549,11 +551,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
}
}
}
});
}
......
......@@ -8,6 +8,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.utils.*;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -32,21 +33,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.equipmanage.common.entity.Equipment;
import com.yeejoin.equipmanage.common.entity.EquipmentDetail;
import com.yeejoin.equipmanage.common.entity.EquipmentIndex;
import com.yeejoin.equipmanage.common.entity.EquipmentManageEntity;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.EquipmentSystemSourceStatistics;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.Journal;
import com.yeejoin.equipmanage.common.entity.ManufacturerInfo;
import com.yeejoin.equipmanage.common.entity.Stock;
import com.yeejoin.equipmanage.common.entity.StockBill;
import com.yeejoin.equipmanage.common.entity.StockBillDetail;
import com.yeejoin.equipmanage.common.entity.StockDetail;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.enums.BillContentEnum;
......@@ -507,10 +493,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
relationRedisUtil.delSysRedisKey(fireFightSysIdsBuffer.toString());
}
if (redisUtils.hasKey("equipAndCarIotCodes")) {
redisUtils.del("equipAndCarIotCodes");
}
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
// @Override
// public void afterCommit() {
......@@ -546,6 +528,10 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
redisUtils.del("equipAndCarIotCodes");
}
redisUtils.set("equipAndCarIotCodes", JSONObject.toJSONString(data));
if (redisUtils.hasKey("equip_warehouseStructures")) {
redisUtils.getAndDeletePatternKeys("equip_warehouseStructures" + "*");
}
return date;
}
......@@ -579,11 +565,22 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
TransactionStatus transactionStatus = platformTransactionManager.getTransaction(transactionDefinition);
try {
//查询装备定义信息
// equipmentQueryWrapper.lambda().eq(Equipment::getCode, equipmentDetailDownloadVOS.getCode());
// Equipment equipment = equipmentMapper.selectOne(equipmentQueryWrapper);
// 此处由于每次导入都需查装备定义导致导入缓慢,所以优化为加入缓存
Equipment equipment;
if (redisUtils.hasKey("equip_equipDefinitions")) {
List<Equipment> equipmentList = JSONObject.parseArray(redisUtils.get("equip_equipDefinitions").toString(), Equipment.class);;
equipment = equipmentList.stream().filter(x -> x.getCode().equals(equipmentDetailDownloadVOS.getCode())).collect(Collectors.toList()).get(0);
} else {
QueryWrapper<Equipment> equipmentQueryWrapper = new QueryWrapper<>();
equipmentQueryWrapper.lambda().eq(Equipment::getCode, equipmentDetailDownloadVOS.getCode());
Equipment equipment = equipmentMapper.selectOne(equipmentQueryWrapper);
equipmentQueryWrapper.isNotNull("id");
List<Equipment> equipments = equipmentMapper.selectList(equipmentQueryWrapper);
equipment = equipments.stream().filter(x -> x.getCode().equals(equipmentDetailDownloadVOS.getCode())).collect(Collectors.toList()).get(0);
redisUtils.set("equip_equipDefinitions", JSONObject.toJSONString(equipments));
}
if (equipment == null) {
erryy.append(String.format("装备(器材)编码[%S]填写错误,请输入正确的装备(器材)编码!",equipmentDetailDownloadVOS.getCode()) + ",");
throw new RuntimeException(String.format("装备(器材)编码[%S]填写错误,请输入正确的装备(器材)编码!",equipmentDetailDownloadVOS.getCode()));
......@@ -604,8 +601,8 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
throw new RuntimeException(String.format("物联编码[%S]填写重复,请重新输入!",iotCode));
}
if(StringUtils.isNotEmpty(haveUsedIotPrefix) && Arrays.stream(haveUsedIotPrefix.split(",")).anyMatch(iotCode::startsWith)){
erryy.append(String.format("物联编码[%S]航班已占用,请重新输入!",iotCode)+ ",");
throw new BadRequest("物联编码航班已占用");
erryy.append(String.format("物联编码[%S]已占用,请重新输入!",iotCode)+ ",");
throw new BadRequest("物联编码已占用");
}
}
AtomicReference<String> fightSysIds = new AtomicReference<>("");
......@@ -680,7 +677,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
equipmentSpecific.setTeamId(fireTeam[1]);
}
// 导入新增所属单位
if (StringUtils.isNotBlank(equipmentDetailDownloadVOS.getCompanyName())) {
String[] company = equipmentDetailDownloadVOS.getCompanyName().split("@");
equipmentSpecific.setAgencyId(company[1]);
......@@ -700,9 +696,19 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
controllerProxy.refreshCount(equipmentSpecific.getBizOrgCode());
//位置编码不为空入库
if (equipmentDetailDownloadVOS != null && equipmentDetailDownloadVOS.getWarehouseStructCode() != null) {
QueryWrapper<WarehouseStructure> warehouseStructureQueryWrapper = new QueryWrapper<>();
warehouseStructureQueryWrapper.lambda().eq(WarehouseStructure::getCode, equipmentDetailDownloadVOS.getWarehouseStructCode());
WarehouseStructure warehouseStructure = warehouseStructureService.getOne(warehouseStructureQueryWrapper);
// QueryWrapper<WarehouseStructure> warehouseStructureQueryWrapper = new QueryWrapper<>();
// warehouseStructureQueryWrapper.lambda().eq(WarehouseStructure::getCode, equipmentDetailDownloadVOS.getWarehouseStructCode());
// WarehouseStructure warehouseStructure = warehouseStructureService.getOne(warehouseStructureQueryWrapper);
// 入库位置进行优化
WarehouseStructure warehouseStructure;
if (redisUtils.hasKey("equip_warehouseStructures")) {
List<WarehouseStructure> warehouseStructures = JSONObject.parseArray(redisUtils.get("equip_warehouseStructures").toString(), WarehouseStructure.class);
warehouseStructure = warehouseStructures.stream().filter(x -> x.getCode().equals(equipmentDetailDownloadVOS.getWarehouseStructCode())).collect(Collectors.toList()).get(0);
} else {
List<WarehouseStructure> warehouseStructures = warehouseStructureService.list();
warehouseStructure = warehouseStructures.stream().filter(x -> x.getCode().equals(equipmentDetailDownloadVOS.getWarehouseStructCode())).collect(Collectors.toList()).get(0);
redisUtils.set("equip_warehouseStructures", JSONObject.toJSONString(warehouseStructures));
}
if (warehouseStructure == null) {
erryy.append(String.format("货位编码[%S]填写错误,请输入正确的货位编码!",equipmentDetailDownloadVOS.getWarehouseStructCode())+ ",");
throw new RuntimeException(String.format("货位编码[%S]填写错误,请输入正确的货位编码!",equipmentDetailDownloadVOS.getWarehouseStructCode()));
......@@ -781,10 +787,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
}
// @Async
public void refreshCount(String bizOrgCode) {
equipmentSpecificSerivce.refreshStaData();
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
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.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -68,4 +67,18 @@ public class EquipmentController extends BaseController {
public ResponseModel getWaterResourceList(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
return ResponseHelper.buildResponse(equipmentService.getWaterResourceInfoList(bizOrgCode));
}
/**
* 获取驻站消防员和运维人员数量
* @param
* @returnP
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/resources/count", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "消防资源部分数据-四横八纵", notes = "消防资源部分数据-四横八纵")
public ResponseModel<Map<String, Object>> getResourcesCount() {
Map<String, Object> map = equipmentService.getResourcesCount();
return ResponseHelper.buildResponse(map);
}
}
......@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.MaintenanceCompanyMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -74,6 +75,7 @@ public class EquipmentServiceImpl {
List<Map<String, Object>> buildingMapList = (List<Map<String, Object>>) response.getResult();
List<MenuFrom> buildingTreeList = Lists.newArrayList();
buildingMapList.forEach(building -> {
MenuFrom menuFrom = new MenuFrom((String) building.get("id"), "全部建筑", (String) building.get("parentId"),
"0");
List<Map<String, Object>> children = (List<Map<String, Object>>) building.get("children");
......@@ -92,6 +94,10 @@ public class EquipmentServiceImpl {
(String) child.get("parentId"), "0");
if (!ValidationUtil.isEmpty(child.get("children"))) {
parseTree(menuFrom, (List<Map<String, Object>>) child.get("children"));
if(parent!=null){
parent.setIsLeaf(false);
}
} else {
parent.setIsLeaf(false);
}
......@@ -145,4 +151,8 @@ public class EquipmentServiceImpl {
public List<Map<String, Object>> getWaterResourceInfoList(String bizOrgCode){
return waterResourceServiceImpl.getWaterResourceInfoList(bizOrgCode);
}
public Map<String, Object> getResourcesCount() {
return waterResourceServiceImpl.getResourcesCount();
}
}
package com.yeejoin.amos.knowledgebase.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -80,6 +81,20 @@ public class DocLibraryResource {
return ResponseHelper.buildResponse(page);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "知识库卡片信息")
@RequestMapping(value = "/card", method = RequestMethod.GET)
public ResponseModel<Object> queryDocCard(HttpServletRequest request,
@RequestParam(value = "offset") Integer offset,
@RequestParam(value = "end") Integer end,
@RequestParam(value = "filterByCollection") String filterByCollection,
@RequestParam(value = "directoryId", required = false) Long directoryId,
@RequestParam(value = "docTitle", required = false) String docTitle,
@RequestParam(value = "createTimeLeft", required = false) String createTimeLeft,
@RequestParam(value = "createTimeRight", required = false) String createTimeRight) {
return ResponseHelper.buildResponse(docLibraryService.queryCardList());
}
/**
* 收藏文档
*
......
......@@ -29,6 +29,10 @@ public interface DocContentMapper extends BaseMapper<KnowledgeDocContent> {
List<Map<String,Object>> queryDocBaseInfoList(Map<String, Object> paramMap);
List<Map<String,Object>> queryDocCardList();
List<Map<String,Object>> queryCardCount();
int queryDocBaseInfoTotal(Map<String, Object> paramMap);
List<Long> getAllPublishedDocIds();
......
......@@ -181,6 +181,16 @@ public class DocLibraryService {
return page;
}
public Map<String,Object> queryCardList(){
List<Map<String, Object>> content = docContentService.getBaseMapper().queryDocCardList();
List<Map<String, Object>> countMap = docContentService.getBaseMapper().queryCardCount();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("content",content);
countMap.forEach(e->resultMap.put(e.get("directoryName").toString(),e.get("num")));
return resultMap;
}
private void addExtraFieldsAndFilters(Map<String, Object> paramsMap, Map<String, String[]> requestMap) {
List<KnowledgeDynamicsOptionModel> optionModels = dynamicsOptionService.queryByFunctional(RequestContext.getAppKey(), DynamicsFunctional.DOC_BASEINFO.name());
if (ValidationUtil.isEmpty(optionModels)) {
......
......@@ -9,10 +9,12 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.maintenance.business.feign.JCSFeignClient;
import com.yeejoin.amos.maintenance.exception.PermissionException;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
......@@ -36,6 +38,8 @@ public class PersonIdentifyAspect {
RedisUtils redisUtils;
@Autowired
JCSFeignClient jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Before(value = "@annotation(com.yeejoin.amos.maintenance.core.framework.PersonIdentify) && @annotation(permission)")
......@@ -49,6 +53,12 @@ public class PersonIdentifyAspect {
throw new RuntimeException(responseModel.getDevMessage());
}
ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
}
......
......@@ -1133,36 +1133,36 @@ public class PointServiceImpl implements IPointService {
Map<String, Object> resp = new HashMap<String, Object>();
Map<String, Object> point = pointMapper.getPointById(id);
if (StringUtil.isNotEmpty(point.get("depid"))) {
List<LinkedHashMap> departmentBos = remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, point.get("depid") + "");
if (departmentBos != null && departmentBos.size() > 0) {
for (int i = 0; i < departmentBos.size(); i++) {
point.put("departmentName", departmentBos.get(i).get("departmentName"));
}
}
}
// if (StringUtil.isNotEmpty(point.get("depid"))) {
// List<LinkedHashMap> departmentBos = remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, point.get("depid") + "");
// if (departmentBos != null && departmentBos.size() > 0) {
// for (int i = 0; i < departmentBos.size(); i++) {
// point.put("departmentName", departmentBos.get(i).get("departmentName"));
//
//
// }
// }
//
// }
// deptName = checkPointBo.getExecuteDeptId();
if (StringUtil.isNotEmpty(point.get("userName"))) {
List<AgencyUserModel> userModels = remoteSecurityService.listUserByUserIds(toke, product, appKey, point.get("userName") + "");
String userName = "";
if (userModels != null && userModels.size() > 0) {
for (int i = 0; i < userModels.size(); i++) {
if (i == userModels.size() - 1) {
userName = userName + userModels.get(i).getRealName();
} else {
userName = userName + userModels.get(i).getRealName() + ",";
}
}
point.put("userName", userName);
}
}
// if (StringUtil.isNotEmpty(point.get("userName"))) {
// List<AgencyUserModel> userModels = remoteSecurityService.listUserByUserIds(toke, product, appKey, point.get("userName") + "");
// String userName = "";
// if (userModels != null && userModels.size() > 0) {
// for (int i = 0; i < userModels.size(); i++) {
// if (i == userModels.size() - 1) {
// userName = userName + userModels.get(i).getRealName();
// } else {
// userName = userName + userModels.get(i).getRealName() + ",";
// }
//
// }
// point.put("userName", userName);
// }
//
//
// }
......
......@@ -15,6 +15,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
......@@ -39,6 +40,8 @@ public class PersonIdentifyAspect {
@Autowired
private JcsFeignClient jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Pointcut("execution(public * com.yeejoin.amos.*.business.controller..*(..))")
public void userDate() {
......@@ -69,6 +72,11 @@ public class PersonIdentifyAspect {
String s = JSONObject.toJSONString(responseModel.getResult());
ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class);
// ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
......
package com.yeejoin.amos.patrol.quartz;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo;
import com.yeejoin.amos.patrol.business.bo.PlanTaskSyncBo;
import com.yeejoin.amos.patrol.business.constants.XJConstant;
import com.yeejoin.amos.patrol.business.dao.mapper.CheckInputMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.MsgMapper;
......@@ -26,6 +28,7 @@ import com.yeejoin.amos.patrol.mqtt.WebMqttComponent;
import org.quartz.Job;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
......@@ -530,6 +533,11 @@ public class JobService implements IJobService {
if (PlanTaskFinishStatusEnum.NOTSTARTED.getValue() == planTask.getFinishStatus()) {
planTask.setFinishStatus(PlanTaskFinishStatusEnum.UNDERWAY.getValue());
iPlanTaskDao.save(planTask);
if (planTask != null) {
PlanTaskSyncBo planTaskSyncBo = buildPlanTaskBo(planTask);
String message = buildSyncMessage(PatrolDataSyncTopicEnum.PLAN_TASK.getTopic(), planTaskSyncBo);
webMqttComponent.publish(PatrolDataSyncTopicEnum.EQM_PATROL_CREATED.getTopic(), message);
}
}
} else if (XJConstant.STATUS_MONITOR_END.equals(jobType)) {
if (PlanTaskFinishStatusEnum.UNDERWAY.getValue() == planTask.getFinishStatus()) {
......@@ -543,6 +551,19 @@ public class JobService implements IJobService {
removeJob(jobName);
}
public PlanTaskSyncBo buildPlanTaskBo(PlanTask planTask) {
PlanTaskSyncBo taskSyncBo = new PlanTaskSyncBo();
BeanUtils.copyProperties(planTask, taskSyncBo);
return taskSyncBo;
}
public String buildSyncMessage(String topic, Object object) {
Map<String, Object> map = new HashMap<>();
map.put("topic", topic);
map.put("data", object);
return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue);
}
@Override
public void msgAddJob(Msg msg) {
addJob("msg", XJConstant.MESSAGE_PUSH, msg.getId(), msg.getFixedTime());
......
......@@ -9,17 +9,18 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.supervision.business.feign.JCSFeignClient;
import com.yeejoin.amos.supervision.exception.PermissionException;
import org.apache.commons.lang.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.ResponseBody;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.List;
import java.util.Map;
......@@ -36,6 +37,8 @@ public class PersonIdentifyAspect {
RedisUtils redisUtils;
@Autowired
JCSFeignClient jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Before(value = "@annotation(com.yeejoin.amos.supervision.core.framework.PersonIdentify) && @annotation(permission)")
public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException {
......@@ -61,6 +64,10 @@ public class PersonIdentifyAspect {
personIdentity.setCompanyId((String) other.get("sequenceNbr"));
personIdentity.setCompanyName((String) other.get("bizOrgName"));
}
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
// ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) result.get(0), ReginParams.PersonIdentity.class);
reginParam.setPersonIdentity(personIdentity);
......
......@@ -124,6 +124,9 @@ state.code=GW190301
state.name=\u9526\u5c4f\u6362\u6d41\u7ad9
#用于总部系统与站端系统逻辑区分,站端写zd总部默认为空
system.type=zd
# 是否开启遥测数据上报
is.open.telemetering=false
......
......@@ -127,3 +127,6 @@ management.endpoint.health.show-details=always
spring.security.user.name=admin
spring.security.user.password=a1234560
stationCode=LSHLZ1bZAJU645Pgl7
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
\ No newline at end of file
......@@ -1395,6 +1395,32 @@
ORDER BY
`wlesal`.`create_date` DESC
</select>
<select id="dcFireAlarmLogPage" resultType="java.util.HashMap">
SELECT
`wlesal`.equipment_specific_index_name type,
`wlesal`.equipment_specific_name alamContent,
DATE_FORMAT(`wlesal`.`create_date`,'%m-%d %H:%i:%s') createDate,
wlesal.location
FROM
`wl_equipment_specific_alarm_log` `wlesal`
LEFT JOIN `wl_equipment_specific_alarm` wesa ON wesa.id = wlesal.equipment_specific_alarm_id
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesal`.`equipment_specific_id` = `wles`.`id`
<where>
wesa.`status` = 1
<if test="param.system != null and param.system != ''">
AND find_in_set( #{param.system}, `wlesal`.`system_codes` )
</if>
<if test="param.fireEquipmentSpecificIndexKey != null and param.fireEquipmentSpecificIndexKey != ''">
AND wlesal.type = #{param.fireEquipmentSpecificIndexKey}
</if>
<if test="param.bizOrgCode != null and param.bizOrgCode != ''">
AND wlesal.biz_org_code like concat (#{param.bizOrgCode},'%')
</if>
</where>
ORDER BY
`wlesal`.`create_date` DESC
</select>
<select id="alarmTrend" resultType="java.util.Map">
SELECT
`result`.`click_date` AS `click_date`,
......@@ -1480,6 +1506,7 @@
ORDER BY
`result`.`click_date`
</select>
<select id="pressureMessage" resultType="java.util.Map">
select
(
......@@ -1517,4 +1544,32 @@
#{startTime} and #{endTime} >= update_date
) as startNum) as startNum
</select>
<select id="stationInfo" resultType="java.util.Map">
SELECT
a.`name`,
a.`code`,
CASE
WHEN a.countAlarmTotal = 0 THEN
SUM( a.NAME ) ELSE count( a.`name` )
END AS alarmEquipTotal,
IFNULL( SUM( a.countAlarmTotal ), 0 ) countAlarmTotal
FROM
(
SELECT
fs.`name`,
fs.`code`,
IFNULL( sum( wesi.`status` ), 0 ) AS countAlarmTotal
FROM
idx_biz_station_info fs
LEFT JOIN wl_equipment_specific_alarm wesi ON wesi.station_code = fs.`code`
AND wesi.`status` = 1
GROUP BY
fs.id,
wesi.equipment_specific_id
) a
GROUP BY
a.`name`
</select>
</mapper>
\ No newline at end of file
......@@ -4127,12 +4127,11 @@
LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids )
LEFT JOIN wl_equipment_specific spec on report.equipment_specific_id = spec.id
where report.system_ids is not null and report.index_true_num > 0
and( report.index_type LIKE CONCAT('%','Fault','%')
or report.index_type LIKE CONCAT('%','FireAlarm','%')
or report.index_type LIKE CONCAT('%','Shield','%')
or report.index_type LIKE CONCAT('%','Open','%')
or report.index_type LIKE CONCAT('%','OilLeak','%')
or report.index_type LIKE CONCAT('%','Alarm','%'))
<foreach collection="indicator" item="index" open="AND(" separator="or" close=")">
report.index_type like concat ('%', #{index})
</foreach>
and report.report_date BETWEEN #{startDate} and #{endDate}
and system_id = #{systemId}
and index_type = #{indexType}
......@@ -5015,6 +5014,26 @@
OR ( `is_alarm` = 0 AND `value` = 'false' ))
</select>
<select id="queryStartAndStopBySpecificId" resultType="java.util.Map">
( SELECT
i.equipment_specific_id,
DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date,
i.equipment_index_name
FROM
wl_equipment_specific_index i
WHERE
<if test="ids != null and ids.size > 0">
i.equipment_specific_id IN
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
AND
</if>
i.equipment_index_key in ('FHS_PressurePump_Start')
ORDER BY
i.update_date DESC
limit 1
) union
(
SELECT
i.equipment_specific_id,
DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date,
......@@ -5029,10 +5048,11 @@
</foreach>
AND
</if>
i.equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop')
i.equipment_index_key in ('FHS_PressurePump_Stop')
ORDER BY
i.update_date DESC
limit 2
limit 1
)
</select>
<select id="queryStateBySpecificId" resultType="java.util.Map">
SELECT
......@@ -5495,5 +5515,170 @@
GROUP BY
s.id
</select>
<select id="selectAllPressurePumpInfo" resultType="java.util.Map">
SELECT
ed.`name`,
concat_ws( '-', ws.full_name, ed.area ) area,
es.iot_code,
es.id,
IFNULL( sum( `status` ), 0 ) AS isAlarm
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = es.warehouse_structure_id
LEFT JOIN wl_equipment_specific_alarm esa ON esa.equipment_specific_id = es.id
WHERE
ed.`code` LIKE '92010800%'
AND es.iot_code IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''" >
AND es.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
es.id
</select>
<select id="selectAllDays" resultType="java.util.Map">
select temp.date from (
SELECT
date
FROM
(
SELECT
DATE_FORMAT(
DATE_SUB(
last_day(curdate()),
INTERVAL xc - 1 DAY
),
'%Y-%m-%d'
) AS date
FROM
(
SELECT
@xi :=@xi + 1 AS xc
FROM
(
SELECT
1
UNION
SELECT
2
UNION
SELECT
3
UNION
SELECT
4
UNION
SELECT
5
UNION
SELECT
6
) xc1,
(
SELECT
1
UNION
SELECT
2
UNION
SELECT
3
UNION
SELECT
4
UNION
SELECT
5
UNION
SELECT
6
) xc2,
(SELECT @xi := 0) xc0
) xcxc
) x0
WHERE
x0.date >= (
SELECT
date_add(
curdate(),
INTERVAL - DAY (curdate()) + 1 DAY
)
)
)temp
order by temp.date
</select>
<select id="getEquip" resultType="java.util.Map">
SELECT
spe.id,
det.`name` equipmentName,
spe.`code`,
det.`code` equipmentCode,
(
CASE
( SELECT count(*) FROM wl_equipment_specific_alarm wesa WHERE wesa.equipment_specific_id = spe.id AND STATUS = 1 )
WHEN 0 THEN
'正常' ELSE '异常'
END
) flag
FROM
wl_equipment_specific AS spe
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id )
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_stock_detail AS wlsd ON wlsd.equipment_detail_id = det.id
WHERE
fs.system_type_code IS NOT NULL
AND fs.system_type_code = 'fireAlarmSys'
AND wlsd.`status` = 1
GROUP BY det.`code`
</select>
<select id="selectPressureDetails" resultType="java.util.Map">
SELECT
ed.`name`,
concat_ws('-', ws.full_name, ed.area) area,
es.iot_code as iotCode,
es.id,
(
SELECT
DATE_FORMAT(wesi.update_date,'%Y-%m-%d %H:%i:%S')
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = es.id
AND wesi.equipment_index_key IN ('FHS_PressurePump_Stop')
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS stopTime,
(
SELECT
DATE_FORMAT(wesi.update_date,'%Y-%m-%d %H:%i:%S')
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = es.id
AND wesi.equipment_index_key IN ('FHS_PressurePump_Start')
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS startTime
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = es.warehouse_structure_id
LEFT JOIN wl_equipment_specific_alarm esa ON esa.equipment_specific_id = es.id
WHERE
ed.`code` LIKE '92010800%'
AND es.iot_code IS NOT NULL
AND es.biz_org_code like CONCAT(#{bizOrgCode}, '%')
GROUP BY
es.id
</select>
<select id="selectEquipmentSpecificById" resultType="java.util.Map">
select * from wl_equipment_specific where id = #{id}
</select>
</mapper>
......@@ -103,5 +103,7 @@ redis.cache.failure.time=10800
#now.gateway.address=http://172.16.10.72:10005/
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
......@@ -3518,7 +3518,7 @@
ALTER TABLE `cb_data_dictionary` add column `extend` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '扩展列';
</sql>
</changeSet>
<changeSet author="shg" id="1663051535136-1">
<changeSet author="shg" id="1663051595136-1">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="cb_org_usr_agency_user"/>
......@@ -3541,7 +3541,6 @@
PRIMARY KEY (`sequence_nbr`) USING BTREE,
UNIQUE KEY `uk_org_usr_id` (`org_usr_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='单位人员平台人员关系表';
>>>>>>> develop_dl_plan6
</sql>
</changeSet>
<changeSet author="tianyiming" id="20220923-tianyiming">
......@@ -3858,5 +3857,18 @@
</sql>
</changeSet>
<changeSet author="tym" id="202301050916">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions>
<comment>cb_data_dictionary 添加人员类型</comment>
<sql>
REPLACE INTO cb_data_dictionary (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `extend`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1604, '1604', '检修人员', 'DLRYLX', NULL, NULL, NULL, NULL, NULL, NULL, b'0', 4);
</sql>
</changeSet>
</databaseChangeLog>
......@@ -23,3 +23,5 @@ mybatis-plus.mapper-locations=classpath:mapper/*
redis.cache.failure.time=10800
management.endpoints.enabled-by-default=false
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
......@@ -76,7 +76,6 @@
)d LIMIT #{offset},#{length}
</select>
<select id="queryDocBaseInfoList" parameterType="map" resultType="map">
SELECT
SEQUENCE_NBR sequenceNbr, REC_DATE recDate, DOC_STATUS docStatus, CREATE_TIME createTime, USER_ID userId,
......@@ -253,5 +252,72 @@
<select id="getAllPublishedDocIds" resultType="long">
SELECT SEQUENCE_NBR FROM knowledge_doc_content WHERE DOC_STATUS = "PUBLISHED"
</select>
<select id="queryDocCardList" resultType="map">
SELECT
SEQUENCE_NBR sequenceNbr,
REC_DATE recDate,
DOC_STATUS docStatus,
CREATE_TIME createTime,
USER_ID userId,
AUDIT_STATUS auditStatus,
REJECTION_COMMENT rejectionComment,
AUDITOR_USER_ID auditorUserId,
ORG_CODE orgCode,
DOC_TITLE docTitle,
DIRECTORY_ID directoryId,
( SELECT kdc.CATEGORY_NAME FROM knowledge_doc_category kdc WHERE kdc.SEQUENCE_NBR = DIRECTORY_ID ) directoryName,
releaseDate,
excuteDate,
IFNULL( collectNum, 0 ) collectNum,
IFNULL( quoteNum, 0 ) quoteNum,
IFNULL( collect, "UNCOLLECT" ) collect
FROM
knowledge_doc_content doct
LEFT JOIN (
SELECT
INSTANCE_ID,
MAX( CASE FIELD_NAME WHEN 'releaseDate' THEN FIELD_VALUE ELSE NULL END ) AS releaseDate,
MAX( CASE FIELD_NAME WHEN 'excuteDate' THEN FIELD_VALUE ELSE NULL END ) AS excuteDate
FROM
knowledge_dynamics_value
GROUP BY
INSTANCE_ID
) fieldt ON doct.SEQUENCE_NBR = fieldt.INSTANCE_ID
LEFT JOIN ( SELECT ENTITY_ID, COUNT( 1 ) collectNum FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" GROUP BY ENTITY_ID ) coll ON doct.SEQUENCE_NBR = coll.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_COUNT quoteNum FROM knowledge_interaction_count WHERE OPERATE_TYPE = "PUBLISH" AND ENTITY_TYPE = "DOC" ) quot ON doct.SEQUENCE_NBR = quot.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_TYPE collect FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" AND USER_ID = 3780967 ) favor ON doct.SEQUENCE_NBR = favor.ENTITY_ID
WHERE
DOC_STATUS = 'PUBLISHED'
ORDER BY
directoryName DESC,
create_time DESC
</select>
<select id="queryCardCount" resultType="map">
SELECT
( SELECT kdc.CATEGORY_NAME FROM knowledge_doc_category kdc WHERE kdc.SEQUENCE_NBR = DIRECTORY_ID ) directoryName,
COUNT(SEQUENCE_NBR) as num
FROM
knowledge_doc_content doct
LEFT JOIN (
SELECT
INSTANCE_ID,
MAX( CASE FIELD_NAME WHEN 'releaseDate' THEN FIELD_VALUE ELSE NULL END ) AS releaseDate,
MAX( CASE FIELD_NAME WHEN 'excuteDate' THEN FIELD_VALUE ELSE NULL END ) AS excuteDate
FROM
knowledge_dynamics_value
GROUP BY
INSTANCE_ID
) fieldt ON doct.SEQUENCE_NBR = fieldt.INSTANCE_ID
LEFT JOIN ( SELECT ENTITY_ID, COUNT( 1 ) collectNum FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" GROUP BY ENTITY_ID ) coll ON doct.SEQUENCE_NBR = coll.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_COUNT quoteNum FROM knowledge_interaction_count WHERE OPERATE_TYPE = "PUBLISH" AND ENTITY_TYPE = "DOC" ) quot ON doct.SEQUENCE_NBR = quot.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_TYPE collect FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" ) favor ON doct.SEQUENCE_NBR = favor.ENTITY_ID
WHERE
DOC_STATUS = 'PUBLISHED'
GROUP BY DIRECTORY_ID
</select>
</mapper>
......@@ -65,3 +65,5 @@ Knowledgebase.fegin.name=AMOS-API-KNOWLEDGEBASE
## 消防救援保障部ID
fire-rescue=1432549862557130753
management.endpoints.enabled-by-default=false
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
......@@ -68,3 +68,6 @@ eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
management.endpoints.enabled-by-default=false
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
......@@ -83,7 +83,7 @@
<if test="pointName!=null">and b.name like concat(concat("%",#{pointName}),"%")</if>
<if test="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if>
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null and isOk!=''">and a.is_OK = #{isOK}</if>
<if test="isOK!=null and isOK!=''">and a.is_OK = #{isOK}</if>
<if test="planId!=null">and a.plan_Id = #{planId}</if>
<if test="planTaskId!=null">and a.plan_task_id = #{planTaskId}</if>
<if test="userId!=null">and find_in_set(#{userId}, a.user_id) > 0</if>
......@@ -292,7 +292,7 @@
<if test="pointName!=null">and b.name like concat(concat("%",#{pointName}),"%")</if>
<if test="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if>
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null">and a.is_OK = #{isOK}</if>
<if test="isOK!=null and isOK!=''">and a.is_OK = #{isOK}</if>
<if test="planId!=null">and a.plan_Id = #{planId}</if>
<if test="planTaskId!=null">and a.plan_task_id = #{planTaskId}</if>
<if test="userId!=null">and find_in_set(#{userId}, a.user_id) > 0</if>
......
......@@ -212,7 +212,7 @@
<!-- ,prpi.id as routePointItemId-->
FROM
p_point_classify ppc
LEFT JOIN p_point_inputitem ppi ON ppi.classify_ids = ppc.id
LEFT JOIN p_point_inputitem ppi ON ppi.classify_ids = ppc.id and ppc.point_id=ppi.point_id
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
<!-- lEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = pii.id-->
WHERE pii.is_delete = '0'
......
......@@ -335,7 +335,7 @@
'移动点'
END) fixed,
p.charge_person_name userName,
p.charge_dept_id depid,
p.biz_org_name departmentName,
IFNULL(p.risk_source_id, '') as buildingId,
p.remark,
p.offline
......
......@@ -27,3 +27,5 @@ rule.award="\u65BD\u5DE5\u5B89\u5168\u9884\u63A7/award"
#server.ssl.key-store-type=JKS
login.environment=dev
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
......@@ -74,3 +74,6 @@ eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
management.endpoints.enabled-by-default=false
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
......@@ -5,3 +5,5 @@ spring.profiles.active=dev
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.serialization.write-dates-as-timestamps=true
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
......@@ -6,3 +6,5 @@ spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.serialization.write-dates-as-timestamps=true
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
......@@ -35,3 +35,7 @@ spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
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