| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.yeshi.fanli.entity.accept.AdminAcceptData; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.yeshi.utils.JsonUtil; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils; |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | import com.yeshi.fanli.dto.common.CategoryInfoDTO; |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil; |
| | | 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 HongBaoV2CountService hongBaoV2CountService; |
| | |
| | | @Resource |
| | | private CommonOrderService commonOrderService; |
| | | |
| | | @Resource |
| | | private TaoBaoOrderService taoBaoOrderService; |
| | | |
| | | @Resource |
| | | private TaoBaoOrderCountService taoBaoOrderCountService; |
| | |
| | | private UserMoneyDebtService userMoneyDebtService; |
| | | |
| | | @Resource |
| | | private UserSystemCouponRecordService userSystemCouponRecordService; |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | |
| | | @Resource |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "countTaoBaoOrder") |
| | | public void countTaoBaoOrder(String callback, HttpServletRequest request, PrintWriter out) { |
| | | public void countTaoBaoOrder(AdminAcceptData acceptData,String callback, HttpServletRequest request, PrintWriter out) { |
| | | |
| | | try { |
| | | Map<String, Object> countByOdrerType = taoBaoOrderCountService.countByOdrerType(); |
| | |
| | | * @param callback |
| | | * @param pageIndex |
| | | * @param pageSize |
| | | * @param uid |
| | | * @param state |
| | | * @param type |
| | | * @param orderState |
| | | * @param orderNo |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getUserOrderList") |
| | | public void getUserOrderList(String callback, Integer pageIndex, Integer pageSize, Integer keyType, String key, |
| | | Integer state, Integer type, Integer orderState, String startTime, String endTime, Integer sourceType, |
| | | Integer riskType, BigDecimal payment, PrintWriter out) { |
| | | public void getUserOrderList(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, Integer keyType, String key, |
| | | Integer state, Integer type, Integer orderState, String startTime, String endTime, Integer sourceType, |
| | | Integer riskType, BigDecimal payment, PrintWriter out) { |
| | | |
| | | if (pageIndex == null || pageIndex < 1) { |
| | | pageIndex = 1; |
| | |
| | | |
| | | if (riskType == 1) { |
| | | listGoodsId = commonOrderCountService.getSameGoodsOrderByUidAndHongBaoType(typeList, uid, |
| | | Integer.parseInt(configService.get(ConfigKeyEnum.adminMinSameGoodsOrderCount.getKey()))); |
| | | Integer.parseInt(configService.getValue(ConfigKeyEnum.adminMinSameGoodsOrderCount.getKey(),acceptData.getSystem()))); |
| | | if (listGoodsId == null || listGoodsId.isEmpty()) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无同商品订单")); |
| | | return; |
| | | } |
| | | } else if (riskType == 2) { |
| | | listShopId = commonOrderCountService.getSameShopOrderByUidAndHongBaoType(typeList, uid, |
| | | Integer.parseInt(configService.get(ConfigKeyEnum.adminMinSameShopOrderCount.getKey()))); |
| | | Integer.parseInt(configService.getValue(ConfigKeyEnum.adminMinSameShopOrderCount.getKey(),acceptData.getSystem()))); |
| | | if (listShopId == null || listShopId.isEmpty()) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无同店铺订单")); |
| | | return; |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getHistoryOrder") |
| | | public void getHistoryOrder(String callback, Integer pageIndex, Integer pageSize, Long uid, Integer state, |
| | | public void getHistoryOrder(AdminAcceptData acceptData,String callback, Integer pageIndex, Integer pageSize, Long uid, Integer state, |
| | | Integer type, Integer orderState, String orderNo, String startTime, String endTime, PrintWriter out) { |
| | | |
| | | if (uid == null) { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getHistoryUnreceived") |
| | | public void getHistoryUnreceived(String callback, Integer type, PrintWriter out) { |
| | | public void getHistoryUnreceived(AdminAcceptData acceptData,String callback, Integer type, PrintWriter out) { |
| | | try { |
| | | |
| | | Long total = commonOrderCountService.countByState(1); |
| | |
| | | |
| | | |
| | | @RequestMapping(value = "uploadTaoBaoWeiQuanOrder") |
| | | public void uploadWeiQuanOrder(String callback, HttpServletRequest request, PrintWriter out) { |
| | | public void uploadWeiQuanOrder(AdminAcceptData acceptData,String callback, HttpServletRequest request, PrintWriter out) { |
| | | try { |
| | | // 1. 先判断httpRequest 是否含有文件类型 |
| | | if (request instanceof MultipartHttpServletRequest) { |
| | |
| | | |
| | | |
| | | @RequestMapping(value = "countOrderInfo") |
| | | public void countOrderInfo(String callback, Long uid, PrintWriter out) { |
| | | // 自购已到账 |
| | | long selfNumEnd = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY, 1); |
| | | // 分享已到账 |
| | | long shareNumEnd = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY, 2); |
| | | |
| | | // 自购未到账 |
| | | long selfNum = hongBaoV2CountService.countMyDirectOrderByCashNotArrival(uid, Constant.VIP_ORDER_PAY, 1); |
| | | // 分享未到账 |
| | | long shareNum = hongBaoV2CountService.countMyDirectOrderByCashNotArrival(uid, Constant.VIP_ORDER_PAY, 2); |
| | | |
| | | public void countOrderInfo(AdminAcceptData acceptData,String callback, Long uid, PrintWriter out) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("selfNumEnd", selfNumEnd); |
| | | data.put("shareNumEnd", shareNumEnd); |
| | | data.put("selfNum", selfNum); |
| | | data.put("description", shareNum); |
| | | |
| | | /* --------- 本月累计 ------------*/ |
| | | JSONObject month = new JSONObject(); |
| | | // 自购已到账 |
| | | month.put("selfNumEnd", hongBaoV2CountService.countOrderByCashArrival(uid, null, 1, 1)); |
| | | // 分享已到账 |
| | | month.put("shareNumEnd", hongBaoV2CountService.countOrderByCashArrival(uid, null, 2, 1)); |
| | | // 邀请已到账 |
| | | month.put("inviteNumEnd", hongBaoV2CountService.countOrderByCashArrival(uid, null, 3, 1)); |
| | | // 自购未到账 |
| | | month.put("selfNum", hongBaoV2CountService.countOrderByCashNotArrival(uid, null, 1, 1)); |
| | | // 分享未到账 |
| | | month.put("shareNum", hongBaoV2CountService.countOrderByCashNotArrival(uid, null, 2, 1)); |
| | | // 邀请未到账 |
| | | month.put("inviteNum", hongBaoV2CountService.countOrderByCashNotArrival(uid, null, 3, 1)); |
| | | data.put("month", month); |
| | | |
| | | |
| | | /* --------- 历史累计 ------------*/ |
| | | JSONObject history = new JSONObject(); |
| | | // 自购已到账 |
| | | history.put("selfNumEnd", hongBaoV2CountService.countOrderByCashArrival(uid, null, 1, null)); |
| | | // 分享已到账 |
| | | history.put("shareNumEnd", hongBaoV2CountService.countOrderByCashArrival(uid, null, 2, null)); |
| | | // 邀请已到账 |
| | | history.put("inviteNumEnd", hongBaoV2CountService.countOrderByCashArrival(uid, null, 3, null)); |
| | | // 自购未到账 |
| | | history.put("selfNum", hongBaoV2CountService.countOrderByCashNotArrival(uid, null, 1, null)); |
| | | // 分享未到账 |
| | | history.put("shareNum", hongBaoV2CountService.countOrderByCashNotArrival(uid, null, 2, null)); |
| | | // 邀请未到账 |
| | | history.put("inviteNum", hongBaoV2CountService.countOrderByCashNotArrival(uid, null, 3, null)); |
| | | data.put("history", history); |
| | | |
| | | |
| | | /* --------- 付款金额大于1 ------------*/ |
| | | // 自购已到账 |
| | | long selfAccountEnd = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY, 1); |
| | | // 分享已到账 |
| | | long shareAccountEnd = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY, 2); |
| | | // 自购未到账 |
| | | long selfAccount = hongBaoV2CountService.countOrderByCashNotArrival(uid, Constant.VIP_ORDER_PAY, 1, null); |
| | | // 分享未到账 |
| | | long shareAccount = hongBaoV2CountService.countOrderByCashNotArrival(uid, Constant.VIP_ORDER_PAY, 2, null); |
| | | data.put("selfAccountEnd", selfAccountEnd); |
| | | data.put("shareAccountEnd", shareAccountEnd); |
| | | data.put("selfAccount", selfAccount); |
| | | data.put("shareAccount", shareAccount); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |