|
|
@@ -103,16 +103,10 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public R submit(FeeCenter feeCenter) {
|
|
|
- String deptId;
|
|
|
- String branchId;
|
|
|
+
|
|
|
String deptName = "";
|
|
|
- if (ObjectUtils.isNull(feeCenter.getBranchId())) {
|
|
|
- deptId = AuthUtil.getDeptId();
|
|
|
- branchId = AuthUtil.getDeptId();
|
|
|
- } else {
|
|
|
- deptId = feeCenter.getBranchId();
|
|
|
- branchId = feeCenter.getBranchId();
|
|
|
- }
|
|
|
+ String deptId = AuthUtil.getDeptId();
|
|
|
+ String branchId = AuthUtil.getDeptId();
|
|
|
//获取部门ids对应中文名
|
|
|
if (ObjectUtils.isNotNull(branchId)) {
|
|
|
R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
|
|
|
@@ -228,6 +222,14 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
if (sonItemsList.isEmpty()) {
|
|
|
throw new RuntimeException("未查到模板明细");
|
|
|
}
|
|
|
+ String deptName = "";
|
|
|
+ String branchId = AuthUtil.getDeptId();
|
|
|
+ if (ObjectUtils.isNotNull(branchId)) {
|
|
|
+ R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
|
|
|
+ if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
|
|
|
+ deptName = res.getData();
|
|
|
+ }
|
|
|
+ }
|
|
|
int count = 1;
|
|
|
for (FeesTemplateSonItems items : sonItemsList) {
|
|
|
FeesTemplateItems templateItems = losBFeesTemplate.getFeesTemplateItemsList().stream().filter(e -> e.getId().equals(items.getPpid()))
|
|
|
@@ -236,8 +238,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
throw new RuntimeException("模版数据错误,请联系管理员");
|
|
|
}
|
|
|
FeeCenter feeCenter = new FeeCenter();
|
|
|
- feeCenter.setBranchId(bills.getBranchId());
|
|
|
- feeCenter.setBranchName(bills.getBranchName());
|
|
|
+ feeCenter.setBranchId(branchId);
|
|
|
+ feeCenter.setBranchName(deptName);
|
|
|
feeCenter.setPid(bills.getId());
|
|
|
feeCenter.setCntrNo(bills.getQuantityCntrTypesDescr());
|
|
|
feeCenter.setBillNo(bills.getBillNo());
|
|
|
@@ -361,7 +363,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
}
|
|
|
feeCenter.setQuantity(new BigDecimal(quantity + ""));
|
|
|
feeCenter.setAmount(feeCenter.getPrice().multiply(feeCenter.getQuantity()));
|
|
|
- } else if ("箱量".equals(items.getQuantityRule())) {
|
|
|
+ } else if ("按箱量".equals(items.getQuantityRule())) {
|
|
|
if (preContainers.isEmpty()) {
|
|
|
text.append("费用:").append(items.getFeeCnName()).append("未找到集装箱信息!");
|
|
|
continue;
|
|
|
@@ -514,7 +516,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
}
|
|
|
feeCenter.setQuantity(new BigDecimal(quantity + ""));
|
|
|
feeCenter.setAmount(feeCenter.getPrice().multiply(feeCenter.getQuantity()));
|
|
|
- } else if ("箱量".equals(items.getQuantityRule())) {
|
|
|
+ } else if ("按箱量".equals(items.getQuantityRule())) {
|
|
|
if (preContainers.isEmpty()) {
|
|
|
text.append("费用:").append(items.getFeeCnName()).append("未找到集装箱信息!");
|
|
|
continue;
|
|
|
@@ -568,16 +570,10 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
bills = billsMapper.selectById(list.get(0).getPid());
|
|
|
status = true;
|
|
|
}
|
|
|
- String deptId;
|
|
|
- String branchId;
|
|
|
+
|
|
|
String deptName = "";
|
|
|
- if (ObjectUtils.isNull(bills.getBranchId())) {
|
|
|
- deptId = AuthUtil.getDeptId();
|
|
|
- branchId = AuthUtil.getDeptId();
|
|
|
- } else {
|
|
|
- deptId = bills.getBranchId();
|
|
|
- branchId = bills.getBranchId();
|
|
|
- }
|
|
|
+ String deptId = AuthUtil.getDeptId();
|
|
|
+ String branchId = AuthUtil.getDeptId();
|
|
|
//获取部门ids对应中文名
|
|
|
if (ObjectUtils.isNotNull(branchId)) {
|
|
|
R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
|
|
|
@@ -771,16 +767,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
public R submitListOptimization(List<FeeCenter> list) {
|
|
|
List<FeeCenter> feeCenterList = new ArrayList<>();
|
|
|
if (ObjectUtils.isNotNull(list) && !list.isEmpty()) {
|
|
|
- String deptId;
|
|
|
- String branchId;
|
|
|
+ String deptId = AuthUtil.getDeptId();
|
|
|
+ String branchId = AuthUtil.getDeptId();
|
|
|
String deptName = "";
|
|
|
- if (ObjectUtils.isNull(list.get(0).getBranchId())) {
|
|
|
- deptId = AuthUtil.getDeptId();
|
|
|
- branchId = AuthUtil.getDeptId();
|
|
|
- } else {
|
|
|
- deptId = list.get(0).getBranchId();
|
|
|
- branchId = list.get(0).getBranchId();
|
|
|
- }
|
|
|
//获取部门ids对应中文名
|
|
|
if (ObjectUtils.isNotNull(branchId)) {
|
|
|
R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
|
|
|
@@ -1004,16 +993,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
BigDecimal amountCUsd = new BigDecimal("0.00");
|
|
|
BigDecimal amountDLoc = new BigDecimal("0.00");
|
|
|
BigDecimal amountCLoc = new BigDecimal("0.00");
|
|
|
- String deptId;
|
|
|
- String branchId;
|
|
|
String deptName = "";
|
|
|
- if (ObjectUtils.isNull(list.get(0).getBranchId())) {
|
|
|
- deptId = AuthUtil.getDeptId();
|
|
|
- branchId = AuthUtil.getDeptId();
|
|
|
- } else {
|
|
|
- deptId = list.get(0).getBranchId();
|
|
|
- branchId = list.get(0).getBranchId();
|
|
|
- }
|
|
|
+ String deptId = AuthUtil.getDeptId();
|
|
|
+ String branchId = AuthUtil.getDeptId();
|
|
|
if (ObjectUtils.isNotNull(branchId)) {
|
|
|
R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
|
|
|
if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
|
|
|
@@ -1161,6 +1143,14 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PreContainers::getIsDeleted, 0)
|
|
|
.apply("find_in_set(pid,'" + billsIds + "')"));
|
|
|
+ String deptName = "";
|
|
|
+ String branchId = AuthUtil.getDeptId();
|
|
|
+ if (ObjectUtils.isNotNull(branchId)) {
|
|
|
+ R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
|
|
|
+ if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
|
|
|
+ deptName = res.getData();
|
|
|
+ }
|
|
|
+ }
|
|
|
List<FeeCenter> list = new ArrayList<>();
|
|
|
StringBuilder text = new StringBuilder();
|
|
|
for (Bills bills : billsList) {
|
|
|
@@ -1204,12 +1194,6 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
date = bills.getEta();
|
|
|
}
|
|
|
}
|
|
|
- String branchId;
|
|
|
- if (ObjectUtils.isNull(bills.getBranchId())) {
|
|
|
- branchId = AuthUtil.getDeptId();
|
|
|
- } else {
|
|
|
- branchId = bills.getBranchId();
|
|
|
- }
|
|
|
String exrateType = currencyUtils.standardCurrency(branchId);
|
|
|
List<BCurExrate> curExrateList = currencyUtils.obtainRate(date, "1", branchId);
|
|
|
int count = 1;
|
|
|
@@ -1220,8 +1204,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
throw new RuntimeException("模版数据错误,请联系管理员");
|
|
|
}
|
|
|
FeeCenter feeCenter = new FeeCenter();
|
|
|
- feeCenter.setBranchId(bills.getBranchId());
|
|
|
- feeCenter.setBranchName(bills.getBranchName());
|
|
|
+ feeCenter.setBranchId(branchId);
|
|
|
+ feeCenter.setBranchName(deptName);
|
|
|
feeCenter.setPid(bills.getId());
|
|
|
feeCenter.setCntrNo(bills.getQuantityCntrTypesDescr());
|
|
|
feeCenter.setBillNo(bills.getBillNo());
|
|
|
@@ -1345,7 +1329,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
}
|
|
|
feeCenter.setQuantity(new BigDecimal(quantity + ""));
|
|
|
feeCenter.setAmount(feeCenter.getPrice().multiply(feeCenter.getQuantity()));
|
|
|
- } else if ("箱量".equals(items.getQuantityRule())) {
|
|
|
+ } else if ("按箱量".equals(items.getQuantityRule())) {
|
|
|
if (preContainers.isEmpty()) {
|
|
|
text.append("费用:").append(items.getFeeCnName()).append("未找到集装箱信息!");
|
|
|
continue;
|
|
|
@@ -1425,6 +1409,14 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
if (feesD == null) {
|
|
|
throw new RuntimeException("未查到销售价信息,请先维护基础资料");
|
|
|
}
|
|
|
+ String deptName = "";
|
|
|
+ String branchId = AuthUtil.getDeptId();
|
|
|
+ if (ObjectUtils.isNotNull(branchId)) {
|
|
|
+ R<String> res = sysClient.getDeptName(Long.parseLong(branchId));
|
|
|
+ if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
|
|
|
+ deptName = res.getData();
|
|
|
+ }
|
|
|
+ }
|
|
|
List<FeeCenter> list = new ArrayList<>();
|
|
|
StringBuilder text = new StringBuilder();
|
|
|
for (Bills bills : billsList) {
|
|
|
@@ -1471,12 +1463,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
date = bills.getEta();
|
|
|
}
|
|
|
}
|
|
|
- String branchId;
|
|
|
- if (ObjectUtils.isNull(bills.getBranchId())) {
|
|
|
- branchId = AuthUtil.getDeptId();
|
|
|
- } else {
|
|
|
- branchId = bills.getBranchId();
|
|
|
- }
|
|
|
+
|
|
|
String exrateType = currencyUtils.standardCurrency(branchId);
|
|
|
List<BCurExrate> curExrateList = currencyUtils.obtainRate(date, "1", branchId);
|
|
|
int count = 1;
|
|
|
@@ -1485,12 +1472,16 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
FeeCenter feeCenter = this.addFeeCenter(bills, "C", count, fees, "船公司", items,
|
|
|
curExrateList, preContainers, exrateType, "1");
|
|
|
if (feeCenter != null) {
|
|
|
+ feeCenter.setBranchId(branchId);
|
|
|
+ feeCenter.setBranchName(deptName);
|
|
|
list.add(feeCenter);
|
|
|
count++;
|
|
|
}
|
|
|
FeeCenter feeCenterD = this.addFeeCenter(bills, "D", count, feesD, "国内直接客户", items,
|
|
|
curExrateList, preContainers, exrateType, "2");
|
|
|
if (feeCenterD != null) {
|
|
|
+ feeCenterD.setBranchId(branchId);
|
|
|
+ feeCenterD.setBranchName(deptName);
|
|
|
list.add(feeCenterD);
|
|
|
count++;
|
|
|
}
|
|
|
@@ -1498,12 +1489,16 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
FeeCenter feeCenter = this.addFeeCenter(bills, "C", count, fees, "船公司", items,
|
|
|
curExrateList, preContainers, exrateType, "1");
|
|
|
if (feeCenter != null) {
|
|
|
+ feeCenter.setBranchId(branchId);
|
|
|
+ feeCenter.setBranchName(deptName);
|
|
|
list.add(feeCenter);
|
|
|
count++;
|
|
|
}
|
|
|
FeeCenter feeCenterD = this.addFeeCenter(bills, "D", count, feesD, "国内直接客户", items,
|
|
|
curExrateList, preContainers, exrateType, "3");
|
|
|
if (feeCenterD != null) {
|
|
|
+ feeCenterD.setBranchId(branchId);
|
|
|
+ feeCenterD.setBranchName(deptName);
|
|
|
list.add(feeCenterD);
|
|
|
count++;
|
|
|
}
|
|
|
@@ -1511,6 +1506,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
|
|
|
FeeCenter feeCenter = this.addFeeCenter(bills, "C", count, fees, "国内直接客户", items,
|
|
|
curExrateList, preContainers, exrateType, "4");
|
|
|
if (feeCenter != null) {
|
|
|
+ feeCenter.setBranchId(branchId);
|
|
|
+ feeCenter.setBranchName(deptName);
|
|
|
list.add(feeCenter);
|
|
|
count++;
|
|
|
}
|