Commit c89433e4 authored by chenzhao's avatar chenzhao

2304 地址 联系人模糊查询缺失

parent 7e2e5b52
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<select id="listMonitorFireBrigade" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto"> <select id="listMonitorFireBrigade" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto">
SELECT ft.sequence_nbr id, SELECT ft.sequence_nbr id,
ft.NAME, ft.NAME,
ft.img, ft.img AS pic,
COUNT(DISTINCT ff.sequence_nbr) personCount COUNT(DISTINCT ff.sequence_nbr) personCount
FROM cb_fire_team ft FROM cb_fire_team ft
LEFT JOIN cb_firefighters ff ON ff.fire_team_id = ft.sequence_nbr LEFT JOIN cb_firefighters ff ON ff.fire_team_id = ft.sequence_nbr
...@@ -99,12 +99,12 @@ ...@@ -99,12 +99,12 @@
a.name , a.name ,
a.contact_user contactUser, a.contact_user contactUser,
a.contact_phone contactPhone, 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 Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance
FROM cb_fire_team a FROM cb_fire_team a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null 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!=""'> <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>
<if test='par.distance!=null'> <if test='par.distance!=null'>
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= #{par.distance} and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= #{par.distance}
......
...@@ -92,4 +92,15 @@ ...@@ -92,4 +92,15 @@
where f.is_delete = #{isDelete} where f.is_delete = #{isDelete}
</select> </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> </mapper>
...@@ -120,5 +120,14 @@ ...@@ -120,5 +120,14 @@
left join cb_org_usr cou on c.belong_id = cou.sequence_nbr left join cb_org_usr cou on c.belong_id = cou.sequence_nbr
where c.is_delete = FALSE; where c.is_delete = FALSE;
</select> </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> </mapper>
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
FROM FROM
jc_alert_called a jc_alert_called a
<where> <where>
1=1 a.is_delete = 0
<if test="alertStatus!= null "> <if test="alertStatus!= null ">
and alert_status = #{alertStatus} and alert_status = #{alertStatus}
</if> </if>
...@@ -185,6 +185,27 @@ ...@@ -185,6 +185,27 @@
</select> </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>
</mapper> </mapper>
...@@ -416,5 +416,20 @@ public class OrgUsrController extends BaseController { ...@@ -416,5 +416,20 @@ public class OrgUsrController extends BaseController {
List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(userIds); List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(userIds);
return ResponseHelper.buildResponse(loginUserDetails); return ResponseHelper.buildResponse(loginUserDetails);
} }
/**
* 判断关联账户是否已关联
*
* @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 ...@@ -103,4 +103,10 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
} }
public List<String> getFirefightersName(String contactName) {
return firefightersMapper.getFirefightersName(contactName);
}
} }
...@@ -296,5 +296,8 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -296,5 +296,8 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
return list1; return list1;
} }
public List<String> getAddress(String address){
return keySiteMapper.getAddress(address);
}
} }
...@@ -82,6 +82,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -82,6 +82,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Autowired @Autowired
DynamicFormInstanceServiceImpl alertFormValueServiceImpl; DynamicFormInstanceServiceImpl alertFormValueServiceImpl;
@Autowired @Autowired
FirefightersServiceImpl firefightersService;
@Autowired
DynamicFormColumnServiceImpl alertFormServiceImpl; DynamicFormColumnServiceImpl alertFormServiceImpl;
@Resource @Resource
OrgUsrMapper orgUsrMapper; OrgUsrMapper orgUsrMapper;
...@@ -1439,6 +1441,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1439,6 +1441,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return orgUsrList; return orgUsrList;
} }
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; ...@@ -8,20 +8,13 @@ import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto; 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 com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.*;
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.typroject.tyboot.component.event.RestEventTrigger; import org.typroject.tyboot.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -68,6 +61,9 @@ public class AlertCalledController extends BaseController { ...@@ -68,6 +61,9 @@ public class AlertCalledController extends BaseController {
private ESAlertCalledService eSAlertCalledService; private ESAlertCalledService eSAlertCalledService;
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
@Value("${redis.cache.failure.time}") @Value("${redis.cache.failure.time}")
private long time; private long time;
/** /**
...@@ -338,4 +334,34 @@ public class AlertCalledController extends BaseController { ...@@ -338,4 +334,34 @@ public class AlertCalledController extends BaseController {
@RequestParam String latitude) { @RequestParam String latitude) {
return ResponseHelper.buildResponse(iAlertCalledService.reLocate(alertCalled, longitude, 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; ...@@ -9,6 +9,8 @@ import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; 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.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -93,6 +95,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -93,6 +95,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
private ControllerServiceImpl controllerService; private ControllerServiceImpl controllerService;
@Autowired @Autowired
private ControllerEquipServiceImpl controllerEquipService; private ControllerEquipServiceImpl controllerEquipService;
@Autowired
FirefightersServiceImpl firefightersService;
@Autowired
KeySiteServiceImpl keySiteService;
@Autowired @Autowired
private AlertLocationLogServiceImpl alertLocationLogService; private AlertLocationLogServiceImpl alertLocationLogService;
...@@ -774,4 +780,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -774,4 +780,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
} }
return resultList; 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 结束*/
} }
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