Merge remote-tracking branch 'origin/dev' into dev
commit
6903066127
|
@ -63,4 +63,5 @@ public class LoginUser implements Serializable {
|
|||
*/
|
||||
private SysUser sysUser;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -13,11 +13,11 @@ public class AllFaultCacheService extends CacheAbsBacis {
|
|||
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "Allfault:info:";
|
||||
return "AllFault:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("Allfault:info:", "");
|
||||
return key.replace("AllFault:info:", "");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,11 +3,12 @@ package com.muyu.enterprise.cache;
|
|||
import com.muyu.common.cache.CacheAbsBacis;
|
||||
import com.muyu.domain.Fence;
|
||||
import com.muyu.domain.req.FenceReq;
|
||||
import com.muyu.domain.resp.FenceResp;
|
||||
|
||||
/**
|
||||
* 所有电子围栏缓存
|
||||
*/
|
||||
public class AllFenceCahceService extends CacheAbsBacis<String, FenceReq> {
|
||||
public class AllFenceCahceService extends CacheAbsBacis<String, FenceResp> {
|
||||
@Override
|
||||
public void clear() {
|
||||
|
||||
|
@ -15,12 +16,12 @@ public class AllFenceCahceService extends CacheAbsBacis<String, FenceReq> {
|
|||
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "Allfence:info:";
|
||||
return "AllFence:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("Allfence:info:", "");
|
||||
return key.replace("AllFence:info:", "");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package com.muyu.enterprise.cache;
|
||||
|
||||
import com.muyu.common.cache.CacheAbsBacis;
|
||||
import com.muyu.domain.MessageTemplate;
|
||||
import com.muyu.domain.MessageValue;
|
||||
import com.muyu.domain.req.MessageValueReq;
|
||||
import com.muyu.domain.resp.MessageValueListResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报文模版缓存
|
||||
*/
|
||||
public class AllMessageValueCacheService extends CacheAbsBacis<String, List<MessageValueListResp>> {
|
||||
public class AllMessageValueCacheService extends CacheAbsBacis<String, MessageValueListResp> {
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -18,11 +19,11 @@ public class AllMessageValueCacheService extends CacheAbsBacis<String, List<Mess
|
|||
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "allmessagevalue:info:";
|
||||
return "AllMessagevalue:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("allmessagevalue:info:", "");
|
||||
return key.replace("AllMessagevalue:info:", "");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,12 +25,12 @@ public class AllVehicleCacheService extends CacheAbsBacis<String, VehicleManageR
|
|||
*/
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "allvehicle:info:";
|
||||
return "AllVehicle:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("allvehicle:info:", "");
|
||||
return key.replace("AllVehicle:info:", "");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,11 +14,11 @@ public class AllVehicleTypeCacheService extends CacheAbsBacis<String, VehicleTyp
|
|||
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "vehicleType:info:";
|
||||
return "AllVehicleType:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("vehicleType:info:", "");
|
||||
return key.replace("AllVehicleType:info:", "");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.enterprise.cache;
|
||||
|
||||
import com.muyu.common.cache.CacheAbsBacis;
|
||||
import com.muyu.domain.WarnRule;
|
||||
|
||||
/**
|
||||
* 预警规则缓存服务
|
||||
*/
|
||||
public class AllWarnRuleCacheService extends CacheAbsBacis<String, WarnRule> {
|
||||
@Override
|
||||
public void clear() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "AllWarnRule:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("AllWarnRule:info:", "");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.muyu.enterprise.cache;
|
||||
|
||||
import com.muyu.common.cache.CacheAbsBacis;
|
||||
import com.muyu.domain.WarnStrategy;
|
||||
import com.muyu.domain.resp.WarnVehicleResp;
|
||||
|
||||
/**
|
||||
* 预警策略缓存服务
|
||||
*/
|
||||
public class AllWarnStrategyCacheService extends CacheAbsBacis<String, WarnVehicleResp> {
|
||||
@Override
|
||||
public void clear() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "AllWarnStrategy:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("AllWarnStrategy:info:", "");
|
||||
}
|
||||
}
|
|
@ -3,6 +3,8 @@ com.muyu.enterprise.cache.AllFenceCahceService
|
|||
com.muyu.enterprise.cache.AllMessageValueCacheService
|
||||
com.muyu.enterprise.cache.AllVehicleCacheService
|
||||
com.muyu.enterprise.cache.AllVehicleTypeCacheService
|
||||
com.muyu.enterprise.cache.AllWarnRuleCacheService
|
||||
com.muyu.enterprise.cache.AllWarnStrategyCacheService
|
||||
com.muyu.enterprise.cache.FaultCacheService
|
||||
com.muyu.enterprise.cache.FenceCahceService
|
||||
com.muyu.enterprise.cache.MessageTemplateCacheService
|
||||
|
|
|
@ -75,6 +75,14 @@ public class WarnRule extends BaseEntity{
|
|||
@Excel(name = "最小值")
|
||||
private Integer minValue;
|
||||
|
||||
/**
|
||||
* 策略外键id
|
||||
*/
|
||||
@Schema(type = "Integer",description = "策略外键id")
|
||||
@Excel(name = "策略外键id")
|
||||
private Integer warnStrategyId;
|
||||
|
||||
|
||||
public static WarnRule updateBuilder(WarnRule warnRule, Supplier<Long> supplier) {
|
||||
return WarnRule.builder()
|
||||
.warnRuleId(supplier.get())
|
||||
|
|
|
@ -51,6 +51,7 @@ public class WarnStrategy extends BaseEntity{
|
|||
private Long vehicleTypeId;
|
||||
|
||||
|
||||
|
||||
public static WarnStrategy updateBuilder(WarnStrategy warnStrategy, Supplier<Long> supplier) {
|
||||
return WarnStrategy.builder()
|
||||
.warnStrategyId(supplier.get())
|
||||
|
|
|
@ -26,5 +26,5 @@ public class BoundFenceGroupReq {
|
|||
/**
|
||||
* 围栏组Ids
|
||||
*/
|
||||
private List<Long> fenceGroupIds;
|
||||
private Long[] fenceGroupIds;
|
||||
}
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
//package com.muyu.domain.req;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.annotation.IdType;
|
||||
//import com.baomidou.mybatisplus.annotation.TableId;
|
||||
//import com.muyu.domain.Fence;
|
||||
//import io.swagger.v3.oas.annotations.media.Schema;
|
||||
//import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Builder;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
//@Data
|
||||
//@Builder
|
||||
//@AllArgsConstructor
|
||||
//@NoArgsConstructor
|
||||
//@Tag(name = "查看绑定的围栏信息")
|
||||
//public class HaveFence {
|
||||
//
|
||||
// /**
|
||||
// * 主键
|
||||
// */
|
||||
// @Schema(type = "Long",description = "主键")
|
||||
// @TableId(value = "id",type = IdType.AUTO)
|
||||
// private Long id;
|
||||
//
|
||||
// /**
|
||||
// * 围栏名称
|
||||
// */
|
||||
// @Schema(type = "String",description = "围栏名称")
|
||||
// private String fenceName;
|
||||
//
|
||||
// /**
|
||||
// * 坐标
|
||||
// */
|
||||
// @Schema(type = "String",description = "坐标")
|
||||
// private String coordinates;
|
||||
//
|
||||
// /**
|
||||
// * 描述
|
||||
// */
|
||||
// @Schema(type = "String",description = "描述")
|
||||
// private String description;
|
||||
//
|
||||
// /**
|
||||
// * 电子围栏列表
|
||||
// */
|
||||
// @Schema(type = "List<Fence>",description = "电子围栏列表")
|
||||
// List<Fence> fenceList;
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
|
@ -23,4 +23,7 @@ public class WarnVehicleReq {
|
|||
@Excel(name = "策略名称")
|
||||
private String strategyName;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -53,6 +53,12 @@ public class MessageValueListResp {
|
|||
@Schema(type = "Integer",title = "起始下标")
|
||||
private Integer messageStartIndex;
|
||||
|
||||
/**
|
||||
* 报文模版外键
|
||||
*/
|
||||
@Schema(type = "Long",description = "报文模版主键")
|
||||
private Long messageTemplateId;
|
||||
|
||||
/**
|
||||
* 终止下标
|
||||
*/
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.enterprise.controller;
|
|||
import com.muyu.common.redis.service.RedisService;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import com.muyu.enterprise.cache.AllFenceCahceService;
|
||||
import com.muyu.enterprise.cache.FenceCahceService;
|
||||
import com.muyu.enterprise.cache.VehicleCacheService;
|
||||
import com.muyu.enterprise.service.ElectService;
|
||||
|
@ -45,6 +46,8 @@ public class ElectController extends BaseController {
|
|||
@Autowired
|
||||
private FenceCahceService fenceCahceService;
|
||||
|
||||
@Autowired
|
||||
private AllFenceCahceService allFenceCahceService;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -57,6 +60,9 @@ public class ElectController extends BaseController {
|
|||
startPage();
|
||||
List<FenceResp> list = electService.selectFenceList(req);
|
||||
//将列表存到Redis
|
||||
for (FenceResp fenceResp : list) {
|
||||
allFenceCahceService.put(fenceResp.getCoordinates(),fenceResp);
|
||||
}
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
@ -142,7 +148,7 @@ public class ElectController extends BaseController {
|
|||
@DeleteMapping("/delMoreFence")
|
||||
@Operation(description = "批量删除电子围栏")
|
||||
public Result delMore(@RequestBody List<Long> fenceIds){
|
||||
// electService.delMoreFence(fenceIds);
|
||||
//批量删除内容存到Redis
|
||||
electService.removeBatchByIds(fenceIds);
|
||||
return Result.success(null,"操作成功");
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ public class MessageTemplateController {
|
|||
@Autowired
|
||||
private MessageTemplateCacheService templateCacheService;
|
||||
|
||||
|
||||
/**
|
||||
* 报文模版列表查询
|
||||
*1
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.enterprise.controller;
|
||||
|
||||
import com.muyu.enterprise.cache.AllMessageValueCacheService;
|
||||
import com.muyu.enterprise.service.MessageValueService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.MessageValue;
|
||||
|
@ -32,6 +33,11 @@ public class MessageValueController {
|
|||
@Autowired
|
||||
private MessageValueService messageValueService;
|
||||
|
||||
//存Redis
|
||||
@Autowired
|
||||
private AllMessageValueCacheService allMessageValueCacheService;
|
||||
|
||||
|
||||
/**
|
||||
* 报文数据列表查询
|
||||
*
|
||||
|
@ -42,6 +48,9 @@ public class MessageValueController {
|
|||
@Operation(summary = "报文数据列表", description = "根据报文类别, 报文模版筛选报文数据")
|
||||
public Result<List<MessageValueListResp>> findAll(@RequestBody MessageValueReq messageValueReq) {
|
||||
List<MessageValueListResp> list = messageValueService.findAll(messageValueReq);
|
||||
for (MessageValueListResp messageValueListResp : list) {
|
||||
allMessageValueCacheService.put(String.valueOf(messageValueListResp.getMessageTemplateId()), messageValueListResp);
|
||||
}
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ public class VehicleController extends BaseController {
|
|||
/**
|
||||
* 车辆绑定围栏组
|
||||
*/
|
||||
@GetMapping("/addBoundFenceGroup")
|
||||
@PostMapping("/addBoundFenceGroup")
|
||||
@Operation(description = "车辆绑定围栏组")
|
||||
public Result boundFenceGroup(
|
||||
@Validated @RequestBody BoundFenceGroupReq boundFenceGroupReq){
|
||||
|
@ -169,4 +169,5 @@ public class VehicleController extends BaseController {
|
|||
Long templateId = vehicleService.findByVehicleVin(vehicleVin);
|
||||
return Result.success(templateId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.muyu.domain.MessageValue;
|
|||
import com.muyu.domain.VehicleType;
|
||||
import com.muyu.domain.req.MessageValueAddReq;
|
||||
import com.muyu.domain.req.VehicleAddReq;
|
||||
import com.muyu.enterprise.cache.AllVehicleTypeCacheService;
|
||||
import com.muyu.enterprise.cache.VehicleCacheService;
|
||||
import com.muyu.enterprise.cache.VehicleTypeCacheService;
|
||||
import com.muyu.enterprise.service.VehicleTypeService;
|
||||
|
@ -38,6 +39,11 @@ public class VehicleTypeController {
|
|||
@Autowired
|
||||
private VehicleTypeCacheService vehicleTypeCacheService;
|
||||
|
||||
//存缓存
|
||||
@Autowired
|
||||
private AllVehicleTypeCacheService allVehicleTypeCacheService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有车辆类型
|
||||
* @return
|
||||
|
@ -46,10 +52,10 @@ public class VehicleTypeController {
|
|||
@Operation(summary = "车辆类型列表",description = "车辆类型列表")
|
||||
public Result<List<VehicleType>> findAll(){
|
||||
List<VehicleType> list = vehicleTypeService.list();
|
||||
list.forEach(vehicleType -> {
|
||||
vehicleTypeCacheService.put(String.valueOf(vehicleType.getVehicleTypeId()), vehicleType);
|
||||
});
|
||||
return Result.success(list);
|
||||
for (VehicleType vehicleType : list) {
|
||||
allVehicleTypeCacheService.put(String.valueOf(vehicleType.getVehicleTypeId()),vehicleType);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.common.core.domain.Result;
|
|||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import com.muyu.domain.WarnRule;
|
||||
import com.muyu.enterprise.cache.AllWarnRuleCacheService;
|
||||
import com.muyu.enterprise.cache.WarnRuleCacheService;
|
||||
import com.muyu.enterprise.service.WarnRuleService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
@ -22,6 +23,10 @@ public class WarnRuleController {
|
|||
@Autowired
|
||||
private WarnRuleCacheService warnRuleCacheService;
|
||||
|
||||
//存列表
|
||||
@Autowired
|
||||
private AllWarnRuleCacheService allWarnRuleCacheServicel;
|
||||
|
||||
/**
|
||||
* 规则列表
|
||||
* @return
|
||||
|
@ -29,7 +34,11 @@ public class WarnRuleController {
|
|||
@RequestMapping(path = "/ruleList",method = RequestMethod.POST)
|
||||
@Operation(summary = "规则列表", description = "获取所有规则列表")
|
||||
public Result<List<WarnRule>> ruleList(){
|
||||
return Result.success(warnRuleService.list());
|
||||
List<WarnRule> list = warnRuleService.list();
|
||||
for (WarnRule warnRule : list) {
|
||||
allWarnRuleCacheServicel.put(warnRule.getRuleName(),warnRule);
|
||||
}
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.common.core.domain.Result;
|
|||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import com.muyu.domain.WarnStrategy;
|
||||
import com.muyu.enterprise.cache.AllWarnStrategyCacheService;
|
||||
import com.muyu.enterprise.cache.WarnStrategyCacheService;
|
||||
import com.muyu.enterprise.service.WarnStrategyService;
|
||||
import com.muyu.domain.req.WarnVehicleReq;
|
||||
|
@ -26,14 +27,31 @@ public class WarnStrategyController {
|
|||
@Autowired
|
||||
private WarnStrategyCacheService warnStrategyCacheService;
|
||||
|
||||
//列表
|
||||
@Autowired
|
||||
private AllWarnStrategyCacheService allWarnStrategyCacheService;
|
||||
|
||||
/**
|
||||
* 策略列表
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(path = "/strategyList",method = RequestMethod.POST)
|
||||
@Operation(summary = "策略列表", description = "获取所有策略列表")
|
||||
public Result<List<WarnStrategy>> strategyList() {
|
||||
return Result.success(warnStrategyService.list());
|
||||
// public Result<List<WarnStrategy>> strategyList() {
|
||||
// List<WarnStrategy> list = warnStrategyService.list();
|
||||
// //存进Redis
|
||||
// for (WarnStrategy warnStrategy : list) {
|
||||
// allWarnStrategyCacheService.put(String.valueOf(warnStrategy.getWarnStrategyId()),warnStrategy);
|
||||
// }
|
||||
// return Result.success(list);
|
||||
// }
|
||||
public Result<List<WarnVehicleResp>> strategyList(@RequestBody @Validated WarnVehicleReq req) {
|
||||
List<WarnVehicleResp> list = warnStrategyService.selectList(req);
|
||||
for (WarnVehicleResp warnVehicleResp : list) {
|
||||
//存进Redis
|
||||
allWarnStrategyCacheService.put(String.valueOf(warnVehicleResp.getVehicleTypeId()),warnVehicleResp);
|
||||
}
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -52,11 +70,11 @@ public class WarnStrategyController {
|
|||
* @param warnVehicleReq
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(path = "ruleStrategyList",method = RequestMethod.POST)
|
||||
@Operation(summary = "策略规则双表联查", description = "获取所有策略规则双表联查")
|
||||
public Result<List<WarnVehicleResp>> ruleStrategyList(@RequestBody WarnVehicleReq warnVehicleReq){
|
||||
return Result.success(warnStrategyService.ruleStrategyList(warnVehicleReq));
|
||||
}
|
||||
// @RequestMapping(path = "ruleStrategyList",method = RequestMethod.POST)
|
||||
// @Operation(summary = "策略规则双表联查", description = "获取所有策略规则双表联查")
|
||||
// public Result<List<WarnVehicleResp>> ruleStrategyList(@RequestBody WarnVehicleReq warnVehicleReq){
|
||||
// return Result.success(warnStrategyService.ruleStrategyList(warnVehicleReq));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 添加策略
|
||||
|
|
|
@ -44,12 +44,8 @@ public interface VehicleMapper extends MPJBaseMapper<Vehicle> {
|
|||
*/
|
||||
// @Insert("INSERT INTO `vehicle-basic`.`bound_middle` (`fence_group_id`,`vehicle_id`) VALUES <foreach collection=\"fenceGroupIds\" item=\"id\" separator=\",\"> (#{id},#{vehicleId}) </foreach>")
|
||||
@Insert({
|
||||
"<script>",
|
||||
"INSERT INTO `vehicle-basic`.`bound_middle` (fence_group_id,vehicle_id) VALUES ",
|
||||
"<foreach collection='fenceGroupIds' item='id' separator=','>",
|
||||
"(#{id}, #{vehicleId})",
|
||||
"</foreach>",
|
||||
"</script>"
|
||||
"<script> INSERT INTO `vehicle-basic`.`bound_middle` (fence_group_id,vehicle_id) VALUES <foreach collection='fenceGroupIds' item='id' separator=','> (#{id}, #{vehicleId}) </foreach> </script>"
|
||||
// "INSERT INTO `vehicle-basic`.`bound_middle` (fence_group_id, vehicle_id) VALUES <foreach collection=\"fenceGroupIds\" item=\"id\" separator=\",\"> (#{id}, #{vehicleId}) </foreach> "
|
||||
})
|
||||
void boundFenceGroup(BoundFenceGroupReq boundFenceGroupReq);
|
||||
|
||||
|
|
|
@ -38,4 +38,5 @@ public interface VehicleService extends IService<Vehicle> {
|
|||
* 绑定围栏组
|
||||
*/
|
||||
void boundFenceGroup(BoundFenceGroupReq boundFenceGroupReq);
|
||||
|
||||
}
|
||||
|
|
|
@ -9,5 +9,8 @@ import java.util.List;
|
|||
|
||||
public interface WarnStrategyService extends IService<WarnStrategy> {
|
||||
|
||||
List<WarnVehicleResp>ruleStrategyList(WarnVehicleReq warnVehicleReq);
|
||||
// List<WarnVehicleResp>ruleStrategyList(WarnVehicleReq warnVehicleReq);
|
||||
|
||||
List<WarnVehicleResp> selectList(WarnVehicleReq req);
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.muyu.domain.Fence;
|
|||
import com.muyu.domain.LanType;
|
||||
import com.muyu.domain.req.FenceReq;
|
||||
import com.muyu.domain.resp.FenceResp;
|
||||
import com.muyu.enterprise.service.VehicleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -24,7 +25,8 @@ public class ElectServiceImpl
|
|||
@Autowired
|
||||
private ElectMapper electMapper;
|
||||
@Autowired
|
||||
private WarnLogsMapper warnLogsMapper;
|
||||
private VehicleService service;
|
||||
|
||||
|
||||
@Autowired
|
||||
private FenceCahceService fenceCahceService;
|
||||
|
@ -51,13 +53,6 @@ public class ElectServiceImpl
|
|||
// fenceCahceService.put(String.valueOf(decode),d);
|
||||
return list;
|
||||
}
|
||||
//
|
||||
// @Override
|
||||
// public int addFence(Fence fence) {
|
||||
// int i = electMapper.addFence(fence);
|
||||
// return i;
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public void updateFenceOn(Long fenceId) {
|
||||
|
|
|
@ -73,7 +73,6 @@ public class VehicleServiceImpl
|
|||
|
||||
@Override
|
||||
public void boundFenceGroup(BoundFenceGroupReq boundFenceGroupReq) {
|
||||
|
||||
vehicleMapper.boundFenceGroup(boundFenceGroupReq);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.enterprise.service.impl;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.muyu.domain.MessageTemplate;
|
||||
import com.muyu.enterprise.mapper.WarnStrategyMapper;
|
||||
import com.muyu.enterprise.service.WarnStrategyService;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
|
@ -12,6 +13,7 @@ import com.muyu.domain.resp.WarnVehicleResp;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
|
@ -21,15 +23,31 @@ public class WarnStrategyServiceImpl extends ServiceImpl<WarnStrategyMapper, War
|
|||
@Autowired
|
||||
private WarnStrategyMapper warnStrategyMapper;
|
||||
|
||||
// @Override
|
||||
// public List<WarnVehicleResp> ruleStrategyList(WarnVehicleReq warnVehicleReq) {
|
||||
// MPJLambdaWrapper<WarnStrategy> wrapper = new MPJLambdaWrapper<>();
|
||||
// wrapper.selectAll(WarnStrategy.class)
|
||||
// .selectAs(VehicleType::getVehicleTypeName,WarnVehicleResp::getVehicleTypeName)
|
||||
// .leftJoin(VehicleType.class, VehicleType::getVehicleTypeId,WarnStrategy::getVehicleTypeId)
|
||||
// .like(
|
||||
// StringUtils.isNotEmpty(warnVehicleReq.getStrategyName()),
|
||||
// WarnStrategy::getStrategyName,warnVehicleReq.getStrategyName()
|
||||
// );
|
||||
// List<WarnVehicleResp> list = warnStrategyMapper.selectJoinList(WarnVehicleResp.class, wrapper);
|
||||
// return list;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<WarnVehicleResp> ruleStrategyList(WarnVehicleReq warnVehicleReq) {
|
||||
public List<WarnVehicleResp> selectList(WarnVehicleReq req) {
|
||||
MPJLambdaWrapper<WarnStrategy> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(WarnStrategy.class)
|
||||
.selectAs(VehicleType::getVehicleTypeName,WarnVehicleResp::getVehicleTypeName)
|
||||
.selectAs(MessageTemplate::getMessageTemplateName,WarnVehicleResp::getMessageTemplateName)
|
||||
.leftJoin(VehicleType.class, VehicleType::getVehicleTypeId,WarnStrategy::getVehicleTypeId)
|
||||
.leftJoin(MessageTemplate.class, MessageTemplate::getMessageTemplateId,WarnStrategy::getMessageTemplateId)
|
||||
.like(
|
||||
StringUtils.isNotEmpty(warnVehicleReq.getStrategyName()),
|
||||
WarnStrategy::getStrategyName,warnVehicleReq.getStrategyName()
|
||||
StringUtils.isNotEmpty(req.getStrategyName()),
|
||||
WarnStrategy::getStrategyName,req.getStrategyName()
|
||||
);
|
||||
List<WarnVehicleResp> list = warnStrategyMapper.selectJoinList(WarnVehicleResp.class, wrapper);
|
||||
return list;
|
||||
|
|
Loading…
Reference in New Issue