Compare commits
6 Commits
162779bf92
...
ef376535ea
Author | SHA1 | Date |
---|---|---|
|
ef376535ea | |
|
ab059c7dde | |
|
3d680d5a68 | |
|
1f50a33c78 | |
|
f432697d94 | |
|
80fcfd12ea |
|
@ -119,14 +119,4 @@ public class PublishController {
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 举报
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "举报")
|
|
||||||
@PostMapping("report")
|
|
||||||
public R<Object> reportPublish(@RequestBody @Valid PublishReportRes publishReportRes) {
|
|
||||||
publishService.reportPublish(publishReportRes);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.PublishReportRes;
|
||||||
|
import com.mcwl.communityCenter.service.PublishReportService;
|
||||||
|
import com.mcwl.communityCenter.service.PublishService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布举报
|
||||||
|
*/
|
||||||
|
@Api(tags = "发布举报")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("publishReport")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PublishReportController {
|
||||||
|
|
||||||
|
private final PublishService publishService;
|
||||||
|
|
||||||
|
private final PublishReportService publishReportService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "举报")
|
||||||
|
@PostMapping("report")
|
||||||
|
public R<Object> reportPublish(@RequestBody @Valid PublishReportRes publishReportRes) {
|
||||||
|
publishService.reportPublish(publishReportRes);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取举报列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取举报列表")
|
||||||
|
@PostMapping("list")
|
||||||
|
public TableDataInfo getReportList(@RequestBody @Valid PageDomain pageDomain) {
|
||||||
|
return publishReportService.getReportList(pageDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -30,6 +30,11 @@ public class IncomeInfo extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Long communityId;
|
private Long communityId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型 0付费加入 1付费问答
|
* 类型 0付费加入 1付费问答
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -41,17 +41,17 @@ public class PublishReport extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 举报类型 字典值
|
* 举报类型 字典值
|
||||||
*/
|
*/
|
||||||
private Long reportType;
|
private Integer reportType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 举报内容
|
* 举报内容
|
||||||
*/
|
*/
|
||||||
private Long content;
|
private String content;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态(0未处理 1已处理 )
|
* 状态(0未处理 1已处理 )
|
||||||
*/
|
*/
|
||||||
private Long status;
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,12 @@ public class CommunityDetailVo {
|
||||||
@ApiModelProperty(value = "社区名称")
|
@ApiModelProperty(value = "社区名称")
|
||||||
private String communityName;
|
private String communityName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区标签
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "社区标签")
|
||||||
|
private Integer communityTag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 价格
|
* 价格
|
||||||
*/
|
*/
|
||||||
|
@ -53,6 +59,18 @@ public class CommunityDetailVo {
|
||||||
@ApiModelProperty(value = "描述")
|
@ApiModelProperty(value = "描述")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "社区类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 有效期天数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "有效期天数")
|
||||||
|
private Integer validityDay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建天数
|
* 创建天数
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -25,7 +25,7 @@ public interface IncomeInfoMapper extends BaseMapper<IncomeInfo> {
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
IncomeAmountVo questionIncome(@Param("userId") Long userId);
|
IncomeAmountVo questionIncome(@Param("userId") Long userId);
|
||||||
|
|
||||||
Double totalIncome();
|
Double totalIncome(@Param("userId") Long userId);
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
List<IncomeInfoListVo> incomeList(Page<IncomeInfo> page,
|
List<IncomeInfoListVo> incomeList(Page<IncomeInfo> page,
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.mcwl.communityCenter.service;
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.mcwl.common.core.domain.R;
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.communityCenter.domain.Publish;
|
import com.mcwl.communityCenter.domain.Publish;
|
||||||
import com.mcwl.communityCenter.domain.PublishReport;
|
import com.mcwl.communityCenter.domain.PublishReport;
|
||||||
|
@ -14,4 +15,6 @@ import javax.validation.Valid;
|
||||||
public interface PublishReportService extends IService<PublishReport> {
|
public interface PublishReportService extends IService<PublishReport> {
|
||||||
|
|
||||||
void saveReport(PublishReport publishReport);
|
void saveReport(PublishReport publishReport);
|
||||||
|
|
||||||
|
TableDataInfo getReportList(@Valid PageDomain pageDomain);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,7 @@ import com.mcwl.common.exception.ServiceException;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
import com.mcwl.common.utils.StringUtils;
|
import com.mcwl.common.utils.StringUtils;
|
||||||
import com.mcwl.communityCenter.constant.AdviceConstant;
|
import com.mcwl.communityCenter.constant.AdviceConstant;
|
||||||
import com.mcwl.communityCenter.domain.Community;
|
import com.mcwl.communityCenter.domain.*;
|
||||||
import com.mcwl.communityCenter.domain.CommunityAdvice;
|
|
||||||
import com.mcwl.communityCenter.domain.CommunityUser;
|
|
||||||
import com.mcwl.communityCenter.domain.Publish;
|
|
||||||
import com.mcwl.communityCenter.domain.dto.*;
|
import com.mcwl.communityCenter.domain.dto.*;
|
||||||
import com.mcwl.communityCenter.domain.vo.CommunityDetailVo;
|
import com.mcwl.communityCenter.domain.vo.CommunityDetailVo;
|
||||||
import com.mcwl.communityCenter.domain.vo.CommunityVo;
|
import com.mcwl.communityCenter.domain.vo.CommunityVo;
|
||||||
|
@ -25,15 +22,19 @@ import com.mcwl.communityCenter.mapper.CommunityAdviceMapper;
|
||||||
import com.mcwl.communityCenter.mapper.CommunityMapper;
|
import com.mcwl.communityCenter.mapper.CommunityMapper;
|
||||||
import com.mcwl.communityCenter.mapper.CommunityUserMapper;
|
import com.mcwl.communityCenter.mapper.CommunityUserMapper;
|
||||||
import com.mcwl.communityCenter.service.CommunityService;
|
import com.mcwl.communityCenter.service.CommunityService;
|
||||||
|
import com.mcwl.communityCenter.service.IncomeInfoService;
|
||||||
import com.mcwl.communityCenter.service.PublishService;
|
import com.mcwl.communityCenter.service.PublishService;
|
||||||
|
import com.mcwl.myInvitation.domain.CommissionRatio;
|
||||||
import com.mcwl.myInvitation.domain.Consume;
|
import com.mcwl.myInvitation.domain.Consume;
|
||||||
import com.mcwl.myInvitation.mapper.ConsumeMapper;
|
import com.mcwl.myInvitation.mapper.ConsumeMapper;
|
||||||
|
import com.mcwl.myInvitation.service.CommissionRatioService;
|
||||||
import com.mcwl.system.service.ISysUserService;
|
import com.mcwl.system.service.ISysUserService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
|
@ -58,6 +59,10 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
|
||||||
|
|
||||||
private final ConsumeMapper consumeMapper;
|
private final ConsumeMapper consumeMapper;
|
||||||
|
|
||||||
|
private final IncomeInfoService incomeInfoService;
|
||||||
|
|
||||||
|
private final CommissionRatioService commissionRatioService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -142,6 +147,29 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
|
||||||
|
|
||||||
sysUserService.updateUser(user);
|
sysUserService.updateUser(user);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 从redis获取提成比例
|
||||||
|
// 抽取社区比例
|
||||||
|
String commissionRationCommunity = redisCache.getCacheObject("CommissionRationCommunity");
|
||||||
|
if (Objects.isNull(commissionRationCommunity)) {
|
||||||
|
CommissionRatio commissionRatio = commissionRatioService.lambdaQuery()
|
||||||
|
.eq(CommissionRatio::getType, 2)
|
||||||
|
.one();
|
||||||
|
commissionRationCommunity = commissionRatio.getRatio().toString();
|
||||||
|
redisCache.setCacheObject("CommissionRationCommunity", commissionRationCommunity);
|
||||||
|
}
|
||||||
|
|
||||||
|
SysUser tenantUser = sysUserService.selectUserById(tenantId);
|
||||||
|
BigDecimal getWallet = priceBigDecimal
|
||||||
|
.multiply(new BigDecimal("1").subtract(new BigDecimal(commissionRationCommunity)));
|
||||||
|
tenantUser.setWallet(getWallet
|
||||||
|
.add(new BigDecimal(tenantUser.getWallet().toString()))
|
||||||
|
.setScale(2, RoundingMode.HALF_UP)
|
||||||
|
.doubleValue());
|
||||||
|
sysUserService.updateUser(tenantUser);
|
||||||
|
|
||||||
|
|
||||||
Calendar now = Calendar.getInstance();
|
Calendar now = Calendar.getInstance();
|
||||||
Date startTime = now.getTime();
|
Date startTime = now.getTime();
|
||||||
now.add(Calendar.YEAR, community.getValidityDay());
|
now.add(Calendar.YEAR, community.getValidityDay());
|
||||||
|
@ -170,7 +198,7 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
|
||||||
communityAdvice.setAdviceType(AdviceConstant.COMMUNITY_NOTICE);
|
communityAdvice.setAdviceType(AdviceConstant.COMMUNITY_NOTICE);
|
||||||
communityAdvice.setUserId(tenantId);
|
communityAdvice.setUserId(tenantId);
|
||||||
communityAdvice.setContent(StringUtils.format("{}加入{}社区,金币+{}",
|
communityAdvice.setContent(StringUtils.format("{}加入{}社区,金币+{}",
|
||||||
SecurityUtils.getLoginUser().getUser().getNickName(), community.getCommunityName(), price));
|
SecurityUtils.getLoginUser().getUser().getNickName(), community.getCommunityName(), getWallet));
|
||||||
communityAdviceMapper.insert(communityAdvice);
|
communityAdviceMapper.insert(communityAdvice);
|
||||||
|
|
||||||
Consume consume = new Consume();
|
Consume consume = new Consume();
|
||||||
|
@ -183,12 +211,20 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
|
||||||
|
|
||||||
consume = new Consume();
|
consume = new Consume();
|
||||||
consume.setUserId(community.getTenantId());
|
consume.setUserId(community.getTenantId());
|
||||||
consume.setAmount(price);
|
consume.setAmount(getWallet.doubleValue());
|
||||||
consume.setProductId(communityId);
|
consume.setProductId(communityId);
|
||||||
consume.setType(3);
|
consume.setType(3);
|
||||||
consume.setWallet(sysUserService.selectUserById(community.getTenantId()).getWallet());
|
consume.setWallet(sysUserService.selectUserById(community.getTenantId()).getWallet());
|
||||||
consumeMapper.insert(consume);
|
consumeMapper.insert(consume);
|
||||||
|
|
||||||
|
IncomeInfo incomeInfo = new IncomeInfo();
|
||||||
|
incomeInfo.setTenantId(tenantId);
|
||||||
|
incomeInfo.setCommunityId(communityId);
|
||||||
|
incomeInfo.setUserId(tenantId);
|
||||||
|
incomeInfo.setType(0);
|
||||||
|
incomeInfo.setAmount(getWallet.doubleValue());
|
||||||
|
incomeInfoService.save(incomeInfo);
|
||||||
|
|
||||||
redisCache.deleteObject("communityJoinNumMap");
|
redisCache.deleteObject("communityJoinNumMap");
|
||||||
|
|
||||||
|
|
||||||
|
@ -299,7 +335,7 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
|
||||||
|
|
||||||
List<Community> myJoinCommunityList = baseMapper.getMyJoinCommunity(new Page<>(1, 100),
|
List<Community> myJoinCommunityList = baseMapper.getMyJoinCommunity(new Page<>(1, 100),
|
||||||
SecurityUtils.getUserId(),
|
SecurityUtils.getUserId(),
|
||||||
new JoinCommunityListPageRes());
|
JoinCommunityListPageRes.builder().isMyCreate(1).build());
|
||||||
|
|
||||||
Map<Long, Community> myJoinCommunityMap = myJoinCommunityList.stream()
|
Map<Long, Community> myJoinCommunityMap = myJoinCommunityList.stream()
|
||||||
.collect(Collectors.toMap(Community::getId, Function.identity()));
|
.collect(Collectors.toMap(Community::getId, Function.identity()));
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class IncomeInfoServiceImpl extends ServiceImpl<IncomeInfoMapper, IncomeI
|
||||||
IncomeAmountVo questionIncome = baseMapper.questionIncome(SecurityUtils.getUserId());
|
IncomeAmountVo questionIncome = baseMapper.questionIncome(SecurityUtils.getUserId());
|
||||||
|
|
||||||
// 累计收益
|
// 累计收益
|
||||||
Double totalIncome = baseMapper.totalIncome();
|
Double totalIncome = baseMapper.totalIncome(SecurityUtils.getUserId());
|
||||||
|
|
||||||
IncomeInfoVo incomeInfoVo = IncomeInfoVo.builder()
|
IncomeInfoVo incomeInfoVo = IncomeInfoVo.builder()
|
||||||
.communityIncome(communityIncome)
|
.communityIncome(communityIncome)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.mcwl.communityCenter.service.impl;
|
package com.mcwl.communityCenter.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
@ -41,4 +42,17 @@ public class PublishReportServiceImpl extends ServiceImpl<PublishReportMapper, P
|
||||||
baseMapper.insertReport(publishReport);
|
baseMapper.insertReport(publishReport);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo getReportList(PageDomain pageDomain) {
|
||||||
|
Page<PublishReport> page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
|
||||||
|
baseMapper.selectPage(page, new LambdaQueryWrapper<PublishReport>());
|
||||||
|
List<PublishReport> records = page.getRecords();
|
||||||
|
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||||
|
tableDataInfo.setRows(records);
|
||||||
|
tableDataInfo.setTotal(page.getTotal());
|
||||||
|
tableDataInfo.setCode(HttpStatus.SUCCESS);
|
||||||
|
tableDataInfo.setMsg("查询成功");
|
||||||
|
return tableDataInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import com.mcwl.communityCenter.domain.dto.*;
|
||||||
import com.mcwl.communityCenter.domain.vo.QuestionCommentVo;
|
import com.mcwl.communityCenter.domain.vo.QuestionCommentVo;
|
||||||
import com.mcwl.communityCenter.domain.vo.QuestionVo;
|
import com.mcwl.communityCenter.domain.vo.QuestionVo;
|
||||||
import com.mcwl.communityCenter.mapper.*;
|
import com.mcwl.communityCenter.mapper.*;
|
||||||
|
import com.mcwl.communityCenter.service.IncomeInfoService;
|
||||||
import com.mcwl.communityCenter.service.QuestionCommentService;
|
import com.mcwl.communityCenter.service.QuestionCommentService;
|
||||||
import com.mcwl.communityCenter.service.QuestionService;
|
import com.mcwl.communityCenter.service.QuestionService;
|
||||||
import com.mcwl.myInvitation.domain.Consume;
|
import com.mcwl.myInvitation.domain.Consume;
|
||||||
|
@ -46,6 +47,8 @@ public class QuestionCommentServiceImpl extends ServiceImpl<QuestionCommentMappe
|
||||||
|
|
||||||
private final ConsumeMapper consumeMapper;
|
private final ConsumeMapper consumeMapper;
|
||||||
|
|
||||||
|
private final IncomeInfoService incomeInfoService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public R<Object> comment(QuestionCommentRes questionCommentRes) {
|
public R<Object> comment(QuestionCommentRes questionCommentRes) {
|
||||||
|
@ -157,7 +160,7 @@ public class QuestionCommentServiceImpl extends ServiceImpl<QuestionCommentMappe
|
||||||
questionMapper.updateById(question);
|
questionMapper.updateById(question);
|
||||||
|
|
||||||
|
|
||||||
SysUser sysUser = sysUserService.selectUserById(tenantId);
|
SysUser sysUser = sysUserService.selectUserById(questionComment.getUserId());
|
||||||
BigDecimal sysWallet = new BigDecimal(sysUser.getWallet().toString());
|
BigDecimal sysWallet = new BigDecimal(sysUser.getWallet().toString());
|
||||||
BigDecimal amount = new BigDecimal(question.getAmount().toString());
|
BigDecimal amount = new BigDecimal(question.getAmount().toString());
|
||||||
// 添加钱包
|
// 添加钱包
|
||||||
|
@ -167,12 +170,20 @@ public class QuestionCommentServiceImpl extends ServiceImpl<QuestionCommentMappe
|
||||||
|
|
||||||
|
|
||||||
Consume consume = new Consume();
|
Consume consume = new Consume();
|
||||||
consume.setUserId(SecurityUtils.getUserId());
|
consume.setUserId(questionComment.getUserId());
|
||||||
consume.setAmount(question.getAmount());
|
consume.setAmount(question.getAmount());
|
||||||
consume.setType(4);
|
consume.setType(4);
|
||||||
consume.setWallet(sysUser.getWallet());
|
consume.setWallet(sysUser.getWallet());
|
||||||
consumeMapper.insert(consume);
|
consumeMapper.insert(consume);
|
||||||
|
|
||||||
|
IncomeInfo incomeInfo = new IncomeInfo();
|
||||||
|
incomeInfo.setTenantId(tenantId);
|
||||||
|
incomeInfo.setCommunityId(communityId);
|
||||||
|
incomeInfo.setUserId(questionComment.getUserId());
|
||||||
|
incomeInfo.setType(1);
|
||||||
|
incomeInfo.setAmount(question.getAmount());
|
||||||
|
incomeInfoService.save(incomeInfo);
|
||||||
|
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<update id="quitCommunity">
|
<update id="quitCommunity">
|
||||||
update cc_community_user
|
update cc_community_user
|
||||||
set del_flag = '1'
|
set del_flag = '2'
|
||||||
where tenant_id = #{tenantId}
|
where tenant_id = #{tenantId}
|
||||||
and community_id = #{communityId}
|
and community_id = #{communityId}
|
||||||
and user_id = #{userId}
|
and user_id = #{userId}
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
<update id="deleteCommunity">
|
<update id="deleteCommunity">
|
||||||
update cc_community
|
update cc_community
|
||||||
set del_flag = '1'
|
set del_flag = '2'
|
||||||
where tenant_id = #{tenantId}
|
where tenant_id = #{tenantId}
|
||||||
and id = #{communityId}
|
and id = #{communityId}
|
||||||
and del_flag = '0';
|
and del_flag = '0';
|
||||||
|
@ -47,6 +47,8 @@
|
||||||
select cu.community_id as id, COALESCE(count(*), 0) as join_num
|
select cu.community_id as id, COALESCE(count(*), 0) as join_num
|
||||||
from cc_community_user cu
|
from cc_community_user cu
|
||||||
where cu.del_flag = '0'
|
where cu.del_flag = '0'
|
||||||
|
and ((CONVERT_TZ(NOW(), 'SYSTEM', '+08:00') >= start_time
|
||||||
|
AND CONVERT_TZ(NOW(), 'SYSTEM', '+08:00') <= end_time) or (start_time is null and end_time is null))
|
||||||
group by cu.community_id
|
group by cu.community_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -102,6 +104,8 @@
|
||||||
and (c.community_name like concat('%', #{joinCommunityListPageRes.searchContent}, '%')
|
and (c.community_name like concat('%', #{joinCommunityListPageRes.searchContent}, '%')
|
||||||
or c.description like concat('%', #{joinCommunityListPageRes.searchContent}, '%'))
|
or c.description like concat('%', #{joinCommunityListPageRes.searchContent}, '%'))
|
||||||
</if>
|
</if>
|
||||||
|
and ((CONVERT_TZ(NOW(), 'SYSTEM', '+08:00') >= start_time
|
||||||
|
AND CONVERT_TZ(NOW(), 'SYSTEM', '+08:00') <= end_time) or (start_time is null and end_time is null))
|
||||||
</select>
|
</select>
|
||||||
<select id="getCommunity" resultType="com.mcwl.communityCenter.domain.Community">
|
<select id="getCommunity" resultType="com.mcwl.communityCenter.domain.Community">
|
||||||
select *
|
select *
|
||||||
|
|
|
@ -103,7 +103,6 @@
|
||||||
and user_id = #{userId}
|
and user_id = #{userId}
|
||||||
and ((CONVERT_TZ(NOW(), 'SYSTEM', '+08:00') >= start_time
|
and ((CONVERT_TZ(NOW(), 'SYSTEM', '+08:00') >= start_time
|
||||||
AND CONVERT_TZ(NOW(), 'SYSTEM', '+08:00') <= end_time) or (start_time is null and end_time is null))
|
AND CONVERT_TZ(NOW(), 'SYSTEM', '+08:00') <= end_time) or (start_time is null and end_time is null))
|
||||||
and (black_end_time is null or NOW() >= black_end_time)
|
|
||||||
and del_flag = '0';
|
and del_flag = '0';
|
||||||
</select>
|
</select>
|
||||||
<select id="getAllCommunityUser" resultType="com.mcwl.communityCenter.domain.CommunityUser">
|
<select id="getAllCommunityUser" resultType="com.mcwl.communityCenter.domain.CommunityUser">
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
SELECT SUM(IF(DATE(create_time) = CURDATE(), amount, 0)) AS today_income,
|
SELECT SUM(IF(DATE(create_time) = CURDATE(), amount, 0)) AS today_income,
|
||||||
SUM(IF(DATE(create_time) = CURDATE() - INTERVAL 1 DAY, amount, 0)) AS yesterday_income
|
SUM(IF(DATE(create_time) = CURDATE() - INTERVAL 1 DAY, amount, 0)) AS yesterday_income
|
||||||
FROM cc_income_info
|
FROM cc_income_info
|
||||||
WHERE tenant_id = #{userId}
|
WHERE user_id = #{userId}
|
||||||
AND type = 0
|
AND type = 0
|
||||||
AND del_flag = '0'
|
AND del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
@ -18,14 +18,14 @@
|
||||||
SELECT SUM(IF(DATE(create_time) = CURDATE(), amount, 0)) AS today_income,
|
SELECT SUM(IF(DATE(create_time) = CURDATE(), amount, 0)) AS today_income,
|
||||||
SUM(IF(DATE(create_time) = CURDATE() - INTERVAL 1 DAY, amount, 0)) AS yesterday_income
|
SUM(IF(DATE(create_time) = CURDATE() - INTERVAL 1 DAY, amount, 0)) AS yesterday_income
|
||||||
FROM cc_income_info
|
FROM cc_income_info
|
||||||
WHERE tenant_id = #{userId}
|
WHERE user_id = #{userId}
|
||||||
AND type = 1
|
AND type = 1
|
||||||
AND del_flag = '0'
|
AND del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
<select id="totalIncome" resultType="java.lang.Double">
|
<select id="totalIncome" resultType="java.lang.Double">
|
||||||
SELECT SUM(amount)
|
SELECT SUM(amount)
|
||||||
FROM cc_income_info
|
FROM cc_income_info
|
||||||
WHERE del_flag = '0'
|
WHERE del_flag = '0' and user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
<select id="incomeList" resultType="com.mcwl.communityCenter.domain.vo.IncomeInfoListVo">
|
<select id="incomeList" resultType="com.mcwl.communityCenter.domain.vo.IncomeInfoListVo">
|
||||||
SELECT u.nick_name as user_name,
|
SELECT u.nick_name as user_name,
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
on ii.tenant_id = c.tenant_id
|
on ii.tenant_id = c.tenant_id
|
||||||
and ii.community_id = c.id
|
and ii.community_id = c.id
|
||||||
left join sys_user u on c.tenant_id = u.user_id
|
left join sys_user u on c.tenant_id = u.user_id
|
||||||
where ii.tenant_id = #{userId}
|
where ii.user_id = #{userId}
|
||||||
<if test="incomeInfoListPageRes.type != null ">
|
<if test="incomeInfoListPageRes.type != null ">
|
||||||
and ii.type = #{incomeInfoListPageRes.type}
|
and ii.type = #{incomeInfoListPageRes.type}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
@ -34,6 +34,10 @@ public class CommissionRatio extends BaseEntity {
|
||||||
* 类型 0邀请人-被邀请人 1公司-商家
|
* 类型 0邀请人-被邀请人 1公司-商家
|
||||||
*/
|
*/
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class CommissionRatioVo {
|
||||||
*/
|
*/
|
||||||
private Double ratio;
|
private Double ratio;
|
||||||
/**
|
/**
|
||||||
* 提成类型,平台手续费、邀请人提成
|
* 提成类型,平台手续费、邀请人提成、星球手续费
|
||||||
*/
|
*/
|
||||||
private String ratioName;
|
private String ratioName;
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ public class CommissionRatioServiceImpl extends ServiceImpl<CommissionRatioMappe
|
||||||
|
|
||||||
redisCache.deleteObject("CommissionRationInviterUser");
|
redisCache.deleteObject("CommissionRationInviterUser");
|
||||||
redisCache.deleteObject("CommissionRationMerchant");
|
redisCache.deleteObject("CommissionRationMerchant");
|
||||||
|
redisCache.deleteObject("CommissionRationCommunity");
|
||||||
|
|
||||||
return this.getCommissionRatioVo(commissionRatio);
|
return this.getCommissionRatioVo(commissionRatio);
|
||||||
}
|
}
|
||||||
|
@ -66,11 +67,7 @@ public class CommissionRatioServiceImpl extends ServiceImpl<CommissionRatioMappe
|
||||||
private CommissionRatioVo getCommissionRatioVo(CommissionRatio commissionRatio) {
|
private CommissionRatioVo getCommissionRatioVo(CommissionRatio commissionRatio) {
|
||||||
CommissionRatioVo vo = new CommissionRatioVo();
|
CommissionRatioVo vo = new CommissionRatioVo();
|
||||||
BeanUtil.copyProperties(commissionRatio, vo);
|
BeanUtil.copyProperties(commissionRatio, vo);
|
||||||
if (commissionRatio.getType() == 0) {
|
vo.setRatioName(commissionRatio.getDescription());
|
||||||
vo.setRatioName("平台手续费");
|
|
||||||
} else if (commissionRatio.getType() == 1) {
|
|
||||||
vo.setRatioName("邀请人提成");
|
|
||||||
}
|
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue