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

更新

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