Merge branch 'develop'

# Conflicts:
#	pom.xml
master
todking 5 years ago
commit b110fd0125

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>1.1.28</version> <version>1.1.29</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -77,6 +77,9 @@ public interface TransactionAnalysisMapper {
JSONObject getClientTransaction(JSONObject params); JSONObject getClientTransaction(JSONObject params);
List<JSONObject> getWeekClientTransaction(JSONObject params);
@CountRef(".countAreaMerchantAmountAnalysis") @CountRef(".countAreaMerchantAmountAnalysis")
PageList<JSONObject> getAreaMerchantAmountAnalysis(JSONObject params, PageBounds pagination); PageList<JSONObject> getAreaMerchantAmountAnalysis(JSONObject params, PageBounds pagination);

@ -24,6 +24,8 @@ import javax.servlet.http.HttpServletResponse;
public interface RetailAppService { public interface RetailAppService {
JSONObject getTransactionCommonData(JSONObject device, AppQueryBean appQueryBean); JSONObject getTransactionCommonData(JSONObject device, AppQueryBean appQueryBean);
List<JSONObject> getTransactionCommonWeekData(JSONObject device, AppQueryBean appQueryBean);
JSONObject getClientSettlementLog(JSONObject device, AppQueryBean appQueryBean); JSONObject getClientSettlementLog(JSONObject device, AppQueryBean appQueryBean);
JSONObject getTransactionLogsByClearingDetailId(JSONObject device, int clearing_detail_id, String timezone); JSONObject getTransactionLogsByClearingDetailId(JSONObject device, int clearing_detail_id, String timezone);

@ -262,6 +262,27 @@ public class RetailAppServiceImp implements RetailAppService {
return res; return res;
} }
@Override
public List<JSONObject> getTransactionCommonWeekData(JSONObject device, AppQueryBean appQueryBean) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
int client_id = device.getIntValue("client_id");
JSONObject client = clientManager.getClientInfo(client_id);
String timezone = client.getString("timezone");
if (timezone != null && !timezone.isEmpty()) {
appQueryBean.setTimezone(timezone);
}
JSONObject params = appQueryBean.toParams();
setAllClientIds(params, client_id);
params.put("client_id", client_id);
List<JSONObject> res = transactionAnalysisMapper.getWeekClientTransaction(params);
res.forEach(r -> {
r.put("date",r.getDate("date").toString());
});
res.remove(res.size() - 1);
return res;
}
@Override @Override
public JSONObject getTradeCommonDate(JSONObject device, AppQueryBean appQueryBean) { public JSONObject getTradeCommonDate(JSONObject device, AppQueryBean appQueryBean) {
String clientType = device.getString("client_type"); String clientType = device.getString("client_type");
@ -302,7 +323,7 @@ public class RetailAppServiceImp implements RetailAppService {
@Override @Override
public JSONObject getQrcode(JSONObject device, QRCodeConfig config, int client_id) { public JSONObject getQrcode(JSONObject device, QRCodeConfig config, int client_id) {
JSONObject client = merchantInfoProvider.getClientInfo(client_id); JSONObject client = merchantInfoProvider.getClientInfo(client_id);
String url = PlatformEnvironment.getEnv().concatUrl("/api/payment/v1.0/partners/" + client.getString("client_moniker")); String url = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/payment/partners/" + client.getString("client_moniker"));
if (config.isCNY()) { if (config.isCNY()) {
url += "_CNY"; url += "_CNY";
} }

@ -103,6 +103,12 @@ public class RetailAppController {
return retailAppService.getTransactionCommonData(device, appQueryBean); return retailAppService.getTransactionCommonData(device, appQueryBean);
} }
// 查询7天的交易金额
@RequestMapping(value = "/common/week", method = RequestMethod.GET)
public List<JSONObject> getTransactionCommonWeekData(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, AppQueryBean appQueryBean) {
return retailAppService.getTransactionCommonWeekData(device, appQueryBean);
}
/** /**
* *
* *

@ -881,6 +881,35 @@
</if> </if>
</select> </select>
<select id="getWeekClientTransaction" resultType="com.alibaba.fastjson.JSONObject">
SELECT
calendar.datelist AS date,
IFNULL( trade_amount, 0 ) AS trade_amount
FROM
calendar
LEFT JOIN (
SELECT
IFNULL( sum( IF ( l.transaction_type = 'Credit', l.clearing_amount, 0 ) ), 0 ) trade_amount,
DATE_FORMAT( l.transaction_time, '%Y-%m-%d' ) AS queryDate
FROM
pmt_transactions l
WHERE
l.channel != 'Settlement'
AND l.system_generate = 0
<if test="client_ids==null and client_id != null">
AND l.client_id=#{client_id}
</if>
<if test="begin!=null">AND l.transaction_time &gt;= #{begin}</if>
<if test="end!=null">AND l.transaction_time &lt; #{end}</if>
GROUP BY
DATE_FORMAT( l.transaction_time, '%Y-%m-%d' )
) AS ticketCount ON calendar.datelist = ticketCount.queryDate
WHERE
calendar.datelist &lt;= #{end} AND calendar.datelist &gt;= #{begin}
ORDER BY
calendar.datelist
</select>
<select id="getAreaMerchantAmountAnalysis" resultType="com.alibaba.fastjson.JSONObject"> <select id="getAreaMerchantAmountAnalysis" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.client_moniker,c.short_name,c.bd_user_name,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) SELECT c.client_moniker,c.short_name,c.bd_user_name,sum(if(t.transaction_type='Credit',t.clearing_amount,0))

Loading…
Cancel
Save