opt: 修改首页单据处理数量,单据明细实时自动审核;
This commit is contained in:
@@ -197,11 +197,11 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
|
||||
if (ids.size() == entityList.size() && ids.size() > 1) {
|
||||
entityList.forEach(r -> {
|
||||
UpdateWrapper<EasOutInBillDetail> updateWrapper = new UpdateWrapper<>();
|
||||
//updateWrapper.set("djzt", "审核");
|
||||
updateWrapper.eq("flid", r.getFlid());
|
||||
updateWrapper.set("czsl", r.getSl());
|
||||
updateWrapper.set("sysl", 0);
|
||||
updateWrapper.set("kwbm", r.getKwbm());
|
||||
updateWrapper.set("djzt", "审核");
|
||||
updateWrapper.set("update_id", SecurityUtils.getCurrentUserId());
|
||||
updateWrapper.set("update_name", SecurityUtils.getCurrentNickName());
|
||||
updateWrapper.set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd"));
|
||||
@@ -227,11 +227,11 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
|
||||
throw new BadRequestException("请检查库位和数量信息");
|
||||
}
|
||||
UpdateWrapper<EasOutInBillDetail> updateWrapper = new UpdateWrapper<>();
|
||||
//updateWrapper.set("djzt", "审核");
|
||||
updateWrapper.eq("flid", entityList.get(0).getFlid());
|
||||
updateWrapper.set("czsl", czsl);
|
||||
updateWrapper.set("sysl", sysl);
|
||||
updateWrapper.set("kwbm", entityList.get(0).getKwbm());
|
||||
updateWrapper.set("djzt", "审核");
|
||||
updateWrapper.set("update_id", SecurityUtils.getCurrentUserId());
|
||||
updateWrapper.set("update_name", SecurityUtils.getCurrentNickName());
|
||||
updateWrapper.set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd"));
|
||||
|
||||
@@ -395,7 +395,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
}
|
||||
List<EasOutInBillDto> easBills = new ArrayList<>();
|
||||
List<EasOutInBillDto> srmBills = new ArrayList<>();
|
||||
//明细行自动审核
|
||||
//对单个明细行的自动审核
|
||||
if (!isDetail) {
|
||||
List<EasBillDetailDto> easBillDetailList = easOutInBillDetailMapper.queryDetailList(ids);
|
||||
if (CollectionUtils.isEmpty(easBillDetailList)) {
|
||||
@@ -423,14 +423,14 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
srmBills.add(easOutInBillDto);
|
||||
}
|
||||
} else {
|
||||
//所有主表
|
||||
//对单据头的审核
|
||||
List<EasOutInBillDto> easOutInBillList = easOutInBillMapper.queryBillList(ids);
|
||||
//所有明细表
|
||||
List<EasOutInBillDetailDto> easOutInBillDetailList = easOutInBillDetailMapper.queryBillDetailList(ids);
|
||||
// long count = easOutInBillDetailList.stream().filter(r -> r.getQty().compareTo(BigDecimal.ZERO) == 0).count();
|
||||
// if (count == easOutInBillDetailList.size()) {
|
||||
// throw new BadRequestException("该单据无任何出入库操作,请检查");
|
||||
// }
|
||||
long count = easOutInBillDetailList.stream().filter(r -> r.getQty().compareTo(BigDecimal.ZERO) == 0).count();
|
||||
if (count == easOutInBillDetailList.size()) {
|
||||
throw new BadRequestException("该单据无任何出入库操作,请检查");
|
||||
}
|
||||
//报文组合
|
||||
if (CollectionUtils.isNotEmpty(easOutInBillList)) {
|
||||
easOutInBillList.forEach(b -> {
|
||||
@@ -509,6 +509,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
/**
|
||||
* Eas多个单据审核
|
||||
*/
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
|
||||
public void syncEasAuditBills(List<EasOutInBillDto> bills) {
|
||||
for (EasOutInBillDto bill : bills) {
|
||||
try {
|
||||
@@ -519,7 +520,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
updateBills(bill);
|
||||
} catch (Exception e) {
|
||||
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
||||
throw new BadRequestException(e.toString());
|
||||
//throw new BadRequestException(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -527,6 +528,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
/**
|
||||
* Srm多个单据审核
|
||||
*/
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
|
||||
public void syncSrmAuditBills(List<EasOutInBillDto> bills) {
|
||||
for (EasOutInBillDto bill : bills) {
|
||||
try {
|
||||
@@ -535,7 +537,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
updateBills(bill);
|
||||
} catch (Exception e) {
|
||||
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
||||
throw new BadRequestException(e.toString());
|
||||
//throw new BadRequestException(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user