|
|
@ -162,21 +162,13 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
public List<WarehouseInfo> getWarehouseInfo() { |
|
|
|
List<WarehouseInfo> warehouseInfoList = easOutInBillMapper.getWarehouseInfo(); |
|
|
|
//三期的仓库放在前面
|
|
|
|
List<WarehouseInfo> second = warehouseInfoList.stream() |
|
|
|
.filter(r -> r.getCkmc().contains("三期")) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
List<WarehouseInfo> second = warehouseInfoList.stream().filter(r -> r.getCkmc().contains("三期")).collect(Collectors.toList()); |
|
|
|
//三期原材料库放在最前面
|
|
|
|
Optional<WarehouseInfo> first = second.stream() |
|
|
|
.filter(r -> r.getCkbm().equals("3.03.013")) |
|
|
|
.findFirst(); |
|
|
|
Optional<WarehouseInfo> first = second.stream().filter(r -> r.getCkbm().equals("3.03.013")).findFirst(); |
|
|
|
List<WarehouseInfo> sortedList = new ArrayList<>(); |
|
|
|
first.ifPresent(sortedList::add); |
|
|
|
second.stream() |
|
|
|
.filter(r -> !r.equals(first.orElse(null))) |
|
|
|
.forEach(sortedList::add); |
|
|
|
warehouseInfoList.stream() |
|
|
|
.filter(r -> !second.contains(r)) |
|
|
|
.forEach(sortedList::add); |
|
|
|
second.stream().filter(r -> !r.equals(first.orElse(null))).forEach(sortedList::add); |
|
|
|
warehouseInfoList.stream().filter(r -> !second.contains(r)).forEach(sortedList::add); |
|
|
|
return sortedList; |
|
|
|
} |
|
|
|
|
|
|
@ -217,31 +209,36 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
@Override |
|
|
|
@SaIgnore |
|
|
|
public CommonPage<EasOutInBill> page(EasOutInBillQuery params) { |
|
|
|
Page<EasOutInBill> easOutInBills = easOutInBillMapper.selectPage(new Page<>(params.getPage(), params.getSize()), new QueryWrapper<EasOutInBill>() |
|
|
|
.lambda() |
|
|
|
.eq(ObjectUtil.isNotEmpty(params.getDjlx()), EasOutInBill::getDjlx, params.getDjlx()) |
|
|
|
.eq(ObjectUtil.isNotEmpty(params.getCkbm()), EasOutInBill::getCkbm, params.getCkbm()) |
|
|
|
.eq(ObjectUtil.isNotEmpty(params.getCgybm()), EasOutInBill::getCgybm, params.getCgybm()) |
|
|
|
//.eq(ObjectUtil.isNotEmpty(params.getDjzt()), EasOutInBill::getDjzt, "1".equals(params.getDjzt()) ? "提交" : "审核")
|
|
|
|
.eq(EasOutInBill::getDjzt, "提交") |
|
|
|
.nested(ObjectUtil.isNotEmpty(params.getFuzzy()), |
|
|
|
i -> i.like(EasOutInBill::getDjid, params.getFuzzy()) |
|
|
|
.or() |
|
|
|
.like(EasOutInBill::getDjbh, params.getFuzzy()) |
|
|
|
.or() |
|
|
|
.like(EasOutInBill::getZzbm, params.getFuzzy()) |
|
|
|
.or() |
|
|
|
.like(EasOutInBill::getZzmc, params.getFuzzy()) |
|
|
|
.or() |
|
|
|
.like(EasOutInBill::getCkmc, params.getFuzzy()) |
|
|
|
.or() |
|
|
|
.like(EasOutInBill::getCkbm, params.getFuzzy()) |
|
|
|
.or() |
|
|
|
.like(EasOutInBill::getCjr, params.getFuzzy() |
|
|
|
) |
|
|
|
).orderByDesc(EasOutInBill::getCjsj) |
|
|
|
); |
|
|
|
return CommonPage.getPage(easOutInBills); |
|
|
|
Page<EasOutInBill> pageObject = new Page<>(params.getPage(), params.getSize()); |
|
|
|
Page<EasOutInBill> receiptBills = easOutInBillMapper.selectPageList(pageObject, params.getFuzzy(),params.getDjlx(),params.getCgybm(), params.getCkbm()); |
|
|
|
// Page<EasOutInBill> easOutInBills = easOutInBillMapper.selectPage(new Page<>(params.getPage(), params.getSize()), new QueryWrapper<EasOutInBill>()
|
|
|
|
// .lambda()
|
|
|
|
// .eq(ObjectUtil.isNotEmpty(params.getDjlx()), EasOutInBill::getDjlx, params.getDjlx())
|
|
|
|
// .eq(ObjectUtil.isNotEmpty(params.getWlbm()), EasOutInBill::getWlbm, params.getCkbm())
|
|
|
|
// .eq(ObjectUtil.isNotEmpty(params.getCkbm()), EasOutInBill::getCkbm, params.getCkbm())
|
|
|
|
// .eq(ObjectUtil.isNotEmpty(params.getCgybm()), EasOutInBill::getCgybm, params.getCgybm())
|
|
|
|
// //.eq(ObjectUtil.isNotEmpty(params.getDjzt()), EasOutInBill::getDjzt, "1".equals(params.getDjzt()) ? "提交" : "审核")
|
|
|
|
// .eq(EasOutInBill::getDjzt, "提交")
|
|
|
|
// .nested(ObjectUtil.isNotEmpty(params.getFuzzy()),
|
|
|
|
// i -> i.like(EasOutInBill::getDjid, params.getFuzzy())
|
|
|
|
// .or()
|
|
|
|
// .like(EasOutInBill::getDjbh, params.getFuzzy())
|
|
|
|
// .or()
|
|
|
|
// .like(EasOutInBill::getZzbm, params.getFuzzy())
|
|
|
|
// .or()
|
|
|
|
// .like(EasOutInBill::getZzmc, params.getFuzzy())
|
|
|
|
// .or()
|
|
|
|
// .like(EasOutInBill::getCkmc, params.getFuzzy())
|
|
|
|
// .or()
|
|
|
|
// .like(EasOutInBill::getWlbm, params.getFuzzy())
|
|
|
|
// .or()
|
|
|
|
// .like(EasOutInBill::getCkbm, params.getFuzzy())
|
|
|
|
// .or()
|
|
|
|
// .like(EasOutInBill::getCjr, params.getFuzzy()
|
|
|
|
// )
|
|
|
|
// ).orderByDesc(EasOutInBill::getCjsj)
|
|
|
|
// );
|
|
|
|
return CommonPage.getPage(receiptBills); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -252,12 +249,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<EasOutInBill> query(EasOutInBillQuery params) { |
|
|
|
return easOutInBillMapper.selectList(new QueryWrapper<EasOutInBill>() |
|
|
|
.lambda() |
|
|
|
.eq(ObjectUtil.isNotEmpty(params), EasOutInBill::getYwlx, params.getFuzzy()) |
|
|
|
.or() |
|
|
|
.eq(ObjectUtil.isNotEmpty(params), EasOutInBill::getDjid, params.getFuzzy()) |
|
|
|
); |
|
|
|
return easOutInBillMapper.selectList(new QueryWrapper<EasOutInBill>().lambda().eq(ObjectUtil.isNotEmpty(params), EasOutInBill::getYwlx, params.getFuzzy()).or().eq(ObjectUtil.isNotEmpty(params), EasOutInBill::getDjid, params.getFuzzy())); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -324,31 +316,28 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
public void insertInOutBills(List<EasOutInBillDetail> easOutInBillDetails, List<EasOutInBillDetail> existingIds) { |
|
|
|
Set<String> ids = existingIds.stream().map(EasOutInBillDetail::getFlid).collect(Collectors.toSet()); |
|
|
|
// 过滤出需要插入的新单据,并根据来源设置 ID
|
|
|
|
List<EasOutInBillDetail> insertEasBills = easOutInBillDetails.stream() |
|
|
|
.filter(bill -> !ids.contains(bill.getFlid())) |
|
|
|
.peek(bill -> { |
|
|
|
bill.setId(IdUtil.getStringId()); |
|
|
|
bill.setCode(IdUtil.getStringId()); |
|
|
|
bill.setTjkwbm(bill.getKwbm()); |
|
|
|
bill.setCzsl(BigDecimal.ZERO); |
|
|
|
bill.setCzsl(BigDecimal.ZERO); |
|
|
|
bill.setKcsl(BigDecimal.ZERO); |
|
|
|
// if (bill.getSl().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
// bill.setSl(bill.getSl().abs());
|
|
|
|
// }
|
|
|
|
bill.setSysl(bill.getSl()); |
|
|
|
if (bill.getDjly() == null) { |
|
|
|
bill.setCjsj(LocalDateTime.parse(bill.getCjsj(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString()); |
|
|
|
bill.setDjly("1"); |
|
|
|
} else { |
|
|
|
//srm的未入库改为提交
|
|
|
|
bill.setDjzt("提交"); |
|
|
|
bill.setYwrq(LocalDateTime.parse(bill.getYwrq(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")).toLocalDate().toString()); |
|
|
|
bill.setCjsj(LocalDateTime.parse(bill.getCjsj(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")).toLocalDate().toString()); |
|
|
|
bill.setDjly("2"); |
|
|
|
} |
|
|
|
}) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
List<EasOutInBillDetail> insertEasBills = easOutInBillDetails.stream().filter(bill -> !ids.contains(bill.getFlid())).peek(bill -> { |
|
|
|
bill.setId(IdUtil.getStringId()); |
|
|
|
bill.setCode(IdUtil.getStringId()); |
|
|
|
bill.setTjkwbm(bill.getKwbm()); |
|
|
|
bill.setCzsl(BigDecimal.ZERO); |
|
|
|
bill.setCzsl(BigDecimal.ZERO); |
|
|
|
bill.setKcsl(BigDecimal.ZERO); |
|
|
|
// if (bill.getSl().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
// bill.setSl(bill.getSl().abs());
|
|
|
|
// }
|
|
|
|
bill.setSysl(bill.getSl()); |
|
|
|
if (bill.getDjly() == null) { |
|
|
|
bill.setCjsj(LocalDateTime.parse(bill.getCjsj(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString()); |
|
|
|
bill.setDjly("1"); |
|
|
|
} else { |
|
|
|
//srm的未入库改为提交
|
|
|
|
bill.setDjzt("提交"); |
|
|
|
bill.setYwrq(LocalDateTime.parse(bill.getYwrq(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")).toLocalDate().toString()); |
|
|
|
bill.setCjsj(LocalDateTime.parse(bill.getCjsj(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")).toLocalDate().toString()); |
|
|
|
bill.setDjly("2"); |
|
|
|
} |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isNotEmpty(insertEasBills)) { |
|
|
|
this.insertBills(insertEasBills); |
|
|
|
} |
|
|
@ -356,37 +345,33 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
|
|
|
|
|
|
|
|
private void insertBills(List<EasOutInBillDetail> detailList) { |
|
|
|
List<EasOutInBillDetail> distinctDetailList = new ArrayList<>(detailList.stream() |
|
|
|
.collect(Collectors.toMap(EasOutInBillDetail::getDjid, Function.identity(), (existing, replacement) -> existing)) |
|
|
|
.values()); |
|
|
|
List<EasOutInBill> billList = distinctDetailList.stream() |
|
|
|
.map(detail -> { |
|
|
|
EasOutInBill bill = new EasOutInBill(); |
|
|
|
bill.setId(IdUtil.getStringId()); |
|
|
|
bill.setBmbm(detail.getBmbm()); |
|
|
|
bill.setBmmc(detail.getBmmc()); |
|
|
|
bill.setDjid(detail.getDjid()); |
|
|
|
bill.setDjid(detail.getDjid()); |
|
|
|
bill.setDjbh(detail.getDjbh()); |
|
|
|
bill.setDjlx(detail.getDjlx()); |
|
|
|
bill.setYwlx(detail.getYwlx()); |
|
|
|
bill.setZzbm(detail.getZzbm()); |
|
|
|
bill.setZzmc(detail.getZzmc()); |
|
|
|
bill.setCkmc(detail.getCkmc()); |
|
|
|
bill.setCkbm(detail.getCkbm()); |
|
|
|
bill.setDjzt(detail.getDjzt()); |
|
|
|
bill.setCjsj(detail.getCjsj()); |
|
|
|
bill.setYwrq(detail.getYwrq()); |
|
|
|
bill.setCjr(detail.getCjr()); |
|
|
|
bill.setBtbz(detail.getBtbz()); |
|
|
|
bill.setCksj(detail.getCksj()); |
|
|
|
bill.setLlr(detail.getLlr()); |
|
|
|
bill.setDjly(detail.getDjly()); |
|
|
|
bill.setCgybm(detail.getCgybm()); |
|
|
|
bill.setCgymc(detail.getCgymc()); |
|
|
|
return bill; |
|
|
|
}) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
List<EasOutInBillDetail> distinctDetailList = new ArrayList<>(detailList.stream().collect(Collectors.toMap(EasOutInBillDetail::getDjid, Function.identity(), (existing, replacement) -> existing)).values()); |
|
|
|
List<EasOutInBill> billList = distinctDetailList.stream().map(detail -> { |
|
|
|
EasOutInBill bill = new EasOutInBill(); |
|
|
|
bill.setId(IdUtil.getStringId()); |
|
|
|
bill.setBmbm(detail.getBmbm()); |
|
|
|
bill.setBmmc(detail.getBmmc()); |
|
|
|
bill.setDjid(detail.getDjid()); |
|
|
|
bill.setDjid(detail.getDjid()); |
|
|
|
bill.setDjbh(detail.getDjbh()); |
|
|
|
bill.setDjlx(detail.getDjlx()); |
|
|
|
bill.setYwlx(detail.getYwlx()); |
|
|
|
bill.setZzbm(detail.getZzbm()); |
|
|
|
bill.setZzmc(detail.getZzmc()); |
|
|
|
bill.setCkmc(detail.getCkmc()); |
|
|
|
bill.setCkbm(detail.getCkbm()); |
|
|
|
bill.setDjzt(detail.getDjzt()); |
|
|
|
bill.setCjsj(detail.getCjsj()); |
|
|
|
bill.setYwrq(detail.getYwrq()); |
|
|
|
bill.setCjr(detail.getCjr()); |
|
|
|
bill.setBtbz(detail.getBtbz()); |
|
|
|
bill.setCksj(detail.getCksj()); |
|
|
|
bill.setLlr(detail.getLlr()); |
|
|
|
bill.setDjly(detail.getDjly()); |
|
|
|
bill.setCgybm(detail.getCgybm()); |
|
|
|
bill.setCgymc(detail.getCgymc()); |
|
|
|
return bill; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
CompletableFuture.runAsync(() -> { |
|
|
|
//主表
|
|
|
|
for (EasOutInBill entity : billList) { |
|
|
@ -411,28 +396,23 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
|
|
|
|
private void updateBills(List<EasOutInBillDetail> easOutInBillDetails, List<EasOutInBillDetail> existingIds) { |
|
|
|
// 过滤出需要插入的新单据,并根据来源设置 ID
|
|
|
|
List<EasOutInBillDetail> updateEasBills = easOutInBillDetails.stream() |
|
|
|
.filter(r -> r.getXgsj() != null) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
List<EasOutInBillDetail> updateEasBills = easOutInBillDetails.stream().filter(r -> r.getXgsj() != null).collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isNotEmpty(updateEasBills)) { |
|
|
|
//比较insertEasBills与existingIds的修改时间进行按需更新
|
|
|
|
for (EasOutInBillDetail entity : updateEasBills) { |
|
|
|
EasOutInBillDetail existing = existingIds.stream() |
|
|
|
.filter(e -> { |
|
|
|
boolean isUpdate = false; |
|
|
|
try { |
|
|
|
if (e.getFlid().equals(entity.getFlid())) { |
|
|
|
if (e.getXgsj() == null || org.nl.common.utils.DateUtil.getDate(entity.getXgsj()).after(org.nl.common.utils.DateUtil.getDate(e.getXgsj()))) { |
|
|
|
isUpdate = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (ParseException ex) { |
|
|
|
throw new RuntimeException(ex); |
|
|
|
EasOutInBillDetail existing = existingIds.stream().filter(e -> { |
|
|
|
boolean isUpdate = false; |
|
|
|
try { |
|
|
|
if (e.getFlid().equals(entity.getFlid())) { |
|
|
|
if (e.getXgsj() == null || org.nl.common.utils.DateUtil.getDate(entity.getXgsj()).after(org.nl.common.utils.DateUtil.getDate(e.getXgsj()))) { |
|
|
|
isUpdate = true; |
|
|
|
} |
|
|
|
return isUpdate; |
|
|
|
}) |
|
|
|
.findFirst() |
|
|
|
.orElse(null); |
|
|
|
} |
|
|
|
} catch (ParseException ex) { |
|
|
|
throw new RuntimeException(ex); |
|
|
|
} |
|
|
|
return isUpdate; |
|
|
|
}).findFirst().orElse(null); |
|
|
|
if (existing != null) { |
|
|
|
EasOutInBillDetail updateEntity = new EasOutInBillDetail(); |
|
|
|
updateEntity.setDjid(entity.getDjid()); |
|
|
@ -483,29 +463,20 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
try { |
|
|
|
// 获取距离今天30天前的日期
|
|
|
|
LocalDate eightDaysAgo = LocalDate.now().minusDays(30); |
|
|
|
existingIds = existingIds.stream() |
|
|
|
.filter(e -> "提交".equals(e.getDjzt()) || "未入库".equals(e.getDjzt())) |
|
|
|
.filter(e -> { |
|
|
|
try { |
|
|
|
return org.nl.common.utils.DateUtil.getDateFormat(e.getCjsj()).toInstant().atZone(ZoneId.systemDefault()).toLocalDate().isAfter(eightDaysAgo); |
|
|
|
} catch (ParseException ex) { |
|
|
|
throw new RuntimeException(ex); |
|
|
|
} |
|
|
|
}) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
existingIds = existingIds.stream().filter(e -> "提交".equals(e.getDjzt()) || "未入库".equals(e.getDjzt())).filter(e -> { |
|
|
|
try { |
|
|
|
return org.nl.common.utils.DateUtil.getDateFormat(e.getCjsj()).toInstant().atZone(ZoneId.systemDefault()).toLocalDate().isAfter(eightDaysAgo); |
|
|
|
} catch (ParseException ex) { |
|
|
|
throw new RuntimeException(ex); |
|
|
|
} |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
// 获取easOutInBillDetails中flid字段的集合
|
|
|
|
Set<String> easFlidSet = easOutInBillDetails.stream() |
|
|
|
.map(EasOutInBillDetail::getFlid) |
|
|
|
.collect(Collectors.toSet()); |
|
|
|
Set<String> easFlidSet = easOutInBillDetails.stream().map(EasOutInBillDetail::getFlid).collect(Collectors.toSet()); |
|
|
|
// 找出existingIds中flid字段集合不在easOutInBillDetails中flid字段集合中的记录
|
|
|
|
List<EasOutInBillDetail> idsToDelete = existingIds.stream() |
|
|
|
.filter(e -> !easFlidSet.contains(e.getFlid())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
List<EasOutInBillDetail> idsToDelete = existingIds.stream().filter(e -> !easFlidSet.contains(e.getFlid())).collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isNotEmpty(idsToDelete)) { |
|
|
|
Map<String, Long> idCount1 = idsToDelete.stream() |
|
|
|
.collect(Collectors.groupingBy(EasOutInBillDetail::getDjid, Collectors.counting())); |
|
|
|
Map<String, Long> idCount2 = existingIds.stream() |
|
|
|
.collect(Collectors.groupingBy(EasOutInBillDetail::getDjid, Collectors.counting())); |
|
|
|
Map<String, Long> idCount1 = idsToDelete.stream().collect(Collectors.groupingBy(EasOutInBillDetail::getDjid, Collectors.counting())); |
|
|
|
Map<String, Long> idCount2 = existingIds.stream().collect(Collectors.groupingBy(EasOutInBillDetail::getDjid, Collectors.counting())); |
|
|
|
Set<String> billIds = new HashSet<>(); |
|
|
|
idCount1.forEach((k, v) -> { |
|
|
|
//遍历idCount1中的djid,与idCount2的比较,如果相等,判断value的个等于idCount2,则记录key到一个新的set集合中
|
|
|
@ -528,17 +499,9 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
//查询主单据进行对比
|
|
|
|
Set<String> bills = queryBills(); |
|
|
|
Set<String> easBills = easOutInBillDetails.stream().map(EasOutInBillDetail::getDjid).collect(Collectors.toSet()); |
|
|
|
Set<String> notInExits = bills.stream() |
|
|
|
.filter(r -> !easBills.contains(r)) |
|
|
|
.collect(Collectors.toSet()); |
|
|
|
Set<String> notInExits = bills.stream().filter(r -> !easBills.contains(r)).collect(Collectors.toSet()); |
|
|
|
if (CollectionUtils.isNotEmpty(notInExits)) { |
|
|
|
UpdateWrapper<EasOutInBill> updateWrapper = new UpdateWrapper<EasOutInBill>() |
|
|
|
.set("update_id", SecurityUtils.getCurrentUserId()) |
|
|
|
.set("update_name", SecurityUtils.getCurrentNickName()) |
|
|
|
.set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")) |
|
|
|
.set("djzt", "审核") |
|
|
|
.set("btbz", "扫描EAS,此单据在EAS已查询不到,或为已审核状态。") |
|
|
|
.in("djid", notInExits); |
|
|
|
UpdateWrapper<EasOutInBill> updateWrapper = new UpdateWrapper<EasOutInBill>().set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).set("djzt", "审核").set("btbz", "扫描EAS,此单据在EAS已查询不到,或为已审核状态。").in("djid", notInExits); |
|
|
|
easOutInBillMapper.update(null, updateWrapper); |
|
|
|
} |
|
|
|
|
|
|
@ -592,11 +555,10 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
easOutInBillDto.setBizDate(easBillDetailList.get(0).getBizDate()); |
|
|
|
List<EasOutInBillDetailDto> entrys = new ArrayList<>(); |
|
|
|
easBillDetailList.forEach(r -> { |
|
|
|
EasOutInBillDetailDto dto = new EasOutInBillDetailDto(); |
|
|
|
BeanUtils.copyProperties(r, dto); |
|
|
|
entrys.add(dto); |
|
|
|
} |
|
|
|
); |
|
|
|
EasOutInBillDetailDto dto = new EasOutInBillDetailDto(); |
|
|
|
BeanUtils.copyProperties(r, dto); |
|
|
|
entrys.add(dto); |
|
|
|
}); |
|
|
|
easOutInBillDto.setEntrys(entrys); |
|
|
|
if ("1".equals(easOutInBillDto.getDjly())) { |
|
|
|
easBills.add(easOutInBillDto); |
|
|
@ -615,8 +577,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
//报文组合
|
|
|
|
if (CollectionUtils.isNotEmpty(easOutInBillList)) { |
|
|
|
easOutInBillList.forEach(b -> { |
|
|
|
List<EasOutInBillDetailDto> billDetails = easOutInBillDetailList.stream().filter(d -> |
|
|
|
Objects.equals(d.getDjid(), b.getBillId())).collect(Collectors.toList()); |
|
|
|
List<EasOutInBillDetailDto> billDetails = easOutInBillDetailList.stream().filter(d -> Objects.equals(d.getDjid(), b.getBillId())).collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isNotEmpty(billDetails)) { |
|
|
|
if (b.getYwlx().contains(EasBillTypeEnum.OUT.getCode())) { |
|
|
|
//只提交大于数量大于0的物料明细
|
|
|
@ -729,11 +690,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
|
|
|
|
|
|
|
|
private void updateBills(EasOutInBillDto bill, String msg) { |
|
|
|
UpdateWrapper<EasOutInBill> updateWrapper = new UpdateWrapper<EasOutInBill>() |
|
|
|
.set("update_id", SecurityUtils.getCurrentUserId()) |
|
|
|
.set("update_name", SecurityUtils.getCurrentNickName()) |
|
|
|
.set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")) |
|
|
|
.eq("djid", bill.getBillId()); |
|
|
|
UpdateWrapper<EasOutInBill> updateWrapper = new UpdateWrapper<EasOutInBill>().set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId()); |
|
|
|
if (StringUtils.isNoneBlank(msg)) { |
|
|
|
updateWrapper.set("shjg", msg); |
|
|
|
} else { |
|
|
|