Преглед изворни кода

商户注券->注券列表

release_toaliyun_real
Burce пре 6 година
родитељ
комит
375839567d
3 измењених фајлова са 23 додато и 20 уклоњено
  1. +19
    -15
      mallinkBApi/src/main/java/com/iformall/controller/WxCouponSendController.java
  2. +1
    -2
      mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java
  3. +3
    -3
      mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml

+ 19
- 15
mallinkBApi/src/main/java/com/iformall/controller/WxCouponSendController.java Прегледај датотеку

@@ -21,9 +21,8 @@ import org.apache.commons.lang3.ArrayUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; 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 javax.annotation.Resource;
import java.util.*; import java.util.*;
@@ -56,7 +55,7 @@ public class WxCouponSendController extends BaseController {
} }
wxCouponSend.setTenantId(getTenantId()); wxCouponSend.setTenantId(getTenantId());
wxCouponSend.setMerchantId(getUser().getMerchantId()); 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.setMerchantLnventory(0);
} }
wxCouponSend.setStatus(wxCouponSend.getStatus()); wxCouponSend.setStatus(wxCouponSend.getStatus());
@@ -71,9 +70,9 @@ public class WxCouponSendController extends BaseController {
} }


@ApiOperation("商户注券") @ApiOperation("商户注券")
@GetMapping("/handSel")
@PostMapping("/handSel")
@ApiImplicitParams({ @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), @ApiImplicitParam(name = "cUserId", value = "用户ID", dataType = "long", paramType = "query", required = true),
}) })
public ResultData handSel(String[] wxCouponSendIds, Long cUserId) { public ResultData handSel(String[] wxCouponSendIds, Long cUserId) {
@@ -82,7 +81,7 @@ public class WxCouponSendController extends BaseController {
if (Objects.isNull(cu)) { if (Objects.isNull(cu)) {
throw new MallinkException(ErrorCode.USER_IS_EMPTY); 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); throw new MallinkException(ErrorCode.COUPON_IS_EMPTY);
} }


@@ -98,7 +97,7 @@ public class WxCouponSendController extends BaseController {
@ApiOperation("注券记录") @ApiOperation("注券记录")
@GetMapping("/actionLog") @GetMapping("/actionLog")
@ApiImplicitParams({ @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 = "beginDate", value = "开始日期 yyyy-MM-dd", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "endDate", 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), @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) { public ResultData sendLog(Integer channelType, String beginDate, String endDate, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxCouponSendController::actionLog"); 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<>(); 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("tenantId", getTenantId());
params.put("channelType", channelType); params.put("channelType", channelType);
params.put("merchantId", getUser().getMerchantId()); params.put("merchantId", getUser().getMerchantId());
params.put("beginDate", begin);
params.put("endDate", cal.getTime());
PageInfo<WxCouponActionLogVo> data = wxCouponActionLogService.getActionLog(params, pageNum, pageSize); PageInfo<WxCouponActionLogVo> data = wxCouponActionLogService.getActionLog(params, pageNum, pageSize);
return new ResultData(data); return new ResultData(data);
} }


+ 1
- 2
mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java Прегледај датотеку

@@ -326,9 +326,8 @@ public class CouponSendSchedule {
WxCouponSendConfig queryConfig = new WxCouponSendConfig(); WxCouponSendConfig queryConfig = new WxCouponSendConfig();
queryConfig.setSendType(sendType); queryConfig.setSendType(sendType);
List<WxCouponSendConfig> couponSendConfigList = couponSendConfigMapper.findList(queryConfig); List<WxCouponSendConfig> couponSendConfigList = couponSendConfigMapper.findList(queryConfig);
Map<String, Integer> mallConfigMap = CollectionUtils.isNotEmpty(couponSendConfigList) ?
return CollectionUtils.isNotEmpty(couponSendConfigList) ?
couponSendConfigList.stream().collect(Collectors.toMap(WxCouponSendConfig::getTenantId, WxCouponSendConfig::getValue)) : null; couponSendConfigList.stream().collect(Collectors.toMap(WxCouponSendConfig::getTenantId, WxCouponSendConfig::getValue)) : null;
return mallConfigMap;
} }


private boolean isCouponSendDisable(Map<String, Integer> mallConfigMap, WxMall mall) { private boolean isCouponSendDisable(Map<String, Integer> mallConfigMap, WxMall mall) {


+ 3
- 3
mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml Прегледај датотеку

@@ -87,7 +87,7 @@
and cs.conditions -> '$.merchantLnventory'> #{merchantLnventory} and cs.conditions -> '$.merchantLnventory'> #{merchantLnventory}
</if> </if>
<if test=" null != ids "> <if test=" null != ids ">
and id in
and cs.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem} #{idItem}
</foreach> </foreach>
@@ -112,10 +112,10 @@
where 1=1 where 1=1
<choose> <choose>
<when test="expired == 0"> <when test="expired == 0">
and <![CDATA[ tt.valid_end_date <= now() ]]>
and <![CDATA[ tt.valid_end_date >= now() ]]>
</when> </when>
<when test="expired == 1"> <when test="expired == 1">
and <![CDATA[ tt.valid_end_date > now() ]]>
and <![CDATA[ tt.valid_end_date < now() ]]>
</when> </when>
<otherwise> <otherwise>
</otherwise> </otherwise>


Loading…
Откажи
Сачувај