提交 f5e74b08 authored 作者: zjm's avatar zjm

Dev

上级 15a2b48e
...@@ -56,6 +56,7 @@ public class BatchAllotController { ...@@ -56,6 +56,7 @@ public class BatchAllotController {
else { else {
//任务id //任务id
List<String> taskIds = new ArrayList<>(); List<String> taskIds = new ArrayList<>();
List<Integer> taskId2s = new ArrayList<>();
//批量保存草稿 //批量保存草稿
// allotBillSaveVoList.forEach(allotBillSaveVo -> { // allotBillSaveVoList.forEach(allotBillSaveVo -> {
// String s = (String)allotBillController.saveAllotBill(allotBillSaveVo).getBody(); // String s = (String)allotBillController.saveAllotBill(allotBillSaveVo).getBody();
...@@ -63,13 +64,14 @@ public class BatchAllotController { ...@@ -63,13 +64,14 @@ public class BatchAllotController {
// }); // });
for (AllotBillSaveVo allotBillSaveVo : allotBillSaveVoList) { for (AllotBillSaveVo allotBillSaveVo : allotBillSaveVoList) {
String s = (String)allotBillController.saveAllotBill(allotBillSaveVo).getBody(); String s = (String)allotBillController.saveAllotBill(allotBillSaveVo).getBody();
taskId2s.add(Integer.valueOf(s.substring(4)));
String newS = s.substring(4); String newS = s.substring(4);
String receiveUnit = allotBillSaveVo.getReceiveUnit(); String receiveUnit = allotBillSaveVo.getReceiveUnit();
String taskId = newS+","+receiveUnit; String taskId = newS+","+receiveUnit;
taskIds.add(taskId); taskIds.add(taskId);
} }
//批量申请签章 //批量申请签章
// taskIds.forEach(integer -> allotBillController.applySign(integer,userId)); taskId2s.forEach(integer -> allotBillController.applySign(integer,userId));
for (String taskId : taskIds) { for (String taskId : taskIds) {
String[] strings = taskId.split(","); String[] strings = taskId.split(",");
//取出来taskId //取出来taskId
......
package com.tykj.dev.device.confirmcheck.controller; package com.tykj.dev.device.confirmcheck.controller;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.confirmcheck.common.CheckType; import com.tykj.dev.device.confirmcheck.common.CheckType;
import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetail; import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetail;
import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckStat; import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckStat;
import com.tykj.dev.device.confirmcheck.entity.vo.*; import com.tykj.dev.device.confirmcheck.entity.vo.*;
import com.tykj.dev.device.confirmcheck.repository.DeviceCheckBillDao;
import com.tykj.dev.device.confirmcheck.repository.DeviceCheckDetailDao; import com.tykj.dev.device.confirmcheck.repository.DeviceCheckDetailDao;
import com.tykj.dev.device.confirmcheck.repository.DeviceCheckLinkDao;
import com.tykj.dev.device.confirmcheck.repository.DeviceCheckStatDao; import com.tykj.dev.device.confirmcheck.repository.DeviceCheckStatDao;
import com.tykj.dev.device.confirmcheck.service.CheckUnitService; import com.tykj.dev.device.confirmcheck.service.CheckUnitService;
import com.tykj.dev.device.confirmcheck.service.ConfirmCheckService;
import com.tykj.dev.device.confirmcheck.service.EscrowService; import com.tykj.dev.device.confirmcheck.service.EscrowService;
import com.tykj.dev.device.confirmcheck.utils.ObjTransUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService; 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 com.tykj.dev.device.selfcheck.controller.SelfCheckController;
import com.tykj.dev.device.task.repository.TaskDao; import com.tykj.dev.device.task.repository.TaskDao;
import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService; import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto; import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.domin.Task; import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.base.enums.AuExample; import com.tykj.dev.device.user.base.enums.AuExample;
import com.tykj.dev.device.user.cache.AreaCache;
import com.tykj.dev.device.user.cache.AreaExhibitionCache; import com.tykj.dev.device.user.cache.AreaExhibitionCache;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.subject.dao.AreaDao;
import com.tykj.dev.device.user.subject.dao.UnitsDao; import com.tykj.dev.device.user.subject.dao.UnitsDao;
import com.tykj.dev.device.user.subject.entity.Units; import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.entity.bto.AreaUnit;
import com.tykj.dev.device.user.subject.service.AuService; import com.tykj.dev.device.user.subject.service.AuService;
import com.tykj.dev.device.user.subject.service.UnitsService; import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.device.user.subject.service.UserService;
import com.tykj.dev.device.user.util.AuthenticationUtils; import com.tykj.dev.device.user.util.AuthenticationUtils;
import com.tykj.dev.misc.base.ResultObj; import com.tykj.dev.misc.base.ResultObj;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.socket.MyWebSocket;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -50,7 +34,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -50,7 +34,6 @@ import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
import java.util.*; import java.util.*;
import java.util.function.Function;
import static com.tykj.dev.misc.base.BusinessEnum.CONFIRM_CHECK_DETAIL; import static com.tykj.dev.misc.base.BusinessEnum.CONFIRM_CHECK_DETAIL;
import static com.tykj.dev.misc.base.BusinessEnum.CONFIRM_CHECK_STAT; import static com.tykj.dev.misc.base.BusinessEnum.CONFIRM_CHECK_STAT;
...@@ -125,13 +108,19 @@ public class ExamController { ...@@ -125,13 +108,19 @@ public class ExamController {
@PostMapping("/confirm/checkPossible") @PostMapping("/confirm/checkPossible")
public ResponseEntity checkPossible(@RequestBody UnitIds unitIds, @RequestParam(defaultValue = "false") boolean isExam) { public ResponseEntity checkPossible(@RequestBody UnitIds unitIds, @RequestParam(defaultValue = "false") boolean isExam) {
boolean tag = false;
if (!isExam) { if (!isExam) {
// 核查 // 核查
List<Units> rs = new ArrayList<>(); List<Units> rs = new ArrayList<>();
rs.addAll(unitsRepo.findAllById(checkUnitService.findUnExistDevice(unitIds.getIds()))); List<Integer> unExistDevice1 = checkUnitService.findUnExistDevice(unitIds.getIds());
rs.addAll(unitsRepo.findAllById(unExistDevice1));
List<Integer> collect = unitsRepo.findAllById(unitIds.getIds()).stream().filter(o -> o.getLevel() == 2).map(Units::getUnitId).collect(toList()); List<Integer> collect = unitsRepo.findAllById(unitIds.getIds()).stream().filter(o -> o.getLevel() == 2).map(Units::getUnitId).collect(toList());
log.info("[check] 获取核查单位,{}", collect); log.info("[check] 获取核查单位,{}", collect);
if (unExistDevice1.size() < unitIds.getIds().size()) {
tag = true;
}
if (!collect.isEmpty()) { if (!collect.isEmpty()) {
for (Integer integer : collect) { for (Integer integer : collect) {
List<Units> bySubordinateAll = unitsService.findBySubordinateAll(integer); List<Units> bySubordinateAll = unitsService.findBySubordinateAll(integer);
...@@ -139,13 +128,27 @@ public class ExamController { ...@@ -139,13 +128,27 @@ public class ExamController {
List<Integer> unExistDevice = checkUnitService.findUnExistDevice(bySubordinateAll.stream().map(Units::getUnitId).collect(toList())); List<Integer> unExistDevice = checkUnitService.findUnExistDevice(bySubordinateAll.stream().map(Units::getUnitId).collect(toList()));
log.info("[check] 市级无装备的单位:{}", unExistDevice); log.info("[check] 市级无装备的单位:{}", unExistDevice);
rs.addAll(unitsRepo.findAllById(unExistDevice)); rs.addAll(unitsRepo.findAllById(unExistDevice));
if (unExistDevice.size() < bySubordinateAll.size()) {
tag = true;
}
} }
} }
return ResponseEntity.ok(rs.stream().distinct().collect(toList())); return ResponseEntity.ok(CheckPossibleVO.builder()
.tag(tag)
.units(rs.stream().distinct().collect(toList()))
.build());
} else { } else {
// 检查 // 检查
List<Units> units = unitsRepo.findAllById(checkUnitService.findUnExistDevice(unitIds.getIds())); List<Units> units = unitsRepo.findAllById(checkUnitService.findUnExistDevice(unitIds.getIds()));
return ResponseEntity.ok(units);
if (units.size() < unitIds.getIds().size()) {
tag = true;
}
return ResponseEntity.ok(CheckPossibleVO.builder()
.tag(tag)
.units(units)
.build());
} }
} }
......
package com.tykj.dev.device.confirmcheck.entity.vo;
import com.tykj.dev.device.user.subject.entity.Units;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author: cnljj1995@gmail.com
* @Date: 2022/3/2
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CheckPossibleVO {
private boolean tag;
private List<Units> units;
}
...@@ -14,6 +14,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition; ...@@ -14,6 +14,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
import com.tykj.dev.device.library.subject.domin.DeviceLog; import com.tykj.dev.device.library.subject.domin.DeviceLog;
import com.tykj.dev.device.library.subject.model.vo.QueryNotOnVo; import com.tykj.dev.device.library.subject.model.vo.QueryNotOnVo;
import com.tykj.dev.device.library.subject.model.vo.QueryTheWarehouseVo; import com.tykj.dev.device.library.subject.model.vo.QueryTheWarehouseVo;
import com.tykj.dev.device.library.subject.model.vo.UpdateXyzVo;
import com.tykj.dev.device.library.subject.vo.*; import com.tykj.dev.device.library.subject.vo.*;
import com.tykj.dev.device.user.cache.StoreCache; import com.tykj.dev.device.user.cache.StoreCache;
import com.tykj.dev.device.user.cache.UnitsCache; import com.tykj.dev.device.user.cache.UnitsCache;
...@@ -23,10 +24,7 @@ import com.tykj.dev.device.user.subject.service.UnitsService; ...@@ -23,10 +24,7 @@ import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
//import com.tykj.dev.misc.base.DeviceLifeStatus; //import com.tykj.dev.misc.base.DeviceLifeStatus;
import com.tykj.dev.misc.exception.ApiException; import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.DeviceModelSort; import com.tykj.dev.misc.utils.*;
import com.tykj.dev.misc.utils.GetTreeUtils;
import com.tykj.dev.misc.utils.PageUtil;
import com.tykj.dev.misc.utils.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.Synchronized; import lombok.Synchronized;
...@@ -96,8 +94,8 @@ public class DeviceLibraryController { ...@@ -96,8 +94,8 @@ public class DeviceLibraryController {
@Resource @Resource
private StoreCache storeCache; private StoreCache storeCache;
// @Resource @Resource
// private DeviceLibraryPositionService deviceLibraryPositionService; private DeviceLibraryPositionService deviceLibraryPositionService;
@ApiOperation(value = "修改装备备注", notes = "修改装备备注") @ApiOperation(value = "修改装备备注", notes = "修改装备备注")
@PostMapping("/setRecord") @PostMapping("/setRecord")
...@@ -820,9 +818,31 @@ public class DeviceLibraryController { ...@@ -820,9 +818,31 @@ public class DeviceLibraryController {
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setStorageLocation(libraryUpdateVo.getStorageLocation()); deviceLibraryEntity.setStorageLocation(libraryUpdateVo.getStorageLocation());
deviceLibraryEntity.setStorageLocationId(libraryUpdateVo.getStorageLocationId()); deviceLibraryEntity.setStorageLocationId(libraryUpdateVo.getStorageLocationId());
//从而修改3D的库房位置 //如果库房位置发生改变需要对3D中的位置信息重置
// deviceLibraryPositionService.onlyUpdateStorageLocation(libraryUpdateVo.getStorageLocationId(), Integer deviceId = deviceEditVo.getDeviceId();
// libraryUpdateVo.getStorageLocation(), libraryUpdateVo.getDeviceId()); DeviceLibraryPosition position = deviceLibraryPositionService.findByDeviceId(deviceId);
position.setDeviceId(deviceId);
position.setIfCabinet(0);
position.setCabinetPosition(null);
position.setUNum(null);
position.setDeviceLibraryPositionName(null);
RotationVo rotationVo = JacksonUtil.readValue(position.getRotation(), RotationVo.class);
if(rotationVo != null){
rotationVo.setX(null);
rotationVo.setY(null);
rotationVo.setZ(null);
}
DeviceLibraryPositionMessageVo messageVo =
JacksonUtil.readValue(position.getDeviceLibraryPositionMessage(),
DeviceLibraryPositionMessageVo.class);
if (messageVo != null){
messageVo.setX(null);
messageVo.setY(null);
messageVo.setZ(null);
position.setDeviceLibraryPositionMessage(messageVo.toJson());
position.setRotation(messageVo.toJson());
}
deviceLibraryPositionService.updateXyz(position);
} }
//add 备注 //add 备注
if (libraryUpdateVo.getRecord()!=null && !libraryUpdateVo.getRecord().equals(deviceLibraryEntity.getRecord())){ if (libraryUpdateVo.getRecord()!=null && !libraryUpdateVo.getRecord().equals(deviceLibraryEntity.getRecord())){
......
...@@ -22,7 +22,7 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos ...@@ -22,7 +22,7 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos
void deleteByDeviceId(Integer deviceId); void deleteByDeviceId(Integer deviceId);
@Transactional @Transactional(rollbackOn = Exception.class)
@Modifying @Modifying
@Query("update DeviceLibraryPosition d set d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage, " + @Query("update DeviceLibraryPosition d set d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage, " +
"d.uNum = :uNum where d.deviceId = :deviceId") "d.uNum = :uNum where d.deviceId = :deviceId")
...@@ -30,7 +30,7 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos ...@@ -30,7 +30,7 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos
@Param("uNum") String uNum, @Param("uNum") String uNum,
@Param("deviceId")Integer deviceId); @Param("deviceId")Integer deviceId);
@Transactional @Transactional(rollbackOn = Exception.class)
@Modifying @Modifying
@Query("update DeviceLibraryPosition d set d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage, " + @Query("update DeviceLibraryPosition d set d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage, " +
"d.rotation = :rotation,d.uNum = :uNum ,d.cabinetPosition = null ,d.ifCabinet =0 where d.deviceId in :deviceIds") "d.rotation = :rotation,d.uNum = :uNum ,d.cabinetPosition = null ,d.ifCabinet =0 where d.deviceId in :deviceIds")
...@@ -39,5 +39,16 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos ...@@ -39,5 +39,16 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos
@Param("uNum") String uNum, @Param("uNum") String uNum,
@Param("deviceIds")List<Integer> deviceIds); @Param("deviceIds")List<Integer> deviceIds);
// @Transactional(rollbackOn = Exception.class)
// @Modifying
// @Query("update DeviceLibraryPosition d set d.ifCabinet = :ifCabinet,d.cabinetPosition = :cabinetPosition " +
// ",d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage ,d.rotation = :rotation where d.deviceId = :deviceId")
// int updateXyz(@Param("ifCabinet") Integer ifCabinet,
// @Param("cabinetPosition") Integer cabinetPosition,
// @Param("deviceLibraryPositionMessage") String deviceLibraryPositionMessage,
// @Param("rotation") String rotation,
// @Param("deviceId")Integer deviceId);
} }
...@@ -2,6 +2,7 @@ package com.tykj.dev.device.library.service; ...@@ -2,6 +2,7 @@ package com.tykj.dev.device.library.service;
import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition; import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO; import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO;
import com.tykj.dev.device.library.subject.model.vo.UpdateXyzVo;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -72,4 +73,7 @@ public interface DeviceLibraryPositionService { ...@@ -72,4 +73,7 @@ public interface DeviceLibraryPositionService {
List<DeviceLibraryPosition> findAll(); List<DeviceLibraryPosition> findAll();
void updateXyz(DeviceLibraryPosition deviceLibraryPosition);
} }
...@@ -6,6 +6,7 @@ import com.tykj.dev.device.library.repository.DeviceLibraryPositionDao; ...@@ -6,6 +6,7 @@ import com.tykj.dev.device.library.repository.DeviceLibraryPositionDao;
import com.tykj.dev.device.library.service.DeviceLibraryPositionService; import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition; import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO; import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO;
import com.tykj.dev.device.library.subject.model.vo.UpdateXyzVo;
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.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -101,4 +102,10 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe ...@@ -101,4 +102,10 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
return deviceLibraryPositionList; return deviceLibraryPositionList;
} }
@Override
public void updateXyz(DeviceLibraryPosition deviceLibraryPosition) {
deviceLibraryPositionDao.save(deviceLibraryPosition);
}
} }
...@@ -52,6 +52,7 @@ import java.lang.reflect.Field; ...@@ -52,6 +52,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -1192,16 +1193,13 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1192,16 +1193,13 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
if (!CollectionUtils.isEmpty(deviceIds)){ if (!CollectionUtils.isEmpty(deviceIds)){
//添加装备日志 //添加装备日志
deviceIds.forEach(integer -> { deviceIds.forEach(integer -> {
// if (updateStorageLocationVo.getStorageLocationId() != (getOne(integer).getStorageLocationId())){
// DeviceLogDto deviceLogDto= new DeviceLogDto(integer,"将存放位置修改为"+
// updateStorageLocationVo.getStorageLocation(),null,userId);
// deviceLogDtos.add(deviceLogDto);
// }});
Integer storageLocationId = updateStorageLocationVo.getStorageLocationId(); Integer storageLocationId = updateStorageLocationVo.getStorageLocationId();
//数据库中的库房id
Integer dataStorageLocationId = getOne(integer).getStorageLocationId(); Integer dataStorageLocationId = getOne(integer).getStorageLocationId();
if (storageLocationId == null ? dataStorageLocationId == null : storageLocationId.equals(dataStorageLocationId)){ if (!storageLocationId.equals(dataStorageLocationId)){
String remark = updateStorageLocationVo.getStorageLocation() == null ? "空":updateStorageLocationVo.getStorageLocation();
DeviceLogDto deviceLogDto= new DeviceLogDto(integer,"将存放位置修改为"+ DeviceLogDto deviceLogDto= new DeviceLogDto(integer,"将存放位置修改为"+
updateStorageLocationVo.getStorageLocation(),null,userId); remark,null,userId);
deviceLogDtos.add(deviceLogDto); deviceLogDtos.add(deviceLogDto);
}}); }});
...@@ -1211,15 +1209,41 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1211,15 +1209,41 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
deviceLibraryDao.updateStorageLocation(updateStorageLocationVo.getStorageLocation(), deviceLibraryDao.updateStorageLocation(updateStorageLocationVo.getStorageLocation(),
updateStorageLocationVo.getStorageLocationId(),updateStorageLocationVo.getDeviceIds()); updateStorageLocationVo.getStorageLocationId(),updateStorageLocationVo.getDeviceIds());
//修改3d的部分字段 //修改3d的部分字段
DeviceLibraryPositionMessageVo deviceLibraryPositionMessageVo = new DeviceLibraryPositionMessageVo(); // DeviceLibraryPositionMessageVo deviceLibraryPositionMessageVo = new DeviceLibraryPositionMessageVo();
UpdatePostionMessageVO updatePostionMessageVO = new UpdatePostionMessageVO(); // UpdatePostionMessageVO updatePostionMessageVO = new UpdatePostionMessageVO();
updatePostionMessageVO.setDeviceLibraryPositionMessageVo(deviceLibraryPositionMessageVo); // updatePostionMessageVO.setDeviceLibraryPositionMessageVo(deviceLibraryPositionMessageVo);
RotationVo rotationVo = new RotationVo(); // RotationVo rotationVo = new RotationVo();
updatePostionMessageVO.setRotationVo(rotationVo); // updatePostionMessageVO.setRotationVo(rotationVo);
updatePostionMessageVO.setDeviceIds(updateStorageLocationVo.getDeviceIds()); // updatePostionMessageVO.setDeviceIds(updateStorageLocationVo.getDeviceIds());
updatePostionMessageVO.setUNum(null); // updatePostionMessageVO.setUNum(null);
//
deviceLibraryPositionService.fnUpdatePostionMessageList(updatePostionMessageVO); // deviceLibraryPositionService.fnUpdatePostionMessageList(updatePostionMessageVO);
CompletableFuture.runAsync(()->{
deviceIds.forEach(deviceId->{
DeviceLibraryPosition position = deviceLibraryPositionService.findByDeviceId(deviceId);
position.setDeviceId(deviceId);
position.setIfCabinet(0);
position.setCabinetPosition(null);
position.setUNum(null);
position.setDeviceLibraryPositionName(null);
RotationVo rotationVo = JacksonUtil.readValue(position.getRotation(), RotationVo.class);
assert rotationVo != null;
rotationVo.setX(null);
rotationVo.setY(null);
rotationVo.setZ(null);
DeviceLibraryPositionMessageVo messageVo =
JacksonUtil.readValue(position.getDeviceLibraryPositionMessage(),
DeviceLibraryPositionMessageVo.class);
assert messageVo != null;
messageVo.setX(null);
messageVo.setY(null);
messageVo.setZ(null);
position.setDeviceLibraryPositionMessage(messageVo.toJson());
position.setRotation(messageVo.toJson());
deviceLibraryPositionService.updateXyz(position);
});
});
CompletableFuture.runAsync(()->{ CompletableFuture.runAsync(()->{
deviceLogService.addAllLog(deviceLogDtos); deviceLogService.addAllLog(deviceLogDtos);
}); });
...@@ -1316,7 +1340,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1316,7 +1340,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
//报废 退役 销毁 丢失 //报废 退役 销毁 丢失
List<Integer> status = new ArrayList<>(Arrays.asList(5,10,11,12)); List<Integer> status = new ArrayList<>(Arrays.asList(5,10,11,12));
// deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> !status.contains(deviceLibrary.getLifeStatus()) && deviceLibrary.getIsPart() == 0).collect(Collectors.toList()); // deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> !status.contains(deviceLibrary.getLifeStatus()) && deviceLibrary.getIsPart() == 0).collect(Collectors.toList());
deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> !status.contains(deviceLibrary.getLifeStatus()) && deviceLibrary.getType() == 1).collect(Collectors.toList()); deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> !status.contains(deviceLibrary.getLifeStatus())
&& deviceLibrary.getType() == 1 && deviceLibrary.getIsPart() == 0).collect(Collectors.toList());
deviceLibraries.forEach(DeviceLibrary::setConfigName); deviceLibraries.forEach(DeviceLibrary::setConfigName);
stopWatch.stop(); stopWatch.stop();
log.info("条件查询结果集时间为:{}",stopWatch.getTotalTimeSeconds()); log.info("条件查询结果集时间为:{}",stopWatch.getTotalTimeSeconds());
...@@ -1515,7 +1540,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1515,7 +1540,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
List<DeviceLibraryPosition> deviceLibraryPositions = new ArrayList<>(); List<DeviceLibraryPosition> deviceLibraryPositions = new ArrayList<>();
List<Integer> status = new ArrayList<>(Arrays.asList(5,10,11,12)); List<Integer> status = new ArrayList<>(Arrays.asList(5,10,11,12));
deviceLibraryList.forEach(deviceLibrary -> { deviceLibraryList.forEach(deviceLibrary -> {
if (deviceLibrary.getIsPart()==0 && !status.contains(deviceLibrary.getLifeStatus())) { if (deviceLibrary.getIsPart()==0 && !status.contains(deviceLibrary.getLifeStatus())&& deviceLibrary.getType() == 1) {
DeviceLibraryPosition deviceLibraryPosition = new DeviceLibraryPosition(); DeviceLibraryPosition deviceLibraryPosition = new DeviceLibraryPosition();
deviceLibraryPosition.setDeviceId(deviceLibrary.getId()); deviceLibraryPosition.setDeviceId(deviceLibrary.getId());
deviceLibraryPositions.add(deviceLibraryPosition); deviceLibraryPositions.add(deviceLibraryPosition);
......
...@@ -25,8 +25,8 @@ public class QueryTheWarehouseVo extends CustomPage { ...@@ -25,8 +25,8 @@ public class QueryTheWarehouseVo extends CustomPage {
@ApiModelProperty(value = "装备序列号", example = "123-1") @ApiModelProperty(value = "装备序列号", example = "123-1")
public String seqNumber; public String seqNumber;
@ApiModelProperty(value = "当前库房的id 我会取反操作") // @ApiModelProperty(value = "当前库房的id 我会取反操作")
private List<Integer> storageLocationIds; // private List<Integer> storageLocationIds;
@ApiModelProperty(value = "所属单位") @ApiModelProperty(value = "所属单位")
public String ownUnit; public String ownUnit;
...@@ -41,5 +41,5 @@ public class QueryTheWarehouseVo extends CustomPage { ...@@ -41,5 +41,5 @@ public class QueryTheWarehouseVo extends CustomPage {
// private Integer nonStorageLocationId; // private Integer nonStorageLocationId;
@ApiModelProperty(value = "库房id的集合") @ApiModelProperty(value = "库房id的集合")
private List<Integer> StorageLocationIds; private List<Integer> storageLocationIds;
} }
package com.tykj.dev.device.library.subject.model.vo;
import com.tykj.dev.device.library.subject.vo.DeviceLibraryPositionMessageVo;
import com.tykj.dev.device.library.subject.vo.RotationVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* @author zsp
* @create 2021/12/30 13:05
*/
@Data
@ApiModel("修改3D位置vo")
@AllArgsConstructor
public class UpdateXyzVo {
@ApiModelProperty(value = "是否在机柜中 ",notes = "0 不在 1 在")
private Integer ifCabinet = 0;
@ApiModelProperty(value = "在几号机柜里",notes = "1")
private Integer cabinetPosition;
@ApiModelProperty(value = "位置信息",notes = "{x, y, z}")
private RotationVo rotationVo;
@ApiModelProperty(value = "位置信息vo",notes = "{x, y, z}")
private DeviceLibraryPositionMessageVo deviceLibraryPositionMessageVo;
@ApiModelProperty(value = "装备id")
private Integer deviceId;
}
...@@ -608,7 +608,7 @@ public class RepairController { ...@@ -608,7 +608,7 @@ public class RepairController {
// DeviceLogDto deviceLogDto = new DeviceLogDto(d.getDeviceId(), "向" + repairBillSaveVo.getReceiveUnit() + "发起装备维修", null, null); // DeviceLogDto deviceLogDto = new DeviceLogDto(d.getDeviceId(), "向" + repairBillSaveVo.getReceiveUnit() + "发起装备维修", null, null);
// DeviceLogDto deviceLogDto = new DeviceLogDto(d.getDeviceId(), "向" + repairBillSaveVo.getReceiveUnit() + "发起装备维修", null, null); // DeviceLogDto deviceLogDto = new DeviceLogDto(d.getDeviceId(), "向" + repairBillSaveVo.getReceiveUnit() + "发起装备维修", null, null);
DeviceLogDto deviceLogDto; DeviceLogDto deviceLogDto;
if (repairBillSaveVo.getLeftSignatureId() != null && "".equals(repairBillSaveVo.getLeftSignatureId())){ if (repairBillSaveVo.getLeftSignatureId() != null && !"".equals(repairBillSaveVo.getLeftSignatureId())){
//说明是签章出库 //说明是签章出库
deviceLogDto = new DeviceLogDto(d.getDeviceId(), "向" + repairBillSaveVo.getReceiveUnit() + "发起装备维修(签章出库)", null, null,saveEntity.getId()); deviceLogDto = new DeviceLogDto(d.getDeviceId(), "向" + repairBillSaveVo.getReceiveUnit() + "发起装备维修(签章出库)", null, null,saveEntity.getId());
}else { }else {
...@@ -1593,10 +1593,12 @@ public class RepairController { ...@@ -1593,10 +1593,12 @@ public class RepairController {
//各单位阅知map //各单位阅知map
Map<Integer, List<Integer>> messageMap = new HashMap<>(); Map<Integer, List<Integer>> messageMap = new HashMap<>();
// List<DeviceLibrary> deviceLibraries = new ArrayList<>(); // List<DeviceLibrary> deviceLibraries = new ArrayList<>();
Integer unitId1 = userUtils.getCurrentUnitId();
for (Integer id : repairStatusChangeVo.getId()) { for (Integer id : repairStatusChangeVo.getId()) {
//获取维修详情单 //获取维修详情单
RepairDetail repairDetail1 = deviceRepairDetailService.getOne(id); RepairDetail repairDetail1 = deviceRepairDetailService.getOne(id);
if (repairDetail1.getDeviceRepairBillId() == 0) { // if (repairDetail1.getDeviceRepairBillId() == 0) {
if (repairDetail1.getOwnUnitId().equals(unitId1)) {
//已领取入库(本级) //已领取入库(本级)
repairDetail1.setRepairStatus(5); repairDetail1.setRepairStatus(5);
deviceRepairDetailService.update(repairDetail1); deviceRepairDetailService.update(repairDetail1);
......
...@@ -544,8 +544,12 @@ public class StatisticalServiceImpl implements StatisticalService { ...@@ -544,8 +544,12 @@ public class StatisticalServiceImpl implements StatisticalService {
}else { }else {
workBench.setMatchingDeviceNum(0); workBench.setMatchingDeviceNum(0);
} }
// workBench.setDailyDeviceNum(Long.valueOf(deviceLibraries.stream().filter(deviceLibrary ->
// deviceLibrary.getOwnUnit().equals(unitName)&&Arrays.asList(2,14).contains(deviceLibrary.getLifeStatus()))
// .count()).intValue());
List<Integer> status = new ArrayList<>(Arrays.asList(5,10,12));
workBench.setDailyDeviceNum(Long.valueOf(deviceLibraries.stream().filter(deviceLibrary -> workBench.setDailyDeviceNum(Long.valueOf(deviceLibraries.stream().filter(deviceLibrary ->
deviceLibrary.getOwnUnit().equals(unitName)&&Arrays.asList(2,14).contains(deviceLibrary.getLifeStatus())) deviceLibrary.getOwnUnit().equals(unitName)&& !status.contains(deviceLibrary.getLifeStatus()))
.count()).intValue()); .count()).intValue());
List<Task> allTasks = taskDao.findAll(); List<Task> allTasks = taskDao.findAll();
......
...@@ -918,7 +918,8 @@ public class StorageBillController { ...@@ -918,7 +918,8 @@ public class StorageBillController {
List<DeviceLibraryPosition> deviceLibraryPositions = new ArrayList<>(); List<DeviceLibraryPosition> deviceLibraryPositions = new ArrayList<>();
//开始存储装备的3D 修改需求 只渲染类型是密码机的设备 密码机的类型为1 //开始存储装备的3D 修改需求 只渲染类型是密码机的设备 密码机的类型为1
// saveDevices = saveDevices.stream().filter(deviceLibrary -> deviceLibrary.getIsPart() == 0).collect(Collectors.toList()); // saveDevices = saveDevices.stream().filter(deviceLibrary -> deviceLibrary.getIsPart() == 0).collect(Collectors.toList());
saveDevices = saveDevices.stream().filter(deviceLibrary -> deviceLibrary.getType() == 1).collect(Collectors.toList()); saveDevices = saveDevices.stream().filter(deviceLibrary -> deviceLibrary.getType() == 1
&& deviceLibrary.getIsPart() == 0).collect(Collectors.toList());
saveDevices.forEach(deviceLibrary -> { saveDevices.forEach(deviceLibrary -> {
DeviceLibraryPosition deviceLibraryPosition = new DeviceLibraryPosition(); DeviceLibraryPosition deviceLibraryPosition = new DeviceLibraryPosition();
deviceLibraryPosition.setDeviceId(deviceLibrary.getId()); deviceLibraryPosition.setDeviceId(deviceLibrary.getId());
......
...@@ -31,8 +31,17 @@ public class GroupServiceImpl implements GroupService { ...@@ -31,8 +31,17 @@ public class GroupServiceImpl implements GroupService {
UnitsService unitsService; UnitsService unitsService;
@Override @Override
public void saveGroup(Groups group) { public void saveGroup(Groups group) {
if (groupDao.existsByName(group.getName())){ if (group.getId()==null) {
throw new ApiException(ResponseEntity.status(20020).body("组名称重复")); if (groupDao.existsByName(group.getName())) {
throw new ApiException(ResponseEntity.status(20020).body("组名称重复"));
}
}else {
Groups byId = findById(group.getId());
if (!byId.getName().equals(group.getName())){
if (groupDao.existsByName(group.getName())) {
throw new ApiException(ResponseEntity.status(20020).body("组名称重复"));
}
}
} }
StringBuffer stringBuffer=new StringBuffer(); StringBuffer stringBuffer=new StringBuffer();
group.getMembers().forEach( group.getMembers().forEach(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论