fix Estimate

master
luoyang 6 years ago
parent 35202a83de
commit b4da9ca173

@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.jsoup.helper.DataUtil;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
@ -227,17 +228,18 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
//预计到账金额
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH)-1, 0, 0, 0);
Date datefrom = cal.getTime();
JSONObject params = new JSONObject();
params.put("datefrom", DateFormatUtils.format(datefrom, "yyyy-MM-dd HH:mm:ss"));
params.put("dateto", DateFormatUtils.format(DateUtils.addDays(datefrom, 1),"yyyy-MM-dd HH:mm:ss"));
if (DateUtils.addDays(new Date(), -1).getDate() == datefrom.getDate()) {
JSONObject params = new JSONObject();
params.put("datefrom", DateFormatUtils.format(datefrom, "yyyy-MM-dd HH:mm:ss"));
params.put("dateto", DateFormatUtils.format(DateUtils.addDays(datefrom, 1),"yyyy-MM-dd HH:mm:ss"));
List<JSONObject> lastDayClearingAmount = transactionMapper.getLastDaytransAmount(params);
dayInfo.put("clearing", lastDayClearingAmount);
List<JSONObject> lastDayClearingAmount = transactionMapper.getLastDaytransAmount(params);
dayInfo.put("clearing", lastDayClearingAmount);
}
return dayInfo;
}

@ -1115,7 +1115,8 @@
<select id="getLastDaytransAmount" resultType="com.alibaba.fastjson.JSONObject">
SELECT ifnull(SUM(IF(transaction_type='Credit',clearing_amount,-clearing_amount)),0) clearing_amount,
ifnull(SUM(IF(transaction_type='Credit',total_surcharge,-total_surcharge)),0) total_surcharge,
ifnull(SUM(IF(transaction_type='Credit',channel_surcharge,-channel_surcharge)),0) channel_surcharge
ifnull(SUM(IF(transaction_type='Credit',channel_surcharge,-channel_surcharge)),0) channel_surcharge,
channel
FROM pmt_transactions
WHERE channel!='Settlement'
AND channel!='System'

@ -103,7 +103,7 @@
总到账金额:<a class="text-green"
ng-bind="fut.platformGetSettleFee|currency:'AUD'"></a></p>
</div>
<div ng-if="fut.clearing.size >0">
<div ng-if="fut.clearing.length >0">
<div class="box-header">
<span class="text-bold">预计到账金额详情:</span>
</div>

Loading…
Cancel
Save