1 update api doc

2 fixbug pos
master
wangning 7 years ago
parent 649422f6ef
commit 258af077c9

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

@ -65,7 +65,7 @@ public interface RetailAppService {
JSONObject getClientCurrentRateNew(JSONObject device);
JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device);
JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device,String app_client_ids);
JSONObject getActivities(JSONObject device, String activity_page, int page, int limit);

@ -1034,7 +1034,7 @@ public class RetailAppServiceImp implements RetailAppService {
}
@Override
public JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device) {
public JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device,String app_client_ids) {
try {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
dateFormat.setTimeZone(TimeZone.getTimeZone(timezone));
@ -1066,7 +1066,19 @@ public class RetailAppServiceImp implements RetailAppService {
}
JSONObject res = new JSONObject();
res.put("transactions", transactions);
JSONObject analysis = transactionMapper.analysisRetailDailyReport(date, to, devId, device.getIntValue("client_id"));
String [] param_client_ids = null;
if(StringUtils.isEmpty(app_client_ids)) {
JSONArray client_ids = clientManager.getAllClientIds(device.getIntValue("client_id"));
if (client_ids.size() > 1) {
param_client_ids = new String[client_ids.size()];
client_ids.toArray(param_client_ids);
}
}else {
param_client_ids = app_client_ids.split(",");
}
JSONObject analysis = transactionMapper.analysisRetailDailyReport(date, to, devId, device.getIntValue("client_id"),param_client_ids);
analysis.put("date", TimeZoneUtils.formatTime(date, "dd/MMM/yyyy", timezone));
analysis.put("display_amount",display_amount);
analysis.put("cny_display_amount",cny_display_amount);

@ -245,9 +245,9 @@ public class RetailAppController {
}
@RequestMapping(value = "/daily_transactions/date/{dateStr}", method = RequestMethod.GET)
public JSONObject listDailyTransactions(@PathVariable String dateStr, @RequestParam(defaultValue = "Australia/Melbourne") String timezone,
public JSONObject listDailyTransactions(@PathVariable String dateStr, @RequestParam(defaultValue = "Australia/Melbourne") String timezone,@RequestParam(required = false) String app_client_ids,
@RequestParam(defaultValue = "false") boolean thisdevice, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.listDailyTransactions(dateStr, timezone, thisdevice, device);
return retailAppService.listDailyTransactions(dateStr, timezone, thisdevice, device,app_client_ids);
}
@RequestMapping(value = "/modify/retail_surcharge", method = RequestMethod.PUT)

@ -108,7 +108,7 @@ public interface TransactionMapper {
List<JSONObject> listDailyTransactions(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId);
JSONObject analysisRetailDailyReport(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId);
JSONObject analysisRetailDailyReport(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId,@Param("client_ids")String [] client_ids);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "system_generate=1")

@ -675,9 +675,20 @@
sum(if(t.transaction_type='Credit',t.tax_amount,-t.tax_amount)) tax_amount
FROM pmt_transactions t
WHERE t.transaction_time>=#{from} and t.transaction_time<#{to} and (t.transaction_type='Credit' or t.refund_id is not null)
and t.client_id=#{client_id}
WHERE
t.transaction_time>=#{from} and t.transaction_time<#{to} and (t.transaction_type='Credit' or t.refund_id is not null)
]]>
<if test="client_ids!=null">
AND t.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_ids==null">
and t.client_id=#{client_id}
</if>
<if test="dev_id!=null">and t.device_id=#{dev_id}</if>
</select>
<select id="listTransactionsOfClearingOrder" resultType="com.alibaba.fastjson.JSONObject">

Loading…
Cancel
Save