Commit 86eee001 authored by chenzhao's avatar chenzhao

修改bug

parent b09a9b91
......@@ -271,7 +271,8 @@
SELECT
b.company_id companyId,
b.company_name companyName,
COUNT( c.resources_num ) carNum
COUNT( c.resources_num ) carNum,
car_user userNum
FROM
jc_power_transfer a
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
......
......@@ -1432,12 +1432,14 @@ public class CommandController extends BaseController {
String buildIdName = "";
Long zdid = null;
String zdname = "";
String bizOrgCode = "";
OrgusrDataxDto orgusrDataxDto = new OrgusrDataxDto();
if (AlertCalled.getUnitInvolved() != null && !"".equals(AlertCalled.getUnitInvolved())) {
List<OrgUsrzhDto> orgUsrzhDto = iOrgUsrService.getOrgUsrzhDto(AlertCalled.getUnitInvolved());
if (orgUsrzhDto != null && orgUsrzhDto.size() > 0 && orgUsrzhDto.get(0) != null) {
buildId = orgUsrzhDto.get(0).getBuildId() == null ? null : Long.valueOf(orgUsrzhDto.get(0).getBuildId());
buildIdName = orgUsrzhDto.get(0).getBuildId() == null ? null : orgUsrzhDto.get(0).getBuildName();
bizOrgCode = orgUsrzhDto.get(0).getBizOrgCode() == null ? null : orgUsrzhDto.get(0).getBizOrgCode();
}
}
......@@ -1463,6 +1465,15 @@ public class CommandController extends BaseController {
}
}
}
if (AlertCalled.getAlertTypeCode().equals("235") ||AlertCalled.getAlertTypeCode().equals("242")){
List<KeySiteDto> keySiteDtos = keySiteService.queryForKeySiteList(null, null, null, null, null, bizOrgCode);
List<OrgMenuDto> result = new ArrayList<>();
keySiteDtos.stream().forEach(e->{
OrgMenuDto date = new OrgMenuDto(e.getSequenceNbr(), e.getSequenceNbr(), e.getName(), e.getName(), null);
result.add(date);
});
return ResponseHelper.buildResponse(result);
}
return ResponseHelper.buildResponse(buildId == null ? null : keySiteService.getBuildAndKeyTree(buildId));
}
......
......@@ -187,6 +187,10 @@ public class KeySiteController extends BaseController {
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
}
if(model.getFireEnduranceRateName()!=null){
model.setFireEnduranceRate(DynamicGroupCode.getEnum(model.getFireEnduranceRateName()).getCode());
}
return ResponseHelper.buildResponse(keySiteService.update(model, getUserInfo()));
}
......@@ -234,7 +238,9 @@ public class KeySiteController extends BaseController {
}
}
dto.setAttachmentsList(list);
if (dto.getFireEnduranceRateName() != null){
dto.setFireEnduranceRate(dto.getFireEnduranceRateName());
}
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("}"))));
......
package com.yeejoin.amos.boot.module.common.biz.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum DynamicGroupCode {
JCS_PERSON("机场人员", "246"),
......@@ -8,10 +13,6 @@ public enum DynamicGroupCode {
JCS_SANJ("三级", "854"),
JCS_SIJ("四级", "855");
private String name;
private String code;
......@@ -31,11 +32,6 @@ public enum DynamicGroupCode {
this.code = code;
}
DynamicGroupCode(String name, String code) {
this.name = name;
this.code = code;
}
public static DynamicGroupCode getEnum(String name) {
for (DynamicGroupCode bEnum : DynamicGroupCode.values()) {
if (bEnum.getName().equals(name)) {
......
......@@ -9,7 +9,11 @@ import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
......@@ -76,10 +80,31 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
if ("null".equals(name)) {
name = null;
}
return this.queryForList("", false, isDelete,bizCompanyId,name,bizOrgCode);
return this.queryForList("rec_date", false, isDelete,bizCompanyId,name,bizOrgCode);
}
public List<FireStationDto> queryList(Boolean isDelete, String bizOrgCode,Long bizCompanyId,String name){
LambdaQueryWrapper<FireStation> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BaseEntity::getIsDelete,isDelete);
wrapper.eq(FireStation::getBizOrgCode,bizOrgCode);
if (bizCompanyId != null){
wrapper.eq(FireStation::getBizCompanyId,bizCompanyId);
}
if (StringUtils.isNotEmpty(name)){
wrapper.like(FireStation::getName,name);
}
List<FireStation> fireStations = fireStationMapper.selectList(wrapper);
List<FireStationDto> list = new ArrayList<>();
fireStations.stream().forEach(e-> {
FireStationDto fireStationDto = new FireStationDto();
BeanUtils.copyProperties(e,fireStationDto);
list.add(fireStationDto);
});
return list;
/**
}
/**
* 删除
*/
public Boolean updateisDelete(Long sequenceNbr) {
......
......@@ -336,7 +336,10 @@ public class BuildingController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询建筑详细信息")
public Map<String, Object> getBuildDetaliByFloorId(@RequestParam String instanceId) {
return buildService.getBuildDetaliByFloorId(instanceId);
String token = getToken();
String appKey = getAppKey();
String product = getProduct();
return buildService.getBuildDetaliByFloorId(instanceId,token,appKey,product);
}
@GetMapping(value = "/getBuildingAbsolutePosition")
......
......@@ -283,7 +283,7 @@ public interface IBuilldService extends IService<Building> {
List<BuildingTreeAndEquipVO> gettreeAndEquip();
Map<String ,Object> getBuildDetaliByFloorId( String instanceId);
Map<String ,Object> getBuildDetaliByFloorId( String instanceId,String appKey, String product, String token);
/**
* 获取id与绝对位置对应的的map
......
......@@ -1145,7 +1145,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}
@Override
public Map<String, Object> getBuildDetaliByFloorId(String instanceId) {
public Map<String, Object> getBuildDetaliByFloorId(String instanceId,String appKey, String product, String token) {
List<DictionarieValueModel> build_type = Systemctl.dictionarieClient.dictValues(buildType).getResult();
Map<String, String> buildType = build_type.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
......@@ -1167,7 +1167,11 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
String userId = String.valueOf(map.get("dutyUser"));
String dutyUser = "";
if (userId != null && !"".equals(userId)) {
dutyUser = remoteSecurityService.getUserById(userId).getRealName();
ResponseModel<JSONObject> obj = jcsFeign.getUnitById(appKey,product,token,userId);
JSONObject result = obj.getResult();
if (result.containsKey("bizOrgName")) {
dutyUser = result.get("bizOrgName").toString();
}
}
Map<String, Object> res = new LinkedHashMap<>();
......
......@@ -335,7 +335,8 @@ public class ExcelServiceImpl {
nameString =par.containsKey("name")?par.get("name").toString():null;
bizCompanyId =par.containsKey("bizCompanyId")?Long.parseLong(par.get("bizCompanyId").toString()):null;
}
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false, bizCompanyId,nameString,par.containsKey("bizOrgCode")?par.get("bizOrgCode").toString():null);
List<FireStationDto> fireStationDtoList = fireStationService.queryList(false, par.containsKey("bizOrgCode")?par.get("bizOrgCode").toString():null,bizCompanyId,nameString);
// List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false, bizCompanyId,nameString,par.containsKey("bizOrgCode")?par.get("bizOrgCode").toString():null);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireStationDtoList,
FireStationDto.class, null, false);
break;
......
......@@ -588,22 +588,50 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
});
transferDetail.deleteCharAt(transferDetail.length() - 1);
if (transferDetail.toString().contains("、")) {
String transfer = null;
String taskStatus = null;
String[] split = transferDetail.toString().split("、");
if (split.length > 1) {
transfer = split[0];
taskStatus = split[1];
if (transferDetail.toString().contains(";")) {
String[] split = transferDetail.toString().split(";");
List<String> list = Arrays.asList(split);
list.forEach(e -> {
if (e.contains("、")) {
String transfer = null;
String taskStatus = null;
String[] split2 = e.split("、");
if (split2.length > 1) {
transfer = split2[0];
taskStatus = split2[1];
}
String transferDetails = templateContent.replace("departmentName-type-resourcesNum", transfer)
.replace("rescueGrid", rescueGrid == null ? "" : rescueGrid).replace("taskStatus",
taskStatus != null ? FireCarStatusEnum.getEnum(taskStatus).getName() : null);
transferContent.add(transferDetails);
} else {
String transferDetails = templateContent
.replace("departmentName-type-resourcesNum", e)
.replace("rescueGrid", rescueGrid == null ? "" : rescueGrid).replace("任务状态:taskStatus", "");
transferContent.add(transferDetails);
}
});
}else {
if (transferDetail.toString().contains("、")) {
String transfer = null;
String taskStatus = null;
String[] split2 = transferDetail.toString().split("、");
if (split2.length > 1) {
transfer = split2[0];
taskStatus = split2[1];
}
String transferDetails = templateContent.replace("departmentName-type-resourcesNum", transfer)
.replace("rescueGrid", rescueGrid == null ? "" : rescueGrid).replace("taskStatus",
taskStatus != null ? FireCarStatusEnum.getEnum(taskStatus).getName() : null);
transferContent.add(transferDetails);
} else {
String transferDetails = templateContent
.replace("departmentName-type-resourcesNum", transferDetail.toString())
.replace("rescueGrid", rescueGrid == null ? "" : rescueGrid).replace("任务状态:taskStatus", "");
transferContent.add(transferDetails);
}
}
String transferDetails = templateContent.replace("departmentName-type-resourcesNum", transfer)
.replace("rescueGrid", rescueGrid == null ? "" : rescueGrid).replace("taskStatus",
taskStatus != null ? FireCarStatusEnum.getEnum(taskStatus).getName() : null);
transferContent.add(transferDetails);
} else {
String transferDetails = templateContent
.replace("departmentName-type-resourcesNum", transferDetail.toString())
.replace("rescueGrid", rescueGrid == null ? "" : rescueGrid).replace("任务状态:taskStatus", "");
transferContent.add(transferDetails);
}
});
transferInfo.put("transferContent", transferContent);
......
......@@ -668,26 +668,47 @@
a.*
FROM
(
<if test="par.buildingId!=null and par.buildingId!=''">
SELECT
v.id AS id,
v.code AS code,
v.url AS url,
v.token AS token,
v.name AS name,
v.address,
v.longitude,
'' as distance,
v.latitude
FROM wl_video v
JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE
FIND_IN_SET(#{par.buildingId}, vc.parent_source_ids)
GROUP BY id
</if>
<if test="par.equipmentSpecificId!=null and par.equipmentSpecificId!=''">
select
v.id AS id,
v.CODE AS CODE,
v.url AS url,
v.token AS token,
v.NAME AS NAME,
v.address,
v.longitude,
'' AS distance,
v.latitude
from wl_video_equipment_specific as ves
left join wl_video as v on ves.video_id = v.id
where equipment_specific_id = #{par.equipmentSpecificId}
select
v.id AS id,
v.CODE AS CODE,
v.url AS url,
v.token AS token,
v.NAME AS NAME,
v.address,
v.longitude,
'' AS distance,
v.latitude
from wl_video_equipment_specific as ves
left join wl_video as v on ves.video_id = v.id
where equipment_specific_id = #{par.equipmentSpecificId}
</if>
<if test='par.longitude!=null and par.buildingId!=null '>
UNION
</if>
<if test='par.longitude!=null and par.equipmentSpecificId !=null '>
UNION
</if>
<if test='par.longitude!=null and par.latitude!=null '>
SELECT
(SELECT
wle.id ,
wle.`code` ,
wle.url,
......@@ -700,24 +721,24 @@
FROM wl_video wle
where wle.longitude is not null and wle.latitude is not null
<if test='par.longitude!=null and par.latitude!=null'>
and Round(st_distance(point(wle.longitude,wle.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
and Round(st_distance(point(wle.longitude,wle.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
&lt;= #{par.distance}
</if>
<if test='par.type!=null and par.type!="" '>
AND wle.type = #{type}
wle.type = #{type}
</if>
<if test='par.remark!=null and par.remark!="" '>
AND wle.remake like concat ('%',#{par.remake},'%')
wle.remake like concat ('%',#{par.remake},'%')
</if>
<if test='par.code!=null and par.code!="" '>
AND wle.code like concat ('%',#{par.code},'%')
</if>
wle.code like concat ('%',#{par.code},'%')
</if>)
</if>
<if test="par.longitudeTwo != null and par.longitude != null">
UNION
</if>
<if test='par.longitudeTwo !=null and par.latitudeTwo !=null '>
SELECT
(SELECT
wle.id,
wle.`code`,
wle.url,
......@@ -729,15 +750,14 @@
st_distance (
point ( wle.longitude, wle.latitude ),
point (#{par.longitudeTwo},#{par.latitudeTwo} ) ) * 111195, 1 ) AS distance,
wle.latitude
FROM
wl_video wle
WHERE
wle.longitude IS NOT NULL
AND wle.latitude IS NOT NULL
<if test='par.longitudeTwo!=null and par.latitude!=null'>
AND Round(st_distance(point(wle.longitude,wle.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<if test='par.longitudeTwo!=null and par.latitude!=null '>
AND Round(st_distance(point(wle.longitude,wle.latitude),point(#{par.longitudeTwo},#{par.latitudeTwo} ))*111195,1)
&lt;= #{par.distance}
</if>
<if test='par.type!=null and par.type!="" '>
......@@ -748,7 +768,7 @@
</if>
<if test='par.code!=null and par.code!="" '>
AND wle.code like concat ('%',#{par.code},'%')
</if>
</if>)
</if>
union
SELECT
......@@ -767,7 +787,7 @@
WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids)
GROUP BY id
) AS a group by a.id ) b
) AS a GROUP BY a.id ) b
</select>
<select id="pageVideoCount" resultType="int">
......
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