提交 59d5cc2b authored 作者: 133's avatar 133

[用户模块] 修改生成装备使用报告和查询同级用户bug

上级 e1c8963b
...@@ -74,10 +74,6 @@ public class AllotBillServiceImpl implements AllotBillService { ...@@ -74,10 +74,6 @@ public class AllotBillServiceImpl implements AllotBillService {
private Specification<AllotBill> getSelectSpecification(AllotBillSelectVo allotBillSelectVo) { private Specification<AllotBill> getSelectSpecification(AllotBillSelectVo allotBillSelectVo) {
PredicateBuilder<AllotBill> predicateBuilder = Specifications.and(); PredicateBuilder<AllotBill> predicateBuilder = Specifications.and();
PredicateBuilder<AllotBill> predicateBuilder1 = Specifications.or();
predicateBuilder1.eq("sendUnit", userUtils.getCurrentUserUnitName());
predicateBuilder1.eq("receiveUnit", userUtils.getCurrentUserUnitName());
predicateBuilder.predicate(predicateBuilder1.build());
if (allotBillSelectVo != null) { if (allotBillSelectVo != null) {
if (allotBillSelectVo.getReplayNumber() != null) { if (allotBillSelectVo.getReplayNumber() != null) {
predicateBuilder.eq("replayNumber", allotBillSelectVo.getReplayNumber()); predicateBuilder.eq("replayNumber", allotBillSelectVo.getReplayNumber());
......
...@@ -13,6 +13,7 @@ import org.springframework.data.annotation.LastModifiedDate; ...@@ -13,6 +13,7 @@ import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener; import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*; import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -233,7 +234,7 @@ public class SendBackBillDetail { ...@@ -233,7 +234,7 @@ public class SendBackBillDetail {
@Transient @Transient
@ApiModelProperty(value = "装备List") @ApiModelProperty(value = "装备List")
private List<DeviceLibrary> deviceLibraryEntities; private List<DeviceLibrary> deviceLibraryEntities =new ArrayList<>();
@ApiModelProperty(value = "不知道是什么的号码") @ApiModelProperty(value = "不知道是什么的号码")
private String num; private String num;
......
...@@ -704,12 +704,13 @@ public class SendBackServiceImpl implements SendBackService { ...@@ -704,12 +704,13 @@ public class SendBackServiceImpl implements SendBackService {
List<SendBackBillDetail> list = sendBackBillDetailEntityDao.findAll(specification, pageable).getContent(); List<SendBackBillDetail> list = sendBackBillDetailEntityDao.findAll(specification, pageable).getContent();
for (SendBackBillDetail s:list) { for (SendBackBillDetail s:list) {
String deviceIds = s.getDeviceIds(); String deviceIds = s.getDeviceIds();
String[] idString = deviceIds.split("x"); if (deviceIds!=null) {
List<String> idStringList = Arrays.asList(idString); String[] idString = deviceIds.split("x");
List<String> idListString = idStringList.stream().filter(list2->!list2.equals("")).collect(Collectors.toList()); List<String> idStringList = Arrays.asList(idString);
System.out.println(); List<String> idListString = idStringList.stream().filter(list2 -> !list2.equals("")).collect(Collectors.toList());
List<Integer> idList = idListString.stream().map(Integer::parseInt).collect(Collectors.toList()); List<Integer> idList = idListString.stream().map(Integer::parseInt).collect(Collectors.toList());
s.setDeviceLibraryEntities(deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(idList)); s.setDeviceLibraryEntities(deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(idList));
}
} }
long count = sendBackBillDetailEntityDao.count(specification); long count = sendBackBillDetailEntityDao.count(specification);
return ResponseEntity.ok(new ListVo(count,list)); return ResponseEntity.ok(new ListVo(count,list));
......
...@@ -47,8 +47,12 @@ public class UserPublicServiceImpl implements UserPublicService { ...@@ -47,8 +47,12 @@ public class UserPublicServiceImpl implements UserPublicService {
*/ */
@Override @Override
public User getOne(Integer userId) { public User getOne(Integer userId) {
Optional<User> resultEntity = userDao.findById(userId); if (userId!=null) {
return resultEntity.orElse(null); Optional<User> resultEntity = userDao.findById(userId);
return resultEntity.orElse(null);
}else {
return new User();
}
} }
@Override @Override
......
...@@ -173,7 +173,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -173,7 +173,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
if (userUtils.getCurrentUnitLevel() == 1) { if (userUtils.getCurrentUnitLevel() == 1) {
//筛选出在日期范围内的销毁单 //筛选出在日期范围内的销毁单
List<DeviceDestroyBill> deviceDestoryBillEntities = deviceDestroyBillDao.findAll().stream() List<DeviceDestroyBill> deviceDestoryBillEntities = deviceDestroyBillDao.findAll().stream()
.filter(deviceDestoryBillEntity -> deviceDestoryBillEntity.getDestroyStatus() == 2 && deviceDestoryBillEntity.getDestroyTime().after(date) && deviceDestoryBillEntity.getDestroyTime().before(date2)) .filter(deviceDestoryBillEntity -> deviceDestoryBillEntity.getDestroyStatus() == 2 && deviceDestoryBillEntity.getDestroyTime()!=null&&deviceDestoryBillEntity.getDestroyTime().after(date) && deviceDestoryBillEntity.getDestroyTime().before(date2))
.collect(toList()); .collect(toList());
//累加销毁数量 //累加销毁数量
if (deviceDestoryBillEntities.size() > 0) { if (deviceDestoryBillEntities.size() > 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论