|
|
|
@ -10,7 +10,6 @@ import au.com.royalpay.payment.manage.bill.core.BillService;
|
|
|
|
|
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
|
|
|
|
|
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
|
|
|
|
|
import au.com.royalpay.payment.tools.CommonConsts;
|
|
|
|
|
import au.com.royalpay.payment.tools.device.advise.AppClientController;
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
|
|
|
|
|
import au.com.royalpay.payment.tools.http.HttpUtils;
|
|
|
|
|
|
|
|
|
@ -24,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -35,7 +35,7 @@ import javax.validation.Valid;
|
|
|
|
|
/**
|
|
|
|
|
* Created by yishuqian on 28/03/2017.
|
|
|
|
|
*/
|
|
|
|
|
@AppClientController
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/api/v1.0/retail/app")
|
|
|
|
|
public class RetailAppController {
|
|
|
|
|
@Resource
|
|
|
|
@ -288,18 +288,26 @@ public class RetailAppController {
|
|
|
|
|
}
|
|
|
|
|
@RequestMapping(value = "/bill/{bill_id}",method = RequestMethod.GET)
|
|
|
|
|
public JSONObject getBills(@PathVariable("bill_id")String bill_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
|
|
|
|
|
device = new JSONObject();
|
|
|
|
|
device.put("client_id",9);
|
|
|
|
|
return billService.getBillDetail(bill_id,device.getIntValue("client_id"));
|
|
|
|
|
}
|
|
|
|
|
@RequestMapping(value = "/bill",method = RequestMethod.PUT)
|
|
|
|
|
public void addBill(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestBody NewBillBean newBillBean){
|
|
|
|
|
device = new JSONObject();
|
|
|
|
|
device.put("client_id",9);
|
|
|
|
|
billService.save(device.getIntValue("client_id"),newBillBean);
|
|
|
|
|
}
|
|
|
|
|
@RequestMapping(value = "/bill/{bill_id}/close",method = RequestMethod.POST)
|
|
|
|
|
public void closeBill(@PathVariable("bill_id")String bill_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
|
|
|
|
|
device = new JSONObject();
|
|
|
|
|
device.put("client_id",9);
|
|
|
|
|
billService.updateBillStatus(bill_id,"2");
|
|
|
|
|
}
|
|
|
|
|
@RequestMapping(value = "/bill/orders/{bill_id}/",method = RequestMethod.GET)
|
|
|
|
|
@RequestMapping(value = "/bill/orders/{bill_id}",method = RequestMethod.GET)
|
|
|
|
|
public List<JSONObject> getBillOrders(@PathVariable("bill_id")String bill_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
|
|
|
|
|
device = new JSONObject();
|
|
|
|
|
device.put("client_id",9);
|
|
|
|
|
return billOrderService.getByBillId(bill_id,device.getIntValue("client_id"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|