|
|
@ -115,20 +115,21 @@ public class RetailAppController {
|
|
|
|
return retailAppService.getClientSettlementLog(device, appQueryBean);
|
|
|
|
return retailAppService.getClientSettlementLog(device, appQueryBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/transaction_log/{clearing_detail_id}")
|
|
|
|
@RequestMapping("/transaction_log/{clearing_detail_id}")
|
|
|
|
public JSONObject getTransactionLogByClearingDetailId(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable int clearing_detail_id, @RequestParam(required = false) String timezone) {
|
|
|
|
public JSONObject getTransactionLogByClearingDetailId(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable int clearing_detail_id,
|
|
|
|
|
|
|
|
@RequestParam(required = false) String timezone) {
|
|
|
|
return retailAppService.getTransactionLogsByClearingDetailId(device, clearing_detail_id, timezone);
|
|
|
|
return retailAppService.getTransactionLogsByClearingDetailId(device, clearing_detail_id, timezone);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*消息模块begin*/
|
|
|
|
/* 消息模块begin */
|
|
|
|
@RequestMapping(value = "/notice", method = RequestMethod.GET)
|
|
|
|
@RequestMapping(value = "/notice", method = RequestMethod.GET)
|
|
|
|
public JSONObject listNotices(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam Map<String, Object> params) {
|
|
|
|
public JSONObject listNotices(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam Map<String, Object> params) {
|
|
|
|
return retailAppService.listNotices(device, (JSONObject) JSON.toJSON(params));
|
|
|
|
return retailAppService.listNotices(device, (JSONObject) JSON.toJSON(params));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@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");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -139,12 +140,12 @@ public class RetailAppController {
|
|
|
|
public JSONObject getNoticeId(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String noticeId) {
|
|
|
|
public JSONObject getNoticeId(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String noticeId) {
|
|
|
|
return retailAppService.getNoticeDetailById(device, noticeId);
|
|
|
|
return retailAppService.getNoticeDetailById(device, noticeId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*消息模块end*/
|
|
|
|
/* 消息模块end */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*我的页面begin*/
|
|
|
|
/* 我的页面begin */
|
|
|
|
@RequestMapping(value = "/partner_password/{account_id}", method = RequestMethod.PUT)
|
|
|
|
@RequestMapping(value = "/partner_password/{account_id}", method = RequestMethod.PUT)
|
|
|
|
public void changePassword(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String account_id, @RequestBody @Valid ChangePwdBean change, Errors errors) {
|
|
|
|
public void changePassword(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @PathVariable String account_id,
|
|
|
|
|
|
|
|
@RequestBody @Valid ChangePwdBean change, Errors errors) {
|
|
|
|
HttpUtils.handleValidErrors(errors);
|
|
|
|
HttpUtils.handleValidErrors(errors);
|
|
|
|
retailAppService.changeAccountPassword(device, change, account_id);
|
|
|
|
retailAppService.changeAccountPassword(device, change, account_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -168,9 +169,9 @@ public class RetailAppController {
|
|
|
|
public void signOut(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
|
|
|
|
public void signOut(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
|
|
|
|
retailAppService.sign_out(device);
|
|
|
|
retailAppService.sign_out(device);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*我的页面end*/
|
|
|
|
/* 我的页面end */
|
|
|
|
|
|
|
|
|
|
|
|
/*活动页面 begin*/
|
|
|
|
/* 活动页面 begin */
|
|
|
|
@RequestMapping(value = "/activities", method = RequestMethod.GET)
|
|
|
|
@RequestMapping(value = "/activities", method = RequestMethod.GET)
|
|
|
|
public JSONObject getActivities(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(defaultValue = "activity_page") String type,
|
|
|
|
public JSONObject getActivities(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(defaultValue = "activity_page") String type,
|
|
|
|
@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit) {
|
|
|
|
@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit) {
|
|
|
@ -187,7 +188,7 @@ public class RetailAppController {
|
|
|
|
return retailAppService.checkT1Client(device);
|
|
|
|
return retailAppService.checkT1Client(device);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*活动页面 end*/
|
|
|
|
/* 活动页面 end */
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取最新版本
|
|
|
|
* 获取最新版本
|
|
|
@ -205,16 +206,19 @@ public class RetailAppController {
|
|
|
|
return retailAppService.getClientInfo(device);
|
|
|
|
return retailAppService.getClientInfo(device);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/client/check", method = RequestMethod.GET)
|
|
|
|
|
|
|
|
public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
|
|
|
|
|
|
|
|
return retailAppService.getCheckClientInfo(device);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/client", method = RequestMethod.PUT)
|
|
|
|
@RequestMapping(value = "/client", method = RequestMethod.PUT)
|
|
|
|
public void updateClient(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody AppClientBean appClientBean) {
|
|
|
|
public void updateClient(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody AppClientBean appClientBean) {
|
|
|
|
retailAppService.updateClient(device, appClientBean);
|
|
|
|
retailAppService.updateClient(device, appClientBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@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,
|
|
|
|
@RequestParam(defaultValue = "false") boolean thisdevice, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
|
|
|
|
@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
|
|
|
|
|
|
|
|
return retailAppService.listDailyTransactions(dateStr, timezone, thisdevice, device);
|
|
|
|
return retailAppService.listDailyTransactions(dateStr, timezone, thisdevice, device);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -264,7 +268,8 @@ 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");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -276,11 +281,11 @@ public class RetailAppController {
|
|
|
|
signInStatusManager.clientQRCodeAppSignIn(device, codeId);
|
|
|
|
signInStatusManager.clientQRCodeAppSignIn(device, codeId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 优惠券Begin */
|
|
|
|
/*优惠券Begin*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/coupon/used", method = RequestMethod.GET)
|
|
|
|
@RequestMapping(value = "/coupon/used", method = RequestMethod.GET)
|
|
|
|
public JSONObject getCoupons(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int limit) {
|
|
|
|
public JSONObject getCoupons(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam(value = "page", defaultValue = "1") int page,
|
|
|
|
|
|
|
|
@RequestParam(value = "limit", defaultValue = "10") int limit) {
|
|
|
|
return retailAppService.getCoupons(device, page, limit);
|
|
|
|
return retailAppService.getCoupons(device, page, limit);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -293,8 +298,7 @@ public class RetailAppController {
|
|
|
|
public void useCoupon(@PathVariable String coupon_log_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
|
|
|
|
public void useCoupon(@PathVariable String coupon_log_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
|
|
|
|
retailAppService.useCoupon(device, coupon_log_id);
|
|
|
|
retailAppService.useCoupon(device, coupon_log_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*优惠券End*/
|
|
|
|
/* 优惠券End */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 广告位
|
|
|
|
* 广告位
|
|
|
@ -309,30 +313,33 @@ public class RetailAppController {
|
|
|
|
return retailAppService.getAdDetail(device, article_id);
|
|
|
|
return retailAppService.getAdDetail(device, article_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/bills/{bill_id}", method = RequestMethod.GET)
|
|
|
|
|
|
|
|
public JSONObject getBill(@PathVariable("bill_id") String bill_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
|
|
|
|
@RequestMapping(value = "/bills/{bill_id}",method = RequestMethod.GET)
|
|
|
|
return billService.getBillDetail(bill_id, device.getIntValue("client_id"));
|
|
|
|
public JSONObject getBill(@PathVariable("bill_id")String bill_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
|
|
|
|
|
|
|
|
return billService.getBillDetail(bill_id,device.getIntValue("client_id"));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@RequestMapping(value = "/bills/list",method = RequestMethod.GET)
|
|
|
|
|
|
|
|
public JSONObject getBills(QueryBillBean queryBillBean,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
|
|
|
|
@RequestMapping(value = "/bills/list", method = RequestMethod.GET)
|
|
|
|
return billService.queryBills(device.getIntValue("client_id"),queryBillBean);
|
|
|
|
public JSONObject getBills(QueryBillBean queryBillBean, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
|
|
|
|
|
|
|
|
return billService.queryBills(device.getIntValue("client_id"), queryBillBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@RequestMapping(value = "/bills",method = RequestMethod.PUT)
|
|
|
|
|
|
|
|
public JSONObject addBill(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestBody NewBillBean newBillBean){
|
|
|
|
@RequestMapping(value = "/bills", method = RequestMethod.PUT)
|
|
|
|
JSONObject result = billService.save(device.getIntValue("client_id"),newBillBean);
|
|
|
|
public JSONObject addBill(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody NewBillBean newBillBean) {
|
|
|
|
|
|
|
|
JSONObject result = billService.save(device.getIntValue("client_id"), newBillBean);
|
|
|
|
result.remove("bill");
|
|
|
|
result.remove("bill");
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@RequestMapping(value = "/bills/{bill_id}/close",method = RequestMethod.POST)
|
|
|
|
|
|
|
|
public void closeBill(@PathVariable("bill_id")String bill_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
|
|
|
|
@RequestMapping(value = "/bills/{bill_id}/close", method = RequestMethod.POST)
|
|
|
|
billService.updateBillStatus(bill_id,"2",device.getIntValue("client_id"));
|
|
|
|
public void closeBill(@PathVariable("bill_id") String bill_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
|
|
|
|
|
|
|
|
billService.updateBillStatus(bill_id, "2", device.getIntValue("client_id"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@RequestMapping(value = "/bills/orders/{bill_id}",method = RequestMethod.GET)
|
|
|
|
|
|
|
|
public JSONObject getBillOrders(@PathVariable("bill_id")String bill_id, QueryBillOrderBean queryBillOrderBean,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
|
|
|
|
@RequestMapping(value = "/bills/orders/{bill_id}", method = RequestMethod.GET)
|
|
|
|
JSONObject result =billOrderService.query(bill_id,device.getIntValue("client_id"),queryBillOrderBean);
|
|
|
|
public JSONObject getBillOrders(@PathVariable("bill_id") String bill_id, QueryBillOrderBean queryBillOrderBean,
|
|
|
|
result.put("analysis",billOrderService.analysis(bill_id,device.getIntValue("client_id"),queryBillOrderBean));
|
|
|
|
@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
|
|
|
|
|
|
|
|
JSONObject result = billOrderService.query(bill_id, device.getIntValue("client_id"), queryBillOrderBean);
|
|
|
|
|
|
|
|
result.put("analysis", billOrderService.analysis(bill_id, device.getIntValue("client_id"), queryBillOrderBean));
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|