|
@@ -25,6 +25,7 @@ import com.uas.platform.b2b.model.SearchFilter;
|
|
|
import com.uas.platform.b2b.model.SourceForApcheck;
|
|
import com.uas.platform.b2b.model.SourceForApcheck;
|
|
|
import com.uas.platform.b2b.model.Vendor;
|
|
import com.uas.platform.b2b.model.Vendor;
|
|
|
import com.uas.platform.b2b.model.util.UnCheckedCountSqls;
|
|
import com.uas.platform.b2b.model.util.UnCheckedCountSqls;
|
|
|
|
|
+import com.uas.platform.b2b.publicapi.model.ApCheckAmount;
|
|
|
import com.uas.platform.b2b.publicapi.model.TradeCount;
|
|
import com.uas.platform.b2b.publicapi.model.TradeCount;
|
|
|
import com.uas.platform.b2b.search.SearchService;
|
|
import com.uas.platform.b2b.search.SearchService;
|
|
|
import com.uas.platform.b2b.service.OrderRedDotService;
|
|
import com.uas.platform.b2b.service.OrderRedDotService;
|
|
@@ -528,11 +529,11 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
.forEach(customer -> {
|
|
.forEach(customer -> {
|
|
|
Long customerUU = customer.getMyEnUU();
|
|
Long customerUU = customer.getMyEnUU();
|
|
|
if (!StringUtils.isEmpty(customer.getTotalCountString())) {
|
|
if (!StringUtils.isEmpty(customer.getTotalCountString())) {
|
|
|
- List<TradeCount> tradeCounts = JSON.parseArray(customer.getTotalCountString(), TradeCount.class);
|
|
|
|
|
|
|
+ List<ApCheckAmount> tradeCounts = JSON.parseArray(customer.getTotalCountString(), ApCheckAmount.class);
|
|
|
customer.setTotalCount(tradeCounts);
|
|
customer.setTotalCount(tradeCounts);
|
|
|
}
|
|
}
|
|
|
// 本月应收
|
|
// 本月应收
|
|
|
- List<TradeCount> thisMonthTrades = getThisMonthTrade(enUU, customerUU, checkDate, fromDate, endDate);
|
|
|
|
|
|
|
+ List<ApCheckAmount> thisMonthTrades = getThisMonthTrade(enUU, customerUU, checkDate, fromDate, endDate);
|
|
|
customer.setThisMonthCount(thisMonthTrades);
|
|
customer.setThisMonthCount(thisMonthTrades);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -588,7 +589,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
* @return 统计结果
|
|
* @return 统计结果
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public List<TradeCount> getThisMonthTrade(Long enUU, Long customerUU, String checkDate, Long fromDate, Long endDate) {
|
|
|
|
|
|
|
+ public List<ApCheckAmount> getThisMonthTrade(Long enUU, Long customerUU, String checkDate, Long fromDate, Long endDate) {
|
|
|
String sqlFromDate;
|
|
String sqlFromDate;
|
|
|
String sqlEndDate;
|
|
String sqlEndDate;
|
|
|
/*
|
|
/*
|
|
@@ -616,49 +617,49 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
} else {
|
|
} else {
|
|
|
throw new IllegalOperatorException("请选择对账时间");
|
|
throw new IllegalOperatorException("请选择对账时间");
|
|
|
}
|
|
}
|
|
|
- List<TradeCount> totalTrades = new ArrayList<>();
|
|
|
|
|
|
|
+ List<ApCheckAmount> totalTrades = new ArrayList<>();
|
|
|
ThreadUtils
|
|
ThreadUtils
|
|
|
// 货款调账
|
|
// 货款调账
|
|
|
.task(() -> {
|
|
.task(() -> {
|
|
|
- List<TradeCount> trades = commonDao.query(UnCheckedCountSqls.THISMONTH_ADJUSTMENT_COUNT_SQL, TradeCount.class, enUU, customerUU, sqlFromDate, sqlEndDate);
|
|
|
|
|
|
|
+ List<ApCheckAmount> trades = commonDao.query(UnCheckedCountSqls.THISMONTH_ADJUSTMENT_COUNT_SQL, ApCheckAmount.class, enUU, customerUU, sqlFromDate, sqlEndDate);
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
})
|
|
})
|
|
|
// 采购验收
|
|
// 采购验收
|
|
|
.task(() -> {
|
|
.task(() -> {
|
|
|
- List<TradeCount> trades = commonDao.query(UnCheckedCountSqls.THISMONTH_SALE_ACCEPT_COUNT_SQL, TradeCount.class, enUU, customerUU, sqlFromDate, sqlEndDate);
|
|
|
|
|
|
|
+ List<ApCheckAmount> trades = commonDao.query(UnCheckedCountSqls.THISMONTH_SALE_ACCEPT_COUNT_SQL, ApCheckAmount.class, enUU, customerUU, sqlFromDate, sqlEndDate);
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
})
|
|
})
|
|
|
// 采购验退
|
|
// 采购验退
|
|
|
.task(() -> {
|
|
.task(() -> {
|
|
|
- List<TradeCount> trades = commonDao.query(UnCheckedCountSqls.THISMONTH_SALE_RETURN_COUNT_SQL, TradeCount.class, enUU, customerUU, sqlFromDate, sqlEndDate);
|
|
|
|
|
|
|
+ List<ApCheckAmount> trades = commonDao.query(UnCheckedCountSqls.THISMONTH_SALE_RETURN_COUNT_SQL, ApCheckAmount.class, enUU, customerUU, sqlFromDate, sqlEndDate);
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
})
|
|
})
|
|
|
// 委外验收
|
|
// 委外验收
|
|
|
.task(() -> {
|
|
.task(() -> {
|
|
|
- List<TradeCount> trades = commonDao.query(UnCheckedCountSqls.THISMONTH_MAKE_ACCEPT_COUNT_SQL, TradeCount.class, enUU, customerUU, sqlFromDate, sqlEndDate);
|
|
|
|
|
|
|
+ List<ApCheckAmount> trades = commonDao.query(UnCheckedCountSqls.THISMONTH_MAKE_ACCEPT_COUNT_SQL, ApCheckAmount.class, enUU, customerUU, sqlFromDate, sqlEndDate);
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
})
|
|
})
|
|
|
// 委外验退
|
|
// 委外验退
|
|
|
.task(() -> {
|
|
.task(() -> {
|
|
|
- List<TradeCount> trades = commonDao.query(UnCheckedCountSqls.THISMONTH_MAKE_RETURN_COUNT_SQL, TradeCount.class, enUU, customerUU, sqlFromDate, sqlEndDate);
|
|
|
|
|
|
|
+ List<ApCheckAmount> trades = commonDao.query(UnCheckedCountSqls.THISMONTH_MAKE_RETURN_COUNT_SQL, ApCheckAmount.class, enUU, customerUU, sqlFromDate, sqlEndDate);
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
})
|
|
})
|
|
|
.run();
|
|
.run();
|
|
|
- Double rmbCount = totalTrades.stream().filter(tradeCount -> RMB.equals(tradeCount.getCurrency()) && null != tradeCount.getAmount())
|
|
|
|
|
- .mapToDouble(trade -> trade.getAmount().doubleValue()).sum();
|
|
|
|
|
- Double usdCount = totalTrades.stream().filter(tradeCount -> USD.equals(tradeCount.getCurrency()) && null != tradeCount.getAmount())
|
|
|
|
|
- .mapToDouble(trade -> trade.getAmount().doubleValue()).sum();
|
|
|
|
|
- Double hkdCount = totalTrades.stream().filter(tradeCount -> HKD.equals(tradeCount.getCurrency()) && null != tradeCount.getAmount())
|
|
|
|
|
- .mapToDouble(trade -> trade.getAmount().doubleValue()).sum();
|
|
|
|
|
- List<TradeCount> resultCounts = new ArrayList<>();
|
|
|
|
|
|
|
+ Double rmbCount = totalTrades.stream().filter(tradeCount -> RMB.equals(tradeCount.getCurrency()))
|
|
|
|
|
+ .mapToDouble(ApCheckAmount::getCount).sum();
|
|
|
|
|
+ Double usdCount = totalTrades.stream().filter(tradeCount -> USD.equals(tradeCount.getCurrency()))
|
|
|
|
|
+ .mapToDouble(ApCheckAmount::getCount).sum();
|
|
|
|
|
+ Double hkdCount = totalTrades.stream().filter(tradeCount -> HKD.equals(tradeCount.getCurrency()))
|
|
|
|
|
+ .mapToDouble(ApCheckAmount::getCount).sum();
|
|
|
|
|
+ List<ApCheckAmount> resultCounts = new ArrayList<>();
|
|
|
if (rmbCount > 0) {
|
|
if (rmbCount > 0) {
|
|
|
- resultCounts.add(new TradeCount(RMB, DecimalUtils.decimalPoint(rmbCount, 2)));
|
|
|
|
|
|
|
+ resultCounts.add(new ApCheckAmount(RMB, DecimalUtils.decimalPoint(rmbCount, 2)));
|
|
|
}
|
|
}
|
|
|
if (usdCount > 0) {
|
|
if (usdCount > 0) {
|
|
|
- resultCounts.add(new TradeCount(USD, DecimalUtils.decimalPoint(usdCount, 2)));
|
|
|
|
|
|
|
+ resultCounts.add(new ApCheckAmount(USD, DecimalUtils.decimalPoint(usdCount, 2)));
|
|
|
}
|
|
}
|
|
|
if (hkdCount > 0) {
|
|
if (hkdCount > 0) {
|
|
|
- resultCounts.add(new TradeCount(HKD, DecimalUtils.decimalPoint(hkdCount, 2)));
|
|
|
|
|
|
|
+ resultCounts.add(new ApCheckAmount(HKD, DecimalUtils.decimalPoint(hkdCount, 2)));
|
|
|
}
|
|
}
|
|
|
return resultCounts;
|
|
return resultCounts;
|
|
|
}
|
|
}
|
|
@@ -671,50 +672,50 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
* @return 统计结果
|
|
* @return 统计结果
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public List<TradeCount> getDueTrade(Long enUU, Long customerUU) {
|
|
|
|
|
- List<TradeCount> totalTrades = new ArrayList<>();
|
|
|
|
|
|
|
+ public List<ApCheckAmount> getDueTrade(Long enUU, Long customerUU) {
|
|
|
|
|
+ List<ApCheckAmount> totalTrades = new ArrayList<>();
|
|
|
ThreadUtils
|
|
ThreadUtils
|
|
|
// 货款调账
|
|
// 货款调账
|
|
|
.task(() -> {
|
|
.task(() -> {
|
|
|
- List<TradeCount> trades = commonDao.query(UnCheckedCountSqls.ADJUSTMENT_COUNT_SQL, TradeCount.class, enUU, customerUU);
|
|
|
|
|
|
|
+ List<ApCheckAmount> trades = commonDao.query(UnCheckedCountSqls.ADJUSTMENT_COUNT_SQL, ApCheckAmount.class, enUU, customerUU);
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
})
|
|
})
|
|
|
// 采购验收
|
|
// 采购验收
|
|
|
.task(() -> {
|
|
.task(() -> {
|
|
|
- List<TradeCount> trades = commonDao.query(UnCheckedCountSqls.SALE_ACCEPT_COUNT_SQL, TradeCount.class, enUU, customerUU);
|
|
|
|
|
|
|
+ List<ApCheckAmount> trades = commonDao.query(UnCheckedCountSqls.SALE_ACCEPT_COUNT_SQL, ApCheckAmount.class, enUU, customerUU);
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
})
|
|
})
|
|
|
// 采购验退
|
|
// 采购验退
|
|
|
.task(() -> {
|
|
.task(() -> {
|
|
|
- List<TradeCount> trades = commonDao.query(UnCheckedCountSqls.SALE_RETURN_COUNT_SQL, TradeCount.class, enUU, customerUU);
|
|
|
|
|
|
|
+ List<ApCheckAmount> trades = commonDao.query(UnCheckedCountSqls.SALE_RETURN_COUNT_SQL, ApCheckAmount.class, enUU, customerUU);
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
})
|
|
})
|
|
|
// 委外验收
|
|
// 委外验收
|
|
|
.task(() -> {
|
|
.task(() -> {
|
|
|
- List<TradeCount> trades = commonDao.query(UnCheckedCountSqls.MAKE_ACCEPT_COUNT_SQL, TradeCount.class, enUU, customerUU);
|
|
|
|
|
|
|
+ List<ApCheckAmount> trades = commonDao.query(UnCheckedCountSqls.MAKE_ACCEPT_COUNT_SQL, ApCheckAmount.class, enUU, customerUU);
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
})
|
|
})
|
|
|
// 委外验退
|
|
// 委外验退
|
|
|
.task(() -> {
|
|
.task(() -> {
|
|
|
- List<TradeCount> trades = commonDao.query(UnCheckedCountSqls.MAKE_RETURN_COUNT_SQL, TradeCount.class, enUU, customerUU);
|
|
|
|
|
|
|
+ List<ApCheckAmount> trades = commonDao.query(UnCheckedCountSqls.MAKE_RETURN_COUNT_SQL, ApCheckAmount.class, enUU, customerUU);
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
})
|
|
})
|
|
|
.run();
|
|
.run();
|
|
|
- Double rmbCount = totalTrades.stream().filter(tradeCount -> RMB.equals(tradeCount.getCurrency()) && null != tradeCount.getAmount())
|
|
|
|
|
- .mapToDouble(trade -> trade.getAmount().doubleValue()).sum();
|
|
|
|
|
- Double usdCount = totalTrades.stream().filter(tradeCount -> USD.equals(tradeCount.getCurrency()) && null != tradeCount.getAmount())
|
|
|
|
|
- .mapToDouble(trade -> trade.getAmount().doubleValue()).sum();
|
|
|
|
|
- Double hkdCount = totalTrades.stream().filter(tradeCount -> HKD.equals(tradeCount.getCurrency()) && null != tradeCount.getAmount())
|
|
|
|
|
- .mapToDouble(trade -> trade.getAmount().doubleValue()).sum();
|
|
|
|
|
- List<TradeCount> resultCounts = new ArrayList<>();
|
|
|
|
|
|
|
+ Double rmbCount = totalTrades.stream().filter(tradeCount -> RMB.equals(tradeCount.getCurrency()))
|
|
|
|
|
+ .mapToDouble(ApCheckAmount::getCount).sum();
|
|
|
|
|
+ Double usdCount = totalTrades.stream().filter(tradeCount -> USD.equals(tradeCount.getCurrency()))
|
|
|
|
|
+ .mapToDouble(ApCheckAmount::getCount).sum();
|
|
|
|
|
+ Double hkdCount = totalTrades.stream().filter(tradeCount -> HKD.equals(tradeCount.getCurrency()))
|
|
|
|
|
+ .mapToDouble(ApCheckAmount::getCount).sum();
|
|
|
|
|
+ List<ApCheckAmount> resultCounts = new ArrayList<>();
|
|
|
if (rmbCount > 0) {
|
|
if (rmbCount > 0) {
|
|
|
- resultCounts.add(new TradeCount(RMB, DecimalUtils.decimalPoint(rmbCount, 2)));
|
|
|
|
|
|
|
+ resultCounts.add(new ApCheckAmount(RMB, DecimalUtils.decimalPoint(rmbCount, 2)));
|
|
|
}
|
|
}
|
|
|
if (usdCount > 0) {
|
|
if (usdCount > 0) {
|
|
|
- resultCounts.add(new TradeCount(USD, DecimalUtils.decimalPoint(usdCount, 2)));
|
|
|
|
|
|
|
+ resultCounts.add(new ApCheckAmount(USD, DecimalUtils.decimalPoint(usdCount, 2)));
|
|
|
}
|
|
}
|
|
|
if (hkdCount > 0) {
|
|
if (hkdCount > 0) {
|
|
|
- resultCounts.add(new TradeCount(HKD, DecimalUtils.decimalPoint(hkdCount, 2)));
|
|
|
|
|
|
|
+ resultCounts.add(new ApCheckAmount(HKD, DecimalUtils.decimalPoint(hkdCount, 2)));
|
|
|
}
|
|
}
|
|
|
return resultCounts;
|
|
return resultCounts;
|
|
|
}
|
|
}
|