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