From dbb9bfaa290effe8512914989cdf705e815dec2a Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Mon, 6 Feb 2023 11:00:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A42=E3=80=820=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/OrderHltRechargeController.java | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 hai-order/src/main/java/com/web/controller/business/OrderHltRechargeController.java diff --git a/hai-order/src/main/java/com/web/controller/business/OrderHltRechargeController.java b/hai-order/src/main/java/com/web/controller/business/OrderHltRechargeController.java new file mode 100644 index 00000000..edf1178b --- /dev/null +++ b/hai-order/src/main/java/com/web/controller/business/OrderHltRechargeController.java @@ -0,0 +1,126 @@ +package com.web.controller.business; + +import com.alibaba.excel.EasyExcel; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighOrder; +import com.hai.enum_type.OrderStatusEnum; +import com.hai.enum_type.UserObjectTypeEnum; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.order.model.OrderThirdPartyModel; +import com.hai.order.service.OrderService; +import com.hai.order.type.OrderPayType; +import com.web.config.SysConst; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +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.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Controller +@RequestMapping(value = "hltRecharge") +@Api(value = "汇联通订单业务") +public class OrderHltRechargeController { + + + private static Logger log = LoggerFactory.getLogger(OrderThirdPartyController.class); + + @Resource + private UserCenter userCenter; + + @Resource + private OrderService orderService; + + + @RequestMapping(value = "/getOrderList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询汇联通充值订单列表") + public ResponseData getOrderList(@RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "memPhone", required = false) String memPhone, + @RequestParam(name = "memCardNo", required = false) String memCardNo, + @RequestParam(name = "payType", required = false) Integer payType, + @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + @RequestParam(name = "productType", required = false) Integer productType, + @RequestParam(name = "finishTimeS", required = false) Long finishTimeS, + @RequestParam(name = "finishTimeE", required = false) Long finishTimeE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { + try { + + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + Map map = new HashMap<>(); + if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) { + map.put("companyId" , companyId); + } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) { + map.put("companyId", userInfoModel.getBsCompany().getId()); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + map.put("createTimeS", createTimeS); + map.put("createTimeE", createTimeE); + map.put("payTimeS", payTimeS); + map.put("payTimeE", payTimeE); + map.put("finishTimeS", finishTimeS); + map.put("finishTimeE", finishTimeE); + map.put("orderNo", orderNo); + map.put("memPhone", memPhone); + map.put("memCardNo", memCardNo); + map.put("productType", productType); + map.put("status", status); + map.put("payType", payType); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(orderService.getOrderList(map))); + + } catch (Exception e) { + log.error("OrderCouponController --> getOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getOrderDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询订单详情") + public ResponseData getOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) { + try { + Map map = new HashMap<>(); + map.put("tradeOrder", orderService.getOrderDetailByNo(orderNo)); + + return ResponseMsgUtil.success(map); + + } catch (Exception e) { + log.error("OrderIntegralRechargeController -> getOrderDetail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + + +}