| | |
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.entity.admin.OrderAdmin;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.count.TaoBaoOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/order")
|
| | | public class OrderAdminController {
|
| | |
| | | @Resource
|
| | | private OrderService orderService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoService hongBaoService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoOrderService taoBaoOrderService;
|
| | | |
| | | @Resource
|
| | | private TaoBaoOrderCountService taoBaoOrderCountService;
|
| | |
|
| | |
|
| | | /**
|
| | | * 统计历史订单-淘宝订单
|
| | | * @param callback
|
| | | * @param request
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countTaoBaoOrder")
|
| | | public void countTaoBaoOrder(String callback, HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | @RequestMapping(value = "getOrderList", method = RequestMethod.POST)
|
| | | public void getOrderList(int pageIndex, String key, PrintWriter out) {
|
| | | List<OrderAdmin> orderAdminList = hongBaoService.getOrderAdminList(pageIndex, key);
|
| | | int count = orderService.getCount(key);
|
| | | int totalPage = count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1;
|
| | | PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count, totalPage);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("orderList", JsonUtil.getSimpleGsonWithDateAndSerialization().toJson(orderAdminList));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | try {
|
| | | Map<String, Object> countByOdrerType = taoBaoOrderCountService.countByOdrerType();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("typeOrder", countByOdrerType);
|
| | | |
| | | // 统计今日 未失效订单数量 相同订单号合并为一单
|
| | | int todayOrder = taoBaoOrderCountService.countToday();
|
| | | // 统计昨日 未失效订单数量 相同订单号合并为一单
|
| | | int yesterdayOrder = taoBaoOrderCountService.countYesterday();
|
| | |
|
| | | data.put("todayOrder", todayOrder);
|
| | | data.put("yesterdayOrder", yesterdayOrder);
|
| | | |
| | | data.put("genzong", yesterdayOrder);
|
| | | data.put("yesterdayOrder", yesterdayOrder);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("统计失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 查询所有用户订单列表
|
| | | * @param callback
|