Commit 86eee001 authored by chenzhao's avatar chenzhao

修改bug

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