|
|
@@ -210,31 +210,29 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
.eq(Bills::getHblno, bills.getHblno())
|
|
|
.eq(Bills::getBusinessType, bills.getBusinessType())
|
|
|
);
|
|
|
- if (ObjectUtils.isNotNull(bills.getBillDate())) {
|
|
|
- LocalDate date = bills.getBillDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
- int year = date.getYear();
|
|
|
- int month = date.getMonthValue();
|
|
|
- FinPeriod finPeriod = finPeriodMapper.selectOne(new LambdaQueryWrapper<FinPeriod>()
|
|
|
- .eq(FinPeriod::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(FinPeriod::getBranchId, bills.getBranchId())
|
|
|
- .eq(FinPeriod::getIsDeleted, 0)
|
|
|
- .eq(FinPeriod::getPeriodYear, year)
|
|
|
- .eq(FinPeriod::getPeriodMonth, month));
|
|
|
- if (finPeriod != null) {
|
|
|
- if (1 == finPeriod.getIsClosed()) {
|
|
|
- throw new RuntimeException(year + "年" + month + "月账期已结转,保存失败");
|
|
|
- }
|
|
|
- if (1 == finPeriod.getLockingStatus()) {
|
|
|
- throw new RuntimeException(year + "年" + month + "月账期已锁定,保存失败");
|
|
|
- }
|
|
|
+ if ("SE".equals(bills.getBusinessType())) {
|
|
|
+ bills.setBillDate(bills.getActualEtd());
|
|
|
+ } else if ("SI".equals(bills.getBusinessType())) {
|
|
|
+ bills.setBillDate(bills.getActualEta());
|
|
|
+ }
|
|
|
+ LocalDate date = bills.getBillDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
+ int year = date.getYear();
|
|
|
+ int month = date.getMonthValue();
|
|
|
+ FinPeriod finPeriod = finPeriodMapper.selectOne(new LambdaQueryWrapper<FinPeriod>()
|
|
|
+ .eq(FinPeriod::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(FinPeriod::getBranchId, bills.getBranchId())
|
|
|
+ .eq(FinPeriod::getIsDeleted, 0)
|
|
|
+ .eq(FinPeriod::getPeriodYear, year)
|
|
|
+ .eq(FinPeriod::getPeriodMonth, month));
|
|
|
+ if (finPeriod != null) {
|
|
|
+ if (1 == finPeriod.getIsClosed()) {
|
|
|
+ throw new RuntimeException(year + "年" + month + "月账期已结转,保存失败");
|
|
|
}
|
|
|
- } else {
|
|
|
- if ("SE".equals(bills.getBusinessType())) {
|
|
|
- bills.setBillDate(bills.getActualEtd());
|
|
|
- } else if ("SI".equals(bills.getBusinessType())) {
|
|
|
- bills.setBillDate(bills.getActualEta());
|
|
|
+ if (1 == finPeriod.getLockingStatus()) {
|
|
|
+ throw new RuntimeException(year + "年" + month + "月账期已锁定,保存失败");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (ObjectUtils.isNotNull(bills.getCorpId())) {
|
|
|
BCorps bCorps = corpsMapper.selectById(bills.getCorpId());
|
|
|
if ("D".equals(bCorps.getCreditLevel())) {
|
|
|
@@ -379,7 +377,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if (ObjectUtils.isNull(item.getCntrTypeCode())) {
|
|
|
throw new RuntimeException("箱型不能为空");
|
|
|
}
|
|
|
- if ("0".equals(item.getWhetherAppearStatus())){
|
|
|
+ if ("0".equals(item.getWhetherAppearStatus())) {
|
|
|
item.setActualQuantity(item.getQuantity());
|
|
|
}
|
|
|
if (item.getId() == null) {
|
|
|
@@ -545,7 +543,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
String exrateType = currencyUtils.standardCurrency(branchId);
|
|
|
statusD += 1;
|
|
|
for (FeeCenter item : bills.getFeeCenterListD()) {
|
|
|
- if (ObjectUtils.isNotNull(bills.getPreContainersList())&& !"CQXSF".equals(item.getFeeCode())) {
|
|
|
+ if (ObjectUtils.isNotNull(bills.getPreContainersList()) && !"CQXSF".equals(item.getFeeCode())) {
|
|
|
PreContainers preContainers = bills.getPreContainersList().stream().filter(e -> e.getCntrTypeCode().equals(item.getUnitNo()))
|
|
|
.findFirst().orElse(null);
|
|
|
if (preContainers != null && item.getQuantity().compareTo(new BigDecimal(preContainers.getQuantity() + "")) != 0 &&
|
|
|
@@ -1305,29 +1303,77 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
bills.setUpdateUser(AuthUtil.getUserId());
|
|
|
bills.setUpdateTime(new Date());
|
|
|
bills.setUpdateUserName(AuthUtil.getUserName());
|
|
|
- if (ObjectUtils.isNotNull(bills.getBillDate())) {
|
|
|
- LocalDate date = bills.getBillDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
- int year = date.getYear();
|
|
|
- int month = date.getMonthValue();
|
|
|
- FinPeriod finPeriod = finPeriodMapper.selectOne(new LambdaQueryWrapper<FinPeriod>()
|
|
|
- .eq(FinPeriod::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(FinPeriod::getBranchId, bills.getBranchId())
|
|
|
- .eq(FinPeriod::getIsDeleted, 0)
|
|
|
- .eq(FinPeriod::getPeriodYear, year)
|
|
|
- .eq(FinPeriod::getPeriodMonth, month));
|
|
|
- if (finPeriod != null) {
|
|
|
- if (1 == finPeriod.getIsClosed()) {
|
|
|
- throw new RuntimeException(year + "年" + month + "月账期已结转,保存失败");
|
|
|
- }
|
|
|
- if (1 == finPeriod.getLockingStatus()) {
|
|
|
- throw new RuntimeException(year + "年" + month + "月账期已锁定,保存失败");
|
|
|
- }
|
|
|
+ if ("SE".equals(bills.getBusinessType())) {
|
|
|
+ bills.setBillDate(bills.getActualEtd());
|
|
|
+ } else if ("SI".equals(bills.getBusinessType())) {
|
|
|
+ bills.setBillDate(bills.getActualEta());
|
|
|
+ }
|
|
|
+ LocalDate date = bills.getBillDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
+ int year = date.getYear();
|
|
|
+ int month = date.getMonthValue();
|
|
|
+ FinPeriod finPeriod = finPeriodMapper.selectOne(new LambdaQueryWrapper<FinPeriod>()
|
|
|
+ .eq(FinPeriod::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(FinPeriod::getBranchId, bills.getBranchId())
|
|
|
+ .eq(FinPeriod::getIsDeleted, 0)
|
|
|
+ .eq(FinPeriod::getPeriodYear, year)
|
|
|
+ .eq(FinPeriod::getPeriodMonth, month));
|
|
|
+ if (finPeriod != null) {
|
|
|
+ if (1 == finPeriod.getIsClosed()) {
|
|
|
+ throw new RuntimeException(year + "年" + month + "月账期已结转,保存失败");
|
|
|
+ }
|
|
|
+ if (1 == finPeriod.getLockingStatus()) {
|
|
|
+ throw new RuntimeException(year + "年" + month + "月账期已锁定,保存失败");
|
|
|
}
|
|
|
}
|
|
|
if ("MM".equals(bills.getBillType()) && ObjectUtils.isNotNull(bills.getId())) {
|
|
|
bills.setMasterBillNo(bills.getBillNo());
|
|
|
this.synchronous(bills);
|
|
|
}
|
|
|
+ List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
|
|
|
+ .eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(FeeCenter::getIsDeleted, 0)
|
|
|
+ .eq(FeeCenter::getPid, bills.getId()));
|
|
|
+ for (FeeCenter item : feeCenterList) {
|
|
|
+ item.setEta(bills.getEta());
|
|
|
+ item.setEtd(bills.getEtd());
|
|
|
+ item.setBillDate(bills.getBillDate());
|
|
|
+ item.setVesselId(bills.getVesselId());
|
|
|
+ item.setVesselCnName(bills.getVesselCnName());
|
|
|
+ item.setVesselEnName(bills.getVesselEnName());
|
|
|
+ item.setVoyageNo(bills.getVoyageNo());
|
|
|
+ item.setPolId(bills.getPolId());
|
|
|
+ item.setPolCnName(bills.getPolCnName());
|
|
|
+ item.setPolEnName(bills.getPolEnName());
|
|
|
+ item.setPolCode(bills.getPolCode());
|
|
|
+ item.setPodId(bills.getPodId());
|
|
|
+ item.setPodCnName(bills.getPodCnName());
|
|
|
+ item.setPodEnName(bills.getPodEnName());
|
|
|
+ item.setPodCode(bills.getPodCode());
|
|
|
+ }
|
|
|
+ feeCenterService.updateBatchById(feeCenterList);
|
|
|
+ List<FinAccBills> finAccBillsList = finAccBillsService.list(new LambdaQueryWrapper<FinAccBills>()
|
|
|
+ .eq(FinAccBills::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(FinAccBills::getIsDeleted, 0)
|
|
|
+ .eq(FinAccBills::getBusinessBillId, bills.getId()));
|
|
|
+ for (FinAccBills item : finAccBillsList) {
|
|
|
+ item.setEtd(bills.getEtd());
|
|
|
+ item.setEta(bills.getEta());
|
|
|
+ item.setBillDate(bills.getBillDate());
|
|
|
+ item.setBusinessDate(bills.getBillDate());
|
|
|
+ item.setVesselId(bills.getVesselId());
|
|
|
+ item.setVesselCnName(bills.getVesselCnName());
|
|
|
+ item.setVesselEnName(bills.getVesselEnName());
|
|
|
+ item.setVoyageNo(bills.getVoyageNo());
|
|
|
+ item.setPolId(bills.getPolId());
|
|
|
+ item.setPolCnName(bills.getPolCnName());
|
|
|
+ item.setPolEnName(bills.getPolEnName());
|
|
|
+ item.setPolCode(bills.getPolCode());
|
|
|
+ item.setPodId(bills.getPodId());
|
|
|
+ item.setPodCnName(bills.getPodCnName());
|
|
|
+ item.setPodEnName(bills.getPodEnName());
|
|
|
+ item.setPodCode(bills.getPodCode());
|
|
|
+ }
|
|
|
+ finAccBillsService.updateBatchById(finAccBillsList);
|
|
|
if (!bills.getPreContainersList().isEmpty()) {
|
|
|
preContainersService.saveOrUpdateBatch(bills.getPreContainersList());
|
|
|
}
|
|
|
@@ -4273,7 +4319,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
preContainers1.setContainerNumberStatus("录入");
|
|
|
copyPreContainersList.add(preContainers1);
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
item.setQuantityCntrDescr("");
|
|
|
quantityCntrDescr = true;
|
|
|
}
|
|
|
@@ -4292,7 +4338,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (quantityCntrDescr){
|
|
|
+ if (quantityCntrDescr) {
|
|
|
this.updateBatchById(copyBillsList);
|
|
|
}
|
|
|
if (!copyFeeCenterList.isEmpty()) {
|
|
|
@@ -4747,7 +4793,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if (ObjectUtils.isNull(item.getCntrTypeCode())) {
|
|
|
throw new RuntimeException("箱型不能为空");
|
|
|
}
|
|
|
- if ("0".equals(item.getWhetherAppearStatus())){
|
|
|
+ if ("0".equals(item.getWhetherAppearStatus())) {
|
|
|
item.setActualQuantity(item.getQuantity());
|
|
|
}
|
|
|
item.setWhetherModifyJson(item.getCntrTypeCode() + "+" + item.getQuantity());
|