提交 83606bac authored 作者: zjm's avatar zjm

Merge branch 'dev' of git.yfzx.zjtys.com.cn:matrix/device-back into feature-check

......@@ -22,6 +22,7 @@ import com.tykj.dev.device.repair.subject.vo.DeviceDetailVo;
import com.tykj.dev.device.repair.subject.vo.RevokeUnderTask;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.dao.UserDao;
......@@ -93,6 +94,9 @@ public class BackController {
@Autowired
private UnitsService unitsService;
@Autowired
private UnitsCache unitsCache;
@ApiOperation(value = "发起退回业务", notes = "可以通过这个接口发起退回任务")
@PostMapping(value = "/addBackBill")
@Transactional(rollbackFor = Exception.class)
......@@ -965,7 +969,8 @@ public class BackController {
AllotBackBill allotBackBill = allotBackBillService.getOne(billId);
//修改装备得所属所在
// deviceLibraryService.updateLocalAndOwn(allotBackBill.getReceiveUnit(),deviceIds);
deviceLibraryService.updateLocalAndOwn(unitsService.findById(allotBackBill.getReceiveUnitId()).getName(),deviceIds);
// deviceLibraryService.updateLocalAndOwn(unitsService.findById(allotBackBill.getReceiveUnitId()).getName(),deviceIds);
deviceLibraryService.updateLocalAndOwn(unitsCache.findById(allotBackBill.getReceiveUnitId()).getName(),deviceIds);
allotBackBillService.deleteByAllotBackId(billId);
taskService.deleteById(taskId);
return ResponseEntity.ok("撤回成功");
......
......@@ -241,7 +241,7 @@ public class DeviceLibraryController {
@Autowired
private UnitStoreLocationService unitStoreLocationService;
@ApiOperation(value = "模糊查询核心装备分页", notes = "可以通过这个接口查询装备列表")
@ApiOperation(value = "模糊查询核心装备分页", notes = "可以通过这个接口查询装备列表 全省库")
@PostMapping("/core/feature/summary")
public ResponseEntity selectCoreDevicePage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
......@@ -259,6 +259,8 @@ public class DeviceLibraryController {
// Boolean hasTypeDim = deviceLibrarySelectVo.getTypeDim()!=null;
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
List<DeviceLibrary> resultList = deviceLibraryService.getCoreDevicePage(deviceLibrarySelectVo);
Map<String,Object> map = new HashMap<>();
map.put("resultList",resultList);
if (hasModelDim||hasLifeStatusDim||hasLocationUnitDim||hasNameDim||hasOwnUnitDim||hasSeqDim) {
resultList = resultList.stream().filter(deviceLibrary -> {
Boolean containModelDim = !hasModelDim||deviceLibrary.getModel().contains(deviceLibrarySelectVo.getModelDim());
......@@ -276,7 +278,6 @@ public class DeviceLibraryController {
}
// List<DeviceVo> deviceVos = resultList.stream().map(DeviceLibrary::parseVo).collect(Collectors.toList());
Page<DeviceLibrary> deviceLibraryEntities = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), resultList, deviceLibrarySelectVo.getPageable());
Map<String,Object> map = new HashMap<>();
Map<Integer,String> lifeStatusMap = configCache.getLifeStatusMap();
//
Map<Integer, String> styleMap = configCache.getStyleMap();
......
......@@ -13,6 +13,7 @@ import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary;
import com.tykj.dev.device.matching.subject.vo.MatchingUnitVo;
import com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo;
import com.tykj.dev.device.matching.subject.vo.RelationDeviceVo;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.device.user.subject.service.UserPublicService;
......@@ -31,6 +32,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.util.*;
......@@ -62,6 +64,9 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
@Autowired
private RfidService rfidService;
@Resource
private UnitsCache unitsCache;
@Override
public MatchingDeviceLibrary addEntity(MatchingDeviceLibrary matchingDeviceLibraryEntity) {
MatchingDeviceLibrary matchingDeviceLibrary = matchingDeviceLibraryDao.save(matchingDeviceLibraryEntity);
......@@ -199,7 +204,8 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
// .collect(Collectors.toList());
List<MatchingDeviceLibrary> resultList = matchingDeviceLibraryDao.findAll(getPredicate(matchingDeviceSelectVo).build())
.stream()
.filter(matchingDeviceLibraryEntity -> units.contains(unitsService.findById(matchingDeviceLibraryEntity.getCreateUnitId()).getName()))
.filter(matchingDeviceLibraryEntity -> units.contains(
unitsCache.findById(matchingDeviceLibraryEntity.getCreateUnitId()).getName()))
.collect(Collectors.toList());
// List<MatchingDeviceLibrary> resultList = matchingDeviceLibraryDao.findAll().stream()
// .filter(matchingDeviceLibraryEntity -> units.contains(matchingDeviceLibraryEntity.getCreateUnit()))
......
......@@ -31,6 +31,7 @@ import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.dao.UserDao;
......@@ -55,6 +56,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.Executor;
import java.util.stream.Collectors;
......@@ -144,6 +146,9 @@ public class RepairController {
@Autowired
private RepairDetailService repairDetailService;
@Resource
private UnitsCache unitsCache;
@ApiOperation(value = "判断维修装备是否同一个送修单位", notes = "可以通过这个接口判断维修装备是否同一个送修单位")
@PostMapping(value = "/judge")
@Transactional(rollbackFor = Exception.class)
......@@ -161,7 +166,8 @@ public class RepairController {
List<Integer> collect = sendUnits.stream().distinct().collect(Collectors.toList());
//如果是同一单位返回单位名称,否则返error
if (collect.size() == 1) {
Units units = unitsService.findById(collect.get(0));
// Units units = unitsService.findById(collect.get(0));
Units units = unitsCache.findById(collect.get(0));
// return ResponseEntity.ok(sendUnits.iterator().next());
return ResponseEntity.ok(units);
} else {
......@@ -1577,7 +1583,7 @@ public class RepairController {
//获取旧状态 下级送来的
Integer oldStatus = repairDetail1.getRepairStatus();
// if (repairStatusChangeVo.getNewStatus() == 2 && repairDetail1.getOwnUnit().equals(userUtils.getCurrentUserUnitName())) {
if (repairStatusChangeVo.getNewStatus() == 2 && unitsService.findById(repairDetail1.getOwnUnitId()).getName().equals(userUtils.getCurrentUserUnitName())) {
if (repairStatusChangeVo.getNewStatus() == 2 && unitsCache.findById(repairDetail1.getOwnUnitId()).getName().equals(userUtils.getCurrentUserUnitName())) {
repairDetail1.setRepairStatus(5);
} else {
//修改当前任务维修详情单该装备状态
......@@ -1991,7 +1997,7 @@ public class RepairController {
// .filter(repairDetail -> repairDetail.getRepairBackBillId()!=null)
// .collect(Collectors.toList());
List<RepairDetail> repairDetails2 = repairDetails.stream()
.filter(repairDetail -> units.contains(unitsService.findById(repairDetail.getLocationUnitId()).getName())
.filter(repairDetail -> units.contains(unitsCache.findById(repairDetail.getLocationUnitId()).getName())
&& (!hasYear || repairDetail.getUpdateTime().getYear() == year - 1900))
.filter(repairDetail -> repairDetail.getRepairBackBillId()!=null)
.collect(Collectors.toList());
......@@ -2080,7 +2086,9 @@ public class RepairController {
//所在在当前单位的
// List<RepairDetail> repairDetails2 = repairDetails.stream().filter(repairDetail -> repairDetail.getLocationUnit().equals(unitName)).collect(Collectors.toList());
List<RepairDetail> repairDetails2 = repairDetails.stream().filter(repairDetail ->
unitsService.findById(repairDetail.getLocationUnitId()).getName().equals(unitName)).collect(Collectors.toList());
// unitsService.findById(repairDetail.getLocationUnitId()).getName().equals(unitName))
unitsCache.findById(repairDetail.getLocationUnitId()).getName().equals(unitName))
.collect(Collectors.toList());
List<WaitingRepairEquipmentVo> waitingRepairEquipments = new ArrayList<>();
for (RepairDetail repairDetail : repairDetails2) {
TaskBto taskBto = taskService.getParentTaskIsNull(repairDetail.getDeviceRepairBillId(), 5);
......@@ -2605,23 +2613,23 @@ public class RepairController {
// } else {
// return repairDetail.getRepairBackBillId() == null && repairDetail.getRepairStatus().equals(RepairStatusEnum.WAIT_REPAIR.id) && repairDetail.getLocationUnit().equals(repairDetail.getOwnUnit());
// }
if (!unitsService.findById(repairDetail.getLocationUnitId()).equals(unitsService.findById(repairDetail.getOwnUnitId()))) {
if (!unitsCache.findById(repairDetail.getLocationUnitId()).equals(unitsCache.findById(repairDetail.getOwnUnitId()))) {
// return repairDetail.getRepairBackBillId() == null && repairDetail.getRepairStatus().equals(RepairStatusEnum.WAIT_REPAIR.id) && repairDetail.getLocationUnit().equals(currentUserUnitName);
return repairDetail.getRepairBackBillId() == null &&
repairDetail.getRepairStatus().equals(RepairStatusEnum.WAIT_REPAIR.id) &&
unitsService.findById(repairDetail.getLocationUnitId()).getName().equals(currentUserUnitName);
unitsCache.findById(repairDetail.getLocationUnitId()).getName().equals(currentUserUnitName);
} else {
// return repairDetail.getRepairBackBillId() == null && repairDetail.getRepairStatus().equals(RepairStatusEnum.WAIT_REPAIR.id)
// && repairDetail.getLocationUnit().equals(repairDetail.getOwnUnit());
return repairDetail.getRepairBackBillId() == null && repairDetail.getRepairStatus().equals(RepairStatusEnum.WAIT_REPAIR.id)
&& unitsService.findById(repairDetail.getLocationUnitId()).getName()
.equals(unitsService.findById(repairDetail.getOwnUnitId()).getName());
&& unitsCache.findById(repairDetail.getLocationUnitId()).getName()
.equals(unitsCache.findById(repairDetail.getOwnUnitId()).getName());
}
}).collect(Collectors.toList());
repairDetails.forEach(repairDetail -> {
// if (repairDetail.getLocationUnit().equals(repairDetail.getOwnUnit()))
if (unitsService.findById(repairDetail.getLocationUnitId()).getName()
.equals(unitsService.findById(repairDetail.getOwnUnitId()).getName())){
if (unitsCache.findById(repairDetail.getLocationUnitId()).getName()
.equals(unitsCache.findById(repairDetail.getOwnUnitId()).getName())){
repairDetail.setDeviceRepairBillId(0);
repairDetail.setRepairStatus(RepairStatusEnum.WAIT_SEND.id);
repairDetail.setLocationUnit(deviceLibraryService.getOne(
......@@ -2722,10 +2730,10 @@ public class RepairController {
// .collect(Collectors.toList());
List<RepairDetail> repairDetails = byRepairBackBillId.stream().filter(repairDetail ->
repairDetail.getDeviceRepairBillId() != null &&
!unitsService.findById(repairDetail.getLocationUnitId()).getName()
.equals(unitsService.findById(repairDetail.getOwnUnitId()).getName()) &&
!unitsCache.findById(repairDetail.getLocationUnitId()).getName()
.equals(unitsCache.findById(repairDetail.getOwnUnitId()).getName()) &&
repairDetail.getRepairStatus().equals(RepairStatusEnum.RECEIVE_WAIT_STORAGE.id)
&& unitsService.findById(repairDetail.getLocationUnitId()).getName().equals(currentUserUnitName))
&& unitsCache.findById(repairDetail.getLocationUnitId()).getName().equals(currentUserUnitName))
.collect(Collectors.toList());
for (RepairDetail repairDetail : repairDetails) {
repairDetail.setRepairBackBillId(null);
......
......@@ -24,6 +24,7 @@ import com.tykj.dev.device.repair.subject.vo.SetDevicesOwnUnit;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.entity.User;
......@@ -41,6 +42,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
......@@ -81,6 +83,9 @@ public class RepairDetailServiceImpl implements RepairDetailService {
@Autowired
private DeviceLogService deviceLogService;
@Resource
private UnitsCache unitsCache;
@Override
public RepairDetail save(RepairDetail deviceRepairDetailEntity) {
RepairDetail repairDetail = deviceRepairDetailDao.save(deviceRepairDetailEntity);
......@@ -348,7 +353,8 @@ public class RepairDetailServiceImpl implements RepairDetailService {
List<String> names = superiorUnitsList.stream().map(Units::getName).collect(Collectors.toList());
// List<RepairDetail> exceptionList = repairDetails.stream().filter(repairDetail -> names.contains(repairDetail.getLocationUnit())).sorted(Comparator.comparing(RepairDetail::getCreateTime)).collect(Collectors.toList());
List<RepairDetail> exceptionList = repairDetails.stream().filter(repairDetail ->
names.contains(unitsService.findById(repairDetail.getLocationUnitId()).getName()))
// names.contains(unitsService.findById(repairDetail.getLocationUnitId()).getName()))
names.contains(unitsCache.findById(repairDetail.getLocationUnitId()).getName()))
.sorted(Comparator.comparing(RepairDetail::getCreateTime)).collect(Collectors.toList());
repairDetails.removeAll(exceptionList);
//维修未入库 等待维修分为接收区装备和市发起维修
......
......@@ -315,7 +315,8 @@ public class BigScreenServiceImpl implements BigScreenService {
// .sorted(Comparator.comparing(SelfCheckBill::getUpdateTime,Comparator.nullsLast(Date::compareTo)).reversed())
// .collect(Collectors.toList());
List<SelfCheckBill> selfCheckBillList = selfCheckBills.stream()
.filter(selfCheckBill -> unitsService.findById(selfCheckBill.getCheckUnitId()).getName().equals(unitName))
// .filter(selfCheckBill -> unitsService.findById(selfCheckBill.getCheckUnitId()).getName().equals(unitName))
.filter(selfCheckBill -> unitsCache.findById(selfCheckBill.getCheckUnitId()).getName().equals(unitName))
.sorted(Comparator.comparing(SelfCheckBill::getUpdateTime,Comparator.nullsLast(Date::compareTo)).reversed())
.collect(Collectors.toList());
if (!selfCheckBillList.isEmpty()) {
......
......@@ -256,7 +256,8 @@ public class StatisticalServiceImpl implements StatisticalService {
Map<String,Integer> selfCheckBillMap = selfCheckBills.stream().filter(selfCheckBill ->selfCheckBill.getCycle()!=null
&& selfCheckBill.getTitle().equals(selfCheckBillList.get(0).getTitle()))
.collect(Collectors.toMap(selfCheckBill ->
unitsService.findById(selfCheckBill.getCheckUnitId()).getName()
// unitsService.findById(selfCheckBill.getCheckUnitId()).getName()
unitsCache.findById(selfCheckBill.getCheckUnitId()).getName()
,SelfCheckBill::getCheckStatus,(v1, v2)->v1));
//获取所有市
List<Area> areas = areaDao.findAreasByType(2);
......@@ -523,7 +524,8 @@ public class StatisticalServiceImpl implements StatisticalService {
WorkBench workBench = new WorkBench();
DeviceLibrarySelectVo deviceLibrarySelectVo = new DeviceLibrarySelectVo();
// deviceLibrarySelectVo.setAreaId(areaCache.findByName("浙江省").getId());
deviceLibrarySelectVo.setAreaId(unitsService.findById(unit).getAreaId());
// deviceLibrarySelectVo.setAreaId(unitsService.findById(unit).getAreaId());
deviceLibrarySelectVo.setAreaId(unitsCache.findById(unit).getAreaId());
workBench.setPackingNum(packingLibraryDao.findAllByIsRootAndPackingStatus(0,2).size());
// List<DeviceLibrary> deviceLibraries = deviceLibraryService.getCoreDevicePage(deviceLibrarySelectVo);
List<DeviceLibrary> deviceLibraries = deviceLibraryService.getDeviceByUnitNameAll(unit);
......@@ -593,7 +595,7 @@ public class StatisticalServiceImpl implements StatisticalService {
// .sorted(Comparator.nullsLast(Comparator.comparing(SelfCheckBill::getUpdateTime).reversed()))
// .collect(Collectors.toList());
List<SelfCheckBill> selfCheckBillList = selfCheckBills.stream()
.filter(selfCheckBill -> unitsService.findById(selfCheckBill.getCheckUnitId()).getName().equals(unitName)
.filter(selfCheckBill -> unitsCache.findById(selfCheckBill.getCheckUnitId()).getName().equals(unitName)
&& selfCheckBill.getCheckedCount() != null)
.sorted(Comparator.nullsLast(Comparator.comparing(SelfCheckBill::getUpdateTime).reversed()))
.collect(Collectors.toList());
......@@ -602,7 +604,7 @@ public class StatisticalServiceImpl implements StatisticalService {
// .sorted(Comparator.nullsLast(Comparator.comparing(DeviceCheckDetail::getUpdateTime).reversed()))
// .collect(Collectors.toList());
List<DeviceCheckDetail> deviceCheckDetailList = deviceCheckDetails.stream()
.filter(deviceCheckDetail -> unitsService.findById(deviceCheckDetail.getCheckUnitId()).getName().equals(unitName)
.filter(deviceCheckDetail -> unitsCache.findById(deviceCheckDetail.getCheckUnitId()).getName().equals(unitName)
&& deviceCheckDetail.getCheckedCount() != null)
.sorted(Comparator.nullsLast(Comparator.comparing(DeviceCheckDetail::getUpdateTime).reversed()))
.collect(Collectors.toList());
......@@ -745,7 +747,7 @@ public class StatisticalServiceImpl implements StatisticalService {
// .collect(Collectors.toList());
List<SelfCheckBill> selfCheckBillList = selfCheckBills.stream()
.filter(selfCheckBill -> selfCheckBill.getTitle().contains(quarter)&&
unitsService.findById(selfCheckBill.getCheckUnitId()).getName().equals(units.get(0).getName()))
unitsCache.findById(selfCheckBill.getCheckUnitId()).getName().equals(units.get(0).getName()))
.collect(Collectors.toList());
if(selfCheckBillList.size()==1){
SelfCheckBill selfCheckBill = selfCheckBillList.get(0);
......
......@@ -3,6 +3,7 @@ package com.tykj.dev.device.usereport.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.file.entity.WrodParameter;
import com.tykj.dev.device.file.service.UseReportFIleService;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.subject.entity.SecurityUser;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.service.UnitsService;
......@@ -26,6 +27,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......@@ -49,6 +51,9 @@ public class DeviceUseReportController {
@Autowired
UnitsService unitsService;
@Resource
private UnitsCache unitsCache;
@Autowired
private UseReportFIleService useReportFIleService;
@ApiOperation(value = "模糊查询装备使用报告分页", notes = "可以通过这个接口模糊查询装备使用报告分页")
......@@ -103,7 +108,8 @@ public class DeviceUseReportController {
//新建word模板
WrodParameter wrodParameter = deviceUseReportDetailVo.toWrodParameter();
// Units units= unitsService.findbyName(deviceUseReportDetailVo.getUnit());
Units units= unitsService.findById(deviceUseReportDetailVo.getUnitId());
// Units units= unitsService.findById(deviceUseReportDetailVo.getUnitId());
Units units= unitsCache.findById(deviceUseReportDetailVo.getUnitId());
Instant instant = deviceUseReportDetailVo.getCreateTime().toInstant();
ZoneId zone = ZoneId.systemDefault();
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone);
......
......@@ -27,6 +27,7 @@ import com.tykj.dev.device.sendback.entity.vo.RepelManagementVo;
import com.tykj.dev.device.sendback.service.RepelQueryService;
import com.tykj.dev.device.storage.repository.StorageBillDao;
import com.tykj.dev.device.storage.subject.domin.StorageBill;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
......@@ -105,6 +106,9 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
@Autowired
private UnitsService unitsService;
@Autowired
private UnitsCache unitsCache;
@Override
public DeviceUseReport addEntity(DeviceUseReport deviceUseReportEntity) {
return deviceUseReportDao.save(deviceUseReportEntity);
......@@ -393,7 +397,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
// .collect(toList());
List<AllotBackBill> receiveAllotBackBills = allotBackBillDao.findAll().stream()
.filter(allotBackBill -> allotBackBill.getBackStatus() == 3 &&
userUtils.getCurrentUserUnitName().equals(unitsService.findById(allotBackBill.getReceiveUnitId()).getName())
userUtils.getCurrentUserUnitName().equals(unitsCache.findById(allotBackBill.getReceiveUnitId()).getName())
&& allotBackBill.getReceiveTime().after(date) && allotBackBill.getReceiveTime().before(date2))
.collect(toList());
//接收退回
......@@ -412,7 +416,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
// .collect(toList());
List<AllotBackBill> sendAllotBackBills = allotBackBillDao.findAll().stream()
.filter(allotBackBill -> allotStatusBackList.contains(allotBackBill.getBackStatus()) &&
userUtils.getCurrentUserUnitName().equals(unitsService.findById(allotBackBill.getSendUnitId()).getName())
userUtils.getCurrentUserUnitName().equals(unitsCache.findById(allotBackBill.getSendUnitId()).getName())
&& allotBackBill.getSendTime().after(date) && allotBackBill.getSendTime().before(date2))
.collect(toList());
//发起退回
......@@ -475,7 +479,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
// .collect(toList());
String currentUserUnitName = userUtils.getCurrentUserUnitName();
List<RepairSendBill> repairDetails = repairSendBillDao.findAll().stream()
.filter(repairSendBill -> currentUserUnitName.equals(unitsService.findById(repairSendBill.getSendUnitId()).getName())
.filter(repairSendBill -> currentUserUnitName.equals(unitsCache.findById(repairSendBill.getSendUnitId()).getName())
&& toUpRepairStatusList.contains(repairSendBill.getRepairStatus()) &&
repairSendBill.getUpdateTime().after(date) && repairSendBill.getUpdateTime().before(date2))
.collect(toList());
......@@ -493,7 +497,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
// .filter(repairSendBill -> repairSendBill.getReceiveUnit().equals(userUtils.getCurrentUserUnitName()) && toUpRepairStatusList.contains(repairSendBill.getRepairStatus()) && repairSendBill.getUpdateTime().after(date) && repairSendBill.getUpdateTime().before(date2))
// .collect(toList());
List<RepairSendBill> toUpRepairList = repairSendBillDao.findAll().stream()
.filter(repairSendBill -> currentUserUnitName.equals(unitsService.findById(repairSendBill.getReceiveUnitId()).getName())
.filter(repairSendBill -> currentUserUnitName.equals(unitsCache.findById(repairSendBill.getReceiveUnitId()).getName())
&& toUpRepairStatusList.contains(repairSendBill.getRepairStatus()) && repairSendBill.getUpdateTime().after(date) && repairSendBill.getUpdateTime().before(date2))
.collect(toList());
if (toUpRepairList.size()>0){
......@@ -510,7 +514,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
// .filter(repairBackBill -> repairBackBill.getReceiveUnit().equals(userUtils.getCurrentUserUnitName()) && repairBackList.contains(repairBackBill.getBackStatus()) && repairBackBill.getUpdateTime().after(date) && repairBackBill.getUpdateTime().before(date2))
// .collect(toList());
List<RepairBackBill> repairBackBills = repairBackBillDao.findAll().stream()
.filter(repairBackBill -> unitsService.findById(repairBackBill.getReceiveUnitId()).getName().equals(currentUserUnitName)
.filter(repairBackBill -> unitsCache.findById(repairBackBill.getReceiveUnitId()).getName().equals(currentUserUnitName)
&& repairBackList.contains(repairBackBill.getBackStatus()) && repairBackBill.getUpdateTime().after(date)
&& repairBackBill.getUpdateTime().before(date2))
.collect(toList());
......@@ -520,7 +524,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
// .filter(repairBackBill -> repairBackBill.getSendUnit().equals(userUtils.getCurrentUserUnitName()) && repairBackList.contains(repairBackBill.getBackStatus()) && repairBackBill.getUpdateTime().after(date) && repairBackBill.getUpdateTime().before(date2))
// .collect(toList());
List<RepairBackBill> repairBackBillList = repairBackBillDao.findAll().stream()
.filter(repairBackBill -> unitsService.findById(repairBackBill.getSendUnitId()).getName().equals(currentUserUnitName) && repairBackList.contains(repairBackBill.getBackStatus()) && repairBackBill.getUpdateTime().after(date) && repairBackBill.getUpdateTime().before(date2))
.filter(repairBackBill -> unitsCache.findById(repairBackBill.getSendUnitId()).getName().equals(currentUserUnitName) && repairBackList.contains(repairBackBill.getBackStatus()) && repairBackBill.getUpdateTime().after(date) && repairBackBill.getUpdateTime().before(date2))
.collect(toList());
//将数量进行新增 累加数量
......@@ -596,7 +600,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
// .collect(toList());
List<RepairSendBill> repairSendBills = repairSendBillDao.findAll().stream()
.filter(repairSendBill -> repairSendBill.getRepairStatus() == 5 &&
userPublicService.findByUnitsToname(1).equals(unitsService.findById(repairSendBill.getSendUnitId()).getName()) &&
userPublicService.findByUnitsToname(1).equals(unitsCache.findById(repairSendBill.getSendUnitId()).getName()) &&
repairSendBill.getSendTime().after(startDate) && repairSendBill.getSendTime().before(endDate))
.collect(toList());
//获取所有维修的装备
......@@ -627,7 +631,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
// .collect(toList());
List<RepairBackBill> backBills = repairBackBillDao.findAll().stream()
.filter(repairBackBill -> repairBackBill.getBackStatus() == 5 &&
userPublicService.findByUnitsToname(1).equals(unitsService.findById(repairBackBill.getReceiveUnitId()).getName()) && repairBackBill.getCreateTime().after(startDate) && repairBackBill.getCreateTime().before(endDate))
userPublicService.findByUnitsToname(1).equals(unitsCache.findById(repairBackBill.getReceiveUnitId()).getName()) && repairBackBill.getCreateTime().after(startDate) && repairBackBill.getCreateTime().before(endDate))
.collect(toList());
//获取所有的装备维修退回的
if (backBills.size()>0){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论