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

feat(列装模块,配套设备模块,便签管理,缓存模块): 未打印标签查询,列装绑定,关联设备,缓存的替换

未打印标签查询,列装绑定,关联设备,缓存的替换
上级 1e102426
......@@ -470,7 +470,7 @@ public class AllotBillController {
messageService.add(messageBto);
}
//根据status判断是否业务完结,发送不同的阅知message
String message = allotReceiveVo.getStatus() == 0 ? "业务办结" : "接收配发装备";
String message = allotReceiveVo.getStatus() == 0 ? allotBillEntity.getReceiveUnit()+"配发业务办结" : allotBillEntity.getReceiveUnit()+"接收配发装备";
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), message, ids, 1);
messageService.add(messageBto);
log.info("[配发模块]:接收并发起入库");
......@@ -812,19 +812,21 @@ public class AllotBillController {
}
//给同单位专管员和收件单位专管员推阅知
// messageBto1.setContent(title.substring(0,4)+"撤回"+title.substring(4));
messageBto1.setContent("撤回任务:" + title);
MessageBto messageBto = new MessageBto(-1, parentTask.getBusinessType(), messageBto1.getContent(), idList, 1);
BeanUtils.copyProperties(messageBto1,messageBto);
messageBto.setTaskId(-1);
messageService.add(messageBto);
myWebSocket.sendMessage1();
//将任务都完结
taskService.moveToRevoke(taskBto);
taskService.moveToRevoke(parentTask);
// messageBto1.setContent("撤回对" + allotBill.getReceiveUnit()+"的型号为"+"的任务");
// MessageBto messageBto = new MessageBto(-1, parentTask.getBusinessType(), messageBto1.getContent(), idList, 1);
// BeanUtils.copyProperties(messageBto1,messageBto);
// messageBto.setTaskId(-1);
// messageService.add(messageBto);
// myWebSocket.sendMessage1();
// //将任务都完结
// taskService.moveToRevoke(taskBto);
// taskService.moveToRevoke(parentTask);
List<DeviceLibrary> deviceLibraryList = null;
if (allotBill.getAllotCheckDetail() != null) {
List<Integer> ids = StringSplitUtil.split(allotBill.getAllotCheckDetail());
//所有的装备
List<DeviceLibrary> deviceLibraryList;
// List<DeviceLibrary> deviceLibraryList;
//所有的装备日志
List<DeviceLogDto> deviceLogDtos = new ArrayList<>();
......@@ -846,6 +848,17 @@ public class AllotBillController {
allotBillService.delete(allotBill.getId());
}
messageBto1.setContent("撤回对" + allotBill.getReceiveUnit()+"的型号为"+deviceLibraryList.stream().map(DeviceLibrary::getModel)
.collect(Collectors.toList())+"的任务");
MessageBto messageBto = new MessageBto(-1, parentTask.getBusinessType(), messageBto1.getContent(), idList, 1);
BeanUtils.copyProperties(messageBto1,messageBto);
messageBto.setTaskId(-1);
messageService.add(messageBto);
myWebSocket.sendMessage1();
//将任务都完结
taskService.moveToRevoke(taskBto);
taskService.moveToRevoke(parentTask);
return ResponseEntity.ok(messageBto);
}
......
......@@ -48,9 +48,6 @@ public class AllotBillSelectController {
@Autowired
private AllotBackBillService allotBackBillService;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
@Autowired
private TaskService taskService;
......
......@@ -2,7 +2,9 @@ package com.tykj.dev.device.apply.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
......@@ -11,6 +13,8 @@ import java.util.List;
*/
@Data
@ApiModel("申请详情类")
@AllArgsConstructor
@NoArgsConstructor
public class ApplyBillDetailVo {
// @NotNull(message = "packingId不能为空")
......@@ -37,4 +41,5 @@ public class ApplyBillDetailVo {
public void setChildNull() {
childs=null;
}
}
......@@ -13,6 +13,7 @@ import com.tykj.dev.device.finalcheck.repisotry.FinalDetailDao;
import com.tykj.dev.device.finalcheck.repisotry.FinalReportDao;
import com.tykj.dev.device.finalcheck.service.FinalCheckService;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.util.UserUtils;
......@@ -52,8 +53,11 @@ public class FinalCheckServiceImpl implements FinalCheckService {
@Autowired
private FinalDetailDao detailDao;
// @Autowired
// private DeviceLibraryDao deviceDao;
@Autowired
private DeviceLibraryDao deviceDao;
private DeviceLibraryCacheService deviceLibraryCacheService;
@Autowired
private DeviceUseReportService dataService;
......@@ -93,7 +97,9 @@ public class FinalCheckServiceImpl implements FinalCheckService {
report = reportDao.save(report);
// 查询这段时间内该单位下的所有装备 并且计数
// List<DeviceLibrary> devices = deviceDao.findAllByUnitBetweenTime(unitName, localDateToDate(startTime), localDateToDate(endTime));
List<DeviceLibrary> devices = deviceDao.findAll();
// List<DeviceLibrary> devices = deviceDao.findAll();
List<DeviceLibrary> devices = deviceLibraryCacheService.getAllDeviceLibraryList();
// PredicateBuilder<DeviceLibrary> builder = Specifications.and();
// builder.eq("ownUnit",unitName);
// List<DeviceLibrary> devices = deviceDao.findAll(builder.build());
......
......@@ -773,7 +773,7 @@ public class DeviceLibraryController {
String model = deviceEditVo.getUpdateVoList().getModel();
//配件的型号
String childModel = d.getModel();
if (model.equals(childModel)){
// if (model.equals(childModel)){
if (deviceLibraryEntity.getIsPart() == 0 && d.getIsPart() == 1) {
d.setPartParentId(deviceEditVo.getDeviceId());
deviceLibraryService.update(d);
......@@ -794,9 +794,9 @@ public class DeviceLibraryController {
deviceLogService.addLog(deviceLogDto);
deviceLogService.addLog(deviceLogDto2);
}
}else {
throw new ApiException("添加的配件的列装目录和该装备列装目录不一致,请进行更换");
}
// }else {
// throw new ApiException("添加的配件的列装目录和该装备列装目录不一致,请进行更换");
// }
}
}
......
......@@ -466,4 +466,16 @@ public interface DeviceLibraryService {
* @return 装备的集合
*/
List<DeviceLibrary> getAllBySeqNumber(String rfid);
/**
* 根据id集合查询装备
* @param ids 装备id的集合
*/
List<DeviceLibrary> findAllByIds(List<Integer> ids);
/**
* 更新装备的状态 正式和试用
*/
void updateTry(List<DeviceLibrary> deviceLibraries);
}
......@@ -44,7 +44,7 @@ public class CacheLibraryServiceImpl implements DeviceLibraryCacheService {
public List<DeviceLibrary> getAllDeviceLibraryList() {
long start = System.currentTimeMillis();
List<DeviceLibrary> all = deviceLibraryDao.findAll();
log.info("缓存时间:{}", System.currentTimeMillis() - start);
log.info("创建缓存时间:{}", System.currentTimeMillis() - start);
return all;
}
......
......@@ -1016,6 +1016,20 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return deviceLibraryDao.getAllBySeqNumber(rfid);
}
@Override
public List<DeviceLibrary> findAllByIds(List<Integer> ids) {
return deviceLibraryDao.findAllByIdIn(ids);
}
@Override
@UpdateCache
public void updateTry(List<DeviceLibrary> deviceLibraries) {
deviceLibraries.forEach(deviceLibrary -> {
deviceLibrary.setTryOutDevice(0);
update(deviceLibrary);
});
}
// @Override
// @UpdateCache
// public int updatePartParentId(List<Integer> deviceIds) {
......
......@@ -9,6 +9,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
/**
* @author dengdiyi
......@@ -74,4 +75,9 @@ public interface MatchingDeviceLibraryService {
* @param relationDeviceVo 关联装备的vo
*/
void relationDevice(RelationDeviceVo relationDeviceVo);
/**
* 获取配套设备的序列号
*/
Map<String,MatchingDeviceLibrary> getAllMatchingDeviceSeqNumber();
}
......@@ -5,6 +5,8 @@ import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.matching.repository.MatchingDeviceLibraryDao;
import com.tykj.dev.device.matching.service.MatchingDeviceLibraryService;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary;
......@@ -26,6 +28,7 @@ import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
......@@ -225,6 +228,13 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
update(matchingDeviceLibrary);
}
@Override
public Map<String, MatchingDeviceLibrary> getAllMatchingDeviceSeqNumber() {
List<MatchingDeviceLibrary> matchingDeviceLibraries = matchingDeviceLibraryDao.findAll();
return matchingDeviceLibraries.stream().collect(Collectors.toMap(
MatchingDeviceLibrary::getSeqNumber, Function.identity()));
}
/**
* @param matchingDeviceSelectVo 配套设备查询vo
* 创建通用查询条件筛选器
......
......@@ -129,6 +129,10 @@ public class MatchingDeviceLibrary {
@Transient
private String typeName;
@ApiModelProperty(value = "关联装备的序列号")
@Transient
private String deviceSeqNumber;
public MatchingDeviceLibrary setConfigName(){
ConfigCache configCache = SpringUtils.getBean("initConfigCache");
......
......@@ -58,7 +58,8 @@ public class MatchingDeviceSaveVo {
MatchingDeviceLibrary matchingDeviceLibraryEntity = new MatchingDeviceLibrary();
BeanUtils.copyProperties(this, matchingDeviceLibraryEntity);
matchingDeviceLibraryEntity.setLifeStatus(2);
matchingDeviceLibraryEntity.setDeviceId(0);
// matchingDeviceLibraryEntity.setDeviceId(0);
matchingDeviceLibraryEntity.setDeviceId(null);
// if (matchingDeviceLibraryEntity.getRfidCardId()==null||"".equals(matchingDeviceLibraryEntity.getRfidCardId())){
// matchingDeviceLibraryEntity.setRfidCardId(UUID.randomUUID().toString());
// }
......
......@@ -732,13 +732,14 @@ public class PackingController {
if (!packingLibraryUpdateVo.getMatchingRange().equals(packingLibrary.getMatchingRange())&&packingLibraryService.matchingRangeIsExist(packingLibrary.getPartParentId(),packingLibraryUpdateVo.getMatchingRange(),packingLibraryUpdateVo.getType(),packingLibraryUpdateVo.getStyle(),packingLibraryUpdateVo.getName(),packingLibraryUpdateVo.getSecretLevel(),packingLibraryUpdateVo.getInvisibleRange())){
throw new ApiException("该型号下已存在配用范围为"+configCache.getMatchingRangeMap().get(packingLibraryUpdateVo.getMatchingRange())+"的相同装备");
}
PackingLog packingLog = new PackingLog();
//复制相同的字段
if (packingLibraryUpdateVo.getName()!=null&&!packingLibraryUpdateVo.getName().equals(packingLibrary.getName())){
if (packingLibraryService.nameIsExist1(packingLibrary.getModel(),packingLibraryUpdateVo.getName(),packingLibrary.getPartParentId(),packingLibrary.getMatchingRange())){
throw new ApiException("该型号下已存在配用范围为"+configCache.getMatchingRangeMap().get(packingLibraryUpdateVo.getMatchingRange())+"的相同名称装备");
}
//添加列装日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
packingLog.setRemark("将名称从"+packingLibrary.getName()+"改为"+packingLibraryUpdateVo.getName());
packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog);
......@@ -748,7 +749,7 @@ public class PackingController {
}
if (packingLibraryUpdateVo.getApplyType()!=null&&!packingLibraryUpdateVo.getApplyType().equals(packingLibrary.getApplyType())){
//添加列装应用类型日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
packingLog.setRemark("将应用类型从"+configCache.getApplyTypeMap().getOrDefault(packingLibrary.getApplyType(),"空")+"改为"+configCache.getApplyTypeMap().get(packingLibraryUpdateVo.getApplyType()));
packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog);
......@@ -756,7 +757,7 @@ public class PackingController {
}
if (packingLibraryUpdateVo.getSecretLevel()!=null&&!packingLibraryUpdateVo.getSecretLevel().equals(packingLibrary.getSecretLevel())){
//添加列装密级日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
packingLog.setRemark("将密级从"+configCache.getSecretLevelMap().getOrDefault(packingLibrary.getSecretLevel(),"空")+"改为"+configCache.getSecretLevelMap().get(packingLibraryUpdateVo.getSecretLevel()));
packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog);
......@@ -822,7 +823,7 @@ public class PackingController {
}
if (packingLibraryUpdateVo.getInvisibleRange()!=null&&!packingLibraryUpdateVo.getInvisibleRange().equals(packingLibrary.getInvisibleRange())){
//添加列装可见范围日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
packingLog.setRemark("将可见范围从"+configCache.getInvisibleRangeMap().getOrDefault(packingLibrary.getInvisibleRange(),"空")+"改为"+configCache.getInvisibleRangeMap().get(packingLibraryUpdateVo.getInvisibleRange()));
packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog);
......@@ -830,7 +831,7 @@ public class PackingController {
}
if (packingLibraryUpdateVo.getType()!=null&&!packingLibraryUpdateVo.getType().equals(packingLibrary.getType())){
//添加列装形态日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
packingLog.setRemark("将形态从"+configCache.getStyleMap().getOrDefault(packingLibrary.getType(),"空")+"改为"+configCache.getStyleMap().get(packingLibraryUpdateVo.getType()));
packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog);
......@@ -838,7 +839,7 @@ public class PackingController {
}
if (packingLibraryUpdateVo.getNature()!=null&&!packingLibraryUpdateVo.getNature().equals(packingLibrary.getNature())){
//添加列装性质日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
packingLog.setRemark("将列装性质从"+configCache.getNatureMap().getOrDefault(packingLibrary.getNature(),"空")+"改为"+configCache.getNatureMap().get(packingLibraryUpdateVo.getNature()));
packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog);
......@@ -846,7 +847,7 @@ public class PackingController {
}
if (packingLibraryUpdateVo.getStyle()!=null&&!packingLibraryUpdateVo.getStyle().equals(packingLibrary.getStyle())){
//添加列装日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
String s1= packingLibrary.getStyle()==1?"装备":"附件";
String s2= packingLibraryUpdateVo.getStyle()==1?"装备":"附件";
packingLog.setRemark("将类型从"+s1+"改为"+s2);
......@@ -856,7 +857,7 @@ public class PackingController {
}
if (packingLibraryUpdateVo.getProdUnit()!=null&&!packingLibraryUpdateVo.getProdUnit().equals(packingLibrary.getProdUnit())){
//添加列装日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
String origin = packingLibrary.getProdUnit()==null?"无":packingLibrary.getProdUnit();
packingLog.setRemark("将生产单位从"+origin+"改为"+packingLibraryUpdateVo.getProdUnit());
packingLog.setPackingId(packingLibrary.getId());
......@@ -865,7 +866,7 @@ public class PackingController {
}
if (packingLibraryUpdateVo.getPrice()!=null&&!packingLibraryUpdateVo.getPrice().equals(packingLibrary.getPrice())){
//添加列装日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
String origin = packingLibrary.getPrice()==null?"无":packingLibrary.getPrice();
packingLog.setRemark("将价格从"+origin+"改为"+packingLibraryUpdateVo.getPrice());
packingLog.setPackingId(packingLibrary.getId());
......@@ -874,7 +875,7 @@ public class PackingController {
}
if (packingLibraryUpdateVo.getImageUrl()!=null&&!packingLibraryUpdateVo.getImageUrl().equals(packingLibrary.getImageUrl())){
//添加列装日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
packingLog.setRemark("更新设备图片");
packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog);
......@@ -883,7 +884,7 @@ public class PackingController {
}
if (packingLibraryUpdateVo.getFileUrl()!=null&&!packingLibraryUpdateVo.getFileUrl().equals(packingLibrary.getFileUrl())){
//添加列装日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
if ("".equals(packingLibraryUpdateVo.getFileUrl())){
packingLog.setRemark("删除列装文件");
}
......@@ -897,7 +898,7 @@ public class PackingController {
}
if (packingLibraryUpdateVo.getFileList()!=null&&!FilesUtil.stringFileToList(packingLibraryUpdateVo.getFileList()).equals(packingLibrary.getFileDb())){
//添加列装日志
PackingLog packingLog = new PackingLog();
// PackingLog packingLog = new PackingLog();
packingLog.setRemark("更新列装设备文件");
packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog);
......@@ -907,7 +908,7 @@ public class PackingController {
packingLibraryService.update(packingLibrary);
//发送阅知信息
List<Integer> userIds = userPublicService.findOtherUser(userUtils.getCurrentUserId());
MessageBto messageBto = new MessageBto(0,1,"修改列装装备信息",userIds,0);
MessageBto messageBto = new MessageBto(0,1,"修改列装:"+packingLog.getRemark(),userIds,0);
messageService.add(messageBto);
return ResponseEntity.ok("编辑成功");
}
......
......@@ -963,6 +963,9 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
}
}
originPacking.setPartParentId(selectPacking.getId());
PackingLog packingLog = new PackingLog();
packingLog.setRemark("列装名称为"+originPacking.getName()+"与列装名称"+selectPacking.getName()+"绑定在一起");
packingLogService.add(packingLog);
update(originPacking);
}
......@@ -971,14 +974,23 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
//获取列装对象的装备
List<DeviceLibrary> deviceLibraries = deviceLibraryService.findAllByPackingId(packingLibrary.getId());
List<Integer> deviceIds = deviceLibraries.stream().map(deviceLibrary -> deviceLibrary.getId()).collect(Collectors.toList());
List<Integer> deviceIds = deviceLibraries.stream().map(DeviceLibrary::getId).collect(Collectors.toList());
//将装备的父id全部置空
Integer userId = userUtils.getCurrentUserId();
deviceLibraries.forEach(deviceLibrary -> {
DeviceLogDto deviceLogDto = new DeviceLogDto();
deviceLibrary.setPartParentId(null);
deviceLibraryService.update(deviceLibrary);
deviceLogDto.setDeviceId(deviceLibrary.getId());
deviceLogDto.setRemark("由于列装进行了解绑,装备也伴随着解绑");
deviceLogDto.setCreateUserId(userId);
deviceLogService.addLog(deviceLogDto);
});
//修改列装
packingLibrary.setPartParentId(null);
PackingLog packingLog = new PackingLog();
packingLog.setRemark("手动进行了列装解绑");
packingLogService.add(packingLog);
update(packingLibrary);
}
......
......@@ -3,7 +3,6 @@ package com.tykj.dev.device.repair.controller;
import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
......@@ -80,9 +79,6 @@ public class RepairBillSelectController {
@Autowired
private UserPublicService userPublicService;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
@ApiOperation(value = "查询工作台维修装备数量", notes = "可以通过这个接口查询工作台维修装备数量")
@GetMapping(value = "/repairNum")
public ResponseEntity getRepairNum(){
......
......@@ -276,7 +276,9 @@ public class RepairController {
}
//发送阅知信息
List<Integer> userIds = userPublicService.findOtherUser(userUtils.getCurrentUserId());
MessageBto messageBto = new MessageBto(0, 5, "添加维修装备", userIds, 1);
List<String> models = deviceLibraryService.findAllByIds(ids).stream().map(DeviceLibrary::getModel)
.collect(Collectors.toList());
MessageBto messageBto = new MessageBto(0, 5, "添加维修装备:型号为"+models, userIds, 1);
//阅知记录存放detailIds
messageBto.setRecord(StringSplitUtil.idListToString(detailIds));
messageService.add(messageBto);
......@@ -583,7 +585,10 @@ public class RepairController {
MessageBto messageBto = new MessageBto(saveEntity.getId(), saveEntity.getBusinessType(), "被选为签发人", idList1, 1);
messageService.add(messageBto);
}
MessageBto messageBto = new MessageBto(saveEntity.getId(), saveEntity.getBusinessType(), "向" + userPublicService.getAreaNameByUnitName(repairBill.getReceiveUnit()) + "发起装备维修", ids, 1);
String content = "待领取送修装备,型号为"+deviceLibraryService.findAllByIds(idList)
.stream().map(DeviceLibrary::getModel).collect(Collectors.toList());
// MessageBto messageBto = new MessageBto(saveEntity.getId(), saveEntity.getBusinessType(), "向" + userPublicService.getAreaNameByUnitName(repairBill.getReceiveUnit()) + "发起装备维修", ids, 1);
MessageBto messageBto = new MessageBto(saveEntity.getId(), saveEntity.getBusinessType(), content, ids, 1);
messageService.add(messageBto);
myWebSocket.sendMessage1();
//
......@@ -1762,6 +1767,7 @@ public class RepairController {
//已领取装备
else if (type == 4) {
Integer level = userUtils.getCurrentUnitLevel();
String currentUserUnitName = userUtils.getCurrentUserUnitName();
List<RepairDetail> repairDetails;
if (level == 1) {
repairDetails = repairDetailDao.findAllByRepairStatus(5, repairTaskSelectVo.getPageable().getSort());
......@@ -2347,11 +2353,15 @@ public class RepairController {
if (repairDetail.getLocationUnit().equals(repairDetail.getOwnUnit())){
repairDetail.setDeviceRepairBillId(0);
repairDetail.setRepairStatus(RepairStatusEnum.WAIT_SEND.id);
repairDetail.setLocationUnit(deviceLibraryService.getOne(
repairDetail.getDeviceId()).getLocationUnit());
repairDetailDao.save(repairDetail);
}else {
//下级
RepairDetail repairDetail1 = repairDetailDao.findById(repairDetail.getPid()).get();
repairDetail1.setRepairStatus(RepairStatusEnum.WAIT_SEND.id);
repairDetail.setLocationUnit(deviceLibraryService.getOne(
repairDetail.getDeviceId()).getLocationUnit());
repairDetailDao.save(repairDetail1);
repairDetailDao.deleteById(repairDetail.getId());
}
......
......@@ -5,6 +5,8 @@ import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.Script;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
......@@ -26,6 +28,7 @@ import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.RepairStatusEnum;
import com.tykj.dev.misc.base.StatusEnum;
......@@ -72,6 +75,12 @@ public class RepairDetailServiceImpl implements RepairDetailService {
@Autowired
private UnitsService unitsService;
@Autowired
private UserUtils userUtils;
@Autowired
private DeviceLogService deviceLogService;
@Override
public RepairDetail save(RepairDetail deviceRepairDetailEntity) {
RepairDetail repairDetail = deviceRepairDetailDao.save(deviceRepairDetailEntity);
......@@ -285,6 +294,14 @@ public class RepairDetailServiceImpl implements RepairDetailService {
List<Integer> deviceIds = billVos.stream().map(BillVo::getDevicesId).collect(Collectors.toList());
//修改装备的所属和装备的状态
deviceLibraryService.updateDevicesOwnUnit(deviceIds);
Integer userId = userUtils.getCurrentUserId();
//添加装备履历
deviceIds.forEach(
integer -> {
DeviceLogDto deviceLogDto = new DeviceLogDto(integer, "由于进行清退任务,该设备状态修改为在库", null, userId);
deviceLogService.addLog(deviceLogDto);
}
);
//修改维修单的remark
List<Integer> repairBillIds = billVos.stream().map(BillVo::getRepairBillId).collect(Collectors.toList());
//根据sendBill查询
......
package com.tykj.dev.rfid.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -9,8 +10,12 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class PrintVo {
@ApiModelProperty(name = "表面号")
String rfidContent;
@ApiModelProperty(name = "型号")
String str1;
@ApiModelProperty(name = "名称")
String str2;
@ApiModelProperty(name = "序列号")
String str3;
}
......@@ -20,4 +20,7 @@ public class RfidPrintVo {
@ApiModelProperty(name = "表面号")
String content;
@ApiModelProperty(name = "配套设备的序列号")
String matchingDeviceSeq;
}
......@@ -5,7 +5,7 @@ import com.tykj.dev.config.repository.SystemVariableDao;
import com.tykj.dev.config.service.SystemVariableService;
import com.tykj.dev.config.swagger.AutoDocument;
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.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
......@@ -73,8 +73,8 @@ public class SelfCheckController {
@Autowired
private DeviceLibraryService deviceLibraryService;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
// @Autowired
// private DeviceLibraryDao deviceLibraryDao;
@Autowired
private DeviceLogService deviceLogService;
......@@ -228,7 +228,8 @@ public class SelfCheckController {
for (String s : list2) {
//如果不在交集中,则为新增
if (!list1.contains(s)) {
List<DeviceLibrary> d = deviceLibraryDao.getAllByRfidCardId(s);
// List<DeviceLibrary> d = deviceLibraryDao.getAllByRfidCardId(s);
List<DeviceLibrary> d =deviceLibraryService.getAllByRfidCardId(s);
//如果新增的为系统中存在的装备
if (d.size() > 0) {
for (DeviceLibrary deviceLibraryEntity : d) {
......
......@@ -2,6 +2,7 @@ package com.tykj.dev.device.sendback.service.impl;
import com.tykj.dev.config.base.DeviceLifeStatus;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
......@@ -59,6 +60,9 @@ public class AgainStorageBillServiceImpl implements AgainStorageBillService {
@Autowired
UserService userService;
@Autowired
private DeviceLibraryService deviceLibraryService;
@Override
public void againPutInStorage(TransitionOfLifeVo transitionOfLifeVo, SecurityUser securityUser) {
List<DeviceLibrary> deviceLibraries= deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(transitionOfLifeVo.getIds());
......@@ -66,22 +70,26 @@ public class AgainStorageBillServiceImpl implements AgainStorageBillService {
String typeName;
switch (transitionOfLifeVo.getType()){
case 0:
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.IN_LIBRARY.id,transitionOfLifeVo.getIds());
// deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.IN_LIBRARY.id,transitionOfLifeVo.getIds());
deviceLibraryService.upDateLeftStatus(DeviceLifeStatus.IN_LIBRARY.id,transitionOfLifeVo.getIds());
typeName="重新入库";
break;
case 1:
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.TO_BE_SCRAPPED.id,transitionOfLifeVo.getIds());
// deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.TO_BE_SCRAPPED.id,transitionOfLifeVo.getIds());
deviceLibraryService.upDateLeftStatus(DeviceLifeStatus.TO_BE_SCRAPPED.id,transitionOfLifeVo.getIds());
typeName="转为待报废设备";
break;
case 2:
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.TO_BE_DESTROYED.id,transitionOfLifeVo.getIds());
// deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.TO_BE_DESTROYED.id,transitionOfLifeVo.getIds());
deviceLibraryService.upDateLeftStatus(DeviceLifeStatus.TO_BE_DESTROYED.id,transitionOfLifeVo.getIds());
typeName="转为待销毁设备";
break;
case 3:
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.REPEL.id,transitionOfLifeVo.getIds());
// deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.REPEL.id,transitionOfLifeVo.getIds());
deviceLibraryService.upDateLeftStatus(DeviceLifeStatus.REPEL.id,transitionOfLifeVo.getIds());
typeName="转为待退役设备";
break;
......
......@@ -3,6 +3,7 @@ package com.tykj.dev.statistical.service.impl;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.repair.repository.RepairDetailDao;
......@@ -77,6 +78,9 @@ public class BigScreenServiceImpl implements BigScreenService {
@Autowired
private DeviceLibraryService deviceLibraryService;
@Autowired
private DeviceLibraryCacheService deviceLibraryCacheService;
/**
* 获取省及各市装备统计信息
*/
......@@ -85,7 +89,8 @@ public class BigScreenServiceImpl implements BigScreenService {
List<DevNum> devNumList = new ArrayList<>();
List<DevNum> devNums = new ArrayList<>(statisticalCache.getDevNums());
//获取所有装备
List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll();
// List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll();
List<DeviceLibrary> deviceLibraries = deviceLibraryCacheService.getAllDeviceLibraryList();
//获取省本级
List<Area> areas = areaDao.findAreasByType(1);
//获取所有单位
......@@ -146,7 +151,8 @@ public class BigScreenServiceImpl implements BigScreenService {
//本年度业务总数
centerNum.setBusinessCount((int) taskDao.findAll().stream().filter(task -> isPresentYear(task.getCreateTime())).count());
//新增设备数
centerNum.setDeviceAddCount((int) deviceLibraryDao.findAll().stream().filter(deviceLibrary -> deviceLibrary.getCreateTime()!=null&&isPresentYear(deviceLibrary.getCreateTime())).count());
// centerNum.setDeviceAddCount((int) deviceLibraryDao.findAll().stream().filter(deviceLibrary -> deviceLibrary.getCreateTime()!=null&&isPresentYear(deviceLibrary.getCreateTime())).count());
centerNum.setDeviceAddCount((int) deviceLibraryCacheService.getAllDeviceLibraryList().stream().filter(deviceLibrary -> deviceLibrary.getCreateTime()!=null&&isPresentYear(deviceLibrary.getCreateTime())).count());
//故障率
Set<Integer> repairDeviceIds = new HashSet<>();
List<Task> businessList = taskDao.findAllByBusinessType(BusinessEnum.REPAIR.id);
......
......@@ -3,7 +3,8 @@ package com.tykj.dev.statistical.service.impl;
import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetail;
import com.tykj.dev.device.confirmcheck.repository.DeviceCheckDetailDao;
import com.tykj.dev.device.confirmcheck.repository.DeviceCheckStatDao;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
//import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
......@@ -50,8 +51,8 @@ import java.util.stream.Collectors;
@Service
public class StatisticalServiceImpl implements StatisticalService {
@Autowired
private DeviceLibraryDao deviceLibraryDao;
// @Autowired
// private DeviceLibraryDao deviceLibraryDao;
@Autowired
private AreaDao areaDao;
......@@ -100,6 +101,9 @@ public class StatisticalServiceImpl implements StatisticalService {
@Autowired
private UserUtils userUtils;
@Autowired
private DeviceLibraryCacheService deviceLibraryCacheService;
/**
* 获取装备统计信息
*/
......@@ -107,7 +111,8 @@ public class StatisticalServiceImpl implements StatisticalService {
public List<DevNum> getDeviceNum() {
List<DevNum> nums=new ArrayList<>();
//获取所有装备
List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll();
// List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll();
List<DeviceLibrary> deviceLibraries = deviceLibraryCacheService.getAllDeviceLibraryList();
//获取所有市
List<Area> areas = areaDao.findAreasByType(2);
//获取所有单位
......@@ -145,7 +150,8 @@ public class StatisticalServiceImpl implements StatisticalService {
public List<DevLifeSector> getLifeStatus(Integer type) {
List<DevLifeSector> nums=new ArrayList<>();
//获取所有装备
List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll();
// List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll();
List<DeviceLibrary> deviceLibraries = deviceLibraryCacheService.getAllDeviceLibraryList();
//省
if (type==1){
DevLifeSector devLifeSector = new DevLifeSector();
......
......@@ -192,13 +192,25 @@ public class StorageBillController {
start = Integer.parseInt(s);
}
List<String> seq2 = createSeq2(start+1, start+1+num);
StringJoiner stringBuffer = new StringJoiner("-");
String modelStyle = createSeqVo.getModel()+createSeqVo.getStyle();
for (String s : seq2) {
stringBuffer.add(modelStyle+s);
// StringJoiner stringBuffer = new StringJoiner("-");
StringBuilder stringBuilder = new StringBuilder();
String model = createSeqVo.getModel();
String type = createSeqVo.getType();
String style = createSeqVo.getStyle();
if (style.length()<2){
style = "0"+style;
}
return ResponseEntity.ok(stringBuffer.toString());
// return ResponseEntity.ok(seqList);
if (type.length()<2){
type = "0"+type;
}
String modelTypeStyle = model+type+style;
stringBuilder
.append(modelTypeStyle)
.append(seq2.get(0))
.append("-")
.append(modelTypeStyle)
.append(seq2.get(seq2.size()-1));
return ResponseEntity.ok(stringBuilder);
}
@ApiOperation(value = "获取序列号区间列表", notes = "可以通过这个接口获取序列号区间列表")
......@@ -640,6 +652,21 @@ public class StorageBillController {
}
}
}
//完成更新试用修改为正式
if(storageBillSaveVo.getTryOutDevice() == 0){
List<DeviceLibrarySaveVo> deviceLibrarySaveVoList = storageBillSaveVo.getDeviceLibrarySaveVoList();
deviceLibrarySaveVoList.forEach(deviceLibrarySaveVo -> {
List<DeviceLibrary> deviceLibraries = deviceLibraryService.findAllByPackingId(deviceLibrarySaveVo.getPackingId());
deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> deviceLibrary.getTryOutDevice() == 1)
.collect(Collectors.toList());
if (deviceLibraries.size()>0){
//将装备试用的改为正式的
deviceLibraryService.updateTry(deviceLibraries);
}
});
}
//异步去查询数据库
executor.execute(
()->{
......@@ -851,4 +878,6 @@ public class StorageBillController {
return list;
}
}
......@@ -618,7 +618,7 @@ public class TaskServiceImpl implements TaskService {
}
return taskUserVos;
}
//办结 封存 全部 我发起的
//办结 4 封存 5 全部 0 我发起的 1
if (num == 4 || num == 5 || num == 1 || num == 0) {
//获取单位等级
Integer level = userUtils.getCurrentUnitLevel();
......
......@@ -12,7 +12,7 @@ import com.tykj.dev.device.apply.subject.vo.ApplyBillDetailVo;
import com.tykj.dev.device.apply.subject.vo.ReplyVo;
import com.tykj.dev.device.file.entity.FileRet;
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.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
......@@ -53,6 +53,7 @@ import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.toMap;
/**
......@@ -110,8 +111,8 @@ public class TaskSelectController {
@Autowired
private TaskDao taskDao;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
// @Autowired
// private DeviceLibraryDao deviceLibraryDao;
@ApiOperation(value = "查询业务对应页面的数据", notes = "可以通过这个接口查询业务对应页面的数据")
@GetMapping("/manage/detail/{id}")
......@@ -390,6 +391,17 @@ public class TaskSelectController {
for (int i = 0; i < packingIdList.size(); i++) {
PackingLibrary p = packingLibraryService.getOne(packingIdList.get(i));
ApplyBillDetailVo applyBillDetailVo = applyBillDetailVoMap.get(packingIdList.get(i));
//zsp 进行试用装备数量的显示 和序列号
//查询出所有的试用装备
List<DeviceLibrary> deviceLibraries = deviceLibraryService.findAllByPackingId(packingIdList.get(i));
if (deviceLibraries.size()>0){
deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> deviceLibrary.getTryOutDevice() == 1)
.collect(Collectors.toList());
p.setDeviceSeqNumberList(deviceLibraries.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList()));
}
// deviceLibraryList.addAll(deviceLibraries);
// List<String> stringList = deviceLibraries.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList());
//截止
if (deviceApplyBillEntity.getApplyType()==1) {
p.setApplyNum(numList.get(i));
if (statMap.size()>0){
......@@ -423,6 +435,8 @@ public class TaskSelectController {
}
}
list.add(packingLibraryEntityList);
//新增zsp
// list.add(deviceLibraryList);
list.add(deviceLibraryService.getAllotList(new DeviceLibrarySelectVo()).stream().filter(deviceLibraryEntity -> packingIdList.contains(deviceLibraryEntity.getPackingId())).sorted(Comparator.comparing(DeviceLibrary::getPackingId)).collect(Collectors.toList()));
List<Task> tasks = taskDao.findAllByParentTaskId(taskId);
List<DeviceLibrary> deviceLibraries = new ArrayList<>();
......@@ -440,6 +454,7 @@ public class TaskSelectController {
}
}
list.add(deviceLibraries);
return ResponseEntity.ok(new ResultObj(list, "查询成功"));
default:
throw new ApiException(ResultUtil.failed("该接口不支持当前task业务类型"));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论