|
|
@@ -202,9 +202,13 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
record.setAmount(item.getActualAmount());
|
|
|
record.setDate(item.getBusinessDate());
|
|
|
record.setBillNo(item.getBillNoJoin());
|
|
|
- record.setBillNo(item.getContractNo());
|
|
|
+ record.setContractNo(item.getContractNo());
|
|
|
record.setRemarks(item.getRemarks());
|
|
|
record.setCustomsDeclarationNo(item.getDeclarationNumber());
|
|
|
+ record.setAmount(item.getPaymentInUsd());
|
|
|
+ record.setCorpName(item.getCorpName());
|
|
|
+ record.setAmountUsd(item.getActualAmount());
|
|
|
+ record.setExchangeRate(item.getExchangeRate());
|
|
|
if ("D".equals(item.getDc())) {
|
|
|
record.setStatus("付汇已结算");
|
|
|
record.setSrcType("STL-D-FH");
|
|
|
@@ -788,7 +792,6 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
}
|
|
|
}
|
|
|
declare.setBusinessStatus("提交审核");
|
|
|
- declare.setOrderStatus("单据提交审核");
|
|
|
baseMapper.updateById(declare);
|
|
|
return declare;
|
|
|
}
|
|
|
@@ -809,7 +812,6 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
throw new SecurityException("操作失败,请联系管理员");
|
|
|
}
|
|
|
declare.setBusinessStatus("录入");
|
|
|
- declare.setOrderStatus("单据审核撤销");
|
|
|
baseMapper.updateById(declare);
|
|
|
return declare;
|
|
|
}
|
|
|
@@ -1054,7 +1056,6 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
Agent detail = baseMapper.selectById(agent.getId());
|
|
|
detail.setExchangeRate(agent.getExchangeRate());
|
|
|
detail.setDownPayment("1");
|
|
|
- detail.setOrderStatus("首款账单生成");
|
|
|
List<BFees> feesList = bFeesService.list(new LambdaQueryWrapper<BFees>()
|
|
|
.eq(BFees::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(BFees::getIsDeleted, 0)
|
|
|
@@ -1126,7 +1127,6 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
}
|
|
|
}
|
|
|
Agent detail = baseMapper.selectById(agent.getId());
|
|
|
- detail.setOrderStatus("尾款账单已生成");
|
|
|
detail.setExchangeRate(agent.getExchangeRate());
|
|
|
List<BFees> feesList = bFeesService.list(new LambdaQueryWrapper<BFees>()
|
|
|
.eq(BFees::getTenantId, AuthUtil.getTenantId())
|
|
|
@@ -1275,8 +1275,8 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
}
|
|
|
item.setFirstPaidInPayment(amount);
|
|
|
item.setFirstPaidInPaymentDate(date);
|
|
|
- item.setOrderStatus("部分货款");
|
|
|
- item.setWhetherReceivedDownPayments("部分货款");
|
|
|
+ item.setOrderStatus("已收首款未收尾款");
|
|
|
+ item.setWhetherReceivedDownPayments("已收首款未收尾款");
|
|
|
}
|
|
|
if (new BigDecimal("0").compareTo(finalPaymentReceived) != 0) {
|
|
|
BigDecimal amount = feeCenterList.stream().filter(e -> "WK".equals(e.getFeeCode()) && item.getContractNo().equals(e.getBillNo()))
|
|
|
@@ -1286,9 +1286,9 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
}
|
|
|
item.setFinalPaymentReceived(item.getFinalPaymentReceived().add(amount));
|
|
|
item.setFinalPaymentReceivedDate(date);
|
|
|
- item.setOrderStatus("已收货款");
|
|
|
+ item.setOrderStatus("已收尾款");
|
|
|
if (item.getFinalPaymentReceived().add(amount).compareTo(item.getFinalPaymentReceivable()) == 0) {
|
|
|
- item.setWhetherReceivedDownPayments("已收货款");
|
|
|
+ item.setWhetherReceivedDownPayments("已收尾款");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1302,14 +1302,14 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
String formattedDate = sdf.format(now);
|
|
|
for (AgentItems items : agentItemsList) {
|
|
|
if (ObjectUtils.isNull(items.getPaymentRecord())) {
|
|
|
- items.setPaymentRecord("【应收首付款】,【应收尾款】,【应付首付款】,【应付尾款】");
|
|
|
+ items.setPaymentRecord("【收首款】,【收尾款】,【付首款】,【付尾款】");
|
|
|
}
|
|
|
if (new BigDecimal("0").compareTo(firstPaidInPayment) != 0) {
|
|
|
- String msg = "应收首付款:已收款-时间:" + formattedDate;
|
|
|
- items.setPaymentRecord(items.getPaymentRecord().replaceAll("应收首付款", msg));
|
|
|
+ String msg = "收首款:收款时间:" + formattedDate;
|
|
|
+ items.setPaymentRecord(items.getPaymentRecord().replaceAll("收首款", msg));
|
|
|
} else if (new BigDecimal("0").compareTo(finalPaymentReceived) != 0) {
|
|
|
- String msg = "应收尾款:已收款-时间:" + formattedDate;
|
|
|
- items.setPaymentRecord(items.getPaymentRecord().replaceAll("应收尾款", msg));
|
|
|
+ String msg = "收尾款:收款时间:" + formattedDate;
|
|
|
+ items.setPaymentRecord(items.getPaymentRecord().replaceAll("收尾款", msg));
|
|
|
}
|
|
|
}
|
|
|
agentItemsService.updateBatchById(agentItemsList);
|
|
|
@@ -1857,8 +1857,8 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
item.setPrepaidAmountStl(item.getPrepaidAmount());
|
|
|
item.setFirstActualPayment(item.getPrepaidAmount());
|
|
|
item.setFirstActualPaymentDate(date);
|
|
|
- item.setOrderStatus("部分付汇");
|
|
|
- item.setWhetherReceivedBalancePayment("部分付汇");
|
|
|
+ item.setOrderStatus("首款已付未付尾款");
|
|
|
+ item.setWhetherReceivedBalancePayment("首款已付未付尾款");
|
|
|
}
|
|
|
}
|
|
|
if (new BigDecimal("0").compareTo(finalPaymentInFull) != 0) {
|
|
|
@@ -1870,9 +1870,9 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
item.setGoodsValueStl(item.getGoodsValueStl().add(amountWk));
|
|
|
item.setFinalPaymentInFull(item.getFinalPaymentInFull().add(amountWk));
|
|
|
item.setFinalPaymentInFullDate(date);
|
|
|
- item.setOrderStatus("已付汇");
|
|
|
+ item.setOrderStatus("已付尾款");
|
|
|
if (item.getFinalPaymentInFull().add(amountWk).compareTo(item.getFinalPaymentPayable()) == 0) {
|
|
|
- item.setWhetherReceivedBalancePayment("已付汇");
|
|
|
+ item.setWhetherReceivedBalancePayment("已付尾款");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1886,14 +1886,14 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
String formattedDate = sdf.format(now);
|
|
|
for (AgentItems items : agentItemsList) {
|
|
|
if (ObjectUtils.isNull(items.getPaymentRecord())) {
|
|
|
- items.setPaymentRecord("【应收首付款】,【应收尾款】,【应付首付款】,【应付尾款】");
|
|
|
+ items.setPaymentRecord("【收首款】,【收尾款】,【付首款】,【付尾款】");
|
|
|
}
|
|
|
if (new BigDecimal("0").compareTo(firstActualPayment) != 0) {
|
|
|
- String msg = "应付首付款:已付款-时间:" + formattedDate;
|
|
|
- items.setPaymentRecord(items.getPaymentRecord().replaceAll("应付首付款", msg));
|
|
|
+ String msg = "付首款:付款时间:" + formattedDate;
|
|
|
+ items.setPaymentRecord(items.getPaymentRecord().replaceAll("付首款", msg));
|
|
|
} else if (new BigDecimal("0").compareTo(finalPaymentInFull) != 0) {
|
|
|
- String msg = "应付尾款:已付款-时间:" + formattedDate;
|
|
|
- items.setPaymentRecord(items.getPaymentRecord().replaceAll("应付尾款", msg));
|
|
|
+ String msg = "付尾款:付款时间:" + formattedDate;
|
|
|
+ items.setPaymentRecord(items.getPaymentRecord().replaceAll("付尾款", msg));
|
|
|
}
|
|
|
}
|
|
|
agentItemsService.updateBatchById(agentItemsList);
|
|
|
@@ -1993,7 +1993,8 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
data.setStlAmountCrLoc(item.getAmount());
|
|
|
}
|
|
|
finAccBillsService.saveOrUpdate(data);
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
if ("D".equals(item.getDc())) {
|
|
|
data.setStlAmountDr(item.getAmount());
|
|
|
data.setStlAmountCr(new BigDecimal("0.00"));
|
|
|
@@ -2022,7 +2023,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
stlBillsItems.setCreateDeptName(deptName);
|
|
|
}
|
|
|
stlBillsItems.setLineNo(1);
|
|
|
- stlBillsItems.setBusinessType(agentList.get(0).getBusinessType());
|
|
|
+ stlBillsItems.setBusinessType(item.getBusinessType());
|
|
|
stlBillsItems.setBillNo(billNo);
|
|
|
stlBillsItems.setBillDate(date);
|
|
|
stlBillsItems.setAccountDate(data.getAccountDate());
|
|
|
@@ -2057,13 +2058,13 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
stlBillsItems.setItemType("STL");
|
|
|
stlBillsItems.setQuantity(new BigDecimal("1"));
|
|
|
stlBillsItems.setUnitNo(item.getUnitNo());
|
|
|
- stlBillsItems.setPrice(data.getAmountDr());
|
|
|
+ stlBillsItems.setPrice(data.getAmountCr());
|
|
|
stlBillsItems.setCurCode("CNY");
|
|
|
- stlBillsItems.setAmount(data.getAmountDr());
|
|
|
+ stlBillsItems.setAmount(data.getAmountCr());
|
|
|
stlBillsItems.setCurrentStlCurCode("CNY");
|
|
|
stlBillsItems.setCurrentStlExrate(item.getStlExrate());
|
|
|
- stlBillsItems.setCurrentStlAmount(data.getAmountDr());
|
|
|
- stlBillsItems.setCurrentStlAmountLoc(data.getAmountDr());
|
|
|
+ stlBillsItems.setCurrentStlAmount(data.getAmountCr());
|
|
|
+ stlBillsItems.setCurrentStlAmountLoc(data.getAmountCr());
|
|
|
stlBillsItems.setStatus(3);
|
|
|
stlBillsItems.setIsCleared(1);
|
|
|
stlBillsItemsList.add(stlBillsItems);
|
|
|
@@ -2116,12 +2117,10 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
finStlBills.setCreateDeptName(deptName);
|
|
|
}
|
|
|
finStlBills.setBusinessType("STL");
|
|
|
- finStlBills.setCorpId(agentList.get(0).getCorpId());
|
|
|
- finStlBills.setCorpCnName(agentList.get(0).getCorpName());
|
|
|
- finStlBills.setBusinessTypes(agentList.get(0).getBusinessType());
|
|
|
+ finStlBills.setCorpId(feeCenterList.get(0).getCorpId());
|
|
|
+ finStlBills.setCorpCnName(feeCenterList.get(0).getCorpCnName());
|
|
|
+ finStlBills.setBusinessTypes(feeCenterList.get(0).getBusinessType());
|
|
|
finStlBills.setBusinessNo(billNo);
|
|
|
- finStlBills.setDeptId(agentList.get(0).getCreateDept());
|
|
|
- finStlBills.setDeptName(agentList.get(0).getCreateDeptName());
|
|
|
finStlBills.setOperatorId(AuthUtil.getUserId());
|
|
|
finStlBills.setOperatorName(AuthUtil.getUserName());
|
|
|
finStlBills.setDc("C");
|
|
|
@@ -2136,7 +2135,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
List<BCorpsBank> corpsBankList = bCorpsBankService.list(new LambdaQueryWrapper<BCorpsBank>()
|
|
|
.eq(BCorpsBank::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(BCorpsBank::getIsDeleted, 0)
|
|
|
- .eq(BCorpsBank::getPid, agentList.get(0).getCorpId()));
|
|
|
+ .eq(BCorpsBank::getPid, feeCenterList.get(0).getCorpId()));
|
|
|
if (!corpsBankList.isEmpty()) {
|
|
|
finStlBills.setBankId(corpsBankList.get(0).getId());
|
|
|
finStlBills.setBankAccountName(corpsBankList.get(0).getAccountName());
|
|
|
@@ -2744,7 +2743,6 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
List<FeeCenter> feeCenterList = new ArrayList<>();
|
|
|
if ("FFSQ-SK".equals(agent.getPaidApplication())) {
|
|
|
declare.setApplyForPayment("1");
|
|
|
- declare.setOrderStatus("已生成应付首付款");
|
|
|
if (feeCenterService.count(new LambdaQueryWrapper<FeeCenter>()
|
|
|
.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(FeeCenter::getIsDeleted, 0)
|
|
|
@@ -2824,7 +2822,6 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
} else {
|
|
|
throw new RuntimeException("请选择明细");
|
|
|
}
|
|
|
- declare.setOrderStatus("已生成应付尾款");
|
|
|
}
|
|
|
if (!feeCenterList.isEmpty()) {
|
|
|
feeCenterService.saveBatch(feeCenterList);
|
|
|
@@ -2930,8 +2927,8 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
}
|
|
|
Agent agent = baseMapper.selectById(feeCenterList.get(0).getPid());
|
|
|
Agent stlAgent = new Agent();
|
|
|
- stlAgent.setCorpId(agent.getCorpId());
|
|
|
- stlAgent.setCorpName(agent.getCorpName());
|
|
|
+ stlAgent.setCorpId(feeCenterList.get(0).getCorpId());
|
|
|
+ stlAgent.setCorpName(feeCenterList.get(0).getCorpCnName());
|
|
|
stlAgent.setBusinessType("MYDL-STL");
|
|
|
stlAgent.setDc(feeCenterList.get(0).getDc());
|
|
|
stlAgent.setBusinessDate(date);
|
|
|
@@ -3828,15 +3825,15 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
if (new BigDecimal("0").compareTo(firstPaidInPayment) != 0) {
|
|
|
item.setFirstPaidInPayment(new BigDecimal("0.00"));
|
|
|
item.setFirstPaidInPaymentDate(null);
|
|
|
- item.setOrderStatus("未收货款");
|
|
|
- item.setWhetherReceivedDownPayments("未收货款");
|
|
|
+ item.setOrderStatus("未收首款");
|
|
|
+ item.setWhetherReceivedDownPayments("未收首款");
|
|
|
}
|
|
|
if (new BigDecimal("0").compareTo(finalPaymentReceived) != 0) {
|
|
|
BigDecimal amount = feeCenterList.stream().filter(e -> "WK".equals(e.getFeeCode()) && item.getContractNo().equals(e.getBillNo()))
|
|
|
.map(FeeCenter::getAmountLoc).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
item.setFinalPaymentReceived(item.getFinalPaymentReceived().add(amount));
|
|
|
item.setFinalPaymentReceivedDate(null);
|
|
|
- item.setOrderStatus("部分货款");
|
|
|
+ item.setOrderStatus("已收首款未收尾款");
|
|
|
}
|
|
|
}
|
|
|
List<AgentItems> agentItemsList = agentItemsService.list(new LambdaQueryWrapper<AgentItems>()
|
|
|
@@ -3850,12 +3847,12 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
String[] newArr = new String[arr.length];
|
|
|
for (int i = 0; i < arr.length; i++) {
|
|
|
if (new BigDecimal("0").compareTo(firstPaidInPayment) != 0) {
|
|
|
- if (arr[i].contains("应收首付款")) {
|
|
|
- arr[i] = "【应收首付款】";
|
|
|
+ if (arr[i].contains("收首款")) {
|
|
|
+ arr[i] = "【收首款】";
|
|
|
}
|
|
|
} else if (new BigDecimal("0").compareTo(finalPaymentReceived) != 0) {
|
|
|
- if (arr[i].contains("应收尾款")) {
|
|
|
- arr[i] = "【应收尾款】";
|
|
|
+ if (arr[i].contains("收尾款")) {
|
|
|
+ arr[i] = "【收尾款】";
|
|
|
}
|
|
|
}
|
|
|
newArr[i] = arr[i];
|
|
|
@@ -4034,8 +4031,8 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
item.setPrepaidAmountStl(new BigDecimal("0.00"));
|
|
|
item.setFirstActualPayment(new BigDecimal("0.00"));
|
|
|
item.setFirstActualPaymentDate(null);
|
|
|
- item.setOrderStatus("未付汇");
|
|
|
- item.setWhetherReceivedBalancePayment("未付汇");
|
|
|
+ item.setOrderStatus("未付首款");
|
|
|
+ item.setWhetherReceivedBalancePayment("未付首款");
|
|
|
}
|
|
|
}
|
|
|
if (new BigDecimal("0").compareTo(finalPaymentInFull) != 0) {
|
|
|
@@ -4045,8 +4042,8 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
item.setGoodsValueStl(item.getGoodsValueStl().subtract(amountWk));
|
|
|
item.setFinalPaymentInFullDate(null);
|
|
|
if (item.getFinalPaymentInFull().add(amountWk).compareTo(item.getFinalPaymentPayable()) == 0) {
|
|
|
- item.setOrderStatus("未付汇");
|
|
|
- item.setWhetherReceivedBalancePayment("未付汇");
|
|
|
+ item.setOrderStatus("首款已付未付尾款");
|
|
|
+ item.setWhetherReceivedBalancePayment("首款已付未付尾款");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -4064,18 +4061,18 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
String[] newArr = new String[arr.length];
|
|
|
for (int i = 0; i < arr.length; i++) {
|
|
|
if (new BigDecimal("0").compareTo(firstActualPayment) != 0) {
|
|
|
- if (arr[i].contains("应付首付款")) {
|
|
|
- arr[i] = "【应付首付款】";
|
|
|
+ if (arr[i].contains("付首款")) {
|
|
|
+ arr[i] = "【付首款】";
|
|
|
}
|
|
|
} else if (new BigDecimal("0").compareTo(finalPaymentInFull) != 0) {
|
|
|
- if (arr[i].contains("应付尾款")) {
|
|
|
- arr[i] = "【应付尾款】";
|
|
|
+ if (arr[i].contains("付尾款")) {
|
|
|
+ arr[i] = "【付尾款】";
|
|
|
}
|
|
|
}
|
|
|
newArr[i] = arr[i];
|
|
|
}
|
|
|
items.setPaymentRecord(String.join(",", newArr));
|
|
|
- items.setPaymentRecord("【应收首付款】,【应收尾款】,【应付首付款】,【应付尾款】");
|
|
|
+ items.setPaymentRecord("【收首款】,【收尾款】,【付首款】,【付尾款】");
|
|
|
}
|
|
|
}
|
|
|
agentItemsService.updateBatchById(agentItemsList);
|