Commit 3f3c0547 authored by chenhao's avatar chenhao

Merge branch 'chenhao' into developer

parents df4bdd4e a0127e96
......@@ -26,6 +26,10 @@ public class FireBrigadeResourceDto extends BaseDto {
@ApiModelProperty(value = "资源图片")
private List<String> image;
/*2403 队伍未显示图片 陈召 2021-09-23*/
private String pic;
@ApiModelProperty(value = "资源类型")
private String type;
......
......@@ -33,4 +33,6 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<FirefightersTreeDto> getFirefightersJobTitleCount();
List<FirefightersExcelDto> exportToExcel(Boolean isDelete);
List<String> getFirefightersName(String contactName);
}
......@@ -36,5 +36,6 @@ public KeySiteDto getSequenceNbr(Long sequenceNbr);
public List<KeySiteDateDto> getKeySiteDate(Long id);
public List<String> getAddress(String address);
}
......@@ -82,4 +82,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
* @return
*/
List< OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId);
List<OrgUsr> amosIdExist(String amosId);
}
......@@ -5,7 +5,7 @@
<select id="listMonitorFireBrigade" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto">
SELECT ft.sequence_nbr id,
ft.NAME,
ft.img,
ft.img AS pic,
COUNT(DISTINCT ff.sequence_nbr) personCount
FROM cb_fire_team ft
LEFT JOIN cb_firefighters ff ON ff.fire_team_id = ft.sequence_nbr
......@@ -99,12 +99,12 @@
a.name ,
a.contact_user contactUser,
a.contact_phone contactPhone,
( SELECT count( 1 ) FROM cb_firefighters WHERE fire_team_id = a.sequence_nbr AND is_delete = 0 ) userNum,
( SELECT count( 1 ) FROM cb_firefighters WHERE fire_team_id = a.sequence_n br AND is_delete = 0 ) userNum,
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance
FROM cb_fire_team a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if test='par.typeCode!=null and par.typeCode!=""'>
and a.type_code in (#{par.typeCode})
and a.type_code in (116,830,114)
</if>
<if test='par.distance!=null'>
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= #{par.distance}
......
......@@ -157,4 +157,15 @@ AND fe.is_delete = 0
AND fp.is_delete = 0
</select>
<select id="getFirefightersName" resultType="string">
SELECT
a.name
FROM
cb_firefighters a
WHERE
a.is_delete =0
and
a.name like concat ('%',#{contactName},'%')
</select>
</mapper>
......@@ -121,7 +121,6 @@
where c.is_delete = FALSE;
</select>
<select id="getKeySiteDate" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto">
SELECT
c.sequence_nbr AS `key`,
......@@ -137,4 +136,12 @@
</if>
</select>
<select id="getAddress" resultType="string">
SELECT
c.address_desc
FROM cb_key_site c
where c.is_delete = FALSE
and
c.address_desc like concat ('%',#{address},'%');
</select>
</mapper>
......@@ -561,4 +561,11 @@ GROUP BY
</select>
<select id="amosIdExist" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr">
SELECT *
FROM cb_org_usr
WHERE is_delete = 0
amos_org_id = #{amosId}
</select>
</mapper>
......@@ -36,6 +36,10 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
List<AlertCalledTodyDto> getTodayAlertCalled();
List<String> getContactName(String contactName);
List<String> getAddress(String address);
List<AlertCalled> selectAllPage(Long current, Long size,
Integer alertStatus,
String alertTypeCode ,
......
......@@ -114,7 +114,7 @@
FROM
jc_alert_called a
<where>
1=1
a.is_delete = 0
<if test="alertStatus!= null ">
and alert_status = #{alertStatus}
</if>
......@@ -185,6 +185,27 @@
</select>
<select id="getContactName" resultType="string">
SELECT
a.contact_user
FROM
jc_alert_called a
WHERE
a.is_delete =0
and
a.contact_user like concat ('%',#{contactName},'%')
</select>
<select id="getAddress" resultType="string">
SELECT
a.address
FROM
jc_alert_called a
WHERE
a.is_delete =0
and
a.address like concat ('%',#{address},'%')
</select>
<!-- 未结束警情列表 -->
<select id="AlertCalledStatusPage" resultType="com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled">
......
......@@ -456,4 +456,19 @@ public class OrgUsrController extends BaseController {
}
return equipjSONObject;
}
/**
* 判断关联账户是否已关联
*
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAmosId", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "判断关联账户是否已关联", notes = "判断关联账户是否已关联")
public Object getAmosId( String amosId) {
return iOrgUsrService.amosIdExist(amosId);
}
}
\ No newline at end of file
......@@ -103,4 +103,10 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
}
public List<String> getFirefightersName(String contactName) {
return firefightersMapper.getFirefightersName(contactName);
}
}
......@@ -311,4 +311,8 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
}
public List<String> getAddress(String address){
return keySiteMapper.getAddress(address);
}
}
......@@ -62,6 +62,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Autowired
DynamicFormInstanceServiceImpl alertFormValueServiceImpl;
@Autowired
FirefightersServiceImpl firefightersService;
@Autowired
DynamicFormColumnServiceImpl alertFormServiceImpl;
@Resource
OrgUsrMapper orgUsrMapper;
......@@ -1522,6 +1524,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
return orgUser;
}
public Object amosIdExist(String amosId){
List<OrgUsr> orgUsrs = orgUsrMapper.amosIdExist(amosId);
if (orgUsrs.size() > 0){
return false;
}
return true;
}
}
......@@ -8,20 +8,13 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
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.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -68,6 +61,9 @@ public class AlertCalledController extends BaseController {
private ESAlertCalledService eSAlertCalledService;
@Autowired
RedisUtils redisUtils;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
@Value("${redis.cache.failure.time}")
private long time;
/**
......@@ -338,4 +334,34 @@ public class AlertCalledController extends BaseController {
@RequestParam String latitude) {
return ResponseHelper.buildResponse(iAlertCalledService.reLocate(alertCalled, longitude, latitude));
}
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始*/
/**
* 警情填报联系人模糊查询
*
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAmosId", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "警情填报联系人模糊查询", notes = "警情填报联系人模糊查询")
public List<String> getContact (String contactName) {
return iAlertCalledService.getContactName(contactName);
}
/**
* 警情填报地址模糊查询
*
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAddress", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "警情填报地址模糊查询", notes = "警情填报地址模糊查询")
public List<String> getAddress (String address) {
return iAlertCalledService.getCalledAddress(address);
}
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束*/
}
\ No newline at end of file
......@@ -9,6 +9,8 @@ import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -93,6 +95,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
private ControllerServiceImpl controllerService;
@Autowired
private ControllerEquipServiceImpl controllerEquipService;
@Autowired
FirefightersServiceImpl firefightersService;
@Autowired
KeySiteServiceImpl keySiteService;
@Autowired
private AlertLocationLogServiceImpl alertLocationLogService;
......@@ -451,10 +457,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
listdate.add(new KeyValueLabel("联系电话", "contactPhone", alertCalled.getContactPhone()));
// listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
list.stream().forEach(alertFormValue -> {
String valueCode = alertFormValue.getFieldValueCode();
if(null == valueCode) {
/*2661 灾情详情中字典类数据错误显示为code 改为value值 2021-09-23 陈召 开始 */
String valueCode = alertFormValue.getFieldValue();
/*2661 灾情详情中字典类数据错误显示为code 改为value值 2021-09-23 陈召 结束 */
/*if(null == valueCode) {
valueCode = alertFormValue.getFieldValue();
}
}*/
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), valueCode));
});
map.put("data", listdate);
......@@ -774,4 +782,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
return resultList;
}
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始*/
public List<String> getContactName(String contactName){
List<String> firefightersName = firefightersService.getFirefightersName(contactName);
List<String> contactNames = alertCalledMapper.getContactName(contactName);
firefightersName.addAll(contactNames);
return firefightersName;
}
public List<String> getCalledAddress(String address){
List<String> keyAddress = keySiteService.getAddress(address);
List<String> alertAddress = alertCalledMapper.getAddress(address);
keyAddress.addAll(alertAddress);
return keyAddress;
}
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束*/
}
......@@ -49,10 +49,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -147,7 +144,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
} catch (MqttException e) {
throw new RuntimeException();
throw new RuntimeException();
}
return true;
......@@ -222,6 +219,21 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
// 3.消防队伍-监控大队
List<FireBrigadeResourceDto> monitorFireBrigadeList = fireTeamService.listMonitorFireBrigade(FireBrigadeTypeEnum.监控大队.getCode());
//List<FireBrigadeResourceDto> monitorFireBrigadeList = fireTeamService.listMonitorFireBrigade();
/*bug 2403 队伍未显示图片 2021-09-23 陈召开始 */
for (FireBrigadeResourceDto fireBrigadeResourceDto : monitorFireBrigadeList) {
if (fireBrigadeResourceDto.getPic() != null) {
String[] split = fireBrigadeResourceDto.getPic().split(",");
if (split.length > 1) {
fireBrigadeResourceDto.setImage(Arrays.asList(split));
} else {
List<String> objects = new ArrayList<>();
objects.add(fireBrigadeResourceDto.getPic());
fireBrigadeResourceDto.setImage(objects);
}
}
}
/*bug 2403 队伍未显示图片 2021-09-23 陈召结束 */
FireBrigadeResourceDto monitorResourceDto = new FireBrigadeResourceDto();
monitorResourceDto.setId("0");
monitorResourceDto.setName(FireBrigadeTypeEnum.监控大队.getName());
......@@ -239,7 +251,6 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
}
private List<PowerTransferCompanyResources> DtoEntityBatchConvert(List<PowerTransferCompanyResourcesDto> powerTransferCompanyResourcesDtoList, Long powerTransferCompanySequenceNbr) {
ArrayList<PowerTransferCompanyResources> powerTransferCompanyResourcesList = new ArrayList<>();
PowerTransferCompanyResources powerTransferCompanyResources;
......@@ -368,7 +379,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
transferDetail.deleteCharAt(transferDetail.length() - 1);
String transferDetails = templateContent.replace("departmentName-type-resourcesNum",
transferDetail.toString()).replace("rescueGrid", rescueGrid == null ? "" : rescueGrid).replace(
"taskStatus", "");
"taskStatus", "");
transferContent.add(transferDetails);
});
......@@ -379,10 +390,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
@Override
public List<PowerCompanyCountDto> getPowerCompanyCountDtocount(Long id) {
List<PowerCompanyCountDto> list= powerTransferMapper.getPowerCompanyCountDtocount(id);
if(list!=null&&list.size()>0){
list.stream().forEach(powerCompanyCountDto->{
List<PowerCarCountDto> li= powerTransferMapper.getPowerCarCountDtocount(id,powerCompanyCountDto.getCompanyId());
List<PowerCompanyCountDto> list = powerTransferMapper.getPowerCompanyCountDtocount(id);
if (list != null && list.size() > 0) {
list.stream().forEach(powerCompanyCountDto -> {
List<PowerCarCountDto> li = powerTransferMapper.getPowerCarCountDtocount(id, powerCompanyCountDto.getCompanyId());
powerCompanyCountDto.setPowerCarCountDto(li);
});
}
......
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