|
|
@@ -109,20 +109,22 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
ErpProdIo erpProdIo = new ErpProdIo();
|
|
|
erpProdIo.setDetails(details);
|
|
|
// 应收总额
|
|
|
- List<TradeCount> totalTrades = apCheckService.getDueTrade(enUU, keyword.getCustomerUU());
|
|
|
- List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(keyword.getCustomerUU(), enUU);
|
|
|
- if (!CollectionUtil.isEmpty(totalTrades)) {
|
|
|
- erpProdIo.setTotalCount(totalTrades);
|
|
|
- if (!CollectionUtil.isEmpty(vendors)) {
|
|
|
- String tradeString = JSON.toJSONString(totalTrades);
|
|
|
- ThreadUtils.task(()
|
|
|
- -> commonDao.getJdbcTemplate().update(String.format(ApCheckTask.UPDATE_COUNT_SQL, tradeString, vendors.get(0).getId()))
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- // 本月应收
|
|
|
- List<TradeCount> thisMonthTrades = apCheckService.getThisMonthTrade(enUU, keyword.getCustomerUU(), checkDate, fromDate, endDate);
|
|
|
- erpProdIo.setThisMonthCount(thisMonthTrades);
|
|
|
+ if (null != keyword.getCustomerUU()) {
|
|
|
+ List<TradeCount> totalTrades = apCheckService.getDueTrade(enUU, keyword.getCustomerUU());
|
|
|
+ List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(keyword.getCustomerUU(), enUU);
|
|
|
+ if (!CollectionUtil.isEmpty(totalTrades)) {
|
|
|
+ erpProdIo.setTotalCount(totalTrades);
|
|
|
+ if (!CollectionUtil.isEmpty(vendors)) {
|
|
|
+ String tradeString = JSON.toJSONString(totalTrades);
|
|
|
+ ThreadUtils.task(()
|
|
|
+ -> commonDao.getJdbcTemplate().update(String.format(ApCheckTask.UPDATE_COUNT_SQL, tradeString, vendors.get(0).getId()))
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 本月应收
|
|
|
+ List<TradeCount> thisMonthTrades = apCheckService.getThisMonthTrade(enUU, keyword.getCustomerUU(), checkDate, fromDate, endDate);
|
|
|
+ erpProdIo.setThisMonthCount(thisMonthTrades);
|
|
|
+ }
|
|
|
return erpProdIo;
|
|
|
}
|
|
|
|