Commit b1939033 authored by KeYong's avatar KeYong

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

parents ef7a86b5 3a2a5ba1
......@@ -7,7 +7,12 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.controller.DataDictionaryController;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.apache.velocity.runtime.directive.Break;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.DeleteMapping;
......@@ -79,6 +84,9 @@ public class KeySiteController extends BaseController {
@Value("${auth-key-key-site:key_site_info}")
private String authKey;
@Autowired
DataDictionaryServiceImpl iDataDictionaryService;
/**
* 新增重点部位
*
......@@ -105,6 +113,12 @@ public class KeySiteController extends BaseController {
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
}
if(model.getFireEnduranceRateName()!=null){
setData(model,"NHDJ");
}
if(model.getUseNature()!=null){
setData(model,"JZWSYXZ");
}
List<String> ids = new ArrayList<String>();
ids.add(model.getBuildingId().toString());
Map<String, String> map3 = keySiteService.getNodeAllParentIds(ids);
......@@ -113,6 +127,22 @@ public class KeySiteController extends BaseController {
return ResponseHelper.buildResponse(entity);
}
private void setData(KeySiteDto model,String type){
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
List<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
for (DataDictionary dataDictionary : list) {
if (type.equals("NHDJ") && dataDictionary.getName().equals(model.getFireEnduranceRateName())){
model.setFireEnduranceRate(dataDictionary.getCode());
}
if (type.equals("JZWSYXZ") && dataDictionary.getName().equals(model.getUseNatureName())){
model.setUseNature(dataDictionary.getCode());
}
break;
}
}
public static JSONObject getLongLatFromAddress(String address) {
JSONObject result = new JSONObject();
result.put(BizConstant.ADDRESS, "");
......@@ -179,6 +209,12 @@ public class KeySiteController extends BaseController {
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
}
if(model.getFireEnduranceRateName()!=null){
setData(model,"NHDJ");
}
if(model.getUseNature()!=null){
setData(model,"JZWSYXZ");
}
return ResponseHelper.buildResponse(keySiteService.update(model, getUserInfo()));
}
......@@ -226,7 +262,12 @@ public class KeySiteController extends BaseController {
}
}
dto.setAttachmentsList(list);
if (dto.getFireEnduranceRateName() != null){
dto.setFireEnduranceRate(dto.getFireEnduranceRateName());
}
if (dto.getUseNatureName() != null){
dto.setUseNature(dto.getUseNatureName());
}
if(null != dto.getLongitude() && null != dto.getLatitude()) {
dto.setAddressDesc(dto.getAddressDesc().concat("@address@").concat("{\"longitude\":").
concat(dto.getLongitude().toString().concat(",\"latitude\":").concat(dto.getLatitude().toString().concat("}"))));
......
......@@ -1127,14 +1127,19 @@ public class OrgUsrController extends BaseController {
@RequestParam("nodeKey") String nodeKey) throws Exception {
JSONObject jsonObject = workflowFeignService.candidateGroupsUser(processDefinitionKey, processDefinitionId, nodeKey);
String result = JSONObject.toJSONString(jsonObject.get("result"));
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
List<Map> objects = JSONObject.parseArray(result,Map.class);
//9891 按照测试要求转成人员管理信息且按换流站过滤
List<Map> map = new ArrayList<>();
objects.stream().forEach(e->{
OrgUsr orgUsr = orgUsrMapper.queryByUserId(Long.valueOf(e.get("userId").toString()));
if (!ObjectUtils.isEmpty(orgUsr)){
if (!ObjectUtils.isEmpty(orgUsr) && orgUsr.getBizOrgCode().startsWith(bizOrgCode)){
e.put("realName",orgUsr.getBizOrgName());
map.add(e);
}
});
return ResponseHelper.buildResponse(objects) ;
return ResponseHelper.buildResponse(map) ;
}
......
......@@ -244,13 +244,13 @@ public class EquipmentDetailController extends AbstractBaseController {
@RequestParam(required = false) Long stockDetailId) {
EquipmentDate equipmentDate = new EquipmentDate();
EquipmentSpecific equipmentSpecific = equipmentSpecificSerivce.getBaseMapper().selectOne(new QueryWrapper<EquipmentSpecific>().eq("code",code));
FireFightingSystemEntity fightingSystemEntity = new FireFightingSystemEntity();
if(!ObjectUtils.isEmpty(equipmentSpecific.getSystemId())){
FireFightingSystemEntity fightingSystemEntity = fireFightingSystemService.getOneById(Long.valueOf(equipmentSpecific.getSystemId()));
fightingSystemEntity = fireFightingSystemService.getOneById(Long.valueOf(equipmentSpecific.getSystemId()));
equipmentSpecific.setSystemId(fightingSystemEntity.getName());
} else {
equipmentSpecific.setSystemId("");
}
FireFightingSystemEntity fightingSystemEntity = fireFightingSystemService.getOneById(Long.valueOf(equipmentSpecific.getSystemId()));
equipmentSpecific.setSystemId(fightingSystemEntity.getName());
equipmentSpecific.setFullqrCode("01#" + equipmentSpecific.getQrCode());
EquipmentDetail equipmentDetail = iEquipmentDetailService.getOneById(equipmentSpecific.getEquipmentDetailId());
......
......@@ -866,8 +866,10 @@ public class FireFightingSystemController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取点位图,区域树数据", notes = "消防系统点位图使用")
@GetMapping(value = "/point/tree")
public List<PointTreeVo> getPointTree(@RequestParam(required = false) String systemId, @RequestParam(required = false) String bizOrgCode) {
return fireFightingSystemService.getPointTree(systemId, bizOrgCode);
public List<PointTreeVo> getPointTree(@RequestParam(required = false) String systemId,
@RequestParam(required = false) String bizOrgCode,
@RequestParam(required = false) String type) {
return fireFightingSystemService.getPointTree(systemId, bizOrgCode,type);
}
@RequestMapping(value = "/{systemCode}/system/detail", method = RequestMethod.GET)
......@@ -881,8 +883,8 @@ public class FireFightingSystemController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取系统分类树", notes = "获取系统分类树")
@GetMapping(value = "/systemAndEquipmentTreeByBziOrgCode")
public List<OrgMenuDto> systemAndEquipmentTreeByBziOrgCode(@RequestParam(required = false) String bizOrgCode) {
return fireFightingSystemService.systemAndEquipmentTreeByBziOrgCode(bizOrgCode);
public List<OrgMenuDto> systemAndEquipmentTreeByBziOrgCode() {
return fireFightingSystemService.systemAndEquipmentTreeByBziOrgCode();
}
/**
......
......@@ -5,6 +5,7 @@ import com.yeejoin.equipmanage.service.IStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -27,6 +28,8 @@ public class StatisticsController {
@Autowired
private IStatisticsService iStatisticsService;
@Value("${state.code:code}")
private String stationCode;
/**
* 根据基本类型统计总数(按仓库)
*
......@@ -41,6 +44,15 @@ public class StatisticsController {
return iStatisticsService.getAllCategoryBaseByWarehouseId(warehouseId);
}
@RequestMapping(value = "/getwarehouseId", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public Map<String, Object> getEquipmentStatusByWarehouseId() {
return iStatisticsService.getWarehouseId(stationCode);
}
/**
* 根据装备状态统计总数(按仓库)
*
......
......@@ -174,7 +174,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
Map<String,Double> getEquipLocationInfo(Long equipmentSpecificId);
Map<String, Object> getEquipSpeInfo(@Param("equipmentSpecificId") Long equipmentSpecificId);
Map<String, Object> getWarehouseId(@Param("code") String code);
/**
* 根据specificId删除装备相关数据
* @param specificId specificId
......
......@@ -87,7 +87,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param orgCode
* @return
*/
List<PointTreeVo> getPointTree(String systemId, String orgCode);
List<PointTreeVo> getPointTree(String systemId, String orgCode,String type);
/**
......@@ -298,7 +298,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
List<Map<String, Object>> getSystemRunningInfoList();
Page<FireFightingSystemDto> fireSysRunStatusPage(Page<Map<String, Object>> page, String bizOrgCode);
List<OrgMenuDto> systemAndEquipmentTreeByBziOrgCode(String bizOrgCode);
List<OrgMenuDto> systemAndEquipmentTreeByBziOrgCode();
Map<String, Object> getSystemDetailByCode(String systemCode);
......
......@@ -21,4 +21,6 @@ public interface IStatisticsService {
* @return List<EquipCategoryVo>
*/
List<EquipCategoryVo> equipCategoryVoList(String systemCode);
Map<String, Object> getWarehouseId(String orgcode);
}
......@@ -1877,7 +1877,11 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
EquipmentSpecificIndex equipmentSpecificIndex = collect.get(entry.getKey());
if (!ObjectUtils.isEmpty(equipmentSpecificIndex)) {
IotIndexInfoVo iotIndexInfoVo = new IotIndexInfoVo();
iotIndexInfoVo.setType(equipmentSpecificIndex.getIndexName());
iotIndexInfoVo.setType(equipmentSpecificIndex.getTypeName()!=null?equipmentSpecificIndex.getTypeName(): equipmentSpecificIndex.getIndexName());
iotIndexInfoVo.setNumber(deviceName);
if (equipmentSpecificIndex.getIsTrend() == 1) {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getIndexName() + entry.getValue() + equipmentSpecificIndex.getIndexUnitName());
......
......@@ -31,6 +31,7 @@ import com.yeejoin.equipmanage.common.utils.ChartsUtils;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.utils.WordTemplateUtils;
import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*;
......@@ -110,6 +111,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
private Resource systemCode;
@Autowired
JcsFeign jcsFeignClient;
@Autowired
private IEqDynamicFormGroupService iEqDynamicFormGroupService;
@Autowired
......@@ -401,7 +404,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
@Override
public List<PointTreeVo> getPointTree(String id, String orgCode) {
public List<PointTreeVo> getPointTree(String id, String orgCode, String type) {
// CommonResponse se = riskModelFeign.getRiskSourceList(orgCode);
// List<Map<String, Object>> list = (List<Map<String, Object>>) se.getDataList();
// List<PointTreeVo> responses = new ArrayList<>();
......@@ -416,6 +419,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// responses.add(p);
// });
// List<PointTreeVo> regionList = responses.stream().filter(r -> "TRUE".equals(r.getIsRegion())).collect(Collectors.toList());
if("dl".equals(type)){
FeignClientResult<List<OrgUsrDto>> feignClientResult = jcsFeignClient.getCompanyDeptListWithAuth(authKey, "COMPANY", "dl");
orgCode = feignClientResult.getResult().get(0).getBizOrgCode();
}
List<PointTreeVo> buildList = buildingMapper.getBuildList(orgCode, null);
return transferListToPointTree(buildList, id, null);
}
......@@ -2096,7 +2103,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
@Override
public List<OrgMenuDto> systemAndEquipmentTreeByBziOrgCode(String bizOrgCode) {
public List<OrgMenuDto> systemAndEquipmentTreeByBziOrgCode() {
FeignClientResult<List<OrgUsrDto>> feignClientResult = jcsFeignClient.getCompanyDeptListWithAuth(authKey, "COMPANY", "dl");
String bizOrgCode = feignClientResult.getResult().get(0).getBizOrgCode();
List<Map<String, Object>> list = fireFightingSystemMapper.systemAndEquipment(bizOrgCode);
return systemAndEquipmentTree(list);
}
......
......@@ -221,6 +221,12 @@ public class StatisticsServiceImpl implements IStatisticsService {
return equipmentSpecificMapper.selectEquipCategoryNumber(fightingSystemEntity.getId());
}
@Override
public Map<String, Object> getWarehouseId(String orgcode) {
Map<String, Object> map=equipmentSpecificMapper.getWarehouseId(orgcode);
return map;
}
private Double getExtinguishingCountByWarehouseId(String categoryCode, Long warehouseId) {
List<EquipmentCategory> categoryList = iEquipmentCategoryService
.list(new QueryWrapper<EquipmentCategory>().eq("code", categoryCode));
......
......@@ -113,8 +113,8 @@ public class FirefightersController extends BaseController {
@Value("${auth-key-fire-fighters:fire_fighters_info}")
private String authKey;
@Value("${system.type}")
private String type;
@Value("${logic}")
private Boolean logic;
@Autowired
IUserCarService userCarService;
......@@ -428,7 +428,7 @@ public class FirefightersController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "所有的消防人员", notes = "所有的消防人员")
public ResponseModel<Object> getAllFirefightersPerson(String jobCode)throws Exception {
String bizOrgCode = null;
if("dl".equals(type)){
if(!logic){
// 获取登陆人角色firefighters/all/fire/person
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
......
......@@ -1379,13 +1379,12 @@ public class PointServiceImpl implements IPointService {
CheckPtListPageParam param =new CheckPtListPageParam();
param.setPageNumber(commonPageable.getPageNumber());
param.setPageSize(commonPageable.getPageSize());
long total = pointMapper.getCheckPointCountNew(param);
List<CheckPtListBo> content = pointMapper.getCheckPointListNew(param);
param.setPageNumber(commonPageable.getPageNumber());
param.setPageSize(commonPageable.getPageSize());
param.setOrgCode(orgCode);
long total = pointMapper.getCheckPointCountNew(param);
List<CheckPtListBo> content = pointMapper.getCheckPointListNew(param);
Page<CheckPtListBo> result = new PageImpl<CheckPtListBo>(content, param, total);
List< HashMap<String, Object>> colModel=new ArrayList<>();
HashMap<String, Object> temph0 = new HashMap<>();
......
......@@ -115,7 +115,8 @@ equipment.pressurepump.stop=FHS_PressurePump_Stop
# 站端标识
state.code=GW190301
state.name=锦屏换流站
state.name=\u9526\u5c4f\u6362\u6d41\u7ad9
# 是否开启遥测数据上报
is.open.telemetering=false
\ No newline at end of file
......@@ -7711,24 +7711,9 @@ ORDER BY
-- 运维概览-韶山消防巡查统计
DROP VIEW IF EXISTS `v_fire_check_num_shaoshan`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_check_num_shaoshan` AS
SELECT
( SELECT ifnull( sum( `p_plan_task`.`point_num` ), 0 ) FROM `p_plan_task` WHERE `p_plan_task`.`check_date` LIKE concat( curdate(), '%' ) ) AS `point_num`,
(
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 )
FROM
`p_plan_task`
WHERE
`p_plan_task`.`finish_status` = 3
AND `p_plan_task`.`check_date` LIKE concat( curdate(), '%' )
) AS `miss_num`,
(
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 )
FROM
`p_plan_task`
WHERE
`p_plan_task`.`finish_status` = 0
AND `p_plan_task`.`check_date` LIKE concat( curdate(), '%' )
) AS `unfinish_num`;
\ No newline at end of file
CREATE
ALGORITHM=UNDEFINED
DEFINER=`root`@`%`
SQL SECURITY DEFINER
VIEW `v_fire_check_num_shaoshan` AS
select (select ifnull(sum(`p_plan_task`.`point_num`),0) from `p_plan_task` where (`p_plan_task`.`check_date` like concat(curdate(),'%'))) AS `point_num`,(select ifnull(sum(`p_plan_task`.`point_num`),0) from `p_plan_task` where ((`p_plan_task`.`finish_status` = 3) and (`p_plan_task`.`check_date` like concat(curdate(),'%')))) AS `miss_num`,(select ifnull(sum(`p_plan_task`.`point_num`),0) from `p_plan_task` where ((`p_plan_task`.`finish_status` <> 2) and (`p_plan_task`.`check_date` like concat(curdate(),'%')))) AS `unfinish_num`;
......@@ -462,4 +462,21 @@
ALTER TABLE `wl_equipment_specific_alarm_log` ADD COLUMN `station_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '换流站编码';
</sql>
</changeSet>
<changeSet author="tw" id="20221208-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="idx_biz_station_info" columnName="warehouse_id"/>
</not>
</preConditions>
<comment>新增属性字段 warehouse_id</comment>
<sql>
alter table `idx_biz_station_info` add column `warehouse_id` bigint(32) COMMENT '仓库id';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -32,14 +32,14 @@
left join wl_warehouse_structure wws on wws.id = sys.contro_box_build
LEFT JOIN wl_equipment_category wec ON wec.id = sys.system_type
where 1=1
<if test="equimentName != null and equimentName !='' and equimentCode !='null' ">
<if test="equimentName != null and equimentName !='' and equimentName !='null' ">
AND sys.NAME like CONCAT('%',#{equimentName},'%')
</if>
<if test="equimentCode != null and equimentCode !='' and equimentCode !='null' ">
AND sys.CODE like CONCAT('%',#{equimentCode},'%')
</if>
<if test="nameOrCode != null and nameOrCode != ''">
AND (sys.CODE like CONCAT('%',#{nameOrCode},'%') OR sys.NAME like CONCAT('%',#{nameOrCode},'%') OR wec.`name` like CONCAT('%',#{nameOrCode},'%') OR sys.system_type_code like CONCAT('%',#{nameOrCode},'%'))
AND (sys.CODE like CONCAT('%',#{nameOrCode},'%') or sys.NAME like CONCAT('%',#{nameOrCode},'%') OR wec.`name` like CONCAT('%',#{nameOrCode},'%'))
</if>
<if test="construction != 'all' ">
AND sys.CONSTRUCTION_UNIT = #{construction}
......@@ -62,10 +62,10 @@
from
f_fire_fighting_system
<where>
<if test="equimentName != null and equimentName !='' and equimentName != 'null' ">
<if test="equimentName != null and equimentName != '' and equimentName != 'null' ">
AND name like CONCAT('%',#{equimentName},'%')
</if>
<if test="equimentCode != null and equimentCode !='' and equimentCode !='null' ">
<if test="equimentCode != null and equimentCode != '' and equimentCode != 'null' ">
AND code like CONCAT('%',#{equimentCode},'%')
</if>
<if test="construction != 'all' ">
......
......@@ -457,7 +457,8 @@
wei.is_trend isTrend,
wesi.value_label,
wesi.equipment_index_name,
wesi.update_date AS updateDate
wesi.update_date AS updateDate,
wei.type_name AS typeName
FROM
wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
......
......@@ -1403,6 +1403,14 @@
LEFT JOIN wl_warehouse_structure ws ON sd.warehouse_structure_id = ws.id
WHERE es.id = #{equipmentSpecificId}
</select>
<select id="getWarehouseId" resultType="Map">
select warehouse_id as warehouseId from idx_biz_station_info where code = #{code}
</select>
<delete id="deleteEquipDataBySpecificId">
DELETE es, ed, esi, ves, esr, esa, esal, eard FROM
wl_equipment_specific es
......
......@@ -138,7 +138,7 @@ management.security.enabled=true
spring.security.user.name=admin
spring.security.user.password=a1234560
#?????????
system.type=dl
#system.type=dl
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为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