|
|
|
@@ -1,10 +1,13 @@ |
|
|
|
package com.iformall.controller; |
|
|
|
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.annotation.SystemControllerLog; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.domain.po.MallUserInfo; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.WxCUser; |
|
|
|
import com.iformall.domain.po.WxCouponChannel; |
|
|
|
import com.iformall.domain.po.WxOrder; |
|
|
|
import com.iformall.domain.vo.WxOrderQueryVo; |
|
|
|
import com.iformall.enums.EnumCouponChannelStatus; |
|
|
|
import com.iformall.enums.EnumCouponChannelType; |
|
|
|
@@ -12,22 +15,16 @@ import com.iformall.enums.EnumUserType; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.service.WxCUserService; |
|
|
|
import com.iformall.service.WxCouponChannelService; |
|
|
|
import com.iformall.service.WxOrderService; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
|
|
|
|
import com.iformall.domain.po.WxOrder; |
|
|
|
import com.iformall.service.WxOrderService; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@@ -134,15 +131,6 @@ public class WxOrderController extends BaseController { |
|
|
|
@PostMapping("save") |
|
|
|
public ResultData saveOrder(@RequestBody Map<String, String> paramMap) { |
|
|
|
|
|
|
|
MallUserInfo mallUserInfo = getUser(); |
|
|
|
WxCUser wxCUser = new WxCUser(); |
|
|
|
if (mallUserInfo != null) { |
|
|
|
wxCUser = wxCUserService.getById(mallUserInfo.getId()); |
|
|
|
if (wxCUser == null) { |
|
|
|
throw new MallinkException(ErrorCode.USER_NOT_MEMBER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
logger.info("OrderSave: " + paramMap.toString()); |
|
|
|
//Assert.notNull(wxOrders.getName(), "角色名不能为空"); |
|
|
|
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); |
|
|
|
@@ -151,6 +139,16 @@ public class WxOrderController extends BaseController { |
|
|
|
String pressStr = paramMap.get("press"); |
|
|
|
String orderGroupIdStr = paramMap.get("orderGroupId"); |
|
|
|
String formId = paramMap.get("formId"); |
|
|
|
//被操作人的ID |
|
|
|
String userIdStr = paramMap.get("userId"); |
|
|
|
Long userId = 0L; |
|
|
|
if (StringUtils.isNotBlank(userIdStr)) { |
|
|
|
userId = Long.valueOf(userIdStr); |
|
|
|
} |
|
|
|
WxCUser wxCUser = wxCUserService.getById(userId); |
|
|
|
if (wxCUser == null) { |
|
|
|
throw new MallinkException(ErrorCode.USER_NOT_MEMBER); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isBlank(couponChannelIdStr)) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); |
|
|
|
@@ -222,8 +220,8 @@ public class WxOrderController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
//用于标记当前操作人为A端用户 |
|
|
|
wxCUser.setUserType(EnumUserType.MALLUSER.getCode()); |
|
|
|
|
|
|
|
wxCUser.setOperatorType(EnumUserType.MALLUSER.getCode()); |
|
|
|
wxCUser.setOperatorId(getUser().getId()); |
|
|
|
try { |
|
|
|
WxOrder order = wxOrderService.saveCouponOrder(wxCUser, couponChannelId, couponId, isPress, orderGroupId, formId); |
|
|
|
return new ResultData(order); |
|
|
|
|