|
|
|
@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
@ -28,70 +29,45 @@ public class AdminOrderController extends BaseController { |
|
|
|
private OrderGoodsDetailService orderGoodsDetailService; |
|
|
|
|
|
|
|
@PostMapping("/list") |
|
|
|
public JSONObject olist(@RequestParam(value = "current_page",defaultValue = "1") String spage){ |
|
|
|
public JSONObject olist(@RequestParam(value = "page",defaultValue = "1") String spage){ |
|
|
|
int ipage = Integer.valueOf(spage); |
|
|
|
List<Order> orderList=orderService.getAllOrderList(ipage); |
|
|
|
Map retmap = new HashMap(); |
|
|
|
int total = orderService.countAllOrder(); |
|
|
|
jsonObject.put("current_page",spage); |
|
|
|
jsonObject.put("per_page", ChConstant.PAGESIZE); |
|
|
|
jsonObject.put("total",total); |
|
|
|
retmap.put("current_page",spage); |
|
|
|
retmap.put("per_page",ChConstant.PAGESIZE); |
|
|
|
retmap.put("total",total); |
|
|
|
retmap.put("data",orderList); |
|
|
|
|
|
|
|
|
|
|
|
//jsonObject.put("current_page",spage);
|
|
|
|
//jsonObject.put("per_page", ChConstant.PAGESIZE);
|
|
|
|
//jsonObject.put("total",total);
|
|
|
|
jsonObject.put("code",200); |
|
|
|
jsonObject.put("data",orderList); |
|
|
|
jsonObject.put("data",retmap); |
|
|
|
jsonObject.put("msg","成功"); |
|
|
|
return jsonObject; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 订单列列表 |
|
|
|
* @param batchacode |
|
|
|
* @param entrustName |
|
|
|
* @param buyName |
|
|
|
* @param goodsName |
|
|
|
* @param orderType |
|
|
|
* @param transactionStatus |
|
|
|
* @param createtime |
|
|
|
* @param goodsIsli |
|
|
|
* @param chargesType |
|
|
|
* @param spage |
|
|
|
* @param slimit |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("/so") |
|
|
|
public JSONObject solist(@RequestParam(value = "batchcode",defaultValue = "") String batchacode, |
|
|
|
@RequestParam(value = "entrust_name",defaultValue = "") String entrustName, |
|
|
|
@RequestParam(value = "buy_name",defaultValue = "") String buyName, |
|
|
|
@RequestParam(value = "goods_ame",defaultValue = "") String goodsName, |
|
|
|
@RequestParam(value = "order_type",defaultValue = "") String orderType, |
|
|
|
@RequestParam(value = "transaction_status",defaultValue = "0") String transactionStatus, |
|
|
|
@RequestParam(value = "createtime",defaultValue = "") String createtime, |
|
|
|
@RequestParam(value = "goods_isli",defaultValue = "")String goodsIsli, |
|
|
|
@RequestParam(value = "charges_type",defaultValue = "") String chargesType, |
|
|
|
@RequestParam(value = "page",defaultValue = "1") String spage, |
|
|
|
@RequestParam(value = "limit",defaultValue = "20") String slimit){ |
|
|
|
|
|
|
|
Map<String,Object> qmap=new HashMap<>(); |
|
|
|
qmap.put("batchcode",batchacode); |
|
|
|
qmap.put("entrust_name",entrustName); |
|
|
|
qmap.put("goods_name",goodsName); |
|
|
|
qmap.put("order_type",orderType); |
|
|
|
// qmap.put("transaction_status",transactionStatus);
|
|
|
|
qmap.put("createtime",createtime); |
|
|
|
qmap.put("godos_isli",goodsIsli); |
|
|
|
qmap.put("charges_type",chargesType); |
|
|
|
|
|
|
|
public JSONObject solist(HttpServletRequest request){ |
|
|
|
Map odmap = orderMap(request); |
|
|
|
String spage=request.getParameter("page"); |
|
|
|
//
|
|
|
|
int page= Integer.valueOf(spage); |
|
|
|
|
|
|
|
String slimit=request.getParameter("limit"); |
|
|
|
int limit = Integer.valueOf(slimit); |
|
|
|
List<Order> orderList = new ArrayList<>(); |
|
|
|
// 如果条件为空
|
|
|
|
if(qmap.isEmpty()){ |
|
|
|
orderList=orderService.getAllOrderList(page); |
|
|
|
}else { |
|
|
|
orderList=orderService.getOrderList(qmap, page, limit); |
|
|
|
} |
|
|
|
|
|
|
|
Map map = orderService.getOrderList(odmap,page,limit); |
|
|
|
|
|
|
|
jsonObject.put("code",200); |
|
|
|
jsonObject.put("msg","操作成功"); |
|
|
|
jsonObject.put("data",orderList); |
|
|
|
jsonObject.put("data",map); |
|
|
|
return jsonObject; |
|
|
|
} |
|
|
|
|
|
|
|
|