parent
5397b66b1a
commit
74dd3f47bf
@ -0,0 +1,175 @@ |
||||
package com.web.controller; |
||||
|
||||
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.enum_type.UserObjectTypeEnum; |
||||
import com.hai.model.ResponseData; |
||||
import com.hai.model.UserInfoModel; |
||||
import com.hai.order.service.OrderService; |
||||
import com.hai.order.service.OrderServiceExt; |
||||
import com.hai.service.HighGasOrderService; |
||||
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 java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: OrderExtController |
||||
* @author: HuRui |
||||
* @date: 2022/9/14 |
||||
**/ |
||||
@Controller |
||||
@RequestMapping(value = "bweb") |
||||
@Api(value = "订单业务") |
||||
public class OrderBWebController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(OrderBWebController.class); |
||||
|
||||
@Resource |
||||
private UserCenter userCenter; |
||||
|
||||
@Resource |
||||
private OrderService orderService; |
||||
|
||||
@Resource |
||||
private OrderServiceExt orderServiceExt; |
||||
|
||||
@Resource |
||||
private HighGasOrderService gasOrderService; |
||||
|
||||
@RequestMapping(value="/getCouponOrderList",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询卡券订单列表") |
||||
public ResponseData getCouponOrderList(@RequestParam(name = "companyId", required = false) Long companyId, |
||||
@RequestParam(name = "orderNo", required = false) String orderNo, |
||||
@RequestParam(name = "orderStatus", required = false) Integer orderStatus, |
||||
@RequestParam(name = "childOrderNo", required = false) String childOrderNo, |
||||
@RequestParam(name = "goodsId", required = false) Long goodsId, |
||||
@RequestParam(name = "goodsName", required = false) String goodsName, |
||||
@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 = "refundTimeS", required = false) Long refundTimeS, |
||||
@RequestParam(name = "refundTimeE", required = false) Long refundTimeE, |
||||
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||
@RequestParam(name = "pageSize", required = true) Integer pageSize |
||||
) { |
||||
try { |
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("companyId", companyId); |
||||
param.put("orderNo", orderNo); |
||||
param.put("orderStatus", orderStatus); |
||||
param.put("childOrderNo", childOrderNo); |
||||
param.put("goodsId", goodsId); |
||||
param.put("goodsName", goodsName); |
||||
param.put("createTimeS", createTimeS); |
||||
param.put("createTimeE", createTimeE); |
||||
param.put("payTimeS", payTimeS); |
||||
param.put("payTimeE", payTimeE); |
||||
param.put("refundTimeS", refundTimeS); |
||||
param.put("refundTimeE", refundTimeE); |
||||
|
||||
PageHelper.startPage(pageNum, pageSize); |
||||
return ResponseMsgUtil.success(orderServiceExt.getOrderCouponList(param)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("OrderExtController -> getCouponOrderList() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
|
||||
@RequestMapping(value="/getGasOrderList",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询油站订单列表") |
||||
public ResponseData getGasOrderList(@RequestParam(name = "companyId", required = false) Long companyId, |
||||
@RequestParam(name = "merId", required = false) Long merId, |
||||
@RequestParam(name = "storeId", required = false) Long storeId, |
||||
@RequestParam(name = "orderNo", required = false) String orderNo, |
||||
@RequestParam(name = "childOrderNo", required = false) String childOrderNo, |
||||
@RequestParam(name = "gasOilType", required = false) Integer gasOilType, |
||||
@RequestParam(name = "gasOilNo", required = false) String gasOilNo, |
||||
@RequestParam(name = "status", required = false) Integer status, |
||||
@RequestParam(name = "gasSalesmanId", required = false) Long gasSalesmanId, |
||||
@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 = "refundTimeS", required = false) Long refundTimeS, |
||||
@RequestParam(name = "refundTimeE", required = false) Long refundTimeE, |
||||
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||
@RequestParam(name = "pageSize", required = true) Integer pageSize |
||||
) { |
||||
try { |
||||
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); |
||||
if (userInfoModel == null) { |
||||
log.error("OrderBWebController -> getGasOrderList() error!", "用户身份错误或已过期"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); |
||||
} |
||||
Map<String, Object> param = new HashMap<>(); |
||||
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) { |
||||
param.put("companyId", companyId); |
||||
param.put("merId", merId); |
||||
param.put("storeId", storeId); |
||||
|
||||
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) { |
||||
param.put("companyId", userInfoModel.getBsCompany().getId()); |
||||
param.put("merId", merId); |
||||
param.put("storeId", storeId); |
||||
|
||||
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type2.getType())) { |
||||
param.put("merId", userInfoModel.getMerchant().getId()); |
||||
param.put("storeId", storeId); |
||||
|
||||
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type3.getType())) { |
||||
param.put("storeId", userInfoModel.getMerchantStore().getId()); |
||||
|
||||
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { |
||||
param.put("gasAgentId", userInfoModel.getMerchantStore().getId()); |
||||
param.put("gasSalesmanId", gasSalesmanId); |
||||
|
||||
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type7.getType())) { |
||||
param.put("gasSalesmanId", userInfoModel.getMerchantStore().getId()); |
||||
|
||||
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type8.getType())) { |
||||
param.put("gasStaffId", userInfoModel.getGasStaff().getId()); |
||||
|
||||
} else { |
||||
log.error("OrderBWebController -> getGasOrderList() error!", "未知用户身份"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知用户身份"); |
||||
} |
||||
param.put("orderNo", orderNo); |
||||
param.put("childOrderNo", childOrderNo); |
||||
param.put("status", status); |
||||
param.put("createTimeS", createTimeS); |
||||
param.put("createTimeE", createTimeE); |
||||
param.put("payTimeS", payTimeS); |
||||
param.put("payTimeE", payTimeE); |
||||
param.put("refundTimeS", refundTimeS); |
||||
param.put("refundTimeE", refundTimeE); |
||||
|
||||
PageHelper.startPage(pageNum, pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(gasOrderService.getGasOrderList(param))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("OrderExtController -> getCouponOrderList() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,72 @@ |
||||
package com.hai.order.model; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* 卡券订单模型 |
||||
* @className: OrderCouponModal |
||||
* @author: HuRui |
||||
* @date: 2022/9/14 |
||||
**/ |
||||
@Data |
||||
public class OrderCouponModal { |
||||
|
||||
// 交易订单id
|
||||
private Long orderId; |
||||
|
||||
// 交易订单号
|
||||
private String orderNo; |
||||
|
||||
// 第三方交易流水号
|
||||
private String paySerialNo; |
||||
|
||||
// 子订单id
|
||||
private Long childOrderId; |
||||
|
||||
// 子订单号
|
||||
private String childOrderNo; |
||||
|
||||
// 用户手机号
|
||||
private String memPhone; |
||||
|
||||
// 积分抵扣
|
||||
private Integer integralDeduct; |
||||
|
||||
// 支付方式
|
||||
private Integer payType; |
||||
|
||||
// 产品id
|
||||
private Long goodsId; |
||||
|
||||
// 产品名称
|
||||
private String goodsName; |
||||
|
||||
// 产品价格
|
||||
private BigDecimal goodsPrice; |
||||
|
||||
// 产品实际价格
|
||||
private BigDecimal goodsActualPrice; |
||||
|
||||
// 子订单状态
|
||||
private Integer childOrderStatus; |
||||
|
||||
// 创建时间
|
||||
private Date createTime; |
||||
|
||||
// 支付时间
|
||||
private Date payTime; |
||||
|
||||
// 完成时间
|
||||
private Date finishTime; |
||||
|
||||
// 取消时间
|
||||
private Date cancelTime; |
||||
|
||||
// 退款时间
|
||||
private Date refundTime; |
||||
|
||||
|
||||
} |
Loading…
Reference in new issue