fix : develop_act_Chairty

master
luoyang14z7 6 years ago
parent df14273f57
commit 0bbd6b8297

@ -86,9 +86,19 @@ public class ActChairtyServiceImp implements ActChairtyService {
@Override @Override
public JSONObject gettotal() { public JSONObject gettotal() {
List<JSONObject> gettotalnum = actChairtyMapper.chairtyClientNum();
int amount=0 ;
double chairty=0.00;
for (JSONObject gettotals : gettotalnum) {
amount += gettotals.getIntValue("sum_ordernum");
chairty += gettotals.getDoubleValue("count_ordernum") * 0.01;
}
BigDecimal bg = new BigDecimal(chairty);
double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
JSONObject gettotal = new JSONObject();
gettotal.put("amount", amount);
gettotal.put("chairty", f1);
return gettotal;
} }

@ -31,7 +31,7 @@ public interface ActChairtyMapper {
PageList<JSONObject> getChairtyWeekRaking(@Param("begin") Date begin, @Param("end") Date end,PageBounds pageBounds); PageList<JSONObject> getChairtyWeekRaking(@Param("begin") Date begin, @Param("end") Date end,PageBounds pageBounds);
List<JSONObject> chairtytotalNum(); List<JSONObject> chairtyClientNum();
} }

@ -6,20 +6,21 @@ select client_moniker,active_time,IFNULL(count(org_id),0) as count_ordernum,ifnu
from act_charity from act_charity
left JOIN pmt_transactions on act_charity.client_id = pmt_transactions.client_id left JOIN pmt_transactions on act_charity.client_id = pmt_transactions.client_id
and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=act_charity.active_time and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=act_charity.active_time
and t.refund_id is null and t.channel != 'Settlement' and pmt_transactions.refund_id is null and pmt_transactions.channel != 'Settlement'
GROUP BY act_charity.client_id order by sum_ordernum desc GROUP BY act_charity.client_id order by sum_ordernum desc
</select> </select>
<select id="getChairtyWeekstartAnalysis" resultType="com.alibaba.fastjson.JSONObject"> <select id="getChairtyWeekstartAnalysis" resultType="com.alibaba.fastjson.JSONObject">
select DATE_FORMAT(pmt_transactions.transaction_time,'%Y-%m-%d') as weekstart from act_charity select DATE_FORMAT(pmt_transactions.transaction_time,'%Y-%m-%d') as weekstart from act_charity
inner JOIN pmt_transactions on act_charity.client_id = pmt_transactions.client_id inner JOIN pmt_transactions on act_charity.client_id = pmt_transactions.client_id
where dayofweek(pmt_transactions.transaction_time)=2 and pmt_transactions.transaction_time&gt;=#{begin} and pmt_transactions.transaction_time&lt;=#{end} and t.refund_id is null and t.channel != 'Settlement' where dayofweek(pmt_transactions.transaction_time)=2 and pmt_transactions.transaction_time&gt;=#{begin} and pmt_transactions.transaction_time&lt;=#{end}
and pmt_transactions.refund_id is null and pmt_transactions.channel != 'Settlement'
group by weekstart order by weekstart asc; group by weekstart order by weekstart asc;
</select> </select>
<select id="getChairtyWeekAnalysis" resultType="com.alibaba.fastjson.JSONObject"> <select id="getChairtyWeekAnalysis" resultType="com.alibaba.fastjson.JSONObject">
select count(pmt_transactions.org_id) as count_ordernum,ifnull(sum(pmt_transactions.transaction_amount),0) as sum_ordernum from act_charity left JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id select count(pmt_transactions.org_id) as count_ordernum,ifnull(sum(pmt_transactions.transaction_amount),0) as sum_ordernum from act_charity left JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id
and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time&gt;=#{begin} and pmt_transactions.transaction_time&lt;=#{end} and t.refund_id is null and t.channel != 'Settlement' and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time&gt;=#{begin} and pmt_transactions.transaction_time&lt;=#{end}
and pmt_transactions.refund_id is null and pmt_transactions.channel != 'Settlement'
</select> </select>
@ -27,6 +28,5 @@ GROUP BY act_charity.client_id order by sum_ordernum desc
select act_charity.client_moniker,((count(pmt_transactions.org_id)) * 0.01) as chair_ordernum,ifnull(sum(pmt_transactions.transaction_amount),0) as sum_ordernum from act_charity left JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id select act_charity.client_moniker,((count(pmt_transactions.org_id)) * 0.01) as chair_ordernum,ifnull(sum(pmt_transactions.transaction_amount),0) as sum_ordernum from act_charity left JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id
and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time&gt;=#{begin} and pmt_transactions.transaction_time&lt;=#{end} and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time&gt;=#{begin} and pmt_transactions.transaction_time&lt;=#{end}
GROUP BY act_charity.client_moniker order by sum_ordernum desc GROUP BY act_charity.client_moniker order by sum_ordernum desc
</select> </select>
</mapper> </mapper>

@ -176,7 +176,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul
$scope.doPartnerTotalRanking(1); $scope.doPartnerTotalRanking(1);
}; };
$scope.doAnalysis(1); $scope.doAnalysis(1);
$scope.getTotalCashBack(1); $scope.getTotalAmount(1);
$scope.settleDelayEchart = function (chart) { $scope.settleDelayEchart = function (chart) {
chart.on('click', function (params) { chart.on('click', function (params) {
$scope.cashBack_total_daily = $scope.cashbackDaily[params.dataIndex].chairty_amount; $scope.cashBack_total_daily = $scope.cashbackDaily[params.dataIndex].chairty_amount;

@ -52,8 +52,8 @@
<tr ng-repeat="client in clients"> <tr ng-repeat="client in clients">
<td ng-bind="client.client_moniker"></td> <td ng-bind="client.client_moniker"></td>
<td ng-bind="client.active_time"></td> <td ng-bind="client.active_time"></td>
<td ng-bind="client.count_orderNum"></td> <td ng-bind="client.count_ordernum"></td>
<td ng-bind="client.sum_orderNum"></td> <td ng-bind="client.sum_ordernum"></td>
<td ng-bind="client.chairty_num"></td> <td ng-bind="client.chairty_num"></td>
</tr> </tr>
</tbody> </tbody>

Loading…
Cancel
Save