Compare commits
9 Commits
76e7619eac
...
5083e455ab
Author | SHA1 | Date |
---|---|---|
|
5083e455ab | |
|
a74e6412e0 | |
|
502fcb3072 | |
|
f90bc03b48 | |
|
5357e25635 | |
|
93655e9f63 | |
|
4d50a05ed7 | |
|
0005e1da6b | |
|
f3e5e93173 |
|
@ -0,0 +1,51 @@
|
||||||
|
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.*;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityFileLogService;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityFileService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件
|
||||||
|
*/
|
||||||
|
@Api(tags = "社区文件")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("communityFile")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CommunityFileController {
|
||||||
|
|
||||||
|
private final CommunityFileService communityFileService;
|
||||||
|
|
||||||
|
private final CommunityFileLogService communityFileLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件上传
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "社区文件上传")
|
||||||
|
@PostMapping("/upload")
|
||||||
|
public R<Object> upload(@RequestBody @Valid CommunityUploadFileRes communityUploadFileRes) {
|
||||||
|
communityFileService.upload(communityUploadFileRes);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "社区文件列表")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public TableDataInfo getCommunityFileList(@RequestBody @Valid CommunityFilePageListRes communityFilePageListRes) {
|
||||||
|
return communityFileService.getCommunityFileList(communityFilePageListRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -31,16 +31,6 @@ public class PublishController {
|
||||||
|
|
||||||
private final PublishService publishService;
|
private final PublishService publishService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取发布列表
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "获取发布列表")
|
|
||||||
@PostMapping("list")
|
|
||||||
public TableDataInfo list(@RequestBody @Valid PublishPageRes publishPageRes) {
|
|
||||||
return publishService.getPublishList(publishPageRes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取发布详情
|
* 获取发布详情
|
||||||
*/
|
*/
|
||||||
|
@ -50,7 +40,7 @@ public class PublishController {
|
||||||
|
|
||||||
PublishVo publishVo = publishService.getDetail(publishDetailRes);
|
PublishVo publishVo = publishService.getDetail(publishDetailRes);
|
||||||
if (Objects.isNull(publishVo)) {
|
if (Objects.isNull(publishVo)) {
|
||||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"获取详情失败");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "获取详情失败");
|
||||||
}
|
}
|
||||||
return R.ok(publishVo);
|
return R.ok(publishVo);
|
||||||
}
|
}
|
||||||
|
@ -65,22 +55,31 @@ public class PublishController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取发布图片列表
|
* 获取发布列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取发布图片列表")
|
@ApiOperation(value = "获取发布列表")
|
||||||
@PostMapping("publishImage")
|
@PostMapping("publishList")
|
||||||
public TableDataInfo publishImage(@RequestBody @Valid PublishPageRes publishPageRes) {
|
public TableDataInfo publishList(@RequestBody @Valid PublishPageRes publishPageRes) {
|
||||||
return publishService.publishImage(publishPageRes);
|
return publishService.publishList(publishPageRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 获取发布文件列表
|
// * 获取发布图片列表
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "获取发布文件列表")
|
// @ApiOperation(value = "获取发布图片列表")
|
||||||
@PostMapping("publishFile")
|
// @PostMapping("publishImage")
|
||||||
public TableDataInfo publishFile(@RequestBody @Valid PublishPageRes publishPageRes) {
|
// public TableDataInfo publishImage(@RequestBody @Valid PublishPageRes publishPageRes) {
|
||||||
return publishService.publishFile(publishPageRes);
|
// return publishService.publishImage(publishPageRes);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取发布文件列表
|
||||||
|
// */
|
||||||
|
// @ApiOperation(value = "获取发布文件列表")
|
||||||
|
// @PostMapping("publishFile")
|
||||||
|
// public TableDataInfo publishFile(@RequestBody @Valid PublishPageRes publishPageRes) {
|
||||||
|
// return publishService.publishFile(publishPageRes);
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
|
@ -92,4 +91,19 @@ public class PublishController {
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 精选/取消精选
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "精选/取消精选")
|
||||||
|
@GetMapping("elite")
|
||||||
|
public R<Object> elitePublish(@NotNull(message = "社区id不能为空")
|
||||||
|
@ApiParam(value = "社区id")
|
||||||
|
@Valid Long communityId,
|
||||||
|
@NotNull(message = "发布文章id不能为空")
|
||||||
|
@ApiParam(value = "发布文章id")
|
||||||
|
@Valid Long publishId) {
|
||||||
|
publishService.elitePublish(communityId, publishId);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,20 +3,17 @@ package com.mcwl.web.controller.memberCenter;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.mcwl.common.core.domain.R;
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.memberCenter.domain.Benefit;
|
import com.mcwl.memberCenter.domain.Benefit;
|
||||||
import com.mcwl.memberCenter.domain.dto.BenefitDto;
|
import com.mcwl.memberCenter.domain.dto.AddBenefitDto;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.EditBenefitDto;
|
||||||
import com.mcwl.memberCenter.domain.vo.BenefitVo;
|
import com.mcwl.memberCenter.domain.vo.BenefitVo;
|
||||||
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
|
||||||
import com.mcwl.memberCenter.service.BenefitService;
|
import com.mcwl.memberCenter.service.BenefitService;
|
||||||
import com.mcwl.memberCenter.service.MemberBenefitService;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
@ -30,6 +27,7 @@ public class BenefitController {
|
||||||
|
|
||||||
private final BenefitService benefitService;
|
private final BenefitService benefitService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权益列表
|
* 权益列表
|
||||||
*/
|
*/
|
||||||
|
@ -37,15 +35,8 @@ public class BenefitController {
|
||||||
@ApiOperation(value = "权益列表")
|
@ApiOperation(value = "权益列表")
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
public R<List<BenefitVo>> list() {
|
public R<List<BenefitVo>> list() {
|
||||||
List<Benefit> benefitList = benefitService.list();
|
|
||||||
List<BenefitVo> benefitVoList = new ArrayList<>();
|
|
||||||
for (Benefit benefit : benefitList) {
|
|
||||||
BenefitVo benefitVo = BeanUtil.copyProperties(benefit, BenefitVo.class);
|
|
||||||
benefitVo.setBenefitType(benefit.getBenefitType().getValue());
|
|
||||||
benefitVoList.add(benefitVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
return R.ok(benefitVoList);
|
return R.ok(benefitService.benefitList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,25 +45,11 @@ public class BenefitController {
|
||||||
// @PreAuthorize("@ss.hasPermi('system:benefit:add')")
|
// @PreAuthorize("@ss.hasPermi('system:benefit:add')")
|
||||||
@ApiOperation(value = "添加权益")
|
@ApiOperation(value = "添加权益")
|
||||||
@PostMapping("add")
|
@PostMapping("add")
|
||||||
public void add(@RequestBody @Valid BenefitDto benefitDto) {
|
public R<Object> add(@RequestBody @Valid AddBenefitDto addBenefitDto) {
|
||||||
|
|
||||||
benefitDto.setId(null);
|
benefitService.addBenefit(addBenefitDto);
|
||||||
Benefit benefit = BeanUtil.copyProperties(benefitDto, Benefit.class);
|
|
||||||
benefitService.save(benefit);
|
|
||||||
|
|
||||||
}
|
return R.ok();
|
||||||
|
|
||||||
/**
|
|
||||||
* 权益详情
|
|
||||||
*/
|
|
||||||
// @PreAuthorize("@ss.hasPermi('system:benefit:query')")
|
|
||||||
@ApiOperation(value = "权益详情")
|
|
||||||
@GetMapping("detail")
|
|
||||||
public R<BenefitVo> detail(Long id) {
|
|
||||||
Benefit benefit = benefitService.getById(id);
|
|
||||||
BenefitVo benefitVo = BeanUtil.copyProperties(benefit, BenefitVo.class);
|
|
||||||
benefitVo.setBenefitType(benefit.getBenefitType().getValue());
|
|
||||||
return R.ok(benefitVo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,20 +58,23 @@ public class BenefitController {
|
||||||
// @PreAuthorize("@ss.hasPermi('system:benefit:edit')")
|
// @PreAuthorize("@ss.hasPermi('system:benefit:edit')")
|
||||||
@ApiOperation(value = "修改权益")
|
@ApiOperation(value = "修改权益")
|
||||||
@PostMapping("update")
|
@PostMapping("update")
|
||||||
public void update(@RequestBody @Valid BenefitDto benefitDto) {
|
public R<Object> update(@RequestBody @Valid EditBenefitDto editBenefitDto) {
|
||||||
|
|
||||||
Benefit benefit = BeanUtil.copyProperties(benefitDto, Benefit.class);
|
Benefit benefit = BeanUtil.copyProperties(editBenefitDto, Benefit.class);
|
||||||
benefitService.updateById(benefit);
|
benefitService.updateById(benefit);
|
||||||
|
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @PreAuthorize("@ss.hasPermi('system:benefit:remove')")
|
// @PreAuthorize("@ss.hasPermi('system:benefit:remove')")
|
||||||
@ApiOperation(value = "删除权益")
|
@ApiOperation(value = "删除权益")
|
||||||
@GetMapping("delete")
|
@GetMapping("delete")
|
||||||
public void delete(@NotNull(message = "id不能为空") Long id) {
|
public R<Object> delete(@NotNull(message = "id不能为空") Long id) {
|
||||||
benefitService.removeById(id);
|
benefitService.removeById(id);
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.mcwl.web.controller.memberCenter;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.memberCenter.domain.Benefit;
|
||||||
|
import com.mcwl.memberCenter.domain.BenefitName;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.AddBenefitDto;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.AddBenefitNameDto;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.EditBenefitDto;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.EditBenefitNameDto;
|
||||||
|
import com.mcwl.memberCenter.domain.vo.BenefitVo;
|
||||||
|
import com.mcwl.memberCenter.service.BenefitNameService;
|
||||||
|
import com.mcwl.memberCenter.service.BenefitService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 权益名称
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("benefitName")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
|
public class BenefitNameController {
|
||||||
|
|
||||||
|
private final BenefitNameService benefitNameService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权益名称列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "权益名称列表")
|
||||||
|
@GetMapping("list")
|
||||||
|
public R<List<BenefitName>> list() {
|
||||||
|
List<BenefitName> list = benefitNameService.list();
|
||||||
|
return R.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "添加权益名称")
|
||||||
|
@PostMapping("add")
|
||||||
|
public R<Object> add(@RequestBody @Valid AddBenefitNameDto addBenefitDto) {
|
||||||
|
BenefitName benefitName = BeanUtil.toBean(addBenefitDto, BenefitName.class);
|
||||||
|
benefitNameService.save(benefitName);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改权益名称")
|
||||||
|
@PostMapping("update")
|
||||||
|
public R<Object> update(@RequestBody @Valid EditBenefitNameDto editBenefitNameDto) {
|
||||||
|
BenefitName benefitName = BeanUtil.toBean(editBenefitNameDto, BenefitName.class);
|
||||||
|
benefitNameService.updateById(benefitName);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除权益名称")
|
||||||
|
@GetMapping("delete")
|
||||||
|
public R<Object> delete(@Valid @NotNull(message = "id不能为空") Long id) {
|
||||||
|
benefitNameService.removeById(id);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -117,13 +117,6 @@ wechat:
|
||||||
# 应用密钥
|
# 应用密钥
|
||||||
secret: 11218568b79e2c5eb10459ef8c0374bd
|
secret: 11218568b79e2c5eb10459ef8c0374bd
|
||||||
|
|
||||||
#公众号配置
|
|
||||||
#wechat:
|
|
||||||
# # 应用ID
|
|
||||||
# appid: wx82d4c3c96f0ffa5b
|
|
||||||
# # 应用密钥
|
|
||||||
# secret: abbabcf1da711a3bbd95387ec83edcac
|
|
||||||
|
|
||||||
# yml版(application.yml)
|
# yml版(application.yml)
|
||||||
aliyun:
|
aliyun:
|
||||||
oss:
|
oss:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
spring:
|
spring:
|
||||||
#mq
|
#mq
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
host: 113.45.74.175
|
host: 113.45.9.111
|
||||||
port: 5672
|
port: 5672
|
||||||
username: guest
|
username: guest
|
||||||
password: guest
|
password: guest
|
||||||
|
@ -23,9 +23,9 @@ spring:
|
||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://113.45.74.175:3306/mcwl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://113.45.9.111:3306/mcwl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
password: Leng1128
|
password: ybl123456@
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
@ -79,9 +79,9 @@ spring:
|
||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: 113.45.74.175
|
host: 113.45.9.111
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6370
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 0
|
database: 0
|
||||||
# 密码
|
# 密码
|
||||||
|
@ -137,12 +137,18 @@ mall:
|
||||||
appId: 2021005119630093
|
appId: 2021005119630093
|
||||||
# 线上应用私钥
|
# 线上应用私钥
|
||||||
privateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCQuhRU5iHoabfzJS40A+moMKzb5rmi5XbL59K98CW65Oq/rnzQnj6sCYggIXOLCLKUykZ1XIVa+4V7bGFkMDF0236ncPumnVY/tfCSebLyKl+up1mGeH4mAR6ily7nXAhRnXL+A0015bpCa5FCg2ReN68MEmquB/mHfeLqJfRupwzDWnIWxYSKkFCJ0i47KTFYhM93LHHQ8GrZNNaeiJ6q59MruQI83z0HCxN/DzK4Z2rBWGilwPuYcSEa0STPXYhz8XMXUX/Mlp7dd5zyWeNaxkNRWlhKHvhLVPGvteaEcchs476DIWLCRVXEC1372wMKNrKblzRp7Wi5+l+W14k5AgMBAAECggEAHahkPjmivTPc5FC8NSCQI01GPxH6/Ky1OXfaMd4ifTgn+vvQzBeBlFOnt53jRZyUq/T/l1FMaqacZfyBwLw3hlDslXeLuksHv6qTEBEsYH/ad7oHmIzcnQEhvAPrMrIjakYvqGoYynC3SKEudUjjqoMSthCYF+2+bsuXUpBQlNQLqcJ03U+YhfLswwVVujKvAujoLRqDAWeaa0k0y/1Ua4fr5GJq5M+P8TTBRgZlSK5A7Ee6yxMUncZ9W3lTqZtyG0OQLbz9gkr0c63KPisigaOx9eKlCPWFWUWo+zGvQMVijHDTeoJ3dqNmsPtiIE3rDt8anx4a1R7YK6MQ520hAQKBgQDPFMNl4fRmLSOLNShJm/0mBMoIjPmS3+tPBtCiG4oH9F8vYMJWDA1Im0FdgRa2HlCv6hpiVvvQt824RaUYa7XR6aefXKVEWddHvl3utnghMohjK8o8fTmIxADtU5Q2OlWmPdp1v7yDg8yE5P1GlY+AZ3oggxXOIRVtQrNeL7E3iQKBgQCy6nEaUQUCDDts4o7Pn+N402g3/T9Vz/5JtKmDI01EndK5l/yE8CdgGwdiwN1k3la/Nv8P5kaaX2qVcCGoOIQmMNGOxuNfkKCi+bJKdxmFOI4E3iVYT2H6x27QJwNB6bik1i6b2OWT7ckxeB6xMjefNp1u8Qif+vab60OQZSqoMQKBgESRF3Hwsz/xykcZvtFAuT2RcGQMacbcJcnw87v5ambf33SMkUx0iSF1ZttTFvYOa6ET3tCZBKBDe/Z7+QJxB68NstbtkjtjlAjJW8ji2jwDw20y3q/QtvA2Fih++CBMiHeXG3LJnd3eEiYevE5Wz0ExAhspzFqIUdPvtfyFxiQhAoGBAKgc+iGMN3RxIfVx/FbDGe6SVr8lSrnLMlj3VMBQD26GDVcupKwVLCp1uz7jkiQRdtk9R/UcnwK23WOFdVqnoCRygrXx0/wb3ZTFou2tc2Fmfqu8QML19E67zjfwMHNitYjNaAYwi6ewKvg8sjo1wWXs34k7GquYGNjw+w9Wv/pBAoGAUlVHfZ4RncAiiH/x3EDgqmmVikFpLoM2xXxM16nplrjdBE6IzkpgWb/x2ZI6JCMDyoV2kvF6owW2+QEQ81MrHQMtBRpAvd8nI03gXA5VF3uwp4UjfGpoIAGDBrqQv9DM8vx6C6VJNTT5esZWZSw/+PZ4D19l0/n7gICGx3ugw0Q=
|
privateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCQuhRU5iHoabfzJS40A+moMKzb5rmi5XbL59K98CW65Oq/rnzQnj6sCYggIXOLCLKUykZ1XIVa+4V7bGFkMDF0236ncPumnVY/tfCSebLyKl+up1mGeH4mAR6ily7nXAhRnXL+A0015bpCa5FCg2ReN68MEmquB/mHfeLqJfRupwzDWnIWxYSKkFCJ0i47KTFYhM93LHHQ8GrZNNaeiJ6q59MruQI83z0HCxN/DzK4Z2rBWGilwPuYcSEa0STPXYhz8XMXUX/Mlp7dd5zyWeNaxkNRWlhKHvhLVPGvteaEcchs476DIWLCRVXEC1372wMKNrKblzRp7Wi5+l+W14k5AgMBAAECggEAHahkPjmivTPc5FC8NSCQI01GPxH6/Ky1OXfaMd4ifTgn+vvQzBeBlFOnt53jRZyUq/T/l1FMaqacZfyBwLw3hlDslXeLuksHv6qTEBEsYH/ad7oHmIzcnQEhvAPrMrIjakYvqGoYynC3SKEudUjjqoMSthCYF+2+bsuXUpBQlNQLqcJ03U+YhfLswwVVujKvAujoLRqDAWeaa0k0y/1Ua4fr5GJq5M+P8TTBRgZlSK5A7Ee6yxMUncZ9W3lTqZtyG0OQLbz9gkr0c63KPisigaOx9eKlCPWFWUWo+zGvQMVijHDTeoJ3dqNmsPtiIE3rDt8anx4a1R7YK6MQ520hAQKBgQDPFMNl4fRmLSOLNShJm/0mBMoIjPmS3+tPBtCiG4oH9F8vYMJWDA1Im0FdgRa2HlCv6hpiVvvQt824RaUYa7XR6aefXKVEWddHvl3utnghMohjK8o8fTmIxADtU5Q2OlWmPdp1v7yDg8yE5P1GlY+AZ3oggxXOIRVtQrNeL7E3iQKBgQCy6nEaUQUCDDts4o7Pn+N402g3/T9Vz/5JtKmDI01EndK5l/yE8CdgGwdiwN1k3la/Nv8P5kaaX2qVcCGoOIQmMNGOxuNfkKCi+bJKdxmFOI4E3iVYT2H6x27QJwNB6bik1i6b2OWT7ckxeB6xMjefNp1u8Qif+vab60OQZSqoMQKBgESRF3Hwsz/xykcZvtFAuT2RcGQMacbcJcnw87v5ambf33SMkUx0iSF1ZttTFvYOa6ET3tCZBKBDe/Z7+QJxB68NstbtkjtjlAjJW8ji2jwDw20y3q/QtvA2Fih++CBMiHeXG3LJnd3eEiYevE5Wz0ExAhspzFqIUdPvtfyFxiQhAoGBAKgc+iGMN3RxIfVx/FbDGe6SVr8lSrnLMlj3VMBQD26GDVcupKwVLCp1uz7jkiQRdtk9R/UcnwK23WOFdVqnoCRygrXx0/wb3ZTFou2tc2Fmfqu8QML19E67zjfwMHNitYjNaAYwi6ewKvg8sjo1wWXs34k7GquYGNjw+w9Wv/pBAoGAUlVHfZ4RncAiiH/x3EDgqmmVikFpLoM2xXxM16nplrjdBE6IzkpgWb/x2ZI6JCMDyoV2kvF6owW2+QEQ81MrHQMtBRpAvd8nI03gXA5VF3uwp4UjfGpoIAGDBrqQv9DM8vx6C6VJNTT5esZWZSw/+PZ4D19l0/n7gICGx3ugw0Q=
|
||||||
# 线上应用公钥证书
|
# # 线上应用公钥证书
|
||||||
appCertPath: /opt/cert/pro/appCertPublicKey_2021005119630093.crt
|
# appCertPath: /opt/cert/pro/appCertPublicKey_2021005119630093.crt
|
||||||
# 线上支付宝公钥证书路径
|
# # 线上支付宝公钥证书路径
|
||||||
alipayCertPath: /opt/cert/pro/alipayCertPublicKey_RSA2.crt
|
# alipayCertPath: /opt/cert/pro/alipayCertPublicKey_RSA2.crt
|
||||||
# 线上支付宝根证书路径
|
# # 线上支付宝根证书路径
|
||||||
alipayRootCertPath: /opt/cert/pro/alipayRootCert.crt
|
# alipayRootCertPath: /opt/cert/pro/alipayRootCert.crt
|
||||||
|
# 沙箱应用公钥证书
|
||||||
|
appCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayPublicCert.crt
|
||||||
|
# 沙箱支付宝公钥证书路径
|
||||||
|
alipayCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayPublicCert.crt
|
||||||
|
# 沙箱支付宝根证书路径
|
||||||
|
alipayRootCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayRootCert.crt
|
||||||
notifyUrl: https://36072a51.r27.cpolar.top/ali/pay/notify
|
notifyUrl: https://36072a51.r27.cpolar.top/ali/pay/notify
|
||||||
# 线上支付宝网关
|
# 线上支付宝网关
|
||||||
gatewayUrl: https://openapi.alipay.com/gateway.do
|
gatewayUrl: https://openapi.alipay.com/gateway.do
|
||||||
|
@ -169,3 +175,9 @@ mqtt:
|
||||||
max-reconnect-attempts: 5
|
max-reconnect-attempts: 5
|
||||||
clean-session: true
|
clean-session: true
|
||||||
|
|
||||||
|
#用户头像与背景
|
||||||
|
mcwl:
|
||||||
|
encryptUrl: http://113.45.9.111:9090/encryptAndUpload
|
||||||
|
user:
|
||||||
|
avatar: https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/MARCH/10/7/53/3f5cc1d7-b062-4a22-9f7e-d442bc6dcf42.png
|
||||||
|
backgroundImg: https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/MARCH/10/8/2/c8387681-8138-4a29-a1c9-4a143da34c5a.png
|
||||||
|
|
|
@ -52,7 +52,7 @@ spring:
|
||||||
# 国际化资源文件路径
|
# 国际化资源文件路径
|
||||||
basename: i18n/messages
|
basename: i18n/messages
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: druid
|
||||||
# 文件上传
|
# 文件上传
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.mcwl.communityCenter.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.mcwl.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("cc_community_file")
|
||||||
|
@Builder
|
||||||
|
public class CommunityFile extends BaseEntity {
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区id
|
||||||
|
*/
|
||||||
|
private Long communityId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件地址
|
||||||
|
*/
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名
|
||||||
|
*/
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件对象key
|
||||||
|
*/
|
||||||
|
private String objectKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件大小
|
||||||
|
*/
|
||||||
|
private Long fileSize;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.mcwl.communityCenter.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.mcwl.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("cc_community_file_log")
|
||||||
|
public class CommunityFileLog extends BaseEntity {
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区id
|
||||||
|
*/
|
||||||
|
private Long communityId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件id
|
||||||
|
*/
|
||||||
|
private Long communityFileId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载用户id
|
||||||
|
*/
|
||||||
|
private Long downloadUserId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.mcwl.communityCenter.domain.dto;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区请求参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "社区请求参数")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class CommunityFilePageListRes extends PageDomain {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "租户id", required = true)
|
||||||
|
@NotNull(message = "租户id不能为空")
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "社区id", required = true)
|
||||||
|
@NotNull(message = "社区id不能为空")
|
||||||
|
private Long communityId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询条件
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "查询条件")
|
||||||
|
private String search;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.mcwl.communityCenter.domain.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区请求参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "社区请求参数")
|
||||||
|
public class CommunityUploadFileRes {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "租户id", required = true)
|
||||||
|
@NotNull(message = "租户id不能为空")
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "社区id", required = true)
|
||||||
|
@NotNull(message = "社区id不能为空")
|
||||||
|
private Long communityId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "文件", required = true)
|
||||||
|
@NotNull(message = "文件不能为空")
|
||||||
|
private MultipartFile file;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -22,4 +22,8 @@ public class PublishPageRes extends PageDomain {
|
||||||
@ApiParam(value = "租户id", required = true)
|
@ApiParam(value = "租户id", required = true)
|
||||||
private Long tenantId;
|
private Long tenantId;
|
||||||
|
|
||||||
|
@NotNull(message = "类型不能为空")
|
||||||
|
@ApiParam(value = "类型 0只看星主 1精选 2问答", required = true)
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.mcwl.communityCenter.domain.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件返回数据
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "社区文件返回数据")
|
||||||
|
public class CommunityFileVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "社区文件id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "社区id")
|
||||||
|
private Long communityId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件路径
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "文件路径")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "文件名称")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件大小
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "文件大小")
|
||||||
|
private Long fileSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "上传人")
|
||||||
|
private String uploadUserName;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载记录
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "用户下载记录")
|
||||||
|
private DownloadFileUserVo downloadFileUser;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "上传时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.mcwl.communityCenter.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户下载记录
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "用户下载记录")
|
||||||
|
public class DownloadFileUserVo {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户头像")
|
||||||
|
private List<String> avatarList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "下载用户数")
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
}
|
|
@ -86,6 +86,11 @@ public class PublishVo {
|
||||||
@ApiModelProperty(value = "评论数")
|
@ApiModelProperty(value = "评论数")
|
||||||
private Integer commentNum;
|
private Integer commentNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 精选
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "精选")
|
||||||
|
private Integer isElite;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.mcwl.communityCenter.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.mcwl.communityCenter.domain.CommunityFile;
|
||||||
|
import com.mcwl.communityCenter.domain.CommunityFileLog;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CommunityFileLogMapper extends BaseMapper<CommunityFileLog> {
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
List<String> getUserAvatarList(@Param("tenantId")
|
||||||
|
Long tenantId,
|
||||||
|
@Param("communityId")
|
||||||
|
Long communityId,
|
||||||
|
@Param("communityFileId")
|
||||||
|
Long communityFileId);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
Integer getDownloadCount(Long tenantId, Long communityId, Long communityFileId);
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.mcwl.communityCenter.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.mcwl.communityCenter.domain.Community;
|
||||||
|
import com.mcwl.communityCenter.domain.CommunityFile;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.CommunityFilePageListRes;
|
||||||
|
import com.mcwl.communityCenter.domain.vo.CommunityFileVo;
|
||||||
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CommunityFileMapper extends BaseMapper<CommunityFile> {
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
List<CommunityFileVo> getCommunityFileList(Page<CommunityFile> page, @Param("communityFilePageListRes") CommunityFilePageListRes communityFilePageListRes);
|
||||||
|
}
|
|
@ -5,11 +5,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.mcwl.communityCenter.domain.Publish;
|
import com.mcwl.communityCenter.domain.Publish;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.PublishPageRes;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.security.core.parameters.P;
|
import org.springframework.security.core.parameters.P;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface PublishMapper extends BaseMapper<Publish> {
|
public interface PublishMapper extends BaseMapper<Publish> {
|
||||||
|
@ -27,16 +29,20 @@ public interface PublishMapper extends BaseMapper<Publish> {
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
Page<Publish> selectByTenantIdAndCommunityIdAndNotNullImagePage(Page<Publish> page,
|
Page<Publish> selectByTenantIdAndCommunityIdAndNotNullImagePage(Page<Publish> page,
|
||||||
@Param("tenantId")
|
|
||||||
Long tenantId,
|
|
||||||
@Param("communityId")
|
|
||||||
Long communityId);
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
Page<Publish> selectByTenantIdAndCommunityIdAndNotNullFilePage(Page<Publish> page,
|
|
||||||
@Param("tenantId")
|
@Param("tenantId")
|
||||||
Long tenantId,
|
Long tenantId,
|
||||||
@Param("communityId")
|
@Param("communityId")
|
||||||
Long communityId);
|
Long communityId);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
Page<Publish> selectByTenantIdAndCommunityIdAndNotNullFilePage(Page<Publish> page,
|
||||||
|
@Param("tenantId")
|
||||||
|
Long tenantId,
|
||||||
|
@Param("communityId")
|
||||||
|
Long communityId);
|
||||||
|
|
||||||
|
void elitePublish(@Param("communityId") Long communityId, @Param("publishId") Long publishId);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
List<Publish> publishList(Page<Publish> page,@Param("publishPageRes") PublishPageRes publishPageRes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.mcwl.communityCenter.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.mcwl.communityCenter.domain.CommunityFile;
|
||||||
|
import com.mcwl.communityCenter.domain.CommunityFileLog;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CommunityFileLogService extends IService<CommunityFileLog> {
|
||||||
|
|
||||||
|
List<String> getUserAvatarList(Long tenantId, Long communityId, Long communityFileId);
|
||||||
|
|
||||||
|
Integer getDownloadCount(Long tenantId, Long communityId, Long communityFileId);
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.mcwl.communityCenter.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.communityCenter.domain.CommunityFile;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.*;
|
||||||
|
|
||||||
|
public interface CommunityFileService extends IService<CommunityFile> {
|
||||||
|
|
||||||
|
void upload(CommunityUploadFileRes communityUploadFileRes);
|
||||||
|
|
||||||
|
TableDataInfo getCommunityFileList(CommunityFilePageListRes communityFilePageListRes);
|
||||||
|
}
|
|
@ -31,4 +31,8 @@ public interface PublishService extends IService<Publish> {
|
||||||
TableDataInfo publishImage(@Valid PublishPageRes publishPageRes);
|
TableDataInfo publishImage(@Valid PublishPageRes publishPageRes);
|
||||||
|
|
||||||
TableDataInfo publishFile(@Valid PublishPageRes publishPageRes);
|
TableDataInfo publishFile(@Valid PublishPageRes publishPageRes);
|
||||||
|
|
||||||
|
void elitePublish(Long communityId, Long publishId);
|
||||||
|
|
||||||
|
TableDataInfo publishList(PublishPageRes publishPageRes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.mcwl.communityCenter.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.mcwl.communityCenter.domain.CommunityFile;
|
||||||
|
import com.mcwl.communityCenter.domain.CommunityFileLog;
|
||||||
|
import com.mcwl.communityCenter.mapper.CommunityFileLogMapper;
|
||||||
|
import com.mcwl.communityCenter.mapper.CommunityFileMapper;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityFileLogService;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityFileService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CommunityFileLogServiceImpl extends ServiceImpl<CommunityFileLogMapper, CommunityFileLog> implements CommunityFileLogService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getUserAvatarList(Long tenantId, Long communityId, Long communityFileId) {
|
||||||
|
return baseMapper.getUserAvatarList(tenantId, communityId, communityFileId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getDownloadCount(Long tenantId, Long communityId, Long communityFileId) {
|
||||||
|
return baseMapper.getDownloadCount(tenantId, communityId, communityFileId);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.mcwl.communityCenter.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
|
import com.mcwl.common.utils.obs.ObsUtils;
|
||||||
|
import com.mcwl.communityCenter.domain.CommunityFile;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.*;
|
||||||
|
import com.mcwl.communityCenter.domain.vo.CommunityFileVo;
|
||||||
|
import com.mcwl.communityCenter.domain.vo.DownloadFileUserVo;
|
||||||
|
import com.mcwl.communityCenter.mapper.CommunityFileMapper;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityFileLogService;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityFileService;
|
||||||
|
import com.mcwl.system.service.ISysUserService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CommunityFileServiceImpl extends ServiceImpl<CommunityFileMapper, CommunityFile> implements CommunityFileService {
|
||||||
|
|
||||||
|
private final ObsUtils obsUtils;
|
||||||
|
|
||||||
|
private final ISysUserService userService;
|
||||||
|
|
||||||
|
private final CommunityFileLogService communityFileLogService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void upload(CommunityUploadFileRes communityUploadFileRes) {
|
||||||
|
Long tenantId = communityUploadFileRes.getTenantId();
|
||||||
|
Long communityId = communityUploadFileRes.getCommunityId();
|
||||||
|
MultipartFile file = communityUploadFileRes.getFile();
|
||||||
|
Map<String, String> map = obsUtils.uploadFile(file);
|
||||||
|
String filename = file.getOriginalFilename();
|
||||||
|
long fileSize = file.getSize();
|
||||||
|
|
||||||
|
CommunityFile communityFile = CommunityFile.builder()
|
||||||
|
.tenantId(tenantId)
|
||||||
|
.communityId(communityId)
|
||||||
|
.userId(SecurityUtils.getUserId())
|
||||||
|
.fileUrl(map.get("path"))
|
||||||
|
.objectKey(map.get("objectKey"))
|
||||||
|
.fileName(filename)
|
||||||
|
.fileSize(fileSize)
|
||||||
|
.build();
|
||||||
|
baseMapper.insert(communityFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo getCommunityFileList(CommunityFilePageListRes communityFilePageListRes) {
|
||||||
|
Page<CommunityFile> page = new Page<>(communityFilePageListRes.getPageNum(), communityFilePageListRes.getPageSize());
|
||||||
|
List<CommunityFileVo> communityFileList = baseMapper.getCommunityFileList(page, communityFilePageListRes);
|
||||||
|
for (CommunityFileVo communityFileVo : communityFileList) {
|
||||||
|
DownloadFileUserVo downloadFileUserVo = new DownloadFileUserVo();
|
||||||
|
|
||||||
|
List<String> avatarList = communityFileLogService.getUserAvatarList(communityFileVo.getTenantId(),
|
||||||
|
communityFileVo.getCommunityId(),
|
||||||
|
communityFileVo.getId());
|
||||||
|
Integer count = communityFileLogService.getDownloadCount(communityFileVo.getTenantId(),
|
||||||
|
communityFileVo.getCommunityId(),
|
||||||
|
communityFileVo.getId());
|
||||||
|
|
||||||
|
downloadFileUserVo.setAvatarList(avatarList);
|
||||||
|
downloadFileUserVo.setCount(count);
|
||||||
|
|
||||||
|
|
||||||
|
communityFileVo.setDownloadFileUser(downloadFileUserVo);
|
||||||
|
}
|
||||||
|
// 封装返回
|
||||||
|
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||||
|
tableDataInfo.setRows(communityFileList);
|
||||||
|
tableDataInfo.setTotal(page.getTotal());
|
||||||
|
tableDataInfo.setCode(HttpStatus.SUCCESS);
|
||||||
|
tableDataInfo.setMsg("查询成功");
|
||||||
|
return tableDataInfo;
|
||||||
|
}
|
||||||
|
}
|
|
@ -186,16 +186,28 @@ public class PublishServiceImpl extends ServiceImpl<PublishMapper, Publish> impl
|
||||||
return tableDataInfo;
|
return tableDataInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void elitePublish(Long communityId, Long publishId) {
|
||||||
|
baseMapper.elitePublish(communityId, publishId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo publishList(PublishPageRes publishPageRes) {
|
||||||
|
Page<Publish> page = this.initPage(publishPageRes);
|
||||||
|
List<Publish> publishList = baseMapper.publishList(page, publishPageRes);
|
||||||
|
|
||||||
|
// 封装返回
|
||||||
|
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||||
|
tableDataInfo.setRows(publishList);
|
||||||
|
tableDataInfo.setTotal(page.getTotal());
|
||||||
|
tableDataInfo.setCode(HttpStatus.SUCCESS);
|
||||||
|
tableDataInfo.setMsg("查询成功");
|
||||||
|
return tableDataInfo;
|
||||||
|
}
|
||||||
|
|
||||||
private Page<Publish> initPage(PublishPageRes publishPageRes) {
|
private Page<Publish> initPage(PublishPageRes publishPageRes) {
|
||||||
Page<Publish> page = new Page<>(publishPageRes.getPageNum(), publishPageRes.getPageSize());
|
Page<Publish> page = new Page<>(publishPageRes.getPageNum(), publishPageRes.getPageSize());
|
||||||
|
page.addOrder(new OrderItem("create_time", false));
|
||||||
if (StringUtils.isBlank(publishPageRes.getOrderByColumn())) {
|
|
||||||
publishPageRes.setOrderByColumn("create_time");
|
|
||||||
}
|
|
||||||
boolean isAsc = Objects.equals(publishPageRes.getIsAsc(), "asc");
|
|
||||||
OrderItem orderItem = new OrderItem(publishPageRes.getOrderByColumn(), isAsc);
|
|
||||||
|
|
||||||
page.addOrder(orderItem);
|
|
||||||
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,15 +72,15 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
||||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"租户或社区不存在");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"租户或社区不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (Objects.equals(tenantId, userId)) {
|
if (Objects.equals(tenantId, userId)) {
|
||||||
// return AjaxResult.error("您不能提问自己的问题");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"您不能提问自己的问题");
|
||||||
// }
|
}
|
||||||
|
|
||||||
//提问人(userId)是否在社区中
|
//提问人(userId)是否在社区中
|
||||||
// Invite invite = inviteMapper.selectByTenantIdAndCommunityIdAndInviteeUserId(tenantId, communityId, userId);
|
Invite invite = inviteMapper.selectByTenantIdAndCommunityIdAndInviteeUserId(tenantId, communityId, userId);
|
||||||
// if (Objects.isNull(invite)) {
|
if (Objects.isNull(invite)) {
|
||||||
// return AjaxResult.error("您不是该社区成员,不能提问");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"您不是该社区成员,不能提问");
|
||||||
// }
|
}
|
||||||
|
|
||||||
Question question = new Question();
|
Question question = new Question();
|
||||||
BeanUtil.copyProperties(questionRes, question);
|
BeanUtil.copyProperties(questionRes, question);
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.mcwl.communityCenter.mapper.CommunityFileLogMapper">
|
||||||
|
|
||||||
|
<select id="getUserAvatarList" resultType="java.lang.String">
|
||||||
|
select su.avatar
|
||||||
|
from cc_community_file_log cfl
|
||||||
|
left join sys_user su on cfl.download_user_id = su.user_id
|
||||||
|
where tenant_id = #{tenantId}
|
||||||
|
and community_id = #{communityId}
|
||||||
|
and community_file_id = #{communityFileId}
|
||||||
|
order by cfl.create_time desc
|
||||||
|
</select>
|
||||||
|
<select id="getDownloadCount" resultType="java.lang.Integer">
|
||||||
|
select count(*)
|
||||||
|
from cc_community_file_log
|
||||||
|
where tenant_id = #{tenantId}
|
||||||
|
and community_id = #{communityId}
|
||||||
|
and community_file_id = #{communityFileId}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.mcwl.communityCenter.mapper.CommunityFileMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getCommunityFileList" resultType="com.mcwl.communityCenter.domain.vo.CommunityFileVo">
|
||||||
|
select cf.*, su.nick_name as upload_user_name
|
||||||
|
from cc_community_file cf left join sys_user su on cf.user_id = su.user_id
|
||||||
|
where cf.del_flag = '0'
|
||||||
|
and tenant_id = #{communityFilePageListRes.tenantId}
|
||||||
|
and community_id = #{communityFilePageListRes.communityId}
|
||||||
|
<if test="communityFilePageListRes.search != null and communityFilePageListRes.search != ''">
|
||||||
|
and (cf.file_name like concat('%', #{communityFilePageListRes.search}, '%')
|
||||||
|
or su.nick_name like concat('%', #{communityFilePageListRes.search}, '%'))
|
||||||
|
</if>
|
||||||
|
order by cf.create_time desc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -3,6 +3,12 @@
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.mcwl.communityCenter.mapper.PublishMapper">
|
<mapper namespace="com.mcwl.communityCenter.mapper.PublishMapper">
|
||||||
|
<update id="elitePublish">
|
||||||
|
update cc_publish
|
||||||
|
set is_elite = !is_elite
|
||||||
|
where community_id = #{communityId}
|
||||||
|
and id = #{publishId}
|
||||||
|
</update>
|
||||||
<select id="selectByTenantIdAndCommunityIdPage" resultType="com.mcwl.communityCenter.domain.Publish">
|
<select id="selectByTenantIdAndCommunityIdPage" resultType="com.mcwl.communityCenter.domain.Publish">
|
||||||
select id,
|
select id,
|
||||||
tenant_id,
|
tenant_id,
|
||||||
|
@ -84,4 +90,19 @@
|
||||||
and del_flag = '0'
|
and del_flag = '0'
|
||||||
and file_url is not null
|
and file_url is not null
|
||||||
</select>
|
</select>
|
||||||
|
<select id="publishList" resultType="com.mcwl.communityCenter.domain.Publish">
|
||||||
|
select *
|
||||||
|
from cc_publish
|
||||||
|
<where>
|
||||||
|
and tenant_id = #{publishPageRes.tenantId}
|
||||||
|
and community_id = #{publishPageRes.communityId}
|
||||||
|
and del_flag = '0'
|
||||||
|
<if test="publishPageRes.type == 0">
|
||||||
|
and user_id = #{publishPageRes.tenantId}
|
||||||
|
</if>
|
||||||
|
<if test="publishPageRes.type == 1">
|
||||||
|
and is_elite = 1
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -157,7 +157,7 @@ public class SecurityConfig {
|
||||||
"/attention/selectToAttention",
|
"/attention/selectToAttention",
|
||||||
"/WorkFlowVersion/selectVersionByWorkId",
|
"/WorkFlowVersion/selectVersionByWorkId",
|
||||||
"/memberLevel/list",
|
"/memberLevel/list",
|
||||||
"/memberLevel/getMemberBenefitList",
|
"/memberBenefit/getMemberBenefitList",
|
||||||
"/attention/selectAttentionList",
|
"/attention/selectAttentionList",
|
||||||
"/downFile/down",
|
"/downFile/down",
|
||||||
"/personalCenter/selectByUserIdModel",
|
"/personalCenter/selectByUserIdModel",
|
||||||
|
|
|
@ -18,9 +18,9 @@ public class Benefit extends BaseEntity {
|
||||||
@TableId
|
@TableId
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 权益名称
|
* 权益名称Id
|
||||||
*/
|
*/
|
||||||
private String benefitName;
|
private String benefitNameId;
|
||||||
/**
|
/**
|
||||||
* 权益描述
|
* 权益描述
|
||||||
*/
|
*/
|
||||||
|
@ -34,9 +34,9 @@ public class Benefit extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Double benefitDiscount;
|
private Double benefitDiscount;
|
||||||
/**
|
/**
|
||||||
* 权益排序
|
* 单位
|
||||||
*/
|
*/
|
||||||
private Integer benefitOrder;
|
private String benefitUnit;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.mcwl.memberCenter.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.mcwl.common.core.domain.BaseEntity;
|
||||||
|
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权益表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("mem_benefit_name")
|
||||||
|
public class BenefitName extends BaseEntity {
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 权益名称
|
||||||
|
*/
|
||||||
|
private String benefitName;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer benefitOrder;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,13 +1,9 @@
|
||||||
package com.mcwl.memberCenter.domain.dto;
|
package com.mcwl.memberCenter.domain.dto;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.mcwl.common.core.domain.BaseEntity;
|
|
||||||
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
@ -17,15 +13,13 @@ import javax.validation.constraints.NotNull;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ApiModel(description = "权益")
|
@ApiModel(description = "权益")
|
||||||
public class BenefitDto {
|
public class AddBenefitDto {
|
||||||
|
|
||||||
private Long id;
|
|
||||||
/**
|
/**
|
||||||
* 权益名称
|
* 权益名称
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "权益名称", required = true)
|
@ApiModelProperty(value = "权益名称id", required = true)
|
||||||
@NotBlank(message = "权益名称不能为空")
|
@NotNull(message = "权益名称id不能为空")
|
||||||
private String benefitName;
|
private Long benefitNameId;
|
||||||
/**
|
/**
|
||||||
* 权益描述
|
* 权益描述
|
||||||
*/
|
*/
|
||||||
|
@ -44,10 +38,11 @@ public class BenefitDto {
|
||||||
@NotNull(message = "权益折扣不能为空")
|
@NotNull(message = "权益折扣不能为空")
|
||||||
private Double benefitDiscount;
|
private Double benefitDiscount;
|
||||||
/**
|
/**
|
||||||
* 权益排序
|
* 单位
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "权益排序")
|
@NotBlank(message = "单位不能为空")
|
||||||
private Integer benefitOrder;
|
@ApiModelProperty(value = "单位")
|
||||||
|
private String benefitUnit;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.mcwl.memberCenter.domain.dto;
|
||||||
|
|
||||||
|
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权益
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(description = "权益名称")
|
||||||
|
public class AddBenefitNameDto {
|
||||||
|
/**
|
||||||
|
* 权益名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "权益名称", required = true)
|
||||||
|
@NotNull(message = "权益名称不能为空")
|
||||||
|
private String benefitName;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "排序不能为空")
|
||||||
|
@ApiModelProperty(value = "排序", required = true)
|
||||||
|
private Integer benefitOrder;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.mcwl.memberCenter.domain.dto;
|
||||||
|
|
||||||
|
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权益
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(description = "权益")
|
||||||
|
public class EditBenefitDto {
|
||||||
|
/**
|
||||||
|
* 权益id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "权益id", required = true)
|
||||||
|
@NotNull(message = "权益id不能为空")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 权益描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "权益描述")
|
||||||
|
private String benefitDesc;
|
||||||
|
/**
|
||||||
|
* 权益类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "权益类型", required = true)
|
||||||
|
@NotNull(message = "权益类型不能为空")
|
||||||
|
private MemberBenefitTypeEnum benefitType;
|
||||||
|
/**
|
||||||
|
* 权益折扣,当权益类型为折扣时,记录折扣具体数值
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "权益折扣,当权益类型为折扣时,记录折扣具体数值", required = true)
|
||||||
|
@NotNull(message = "权益折扣不能为空")
|
||||||
|
private Double benefitDiscount;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "单位不能为空")
|
||||||
|
@ApiModelProperty(value = "单位")
|
||||||
|
private String benefitUnit;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.mcwl.memberCenter.domain.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权益
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(description = "权益名称")
|
||||||
|
public class EditBenefitNameDto {
|
||||||
|
@ApiModelProperty(value = "id", required = true)
|
||||||
|
@NotNull(message = "id不能为空")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 权益名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "权益名称", required = true)
|
||||||
|
@NotNull(message = "权益名称不能为空")
|
||||||
|
private String benefitName;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "排序不能为空")
|
||||||
|
@ApiModelProperty(value = "排序", required = true)
|
||||||
|
private Integer benefitOrder;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.mcwl.memberCenter.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权益详情vo
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "权益详情vo")
|
||||||
|
public class BenefitInfoVo {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 权益描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "权益描述")
|
||||||
|
private String benefitDesc;
|
||||||
|
/**
|
||||||
|
* 权益类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "权益类型")
|
||||||
|
private String benefitType;
|
||||||
|
/**
|
||||||
|
* 权益折扣,当权益类型为折扣时,记录折扣具体数值
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "权益折扣,当权益类型为折扣时,记录折扣具体数值")
|
||||||
|
private Double benefitDiscount;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "单位")
|
||||||
|
private String benefitUnit;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -4,36 +4,35 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.mcwl.common.core.domain.BaseEntity;
|
import com.mcwl.common.core.domain.BaseEntity;
|
||||||
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权益vo
|
* 权益vo
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@ApiModel(value = "权益列表")
|
||||||
public class BenefitVo {
|
public class BenefitVo {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 权益名称
|
* 权益名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "权益名称")
|
||||||
private String benefitName;
|
private String benefitName;
|
||||||
/**
|
|
||||||
* 权益描述
|
|
||||||
*/
|
|
||||||
private String benefitDesc;
|
|
||||||
/**
|
|
||||||
* 权益类型
|
|
||||||
*/
|
|
||||||
private String benefitType;
|
|
||||||
/**
|
|
||||||
* 权益折扣,当权益类型为折扣时,记录折扣具体数值
|
|
||||||
*/
|
|
||||||
private Double benefitDiscount;
|
|
||||||
/**
|
/**
|
||||||
* 权益排序
|
* 权益排序
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "权益排序")
|
||||||
private Integer benefitOrder;
|
private Integer benefitOrder;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "权益详情")
|
||||||
|
private List<BenefitInfoVo> benefitInfoList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.mcwl.memberCenter.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.mcwl.memberCenter.domain.Benefit;
|
||||||
|
import com.mcwl.memberCenter.domain.BenefitName;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权益 Mapper
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BenefitNameMapper extends BaseMapper<BenefitName> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.mcwl.memberCenter.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.mcwl.memberCenter.domain.Benefit;
|
||||||
|
import com.mcwl.memberCenter.domain.BenefitName;
|
||||||
|
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface BenefitNameService extends IService<BenefitName> {
|
||||||
|
|
||||||
|
}
|
|
@ -2,6 +2,8 @@ package com.mcwl.memberCenter.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.mcwl.memberCenter.domain.Benefit;
|
import com.mcwl.memberCenter.domain.Benefit;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.AddBenefitDto;
|
||||||
|
import com.mcwl.memberCenter.domain.vo.BenefitVo;
|
||||||
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -17,4 +19,8 @@ public interface BenefitService extends IService<Benefit> {
|
||||||
List<Benefit> getNotBenefitList(Long memberLevelId);
|
List<Benefit> getNotBenefitList(Long memberLevelId);
|
||||||
|
|
||||||
Benefit getBenefitByType(Long memberLevelId, MemberBenefitTypeEnum memberBenefitTypeEnum);
|
Benefit getBenefitByType(Long memberLevelId, MemberBenefitTypeEnum memberBenefitTypeEnum);
|
||||||
|
|
||||||
|
void addBenefit(AddBenefitDto addBenefitDto);
|
||||||
|
|
||||||
|
List<BenefitVo> benefitList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.mcwl.memberCenter.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.mcwl.memberCenter.domain.Benefit;
|
||||||
|
import com.mcwl.memberCenter.domain.BenefitName;
|
||||||
|
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
||||||
|
import com.mcwl.memberCenter.mapper.BenefitMapper;
|
||||||
|
import com.mcwl.memberCenter.mapper.BenefitNameMapper;
|
||||||
|
import com.mcwl.memberCenter.service.BenefitNameService;
|
||||||
|
import com.mcwl.memberCenter.service.BenefitService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BenefitNameServiceImpl extends ServiceImpl<BenefitNameMapper, BenefitName> implements BenefitNameService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,28 +1,29 @@
|
||||||
package com.mcwl.memberCenter.service.impl;
|
package com.mcwl.memberCenter.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.mcwl.memberCenter.domain.Benefit;
|
import com.mcwl.memberCenter.domain.Benefit;
|
||||||
import com.mcwl.memberCenter.domain.MemberBenefit;
|
import com.mcwl.memberCenter.domain.BenefitName;
|
||||||
import com.mcwl.memberCenter.domain.MemberLevel;
|
import com.mcwl.memberCenter.domain.dto.AddBenefitDto;
|
||||||
import com.mcwl.memberCenter.domain.vo.MemberBenefitVO;
|
import com.mcwl.memberCenter.domain.vo.BenefitInfoVo;
|
||||||
|
import com.mcwl.memberCenter.domain.vo.BenefitVo;
|
||||||
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
||||||
import com.mcwl.memberCenter.mapper.BenefitMapper;
|
import com.mcwl.memberCenter.mapper.BenefitMapper;
|
||||||
import com.mcwl.memberCenter.mapper.MemberBenefitMapper;
|
import com.mcwl.memberCenter.service.BenefitNameService;
|
||||||
import com.mcwl.memberCenter.service.BenefitService;
|
import com.mcwl.memberCenter.service.BenefitService;
|
||||||
import com.mcwl.memberCenter.service.MemberBenefitService;
|
|
||||||
import com.mcwl.memberCenter.service.MemberLevelService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class BenefitServiceImpl extends ServiceImpl<BenefitMapper, Benefit> implements BenefitService {
|
public class BenefitServiceImpl extends ServiceImpl<BenefitMapper, Benefit> implements BenefitService {
|
||||||
|
|
||||||
|
private final BenefitNameService benefitNameService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Benefit> getBenefitList() {
|
public List<Benefit> getBenefitList() {
|
||||||
return baseMapper.getBenefitList();
|
return baseMapper.getBenefitList();
|
||||||
|
@ -42,4 +43,39 @@ public class BenefitServiceImpl extends ServiceImpl<BenefitMapper, Benefit> impl
|
||||||
public Benefit getBenefitByType(Long memberLevelId, MemberBenefitTypeEnum memberBenefitTypeEnum) {
|
public Benefit getBenefitByType(Long memberLevelId, MemberBenefitTypeEnum memberBenefitTypeEnum) {
|
||||||
return baseMapper.getBenefitByType(memberLevelId, memberBenefitTypeEnum.getValue());
|
return baseMapper.getBenefitByType(memberLevelId, memberBenefitTypeEnum.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addBenefit(AddBenefitDto addBenefitDto) {
|
||||||
|
|
||||||
|
Benefit benefit = BeanUtil.toBean(addBenefitDto, Benefit.class);
|
||||||
|
|
||||||
|
baseMapper.insert(benefit);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BenefitVo> benefitList() {
|
||||||
|
|
||||||
|
List<BenefitVo> benefitVoList = new ArrayList<>();
|
||||||
|
|
||||||
|
List<BenefitName> benefitNameList = benefitNameService.list();
|
||||||
|
|
||||||
|
for (BenefitName benefitName : benefitNameList) {
|
||||||
|
|
||||||
|
BenefitVo benefitVo = BeanUtil.toBean(benefitName, BenefitVo.class);
|
||||||
|
|
||||||
|
List<BenefitInfoVo> benefitInfoVoList = new ArrayList<>();
|
||||||
|
List<Benefit> benefitList = baseMapper.selectList(new LambdaQueryWrapper<Benefit>()
|
||||||
|
.eq(Benefit::getBenefitNameId, benefitName.getId()));
|
||||||
|
for (Benefit benefit : benefitList) {
|
||||||
|
BenefitInfoVo benefitInfoVo1 = BeanUtil.copyProperties(benefit, BenefitInfoVo.class);
|
||||||
|
benefitInfoVo1.setBenefitType(benefit.getBenefitType().getValue());
|
||||||
|
benefitInfoVoList.add(benefitInfoVo1);
|
||||||
|
}
|
||||||
|
benefitVo.setBenefitInfoList(benefitInfoVoList);
|
||||||
|
|
||||||
|
benefitVoList.add(benefitVo);
|
||||||
|
}
|
||||||
|
return benefitVoList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class MemberBenefitServiceImpl extends ServiceImpl<MemberBenefitMapper, M
|
||||||
benefitList.addAll(notBenefitList);
|
benefitList.addAll(notBenefitList);
|
||||||
|
|
||||||
// 排序
|
// 排序
|
||||||
benefitList.sort(Comparator.comparingInt(Benefit::getBenefitOrder));
|
// benefitList.sort(Comparator.comparingInt(Benefit::getCreateTime));
|
||||||
|
|
||||||
memberBenefitVO.setMemberBenefitList(benefitList);
|
memberBenefitVO.setMemberBenefitList(benefitList);
|
||||||
memberBenefitVOList.add(memberBenefitVO);
|
memberBenefitVOList.add(memberBenefitVO);
|
||||||
|
|
|
@ -16,10 +16,8 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Calendar;
|
import java.util.stream.Collectors;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Component("userMemberTask")
|
@Component("userMemberTask")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@ -190,7 +188,7 @@ public class UserMemberTask {
|
||||||
.in(Benefit::getId, benefitIdList)
|
.in(Benefit::getId, benefitIdList)
|
||||||
.list();
|
.list();
|
||||||
for (Benefit benefit : benefitList) {
|
for (Benefit benefit : benefitList) {
|
||||||
if (benefit.getBenefitType().equals(MemberBenefitTypeEnum.POINTS.getValue())) {
|
if (benefit.getBenefitType().getValue().equals(MemberBenefitTypeEnum.POINTS.getValue())) {
|
||||||
return benefit.getBenefitDiscount();
|
return benefit.getBenefitDiscount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,33 +5,33 @@
|
||||||
<mapper namespace="com.mcwl.memberCenter.mapper.BenefitMapper">
|
<mapper namespace="com.mcwl.memberCenter.mapper.BenefitMapper">
|
||||||
|
|
||||||
<select id="getBenefitList" resultType="com.mcwl.memberCenter.domain.Benefit">
|
<select id="getBenefitList" resultType="com.mcwl.memberCenter.domain.Benefit">
|
||||||
select id, benefit_name, benefit_desc, benefit_discount, benefit_order
|
select id, benefit_name_id, benefit_desc, benefit_type, benefit_discount, benefit_unit
|
||||||
from mem_benefit
|
from mem_benefit
|
||||||
where del_flag = '0'
|
where del_flag = '0'
|
||||||
order by benefit_order
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getBenefitListByMemberLevelId" resultType="com.mcwl.memberCenter.domain.Benefit">
|
<select id="getBenefitListByMemberLevelId" resultType="com.mcwl.memberCenter.domain.Benefit">
|
||||||
select b.id, benefit_name, benefit_desc, benefit_discount, benefit_order
|
select b.id, benefit_name_id, benefit_desc, benefit_type, benefit_discount, benefit_unit
|
||||||
from mem_benefit b
|
from mem_benefit b
|
||||||
left join mem_member_benefit mb on b.id = mb.benefit_id
|
left join mem_member_benefit mb on b.id = mb.benefit_id
|
||||||
where mb.member_level_id = #{memberLevelId}
|
where mb.member_level_id = #{memberLevelId}
|
||||||
and b.del_flag = '0'
|
and b.del_flag = '0'
|
||||||
and mb.del_flag = '0'
|
and mb.del_flag = '0'
|
||||||
order by b.benefit_order
|
order by b.create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="getNotBenefitList" resultType="com.mcwl.memberCenter.domain.Benefit">
|
<select id="getNotBenefitList" resultType="com.mcwl.memberCenter.domain.Benefit">
|
||||||
select benefit_name, benefit_desc, benefit_order
|
select b.id, benefit_name_id, benefit_desc, benefit_type, benefit_discount, benefit_unit
|
||||||
from mem_benefit b
|
from mem_benefit b
|
||||||
where b.id not in (select mb.benefit_id
|
where b.id not in (select mb.benefit_id
|
||||||
from mem_member_benefit mb
|
from mem_member_benefit mb
|
||||||
where mb.member_level_id = #{memberLevelId}
|
where mb.member_level_id = #{memberLevelId}
|
||||||
and mb.del_flag = '0')
|
and mb.del_flag = '0')
|
||||||
and b.del_flag = '0'
|
and b.del_flag = '0'
|
||||||
order by b.benefit_order
|
order by b.create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="getBenefitByType" resultType="com.mcwl.memberCenter.domain.Benefit">
|
<select id="getBenefitByType" resultType="com.mcwl.memberCenter.domain.Benefit">
|
||||||
select mb.id, benefit_name, benefit_desc, benefit_type, benefit_discount, benefit_order
|
select mb.id, benefit_name_id, benefit_desc, benefit_type, benefit_discount, benefit_unit
|
||||||
from mem_benefit mb
|
from mem_benefit mb
|
||||||
left join mem_member_benefit mmb on mb.id = mmb.benefit_id
|
left join mem_member_benefit mmb on mb.id = mmb.benefit_id
|
||||||
where mb.del_flag = '0'
|
where mb.del_flag = '0'
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.mcwl.memberCenter.mapper.BenefitNameMapper">
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -733,8 +733,8 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
@Override
|
@Override
|
||||||
public UserDataVo getUserData() {
|
public UserDataVo getUserData() {
|
||||||
return UserDataVo.builder()
|
return UserDataVo.builder()
|
||||||
.userCount(this.getMonthUserCount())
|
.userCount(this.getUserCount())
|
||||||
.monthUserCount(this.getUserCount())
|
.monthUserCount(this.getMonthUserCount())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getUserCount" resultType="java.lang.Integer">
|
<select id="getUserCount" resultType="java.lang.Integer">
|
||||||
select COALESCE(count(*), 0) from sys_user
|
select COALESCE(count(*), 0) from sys_user where del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getMonthUserCount" resultType="java.lang.Integer">
|
<select id="getMonthUserCount" resultType="java.lang.Integer">
|
||||||
|
|
Loading…
Reference in New Issue