Commit 3ffcbb63 authored by chenhao's avatar chenhao

添加119优化项 利用定时器更新联系人和重点部位模糊查询

parent 28f4d7fe
...@@ -71,6 +71,6 @@ public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr); ...@@ -71,6 +71,6 @@ public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr);
public List<KeySiteDateDto> getKeySiteDate(Long id); public List<KeySiteDateDto> getKeySiteDate(Long id);
public List<KeySite> getKeySiteDateByNameLike(String name); public List<KeySite> getKeySiteDateByNameLike(String name,Long companyId);
} }
...@@ -271,7 +271,7 @@ ...@@ -271,7 +271,7 @@
FROM FROM
cb_key_site cb_key_site
WHERE WHERE
address_desc LIKE CONCAT('%',#{locationt},'%') and is_delete=0 is_delete=0
</select> </select>
<select id="getAlertCalledLocation" resultType="Map"> <select id="getAlertCalledLocation" resultType="Map">
...@@ -282,7 +282,7 @@ ...@@ -282,7 +282,7 @@
FROM FROM
jc_alert_called jc_alert_called
WHERE WHERE
address LIKE CONCAT('%',#{locationt},'%') and is_delete=0 is_delete=0
</select> </select>
<select id="getOrgUserLocation" resultType="Map"> <select id="getOrgUserLocation" resultType="Map">
...@@ -296,7 +296,7 @@ ...@@ -296,7 +296,7 @@
case when field_code='longitude' then field_value end as longitude, case when field_code='longitude' then field_value end as longitude,
case when field_code='latitude' then field_value end as latitude case when field_code='latitude' then field_value end as latitude
from cb_dynamic_form_instance from cb_dynamic_form_instance
where group_code='244' ) tt where tt.location like CONCAT('%',#{locationt},'%') and tt.location is not null where group_code='244' ) tt where tt.location is not null
</select> </select>
<select id="getAirportLocation" resultType="Map"> <select id="getAirportLocation" resultType="Map">
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
FROM FROM
jc_airport_stand jc_airport_stand
WHERE WHERE
stand_code LIKE CONCAT('%',#{locationt},'%') and is_delete=0 is_delete=0
</select> </select>
</mapper> </mapper>
...@@ -230,8 +230,8 @@ public class KeySiteController extends BaseController { ...@@ -230,8 +230,8 @@ public class KeySiteController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "通过名称模糊查询重点部位的信息", notes = "通过名称模糊查询重点部位的信息") @ApiOperation(httpMethod = "GET",value = "通过名称模糊查询重点部位的信息", notes = "通过名称模糊查询重点部位的信息")
@GetMapping(value = "/getKeySiteDateByNameLike") @GetMapping(value = "/getKeySiteDateByNameLike")
public ResponseModel<List<KeySite>> getKeySiteDateByNameLike(@RequestParam String name) { public ResponseModel<List<KeySite>> getKeySiteDateByNameLike(@RequestParam String name,@RequestParam Long companyId) {
return ResponseHelper.buildResponse(keySiteService.getKeySiteDateByNameLike(name)); return ResponseHelper.buildResponse(keySiteService.getKeySiteDateByNameLike(name, companyId));
} }
} }
...@@ -319,9 +319,10 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -319,9 +319,10 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
} }
@Override @Override
public List<KeySite> getKeySiteDateByNameLike(String name) { public List<KeySite> getKeySiteDateByNameLike(String name,Long companyId) {
LambdaQueryWrapper<KeySite> mapper =new LambdaQueryWrapper<KeySite>(); LambdaQueryWrapper<KeySite> mapper =new LambdaQueryWrapper<KeySite>();
mapper.eq(KeySite::getIsDelete, false); mapper.eq(KeySite::getIsDelete, false);
mapper.eq(KeySite::getBelongId, companyId);
mapper.like(KeySite::getName, name); mapper.like(KeySite::getName, name);
return this.baseMapper.selectList(mapper); return this.baseMapper.selectList(mapper);
} }
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
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.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.entity.*;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -31,12 +31,15 @@ import com.google.common.collect.Lists; ...@@ -31,12 +31,15 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
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.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue; import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrzhDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrzhDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData; import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.feign.JcsControlServerClient; import com.yeejoin.amos.boot.module.common.api.feign.JcsControlServerClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto;
...@@ -48,6 +51,11 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto; ...@@ -48,6 +51,11 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto; import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel; import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.ControllerTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.ControllerTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum;
...@@ -825,7 +833,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -825,7 +833,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
} }
); );
firefightersName.addAll(contactNames); firefightersName.addAll(contactNames);
return firefightersName; return firefightersName;
} }
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
@Component
public class GetContactNameSchedulerJob {
@Autowired
RedisUtils redisUtils;
@Autowired
AlertCalledServiceImpl alertCalledServiceImpl;
@Value("${redis.cache.failure.time}")
private long time;
/**
* 每天凌晨12:01执行方法,更新联系人在缓存中的数据
*/
@Scheduled(cron = "0 01 00 ? * *")
public void excuteJob() {
List<Map<String, String>> contactName = alertCalledServiceImpl.getContactName();
redisUtils.set(RedisKey.CONTACT_USER, contactName, time);
}
}
...@@ -19,6 +19,7 @@ import org.springframework.core.env.Environment; ...@@ -19,6 +19,7 @@ import org.springframework.core.env.Environment;
import org.springframework.data.redis.connection.RedisConnection; import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler; import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
...@@ -38,6 +39,7 @@ import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils; ...@@ -38,6 +39,7 @@ import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
@EnableFeignClients @EnableFeignClients
@EnableAsync @EnableAsync
@EnableEurekaClient @EnableEurekaClient
@EnableScheduling
@MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*", @MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*", "org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.*.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper" }) "com.yeejoin.amos.boot.module.*.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper" })
......
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