提交 5489b836 authored 作者: 邓砥奕's avatar 邓砥奕

更新

上级 d09d3dc3
......@@ -7,6 +7,7 @@ import com.tykj.dev.device.allot.subject.domin.AllotBackBill;
import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.allot.subject.vo.AllotBillSelectVo;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.user.subject.service.UserPublicService;
......@@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author dengdiyi
......@@ -42,6 +44,9 @@ public class AllotBillSelectController {
@Autowired
private AllotBackBillService allotBackBillService;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
@ApiOperation(value = "查询配发单", notes = "可以通过这个接口查询配发单")
@PostMapping(value = "/archives/allot/summary")
public ResponseEntity selectAllotBill(@RequestBody AllotBillSelectVo allotBillSelectVo) {
......@@ -59,6 +64,7 @@ public class AllotBillSelectController {
@ApiOperation(value = "查询配发单详情页", notes = "可以通过这个接口查询配发单")
@GetMapping(value = "/archives/allot/detail/{id}")
public ResponseEntity selectAllotBillDetail(@PathVariable("id") int id) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
List<Object> list = new ArrayList<>();
//set账单用户名称并添加
AllotBill allotBillEntity = allotBillService.getOne(id);
......@@ -77,7 +83,7 @@ public class AllotBillSelectController {
//如果接收装备详情不为空,分隔装备id并添加
if (allotBillEntity.getAllotCheckDetail() != null) {
for (Integer deviceId : StringSplitUtil.split(allotBillEntity.getAllotCheckDetail())) {
libraryEntities.add(deviceLibraryService.getOne(deviceId));
libraryEntities.add(deviceLibraryMap.get(deviceId));
}
}
list.add(libraryEntities);
......@@ -87,10 +93,12 @@ public class AllotBillSelectController {
@ApiOperation(value = "查询退回单详情页", notes = "可以通过这个接口查询退回单")
@GetMapping(value = "/archives/back/detail/{id}")
public ResponseEntity selectBackBillDetail(@PathVariable("id") int id) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
List<Object> list = new ArrayList<>();
//set账单用户名称并添加
AllotBackBill allotBillEntity = allotBackBillService.getOne(id);
allotBillEntity.setSendUsera(userService.getOne(allotBillEntity.getSendUseraId()).getName());
allotBillEntity.setSendUserb(allotBillEntity.getAgent());
if (allotBillEntity.getReceiveUseraId() != null) {
allotBillEntity.setReceiveUsera(userService.getOne(allotBillEntity.getReceiveUseraId()).getName());
}
......@@ -101,7 +109,7 @@ public class AllotBillSelectController {
//如果接收装备详情不为空,分隔装备id并添加
if (allotBillEntity.getBackCheckDetail() != null) {
for (Integer deviceId : StringSplitUtil.split(allotBillEntity.getBackCheckDetail())) {
libraryEntities.add(deviceLibraryService.getOne(deviceId));
libraryEntities.add(deviceLibraryMap.get(deviceId));
}
}
list.add(libraryEntities);
......
......@@ -142,6 +142,10 @@ public class AllotBackBill {
@Transient
private String sendUsera;
@ApiModelProperty(value = "发件经办人(B岗位)")
@Transient
private String sendUserb;
@ApiModelProperty(value = "收件经办人(A岗位)")
@Transient
private String receiveUsera;
......
......@@ -5,6 +5,7 @@ import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
import com.tykj.dev.device.destroy.entity.enums.DestroyStatus;
import com.tykj.dev.device.destroy.entity.vo.*;
import com.tykj.dev.device.destroy.service.DeviceDestroyBillService;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
......@@ -67,6 +68,8 @@ public class DeviceDestroyController {
private UserUtils userUtils;
@Autowired
private InputOutputDeviceService inputOutputDeviceService;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
public DeviceDestroyController(DeviceDestroyBillService deviceDestroyBillServiceyBillService, TaskService taskService, DeviceLibraryService deviceLibraryService, UserPublicService userPublicService, DeviceLogService deviceLogService, TaskLogService taskLogService) {
this.deviceDestroyBillService = deviceDestroyBillServiceyBillService;
......@@ -129,6 +132,7 @@ public class DeviceDestroyController {
@ApiOperation(value = "查询销毁单详情", notes = "可以通过这个接口查询销毁单")
@GetMapping(value = "/detail")
public ResponseEntity selectDestroyDetail(@Validated @NotNull Integer destroyId) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
//装备文号
String docNumber;
DeviceDestroyDetailResultVo destroyDetailResultVo;
......@@ -140,7 +144,7 @@ public class DeviceDestroyController {
List<Integer> destroyDetail = StringSplitUtil.split(destroyBill.getDestroyDeviceDetail());
for (Integer id : destroyDetail) {
if (id > 0) {
DeviceLibrary d = deviceLibraryService.getOne(id);
DeviceLibrary d = deviceLibraryMap.get(id);
devices.add(d);
nameSet.add(d.getName());
modelSet.add(d.getModel());
......
......@@ -7,6 +7,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
/**
* @author dengdiyi
......@@ -147,4 +148,8 @@ public interface DeviceLibraryService {
int getDeviceCount();
/**
* 获取所有装备map
*/
Map<Integer,DeviceLibrary> getAllDeviceMap();
}
......@@ -15,6 +15,8 @@ public interface DeviceLogService {
*/
void addLog(DeviceLogDto deviceLogDto);
void addAllLog(List<DeviceLogDto> deviceLogDtos);
void sendHash(DeviceLog deviceLog);
/**
......
......@@ -26,6 +26,7 @@ import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.stream.Collectors;
import static java.util.stream.Collectors.groupingBy;
......@@ -461,6 +462,13 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return deviceLibraryDao.findAll(predicateBuilder.build()).size();
}
@Override
public Map<Integer, DeviceLibrary> getAllDeviceMap() {
List<DeviceLibrary> libraries = deviceLibraryDao.findAll();
libraries.forEach(DeviceLibrary::setConfigName);
return libraries.stream().collect(Collectors.toMap(DeviceLibrary::getId, Function.identity()));
}
@Override
public void isNotLoss(List<Integer> ids) {
ids.forEach(integer -> {
......
......@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
/**
......@@ -43,6 +44,20 @@ public class DeviceLogServiceImpl implements DeviceLogService {
}, TaskBeanConfig.getThreadPoolTaskScheduler());
}
@Override
public void addAllLog(List<DeviceLogDto> deviceLogDtos) {
List<DeviceLog> deviceLogs = deviceLogDao.saveAll(deviceLogDtos.stream().map(DeviceLogDto::toDo).collect(Collectors.toList()));
CompletableFuture.runAsync(()->{
deviceLogs.forEach(deviceLog -> {
DeviceLog deviceLog1 = deviceLogDao.findById(deviceLog.getId()).get();
BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(deviceLog1));
String recordId = bcText.getData().getRecordID();
deviceLog1.setRecordId(recordId);
deviceLogDao.save(deviceLog1);
});
}, TaskBeanConfig.getThreadPoolTaskScheduler());
}
@Override
@Async
public void sendHash(DeviceLog deviceLog) {
......
......@@ -2,6 +2,7 @@ package com.tykj.dev.device.repair.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.repair.repository.RepairDetailDao;
......@@ -31,10 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -76,6 +74,9 @@ public class RepairBillSelectController {
@Autowired
private UserPublicService userPublicService;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
@ApiOperation(value = "查询工作台维修装备数量", notes = "可以通过这个接口查询工作台维修装备数量")
@GetMapping(value = "/repairNum")
public ResponseEntity getRepairNum(){
......@@ -126,6 +127,7 @@ public class RepairBillSelectController {
@ApiOperation(value = "查询维修单详情", notes = "可以通过这个接口查询维修单详情")
@GetMapping(value = "/archives/repair/detail/{id}")
public ResponseEntity selectRepairBillDetail(@PathVariable("id") int id) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
List<Object> list = new ArrayList<>();
//获取维修单
RepairBill repairBill = repairBillService.getOne(id);
......@@ -141,7 +143,7 @@ public class RepairBillSelectController {
if (s.length() >= 2 && "1".equals(s.substring(s.length() - 1))) {
Integer deviceId = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(deviceId);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(deviceId);
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraries.add(deviceLibraryEntity);
}
......@@ -165,15 +167,17 @@ public class RepairBillSelectController {
@ApiOperation(value = "查询领取单详情", notes = "可以通过这个接口查询领取单详情")
@GetMapping(value = "/archives/repairBack/detail/{id}")
public ResponseEntity selectRepairBackBillDetail(@PathVariable("id") int id) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
List<Object> list = new ArrayList<>();
//获取维修单
RepairBackBill repairBackBill = repairBackBillService.getOne(id);
if (repairBackBill.getStartUseraId() != null) {
repairBackBill.setStartUserA(userPublicService.getOne(repairBackBill.getStartUseraId()).getName());
}
if (repairBackBill.getStartUserbId() != null) {
repairBackBill.setStartUserB(userPublicService.getOne(repairBackBill.getStartUserbId()).getName());
}
repairBackBill.setStartUserB(repairBackBill.getAgent());
// if (repairBackBill.getStartUserbId() != null) {
// repairBackBill.setStartUserB(userPublicService.getOne(repairBackBill.getStartUserbId()).getName());
// }
if (repairBackBill.getReceiveUseraId() != null) {
repairBackBill.setReceiveUserA(userPublicService.getOne(repairBackBill.getReceiveUseraId()).getName());
}
......@@ -189,7 +193,7 @@ public class RepairBillSelectController {
if (s.length() >= 2 && "1".equals(s.substring(s.length() - 1))) {
Integer deviceId = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(deviceId);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(deviceId);
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraries.add(deviceLibraryEntity);
}
......
......@@ -1407,6 +1407,7 @@ public class RepairController {
@ApiOperation(value = "查询维修详情", notes = "可以通过这个接口查询维修详情")
@GetMapping(value = "/detail/{id}")
public ResponseEntity getDetail(@PathVariable("id") int id) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
//获取task
TaskBto taskBto = taskService.get(id);
RepairBillDetailVo repairBillDetailVo = new RepairBillDetailVo();
......@@ -1428,7 +1429,7 @@ public class RepairController {
if (s.length() >= 2 && "1".equals(s.substring(s.length() - 1))) {
Integer deviceId = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(deviceId);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(deviceId);
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraries.add(deviceLibraryEntity);
}
......@@ -1436,7 +1437,7 @@ public class RepairController {
}
//获取维修详情
List<RepairDetail> repairDetails = getRepairDetail(repairBill.getId());
repairDetails.forEach(repairDetail -> repairDetail.setLocationUnit(deviceLibraryService.getOne(repairDetail.getDeviceId()).getLocationUnit()));
repairDetails.forEach(repairDetail -> repairDetail.setLocationUnit(deviceLibraryMap.get(repairDetail.getDeviceId()).getLocationUnit()));
repairBillDetailVo.setRepairDetails(repairDetails);
//设置装备备注
deviceLibraries.forEach(deviceLibrary -> {
......@@ -1454,7 +1455,7 @@ public class RepairController {
if (s.length() >= 2 && "1".equals(s.substring(s.length() - 1))) {
Integer deviceId = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(deviceId);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(deviceId);
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraries1.add(deviceLibraryEntity);
}
......@@ -1481,9 +1482,10 @@ public class RepairController {
if (repairBackBill.getStartUseraId() != null) {
repairBackBill.setStartUserA(userPublicService.getOne(repairBackBill.getStartUseraId()).getName());
}
if (repairBackBill.getStartUserbId() != null) {
repairBackBill.setStartUserB(userPublicService.getOne(repairBackBill.getStartUserbId()).getName());
}
repairBackBill.setStartUserB(repairBackBill.getAgent());
// if (repairBackBill.getStartUserbId() != null) {
// repairBackBill.setStartUserB(userPublicService.getOne(repairBackBill.getStartUserbId()).getName());
// }
if (repairBackBill.getReceiveUseraId() != null) {
repairBackBill.setReceiveUserA(userPublicService.getOne(repairBackBill.getReceiveUseraId()).getName());
}
......@@ -1499,7 +1501,7 @@ public class RepairController {
if (s.length() >= 2 && "1".equals(s.substring(s.length() - 1))) {
Integer deviceId = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(deviceId);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(deviceId);
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraryList.add(deviceLibraryEntity);
}
......@@ -1511,7 +1513,7 @@ public class RepairController {
if (s.length() >= 2 && "1".equals(s.substring(s.length() - 1))) {
Integer deviceId = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(deviceId);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(deviceId);
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraryList2.add(deviceLibraryEntity);
}
......@@ -1521,7 +1523,7 @@ public class RepairController {
//获取维修详情
List<RepairDetail> repairDetailList = repairDetailDao.findByRepairBackBillId(repairBackBill.getId());
repairDetailList.forEach(repairDetail -> {
DeviceLibrary deviceLibrary = deviceLibraryService.getOne(repairDetail.getDeviceId());
DeviceLibrary deviceLibrary = deviceLibraryMap.get(repairDetail.getDeviceId());
repairDetail.setLocationUnit(deviceLibrary.getLocationUnit());
repairDetail.setConfigName();
});
......
......@@ -102,7 +102,7 @@ public class DeviceRetiredController {
DeviceRetiredResultVo deviceRetiredResultVo = calcDeviceRetiredResultVo(packingLibrary);
deviceRetiredResultVos.add(deviceRetiredResultVo);
});
return ResultUtil.success(deviceRetiredResultVos.stream().filter(deviceRetiredResultVo -> deviceRetiredResultVo.getCount()==0).collect(Collectors.toList()));
return ResultUtil.success(deviceRetiredResultVos.stream().filter(DeviceRetiredResultVo::devNumIsZero).collect(Collectors.toList()));
}
@ApiOperation(value = "提交退装表单", notes = "可以通过这个接口提交销毁表单发起退装流程")
......
......@@ -45,4 +45,26 @@ public class DeviceRetiredResultVo {
@ApiModelProperty(value = "数量", example = "1")
private List<DeviceRetiredResultVo> childNodes = new ArrayList<>();
public boolean devNumIsZero(){
if (this.count==0){
if (this.childNodes.size()>0){
for (DeviceRetiredResultVo d:this.childNodes) {
if (d.getCount()>0){
return false;
}
else if (!d.devNumIsZero()){
return false;
}
}
return true;
}
else {
return true;
}
}
else {
return false;
}
}
}
package com.tykj.dev.device.scrap.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
......@@ -52,6 +53,9 @@ public class DeviceScrapController {
@Autowired
private DeviceLogService deviceLogService;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
@ApiOperation(value = "查询列表", notes = "可以通过这个接口查询销毁单")
@PostMapping(value = "/summary")
public ResponseEntity selectRepairBill(@RequestBody ScrapSelectVo scrapSelectVo) {
......@@ -62,11 +66,12 @@ public class DeviceScrapController {
@ApiOperation(value = "查询列表详情", notes = "可以通过这个接口查询销毁单")
@PostMapping(value = "/summary/{scrapId}")
public ResponseEntity selectRepairBill1(@PathVariable Integer scrapId) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
List<Object> list = new ArrayList<>();
ScrapBill scrapBill = scrapBillService.getOne(scrapId);
list.add(scrapBill);
List<DeviceLibrary> deviceLibraries = StringSplitUtil.userIdSplit(scrapBill.getScrapDetail()).stream()
.map(integer -> deviceLibraryService.getOne(integer))
.map(deviceLibraryMap::get)
.collect(Collectors.toList());
list.add(deviceLibraries);
return ResponseEntity.ok(list);
......
......@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledFuture;
/**
......@@ -437,6 +438,7 @@ public class SelfCheckController {
@ApiOperation(value = "查询自查任务详情", notes = "可以通过这个接口查询自查任务详情")
@GetMapping(value = "/detail/{billId}")
public ResponseEntity selectDetail(@PathVariable("billId") int billId) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
List<Object> list = new ArrayList<>();
//获取业务
TaskBto taskBto = taskService.get(billId, BusinessEnum.SELF_CHECK.id);
......@@ -480,7 +482,7 @@ public class SelfCheckController {
if (s.length()>=2) {
Integer i = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length()-1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(i);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(i);
deviceLibraryEntity.setCheckResult(checkResult);
libraryEntities1.add(deviceLibraryEntity);
}
......
......@@ -354,6 +354,7 @@ public class BigScreenServiceImpl implements BigScreenService {
if (users.size()>0) {
users.forEach(
user -> {
if (user.getTrainStatus()!=5) {
UserDateScreen userDateScreen = new UserDateScreen();
if (map.containsKey(area.getId())) {
userDateScreen = map.get(area.getId());
......@@ -377,6 +378,7 @@ public class BigScreenServiceImpl implements BigScreenService {
userDateScreen.setUnitName(area.getName());
map.put(area.getId(), userDateScreen);
}
}
);
}
else {
......
......@@ -439,7 +439,7 @@ public class StatisticalServiceImpl implements StatisticalService {
@Override
public UserGeneralSituation getUserGeneralSituation() {
int count= (int) userDao.count();
int count= (int) userDao.findAllByIsDel(0).stream().filter(user -> user.getTrainStatus()!=5).count();
int hasTraining= 0;
List<UserSituationVo> list=new ArrayList<>();
List<Integer> ids= userDao.findAll().stream().filter(user -> user.getTrainStatus()!=null&&(user.getTrainStatus() == 1 || user.getTrainStatus() == 2)).map(User::getUserId).collect(Collectors.toList());
......
......@@ -230,6 +230,7 @@ public class StorageBillController {
// taskLogService.addLog(taskLogBto2);
//3.存装备
Integer parentId = null;
List<DeviceLogDto> deviceLogDtos = new ArrayList<>();
for (DeviceLibrarySaveVo d : storageBillSaveVo.getDeviceLibrarySaveVoList()) {
if (d.getRfidCardId()==null|| "".equals(d.getRfidCardId()) ||deviceLibraryDao.getAllByRfidCardId(d.getRfidCardId()).size()==0) {
DeviceLibrary saveEntity = new DeviceLibrary();
......@@ -264,13 +265,14 @@ public class StorageBillController {
stringBuffer.append(saveEntity.getId());
//存装备日志
DeviceLogDto deviceLogDto = new DeviceLogDto(saveEntity.getId(), "发起装备入库", fileVoList);
deviceLogService.addLog(deviceLogDto);
deviceLogDtos.add(deviceLogDto);
stringBuffer.append("x");
}
else {
throw new ApiException("系统中已存在rfid卡号为"+d.getRfidCardId()+"的装备!");
}
}
deviceLogService.addAllLog(deviceLogDtos);
//4.更新入库单入库详情
storageBillEntity.setStorageDetail(stringBuffer.toString());
storageBillService.update(storageBillEntity);
......@@ -337,19 +339,24 @@ public class StorageBillController {
@ApiOperation(value = "查询入库详情", notes = "可以通过这个接口查询入库详情")
@GetMapping(value = "/detail/{billId}")
public ResponseEntity selectDetail(@PathVariable("billId") int billId) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
StorageDetailVo storageDetailVo = new StorageDetailVo();
//获取taskBto和账单
TaskBto taskBto = taskService.get(billId, BusinessEnum.STORAGE.id);
StorageBill storageBillEntity = storageBillService.getOne(billId);
if (storageBillEntity.getReceiveUseraId()!=null) {
storageBillEntity.setReceiveUserA(userPublicService.getOne(storageBillEntity.getReceiveUseraId()).getName());
}
if (storageBillEntity.getReceiveUserbId()!=null) {
storageBillEntity.setReceiveUserB(userPublicService.getOne(storageBillEntity.getReceiveUserbId()).getName());
}
storageDetailVo.setStorageBill(storageBillEntity);
String str = storageBillEntity.getStorageDetail();
List<Integer> list1 = StringSplitUtil.userIdSplit(str);
//获取入库装备
List<DeviceLibrary> libraryEntities = new ArrayList<>();
for (Integer deviceId : list1) {
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(deviceId);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(deviceId);
libraryEntities.add(deviceLibraryEntity);
}
storageDetailVo.setDeviceLibraryList(libraryEntities);
......@@ -411,7 +418,9 @@ public class StorageBillController {
storageBillEntity.setReplyFileList(FilesUtil.stringFileToList(storageBillEntity.getReplyFiles()));
List<StorageBillDetailVo> storageBillDetailVos = JacksonUtil.readValue(storageBillEntity.getPackingDetail(), new TypeReference<List<StorageBillDetailVo>>() {
});
if (storageBillDetailVos != null) {
setPackingLibrary(storageBillDetailVos);
}
storageBillEntity.setStorageBillDetailVos(storageBillDetailVos);
return ResponseEntity.ok(storageBillEntity);
}
......
......@@ -8,6 +8,7 @@ import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.apply.service.DeviceApplyBillService;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
......@@ -49,6 +50,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -111,9 +113,13 @@ public class TaskSelectController {
@Autowired
private TaskDao taskDao;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
@ApiOperation(value = "查询业务对应页面的数据", notes = "可以通过这个接口查询业务对应页面的数据")
@GetMapping("/manage/detail/{id}")
public ResponseEntity selectData(@PathVariable("id") int taskId) {
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
TaskBto taskBto = taskService.get(taskId);
Integer bussinessType = taskBto.getBusinessType();
Integer billId = taskBto.getBillId();
......@@ -139,7 +145,7 @@ public class TaskSelectController {
List<Integer> list1 = StringSplitUtil.userIdSplit(str);
List<DeviceLibrary> libraryEntities = new ArrayList<>();
for (Integer id : list1) {
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(id);
libraryEntities.add(deviceLibraryEntity);
}
list.add(libraryEntities);
......@@ -187,9 +193,10 @@ public class TaskSelectController {
if (allotBillEntity.getSendUseraId() != null) {
allotBillEntity.setSenderUserA(userPublicService.getOne(allotBillEntity.getSendUseraId()).getName());
}
if (allotBillEntity.getSendUserbId() != null) {
allotBillEntity.setSenderUserB(userPublicService.getOne(allotBillEntity.getSendUserbId()).getName());
}
// if (allotBillEntity.getSendUserbId() != null) {
// allotBillEntity.setSenderUserB(userPublicService.getOne(allotBillEntity.getSendUserbId()).getName());
// }
allotBillEntity.setSenderUserB(allotBillEntity.getAgent());
if (allotBillEntity.getReceiveUseraId() != null) {
allotBillEntity.setReceiveUserA(userPublicService.getOne(allotBillEntity.getReceiveUseraId()).getName());
}
......@@ -205,7 +212,7 @@ public class TaskSelectController {
if (s.length() >= 2 && "1".equals(s.substring(s.length() - 1))) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(id);
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraryEntities.add(deviceLibraryEntity);
}
......@@ -226,7 +233,7 @@ public class TaskSelectController {
if (s.length() >= 2 && "1".equals(s.substring(s.length() - 1))) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(id);
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraries.add(deviceLibraryEntity);
}
......@@ -239,6 +246,7 @@ public class TaskSelectController {
if (allotBackBill.getSendUseraId() != null) {
allotBackBill.setSendUsera(userPublicService.getOne(allotBackBill.getSendUseraId()).getName());
}
allotBackBill.setSendUserb(allotBackBill.getAgent());
if (allotBackBill.getReceiveUseraId() != null) {
allotBackBill.setReceiveUsera(userPublicService.getOne(allotBackBill.getReceiveUseraId()).getName());
}
......@@ -257,7 +265,7 @@ public class TaskSelectController {
if (s.length() >= 2 && "1".equals(s.substring(s.length() - 1))) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(id);
deviceLibraryEntity.setCheckResult(checkResult);
libraryArrayList.add(deviceLibraryEntity);
}
......@@ -305,7 +313,7 @@ public class TaskSelectController {
if (s.length() >= 2) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(id);
deviceLibraryEntity.setCheckResult(checkResult);
libraryEntities1.add(deviceLibraryEntity);
}
......@@ -364,7 +372,7 @@ public class TaskSelectController {
AllotBill allotBill = allotBillService.getOne(task.getBillId());
if (allotBill.getAllotCheckDetail() != null) {
StringSplitUtil.split(allotBill.getAllotCheckDetail()).forEach(integer -> {
deviceLibraries.add(deviceLibraryService.getOne(integer));
deviceLibraries.add(deviceLibraryMap.get(integer));
});
}
}
......
......@@ -20,4 +20,6 @@ public interface UserDao extends JpaRepository<User, Integer>, JpaSpecificationE
@Query("select max(o.showOrder) from User o where o.unitsId = ?1")
int maxShowOrder(Integer unitsId);
List<User> findAllByIsDel(Integer isDel);
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论