|
|
|
@@ -21,9 +21,8 @@ import org.apache.commons.lang3.ArrayUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.*; |
|
|
|
@@ -56,7 +55,7 @@ public class WxCouponSendController extends BaseController { |
|
|
|
} |
|
|
|
wxCouponSend.setTenantId(getTenantId()); |
|
|
|
wxCouponSend.setMerchantId(getUser().getMerchantId()); |
|
|
|
if (Objects.nonNull(wxCouponSend.getExpired()) && Objects.equals(wxCouponSend.getStatus(), 0)) { |
|
|
|
if (Objects.nonNull(wxCouponSend.getExpired()) && Objects.equals(wxCouponSend.getExpired(), 0)) { |
|
|
|
wxCouponSend.setMerchantLnventory(0); |
|
|
|
} |
|
|
|
wxCouponSend.setStatus(wxCouponSend.getStatus()); |
|
|
|
@@ -71,9 +70,9 @@ public class WxCouponSendController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("商户注券") |
|
|
|
@GetMapping("/handSel") |
|
|
|
@PostMapping("/handSel") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "wxCouponSendIds", value = "wxCouponSendIds", dataType = "string", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "wxCouponSendIds", value = "CouponSend ID数组", dataType = "string[]",allowMultiple=true, paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "cUserId", value = "用户ID", dataType = "long", paramType = "query", required = true), |
|
|
|
}) |
|
|
|
public ResultData handSel(String[] wxCouponSendIds, Long cUserId) { |
|
|
|
@@ -82,7 +81,7 @@ public class WxCouponSendController extends BaseController { |
|
|
|
if (Objects.isNull(cu)) { |
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
} |
|
|
|
if (ArrayUtils.isEmpty(wxCouponSendIds) || Objects.isNull(cUserId)) { |
|
|
|
if (ArrayUtils.isEmpty(wxCouponSendIds)) { |
|
|
|
throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -98,7 +97,7 @@ public class WxCouponSendController extends BaseController { |
|
|
|
@ApiOperation("注券记录") |
|
|
|
@GetMapping("/actionLog") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "channelType", value = "开始日期 yyyy-MM-dd", dataType = "int", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "channelType", value = "注券类型,商户注券=7", dataType = "int", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "beginDate", value = "开始日期 yyyy-MM-dd", dataType = "string", paramType = "query"), |
|
|
|
@ApiImplicitParam(name = "endDate", value = "结束日期 yyyy-MM-dd", dataType = "string", paramType = "query"), |
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), |
|
|
|
@@ -106,17 +105,22 @@ public class WxCouponSendController extends BaseController { |
|
|
|
}) |
|
|
|
public ResultData sendLog(Integer channelType, String beginDate, String endDate, Integer pageNum, Integer pageSize) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxCouponSendController::actionLog"); |
|
|
|
Date begin = DateUtils.stringToDate(beginDate); |
|
|
|
Date end = DateUtils.stringToDate(endDate); |
|
|
|
Calendar cal = Calendar.getInstance(); |
|
|
|
cal.setTime(end); |
|
|
|
cal.add(Calendar.DATE, 1); |
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
if (Objects.nonNull(beginDate)) { |
|
|
|
Date begin = DateUtils.stringToDate(beginDate); |
|
|
|
params.put("beginDate", begin); |
|
|
|
} |
|
|
|
|
|
|
|
if (Objects.nonNull(endDate)) { |
|
|
|
Date end = DateUtils.stringToDate(endDate); |
|
|
|
Calendar cal = Calendar.getInstance(); |
|
|
|
cal.setTime(end); |
|
|
|
cal.add(Calendar.DATE, 1); |
|
|
|
params.put("endDate", cal.getTime()); |
|
|
|
} |
|
|
|
params.put("tenantId", getTenantId()); |
|
|
|
params.put("channelType", channelType); |
|
|
|
params.put("merchantId", getUser().getMerchantId()); |
|
|
|
params.put("beginDate", begin); |
|
|
|
params.put("endDate", cal.getTime()); |
|
|
|
PageInfo<WxCouponActionLogVo> data = wxCouponActionLogService.getActionLog(params, pageNum, pageSize); |
|
|
|
return new ResultData(data); |
|
|
|
} |
|
|
|
|