|
|
@@ -261,8 +261,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
// 旧数据处理
|
|
|
int version = StringUtil.isBlank(dataSourceBill.getVersion()) ? 1 : Integer.parseInt(dataSourceBill.getVersion());
|
|
|
bills.setVersion(String.valueOf(version + 1));
|
|
|
- List<Long> ids = count.stream().map(Bills::getId).distinct().collect(Collectors.toList());
|
|
|
if (!"MH".equals(bills.getBillType())) {
|
|
|
+ List<Long> ids = count.stream().map(Bills::getId).distinct().collect(Collectors.toList());
|
|
|
if (ObjectUtils.isNotNull(bills.getMblno())) {
|
|
|
if (!count.isEmpty() && !ids.contains(bills.getId())) {
|
|
|
throw new RuntimeException("提单号不允许重复:" + bills.getMblno());
|
|
|
@@ -270,7 +270,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
}
|
|
|
} else {
|
|
|
if (ObjectUtils.isNotNull(bills.getHblno())) {
|
|
|
- if (!count.isEmpty() && !ids.contains(bills.getId())) {
|
|
|
+ List<Long> ids = count1.stream().map(Bills::getId).distinct().collect(Collectors.toList());
|
|
|
+ if (!count1.isEmpty() && !ids.contains(bills.getId())) {
|
|
|
throw new RuntimeException("分单号不允许重复:" + bills.getHblno());
|
|
|
}
|
|
|
}
|
|
|
@@ -447,6 +448,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setRefno(bills.getRefno());
|
|
|
item.setBookingNo(bills.getBookingNo());
|
|
|
item.setCntrNo(bills.getQuantityCntrTypesDescr());
|
|
|
+ item.setQuantityCntrDescr(bills.getQuantityCntrDescr());
|
|
|
+ item.setTeu(bills.getTeu());
|
|
|
if (exrateType.equals(item.getCurCode())) {
|
|
|
amountCr = amountCr.add(item.getAmount());
|
|
|
amountCrLoc = amountCrLoc.add(item.getAmount());
|
|
|
@@ -505,6 +508,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setRefno(bills.getRefno());
|
|
|
item.setBookingNo(bills.getBookingNo());
|
|
|
item.setCntrNo(bills.getQuantityCntrTypesDescr());
|
|
|
+ item.setQuantityCntrDescr(bills.getQuantityCntrDescr());
|
|
|
+ item.setTeu(bills.getTeu());
|
|
|
if (exrateType.equals(item.getCurCode())) {
|
|
|
amountDr = amountDr.add(item.getAmount());
|
|
|
amountDrLoc = amountDrLoc.add(item.getAmount());
|
|
|
@@ -881,10 +886,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
boolean carrierId = ObjectUtils.isNotNull(bills.getCarrierId()) && !bills.getCarrierId().equals(details.getCarrierId());
|
|
|
boolean foreignAgencyId = ObjectUtils.isNotNull(bills.getForeignAgencyId()) && !bills.getForeignAgencyId().equals(details.getForeignAgencyId());
|
|
|
boolean issueDate = ObjectUtils.isNotNull(bills.getIssueDate()) && !bills.getIssueDate().equals(details.getIssueDate());
|
|
|
+ boolean issueAtId = ObjectUtils.isNotNull(bills.getIssueAtId()) && !bills.getIssueAtId().equals(details.getIssueAtId());
|
|
|
boolean boxBelongsTo = ObjectUtils.isNotNull(bills.getBoxBelongsTo()) && !bills.getBoxBelongsTo().equals(details.getBoxBelongsTo());
|
|
|
if (statusEtd || statusEta || statusAtd || statusAta || statusVessel || statusVoyageNo || statusMblno || statusPolId
|
|
|
|| statusPodId || statusCyTrailerTime || statusCyReturnTime || statusLineId || statusForwarding || statusBookingAgentId
|
|
|
- || shippingAgencyId || bookingDate || carrierId || foreignAgencyId || issueDate || boxBelongsTo) {
|
|
|
+ || shippingAgencyId || bookingDate || carrierId || foreignAgencyId || issueDate || boxBelongsTo || issueAtId) {
|
|
|
billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
.eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(Bills::getIsDeleted, 0)
|
|
|
@@ -905,11 +911,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setPolCnName(bills.getPolCnName());
|
|
|
item.setPolEnName(bills.getPolEnName());
|
|
|
item.setPolCode(bills.getPolCode());
|
|
|
- item.setPolNamePrint(bills.getPolNamePrint());
|
|
|
item.setPodId(bills.getPodId());
|
|
|
item.setPodCnName(bills.getPodCnName());
|
|
|
item.setPodEnName(bills.getPodEnName());
|
|
|
- item.setPodNamePrint(bills.getPodNamePrint());
|
|
|
item.setPodCode(bills.getPodCode());
|
|
|
item.setMblno(bills.getMblno());
|
|
|
item.setCyTrailerTime(bills.getCyTrailerTime());
|
|
|
@@ -935,6 +939,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setForeignAgencyEnName(bills.getForeignAgencyEnName());
|
|
|
item.setForeignAgencyDetails(bills.getForeignAgencyDetails());
|
|
|
item.setForeignCntyName(bills.getForeignCntyName());
|
|
|
+ item.setIssueAtId(bills.getIssueAtId());
|
|
|
+ item.setIssueAt(bills.getIssueAt());
|
|
|
}
|
|
|
this.updateBatchById(billsList);
|
|
|
List<Long> billIds = billsList.stream().map(Bills::getId).collect(Collectors.toList());
|
|
|
@@ -1441,6 +1447,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
containersBillsService.saveBatch(containersBillsListNew);
|
|
|
}
|
|
|
}
|
|
|
+ for (Bills item : billsList){
|
|
|
+ item.setEta(bills.getEta());
|
|
|
+ item.setActualEta(bills.getActualEta());
|
|
|
+ }
|
|
|
+ if (!billsList.isEmpty()){
|
|
|
+ this.updateBatchById(billsList);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -4656,6 +4669,21 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
bills.setVersion("1");
|
|
|
this.save(bills);
|
|
|
} else {
|
|
|
+ Bills dataSourceBill = baseMapper.selectOne(new LambdaQueryWrapper<Bills>().select(Bills::getId, Bills::getVersion,
|
|
|
+ Bills::getIssueStatus,Bills::getStatus).eq(Bills::getId, bills.getId()));
|
|
|
+ if (!Objects.equals(dataSourceBill.getVersion(), bills.getVersion())) {
|
|
|
+ return R.fail(601, "数据已被其他用户更新,请等待刷新后重试");
|
|
|
+ }
|
|
|
+ if ("1".equals(dataSourceBill.getIssueStatus())){
|
|
|
+ throw new RuntimeException("单据已生成订单");
|
|
|
+ }
|
|
|
+ if (0 != dataSourceBill.getStatus()){
|
|
|
+ throw new RuntimeException("单据状态不是录入,保存失败");
|
|
|
+ }
|
|
|
+ // 每更新一次往上累加一次版本
|
|
|
+ // 旧数据处理
|
|
|
+ int version = StringUtil.isBlank(dataSourceBill.getVersion()) ? 1 : Integer.parseInt(dataSourceBill.getVersion());
|
|
|
+ bills.setVersion(String.valueOf(version + 1));
|
|
|
bills.setUpdateUser(AuthUtil.getUserId());
|
|
|
bills.setUpdateTime(new Date());
|
|
|
bills.setUpdateUserName(AuthUtil.getUserName());
|