|
@@ -110,7 +110,7 @@ public class PayChargeSurveyServiceImpl implements PayChargeSurveyService {
|
|
|
|
|
|
//上一账期汇总
|
|
|
String lastDate = list.get(1).getYear() +"-"+String.format("%02d", list.get(1).getMonth())+"-01";
|
|
|
- PayAccountSurvey accountSurvey = payChargeSurveyMapper.getlastAccount(null,siteId,customerId);
|
|
|
+ PayAccountSurvey accountSurvey = payChargeSurveyMapper.getlastAccount(lastDate,siteId,customerId);
|
|
|
|
|
|
//客户总数计算
|
|
|
//当前账期以内客户总数
|
|
@@ -344,7 +344,9 @@ public class PayChargeSurveyServiceImpl implements PayChargeSurveyService {
|
|
|
payTransactionSurveyDto = this.tranCompute(payTransactionSurvey);
|
|
|
}else {
|
|
|
//查询交易记录表
|
|
|
- PayTransactionSurvey transactionSurver = payChargeSurveyMapper.getLastTranRocord(year,month,siteId,customerId);
|
|
|
+ PayTransactionSurvey transactionSurver = new PayTransactionSurvey();
|
|
|
+ transactionSurver = payChargeSurveyMapper.getLastTranRocord(year,month,siteId,customerId);
|
|
|
+ transactionSurver = transactionSurver != null ? transactionSurver : new PayTransactionSurvey();
|
|
|
transactionSurver.setYear(year);
|
|
|
transactionSurver.setMonth(month);
|
|
|
payTransactionSurveyDto = this.tranCompute(transactionSurver);
|
|
@@ -380,8 +382,10 @@ public class PayChargeSurveyServiceImpl implements PayChargeSurveyService {
|
|
|
String lastAlipayRate = "";//支付宝比率
|
|
|
String lastBankRate = "";//银行比率
|
|
|
try {
|
|
|
- BigDecimal currentIncome = transactionSurver.getIncomeNumber();//本月收入总数
|
|
|
- BigDecimal lastIncome = transactionSurver.getLastIncomeNumber();//上月收入总数
|
|
|
+ //本月收入总数
|
|
|
+ BigDecimal currentIncome = transactionSurver != null && transactionSurver.getIncomeNumber() != null ? transactionSurver.getIncomeNumber() : defc;
|
|
|
+ //上月收入总数
|
|
|
+ BigDecimal lastIncome = transactionSurver != null && transactionSurver.getLastIncomeNumber() != null ? transactionSurver.getLastIncomeNumber() : defc;
|
|
|
|
|
|
RecordInfo info = this.calculationRate(currentIncome,lastIncome);
|
|
|
BigDecimal income = info.getIncome();
|
|
@@ -390,17 +394,18 @@ public class PayChargeSurveyServiceImpl implements PayChargeSurveyService {
|
|
|
|
|
|
|
|
|
//按支付方式
|
|
|
- cashIncome = transactionSurver.getCashIncome();//本账期现金收入
|
|
|
- lastcashIncome = transactionSurver.getLastCashIncome();//上期现金收入
|
|
|
+ cashIncome = transactionSurver != null && transactionSurver.getCashIncome() != null ? transactionSurver.getCashIncome() : defc;//本账期现金收入
|
|
|
|
|
|
- wechatIncome = transactionSurver.getWechatIncome();//本账期微信
|
|
|
- lastwechatIncome = transactionSurver.getLastWechatIncome();//上期微信
|
|
|
+ lastcashIncome = transactionSurver != null && transactionSurver.getLastCashIncome() != null ? transactionSurver.getLastCashIncome() : defc;//上期现金收入
|
|
|
|
|
|
- alipayIncome = transactionSurver.getAlipayIncome();//本账期支付宝
|
|
|
- lastalipayIncome = transactionSurver.getLastAlipayIncome();//上期支付宝
|
|
|
+ wechatIncome = transactionSurver != null && transactionSurver.getWechatIncome() != null ? transactionSurver.getWechatIncome() : defc;//本账期微信
|
|
|
+ lastwechatIncome = transactionSurver != null && transactionSurver.getLastWechatIncome() != null ? transactionSurver.getLastWechatIncome() : defc;//上期微信
|
|
|
|
|
|
- bankIncome = transactionSurver.getBankIncome();//本账期银行
|
|
|
- lastbankIncome = transactionSurver.getLastBankIncome();//上期银行
|
|
|
+ alipayIncome = transactionSurver != null && transactionSurver.getAlipayIncome() != null ? transactionSurver.getAlipayIncome() : defc;//本账期支付宝
|
|
|
+ lastalipayIncome = transactionSurver != null && transactionSurver.getLastAlipayIncome() != null ? transactionSurver.getLastAlipayIncome() : defc;//上期支付宝
|
|
|
+
|
|
|
+ bankIncome = transactionSurver != null && transactionSurver.getBankIncome() != null ? transactionSurver.getBankIncome() : defc;//本账期银行
|
|
|
+ lastbankIncome = transactionSurver != null && transactionSurver.getLastBankIncome() != null ? transactionSurver.getLastBankIncome() : defc;//上期银行
|
|
|
|
|
|
|
|
|
info = this.calculationRate(cashIncome,lastcashIncome);
|
|
@@ -761,7 +766,7 @@ public class PayChargeSurveyServiceImpl implements PayChargeSurveyService {
|
|
|
BigDecimal defb = new BigDecimal("1.0");
|
|
|
DecimalFormat df = new DecimalFormat("0.0");
|
|
|
try{
|
|
|
- if(lastIncome.compareTo(BigDecimal.ZERO) == 1){
|
|
|
+ if(lastIncome != null && lastIncome.compareTo(BigDecimal.ZERO) == 1){
|
|
|
if(currentIncome.subtract(lastIncome).compareTo(BigDecimal.ZERO) == 0){
|
|
|
//本期减上期持平显示→
|
|
|
lastIncomeIsUp = 2;
|