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

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

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