Merge branch 'dev_yy' into 2.0-dev

* dev_yy: (25 commits)
  提交代理商
  1
  1
  提交实物
  提交代码
  提交代码
  提交代码
  提交抽奖代码
  1
  提交代码
  提交代码
  提交代码
  提交代码
  提交代码
  提交
  1
  1
  修改首页没有积分专区
  提交代码
  修改小程序注册用券
  ...

# Conflicts:
#	hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
#	hai-service/src/main/java/com/hai/common/utils/DateUtil.java
#	hai-service/src/main/java/com/hai/common/utils/RequestUtils.java
#	hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java
#	hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java
#	hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
#	hai-service/src/main/java/com/hai/entity/HighChildOrder.java
#	hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java
#	hai-service/src/main/java/com/hai/entity/HighOrder.java
#	hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java
#	hai-service/src/main/java/com/hai/service/HighUserService.java
#	hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
#	hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java
#	hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
#	hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
dev-discount
袁野 2 years ago
parent 7f09e4bbf1
commit 10e65cc49c
  1. 68
      v1/src/main/java/com/v1/controller/HighOrderController.java

@ -5,7 +5,8 @@ import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
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.service.*;
import com.v1.config.ToolConfig;
@ -15,15 +16,14 @@ 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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -49,9 +49,24 @@ public class HighOrderController {
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Resource
private HighDiscountPackageActualService discountPackageActualService;
@Resource
private HighDiscountPackageService discountPackageService;
@Resource
private HighOrderService highOrderService;
@Resource
private HighDiscountPackageRecordService discountPackageRecordService;
@Resource
private HighDiscountUserRelService highDiscountUserRelService;
@Resource
private HighDiscountPackageDiscountActualService discountPackageDiscountActualService;
@RequestMapping(value = "/getCallOrderList", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "获取话费订单列表")
@ -188,4 +203,47 @@ public class HighOrderController {
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);
}
}
}

Loading…
Cancel
Save