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

feat(装备模块,3D模块,配发模块,维修模块): 修改接口,以及增加接口

修改接口,以及增加接口
上级 eca84b10
...@@ -9,7 +9,6 @@ import com.tykj.dev.device.allot.subject.domin.AllotBill; ...@@ -9,7 +9,6 @@ import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.allot.subject.vo.*; import com.tykj.dev.device.allot.subject.vo.*;
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.DeviceLibraryPositionService;
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;
...@@ -135,9 +134,6 @@ public class AllotBillController { ...@@ -135,9 +134,6 @@ public class AllotBillController {
@Resource @Resource
private UnitsCache unitsCache; private UnitsCache unitsCache;
@Resource
private DeviceLibraryPositionService deviceLibraryPositionService;
@ApiOperation(value = "导入二维码获取配发装备", notes = "可以通过这个接口导入二维码获取配发装备") @ApiOperation(value = "导入二维码获取配发装备", notes = "可以通过这个接口导入二维码获取配发装备")
@PostMapping(value = "/load") @PostMapping(value = "/load")
public ResponseEntity loadDevice(@RequestBody RfidVo rfidVo) { public ResponseEntity loadDevice(@RequestBody RfidVo rfidVo) {
...@@ -543,7 +539,7 @@ public class AllotBillController { ...@@ -543,7 +539,7 @@ public class AllotBillController {
} }
//修改3D的存放位置 //修改3D的存放位置
deviceLibraryPositionService.batchUpdateStorageLocation(null,null,deviceIds); // deviceLibraryPositionService.batchUpdateStorageLocation(null,null,deviceIds);
} }
//发送阅知信息 //发送阅知信息
List<Integer> ids = userPublicService.findOtherUser(userId); List<Integer> ids = userPublicService.findOtherUser(userId);
...@@ -900,7 +896,7 @@ public class AllotBillController { ...@@ -900,7 +896,7 @@ public class AllotBillController {
deviceLibraryService.update(deviceLibrary); deviceLibraryService.update(deviceLibrary);
}); });
//修改3D的库房 //修改3D的库房
deviceLibraryPositionService.batchUpdateStorageLocation(null,null,ids); // deviceLibraryPositionService.batchUpdateStorageLocation(null,null,ids);
//经办人阅知 //经办人阅知
// if (idList.size()>0) { // if (idList.size()>0) {
// MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为经办人", idList, 1); // MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为经办人", idList, 1);
......
...@@ -10,7 +10,6 @@ import com.tykj.dev.device.allot.subject.vo.AllotBackReceiveVo; ...@@ -10,7 +10,6 @@ import com.tykj.dev.device.allot.subject.vo.AllotBackReceiveVo;
import com.tykj.dev.device.allot.subject.vo.AllotBillSaveVo; import com.tykj.dev.device.allot.subject.vo.AllotBillSaveVo;
import com.tykj.dev.device.allot.subject.vo.FileUploadVo; import com.tykj.dev.device.allot.subject.vo.FileUploadVo;
import com.tykj.dev.device.file.service.FilesUtil; import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
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;
...@@ -99,8 +98,6 @@ public class BackController { ...@@ -99,8 +98,6 @@ public class BackController {
@Resource @Resource
private UnitsCache unitsCache; private UnitsCache unitsCache;
@Resource
private DeviceLibraryPositionService deviceLibraryPositionService;
@ApiOperation(value = "发起退回业务", notes = "可以通过这个接口发起退回任务") @ApiOperation(value = "发起退回业务", notes = "可以通过这个接口发起退回任务")
@PostMapping(value = "/addBackBill") @PostMapping(value = "/addBackBill")
...@@ -360,7 +357,7 @@ public class BackController { ...@@ -360,7 +357,7 @@ public class BackController {
} }
} }
//修改3D //修改3D
deviceLibraryPositionService.batchUpdateStorageLocation(null,null,deviceIds); // deviceLibraryPositionService.batchUpdateStorageLocation(null,null,deviceIds);
//发送阅知信息 //发送阅知信息
List<Integer> ids = userPublicService.findOtherUser(userId); List<Integer> ids = userPublicService.findOtherUser(userId);
// ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBackBill.getSendUnit())).stream() // ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBackBill.getSendUnit())).stream()
...@@ -531,7 +528,7 @@ public class BackController { ...@@ -531,7 +528,7 @@ public class BackController {
deviceLibraryService.update(deviceLibrary); deviceLibraryService.update(deviceLibrary);
}); });
//修改3D //修改3D
deviceLibraryPositionService.batchUpdateStorageLocation(null,null,ids); // deviceLibraryPositionService.batchUpdateStorageLocation(null,null,ids);
//经办人阅知 //经办人阅知
// if (idList.size()>0) { // if (idList.size()>0) {
......
...@@ -10,7 +10,7 @@ import com.tykj.dev.device.decommissioning.service.DeviceDecommissioningBusiness ...@@ -10,7 +10,7 @@ import com.tykj.dev.device.decommissioning.service.DeviceDecommissioningBusiness
import com.tykj.dev.device.decommissioning.service.DeviceDecommissioningDetailService; import com.tykj.dev.device.decommissioning.service.DeviceDecommissioningDetailService;
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.DeviceLibraryPositionService; //import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
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;
...@@ -77,8 +77,8 @@ public class DeviceDecommissioningBusinessServiceImpl implements DeviceDecommiss ...@@ -77,8 +77,8 @@ public class DeviceDecommissioningBusinessServiceImpl implements DeviceDecommiss
@Autowired @Autowired
DeviceApplyBillService deviceApplyBillService; DeviceApplyBillService deviceApplyBillService;
@Autowired // @Autowired
DeviceLibraryPositionService deviceLibraryPositionService; // DeviceLibraryPositionService deviceLibraryPositionService;
@Override @Override
public TaskBto saveDeviceDecommissioningDraft(Integer userId, DecommissioningOrderOutData decommissioningOrderOutData) { public TaskBto saveDeviceDecommissioningDraft(Integer userId, DecommissioningOrderOutData decommissioningOrderOutData) {
...@@ -250,7 +250,7 @@ public class DeviceDecommissioningBusinessServiceImpl implements DeviceDecommiss ...@@ -250,7 +250,7 @@ public class DeviceDecommissioningBusinessServiceImpl implements DeviceDecommiss
deviceLibraryService.upDateSeqNumbersLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.RETIRE.id,deviceDecommissioningDetail.getReceiveUnit(),0,seqNumbers); deviceLibraryService.upDateSeqNumbersLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.RETIRE.id,deviceDecommissioningDetail.getReceiveUnit(),0,seqNumbers);
//根据序列号获取id集合 在更新3d的信息 装备修改库房位置为空 todo //根据序列号获取id集合 在更新3d的信息 装备修改库房位置为空 todo
//修改3d库房位置 //修改3d库房位置
deviceLibraryPositionService.batchUpdateStorageLocationAndSeqNumList(null,null,seqNumbers); // deviceLibraryPositionService.batchUpdateStorageLocationAndSeqNumList(null,null,seqNumbers);
deviceDecommissioningDetailService.saveDeviceDecommissioningDetail(deviceDecommissioningDetail); deviceDecommissioningDetailService.saveDeviceDecommissioningDetail(deviceDecommissioningDetail);
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"退役任务回执单据上传成功任务结束",gainThisUser(user.getUserId(),user.getUnitsId()))); addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"退役任务回执单据上传成功任务结束",gainThisUser(user.getUserId(),user.getUnitsId())));
devLogAdd(seqNumbers,"办结退役任务:"+MessageFormatUtil.spellTwoWicket(deviceDecommissioningDetail.getSendUnit(),deviceDecommissioningDetail.getReceiveUnit()),storageDeviceDevommissiong.getUserId(),taskBto.getId()); devLogAdd(seqNumbers,"办结退役任务:"+MessageFormatUtil.spellTwoWicket(deviceDecommissioningDetail.getSendUnit(),deviceDecommissioningDetail.getReceiveUnit()),storageDeviceDevommissiong.getUserId(),taskBto.getId());
......
...@@ -8,7 +8,7 @@ import com.tykj.dev.device.destroy.service.DeviceDestroyBillService; ...@@ -8,7 +8,7 @@ import com.tykj.dev.device.destroy.service.DeviceDestroyBillService;
import com.tykj.dev.device.destroy.service.DeviceDestroyBusinessService; import com.tykj.dev.device.destroy.service.DeviceDestroyBusinessService;
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.DeviceLibraryPositionService; //import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
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;
...@@ -73,8 +73,8 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe ...@@ -73,8 +73,8 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe
@Autowired @Autowired
DeviceApplyBillService deviceApplyBillService; DeviceApplyBillService deviceApplyBillService;
@Autowired // @Autowired
DeviceLibraryPositionService deviceLibraryPositionService; // DeviceLibraryPositionService deviceLibraryPositionService;
@Override @Override
...@@ -188,7 +188,7 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe ...@@ -188,7 +188,7 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe
deviceDestroyBillService.saveDeviceDestroyBill(deviceDestroyBill); deviceDestroyBillService.saveDeviceDestroyBill(deviceDestroyBill);
deviceLibraryService.upDateSeqNumbersLeftStatusAndStorageLocationNull(DeviceLifeStatus.DESTROYED.id,seqNumbers); deviceLibraryService.upDateSeqNumbersLeftStatusAndStorageLocationNull(DeviceLifeStatus.DESTROYED.id,seqNumbers);
//修改3d数据的库房位置 置为null //修改3d数据的库房位置 置为null
deviceLibraryPositionService.batchUpdateStorageLocationAndSeqNumList(null,null,seqNumbers); // deviceLibraryPositionService.batchUpdateStorageLocationAndSeqNumList(null,null,seqNumbers);
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"销毁任务补充手续完成",gainThisUser(securityUser.getCurrentUserInfo().getUserId(),securityUser.getCurrentUserInfo().getUnitsId()))); addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"销毁任务补充手续完成",gainThisUser(securityUser.getCurrentUserInfo().getUserId(),securityUser.getCurrentUserInfo().getUnitsId())));
devLogAdd(seqNumbers,"补充单据信息,状态转化已销毁",deviceDestroyBillVo.getOperationId(),taskBto.getId()); devLogAdd(seqNumbers,"补充单据信息,状态转化已销毁",deviceDestroyBillVo.getOperationId(),taskBto.getId());
......
...@@ -78,7 +78,7 @@ public class DeviceLibraryController { ...@@ -78,7 +78,7 @@ public class DeviceLibraryController {
@Autowired @Autowired
private UserUtils userUtils; private UserUtils userUtils;
@Autowired @Resource
private ConfigCache configCache; private ConfigCache configCache;
@Autowired @Autowired
...@@ -91,8 +91,8 @@ public class DeviceLibraryController { ...@@ -91,8 +91,8 @@ public class DeviceLibraryController {
@Autowired @Autowired
private UnitsService unitsService; private UnitsService unitsService;
@Resource // @Resource
private DeviceLibraryPositionService deviceLibraryPositionService; // private DeviceLibraryPositionService deviceLibraryPositionService;
@ApiOperation(value = "修改装备备注", notes = "修改装备备注") @ApiOperation(value = "修改装备备注", notes = "修改装备备注")
@PostMapping("/setRecord") @PostMapping("/setRecord")
...@@ -759,7 +759,7 @@ public class DeviceLibraryController { ...@@ -759,7 +759,7 @@ public class DeviceLibraryController {
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setName(libraryUpdateVo.getName()); deviceLibraryEntity.setName(libraryUpdateVo.getName());
//修改3D //修改3D
deviceLibraryPositionService.updateName(libraryUpdateVo.getName(), libraryUpdateVo.getDeviceId()); // deviceLibraryPositionService.updateName(libraryUpdateVo.getName(), libraryUpdateVo.getDeviceId());
} }
if (libraryUpdateVo.getOwnUnit() != null && !libraryUpdateVo.getOwnUnit().equals(deviceLibraryEntity.getOwnUnit())) { if (libraryUpdateVo.getOwnUnit() != null && !libraryUpdateVo.getOwnUnit().equals(deviceLibraryEntity.getOwnUnit())) {
//添加装备日志 //添加装备日志
...@@ -788,7 +788,7 @@ public class DeviceLibraryController { ...@@ -788,7 +788,7 @@ public class DeviceLibraryController {
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setSeqNumber(libraryUpdateVo.getSeqNumber()); deviceLibraryEntity.setSeqNumber(libraryUpdateVo.getSeqNumber());
//修改3D //修改3D
deviceLibraryPositionService.updateSeqNumber(libraryUpdateVo.getSeqNumber(), libraryUpdateVo.getDeviceId()); // deviceLibraryPositionService.updateSeqNumber(libraryUpdateVo.getSeqNumber(), libraryUpdateVo.getDeviceId());
} }
} }
if (libraryUpdateVo.getStorageType() != null && !libraryUpdateVo.getStorageType().equals(deviceLibraryEntity.getStorageType())) { if (libraryUpdateVo.getStorageType() != null && !libraryUpdateVo.getStorageType().equals(deviceLibraryEntity.getStorageType())) {
...@@ -808,8 +808,8 @@ public class DeviceLibraryController { ...@@ -808,8 +808,8 @@ public class DeviceLibraryController {
deviceLibraryEntity.setStorageLocation(libraryUpdateVo.getStorageLocation()); deviceLibraryEntity.setStorageLocation(libraryUpdateVo.getStorageLocation());
deviceLibraryEntity.setStorageLocationId(libraryUpdateVo.getStorageLocationId()); deviceLibraryEntity.setStorageLocationId(libraryUpdateVo.getStorageLocationId());
//从而修改3D的库房位置 //从而修改3D的库房位置
deviceLibraryPositionService.onlyUpdateStorageLocation(libraryUpdateVo.getStorageLocationId(), // deviceLibraryPositionService.onlyUpdateStorageLocation(libraryUpdateVo.getStorageLocationId(),
libraryUpdateVo.getStorageLocation(), libraryUpdateVo.getDeviceId()); // libraryUpdateVo.getStorageLocation(), libraryUpdateVo.getDeviceId());
} }
//add 备注 //add 备注
if (libraryUpdateVo.getRecord()!=null && !libraryUpdateVo.getRecord().equals(deviceLibraryEntity.getRecord())){ if (libraryUpdateVo.getRecord()!=null && !libraryUpdateVo.getRecord().equals(deviceLibraryEntity.getRecord())){
...@@ -1077,7 +1077,7 @@ public class DeviceLibraryController { ...@@ -1077,7 +1077,7 @@ public class DeviceLibraryController {
return ResponseEntity.ok("解除成功"); return ResponseEntity.ok("解除成功");
} }
@ApiOperation(value = "批量修改存放位置", notes = "解除装备绑定") @ApiOperation(value = "批量修改存放位置", notes = "批量修改存放位置")
@PostMapping("/batchUpdateStorageLocation") @PostMapping("/batchUpdateStorageLocation")
public ResponseEntity batchUpdateStorageLocation(@RequestBody UpdateStorageLocationVo updateStorageLocationVo){ public ResponseEntity batchUpdateStorageLocation(@RequestBody UpdateStorageLocationVo updateStorageLocationVo){
deviceLibraryService.updateStorageLocation(updateStorageLocationVo); deviceLibraryService.updateStorageLocation(updateStorageLocationVo);
...@@ -1209,12 +1209,20 @@ public class DeviceLibraryController { ...@@ -1209,12 +1209,20 @@ public class DeviceLibraryController {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@PostMapping("/fnConditionQuery") @PostMapping("/fnConditionQuery")
@ApiOperation(value = "查询库房的3D装备") @ApiOperation(value = "查询当前库房的3D装备",notes = "出库和入库的查询")
public ResponseEntity<Map<String, Object>> fnConditionQuery(@RequestBody QueryTheWarehouseVo queryTheWarehouseVo){ public ResponseEntity<Map<String, Object>> fnConditionQuery(@RequestBody QueryTheWarehouseVo queryTheWarehouseVo){
Map<String, Object> map = deviceLibraryService.fnConditionQuery(queryTheWarehouseVo); Map<String, Object> map = deviceLibraryService.fnConditionQuery(queryTheWarehouseVo);
return ResponseEntity.ok(map); return ResponseEntity.ok(map);
} }
@Transactional(rollbackFor = Exception.class)
@PostMapping("/fnModifyWarehouseLocationsInBatches")
@ApiOperation(value = "修改出库和入库(3D)",notes = "修改出库和入库")
public ResponseEntity<String> fnModifyWarehouseLocationsInBatches(@RequestBody UpdateStorageLocationVo updateStorageLocationVo){
deviceLibraryService.updateStorageLocation(updateStorageLocationVo);
String s = updateStorageLocationVo.getStorageLocationId() != null ? "入库成功" : "出库成功" ;
return ResponseEntity.ok(s);
}
// @ApiOperation(value = "修改单位名称", notes = "修改单位名称") // @ApiOperation(value = "修改单位名称", notes = "修改单位名称")
......
...@@ -2,10 +2,7 @@ package com.tykj.dev.device.library.controller; ...@@ -2,10 +2,7 @@ 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.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.ModifyWarehouseLocationsInBatchesVO;
import com.tykj.dev.device.library.subject.model.vo.QueryTheWarehouseVo;
import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO; import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -14,9 +11,7 @@ import org.springframework.http.ResponseEntity; ...@@ -14,9 +11,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* DATE:2021-12-25 * DATE:2021-12-25
...@@ -32,17 +27,9 @@ public class DeviceLibraryPositionController { ...@@ -32,17 +27,9 @@ public class DeviceLibraryPositionController {
@Resource @Resource
private DeviceLibraryPositionService deviceLibraryPositionService; private DeviceLibraryPositionService deviceLibraryPositionService;
// @Transactional(rollbackFor = Exception.class)
// @PostMapping("/findByStorageLocationId")
// @ApiOperation(value = "查询库房的3D装备")
// public ResponseEntity<Map<String, Object>> fnConditionQuery(@RequestBody QueryTheWarehouseVo queryTheWarehouseVo){
// Map<String, Object> map = deviceLibraryPositionService.fnConditionQuery(queryTheWarehouseVo);
// return ResponseEntity.ok(map);
// }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@PostMapping("/updateDeviceLibraryPosition") @PostMapping("/updateDeviceLibraryPosition")
@ApiOperation(value = "修改3D") @ApiOperation(value = "修改3D",notes = "修改整个对象")
public ResponseEntity<String> updateDeviceLibraryPosition(@RequestBody DeviceLibraryPosition deviceLibraryPosition){ public ResponseEntity<String> updateDeviceLibraryPosition(@RequestBody DeviceLibraryPosition deviceLibraryPosition){
String messageVo = deviceLibraryPosition.getDeviceLibraryPositionMessageVo().toJson(); String messageVo = deviceLibraryPosition.getDeviceLibraryPositionMessageVo().toJson();
String rotationVo = deviceLibraryPosition.getRotationVo().toJson(); String rotationVo = deviceLibraryPosition.getRotationVo().toJson();
...@@ -68,13 +55,11 @@ public class DeviceLibraryPositionController { ...@@ -68,13 +55,11 @@ public class DeviceLibraryPositionController {
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@PostMapping("/fnUpdateLocation") @PostMapping("/fnUpdatePostionMessage")
@ApiOperation(value = "批量修改位置") @ApiOperation(value = "批量修改x y z位置",notes = "修改x y z")
public ResponseEntity<String> fnUpdateLocation(@RequestBody List<UpdatePostionMessageVO> updatePostionMessageVOS){ public ResponseEntity<String> fnUpdatePostionMessage(@RequestBody List<UpdatePostionMessageVO> updatePostionMessageVOS){
deviceLibraryPositionService.fnUpdateLocation(updatePostionMessageVOS); deviceLibraryPositionService.fnUpdatePostionMessage(updatePostionMessageVOS);
return ResponseEntity.ok("修改成功"); return ResponseEntity.ok("修改成功");
} }
} }
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.DeviceLibraryPositionService; //import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
import com.tykj.dev.device.library.service.DeviceLibraryService; //import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.model.vo.ModifyWarehouseLocationsInBatchesVO; //import com.tykj.dev.device.library.subject.model.vo.ModifyWarehouseLocationsInBatchesVO;
import com.tykj.dev.device.library.subject.vo.UpdateStorageLocationVo; //import com.tykj.dev.device.library.subject.model.vo.QueryTheWarehouseVo;
import io.swagger.annotations.Api; //import com.tykj.dev.device.library.subject.vo.UpdateStorageLocationVo;
import io.swagger.annotations.ApiOperation; //import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j; //import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils; //import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity; //import org.springframework.beans.BeanUtils;
import org.springframework.transaction.annotation.Transactional; //import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping; //import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody; //import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; //import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; //
//import javax.annotation.Resource;
/** //import java.util.Map;
* @author zsp //
* @create 2022/1/7 14:14 ///**
*/ // * @author zsp
@RestController // * @create 2022/1/7 14:14
@RequestMapping(value = "/public") // */
@AutoDocument //@RestController
@Api(tags = "装备3d模块", description = "装备3d模块") //@RequestMapping(value = "/public")
@Slf4j //@AutoDocument
public class PublicController { //@Api(tags = "装备3d模块", description = "装备3d模块")
//@Slf4j
@Resource //public class PublicController {
DeviceLibraryService deviceLibraryService; //
// @Resource
@Resource // DeviceLibraryService deviceLibraryService;
DeviceLibraryPositionService deviceLibraryPositionService; //
// @Resource
@Transactional(rollbackFor = Exception.class) // DeviceLibraryPositionService deviceLibraryPositionService;
@PostMapping("/fnModifyWarehouseLocationsInBatches") //
@ApiOperation(value = "批量修改库房位置") //// @Transactional(rollbackFor = Exception.class)
public ResponseEntity<String> fnModifyWarehouseLocationsInBatches(@RequestBody ModifyWarehouseLocationsInBatchesVO //// @PostMapping("/fnModifyWarehouseLocationsInBatches")
modifyWarehouseLocationsInBatchesVO){ //// @ApiOperation(value = "批量修改库房位置")
deviceLibraryPositionService.batchUpdateStorageLocation(modifyWarehouseLocationsInBatchesVO.getStorageLocationId(), //// public ResponseEntity<String> fnModifyWarehouseLocationsInBatches(@RequestBody ModifyWarehouseLocationsInBatchesVO
modifyWarehouseLocationsInBatchesVO.getStorageLocation(), modifyWarehouseLocationsInBatchesVO.getDeviceIds()); //// modifyWarehouseLocationsInBatchesVO){
UpdateStorageLocationVo updateStorageLocationVo = new UpdateStorageLocationVo(); //// deviceLibraryPositionService.batchUpdateStorageLocation(modifyWarehouseLocationsInBatchesVO.getStorageLocationId(),
BeanUtils.copyProperties(modifyWarehouseLocationsInBatchesVO,updateStorageLocationVo); //// modifyWarehouseLocationsInBatchesVO.getStorageLocation(), modifyWarehouseLocationsInBatchesVO.getDeviceIds());
deviceLibraryService.updateStorageLocation(updateStorageLocationVo); //// UpdateStorageLocationVo updateStorageLocationVo = new UpdateStorageLocationVo();
String s = modifyWarehouseLocationsInBatchesVO.getStorageLocationId() != null ? "入库成功" : "出库成功" ; //// BeanUtils.copyProperties(modifyWarehouseLocationsInBatchesVO,updateStorageLocationVo);
return ResponseEntity.ok(s); //// deviceLibraryService.updateStorageLocation(updateStorageLocationVo);
} //// String s = modifyWarehouseLocationsInBatchesVO.getStorageLocationId() != null ? "出库成功" : "出库成功" ;
//// return ResponseEntity.ok(s);
} //// }
//
// @Transactional(rollbackFor = Exception.class)
// @PostMapping("/fnModifyWarehouseLocationsInBatches")
// @ApiOperation(value = "批量修改库房位置")
// public ResponseEntity<String> fnModifyWarehouseLocationsInBatches(@RequestBody UpdateStorageLocationVo updateStorageLocationVo){
// deviceLibraryService.updateStorageLocation(updateStorageLocationVo);
// String s = updateStorageLocationVo.getStorageLocationId() != null ? "出库成功" : "出库成功" ;
// return ResponseEntity.ok(s);
// }
//
// @Transactional(rollbackFor = Exception.class)
// @PostMapping("/fnConditionQuery")
// @ApiOperation(value = "查询当前库房的3D装备")
// public ResponseEntity<Map<String, Object>> fnConditionQuery(@RequestBody QueryTheWarehouseVo queryTheWarehouseVo){
// Map<String, Object> map = deviceLibraryService.fnConditionQuery(queryTheWarehouseVo);
// return ResponseEntity.ok(map);
// }
//
//}
package com.tykj.dev.device.library.repository; package com.tykj.dev.device.library.repository;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition; import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -19,52 +15,15 @@ import java.util.List; ...@@ -19,52 +15,15 @@ import java.util.List;
@SuppressWarnings("SqlResolve") @SuppressWarnings("SqlResolve")
public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPosition, Integer>, JpaSpecificationExecutor<DeviceLibraryPosition> { public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPosition, Integer>, JpaSpecificationExecutor<DeviceLibraryPosition> {
List<DeviceLibraryPosition> findAllByStorageLocationId(Integer StorageLocationId);
List<DeviceLibraryPosition> findAllByStorageLocationIdIn(List<Integer> StorageLocationIds);
DeviceLibraryPosition findByDeviceId(Integer deviceId); DeviceLibraryPosition findByDeviceId(Integer deviceId);
List<DeviceLibraryPosition> findAllByDeviceIdIn(List<Integer> deviceIds); List<DeviceLibraryPosition> findAllByDeviceIdIn(List<Integer> deviceIds);
List<DeviceLibraryPosition> findAllByModel(String model);
@Transactional
@Modifying
@Query("update DeviceLibraryPosition d set d.storageLocationId = :StorageLocationId ,d.storageLocation = :StorageLocation where d.deviceId = :deviceId")
int onlyUpdateStorageLocation(@Param("StorageLocationId") Integer StorageLocationId,
@Param("StorageLocation")String StorageLocation,@Param("deviceId")Integer deviceId);
@Transactional
@Modifying
@Query("update DeviceLibraryPosition d set d.storageLocationId = :StorageLocationId ,d.storageLocation = :StorageLocation where d.deviceId in :deviceIds")
int batchUpdateStorageLocation(@Param("StorageLocationId") Integer StorageLocationId,
@Param("StorageLocation")String StorageLocation,@Param("deviceIds")List<Integer> deviceIds);
@Transactional
@Modifying
@Query("update DeviceLibraryPosition d set d.model = :newModel where d.model = :oldModel")
int updateModelByOldModel(@Param("oldModel") String oldModel,@Param("newModel") String newModel);
@Transactional
@Modifying
@Query("update DeviceLibraryPosition d set d.name = :name where d.deviceId = :deviceId")
int updateName(@Param("name") String name,@Param("deviceId") Integer deviceId);
@Transactional
@Modifying
@Query("update DeviceLibraryPosition d set d.seqNumber = :seqNumber where d.deviceId = :deviceId")
int updateSeqNumber(@Param("seqNumber") String seqNumber,@Param("deviceId") Integer deviceId);
@Transactional
@Modifying
@Query("update DeviceLibraryPosition d set d.storageLocationId = :StorageLocationId ,d.storageLocation = :StorageLocation where d.seqNumber in :deviceIds")
int batchUpdateStorageLocationSeqNumList(@Param("StorageLocationId") Integer StorageLocationId,
@Param("StorageLocation")String StorageLocation,@Param("deviceIds")List<String> deviceIds);
@Transactional @Transactional
@Modifying @Modifying
@Query("update DeviceLibraryPosition d set d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage where d.id = :id") @Query("update DeviceLibraryPosition d set d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage where d.id = :id")
int fnUpdateLocation(@Param("deviceLibraryPositionMessage") String deviceLibraryPositionMessage, int fnUpdatePostionMessage(@Param("deviceLibraryPositionMessage") String deviceLibraryPositionMessage,
@Param("id")Integer id); @Param("id")Integer id);
} }
......
package com.tykj.dev.device.library.service; 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.QueryTheWarehouseVo;
import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO; import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author zsp * @author zsp
...@@ -13,64 +11,56 @@ import java.util.Map; ...@@ -13,64 +11,56 @@ import java.util.Map;
*/ */
public interface DeviceLibraryPositionService { public interface DeviceLibraryPositionService {
/**
* 保存单个对象
* @param deviceLibraryPosition deviceLibraryPosition对象
*/
void addDeviceLibraryPosition(DeviceLibraryPosition deviceLibraryPosition); void addDeviceLibraryPosition(DeviceLibraryPosition deviceLibraryPosition);
/**
* 更新对象
* @param deviceLibraryPosition deviceLibraryPosition对象
*/
void updateDeviceLibraryPosition(DeviceLibraryPosition deviceLibraryPosition); void updateDeviceLibraryPosition(DeviceLibraryPosition deviceLibraryPosition);
/**
* 批量保存多个对象
* @param deviceLibraryPositions deviceLibraryPositions对象的集合
*/
void batchDeviceLibraryPositions(List<DeviceLibraryPosition> deviceLibraryPositions); void batchDeviceLibraryPositions(List<DeviceLibraryPosition> deviceLibraryPositions);
List<DeviceLibraryPosition> findByStorageLocationId(Integer StorageLocationId); /**
* 根据id查询单个对象
List<DeviceLibraryPosition> findByStorageLocationIds(List<Integer> StorageLocationIds); * @param id id
* @return 一个对象
*/
DeviceLibraryPosition findById(Integer id); DeviceLibraryPosition findById(Integer id);
void deleteByPosition(Integer id);
DeviceLibraryPosition findByDeviceId(Integer deviceId);
List<DeviceLibraryPosition> findByDeviceIds(List<Integer> deviceIds);
/** /**
* 根据装备id修改库房位置 * 根据id进行删除
* @param StorageLocationId 库房id * @param id id
* @param StorageLocation 库房名称
* @param deviceId 装备id
*/ */
void onlyUpdateStorageLocation(Integer StorageLocationId,String StorageLocation,Integer deviceId); void deleteByPosition(Integer id);
/** /**
* 批量修改库房位置 * 根据装备id查询
* @param StorageLocationId 库房id * @param deviceId 装备的id
* @param StorageLocation 库房名称 * @return 对象
* @param seqNumList 装备序列号的集合
*/ */
void batchUpdateStorageLocationAndSeqNumList(Integer StorageLocationId,String StorageLocation,List<String> seqNumList); DeviceLibraryPosition findByDeviceId(Integer deviceId);
/** /**
* 批量修改库房位置 * 根据装备id的集合进行查询
* @param StorageLocationId 库房id
* @param StorageLocation 库房名称
* @param deviceIds 装备id的集合 * @param deviceIds 装备id的集合
* @return 对象的集合
*/ */
void batchUpdateStorageLocation(Integer StorageLocationId,String StorageLocation,List<Integer> deviceIds); List<DeviceLibraryPosition> findByDeviceIds(List<Integer> deviceIds);
// /** /**
// * 条件查询 * 修改xyz
// * @param queryTheWarehouseVo 条件查询类 * @param updatePostionMessageVO 查询的vo
// * @return */
// */ void fnUpdatePostionMessage(List<UpdatePostionMessageVO> updatePostionMessageVO);
// Map<String,Object> fnConditionQuery(QueryTheWarehouseVo queryTheWarehouseVo);
void updateModelByOldModel(String oldModel,String newModel);
void updateName(String name,Integer deviceId);
void updateSeqNumber(String seqNumber,Integer deviceId);
List<DeviceLibraryPosition> findByModel(String model);
void fnUpdateLocation(List<UpdatePostionMessageVO> updatePostionMessageVO);
......
package com.tykj.dev.device.library.service.impl; package com.tykj.dev.device.library.service.impl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.device.library.repository.DeviceLibraryPositionDao; import com.tykj.dev.device.library.repository.DeviceLibraryPositionDao;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.service.DeviceLibraryPositionService; import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
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.DeviceLibraryPosition; import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
import com.tykj.dev.device.library.subject.model.vo.QueryTheWarehouseVo;
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.vo.DeviceLibraryPositionMessageVo;
import com.tykj.dev.device.library.subject.vo.RotationVo;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
/** /**
* @author zsp * @author zsp
...@@ -38,9 +20,6 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe ...@@ -38,9 +20,6 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
@Autowired @Autowired
private DeviceLibraryPositionDao deviceLibraryPositionDao; private DeviceLibraryPositionDao deviceLibraryPositionDao;
@Autowired
private DeviceLibraryCacheService deviceLibraryCacheService;
@Override @Override
public void addDeviceLibraryPosition(DeviceLibraryPosition deviceLibraryPosition) { public void addDeviceLibraryPosition(DeviceLibraryPosition deviceLibraryPosition) {
deviceLibraryPositionDao.save(deviceLibraryPosition); deviceLibraryPositionDao.save(deviceLibraryPosition);
...@@ -56,16 +35,6 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe ...@@ -56,16 +35,6 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
deviceLibraryPositionDao.saveAll(deviceLibraryPositions); deviceLibraryPositionDao.saveAll(deviceLibraryPositions);
} }
@Override
public List<DeviceLibraryPosition> findByStorageLocationId(Integer StorageLocationId) {
return deviceLibraryPositionDao.findAllByStorageLocationId(StorageLocationId);
}
@Override
public List<DeviceLibraryPosition> findByStorageLocationIds(List<Integer> StorageLocationIds) {
return deviceLibraryPositionDao.findAllByStorageLocationIdIn(StorageLocationIds);
}
@Override @Override
public DeviceLibraryPosition findById(Integer id) { public DeviceLibraryPosition findById(Integer id) {
DeviceLibraryPosition deviceLibraryPosition = new DeviceLibraryPosition(); DeviceLibraryPosition deviceLibraryPosition = new DeviceLibraryPosition();
...@@ -92,100 +61,13 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe ...@@ -92,100 +61,13 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
} }
@Override @Override
public void onlyUpdateStorageLocation(Integer StorageLocationId, String StorageLocation, Integer deviceId) { public void fnUpdatePostionMessage(List<UpdatePostionMessageVO> updatePostionMessageVO) {
deviceLibraryPositionDao.onlyUpdateStorageLocation(StorageLocationId, StorageLocation, deviceId);
}
@Override
public void batchUpdateStorageLocationAndSeqNumList(Integer StorageLocationId, String StorageLocation, List<String> seqNumList) {
deviceLibraryPositionDao.batchUpdateStorageLocationSeqNumList(StorageLocationId, StorageLocation, seqNumList);
}
@Override
public void batchUpdateStorageLocation(Integer StorageLocationId, String StorageLocation, List<Integer> deviceIds) {
deviceLibraryPositionDao.batchUpdateStorageLocation(StorageLocationId, StorageLocation, deviceIds);
}
// @Override
// public Map<String,Object> fnConditionQuery(QueryTheWarehouseVo queryTheWarehouseVo) {
// Map<String,Object> map = new HashMap<>();
//
// Map<Integer, DeviceLibrary> deviceIdMap = deviceLibraryCacheService.getAllDeviceLibraryList().stream().collect(Collectors.toMap(DeviceLibrary::getId, Function.identity()));
//
// PredicateBuilder<DeviceLibraryPosition> builder = createBuilder(queryTheWarehouseVo);
// List<DeviceLibraryPosition> deviceLibraryPositions = deviceLibraryPositionDao.findAll(builder.build());
// Page<DeviceLibraryPosition> page = PageUtil.getPerPage(queryTheWarehouseVo.getPage(),
// queryTheWarehouseVo.getSize(), deviceLibraryPositions,
// queryTheWarehouseVo.getPageable());
// //进行转换
// if (!deviceLibraryPositions.isEmpty()){
// for (DeviceLibraryPosition deviceLibraryPosition : deviceLibraryPositions) {
// deviceLibraryPosition.setDeviceLibraryPositionMessageVo(
// JacksonUtil.readValue(deviceLibraryPosition.getDeviceLibraryPositionMessage(), new TypeReference<DeviceLibraryPositionMessageVo>() {}));
// deviceLibraryPosition.setRotationVo(
// JacksonUtil.readValue(deviceLibraryPosition.getRotation(), new TypeReference<RotationVo>() {}));
// }
// }
// page.forEach(deviceLibraryPosition -> {
// if (deviceIdMap.containsKey(deviceLibraryPosition.getDeviceId())) {
// DeviceLibrary deviceLibrary= deviceIdMap.get(deviceLibraryPosition.getDeviceId()).setConfigName();
// deviceLibraryPosition.setOwnUnitName(deviceLibrary.getOwnUnit());
// deviceLibraryPosition.setTypeName(deviceLibrary.getTypeName());
// }
// });
// List<String> models =
// deviceLibraryPositions.stream().map(DeviceLibraryPosition::getModel).distinct().collect(Collectors.toList());
// List<String> names =
// deviceLibraryPositions.stream().map(DeviceLibraryPosition::getName).distinct().collect(Collectors.toList());
// List<Integer> storageLocationIds =
// deviceLibraryPositions.stream().map(DeviceLibraryPosition::getStorageLocationId).distinct().collect(Collectors.toList());
// map.put("page",page);
// map.put("models",models);
// map.put("names",names);
// map.put("storageLocationIds",storageLocationIds);
// return map;
// }
@Override
public void updateModelByOldModel(String oldModel, String newModel) {
deviceLibraryPositionDao.updateModelByOldModel(oldModel, newModel);
}
@Override
public void updateName(String name, Integer deviceId) {
deviceLibraryPositionDao.updateName(name, deviceId);
}
@Override
public void updateSeqNumber(String seqNumber, Integer deviceId) {
deviceLibraryPositionDao.updateSeqNumber(seqNumber, deviceId);
}
@Override
public List<DeviceLibraryPosition> findByModel(String model) {
return deviceLibraryPositionDao.findAllByModel(model);
}
@Override
public void fnUpdateLocation(List<UpdatePostionMessageVO> updatePostionMessageVO) {
if (!updatePostionMessageVO.isEmpty()){ if (!updatePostionMessageVO.isEmpty()){
updatePostionMessageVO.forEach(updatePostionMessageVO1 -> { updatePostionMessageVO.forEach(updatePostionMessageVO1 -> {
String json = updatePostionMessageVO1.getDeviceLibraryPositionMessageVo().toJson(); String json = updatePostionMessageVO1.getDeviceLibraryPositionMessageVo().toJson();
deviceLibraryPositionDao.fnUpdateLocation(json, updatePostionMessageVO1.getId()); deviceLibraryPositionDao.fnUpdatePostionMessage(json, updatePostionMessageVO1.getId());
}); });
} }
} }
// private PredicateBuilder<DeviceLibraryPosition> createBuilder(QueryTheWarehouseVo queryTheWarehouseVo){
// PredicateBuilder<DeviceLibraryPosition> predicateBuilder = Specifications.and();
// List<Integer> storageLocationIds = queryTheWarehouseVo.getStorageLocationIds();
// predicateBuilder.eq(queryTheWarehouseVo.getModel()!=null,"model",queryTheWarehouseVo.getModel());
// predicateBuilder.eq(queryTheWarehouseVo.getName()!=null,"name",queryTheWarehouseVo.getName());
// predicateBuilder.like(queryTheWarehouseVo.getSeqNumber()!=null,"seqNumber",
// "%"+queryTheWarehouseVo.getSeqNumber()+"%");
// predicateBuilder.in(queryTheWarehouseVo.getStorageLocationIds()!=null && !storageLocationIds.isEmpty(),
// "storageLocationId",storageLocationIds.toArray(new Integer[]{}));
// return predicateBuilder;
// }
} }
package com.tykj.dev.device.library.service.impl; package com.tykj.dev.device.library.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.TypeReference;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcText;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; 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.UpdateCache; import com.tykj.dev.config.UpdateCache;
import com.tykj.dev.config.base.DeviceLifeStatus; import com.tykj.dev.config.base.DeviceLifeStatus;
import com.tykj.dev.device.library.controller.CacheLibraryController;
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.DeviceLibraryCacheService;
import com.tykj.dev.device.library.service.DeviceLibraryPositionService; import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
...@@ -17,6 +16,8 @@ import com.tykj.dev.device.library.service.DeviceLibraryService; ...@@ -17,6 +16,8 @@ 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;
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.domin.DeviceLibraryPosition;
import com.tykj.dev.device.library.subject.model.vo.AllVO;
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.vo.*; import com.tykj.dev.device.library.subject.vo.*;
import com.tykj.dev.device.library.utils.DeviceNumberUtils; import com.tykj.dev.device.library.utils.DeviceNumberUtils;
...@@ -52,6 +53,7 @@ import java.util.function.Function; ...@@ -52,6 +53,7 @@ import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.util.stream.Collectors.groupingBy; import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.toMap;
/** /**
* @author dengdiyi * @author dengdiyi
...@@ -86,7 +88,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -86,7 +88,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
@Qualifier("taskExecutor") @Qualifier("taskExecutor")
private Executor executor; private Executor executor;
@Autowired @Resource
private DeviceLibraryPositionService deviceLibraryPositionService; private DeviceLibraryPositionService deviceLibraryPositionService;
@Override @Override
...@@ -1172,7 +1174,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1172,7 +1174,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
if (!CollectionUtils.isEmpty(deviceIds)){ if (!CollectionUtils.isEmpty(deviceIds)){
//添加装备日志 //添加装备日志
deviceIds.forEach(integer -> { deviceIds.forEach(integer -> {
if (!updateStorageLocationVo.getStorageLocation().equals(getOne(integer).getStorageLocation())){ if (updateStorageLocationVo.getStorageLocationId() != getOne(integer).getStorageLocationId()){
DeviceLogDto deviceLogDto= new DeviceLogDto(integer,"将存放位置修改为"+ DeviceLogDto deviceLogDto= new DeviceLogDto(integer,"将存放位置修改为"+
updateStorageLocationVo.getStorageLocation(),null,userId); updateStorageLocationVo.getStorageLocation(),null,userId);
deviceLogDtos.add(deviceLogDto); deviceLogDtos.add(deviceLogDto);
...@@ -1185,8 +1187,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1185,8 +1187,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
CompletableFuture.runAsync(()->{ CompletableFuture.runAsync(()->{
deviceLogService.addAllLog(deviceLogDtos); deviceLogService.addAllLog(deviceLogDtos);
}); });
deviceLibraryPositionService.batchUpdateStorageLocation(updateStorageLocationVo.getStorageLocationId(), // deviceLibraryPositionService.batchUpdateStorageLocation(updateStorageLocationVo.getStorageLocationId(),
updateStorageLocationVo.getStorageLocation(),deviceIds); // updateStorageLocationVo.getStorageLocation(),deviceIds);
} }
...@@ -1274,16 +1276,72 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1274,16 +1276,72 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(deviceLibrarySelectVo); PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(deviceLibrarySelectVo);
List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll(predicateBuilder.build()); List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll(predicateBuilder.build());
deviceLibraries.forEach(DeviceLibrary::setConfigName); deviceLibraries.forEach(DeviceLibrary::setConfigName);
Page<DeviceLibrary> deviceLibraryPage = PageUtil.getPerPage(queryTheWarehouseVo.getPage(), //拿到所有的装备id
queryTheWarehouseVo.getSize(), deviceLibraries, queryTheWarehouseVo.getPageable()); List<Integer> deviceIds = deviceLibraries.stream().map(DeviceLibrary::getId).collect(Collectors.toList());
//3D位置的map
Map<Integer, DeviceLibraryPosition> positionMap =
deviceLibraryPositionService.findByDeviceIds(deviceIds).stream().collect(toMap(DeviceLibraryPosition::getDeviceId, Function.identity()));
//取出key 在3d的装备id
Set<Integer> integers = positionMap.keySet();
//然后就行过滤
deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> integers.contains(deviceLibrary.getId()))
.collect(Collectors.toList());
List<AllVO> allVOS = new ArrayList<>();
//开始遍历装备
deviceLibraries.forEach(deviceLibrary -> {
AllVO allVO = new AllVO();
//开始赋值
allVO.setDeviceLibrary(deviceLibrary);
DeviceLibraryPosition deviceLibraryPosition = positionMap.getOrDefault(deviceLibrary.getId(),null);
if (deviceLibraryPosition != null){
//转换数据
if (deviceLibraryPosition.getDeviceLibraryPositionMessage() != null){
deviceLibraryPosition.setDeviceLibraryPositionMessageVo(
JacksonUtil.readValue(deviceLibraryPosition.getDeviceLibraryPositionMessage(),
new com.fasterxml.jackson.core.type.TypeReference<DeviceLibraryPositionMessageVo>() {}));
}
if (deviceLibraryPosition.getRotation() !=null){
deviceLibraryPosition.setRotationVo(
JacksonUtil.readValue(deviceLibraryPosition.getRotation(),
new com.fasterxml.jackson.core.type.TypeReference<RotationVo>() {}));
}
}
allVO.setDeviceLibraryPosition(deviceLibraryPosition);
allVOS.add(allVO);
});
//如果是出库 只需要地上的 不出库是全部的
Integer out = queryTheWarehouseVo.getOut();
List<AllVO> pageAllVo = new ArrayList<>();
if (out != null){
//说明要出库 只需要地上的
pageAllVo = allVOS.stream().filter(allVO -> {
DeviceLibraryPosition deviceLibraryPosition = allVO.getDeviceLibraryPosition();
if (deviceLibraryPosition != null) {
String deviceLibraryPositionName = deviceLibraryPosition.getDeviceLibraryPositionName();
if (deviceLibraryPositionName == null) {
return true;
}else {
return false;
}
}else {
//为空 说明该装备不在3D库中
return false;
}
}).collect(Collectors.toList());
}else {
pageAllVo.addAll(allVOS);
}
Page<AllVO> allVOPage = PageUtil.getPerPage(queryTheWarehouseVo.getPage(),
queryTheWarehouseVo.getSize(), pageAllVo, queryTheWarehouseVo.getPageable());
List<DeviceLibrary> collect = pageAllVo.stream().map(AllVO::getDeviceLibrary).collect(Collectors.toList());
List<String> models = List<String> models =
deviceLibraries.stream().map(DeviceLibrary::getModel).distinct().collect(Collectors.toList()); collect.stream().map(DeviceLibrary::getModel).distinct().collect(Collectors.toList());
List<String> seqNumberList = deviceLibraries.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList()); List<String> seqNumberList = collect.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList());
List<String> names = List<String> names =
deviceLibraries.stream().map(DeviceLibrary::getName).distinct().collect(Collectors.toList()); collect.stream().map(DeviceLibrary::getName).distinct().collect(Collectors.toList());
List<String> ownUnits = List<String> ownUnits =
deviceLibraries.stream().map(DeviceLibrary::getOwnUnit).distinct().collect(Collectors.toList()); collect.stream().map(DeviceLibrary::getOwnUnit).distinct().collect(Collectors.toList());
map.put("deviceLibraryPage",deviceLibraryPage); map.put("allVOPage",allVOPage);
map.put("models",models); map.put("models",models);
map.put("seqNumberList",seqNumberList); map.put("seqNumberList",seqNumberList);
map.put("names",names); map.put("names",names);
......
...@@ -287,6 +287,9 @@ public class DeviceLibrary implements Serializable { ...@@ -287,6 +287,9 @@ public class DeviceLibrary implements Serializable {
@Transient @Transient
private Integer isInLibrary; private Integer isInLibrary;
// @Transient
// private DeviceLibraryPosition deviceLibraryPosition;
public void addChildNode(DeviceLibrary deviceLibraryEntity) { public void addChildNode(DeviceLibrary deviceLibraryEntity) {
childs.add(deviceLibraryEntity); childs.add(deviceLibraryEntity);
} }
......
package com.tykj.dev.device.library.subject.domin; package com.tykj.dev.device.library.subject.domin;
import com.tykj.dev.config.cache.ConfigCache;
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.misc.utils.SpringUtils;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -36,11 +39,11 @@ public class DeviceLibraryPosition implements Serializable { ...@@ -36,11 +39,11 @@ public class DeviceLibraryPosition implements Serializable {
@Column(columnDefinition = "integer NOT NULL AUTO_INCREMENT") @Column(columnDefinition = "integer NOT NULL AUTO_INCREMENT")
private Integer id; private Integer id;
/** // /**
* 型号 // * 型号
*/ // */
@ApiModelProperty(value = "型号") // @ApiModelProperty(value = "型号")
private String model; // private String model;
/** /**
* 装备的id * 装备的id
...@@ -48,37 +51,37 @@ public class DeviceLibraryPosition implements Serializable { ...@@ -48,37 +51,37 @@ public class DeviceLibraryPosition implements Serializable {
@ApiModelProperty(value = "装备的id") @ApiModelProperty(value = "装备的id")
private Integer deviceId; private Integer deviceId;
/** // /**
* 密级 // * 密级
*/ // */
@ApiModelProperty(value = "密级") // @ApiModelProperty(value = "密级")
private Integer secretLevel; // private Integer secretLevel;
/** // /**
* 装备名称 // * 装备名称
*/ // */
@ApiModelProperty(value = "装备名称") // @ApiModelProperty(value = "装备名称")
private String name; // private String name;
//
/** // /**
* 装备序列号 // * 装备序列号
*/ // */
@ApiModelProperty(value = "装备序列号") // @ApiModelProperty(value = "装备序列号")
private String seqNumber; // private String seqNumber;
/** // /**
* 生产序列号 // * 生产序列号
*/ // */
@ApiModelProperty(value = "生产序列号") // @ApiModelProperty(value = "生产序列号")
private String prodNumber; // private String prodNumber;
/** // /**
* rfid表面号 // * rfid表面号
*/ // */
@ApiModelProperty(value = "rfid表面号") // @ApiModelProperty(value = "rfid表面号")
private String rfidSurfaceId; // private String rfidSurfaceId;
/** // /**
* rfid卡号 // * rfid卡号
*/ // */
@ApiModelProperty(value = "rfid卡号") // @ApiModelProperty(value = "rfid卡号")
private String rfidCardId; // private String rfidCardId;
/** /**
* 创建用户id * 创建用户id
...@@ -110,11 +113,11 @@ public class DeviceLibraryPosition implements Serializable { ...@@ -110,11 +113,11 @@ public class DeviceLibraryPosition implements Serializable {
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)") @ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0; private Integer deleteTag = 0;
@ApiModelProperty(value = "库房位置",notes = "默认是库房") // @ApiModelProperty(value = "库房位置",notes = "默认是库房")
private String storageLocation; // private String storageLocation;
//
@ApiModelProperty(value = "装备存放位置Id",notes = "默认是库房") // @ApiModelProperty(value = "装备存放位置Id",notes = "默认是库房")
private Integer storageLocationId; // private Integer storageLocationId;
@ApiModelProperty(value = "DeviceLibraryPosition名称",notes = "") @ApiModelProperty(value = "DeviceLibraryPosition名称",notes = "")
private String deviceLibraryPositionName; private String deviceLibraryPositionName;
...@@ -152,4 +155,12 @@ public class DeviceLibraryPosition implements Serializable { ...@@ -152,4 +155,12 @@ public class DeviceLibraryPosition implements Serializable {
@Transient @Transient
private String typeName; private String typeName;
// public DeviceLibraryPosition setConfigName(){
// StoreCache storeCache=SpringUtils.getBean("initStoreCache");
// if (storeCache!=null) {
// setStorageLocation(storeCache.idToName(this.storageLocationId));
// }
// return this;
// }
} }
package com.tykj.dev.device.library.subject.model.vo; package com.tykj.dev.device.library.subject.model.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author zsp * @author zsp
* @create 2021/12/30 13:05 * @create 2022/1/8 11:09
*/ */
@Data @Data
@ApiModel("修改3d装备库房vo") @ApiModel("查询出入库的装备和3D的vo")
public class ModifyWarehouseLocationsInBatchesVO { public class AllVO {
@ApiModelProperty(value = "装备id的集合")
public List<Integer> deviceIds;
@ApiModelProperty(value = "库房的id") @ApiModelProperty(value = "装备的对象")
public Integer storageLocationId; private DeviceLibrary deviceLibrary;
@ApiModelProperty(value = "库房的名称") @ApiModelProperty(value = "3D的对象")
public String storageLocation; private DeviceLibraryPosition deviceLibraryPosition;
} }
...@@ -33,4 +33,7 @@ public class QueryTheWarehouseVo extends CustomPage { ...@@ -33,4 +33,7 @@ public class QueryTheWarehouseVo extends CustomPage {
@ApiModelProperty(value = "当前库房的id") @ApiModelProperty(value = "当前库房的id")
private Integer storageLocationId; private Integer storageLocationId;
@ApiModelProperty(value = "出库")
private Integer out;
} }
...@@ -6,14 +6,12 @@ import io.swagger.annotations.ApiModel; ...@@ -6,14 +6,12 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author zsp * @author zsp
* @create 2021/12/30 13:05 * @create 2022/1/8 13:14
*/ */
@Data @Data
@ApiModel("修改x,y,z位置") @ApiModel("修改xyz")
public class UpdatePostionMessageVO extends CustomPage { public class UpdatePostionMessageVO extends CustomPage {
@ApiModelProperty(value = "id", example = "1") @ApiModelProperty(value = "id", example = "1")
......
...@@ -4,7 +4,7 @@ import com.tykj.dev.config.cache.ConfigCache; ...@@ -4,7 +4,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.file.service.FilesUtil; import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService; import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.service.DeviceLibraryPositionService; //import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
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;
...@@ -93,7 +93,7 @@ public class PackingController { ...@@ -93,7 +93,7 @@ public class PackingController {
@Autowired @Autowired
PackingLogService packingLogService; PackingLogService packingLogService;
@Autowired @Resource
ConfigCache configCache; ConfigCache configCache;
// @Autowired // @Autowired
...@@ -111,8 +111,8 @@ public class PackingController { ...@@ -111,8 +111,8 @@ public class PackingController {
@Qualifier("taskExecutor") @Qualifier("taskExecutor")
Executor executor; Executor executor;
@Resource // @Resource
private DeviceLibraryPositionService deviceLibraryPositionService; // private DeviceLibraryPositionService deviceLibraryPositionService;
@ApiOperation(value = "查询列装详情", notes = "可以通过这个接口查询列装详情") @ApiOperation(value = "查询列装详情", notes = "可以通过这个接口查询列装详情")
@GetMapping(value = "/detail/{billId}") @GetMapping(value = "/detail/{billId}")
...@@ -639,8 +639,8 @@ public class PackingController { ...@@ -639,8 +639,8 @@ public class PackingController {
packingLog.setPackingId(packingLibrary.getId()); packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog); packingLogService.add(packingLog);
//修改3D中的model //修改3D中的model
CompletableFuture.runAsync(()-> // CompletableFuture.runAsync(()->
deviceLibraryPositionService.updateModelByOldModel(packingLibrary.getModel(),packingModelEdit.getModel())); // deviceLibraryPositionService.updateModelByOldModel(packingLibrary.getModel(),packingModelEdit.getModel()));
} }
BeanUtils.copyProperties(packingModelEdit, packingLibrary); BeanUtils.copyProperties(packingModelEdit, packingLibrary);
packingLibraryService.update(packingLibrary); packingLibraryService.update(packingLibrary);
......
...@@ -7,7 +7,7 @@ import com.tykj.dev.config.swagger.AutoDocument; ...@@ -7,7 +7,7 @@ import com.tykj.dev.config.swagger.AutoDocument;
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.DeviceChangeService; import com.tykj.dev.device.library.service.DeviceChangeService;
import com.tykj.dev.device.library.service.DeviceLibraryPositionService; //import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
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;
...@@ -150,8 +150,8 @@ public class RepairController { ...@@ -150,8 +150,8 @@ public class RepairController {
@Resource @Resource
private UnitsCache unitsCache; private UnitsCache unitsCache;
@Resource // @Resource
private DeviceLibraryPositionService deviceLibraryPositionService; // private DeviceLibraryPositionService deviceLibraryPositionService;
@ApiOperation(value = "判断维修装备是否同一个送修单位", notes = "可以通过这个接口判断维修装备是否同一个送修单位") @ApiOperation(value = "判断维修装备是否同一个送修单位", notes = "可以通过这个接口判断维修装备是否同一个送修单位")
@PostMapping(value = "/judge") @PostMapping(value = "/judge")
...@@ -810,7 +810,7 @@ public class RepairController { ...@@ -810,7 +810,7 @@ public class RepairController {
} }
} }
//修改3D //修改3D
deviceLibraryPositionService.batchUpdateStorageLocation(null,null,idList); // deviceLibraryPositionService.batchUpdateStorageLocation(null,null,idList);
//改变维修详情装备所在单位为当前单位 //改变维修详情装备所在单位为当前单位
repairDetailEntities.forEach(repairDetail -> { repairDetailEntities.forEach(repairDetail -> {
repairDetail.setLocationUnit(repairBill.getReceiveUnit()); repairDetail.setLocationUnit(repairBill.getReceiveUnit());
...@@ -1395,7 +1395,7 @@ public class RepairController { ...@@ -1395,7 +1395,7 @@ public class RepairController {
} }
} }
//修改3D //修改3D
deviceLibraryPositionService.batchUpdateStorageLocation(null,null,deviceIds); // deviceLibraryPositionService.batchUpdateStorageLocation(null,null,deviceIds);
//发送阅知信息 //发送阅知信息
List<Integer> ids = userPublicService.findOtherUser(userUtils.getCurrentUserId()); List<Integer> ids = userPublicService.findOtherUser(userUtils.getCurrentUserId());
if (repairReceiveVo.getTaskId() != null) { if (repairReceiveVo.getTaskId() != null) {
...@@ -2381,7 +2381,7 @@ public class RepairController { ...@@ -2381,7 +2381,7 @@ public class RepairController {
deviceLibraryService.update(deviceLibraryEntity); deviceLibraryService.update(deviceLibraryEntity);
}); });
//修改3D //修改3D
deviceLibraryPositionService.batchUpdateStorageLocation(null,null,ids); // deviceLibraryPositionService.batchUpdateStorageLocation(null,null,ids);
//获取维修详情 //获取维修详情
List<RepairDetail> repairDetailList = repairDetailDao.findByRepairBackBillId(repairBackBill.getId()); List<RepairDetail> repairDetailList = repairDetailDao.findByRepairBackBillId(repairBackBill.getId());
//单位阅知map //单位阅知map
...@@ -2515,7 +2515,7 @@ public class RepairController { ...@@ -2515,7 +2515,7 @@ public class RepairController {
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
}); });
//修改3D //修改3D
deviceLibraryPositionService.batchUpdateStorageLocation(null,null,ids); // deviceLibraryPositionService.batchUpdateStorageLocation(null,null,ids);
//改变维修详情装备所在单位为当前单位 //改变维修详情装备所在单位为当前单位
repairDetailEntities.forEach(repairDetail -> { repairDetailEntities.forEach(repairDetail -> {
repairDetail.setLocationUnit(repairBill.getReceiveUnit()); repairDetail.setLocationUnit(repairBill.getReceiveUnit());
...@@ -3072,7 +3072,7 @@ public class RepairController { ...@@ -3072,7 +3072,7 @@ public class RepairController {
String deviceIdDetail = deviceRepairSendBillEntity.getRepairDeviceCheckDetail(); String deviceIdDetail = deviceRepairSendBillEntity.getRepairDeviceCheckDetail();
List<Integer> idList = StringSplitUtil.split(deviceIdDetail); List<Integer> idList = StringSplitUtil.split(deviceIdDetail);
//修改3D //修改3D
deviceLibraryPositionService.batchUpdateStorageLocation(null,null,deviceIds); // deviceLibraryPositionService.batchUpdateStorageLocation(null,null,deviceIds);
//如果当前为省,改变装备的所在为中办 //如果当前为省,改变装备的所在为中办
if (level == 1 && units.getType() == 1) { if (level == 1 && units.getType() == 1) {
//获取当前业务维修详情 记录 //获取当前业务维修详情 记录
......
...@@ -5,7 +5,7 @@ import com.tykj.dev.config.base.DeviceLifeStatus; ...@@ -5,7 +5,7 @@ import com.tykj.dev.config.base.DeviceLifeStatus;
import com.tykj.dev.device.apply.service.DeviceApplyBillService; import com.tykj.dev.device.apply.service.DeviceApplyBillService;
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.DeviceLibraryPositionService; //import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
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;
...@@ -73,8 +73,8 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService { ...@@ -73,8 +73,8 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
@Autowired @Autowired
MessageService messageService; MessageService messageService;
@Autowired // @Autowired
DeviceLibraryPositionService deviceLibraryPositionService; // DeviceLibraryPositionService deviceLibraryPositionService;
@Override @Override
public TaskBto saveDeviceScrapDraft(Integer userId, ScrapOrderOutData scrapOrderOutData) { public TaskBto saveDeviceScrapDraft(Integer userId, ScrapOrderOutData scrapOrderOutData) {
...@@ -233,7 +233,7 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService { ...@@ -233,7 +233,7 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
scrap.setReceiveTime(new Date()); scrap.setReceiveTime(new Date());
deviceLibraryService.upDateSeqNumbersLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.SCRAP_I.id,scrap.getReceiveUnit(),0,seqNumbers); deviceLibraryService.upDateSeqNumbersLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.SCRAP_I.id,scrap.getReceiveUnit(),0,seqNumbers);
//修改3D数据的库房字段置为空 //修改3D数据的库房字段置为空
deviceLibraryPositionService.batchUpdateStorageLocationAndSeqNumList(null,null,seqNumbers); // deviceLibraryPositionService.batchUpdateStorageLocationAndSeqNumList(null,null,seqNumbers);
scrapService.saveScrap(scrap); scrapService.saveScrap(scrap);
devLogAdd(seqNumbers,"报废任务完成,状态转化为已报废",user.getUserId(),taskBto.getId()); devLogAdd(seqNumbers,"报废任务完成,状态转化为已报废",user.getUserId(),taskBto.getId());
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"办结报废业务:"+MessageFormatUtil.spellTwoWicket(scrap.getSendUnit(),scrap.getReceiveUnit()),gainThisUser(user.getUserId(),user.getUnitsId()))); addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"办结报废业务:"+MessageFormatUtil.spellTwoWicket(scrap.getSendUnit(),scrap.getReceiveUnit()),gainThisUser(user.getUserId(),user.getUnitsId())));
......
...@@ -9,7 +9,7 @@ import com.tykj.dev.device.file.service.FilesUtil; ...@@ -9,7 +9,7 @@ import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.file.service.PdfService; import com.tykj.dev.device.file.service.PdfService;
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.DeviceLibraryCacheService;
import com.tykj.dev.device.library.service.DeviceLibraryPositionService; //import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
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;
...@@ -114,8 +114,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -114,8 +114,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
@Autowired @Autowired
RepelEscrowService repelEscrowService; RepelEscrowService repelEscrowService;
@Autowired // @Autowired
DeviceLibraryPositionService deviceLibraryPositionService; // DeviceLibraryPositionService deviceLibraryPositionService;
/** /**
* 发起申请后清退任务 * 发起申请后清退任务
...@@ -1004,7 +1004,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -1004,7 +1004,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
} }
//修改3d的库房位置 置为null //修改3d的库房位置 置为null
// TODO: 12/30/21 // TODO: 12/30/21
deviceLibraryPositionService.batchUpdateStorageLocation(null,null,StringUtils.stringToList(deviceRepelDetail.getDeviceIds())); // deviceLibraryPositionService.batchUpdateStorageLocation(null,null,StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
List<DeviceLibrary> libraries = findInvoleDevice(deviceRepelDetail.getDeviceIds()); List<DeviceLibrary> libraries = findInvoleDevice(deviceRepelDetail.getDeviceIds());
libraries.forEach( libraries.forEach(
deviceLibrary -> { deviceLibrary -> {
...@@ -1036,7 +1036,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -1036,7 +1036,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
} }
//修改3d的库房位置 置为null //修改3d的库房位置 置为null
// TODO: 12/30/21 // TODO: 12/30/21
deviceLibraryPositionService.batchUpdateStorageLocation(null,null,StringUtils.stringToList(deviceRepelDetail.getDeviceIds())); // deviceLibraryPositionService.batchUpdateStorageLocation(null,null,StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
taskService.moveToEnd(taskBto); taskService.moveToEnd(taskBto);
taskService.moveToEnd(taskService.findBillTypeAndFatherId(BusinessEnum.SEND_BACK.id, taskId)); taskService.moveToEnd(taskService.findBillTypeAndFatherId(BusinessEnum.SEND_BACK.id, taskId));
taskService.moveToArchive(taskService.findBillTypeAndFatherId(BusinessEnum.SEND_BACK.id, taskId)); taskService.moveToArchive(taskService.findBillTypeAndFatherId(BusinessEnum.SEND_BACK.id, taskId));
......
...@@ -921,15 +921,15 @@ public class StorageBillController { ...@@ -921,15 +921,15 @@ public class StorageBillController {
saveDevices.forEach(deviceLibrary -> { saveDevices.forEach(deviceLibrary -> {
DeviceLibraryPosition deviceLibraryPosition = new DeviceLibraryPosition(); DeviceLibraryPosition deviceLibraryPosition = new DeviceLibraryPosition();
deviceLibraryPosition.setDeviceId(deviceLibrary.getId()); deviceLibraryPosition.setDeviceId(deviceLibrary.getId());
BeanUtils.copyProperties(deviceLibrary,deviceLibraryPosition); // BeanUtils.copyProperties(deviceLibrary,deviceLibraryPosition);
RotationVo rotationVo = new RotationVo(); // RotationVo rotationVo = new RotationVo();
String s = rotationVo.toJson(); // String s = rotationVo.toJson();
deviceLibraryPosition.setRotation(s); // deviceLibraryPosition.setRotation(s);
DeviceLibraryPositionMessageVo deviceLibraryPositionMessageVo = new DeviceLibraryPositionMessageVo(); // DeviceLibraryPositionMessageVo deviceLibraryPositionMessageVo = new DeviceLibraryPositionMessageVo();
String s1 = deviceLibraryPositionMessageVo.toJson(); // String s1 = deviceLibraryPositionMessageVo.toJson();
deviceLibraryPosition.setDeviceLibraryPositionMessage(s1); // deviceLibraryPosition.setDeviceLibraryPositionMessage(s1);
deviceLibraryPosition.setStorageLocation(storageBillSaveVo.getStorageLocation()); // deviceLibraryPosition.setStorageLocation(storageBillSaveVo.getStorageLocation());
deviceLibraryPosition.setStorageLocationId(storageBillSaveVo.getStorageLocationId()); // deviceLibraryPosition.setStorageLocationId(storageBillSaveVo.getStorageLocationId());
deviceLibraryPositions.add(deviceLibraryPosition); deviceLibraryPositions.add(deviceLibraryPosition);
}); });
log.info("存储3D完成"); log.info("存储3D完成");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论