|
|
@ -5,7 +5,8 @@ import com.hai.common.exception.ErrorCode; |
|
|
|
import com.hai.common.exception.ErrorHelp; |
|
|
|
import com.hai.common.exception.ErrorHelp; |
|
|
|
import com.hai.common.exception.SysCode; |
|
|
|
import com.hai.common.exception.SysCode; |
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
import com.hai.entity.ApiMerchants; |
|
|
|
import com.hai.entity.*; |
|
|
|
|
|
|
|
import com.hai.model.HighMerchantStoreModel; |
|
|
|
import com.hai.model.ResponseData; |
|
|
|
import com.hai.model.ResponseData; |
|
|
|
import com.hai.service.*; |
|
|
|
import com.hai.service.*; |
|
|
|
import com.v1.config.ToolConfig; |
|
|
|
import com.v1.config.ToolConfig; |
|
|
@ -15,15 +16,14 @@ import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -49,9 +49,24 @@ public class HighOrderController { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private OutRechargeOrderService outRechargeOrderService; |
|
|
|
private OutRechargeOrderService outRechargeOrderService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HighDiscountPackageActualService discountPackageActualService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HighDiscountPackageService discountPackageService; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private HighOrderService highOrderService; |
|
|
|
private HighOrderService highOrderService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HighDiscountPackageRecordService discountPackageRecordService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HighDiscountUserRelService highDiscountUserRelService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HighDiscountPackageDiscountActualService discountPackageDiscountActualService; |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getCallOrderList", method = RequestMethod.POST) |
|
|
|
@RequestMapping(value = "/getCallOrderList", method = RequestMethod.POST) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "获取话费订单列表") |
|
|
|
@ApiOperation(value = "获取话费订单列表") |
|
|
@ -188,4 +203,47 @@ public class HighOrderController { |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getDiscountPackage", method = RequestMethod.GET) |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
|
|
|
|
@ApiOperation(value = "getDiscountPackage") |
|
|
|
|
|
|
|
public ResponseData getDiscountPackage(@RequestParam(name = "orderId", required = true) Long orderId) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
HighOrder order = highOrderService.getOrderById(orderId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (HighChildOrder highChildOrder : order.getHighChildOrderList()) { |
|
|
|
|
|
|
|
highChildOrder.setChildOrdeStatus(2); |
|
|
|
|
|
|
|
HighDiscountPackageActual actual = discountPackageActualService.getDetailByChildOrderId(highChildOrder.getId()); |
|
|
|
|
|
|
|
if (actual != null) { |
|
|
|
|
|
|
|
List<HighDiscountPackageDiscountActual> discountList = discountPackageDiscountActualService.getHighDiscountPackageDiscountActualList(actual.getId()); |
|
|
|
|
|
|
|
for (HighDiscountPackageDiscountActual discount : discountList) { |
|
|
|
|
|
|
|
highDiscountUserRelService.receiveDiscount(order.getMemId(), discount.getAgentDiscountCodeId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
HighDiscountPackage discountPackage = discountPackageService.findDiscountPackageById(actual.getDiscountPackageId()); |
|
|
|
|
|
|
|
HighDiscountPackageRecord record = new HighDiscountPackageRecord(); |
|
|
|
|
|
|
|
record.setDiscountPackageId(discountPackage.getId()); |
|
|
|
|
|
|
|
record.setDiscountPackageTitle(discountPackage.getTitle()); |
|
|
|
|
|
|
|
record.setUsingAttribution(discountPackage.getUsingAttribution()); |
|
|
|
|
|
|
|
record.setCompanyId(discountPackage.getCompanyId()); |
|
|
|
|
|
|
|
record.setOrderId(order.getId().intValue()); |
|
|
|
|
|
|
|
record.setChildOrderId(highChildOrder.getId().intValue()); |
|
|
|
|
|
|
|
record.setRecordNo(System.currentTimeMillis() + ""); |
|
|
|
|
|
|
|
record.setSalesType(1); |
|
|
|
|
|
|
|
record.setPrice(order.getPayPrice()); |
|
|
|
|
|
|
|
record.setUserId(order.getMemId().intValue()); |
|
|
|
|
|
|
|
discountPackageRecordService.insertRecord(record); |
|
|
|
|
|
|
|
actual.setAllocationTime(new Date()); |
|
|
|
|
|
|
|
actual.setStatus(3); // 状态: 1: 待分配 2:预分配(售卖)3:已分配
|
|
|
|
|
|
|
|
discountPackageActualService.updateHighDiscountPackageActual(actual); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error("HighOrderController --> gasPageQueryAllStation() error!", e); |
|
|
|
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|