Merge branch 'hotfix' into develop

# Conflicts:
#	src/main/java/au/com/royalpay/payment/manage/customers/core/impls/EncourageUseProcessor.java
master
kira 6 years ago
commit 92a9e2a1ca

@ -240,16 +240,22 @@ public class EncourageUseProcessor implements Ordered, EncourageService {
Date toDate = config.getDate("to_date");
status.put("to", DateFormatUtils.format(toDate, "MM-dd"));
JSONObject member = customerMembershipMapper.findByPaymentOpenId(openid);
JSONObject use = customerEncourageMoneyAccessLogMapper.sumMoney(member.getString("memeber_id"),config.getString("event_id"));
BigDecimal balance = BigDecimal.ZERO;
if(use!=null){
balance = use.getBigDecimal("use_amount");
}
member.put("used_amount",balance.setScale(2, BigDecimal.ROUND_DOWN).toPlainString());
if (member != null) {
status.put("member_info", member);
List<JSONObject> balanceLogs = customerMembershipMapper.listEncourageBalanceHistory(fromDate, toDate, member.getString("member_id"));
status.put("logs", balanceLogs);
BigDecimal usedAmount = customerEncourageMoneyUseLogMapper.sumUsed(member.getString("member_id"), fromDate, toDate);
member.put("used_amount", usedAmount);
// BigDecimal usedAmount = customerEncourageMoneyUseLogMapper.sumUsed(member.getString("member_id"), fromDate, toDate);
// member.put("used_amount", usedAmount);
} else {
member = new JSONObject();
member.put("encourage_balance", 0);
member.put("used_amount", 0);
// member.put("used_amount", 0);
}
status.put("member", member);
return status;

@ -31,4 +31,7 @@ public interface CustomerEncourageMoneyAccessLogMapper {
PageList<JSONObject> list(JSONObject params, PageBounds pageBounds);
List<JSONObject> analysisByDate(@Param("event_id") String eventId);
JSONObject sumMoney(@Param("memberId") String memberId,@Param("eventId")String eventId);
}

@ -34,4 +34,7 @@ public interface CustomerEncourageMoneyUseLogMapper {
List<JSONObject> analysisByDate(@Param("event_id") String eventId);
List<String> listUnsettled();
JSONObject sumMoney(@Param("memberId") String memberId,@Param("eventId")String eventId);
}

@ -42,4 +42,7 @@
GROUP BY access_date
ORDER BY access_date DESC
</select>
<select id="sumMoney" resultType="com.alibaba.fastjson.JSONObject">
select sum(actural_amount) actural_amount from cus_encourage_money_access_log where member_id = #{memberId} and event_id = #{eventId};
</select>
</mapper>

@ -43,4 +43,7 @@
INNER JOIN pmt_orders o ON o.order_id=u.order_id AND o.status>4
WHERE u.transaction_id is null
</select>
<select id="sumMoney" resultType="com.alibaba.fastjson.JSONObject">
select sum(use_amount) use_amount from cus_encourage_money_use_log where member_id = #{memberId} and event_id = #{eventId} and transaction_id is not null
</select>
</mapper>
Loading…
Cancel
Save