提交 f7712daf authored 作者: zhoushaopan's avatar zhoushaopan

修改装备缓存名称

上级 7c764173
流水线 #312 已失败 于阶段
package com.tykj.dev.device.library.controller; package com.tykj.dev.device.library.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.service.CacheLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -25,7 +24,7 @@ import java.util.List; ...@@ -25,7 +24,7 @@ import java.util.List;
public class CacheLibraryController { public class CacheLibraryController {
@Autowired @Autowired
private CacheLibraryService cacheLibraryService; private DeviceLibraryCacheService cacheLibraryService;
@GetMapping("getAll") @GetMapping("getAll")
public List<DeviceLibrary> getAll(){ public List<DeviceLibrary> getAll(){
......
...@@ -6,7 +6,7 @@ import com.tykj.dev.config.cache.ConfigCache; ...@@ -6,7 +6,7 @@ import com.tykj.dev.config.cache.ConfigCache;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.repository.DeviceLibraryDao; import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.repository.DeviceLogDao; import com.tykj.dev.device.library.repository.DeviceLogDao;
import com.tykj.dev.device.library.service.CacheLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.service.DeviceChangeService; import com.tykj.dev.device.library.service.DeviceChangeService;
import com.tykj.dev.device.library.service.DeviceLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService; import com.tykj.dev.device.library.service.DeviceLogService;
...@@ -37,6 +37,7 @@ import javax.validation.constraints.Min; ...@@ -37,6 +37,7 @@ import javax.validation.constraints.Min;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -76,7 +77,7 @@ public class DeviceLibraryController { ...@@ -76,7 +77,7 @@ public class DeviceLibraryController {
private Executor executor; private Executor executor;
@Autowired @Autowired
private CacheLibraryService cacheLibraryService; private DeviceLibraryCacheService cacheLibraryService;
...@@ -492,10 +493,7 @@ public class DeviceLibraryController { ...@@ -492,10 +493,7 @@ public class DeviceLibraryController {
public ResponseEntity getDeviceStatisticsPage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) { public ResponseEntity getDeviceStatisticsPage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
List<DeviceStatisticsVo> deviceStatisticsVoList = deviceLibraryService.getDeviceStatisticsPage(deviceLibrarySelectVo, deviceLibrarySelectVo.getPageable(),deviceLibrarySelectVo.getPageable().getSort()); List<DeviceStatisticsVo> deviceStatisticsVoList = deviceLibraryService.getDeviceStatisticsPage(deviceLibrarySelectVo, deviceLibrarySelectVo.getPageable(),deviceLibrarySelectVo.getPageable().getSort());
List<DeviceStatisticsVo> deviceStatisticsVoSorts = deviceStatisticsVoList.stream() List<DeviceStatisticsVo> deviceStatisticsVoSorts = deviceStatisticsVoList.stream()
.sorted(Comparator.comparing(DeviceStatisticsVo::getModel) .sorted(Comparator.comparing(DeviceStatisticsVo::getModel).thenComparing(DeviceStatisticsVo::getName)).collect(Collectors.toList());
// .thenComparing(DeviceStatisticsVo::getName)
.thenComparing(DeviceStatisticsVo::getMatchingRangeName)
.thenComparing(DeviceStatisticsVo::getIsPart)).collect(Collectors.toList());
// Page<DeviceStatisticsVo> deviceStatisticsVos = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), deviceStatisticsVoList, deviceLibrarySelectVo.getPageable()); // Page<DeviceStatisticsVo> deviceStatisticsVos = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), deviceStatisticsVoList, deviceLibrarySelectVo.getPageable());
Page<DeviceStatisticsVo> deviceStatisticsVos = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), deviceStatisticsVoSorts, deviceLibrarySelectVo.getPageable()); Page<DeviceStatisticsVo> deviceStatisticsVos = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), deviceStatisticsVoSorts, deviceLibrarySelectVo.getPageable());
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
...@@ -814,43 +812,45 @@ public class DeviceLibraryController { ...@@ -814,43 +812,45 @@ public class DeviceLibraryController {
v.size(), k,v.stream().map(DeviceLibrary::getId).collect(Collectors.toList())); v.size(), k,v.stream().map(DeviceLibrary::getId).collect(Collectors.toList()));
deviceNewVoList.add(deviceNewVo); deviceNewVoList.add(deviceNewVo);
}); });
for (DeviceNewVo deviceNewVo : deviceNewVoList) {
Integer unitSort = DeviceModelSort.toUnitSort(deviceNewVo.getOwnUnit());
}
return deviceNewVoList; return deviceNewVoList;
} }
/** /**
* 测试 * 测试
*/ */
// @GetMapping("/setNumber") @GetMapping("/setNumber")
// public List<DeviceLibrary> setNumber(){ public List<DeviceLibrary> setNumber(){
//
// List<DeviceLibrary> allListAndParent = getAllListAndParent(); List<DeviceLibrary> allListAndParent = getAllListAndParent();
// List<DeviceLibrary> deviceLibraries = setOrderNumber(allListAndParent); AtomicInteger sortNum = new AtomicInteger();
// return deviceLibraries; return setOrderNumber(sortNum, allListAndParent);
// } }
//
// public List<DeviceLibrary> getAllListAndParent(){ public List<DeviceLibrary> getAllListAndParent(){
// DeviceLibrarySelectVo deviceLibrarySelectVo = new DeviceLibrarySelectVo(); DeviceLibrarySelectVo deviceLibrarySelectVo = new DeviceLibrarySelectVo();
// List<DeviceLibrary> deviceLibraryServiceAllList = deviceLibraryService.getAllList(deviceLibrarySelectVo); List<DeviceLibrary> deviceLibraryServiceAllList = deviceLibraryService.getAllList(deviceLibrarySelectVo);
// Map<Integer, DeviceLibrary> collect = deviceLibraryServiceAllList.stream().collect(Collectors.toMap(DeviceLibrary::getId, Function.identity())); Map<Integer, DeviceLibrary> collect = deviceLibraryServiceAllList.stream().collect(Collectors.toMap(DeviceLibrary::getId, Function.identity()));
// List<DeviceLibrary> containList = GetTreeUtils.parseTreeFromDown( return GetTreeUtils.parseTreeFromDown(
// deviceLibraryServiceAllList, deviceLibraryServiceAllList,
// DeviceLibrary::getId, DeviceLibrary::getId,
// deviceLibraryEntity -> Optional.ofNullable(collect.get(deviceLibraryEntity.getPartParentId())), deviceLibraryEntity -> Optional.ofNullable(collect.get(deviceLibraryEntity.getPartParentId())),
// DeviceLibrary::addChildNode DeviceLibrary::addChildNode
// ); );
// return containList; }
// }
// private List<DeviceLibrary> setOrderNumber(AtomicInteger sortNum,List<DeviceLibrary> allListAndParent) {
// private List<DeviceLibrary> setOrderNumber(List<DeviceLibrary> allListAndParent) { allListAndParent.forEach(
// for (int i = 0; i < allListAndParent.size(); i++) { deviceLibrary -> {
// DeviceLibrary deviceLibrary = allListAndParent.get(i); deviceLibrary.setOrderNumber(sortNum.incrementAndGet());
// deviceLibrary.setOrderNumber(i+1); if (deviceLibrary.getChilds().size()>0){
// i++; setOrderNumber(sortNum,deviceLibrary.getChilds());
// if (deviceLibrary.getChilds().size()>0){ }
// setOrderNumber(deviceLibrary.getChilds()); }
// } );
// } return allListAndParent;
// return allListAndParent; }
// }
} }
...@@ -8,7 +8,8 @@ import java.util.List; ...@@ -8,7 +8,8 @@ import java.util.List;
* DATE:2021-8-11 * DATE:2021-8-11
* Author:zsp * Author:zsp
*/ */
public interface CacheLibraryService {
public interface DeviceLibraryCacheService {
/** /**
* 查询全部 * 查询全部
......
...@@ -12,7 +12,7 @@ import org.springframework.stereotype.Component; ...@@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
@Component @Component
public class MyInitializer implements ApplicationListener<ApplicationReadyEvent> { public class MyInitializer implements ApplicationListener<ApplicationReadyEvent> {
@Autowired @Autowired
private CacheLibraryService cacheLibraryService; private DeviceLibraryCacheService cacheLibraryService;
@Override @Override
public void onApplicationEvent(ApplicationReadyEvent event) { public void onApplicationEvent(ApplicationReadyEvent event) {
cacheLibraryService.getAllDeviceLibraryList(); cacheLibraryService.getAllDeviceLibraryList();
......
package com.tykj.dev.device.library.service.impl; package com.tykj.dev.device.library.service.impl;
import com.tykj.dev.device.library.repository.DeviceLibraryDao; import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.CacheLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
...@@ -17,7 +16,7 @@ import java.util.List; ...@@ -17,7 +16,7 @@ import java.util.List;
*/ */
@Service @Service
@CacheConfig(cacheNames = "devicesLibraryList") @CacheConfig(cacheNames = "devicesLibraryList")
public class CacheLibraryServiceImpl implements CacheLibraryService { public class CacheLibraryServiceImpl implements DeviceLibraryCacheService {
@Autowired @Autowired
private DeviceLibraryDao deviceLibraryDao; private DeviceLibraryDao deviceLibraryDao;
......
...@@ -7,7 +7,7 @@ import com.tykj.dev.blockcha.subject.service.BlockChainUtil; ...@@ -7,7 +7,7 @@ import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.TaskBeanConfig; import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.config.base.DeviceLifeStatus; import com.tykj.dev.config.base.DeviceLifeStatus;
import com.tykj.dev.device.library.repository.DeviceLibraryDao; import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.CacheLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.service.DeviceLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo; import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
...@@ -57,7 +57,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -57,7 +57,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
private UnitsService unitsService; private UnitsService unitsService;
@Autowired @Autowired
private CacheLibraryService cacheLibraryService; private DeviceLibraryCacheService cacheLibraryService;
@Override @Override
public DeviceLibrary addEntity(DeviceLibrary deviceLibraryEntity) { public DeviceLibrary addEntity(DeviceLibrary deviceLibraryEntity) {
DeviceLibrary deviceLibrary = deviceLibraryDao.save(deviceLibraryEntity); DeviceLibrary deviceLibrary = deviceLibraryDao.save(deviceLibraryEntity);
...@@ -791,7 +791,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -791,7 +791,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
predicateBuilder.eq("ownUnit", deviceLibrarySelectVo.getOwnUnit()); predicateBuilder.eq("ownUnit", deviceLibrarySelectVo.getOwnUnit());
} }
if (deviceLibrarySelectVo.getRfidCardId() != null) { if (deviceLibrarySelectVo.getRfidCardId() != null) {
predicateBuilder.eq("rfidCardId", deviceLibrarySelectVo.getRfidCardId()); predicateBuilder.like("rfidCardId", deviceLibrarySelectVo.getRfidCardId());
} }
if (deviceLibrarySelectVo.getPackingId() != null) { if (deviceLibrarySelectVo.getPackingId() != null) {
predicateBuilder.eq("packingId", deviceLibrarySelectVo.getPackingId()); predicateBuilder.eq("packingId", deviceLibrarySelectVo.getPackingId());
......
...@@ -1204,7 +1204,7 @@ public class RepairController { ...@@ -1204,7 +1204,7 @@ public class RepairController {
messageService.add(messageBto); messageService.add(messageBto);
} }
String message = repairReceiveVo.getStatus() == 0 ? "业务办结" : "接收维修领取装备"; String message = repairReceiveVo.getStatus() == 0 ? "业务办结" : "接收维修领取装备";
MessageBto messageBto = new MessageBto(taskBto2.getId(), taskBto2.getBusinessType(), message, ids, 1,0); MessageBto messageBto = new MessageBto(taskBto2.getId(), taskBto2.getBusinessType(), message, ids, 1,1);
messageService.add(messageBto); messageService.add(messageBto);
//遍历map依次发送阅知 //遍历map依次发送阅知
messageMap.keySet().forEach(integer -> { messageMap.keySet().forEach(integer -> {
...@@ -1212,7 +1212,8 @@ public class RepairController { ...@@ -1212,7 +1212,8 @@ public class RepairController {
integerList.addAll(userDao.findAllByUnitsId(integer).stream() integerList.addAll(userDao.findAllByUnitsId(integer).stream()
.map(User::getUserId) .map(User::getUserId)
.collect(Collectors.toList())); .collect(Collectors.toList()));
MessageBto messageBto2 = new MessageBto(0, 5, "待领取送修装备", integerList); // MessageBto messageBto2 = new MessageBto(0, 5, "待领取送修装备", integerList);
MessageBto messageBto2 = new MessageBto(0, 5, "待领取送修装备", integerList,1,1);
//存放详情id集合 //存放详情id集合
messageBto2.setRecord(StringSplitUtil.idListToString(messageMap.get(integer))); messageBto2.setRecord(StringSplitUtil.idListToString(messageMap.get(integer)));
messageService.add(messageBto2); messageService.add(messageBto2);
...@@ -1424,7 +1425,7 @@ public class RepairController { ...@@ -1424,7 +1425,7 @@ public class RepairController {
ids2.addAll(userDao.findAllByUnitsId(integer).stream() ids2.addAll(userDao.findAllByUnitsId(integer).stream()
.map(User::getUserId) .map(User::getUserId)
.collect(Collectors.toList())); .collect(Collectors.toList()));
MessageBto messageBto2 = new MessageBto(0, 5, "待领取送修装备", ids2); MessageBto messageBto2 = new MessageBto(0, 5, "待领取送修装备", ids2,1,1);
messageBto2.setRecord(StringSplitUtil.idListToString(messageMap.get(integer))); messageBto2.setRecord(StringSplitUtil.idListToString(messageMap.get(integer)));
messageService.add(messageBto2); messageService.add(messageBto2);
}); });
...@@ -1876,7 +1877,7 @@ public class RepairController { ...@@ -1876,7 +1877,7 @@ public class RepairController {
integerList.addAll(userDao.findAllByUnitsId(unitId).stream() integerList.addAll(userDao.findAllByUnitsId(unitId).stream()
.map(User::getUserId) .map(User::getUserId)
.collect(Collectors.toList())); .collect(Collectors.toList()));
MessageBto messageBto2 = new MessageBto(0, 5, "待领取送修装备", integerList); MessageBto messageBto2 = new MessageBto(0, 5, "待领取送修装备", integerList,1,1);
messageBto2.setRecord(String.valueOf(repairDetail1.getId())); messageBto2.setRecord(String.valueOf(repairDetail1.getId()));
messageService.add(messageBto2); messageService.add(messageBto2);
} }
...@@ -2050,7 +2051,7 @@ public class RepairController { ...@@ -2050,7 +2051,7 @@ public class RepairController {
integerList.addAll(userDao.findAllByUnitsId(integer).stream() integerList.addAll(userDao.findAllByUnitsId(integer).stream()
.map(User::getUserId) .map(User::getUserId)
.collect(Collectors.toList())); .collect(Collectors.toList()));
MessageBto messageBto2 = new MessageBto(0, 5, "待领取送修装备", integerList); MessageBto messageBto2 = new MessageBto(0, 5, "待领取送修装备", integerList,1,1);
//阅知记录id拼接 //阅知记录id拼接
messageBto2.setRecord(StringSplitUtil.idListToString(messageMap.get(integer))); messageBto2.setRecord(StringSplitUtil.idListToString(messageMap.get(integer)));
messageService.add(messageBto2); messageService.add(messageBto2);
......
...@@ -9,7 +9,7 @@ import com.tykj.dev.device.apply.subject.vo.ApplyBillDetailVo; ...@@ -9,7 +9,7 @@ import com.tykj.dev.device.apply.subject.vo.ApplyBillDetailVo;
import com.tykj.dev.device.file.entity.FileRet; import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.file.service.FilesUtil; import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao; import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.CacheLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.service.DeviceLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService; import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto; import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
...@@ -121,7 +121,7 @@ public class StorageBillController { ...@@ -121,7 +121,7 @@ public class StorageBillController {
private Executor executor; private Executor executor;
@Autowired @Autowired
private CacheLibraryService cacheLibraryService; private DeviceLibraryCacheService cacheLibraryService;
@ApiOperation(value = "判断序列号是否存在申请任务中", notes = "判断序列号是否存在申请任务中") @ApiOperation(value = "判断序列号是否存在申请任务中", notes = "判断序列号是否存在申请任务中")
@PostMapping(value = "/existApplyTask") @PostMapping(value = "/existApplyTask")
......
...@@ -74,7 +74,7 @@ public class MessageBto { ...@@ -74,7 +74,7 @@ public class MessageBto {
private Integer isHighLight = 0; private Integer isHighLight = 0;
@ApiModelProperty(value = "是否置顶(0:不是,1:是)") @ApiModelProperty(value = "是否置顶(0:不是,1:是)")
private Integer isTop = 0; private Integer isTop;
/** /**
* bto类转化为do类 * bto类转化为do类
...@@ -102,7 +102,7 @@ public class MessageBto { ...@@ -102,7 +102,7 @@ public class MessageBto {
//set vo字段 //set vo字段
if (userUtils!=null&&userReadDetailList.contains(userUtils.getCurrentUserId())){ if (userUtils!=null&&userReadDetailList.contains(userUtils.getCurrentUserId())){
messageUserVo.setIsRead(1); messageUserVo.setIsRead(1);
messageUserVo.setIsTop(1); messageUserVo.setIsTop(0);
} }
if (messageUserVo.getCreateUserId()!=null){ if (messageUserVo.getCreateUserId()!=null){
messageUserVo.setOperator(userPublicService.getOne(messageUserVo.getCreateUserId()).getName()); messageUserVo.setOperator(userPublicService.getOne(messageUserVo.getCreateUserId()).getName());
......
...@@ -87,7 +87,7 @@ public class Message { ...@@ -87,7 +87,7 @@ public class Message {
private Integer isHighLight = 0; private Integer isHighLight = 0;
@ApiModelProperty(value = "是否置顶(0:不是,1:是)") @ApiModelProperty(value = "是否置顶(0:不是,1:是)")
private Integer isTop = 0; private Integer isTop;
/** /**
* do类转化为bto类 * do类转化为bto类
......
...@@ -64,5 +64,5 @@ public class MessageUserVo { ...@@ -64,5 +64,5 @@ public class MessageUserVo {
private String unit; private String unit;
@ApiModelProperty(value = "是否置顶(0:不是,1:是)") @ApiModelProperty(value = "是否置顶(0:不是,1:是)")
private Integer isTop = 0; private Integer isTop;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论