提交 0bd8bccd authored 作者: zhoushaopan's avatar zhoushaopan

[使用报告]修改

上级 87bd7560
...@@ -68,7 +68,7 @@ public class DeviceUseReportController { ...@@ -68,7 +68,7 @@ public class DeviceUseReportController {
BeanUtils.copyProperties(d, deviceUseReportDetailVo); BeanUtils.copyProperties(d, deviceUseReportDetailVo);
//分解数量详情组合字段 //分解数量详情组合字段
List<Integer> list = StringSplitUtil.userIdSplit(d.getReportDetail()); List<Integer> list = StringSplitUtil.userIdSplit(d.getReportDetail());
if (list.size() > 13) { if (list.size() > 15) {
deviceUseReportDetailVo.setDeviceNumber(list.get(0)); deviceUseReportDetailVo.setDeviceNumber(list.get(0));
deviceUseReportDetailVo.setInLibraryNum(list.get(1)); deviceUseReportDetailVo.setInLibraryNum(list.get(1));
deviceUseReportDetailVo.setSendRepairNum(list.get(2)); deviceUseReportDetailVo.setSendRepairNum(list.get(2));
...@@ -83,6 +83,8 @@ public class DeviceUseReportController { ...@@ -83,6 +83,8 @@ public class DeviceUseReportController {
deviceUseReportDetailVo.setPackingNum(list.get(11)); deviceUseReportDetailVo.setPackingNum(list.get(11));
deviceUseReportDetailVo.setRetiredNum(list.get(12)); deviceUseReportDetailVo.setRetiredNum(list.get(12));
deviceUseReportDetailVo.setDecommissioningStatisticsNum(list.get(13)); deviceUseReportDetailVo.setDecommissioningStatisticsNum(list.get(13));
deviceUseReportDetailVo.setToRepairBackNum(14);
deviceUseReportDetailVo.setToRepairNum(list.get(15));
} }
return ResultUtil.success(deviceUseReportDetailVo); return ResultUtil.success(deviceUseReportDetailVo);
} }
......
...@@ -347,7 +347,8 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -347,7 +347,8 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
int retiredNum = 0;//退装 int retiredNum = 0;//退装
int scrapStatisticsNum = 0;//报废 int scrapStatisticsNum = 0;//报废
int decommissioningStatisticsNum = 0;//退役 int decommissioningStatisticsNum = 0;//退役
int toRepairBackNum = 0;//向下级进行维修退回
int toRepairNum = 0;// 接收下级单位维修
//筛选出日期范围内所有入库账单 //筛选出日期范围内所有入库账单
List<StorageBill> storageBillEntities = storageBillDao.findAll().stream() List<StorageBill> storageBillEntities = storageBillDao.findAll().stream()
.filter(storageBillEntity -> storageBillEntity.getStorageStatus() == 2 && userUtils.getCurrentUserUnitName().equals(userPublicService.findUnitsNameByUserId(storageBillEntity.getReceiveUseraId())) && storageBillEntity.getUpdateTime().after(date) && storageBillEntity.getUpdateTime().before(date2)) .filter(storageBillEntity -> storageBillEntity.getStorageStatus() == 2 && userUtils.getCurrentUserUnitName().equals(userPublicService.findUnitsNameByUserId(storageBillEntity.getReceiveUseraId())) && storageBillEntity.getUpdateTime().after(date) && storageBillEntity.getUpdateTime().before(date2))
...@@ -397,7 +398,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -397,7 +398,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
receiveAllotBackNum = receiveAllotBackNum + receiveAllotBackBill.getBackCount(); receiveAllotBackNum = receiveAllotBackNum + receiveAllotBackBill.getBackCount();
} }
} }
//接收退回 //发起退回
if (sendAllotBackBills.size()>0){ if (sendAllotBackBills.size()>0){
for (AllotBackBill sendAllotBackBill : sendAllotBackBills) { for (AllotBackBill sendAllotBackBill : sendAllotBackBills) {
sensAllotBackNum = sensAllotBackNum + sendAllotBackBill.getBackCount(); sensAllotBackNum = sensAllotBackNum + sendAllotBackBill.getBackCount();
...@@ -407,17 +408,6 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -407,17 +408,6 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
//省级才能销毁,列装,退装 退役 报废 //省级才能销毁,列装,退装 退役 报废
if (userUtils.getCurrentUnitLevel() == 1) { if (userUtils.getCurrentUnitLevel() == 1) {
//筛选出在日期范围内的销毁单
// List<DeviceDestroyBill> deviceDestoryBillEntities = deviceDestroyBillDao.findAll().stream()
// .filter(deviceDestoryBillEntity -> deviceDestoryBillEntity.getDestroyStatus() == 2 && deviceDestoryBillEntity.getDestroyTime()!=null&&deviceDestoryBillEntity.getDestroyTime().after(date) && deviceDestoryBillEntity.getDestroyTime().before(date2))
// .collect(toList());
// //累加销毁数量
// if (deviceDestoryBillEntities.size() > 0) {
// for (DeviceDestroyBill s : deviceDestoryBillEntities) {
// List<Integer> list = StringSplitUtil.split(s.getDestroyDeviceDetail());
// destoryNum = destoryNum + list.size();
// }
// }
//报废 //报废
int scrapStatisticsCount = this.getScrapStatisticsCount(date, date2); int scrapStatisticsCount = this.getScrapStatisticsCount(date, date2);
scrapStatisticsNum = scrapStatisticsCount; scrapStatisticsNum = scrapStatisticsCount;
...@@ -454,23 +444,28 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -454,23 +444,28 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
repelManagementVo.setEndTime(deviceUseReportCreateVo.endTime.getTime()); repelManagementVo.setEndTime(deviceUseReportCreateVo.endTime.getTime());
PagingVo pagingVo = repelQueryService.clearedDeviceList(repelManagementVo); PagingVo pagingVo = repelQueryService.clearedDeviceList(repelManagementVo);
sendBackNum=pagingVo.getTotal(); sendBackNum=pagingVo.getTotal();
// //累加清退数量
// if (sendBackBillDetailEntities.size() > 0) {
// for (SendBackBillDetail s : sendBackBillDetailEntities) {
// sendBackNum = sendBackNum + s.getSendedCount();
// }
// }
//维修数量 //维修数量
List<RepairDetail> repairDetails = repairDetailDao.findAll().stream() List<RepairDetail> repairDetails = repairDetailDao.findAll().stream()
.filter(repairDetail -> repairDetail.getOwnUnit().equals(userUtils.getCurrentUserUnitName()) && repairDetail.getRepairStatus() != 3 && repairDetail.getCreateTime().after(date) && repairDetail.getCreateTime().before(date2)) .filter(repairDetail -> repairDetail.getOwnUnit().equals(userUtils.getCurrentUserUnitName()) && repairDetail.getRepairStatus() != 3 && repairDetail.getCreateTime().after(date) && repairDetail.getCreateTime().before(date2))
.collect(toList()); .collect(toList());
List<Integer> toUpRepairStatusList = new ArrayList<>(Arrays.asList(5,2,3,4));
List<RepairSendBill> toUpRepairList = repairSendBillDao.findAll().stream().filter(repairSendBill -> repairSendBill.getReceiveUnit().equals(userUtils.getCurrentUserUnitName()) && toUpRepairStatusList.contains(repairSendBill.getRepairStatus()) && repairSendBill.getCreateTime().after(date) && repairSendBill.getCreateTime().before(date2))
.collect(toList());
if (toUpRepairList.size()>0){
for (RepairSendBill repairSendBill : toUpRepairList) {
toRepairNum = toRepairNum + repairSendBill.getSendedCount();
}
}
//筛选出配接收维修退回的账单 //筛选出配接收维修退回的账单
List<Integer> repairBackList = new ArrayList<>(Arrays.asList(5,2)); List<Integer> repairBackList = new ArrayList<>(Arrays.asList(5,2));
List<RepairBackBill> repairBackBills = repairBackBillDao.findAll().stream() List<RepairBackBill> repairBackBills = repairBackBillDao.findAll().stream()
.filter(repairBackBill -> repairBackBill.getReceiveUnit().equals(userUtils.getCurrentUserUnitName()) && repairBackList.contains(repairBackBill.getBackStatus()) && repairBackBill.getCreateTime().after(date) && repairBackBill.getCreateTime().before(date2)) .filter(repairBackBill -> repairBackBill.getReceiveUnit().equals(userUtils.getCurrentUserUnitName()) && repairBackList.contains(repairBackBill.getBackStatus()) && repairBackBill.getCreateTime().after(date) && repairBackBill.getCreateTime().before(date2))
.collect(toList()); .collect(toList());
//筛选出向下级的维修退回
List<RepairBackBill> repairBackBillList = repairBackBillDao.findAll().stream()
.filter(repairBackBill -> repairBackBill.getSendUnit().equals(userUtils.getCurrentUserUnitName()) && repairBackList.contains(repairBackBill.getBackStatus()) && repairBackBill.getCreateTime().after(date) && repairBackBill.getCreateTime().before(date2))
.collect(toList());
//发起维修数量 //发起维修数量
if(repairDetails.size()>0){ if(repairDetails.size()>0){
sendRepairNum = sendRepairNum + repairDetails.size(); sendRepairNum = sendRepairNum + repairDetails.size();
...@@ -478,7 +473,13 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -478,7 +473,13 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
//将数量进行新增 累加维修数量 //将数量进行新增 累加维修数量
if (repairBackBills.size() >0){ if (repairBackBills.size() >0){
for (RepairBackBill repairBackBill : repairBackBills) { for (RepairBackBill repairBackBill : repairBackBills) {
receiveRepairNum = receiveRepairNum + repairBackBill.getReceiveCount(); receiveRepairNum = receiveRepairNum + repairBackBill.getSendedCount();
}
}
//将数量进行新增 累加维修数量
if (repairBackBillList.size() >0){
for (RepairBackBill repairBackBill : repairBackBillList) {
toRepairBackNum = toRepairBackNum + repairBackBill.getSendedCount();
} }
} }
...@@ -488,7 +489,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -488,7 +489,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
+ receiveRepairNum + "x" + destoryNum + receiveRepairNum + "x" + destoryNum
+ "x" + sendAllotNum + "x" + receiveAllotNum + "x" + sensAllotBackNum + "x" + sendAllotNum + "x" + receiveAllotNum + "x" + sensAllotBackNum
+ "x"+ receiveAllotBackNum + "x"+ sendBackNum + "x"+ scrapStatisticsNum + "x"+ receiveAllotBackNum + "x"+ sendBackNum + "x"+ scrapStatisticsNum
+ "x"+ packingNum + "x"+ retiredNum + "x"+ decommissioningStatisticsNum + "x"); + "x"+ packingNum + "x"+ retiredNum + "x"+ decommissioningStatisticsNum + "x"+toRepairBackNum+"x"+toRepairNum+"x");
return deviceUseReportDao.save(deviceUseReportEntity); return deviceUseReportDao.save(deviceUseReportEntity);
} }
......
...@@ -14,10 +14,8 @@ import java.util.Date; ...@@ -14,10 +14,8 @@ import java.util.Date;
public class DeviceUseReportDetailVo { public class DeviceUseReportDetailVo {
@ApiModelProperty(value = "标题", example = "标题") @ApiModelProperty(value = "标题", example = "标题")
private String title; private String title;
@ApiModelProperty(value = "所属单位", example = "省机要局") @ApiModelProperty(value = "所属单位", example = "省机要局")
private String unit; private String unit;
@ApiModelProperty(value = "装备类型总数", example = "100") @ApiModelProperty(value = "装备类型总数", example = "100")
private Integer deviceNumber; private Integer deviceNumber;
@ApiModelProperty(value = "入库数量", example = "10") @ApiModelProperty(value = "入库数量", example = "10")
...@@ -46,7 +44,10 @@ public class DeviceUseReportDetailVo { ...@@ -46,7 +44,10 @@ public class DeviceUseReportDetailVo {
private Integer retiredNum; private Integer retiredNum;
@ApiModelProperty(value = "退役", example = "10") @ApiModelProperty(value = "退役", example = "10")
private Integer decommissioningStatisticsNum; private Integer decommissioningStatisticsNum;
@ApiModelProperty(value = "向下级进行维修退回", example = "10")
private Integer toRepairBackNum;
@ApiModelProperty(value = "接收下级进行维修", example = "10")
private Integer toRepairNum;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论