master
袁野 1 month ago
commit 346b16f3d6
  1. 48
      order/src/main/java/com/order/controller/business/OrderCouponController.java

@ -1,6 +1,7 @@
package com.order.controller.business;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
@ -10,14 +11,20 @@ import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsOrderChild;
import com.hfkj.entity.BsOrderCoupon;
import com.hfkj.entity.FileRecords;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.model.order.OrderChildModel;
import com.hfkj.model.order.OrderCouponModel;
import com.hfkj.model.order.OrderModel;
import com.hfkj.service.coupon.BsOrderCouponNoService;
import com.hfkj.service.coupon.BsOrderCouponService;
import com.hfkj.service.file.FileRecordsService;
import com.hfkj.service.order.BsOrderChildService;
import com.hfkj.service.order.BsOrderService;
import com.hfkj.service.order.OrderPaySuccessService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import com.hfkj.sysenum.fileRecords.FileRecordsEnum;
import com.hfkj.sysenum.order.OrderChildStatusEnum;
@ -27,13 +34,11 @@ import com.hfkj.sysenum.order.OrderPayTypeEnum;
import com.order.utils.excel.OrderCouponExcelMergeHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
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 org.springframework.web.bind.annotation.*;
import org.thymeleaf.util.DateUtils;
import javax.annotation.Resource;
@ -59,6 +64,12 @@ public class OrderCouponController {
private UserCenter userCenter;
@Resource
private FileRecordsService fileRecordsService;
@Resource
private OrderPaySuccessService orderPaySuccessService;
@Resource
private BsOrderService orderService;
@Resource
private BsOrderChildService orderChildService;
@RequestMapping(value="/queryCouNo",method = RequestMethod.GET)
@ResponseBody
@ -99,6 +110,35 @@ public class OrderCouponController {
}
}
@RequestMapping(value="/reissue",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "补发")
public ResponseData reissue(@RequestBody JSONObject body) {
try {
if (body == null || StringUtils.isBlank(body.getString("orderChildNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询订单
OrderChildModel orderChild = orderChildService.getDetail(body.getString("orderChildNo"));
if (orderChild == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商品订单");
}
OrderModel orderModel = orderService.getDetail(orderChild.getOrderNo());
if (orderChild.getStatus().equals(OrderChildStatusEnum.status2.getCode())
|| orderChild.getStatus().equals(OrderChildStatusEnum.status3.getCode())) {
orderPaySuccessService.product(orderModel, orderChild);
return ResponseMsgUtil.success("操作成功");
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "补发失败,订单状态不正确");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询交易订单列表")

Loading…
Cancel
Save