Commit a81e99d0 by YG8429

修改权益会员绑定逻辑。权益会员返佣逻辑

parent 4e26a05c
...@@ -77,18 +77,6 @@ public class SharingActivitiesController extends BaseController { ...@@ -77,18 +77,6 @@ public class SharingActivitiesController extends BaseController {
return toAjax(sharingActivitiesService.insertSharingActivities(sharingActivities)); return toAjax(sharingActivitiesService.insertSharingActivities(sharingActivities));
} }
/**
* 新增分享活动绑定关系
*/
// @PreAuthorize("@ss.hasPermi('system:activities:addSharingActivities')")
@Log(title = "分享活动绑定关系", businessType = BusinessType.INSERT)
@PostMapping("/addSharingActivities")
public AjaxResult addSharingActivities(@RequestBody SharingActivities sharingActivities) {
AjaxResult ajaxResult = sharingActivitiesService.addSharingActivities(sharingActivities);
return ajaxResult;
}
/** /**
* 修改分享活动绑定关系 * 修改分享活动绑定关系
......
...@@ -49,7 +49,4 @@ public class WxRegisterPhoneRequest implements Serializable { ...@@ -49,7 +49,4 @@ public class WxRegisterPhoneRequest implements Serializable {
@ApiModelProperty(value = "上级id") @ApiModelProperty(value = "上级id")
private Long uid; private Long uid;
@ApiModelProperty(value = "活动类型")
private String activityType;
} }
...@@ -61,5 +61,5 @@ public interface SharingActivitiesService extends IService<SharingActivities> ...@@ -61,5 +61,5 @@ public interface SharingActivitiesService extends IService<SharingActivities>
*/ */
public int deleteSharingActivitiesById(Long id); public int deleteSharingActivitiesById(Long id);
AjaxResult addSharingActivities(SharingActivities sharingActivities);
} }
package share.system.service.impl; package share.system.service.impl;
import java.time.YearMonth;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -10,6 +11,7 @@ import org.springframework.data.redis.core.RedisTemplate; ...@@ -10,6 +11,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.redis.RedisUtil; import share.common.core.redis.RedisUtil;
import share.common.enums.ReceiptRdeisEnum; import share.common.enums.ReceiptRdeisEnum;
import share.common.enums.YesNoEnum;
import share.common.utils.DateUtils; import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -107,28 +109,4 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM ...@@ -107,28 +109,4 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
return sharingActivitiesMapper.deleteSharingActivitiesById(id); return sharingActivitiesMapper.deleteSharingActivitiesById(id);
} }
/**
* 新增分享活动绑定关系
* @param sharingActivities
* @return
*/
@Override
public AjaxResult addSharingActivities(SharingActivities sharingActivities) {
sharingActivities.setCreateTime(DateUtils.getNowDate());
Long newUid = sharingActivities.getNewUid();
SharingActivities sharingActivities1 = sharingActivitiesMapper.selectOne(new LambdaQueryWrapper<SharingActivities>().eq(SharingActivities::getNewUid, newUid));
if (ObjectUtil.isNotEmpty(sharingActivities1)){
return AjaxResult.success("此用户以绑定其他权益会员");
}
Boolean B = redisTemplate.hasKey(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME + sharingActivities.getUid().toString());
if (!B){
return AjaxResult.success("分享用户权益过期");
}
sharingActivitiesMapper.insertSharingActivities(sharingActivities);
Boolean aBoolean = redisTemplate.hasKey(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME + sharingActivities.getUid().toString());
if (!aBoolean){
sharingActivitiesMapper.deleteSharingActivitiesById(sharingActivities.getId());
}
return AjaxResult.success();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment