retail query daily transactions can choose dev only transactions

master
yixian 7 years ago
parent 82707c9d85
commit 1c538488b9

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

@ -952,7 +952,7 @@ public class RetailAppServiceImp implements RetailAppService {
} }
@Override @Override
public JSONObject listDailyTransactions(String dateStr, String timezone, JSONObject device) { public JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device) {
try { try {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
dateFormat.setTimeZone(TimeZone.getTimeZone(timezone)); dateFormat.setTimeZone(TimeZone.getTimeZone(timezone));
@ -960,7 +960,7 @@ public class RetailAppServiceImp implements RetailAppService {
String clientType = device.getString("client_type"); String clientType = device.getString("client_type");
DeviceRegister register = deviceSupport.findRegister(clientType); DeviceRegister register = deviceSupport.findRegister(clientType);
String devId = null; String devId = null;
if (register.includeDevId()) { if (register.includeDevId() || thisDevOnly) {
devId = device.getString("dev_id"); devId = device.getString("dev_id");
} }
Date to = DateUtils.addDays(date, 1); Date to = DateUtils.addDays(date, 1);

@ -116,7 +116,7 @@ public class RetailAppController {
@RequestMapping(value = "/notice/{noticeId}", method = RequestMethod.PUT) @RequestMapping(value = "/notice/{noticeId}", method = RequestMethod.PUT)
public void updateNoticePartnerHasRead(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String noticeId, @RequestBody JSONObject account_param) { public void updateNoticePartnerHasRead(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String noticeId, @RequestBody JSONObject account_param) {
if (!device.getString("account_id").equals(account_param.getString("account_id"))){ if (!device.getString("account_id").equals(account_param.getString("account_id"))) {
throw new ForbiddenException("You have no permission"); throw new ForbiddenException("You have no permission");
} }
retailAppService.updateReadStatus(device, noticeId); retailAppService.updateReadStatus(device, noticeId);
@ -200,8 +200,9 @@ public class RetailAppController {
@RequestMapping(value = "/daily_transactions/date/{dateStr}", method = RequestMethod.GET) @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(defaultValue = "false") boolean thisdevice,
@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.listDailyTransactions(dateStr, timezone, device); return retailAppService.listDailyTransactions(dateStr, timezone, thisdevice, device);
} }
@RequestMapping(value = "/modify/retail_surcharge", method = RequestMethod.PUT) @RequestMapping(value = "/modify/retail_surcharge", method = RequestMethod.PUT)
@ -250,11 +251,11 @@ public class RetailAppController {
} }
@RequestMapping(value = "/cash_back/clean_info", method = RequestMethod.GET) @RequestMapping(value = "/cash_back/clean_info", method = RequestMethod.GET)
public JSONObject getCashbackCleanInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestParam(value = "client_id",required = false) String client_id) { public JSONObject getCashbackCleanInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(value = "client_id", required = false) String client_id) {
if (client_id==null){ if (client_id == null) {
client_id=device.getString("client_id"); client_id = device.getString("client_id");
} }
return retailAppService.getCashbackCleanInfo(device,client_id); return retailAppService.getCashbackCleanInfo(device, client_id);
} }
@RequestMapping(value = "/partner_signin_app_qrcode/{codeId}", method = RequestMethod.GET) @RequestMapping(value = "/partner_signin_app_qrcode/{codeId}", method = RequestMethod.GET)
@ -289,9 +290,10 @@ public class RetailAppController {
public JSONObject getAd(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { public JSONObject getAd(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getAd(device); return retailAppService.getAd(device);
} }
@RequestMapping(value = "/ads/{article_id}", method = RequestMethod.GET) @RequestMapping(value = "/ads/{article_id}", method = RequestMethod.GET)
public JSONObject getAdDetail(@PathVariable String article_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { public JSONObject getAdDetail(@PathVariable String article_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getAdDetail(device,article_id); return retailAppService.getAdDetail(device, article_id);
} }

Loading…
Cancel
Save