|
|
@@ -33,6 +33,8 @@ import org.springblade.modules.ldt.shop.dto.ShopDTO;
|
|
|
import org.springblade.modules.ldt.shop.entity.Shop;
|
|
|
import org.springblade.modules.ldt.shop.service.IShopService;
|
|
|
import org.springblade.modules.ldt.shop.vo.ShopVO;
|
|
|
+import org.springblade.modules.ldt.shop.wrapper.ShopWrapper;
|
|
|
+import org.springblade.modules.system.service.IParamService;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
@@ -58,7 +60,6 @@ public class AppMallController {
|
|
|
private final IMemberService memberService;
|
|
|
private final IBillRecordService billRecordService;
|
|
|
private final IActivityService activityService;
|
|
|
- private final IActivityJoinRecordService activityJoinRecordService;
|
|
|
|
|
|
/**
|
|
|
* 通过手机获取商场信息
|
|
|
@@ -125,16 +126,15 @@ public class AppMallController {
|
|
|
* @param shopDTO
|
|
|
* @return
|
|
|
*/
|
|
|
- @GetMapping("/getPassShopList")
|
|
|
- @ApiOperation(value = "商场获取已经审核通过的商店列表", notes = "传入商场id")
|
|
|
- public R<List<Shop>> getPassShopList(@RequestBody ShopDTO shopDTO) {
|
|
|
+ @GetMapping("/getShopList")
|
|
|
+ @ApiOperation(value = "商场获取商店列表", notes = "传入商场")
|
|
|
+ public R<IPage<ShopVO>> getShopList(ShopDTO shopDTO, Query query) {
|
|
|
Assert.notNull(shopDTO.getMallId(), "商场id不能为空");
|
|
|
- List<Shop> shops = shopService.getBaseMapper().selectList(new QueryWrapper<>(new Shop()).lambda().eq(Shop::getAuditStatus, 1)
|
|
|
- .eq(Shop::getMallId, shopDTO.getMallId()).like(shopDTO.getLabelId() != null, Shop::getLabelIds, shopDTO.getLabelId())
|
|
|
- .eq(shopDTO.getMallAreaId() != null, Shop::getMallAreaId, shopDTO.getMallAreaId()));
|
|
|
-
|
|
|
-
|
|
|
- return R.data(shops);
|
|
|
+ IPage<Shop> shops = shopService.getBaseMapper().selectPage(Condition.getPage(query), new QueryWrapper<>(new Shop()).lambda().eq(shopDTO.getAuditStatus() != null, Shop::getAuditStatus, shopDTO.getAuditStatus())
|
|
|
+ .eq(shopDTO.getMallId() != null, Shop::getMallId, shopDTO.getMallId()).like(shopDTO.getLabelId() != null, Shop::getLabelIds, shopDTO.getLabelId())
|
|
|
+ .eq(shopDTO.getMallAreaId() != null, Shop::getMallAreaId, shopDTO.getMallAreaId())
|
|
|
+ .like(shopDTO.getFullName() != null, Shop::getFullName, shopDTO.getFullName()));
|
|
|
+ return R.data(ShopWrapper.build(mallAreaService).pageVO(shops));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -167,7 +167,7 @@ public class AppMallController {
|
|
|
Date todayDate = sdf.parse(today.toString());
|
|
|
todayMemberIn = members.stream().filter(member -> member.getCreateTime().after(todayDate)).collect(Collectors.toList()).size();
|
|
|
List<Shop> shops = shopService.getBaseMapper().selectList(new QueryWrapper<>(new Shop()).lambda().eq(Shop::getMallId, mallId));
|
|
|
- shopCount = shops.size();
|
|
|
+ shopCount = shops.size();
|
|
|
|
|
|
//今日营收
|
|
|
List<BillRecord> billRecords = billRecordService.getBaseMapper().selectList(new QueryWrapper<>(new BillRecord()).lambda()
|
|
|
@@ -183,7 +183,6 @@ public class AppMallController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
return R.data(appMallStaticVO.setMemberCount(memberCount)
|
|
|
.setShopCount(shopCount)
|
|
|
.setTodayMemberIn(todayMemberIn)
|
|
|
@@ -202,9 +201,9 @@ public class AppMallController {
|
|
|
public R createMemberCenter(@RequestBody Mall mall) {
|
|
|
Mall oldEntity = mallService.getById(mall.getId());
|
|
|
Assert.notNull(oldEntity, "商场不存在");
|
|
|
- Assert.notNull(mall.getPoint(),"积分数不能为空");
|
|
|
- Assert.notNull(mall.getPointValue(),"积分对应的积分价值不能为空");
|
|
|
- Assert.notNull(mall.getConsumeOnePoint(),"每消费一元赠送的积分数不能为空");
|
|
|
+ Assert.notNull(mall.getPoint(), "积分数不能为空");
|
|
|
+ Assert.notNull(mall.getPointValue(), "积分对应的积分价值不能为空");
|
|
|
+ Assert.notNull(mall.getConsumeOnePoint(), "每消费一元赠送的积分数不能为空");
|
|
|
oldEntity.setPoint(mall.getPoint());
|
|
|
oldEntity.setPointValue(mall.getPointValue());
|
|
|
oldEntity.setConsumeOnePoint(mall.getConsumeOnePoint());
|
|
|
@@ -232,9 +231,9 @@ public class AppMallController {
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation(value = "分页", notes = "传入member")
|
|
|
public R<IPage<Member>> getMembersByMallId(Member member, Query query) {
|
|
|
- Assert.notNull(member.getMallId(),"商场id不能为空");
|
|
|
+ Assert.notNull(member.getMallId(), "商场id不能为空");
|
|
|
IPage<Member> pages = memberService.page(Condition.getPage(query), new QueryWrapper<>(new Member()).lambda()
|
|
|
- .eq(Member::getMallId,member.getMallId()).eq(Member::getType,SystemConstant.MALLORSHOP.MALL.getValue())
|
|
|
+ .eq(Member::getMallId, member.getMallId()).eq(Member::getType, SystemConstant.MALLORSHOP.MALL.getValue())
|
|
|
.orderByDesc(Member::getPointValue));
|
|
|
return R.data(pages);
|
|
|
}
|
|
|
@@ -246,33 +245,37 @@ public class AppMallController {
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation(value = "通过商场id获取活动信息", notes = "传入member")
|
|
|
public R<IPage<Activity>> getMembersByMallId(ActivityDTO activityDTO, Query query) {
|
|
|
- Assert.notNull(activityDTO.getSelectType() == null,"查询类型字段不能为空");
|
|
|
- Assert.notNull(activityDTO.getMallId(),"商场id不能为空");
|
|
|
+ Assert.notNull(activityDTO.getSelectType() == null, "查询类型字段不能为空");
|
|
|
+ Assert.notNull(activityDTO.getMallId(), "商场id不能为空");
|
|
|
IPage<Activity> pages = null;
|
|
|
- if(activityDTO.getSelectType() == 1){//查询该商场发起的活动
|
|
|
+ if (activityDTO.getSelectType() == 1) {//查询该商场发起的活动
|
|
|
pages = activityService.page(Condition.getPage(query), new QueryWrapper<>(new Activity()).lambda()
|
|
|
- .eq(Activity::getSponsorType,SystemConstant.MALLORSHOP.MALL.getValue()).eq(Activity::getSponsorId,activityDTO.getMallId())
|
|
|
+ .eq(Activity::getSponsorType, SystemConstant.MALLORSHOP.MALL.getValue()).eq(Activity::getSponsorId, activityDTO.getMallId())
|
|
|
.orderByDesc(Activity::getCreateTime));
|
|
|
- }else if(activityDTO.getSelectType() == 2){//可以参加的活动
|
|
|
+ } else if (activityDTO.getSelectType() == 2) {//可以参加的活动
|
|
|
//获取该商场下所有商户发布的活动
|
|
|
- pages = this.activityService.getCanJoinActicityByMallId(Condition.getPage(query),activityDTO.getMallId());
|
|
|
+ pages = this.activityService.getCanJoinActicityByMallId(Condition.getPage(query), activityDTO.getMallId());
|
|
|
|
|
|
- }else if(activityDTO.getSelectType() == 3){//已参加的活动
|
|
|
+ } else if (activityDTO.getSelectType() == 3) {//已参加的活动
|
|
|
//从活动参加记录表中获取
|
|
|
- List<ActivityJoinRecord> activityJoinRecords = activityJoinRecordService.getBaseMapper().selectList(new QueryWrapper<>(new ActivityJoinRecord()).lambda()
|
|
|
- .eq(ActivityJoinRecord::getJoinId, activityDTO.getSponsorId()).eq(ActivityJoinRecord::getJoinType, SystemConstant.MALLORSHOP.MALL.getValue()));
|
|
|
- pages = new Page<>();
|
|
|
- pages.setCurrent(query.getCurrent());
|
|
|
- pages.setSize(query.getSize());
|
|
|
- pages.setTotal(activityJoinRecords.size());
|
|
|
- List<Long> activityIds = activityJoinRecords.stream().map(ActivityJoinRecord::getActivityId).collect(Collectors.toList());
|
|
|
- activityIds = activityIds.subList((query.getCurrent()-1) * 10, query.getCurrent() * query.getSize());
|
|
|
- List<Activity> activities = this.activityService.getBaseMapper().selectList(new QueryWrapper<>(new Activity())
|
|
|
- .lambda().in(Activity::getId,activityIds));
|
|
|
- pages.setRecords(activities);
|
|
|
+ pages = this.activityService.getHadJoinActivityByMallId(Condition.getPage(query), activityDTO.getMallId());
|
|
|
}
|
|
|
|
|
|
return R.data(pages);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 活动审核
|
|
|
+ */
|
|
|
+ @PostMapping("/auditActivity")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperation(value = "活动审核", notes = "传入activity")
|
|
|
+ public R getMembersByMallId(@RequestBody Activity activity) {
|
|
|
+ Activity oldEntity = activityService.getById(activity.getId());
|
|
|
+ Assert.notNull(oldEntity, "活动不存在");
|
|
|
+ oldEntity.setAuditAdvice(activity.getAuditAdvice());
|
|
|
+ oldEntity.setAuditStatus(activity.getAuditStatus());
|
|
|
+ return R.data(activityService.updateById(oldEntity));
|
|
|
+ }
|
|
|
+
|
|
|
}
|