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

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

...@@ -4,6 +4,7 @@ import com.tykj.dev.device.user.subject.entity.Units; ...@@ -4,6 +4,7 @@ import com.tykj.dev.device.user.subject.entity.Units;
import lombok.Data; import lombok.Data;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
...@@ -81,4 +82,20 @@ public class UnitsCache { ...@@ -81,4 +82,20 @@ public class UnitsCache {
return new ArrayList<>(idMap.values()).stream().filter(units -> areaIds.contains(units.getAreaId())).collect(Collectors.toList()); return new ArrayList<>(idMap.values()).stream().filter(units -> areaIds.contains(units.getAreaId())).collect(Collectors.toList());
} }
/**
* 根据单位id的集合给集合进行排序
* @param ids 单位id集合
* @return 单位id集合
*/
public List<Integer> sortReasonUnitsIds(List<Integer> ids){
return ids.stream().sorted(Comparator.comparing(id->idMap.get(id).getShowOrder())).collect(Collectors.toList());
}
public List<Units> sortReasonUnits(List<Units> unitsList){
return unitsList.stream().sorted(Comparator.comparing(Units::getShowOrder)).collect(Collectors.toList());
}
} }
...@@ -367,14 +367,23 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -367,14 +367,23 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
// List<AllotBill> allotBillEntities = allotBillDao.findAll().stream() // List<AllotBill> allotBillEntities = allotBillDao.findAll().stream()
// .filter(allotBillEntity -> allotBillEntity.getAllotStatus() == 5 && userUtils.getCurrentUserUnitName().equals(allotBillEntity.getReceiveUnit()) && allotBillEntity.getReceiveTime().after(date) && allotBillEntity.getReceiveTime().before(date2)) // .filter(allotBillEntity -> allotBillEntity.getAllotStatus() == 5 && userUtils.getCurrentUserUnitName().equals(allotBillEntity.getReceiveUnit()) && allotBillEntity.getReceiveTime().after(date) && allotBillEntity.getReceiveTime().before(date2))
// .collect(toList()); // .collect(toList());
Integer unitId = userUtils.getCurrentUnitId();
List<AllotBill> allotBillEntities = allotBillDao.findAll().stream() List<AllotBill> allotBillEntities = allotBillDao.findAll().stream()
.filter(allotBillEntity -> allotBillEntity.getAllotStatus() == 5 && .filter(allotBillEntity -> allotBillEntity.getAllotStatus() == 5 &&
userUtils.getCurrentUnitId().equals(allotBillEntity.getReceiveUnitId()) unitId.equals(allotBillEntity.getReceiveUnitId())
&& allotBillEntity.getReceiveTime().after(date) && allotBillEntity.getReceiveTime().before(date2)) && allotBillEntity.getReceiveTime().after(date) && allotBillEntity.getReceiveTime().before(date2))
.collect(toList()); .collect(toList());
//筛选出配发给其它单位的账单 发起配发 //筛选出配发给其它单位的账单 发起配发
// List<AllotBill> allotBillEntities2 = allotBillDao.findAll().stream()
// .filter(allotBillEntity -> allotStatusList.contains(allotBillEntity.getAllotStatus()) &&
// userUtils.getCurrentUserUnitName().equals(userPublicService.findUnitsNameByUserId(allotBillEntity.getSendUseraId()))
// && allotBillEntity.getSendTime().after(date) && allotBillEntity.getSendTime().before(date2))
// .collect(toList());
String currentUserUnitName1 = userUtils.getCurrentUserUnitName();
List<AllotBill> allotBillEntities2 = allotBillDao.findAll().stream() List<AllotBill> allotBillEntities2 = allotBillDao.findAll().stream()
.filter(allotBillEntity -> allotStatusList.contains(allotBillEntity.getAllotStatus()) && userUtils.getCurrentUserUnitName().equals(userPublicService.findUnitsNameByUserId(allotBillEntity.getSendUseraId())) && allotBillEntity.getSendTime().after(date) && allotBillEntity.getSendTime().before(date2)) .filter(allotBillEntity -> allotStatusList.contains(allotBillEntity.getAllotStatus()) &&
currentUserUnitName1.equals(userPublicService.findUnitsNameByUserId(allotBillEntity.getSendUseraId()))
&& allotBillEntity.getSendTime().after(date) && allotBillEntity.getSendTime().before(date2))
.collect(toList()); .collect(toList());
//接收配发装备 //接收配发装备
if (allotBillEntities.size() > 0) { if (allotBillEntities.size() > 0) {
...@@ -397,7 +406,8 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -397,7 +406,8 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
// .collect(toList()); // .collect(toList());
List<AllotBackBill> receiveAllotBackBills = allotBackBillDao.findAll().stream() List<AllotBackBill> receiveAllotBackBills = allotBackBillDao.findAll().stream()
.filter(allotBackBill -> allotBackBill.getBackStatus() == 3 && .filter(allotBackBill -> allotBackBill.getBackStatus() == 3 &&
userUtils.getCurrentUserUnitName().equals(unitsCache.findById(allotBackBill.getReceiveUnitId()).getName()) // userUtils.getCurrentUserUnitName().equals(unitsCache.findById(allotBackBill.getReceiveUnitId()).getName())
currentUserUnitName1.equals(unitsCache.findById(allotBackBill.getReceiveUnitId()).getName())
&& allotBackBill.getReceiveTime().after(date) && allotBackBill.getReceiveTime().before(date2)) && allotBackBill.getReceiveTime().after(date) && allotBackBill.getReceiveTime().before(date2))
.collect(toList()); .collect(toList());
//接收退回 //接收退回
...@@ -416,7 +426,8 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -416,7 +426,8 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
// .collect(toList()); // .collect(toList());
List<AllotBackBill> sendAllotBackBills = allotBackBillDao.findAll().stream() List<AllotBackBill> sendAllotBackBills = allotBackBillDao.findAll().stream()
.filter(allotBackBill -> allotStatusBackList.contains(allotBackBill.getBackStatus()) && .filter(allotBackBill -> allotStatusBackList.contains(allotBackBill.getBackStatus()) &&
userUtils.getCurrentUserUnitName().equals(unitsCache.findById(allotBackBill.getSendUnitId()).getName()) // userUtils.getCurrentUserUnitName().equals(unitsCache.findById(allotBackBill.getSendUnitId()).getName())
currentUserUnitName1.equals(unitsCache.findById(allotBackBill.getSendUnitId()).getName())
&& allotBackBill.getSendTime().after(date) && allotBackBill.getSendTime().before(date2)) && allotBackBill.getSendTime().after(date) && allotBackBill.getSendTime().before(date2))
.collect(toList()); .collect(toList());
//发起退回 //发起退回
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论