@ -286,26 +286,41 @@ public class RetailAppController {
}
@RequestMapping ( value = "/ads/{article_id}" , method = RequestMethod . GET )
public JSONObject getAdDetail ( @PathVariable String article_id , @ModelAttribute ( CommonConsts . RETAIL_DEVICE ) JSONObject device ) {
device = new JSONObject ( ) ;
device . put ( "client_id" , 9 ) ;
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 ) {
device = new JSONObject ( ) ;
device . put ( "client_id" , 9 ) ;
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 ) {
device = new JSONObject ( ) ;
device . put ( "client_id" , 9 ) ;
return billService . queryBills ( device . getIntValue ( "client_id" ) , queryBillBean ) ;
}
@RequestMapping ( value = "/bills" , 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 = "/bills/{bill_id}/close" , method = RequestMethod . POST )
public void closeBill ( @PathVariable ( "bill_id" ) String bill_id , @ModelAttribute ( CommonConsts . RETAIL_DEVICE ) JSONObject device ) {
billService . updateBillStatus ( bill_id , "2" ) ;
device = new JSONObject ( ) ;
device . put ( "client_id" , 9 ) ;
billService . updateBillStatus ( bill_id , "2" , device . getIntValue ( "client_id" ) ) ;
}
@RequestMapping ( value = "/bills/orders/{bill_id}" , method = RequestMethod . GET )
public List < JSONObject > getBillOrders ( @PathVariable ( "bill_id" ) String bill_id , QueryBillOrderBean queryBillOrderBean , @ModelAttribute ( CommonConsts . RETAIL_DEVICE ) JSONObject device ) {
device = new JSONObject ( ) ;
device . put ( "client_id" , 9 ) ;
return billOrderService . query ( bill_id , device . getIntValue ( "client_id" ) , queryBillOrderBean ) ;
}
}