去除冗余代码
This commit is contained in:
parent
b0f46a78a6
commit
c049552fc7
@ -7,8 +7,6 @@ import cn.lili.modules.connect.mapper.ConnectConfigMapper;
|
||||
import cn.lili.modules.connect.service.ConnectConfigService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -23,8 +21,6 @@ import java.util.List;
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ConnectConfigServiceImpl extends ServiceImpl<ConnectConfigMapper, ConnectConfig> implements ConnectConfigService {
|
||||
@Autowired
|
||||
private ConnectConfigMapper connectConfigMapper;
|
||||
|
||||
@Override
|
||||
public List<ConnectConfigForm> listForms() {
|
||||
|
@ -34,9 +34,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Transactional
|
||||
public class DistributionGoodsServiceImpl extends ServiceImpl<DistributionGoodsMapper, DistributionGoods> implements DistributionGoodsService {
|
||||
|
||||
//分销商品
|
||||
@Autowired
|
||||
private DistributionGoodsMapper distributionGoodsMapper;
|
||||
//分销员
|
||||
@Autowired
|
||||
private DistributionService distributionService;
|
||||
@ -48,22 +45,22 @@ public class DistributionGoodsServiceImpl extends ServiceImpl<DistributionGoodsM
|
||||
public IPage<DistributionGoodsVO> goodsPage(DistributionGoodsSearchParams searchParams) {
|
||||
//获取商家的分销商品列表
|
||||
if (UserContext.getCurrentUser().getRole().equals(UserEnums.STORE)) {
|
||||
return distributionGoodsMapper.getDistributionGoodsVO(PageUtil.initPage(searchParams), searchParams.storeQueryWrapper());
|
||||
return this.baseMapper.getDistributionGoodsVO(PageUtil.initPage(searchParams), searchParams.storeQueryWrapper());
|
||||
} else if (UserContext.getCurrentUser().getRole().equals(UserEnums.MEMBER)) {
|
||||
//判断当前登录用户是否为分销员
|
||||
Distribution distribution = distributionService.getDistribution();
|
||||
if (distribution != null) {
|
||||
//判断查看已选择的分销商品列表
|
||||
if (searchParams.isChecked()) {
|
||||
return distributionGoodsMapper.selectGoods(PageUtil.initPage(searchParams), searchParams.distributionQueryWrapper(), distribution.getId());
|
||||
return this.baseMapper.selectGoods(PageUtil.initPage(searchParams), searchParams.distributionQueryWrapper(), distribution.getId());
|
||||
} else {
|
||||
return distributionGoodsMapper.notSelectGoods(PageUtil.initPage(searchParams), searchParams.distributionQueryWrapper(), distribution.getId());
|
||||
return this.baseMapper.notSelectGoods(PageUtil.initPage(searchParams), searchParams.distributionQueryWrapper(), distribution.getId());
|
||||
}
|
||||
}
|
||||
throw new ServiceException(ResultCode.DISTRIBUTION_NOT_EXIST);
|
||||
}
|
||||
//如果是平台则直接进行查询
|
||||
return distributionGoodsMapper.getDistributionGoodsVO(PageUtil.initPage(searchParams), searchParams.distributionQueryWrapper());
|
||||
return this.baseMapper.getDistributionGoodsVO(PageUtil.initPage(searchParams), searchParams.distributionQueryWrapper());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -43,10 +43,6 @@ public class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Dis
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
|
||||
//分销员
|
||||
@Autowired
|
||||
private DistributionMapper distributionMapper;
|
||||
|
||||
//缓存
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
@ -176,7 +172,7 @@ public class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Dis
|
||||
|
||||
@Override
|
||||
public void updateCanRebate(Double canRebate, String distributionId) {
|
||||
this.distributionMapper.updateCanRebate(canRebate,distributionId);
|
||||
this.baseMapper.updateCanRebate(canRebate,distributionId);
|
||||
}
|
||||
|
||||
}
|
@ -24,18 +24,14 @@ import java.util.List;
|
||||
@Transactional
|
||||
public class CategoryBrandServiceImpl extends ServiceImpl<CategoryBrandMapper, CategoryBrand> implements CategoryBrandService {
|
||||
|
||||
//分类品牌绑定
|
||||
@Autowired
|
||||
private CategoryBrandMapper categoryBrandMapper;
|
||||
|
||||
@Override
|
||||
public List<CategoryBrandVO> getCategoryBrandList(String categoryId) {
|
||||
return categoryBrandMapper.getCategoryBrandList(categoryId);
|
||||
return this.baseMapper.getCategoryBrandList(categoryId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByCategoryId(String categoryId) {
|
||||
categoryBrandMapper.delete(new LambdaUpdateWrapper<CategoryBrand>().eq(CategoryBrand::getCategoryId, categoryId));
|
||||
this.baseMapper.delete(new LambdaUpdateWrapper<CategoryBrand>().eq(CategoryBrand::getCategoryId, categoryId));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,9 +40,6 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
||||
//缓存
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
//分类
|
||||
@Autowired
|
||||
private CategoryMapper categoryMapper;
|
||||
|
||||
@Override
|
||||
public List<Category> dbList(String parentId) {
|
||||
@ -159,7 +156,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
||||
.ne(category.getId() != null, "id", category.getId())
|
||||
.eq(DELETE_FLAG_COLUMN, false)
|
||||
.orderByAsc("sort_order");
|
||||
return this.categoryMapper.selectList(queryWrapper);
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -187,7 +184,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
||||
.set("sort_order", category.getSortOrder())
|
||||
.set(DELETE_FLAG_COLUMN, category.getDeleteFlag())
|
||||
.set("commission_rate", category.getCommissionRate());
|
||||
categoryMapper.update(category, updateWrapper);
|
||||
this.baseMapper.update(category, updateWrapper);
|
||||
removeCache();
|
||||
}
|
||||
|
||||
|
@ -23,12 +23,10 @@ import java.util.List;
|
||||
@Service
|
||||
@Transactional
|
||||
public class CategorySpecificationServiceImpl extends ServiceImpl<CategorySpecificationMapper, CategorySpecification> implements CategorySpecificationService {
|
||||
@Autowired
|
||||
private CategorySpecificationMapper categorySpecificationMapper;
|
||||
|
||||
@Override
|
||||
public List<CategorySpecificationVO> getCategorySpecList(String categoryId) {
|
||||
return categorySpecificationMapper.getCategorySpecList(categoryId);
|
||||
return this.baseMapper.getCategorySpecList(categoryId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -38,6 +36,6 @@ public class CategorySpecificationServiceImpl extends ServiceImpl<CategorySpecif
|
||||
|
||||
@Override
|
||||
public void deleteByCategoryId(String categoryId) {
|
||||
categorySpecificationMapper.delete(new LambdaQueryWrapper<CategorySpecification>().eq(CategorySpecification::getCategoryId,categoryId));
|
||||
this.baseMapper.delete(new LambdaQueryWrapper<CategorySpecification>().eq(CategorySpecification::getCategoryId,categoryId));
|
||||
}
|
||||
}
|
@ -12,7 +12,6 @@ import cn.lili.modules.system.service.SettingService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -33,9 +32,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
|
||||
//文件
|
||||
@Autowired
|
||||
private FileManagerPlugin fileManagerPlugin;
|
||||
//商品相册数据层
|
||||
@Autowired
|
||||
private GoodsGalleryMapper goodsGalleryMapper;
|
||||
|
||||
//设置
|
||||
@Autowired
|
||||
private SettingService settingService;
|
||||
@ -44,7 +41,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
|
||||
@Override
|
||||
public void add(List<String> goodsGalleryList, String goodsId) {
|
||||
//删除原来商品相册信息
|
||||
this.goodsGalleryMapper.delete(new UpdateWrapper<GoodsGallery>().eq("goods_id", goodsId));
|
||||
this.baseMapper.delete(new UpdateWrapper<GoodsGallery>().eq("goods_id", goodsId));
|
||||
//确定好图片选择器后进行处理
|
||||
int i = 0;
|
||||
for (String origin : goodsGalleryList) {
|
||||
@ -54,7 +51,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
|
||||
// 默认第一个为默认图片
|
||||
galley.setIsDefault(i == 0 ? 1 : 0);
|
||||
i++;
|
||||
this.goodsGalleryMapper.insert(galley);
|
||||
this.baseMapper.insert(galley);
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,6 +75,6 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
|
||||
@Override
|
||||
public List<GoodsGallery> goodsGalleryList(String goodsId) {
|
||||
//根据商品id查询商品相册
|
||||
return goodsGalleryMapper.selectList(new QueryWrapper<GoodsGallery>().eq("goods_id", goodsId));
|
||||
return this.baseMapper.selectList(new QueryWrapper<GoodsGallery>().eq("goods_id", goodsId));
|
||||
}
|
||||
}
|
@ -55,9 +55,6 @@ import java.util.List;
|
||||
@Transactional
|
||||
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {
|
||||
|
||||
//商品
|
||||
@Autowired
|
||||
private GoodsMapper goodsMapper;
|
||||
//商品属性
|
||||
@Autowired
|
||||
private GoodsParamsService goodsParamsService;
|
||||
@ -85,7 +82,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
|
||||
@Override
|
||||
public void underStoreGoods(String storeId) {
|
||||
this.goodsMapper.underStoreGoods(storeId);
|
||||
this.baseMapper.underStoreGoods(storeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,7 +11,6 @@ import cn.lili.modules.search.service.EsGoodsSearchService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -30,9 +29,6 @@ import java.util.Objects;
|
||||
@Transactional
|
||||
public class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint> implements FootprintService {
|
||||
|
||||
//足迹数据层
|
||||
@Autowired
|
||||
private FootprintMapper footprintMapper;
|
||||
//es商品业务层
|
||||
@Autowired
|
||||
private EsGoodsSearchService esGoodsSearchService;
|
||||
@ -54,7 +50,7 @@ public class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint
|
||||
footPrint.setCreateTime(new Date());
|
||||
this.save(footPrint);
|
||||
//删除超过100条后的记录
|
||||
footprintMapper.deleteLastFootPrint(footPrint.getMemberId());
|
||||
this.baseMapper.deleteLastFootPrint(footPrint.getMemberId());
|
||||
return footPrint;
|
||||
}
|
||||
}
|
||||
@ -82,7 +78,7 @@ public class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint
|
||||
lambdaQueryWrapper.eq(FootPrint::getMemberId, UserContext.getCurrentUser().getId());
|
||||
lambdaQueryWrapper.eq(FootPrint::getDeleteFlag,false);
|
||||
lambdaQueryWrapper.orderByDesc(FootPrint::getUpdateTime);
|
||||
List<String> skuIdList = footprintMapper.footprintSkuIdList(PageUtil.initPage(pageVO), lambdaQueryWrapper);
|
||||
List<String> skuIdList = this.baseMapper.footprintSkuIdList(PageUtil.initPage(pageVO), lambdaQueryWrapper);
|
||||
if (skuIdList.size() > 0) {
|
||||
List<EsGoodsIndex> list = esGoodsSearchService.getEsGoodsBySkuIds(skuIdList);
|
||||
//去除为空的商品数据
|
||||
|
@ -17,7 +17,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -37,9 +36,6 @@ import java.util.Optional;
|
||||
|
||||
public class GoodsCollectionServiceImpl extends ServiceImpl<GoodsCollectionMapper, GoodsCollection> implements GoodsCollectionService {
|
||||
|
||||
//商品收藏
|
||||
@Autowired
|
||||
private GoodsCollectionMapper goodsCollectionMapper;
|
||||
//rocketMq
|
||||
@Autowired
|
||||
private RocketMQTemplate rocketMQTemplate;
|
||||
@ -53,7 +49,7 @@ public class GoodsCollectionServiceImpl extends ServiceImpl<GoodsCollectionMappe
|
||||
queryWrapper.eq("gc.member_id", UserContext.getCurrentUser().getId());
|
||||
queryWrapper.groupBy("gc.id");
|
||||
queryWrapper.orderByDesc("gc.create_time");
|
||||
return goodsCollectionMapper.goodsCollectionVOList(PageUtil.initPage(pageVo), queryWrapper);
|
||||
return this.baseMapper.goodsCollectionVOList(PageUtil.initPage(pageVo), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -61,9 +61,6 @@ import java.util.Map;
|
||||
@Transactional
|
||||
public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMapper, MemberEvaluation> implements MemberEvaluationService {
|
||||
|
||||
//会员评价数据层
|
||||
@Autowired
|
||||
private MemberEvaluationMapper memberEvaluationMapper;
|
||||
//订单
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
@ -91,12 +88,12 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
|
||||
|
||||
@Override
|
||||
public IPage<MemberEvaluationListVO> queryByParams(StoreEvaluationQueryParams storeEvaluationQueryParams) {
|
||||
return memberEvaluationMapper.getMemberEvaluationList(PageUtil.initPage(storeEvaluationQueryParams), storeEvaluationQueryParams.queryWrapper());
|
||||
return this.baseMapper.getMemberEvaluationList(PageUtil.initPage(storeEvaluationQueryParams), storeEvaluationQueryParams.queryWrapper());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<MemberEvaluationListVO> queryPage(EvaluationQueryParams evaluationQueryParams, PageVO page) {
|
||||
return memberEvaluationMapper.getMemberEvaluationList(PageUtil.initPage(page), evaluationQueryParams.queryWrapper());
|
||||
return this.baseMapper.getMemberEvaluationList(PageUtil.initPage(page), evaluationQueryParams.queryWrapper());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -163,7 +160,7 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
|
||||
@Override
|
||||
public EvaluationNumberVO getEvaluationNumber(String goodsId) {
|
||||
EvaluationNumberVO evaluationNumberVO = new EvaluationNumberVO();
|
||||
List<Map<String, Object>> list = memberEvaluationMapper.getEvaluationNumber(goodsId);
|
||||
List<Map<String, Object>> list = this.baseMapper.getEvaluationNumber(goodsId);
|
||||
|
||||
Integer good = 0;
|
||||
Integer moderate = 0;
|
||||
|
@ -22,8 +22,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Transactional
|
||||
public class MemberPointsHistoryServiceImpl extends ServiceImpl<MemberPointsHistoryMapper, MemberPointsHistory> implements MemberPointsHistoryService {
|
||||
|
||||
@Autowired
|
||||
private MemberPointsHistoryMapper memberPointsHistoryMapper;
|
||||
|
||||
@Override
|
||||
public MemberPointsHistoryVO getMemberPointsHistoryVO(String memberId) {
|
||||
@ -32,12 +30,12 @@ public class MemberPointsHistoryServiceImpl extends ServiceImpl<MemberPointsHist
|
||||
Long variablePoint = 0L;
|
||||
|
||||
if (StringUtils.isNotEmpty(memberId)) {
|
||||
point = memberPointsHistoryMapper.getMemberPointsHistoryVO(1, memberId);
|
||||
variablePoint = memberPointsHistoryMapper.getMemberPointsHistoryVO(0, memberId);
|
||||
point = this.baseMapper.getMemberPointsHistoryVO(1, memberId);
|
||||
variablePoint = this.baseMapper.getMemberPointsHistoryVO(0, memberId);
|
||||
|
||||
} else {
|
||||
point = memberPointsHistoryMapper.getALLMemberPointsHistoryVO(0);
|
||||
variablePoint = memberPointsHistoryMapper.getALLMemberPointsHistoryVO(1);
|
||||
point = this.baseMapper.getALLMemberPointsHistoryVO(0);
|
||||
variablePoint = this.baseMapper.getALLMemberPointsHistoryVO(1);
|
||||
}
|
||||
memberPointsHistoryVO.setPoint(point == null ? 0 : point);
|
||||
memberPointsHistoryVO.setVariablePoint(variablePoint == null ? 0 : variablePoint);
|
||||
|
@ -62,9 +62,6 @@ import java.util.List;
|
||||
@Transactional
|
||||
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements MemberService {
|
||||
|
||||
//会员数据处理层
|
||||
@Autowired
|
||||
private MemberMapper memberMapper;
|
||||
//会员token
|
||||
@Autowired
|
||||
private MemberTokenGenerate memberTokenGenerate;
|
||||
@ -90,7 +87,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
public Member findByUsername(String userName) {
|
||||
QueryWrapper<Member> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("username", userName);
|
||||
return memberMapper.selectOne(queryWrapper);
|
||||
return this.baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
@ -107,7 +104,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
public boolean findByMobile(String uuid, String mobile) {
|
||||
QueryWrapper<Member> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("mobile", mobile);
|
||||
Member member = memberMapper.selectOne(queryWrapper);
|
||||
Member member = this.baseMapper.selectOne(queryWrapper);
|
||||
if (member == null) {
|
||||
throw new ServiceException(ResultCode.USER_NOT_PHONE);
|
||||
}
|
||||
@ -204,7 +201,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
public Token mobilePhoneLogin(String mobilePhone) {
|
||||
QueryWrapper<Member> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("mobile", mobilePhone);
|
||||
Member member = memberMapper.selectOne(queryWrapper);
|
||||
Member member = this.baseMapper.selectOne(queryWrapper);
|
||||
//如果手机号不存在则自动注册用户
|
||||
if (member == null) {
|
||||
member = new Member(mobilePhone, UuidUtils.getUUID(), mobilePhone);
|
||||
@ -413,7 +410,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
|
||||
@Override
|
||||
public List<MemberDistributionVO> distribution() {
|
||||
List<MemberDistributionVO> memberDistributionVOS = memberMapper.distribution();
|
||||
List<MemberDistributionVO> memberDistributionVOS = this.baseMapper.distribution();
|
||||
return memberDistributionVOS;
|
||||
}
|
||||
|
||||
@ -426,7 +423,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
private Member findByPhone(String mobilePhone) {
|
||||
QueryWrapper<Member> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("mobile", mobilePhone);
|
||||
return memberMapper.selectOne(queryWrapper);
|
||||
return this.baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -40,9 +40,6 @@ import java.util.Map;
|
||||
@Transactional
|
||||
public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberSign> implements MemberSignService {
|
||||
|
||||
//会员签到
|
||||
@Autowired
|
||||
private MemberSignMapper memberSignMapper;
|
||||
//RocketMQ
|
||||
@Autowired
|
||||
private RocketMQTemplate rocketMQTemplate;
|
||||
@ -66,12 +63,12 @@ public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberS
|
||||
queryWrapper.eq("member_id",authUser.getId());
|
||||
queryWrapper.between("create_time",new Date(DateUtil.startOfTodDay()*1000),DateUtil.getCurrentDayEndTime());
|
||||
//校验今天是否已经签到
|
||||
List<MemberSign> todaySigns = memberSignMapper.getTodayMemberSign(queryWrapper);
|
||||
List<MemberSign> todaySigns = this.baseMapper.getTodayMemberSign(queryWrapper);
|
||||
if (todaySigns.size() > 0) {
|
||||
throw new ServiceException(ResultCode.MEMBER_SIGN_REPEAT);
|
||||
}
|
||||
//当前签到天数的前一天日期
|
||||
List<MemberSign> signs = memberSignMapper.getBeforeMemberSign(authUser.getId());
|
||||
List<MemberSign> signs = this.baseMapper.getBeforeMemberSign(authUser.getId());
|
||||
//构建参数
|
||||
MemberSign memberSign = new MemberSign();
|
||||
memberSign.setMemberId(authUser.getId());
|
||||
@ -84,7 +81,7 @@ public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberS
|
||||
} else {
|
||||
memberSign.setSignDay(1);
|
||||
}
|
||||
Integer result = memberSignMapper.insert(memberSign);
|
||||
Integer result = this.baseMapper.insert(memberSign);
|
||||
//签到成功后发送消息赠送积分
|
||||
if (result > 0) {
|
||||
String destination = rocketmqCustomProperties.getMemberTopic() + ":" + MemberTagsEnum.MEMBER_SING.name();
|
||||
@ -101,7 +98,7 @@ public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberS
|
||||
//获取当前会员
|
||||
AuthUser authUser = UserContext.getCurrentUser();
|
||||
if (authUser != null) {
|
||||
return memberSignMapper.getMonthMemberSign(authUser.getId(), time);
|
||||
return this.baseMapper.getMonthMemberSign(authUser.getId(), time);
|
||||
}
|
||||
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
|
||||
}
|
||||
|
@ -45,9 +45,6 @@ import java.util.Date;
|
||||
@Transactional
|
||||
public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, MemberWallet> implements MemberWalletService {
|
||||
|
||||
//预存款数据层
|
||||
@Autowired
|
||||
private MemberWalletMapper walletMapper;
|
||||
//预存款日志
|
||||
@Autowired
|
||||
private WalletLogService walletLogService;
|
||||
@ -67,7 +64,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
QueryWrapper<MemberWallet> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("member_id", memberId);
|
||||
//执行查询
|
||||
MemberWallet memberWallet = this.walletMapper.selectOne(queryWrapper);
|
||||
MemberWallet memberWallet = this.baseMapper.selectOne(queryWrapper);
|
||||
//如果没有钱包,则创建钱包
|
||||
if (memberWallet == null) {
|
||||
memberWallet = this.save(memberId, memberService.getById(memberId).getUsername());
|
||||
@ -83,7 +80,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
//余额变动
|
||||
memberWallet.setMemberWallet(CurrencyUtil.add(memberWallet.getMemberWallet(), money));
|
||||
memberWallet.setMemberFrozenWallet(CurrencyUtil.sub(memberWallet.getMemberFrozenWallet(), money));
|
||||
this.walletMapper.updateById(memberWallet);
|
||||
this.updateById(memberWallet);
|
||||
//新增预存款日志
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), money, detail, serviceType);
|
||||
walletLogService.save(walletLog);
|
||||
@ -96,7 +93,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
MemberWallet memberWallet = this.checkMemberWallet(memberId);
|
||||
//新增预存款
|
||||
memberWallet.setMemberWallet(CurrencyUtil.add(memberWallet.getMemberWallet(), money));
|
||||
this.walletMapper.updateById(memberWallet);
|
||||
this.baseMapper.updateById(memberWallet);
|
||||
//新增预存款日志
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), money, detail, serviceType);
|
||||
walletLogService.save(walletLog);
|
||||
@ -114,7 +111,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
}
|
||||
memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), money));
|
||||
//保存记录
|
||||
this.walletMapper.updateById(memberWallet);
|
||||
this.updateById(memberWallet);
|
||||
//新增预存款日志
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), -money, detail, serviceType);
|
||||
walletLogService.save(walletLog);
|
||||
@ -133,7 +130,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), money));
|
||||
memberWallet.setMemberFrozenWallet(CurrencyUtil.add(memberWallet.getMemberFrozenWallet(), money));
|
||||
//修改余额
|
||||
this.walletMapper.updateById(memberWallet);
|
||||
this.updateById(memberWallet);
|
||||
//新增预存款日志
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), -money, detail, serviceType);
|
||||
walletLogService.save(walletLog);
|
||||
@ -150,7 +147,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
throw new ServiceException(ResultCode.WALLET_WITHDRAWAL_INSUFFICIENT);
|
||||
}
|
||||
memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), money));
|
||||
this.walletMapper.updateById(memberWallet);
|
||||
this.updateById(memberWallet);
|
||||
//新增预存款日志
|
||||
WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), -money, "提现金额已冻结,审核通过提现成功", serviceType);
|
||||
walletLogService.save(walletLog);
|
||||
@ -164,7 +161,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
*/
|
||||
private MemberWallet checkMemberWallet(String memberId) {
|
||||
//获取会员预存款信息
|
||||
MemberWallet memberWallet = this.walletMapper.selectOne(new QueryWrapper<MemberWallet>().eq("member_id", memberId));
|
||||
MemberWallet memberWallet = this.getOne(new QueryWrapper<MemberWallet>().eq("member_id", memberId));
|
||||
//如果会员预存款信息不存在则同步重新建立预存款信息
|
||||
if (memberWallet == null) {
|
||||
Member member = memberService.getById(memberId);
|
||||
@ -184,11 +181,11 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
//校验会员预存款是否存在
|
||||
QueryWrapper<MemberWallet> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("member_id", member.getId());
|
||||
MemberWallet memberWallet = this.walletMapper.selectOne(queryWrapper);
|
||||
MemberWallet memberWallet = this.getOne(queryWrapper);
|
||||
//如果 预存款信息不为空 执行设置密码
|
||||
if (memberWallet != null) {
|
||||
memberWallet.setWalletPassword(pwd);
|
||||
this.walletMapper.updateById(memberWallet);
|
||||
this.updateById(memberWallet);
|
||||
}
|
||||
}
|
||||
|
||||
@ -200,7 +197,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
//构建查询条件
|
||||
QueryWrapper<MemberWallet> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("member_id", authUser.getId());
|
||||
MemberWallet wallet = this.walletMapper.selectOne(queryWrapper);
|
||||
MemberWallet wallet = this.getOne(queryWrapper);
|
||||
return wallet != null && !StringUtils.isEmpty(wallet.getWalletPassword());
|
||||
}
|
||||
|
||||
@ -211,7 +208,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
memberWallet.setMemberName(memberName);
|
||||
memberWallet.setMemberWallet(0D);
|
||||
memberWallet.setMemberFrozenWallet(0D);
|
||||
this.walletMapper.insert(memberWallet);
|
||||
this.save(memberWallet);
|
||||
return memberWallet;
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,7 @@ import java.util.Date;
|
||||
@Service
|
||||
@Transactional
|
||||
public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawApplyMapper, MemberWithdrawApply> implements MemberWithdrawApplyService {
|
||||
//提现申请数据层
|
||||
@Autowired
|
||||
private MemberWithdrawApplyMapper memberWithdrawApplyMapper;
|
||||
|
||||
//会员余额
|
||||
@Autowired
|
||||
private MemberWalletService memberWalletService;
|
||||
@ -43,7 +41,7 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
|
||||
@Override
|
||||
public Boolean audit(String applyId, Boolean result, String remark) {
|
||||
//查询申请记录
|
||||
MemberWithdrawApply memberWithdrawApply = memberWithdrawApplyMapper.selectById(applyId);
|
||||
MemberWithdrawApply memberWithdrawApply = this.getById(applyId);
|
||||
memberWithdrawApply.setInspectRemark(remark);
|
||||
if (memberWithdrawApply != null) {
|
||||
//如果审核通过 则微信直接提现,反之则记录审核状态
|
||||
@ -55,7 +53,7 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
|
||||
}
|
||||
memberWithdrawApply.setApplyStatus(WithdrawStatusEnum.VIA_AUDITING.name());
|
||||
//保存审核记录
|
||||
memberWithdrawApplyMapper.updateById(memberWithdrawApply);
|
||||
this.updateById(memberWithdrawApply);
|
||||
//提现,微信提现成功后扣减冻结金额
|
||||
Boolean bool = memberWalletService.withdrawal(memberWithdrawApply);
|
||||
if (bool) {
|
||||
@ -68,7 +66,7 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
|
||||
throw new ServiceException(ResultCode.WALLET_REMARK_ERROR);
|
||||
}
|
||||
memberWithdrawApply.setApplyStatus(WithdrawStatusEnum.FAIL_AUDITING.name());
|
||||
memberWithdrawApplyMapper.updateById(memberWithdrawApply);
|
||||
this.updateById(memberWithdrawApply);
|
||||
//需要从冻结金额扣减到余额
|
||||
memberWalletService.increaseWithdrawal(memberWithdrawApply.getApplyMoney(), memberWithdrawApply.getMemberId(), "审核拒绝,提现金额解冻到余额", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name());
|
||||
return true;
|
||||
@ -98,6 +96,6 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
//查询返回数据
|
||||
return this.memberWithdrawApplyMapper.selectPage(PageUtil.initPage(pageVO), queryWrapper);
|
||||
return this.baseMapper.selectPage(PageUtil.initPage(pageVO), queryWrapper);
|
||||
}
|
||||
}
|
@ -13,8 +13,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -29,15 +27,13 @@ import java.util.Optional;
|
||||
@Service
|
||||
@Transactional
|
||||
public class StoreCollectionServiceImpl extends ServiceImpl<StoreCollectionMapper, StoreCollection> implements StoreCollectionService {
|
||||
@Autowired
|
||||
private StoreCollectionMapper storeCollectionMapper;
|
||||
|
||||
@Override
|
||||
public IPage<StoreCollectionVO> storeCollection(PageVO pageVo) {
|
||||
QueryWrapper<StoreCollectionVO> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("sc.member_id", UserContext.getCurrentUser().getId());
|
||||
queryWrapper.orderByDesc("sc.create_time");
|
||||
return storeCollectionMapper.storeCollectionVOList(PageUtil.initPage(pageVo), queryWrapper);
|
||||
return this.baseMapper.storeCollectionVOList(PageUtil.initPage(pageVo), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,7 +14,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.elasticsearch.ResourceNotFoundException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -29,15 +28,12 @@ import java.util.List;
|
||||
@Service
|
||||
@Transactional
|
||||
public class StoreMessageServiceImpl extends ServiceImpl<StoreMessageMapper, StoreMessage> implements StoreMessageService {
|
||||
@Autowired
|
||||
private StoreMessageMapper storeMessageMapper;
|
||||
|
||||
@Override
|
||||
public boolean deleteByMessageId(String messageId) {
|
||||
StoreMessage storeMessage = this.getById(messageId);
|
||||
if (storeMessage != null) {
|
||||
int result = storeMessageMapper.deleteById(messageId);
|
||||
return result > 0;
|
||||
return this.removeById(messageId);
|
||||
}
|
||||
return false;
|
||||
|
||||
@ -60,7 +56,7 @@ public class StoreMessageServiceImpl extends ServiceImpl<StoreMessageMapper, Sto
|
||||
queryWrapper.eq("status", storeMessageQueryVO.getStatus());
|
||||
}
|
||||
queryWrapper.orderByDesc("status");
|
||||
return storeMessageMapper.queryByParams(PageUtil.initPage(pageVO), queryWrapper);
|
||||
return this.baseMapper.queryByParams(PageUtil.initPage(pageVO), queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@ -78,8 +74,7 @@ public class StoreMessageServiceImpl extends ServiceImpl<StoreMessageMapper, Sto
|
||||
throw new ResourceNotFoundException(ResultCode.USER_AUTHORITY_ERROR.message());
|
||||
}
|
||||
storeMessage.setStatus(status);
|
||||
int result = this.storeMessageMapper.updateById(storeMessage);
|
||||
return result > 0;
|
||||
return this.updateById(storeMessage);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -36,8 +36,6 @@ import java.util.Map;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
||||
public class WechatMPMessageServiceImpl extends ServiceImpl<WechatMPMessageMapper, WechatMPMessage> implements WechatMPMessageService {
|
||||
@Autowired
|
||||
private WechatMPMessageMapper wechatMPMessageMapper;
|
||||
@Autowired
|
||||
private WechatAccessTokenUtil wechatAccessTokenUtil;
|
||||
|
||||
@ -53,7 +51,7 @@ public class WechatMPMessageServiceImpl extends ServiceImpl<WechatMPMessageMappe
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
wechatMPMessageMapper.deleteAll();
|
||||
this.baseMapper.deleteAll();
|
||||
try {
|
||||
String accessToken = wechatAccessTokenUtil.cgiAccessToken(ClientTypeEnum.WECHAT_MP);
|
||||
//获取已有模版,删除
|
||||
|
@ -17,7 +17,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -35,8 +34,7 @@ import java.util.Map;
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class WechatMessageServiceImpl extends ServiceImpl<WechatMessageMapper, WechatMessage> implements WechatMessageService {
|
||||
@Autowired
|
||||
private WechatMessageMapper wechatMessageMapper;
|
||||
|
||||
@Autowired
|
||||
private WechatAccessTokenUtil wechatAccessTokenUtil;
|
||||
|
||||
@ -50,7 +48,7 @@ public class WechatMessageServiceImpl extends ServiceImpl<WechatMessageMapper, W
|
||||
@Override
|
||||
public void init() {
|
||||
try {
|
||||
wechatMessageMapper.deleteAll();
|
||||
this.baseMapper.deleteAll();
|
||||
|
||||
String accessToken = wechatAccessTokenUtil.cgiAccessToken(ClientTypeEnum.H5);
|
||||
//获取已有模版,删除
|
||||
|
@ -12,8 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
@ -30,9 +28,6 @@ import java.util.List;
|
||||
@Transactional
|
||||
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements OrderItemService {
|
||||
|
||||
@Autowired
|
||||
private OrderItemMapper orderItemMapper;
|
||||
|
||||
@Override
|
||||
public void updateCommentStatus(String orderItemSn, CommentStatusEnum commentStatusEnum) {
|
||||
LambdaUpdateWrapper<OrderItem> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
||||
@ -89,6 +84,6 @@ public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.ge("o.complete_time", date);
|
||||
queryWrapper.eq("oi.comment_status", CommentStatusEnum.UNFINISHED.name());
|
||||
return orderItemMapper.waitEvaluate(queryWrapper);
|
||||
return this.baseMapper.waitEvaluate(queryWrapper);
|
||||
}
|
||||
}
|
@ -82,9 +82,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
|
||||
private static final String ORDER_SN_COLUMN = "order_sn";
|
||||
|
||||
//订单数据层
|
||||
@Autowired
|
||||
private OrderMapper orderMapper;
|
||||
//延时任务
|
||||
@Autowired
|
||||
private TimeTrigger timeTrigger;
|
||||
@ -479,7 +476,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
queryWrapper.eq("o.delete_flag", false);
|
||||
queryWrapper.groupBy("o.id");
|
||||
queryWrapper.orderByDesc("o.id");
|
||||
return orderMapper.queryByParams(PageUtil.initPage(pageVO), queryWrapper);
|
||||
return this.baseMapper.queryByParams(PageUtil.initPage(pageVO), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2,21 +2,17 @@ package cn.lili.modules.order.order.serviceimpl;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.modules.order.order.entity.dos.Receipt;
|
||||
import cn.lili.modules.order.order.entity.dto.OrderReceiptDTO;
|
||||
import cn.lili.modules.order.order.entity.dto.ReceiptSearchParams;
|
||||
import cn.lili.modules.order.order.mapper.OrderItemMapper;
|
||||
import cn.lili.modules.order.order.mapper.ReceiptMapper;
|
||||
import cn.lili.modules.order.order.service.ReceiptService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -30,14 +26,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Transactional
|
||||
public class ReceiptServiceImpl extends ServiceImpl<ReceiptMapper, Receipt> implements ReceiptService {
|
||||
|
||||
//发票mapper
|
||||
@Autowired
|
||||
private ReceiptMapper receiptMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<OrderReceiptDTO> getReceiptData(ReceiptSearchParams searchParams, PageVO pageVO) {
|
||||
return receiptMapper.getReceipt(PageUtil.initPage(pageVO), searchParams.wrapper());
|
||||
return this.baseMapper.getReceipt(PageUtil.initPage(pageVO), searchParams.wrapper());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,7 +18,6 @@ import cn.lili.modules.order.trade.service.RechargeService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -35,9 +34,6 @@ import java.util.Date;
|
||||
@Transactional
|
||||
public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> implements RechargeService {
|
||||
|
||||
//预存款
|
||||
@Autowired
|
||||
private RechargeMapper rechargeMapper;
|
||||
//会员预存款
|
||||
@Autowired
|
||||
private MemberWalletService memberWalletService;
|
||||
@ -51,7 +47,7 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
|
||||
//整合充值订单数据
|
||||
Recharge recharge = new Recharge(sn, authUser.getId(), authUser.getUsername(), price);
|
||||
//添加预存款充值账单
|
||||
this.rechargeMapper.insert(recharge);
|
||||
this.save(recharge);
|
||||
//返回预存款
|
||||
return recharge;
|
||||
}
|
||||
@ -75,20 +71,20 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
|
||||
queryWrapper.between("pay_time", start, end);
|
||||
}
|
||||
//查询返回数据
|
||||
return this.rechargeMapper.selectPage(PageUtil.initPage(page), queryWrapper);
|
||||
return this.page(PageUtil.initPage(page), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paySuccess(String sn, String receivableNo) {
|
||||
//根据sn获取支付账单
|
||||
Recharge recharge = this.rechargeMapper.selectOne(new QueryWrapper<Recharge>().eq("recharge_sn", sn));
|
||||
Recharge recharge = this.getOne(new QueryWrapper<Recharge>().eq("recharge_sn", sn));
|
||||
//如果支付账单不为空则进行一下逻辑
|
||||
if (recharge != null) {
|
||||
//将此账单支付状态更改为已支付
|
||||
recharge.setPayStatus(PayStatusEnum.PAID.name());
|
||||
recharge.setReceivableNo(receivableNo);
|
||||
//执行保存操作
|
||||
this.rechargeMapper.updateById(recharge);
|
||||
this.updateById(recharge);
|
||||
//增加预存款余额
|
||||
memberWalletService.increase(recharge.getRechargeMoney(), recharge.getMemberId(), "会员余额充值,充值单号为:" + recharge.getRechargeSn(), DepositServiceTypeEnum.WALLET_RECHARGE.name());
|
||||
}
|
||||
@ -96,7 +92,7 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
|
||||
|
||||
@Override
|
||||
public Recharge getRecharge(String sn) {
|
||||
Recharge recharge = this.rechargeMapper.selectOne(new QueryWrapper<Recharge>().eq("recharge_sn", sn));
|
||||
Recharge recharge = this.getOne(new QueryWrapper<Recharge>().eq("recharge_sn", sn));
|
||||
if (recharge != null) {
|
||||
return recharge;
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import cn.lili.modules.order.trade.service.WalletLogService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -26,9 +25,6 @@ import java.util.Date;
|
||||
@Transactional
|
||||
public class WalletLogServiceImpl extends ServiceImpl<WalletLogMapper, WalletLog> implements WalletLogService {
|
||||
|
||||
@Autowired
|
||||
private WalletLogMapper walletLogMapper;
|
||||
|
||||
@Override
|
||||
public IPage<WalletLog> depositLogPage(PageVO page, DepositQueryVO depositQueryVO) {
|
||||
//构建查询条件
|
||||
@ -44,6 +40,6 @@ public class WalletLogServiceImpl extends ServiceImpl<WalletLogMapper, WalletLog
|
||||
depositLogQueryWrapper.between("create_time", start, end);
|
||||
}
|
||||
//查询返回数据
|
||||
return this.walletLogMapper.selectPage(PageUtil.initPage(page), depositLogQueryWrapper);
|
||||
return this.page(PageUtil.initPage(page), depositLogQueryWrapper);
|
||||
}
|
||||
}
|
@ -18,7 +18,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -34,9 +33,6 @@ import java.util.List;
|
||||
@Transactional
|
||||
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> implements ArticleService {
|
||||
|
||||
@Autowired
|
||||
private ArticleMapper articleMapper;
|
||||
|
||||
@Override
|
||||
public IPage<ArticleVO> articlePage(ArticleSearchParams articleSearchParams) {
|
||||
articleSearchParams.setSort("a.sort");
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.lili.modules.page.serviceimpl;
|
||||
|
||||
import cn.lili.common.enums.SwitchEnum;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.SwitchEnum;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
@ -18,8 +18,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@ -30,8 +28,6 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@Service
|
||||
public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> implements PageDataService {
|
||||
@Autowired
|
||||
private PageDataMapper pageDataMapper;
|
||||
|
||||
@Override
|
||||
public void addStorePageData(String storeId) {
|
||||
@ -116,7 +112,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
||||
queryWrapper.eq(pageData.getNum() != null, "num", pageData.getNum());
|
||||
}
|
||||
//判断是否为唯一的页面
|
||||
if (pageDataMapper.getPageDataNum(queryWrapper) == 1) {
|
||||
if (this.baseMapper.getPageDataNum(queryWrapper) == 1) {
|
||||
throw new ServiceException(ResultCode.PAGE_DELETE_ERROR);
|
||||
}
|
||||
return this.removeById(id);
|
||||
@ -136,7 +132,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
||||
|
||||
queryWrapper.eq("page_client_type", pageDataDTO.getPageClientType());
|
||||
|
||||
return pageDataMapper.getPageData(queryWrapper);
|
||||
return this.baseMapper.getPageData(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -146,7 +142,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
||||
queryWrapper.eq(pageDataDTO.getNum() != null, "num", pageDataDTO.getNum());
|
||||
queryWrapper.eq(pageDataDTO.getPageClientType() != null, "page_client_type", pageDataDTO.getPageClientType());
|
||||
|
||||
return pageDataMapper.getPageDataList(PageUtil.initPage(pageVO), queryWrapper);
|
||||
return this.baseMapper.getPageDataList(PageUtil.initPage(pageVO), queryWrapper);
|
||||
|
||||
}
|
||||
}
|
@ -18,9 +18,6 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class SpecialServiceImpl extends ServiceImpl<SpecialMapper, Special> implements SpecialService {
|
||||
|
||||
//专题
|
||||
@Autowired
|
||||
private SpecialMapper specialMapper;
|
||||
//页面数据
|
||||
@Autowired
|
||||
private PageDataService pageDataService;
|
||||
|
@ -5,8 +5,6 @@ import cn.lili.modules.permission.mapper.DepartmentRoleMapper;
|
||||
import cn.lili.modules.permission.service.DepartmentRoleService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -21,21 +19,20 @@ import java.util.List;
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class DepartmentRoleServiceImpl extends ServiceImpl<DepartmentRoleMapper, DepartmentRole> implements DepartmentRoleService {
|
||||
@Autowired
|
||||
private DepartmentRoleMapper departmentRoleMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<DepartmentRole> listByDepartmentId(String departmentId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("department_id", departmentId);
|
||||
return departmentRoleMapper.selectList(queryWrapper);
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateByDepartmentId(String departmentId, List<DepartmentRole> departmentRoles) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("department_id", departmentId);
|
||||
departmentRoleMapper.delete(queryWrapper);
|
||||
this.remove(queryWrapper);
|
||||
|
||||
this.saveBatch(departmentRoles);
|
||||
}
|
||||
@ -44,6 +41,6 @@ public class DepartmentRoleServiceImpl extends ServiceImpl<DepartmentRoleMapper,
|
||||
public void deleteByDepartment(List<String> ids) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("department_id", ids);
|
||||
departmentRoleMapper.delete(queryWrapper);
|
||||
this.remove(queryWrapper);
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package cn.lili.modules.permission.serviceimpl;
|
||||
|
||||
import cn.lili.common.enums.MessageCode;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
@ -8,16 +7,15 @@ import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.common.vo.SearchVO;
|
||||
import cn.lili.modules.permission.entity.dto.MenuSearchParams;
|
||||
import cn.lili.modules.permission.entity.dos.Menu;
|
||||
import cn.lili.modules.permission.entity.dos.RoleMenu;
|
||||
import cn.lili.modules.permission.entity.dto.MenuSearchParams;
|
||||
import cn.lili.modules.permission.entity.vo.MenuVO;
|
||||
import cn.lili.modules.permission.mapper.MenuMapper;
|
||||
import cn.lili.modules.permission.service.MenuService;
|
||||
import cn.lili.modules.permission.service.RoleMenuService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -35,9 +33,6 @@ import java.util.List;
|
||||
@Service
|
||||
@Transactional
|
||||
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService {
|
||||
//菜单
|
||||
@Autowired
|
||||
private MenuMapper menuMapper;
|
||||
//菜单角色
|
||||
@Autowired
|
||||
private RoleMenuService roleMenuService;
|
||||
@ -62,13 +57,13 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me
|
||||
if (authUser.getIsSuper()) {
|
||||
return this.tree();
|
||||
}
|
||||
List<Menu> userMenus = menuMapper.findByUserId(authUser.getId());
|
||||
List<Menu> userMenus = this.baseMapper.findByUserId(authUser.getId());
|
||||
return this.tree(userMenus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Menu> findUserList(String userId) {
|
||||
return menuMapper.findByUserId(userId);
|
||||
return this.baseMapper.findByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -91,7 +86,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me
|
||||
queryWrapper.like("title", title);
|
||||
}
|
||||
queryWrapper.orderByDesc("sort_order");
|
||||
return menuMapper.selectList(queryWrapper);
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
@ -7,7 +7,6 @@ import cn.lili.modules.permission.mapper.RoleMenuMapper;
|
||||
import cn.lili.modules.permission.service.RoleMenuService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -27,15 +26,12 @@ public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> i
|
||||
//菜单
|
||||
@Autowired
|
||||
private MenuMapper menuMapper;
|
||||
//角色菜单
|
||||
@Autowired
|
||||
private RoleMenuMapper roleMenuMapper;
|
||||
|
||||
@Override
|
||||
public List<RoleMenu> findByRoleId(String roleId) {
|
||||
QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("role_id", roleId);
|
||||
return roleMenuMapper.selectList(queryWrapper);
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -61,13 +57,13 @@ public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> i
|
||||
//删除
|
||||
QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("role_id", roleId);
|
||||
roleMenuMapper.delete(queryWrapper);
|
||||
this.remove(queryWrapper);
|
||||
}
|
||||
@Override
|
||||
public void deleteRoleMenu(List<String> roleId) {
|
||||
//删除
|
||||
QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("role_id", roleId);
|
||||
roleMenuMapper.delete(queryWrapper);
|
||||
this.remove(queryWrapper);
|
||||
}
|
||||
}
|
@ -22,14 +22,12 @@ import java.util.List;
|
||||
@Service
|
||||
@Transactional
|
||||
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {
|
||||
@Autowired
|
||||
private UserRoleMapper userRoleMapper;
|
||||
|
||||
@Override
|
||||
public List<UserRole> listByUserId(String userId) {
|
||||
QueryWrapper<UserRole> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", userId);
|
||||
return userRoleMapper.selectList(queryWrapper);
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -46,7 +44,7 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
|
||||
//删除
|
||||
QueryWrapper<UserRole> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", userId);
|
||||
userRoleMapper.delete(queryWrapper);
|
||||
this.remove(queryWrapper);
|
||||
|
||||
//保存
|
||||
this.saveBatch(userRoles);
|
||||
|
@ -27,7 +27,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
@ -57,9 +56,6 @@ public class FullDiscountServiceImpl extends ServiceImpl<FullDiscountMapper, Ful
|
||||
//Mongo
|
||||
@Autowired
|
||||
private MongoTemplate mongoTemplate;
|
||||
//满额活动
|
||||
@Autowired
|
||||
private FullDiscountMapper fullDiscountMapper;
|
||||
//Rocketmq
|
||||
@Autowired
|
||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||
@ -251,7 +247,7 @@ public class FullDiscountServiceImpl extends ServiceImpl<FullDiscountMapper, Ful
|
||||
private void checkSameActiveExist(Date statTime, Date endTime, String storeId, String id) {
|
||||
// 同一时间段内相同的活动
|
||||
QueryWrapper<FullDiscount> queryWrapper = PromotionTools.checkActiveTime(statTime, endTime, PromotionTypeEnum.FULL_DISCOUNT, storeId, id);
|
||||
Integer sameNum = this.fullDiscountMapper.selectCount(queryWrapper);
|
||||
Integer sameNum = this.count(queryWrapper);
|
||||
if (sameNum > 0) {
|
||||
throw new ServiceException("当前时间内已存在同类活动");
|
||||
}
|
||||
|
@ -25,8 +25,6 @@ import java.util.List;
|
||||
@Service
|
||||
@Transactional
|
||||
public class PurchaseQuotedServiceImpl extends ServiceImpl<PurchaseQuotedMapper, PurchaseQuoted> implements PurchaseQuotedService {
|
||||
@Autowired
|
||||
private PurchaseQuotedMapper purchaseQuotedMapper;
|
||||
@Autowired
|
||||
private PurchaseQuotedItemService purchaseQuotedItemService;
|
||||
|
||||
|
@ -24,7 +24,6 @@ import java.util.List;
|
||||
@Service
|
||||
public class CustomWordsServiceImpl extends ServiceImpl<CustomWordsMapper, CustomWords> implements CustomWordsService {
|
||||
|
||||
|
||||
@Override
|
||||
public String deploy() {
|
||||
LambdaQueryWrapper<CustomWords> queryWrapper = new LambdaQueryWrapper<CustomWords>().eq(CustomWords::getDisabled, 1);
|
||||
|
@ -30,12 +30,6 @@ import java.util.List;
|
||||
@Service
|
||||
public class GoodsStatisticsDataServiceImpl extends ServiceImpl<GoodsStatisticsDataMapper, StoreFlow> implements GoodsStatisticsDataService {
|
||||
|
||||
/**
|
||||
* 商品统计
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsStatisticsDataMapper goodsStatisticsDataMapper;
|
||||
|
||||
@Override
|
||||
public List<GoodsStatisticsDataVO> getGoodsStatisticsData(GoodsStatisticsQueryParam goodsStatisticsQueryParam, Integer num) {
|
||||
//获取查询条件
|
||||
@ -47,7 +41,7 @@ public class GoodsStatisticsDataServiceImpl extends ServiceImpl<GoodsStatisticsD
|
||||
queryWrapper.eq(!StringUtils.isEmpty(goodsStatisticsQueryParam.getStoreId()), "store_id", goodsStatisticsQueryParam.getStoreId());
|
||||
//查询前一百条记录
|
||||
Page page = new Page<GoodsStatisticsDataVO>(1, num);
|
||||
return goodsStatisticsDataMapper.getGoodsStatisticsData(page, queryWrapper);
|
||||
return this.baseMapper.getGoodsStatisticsData(page, queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -56,7 +50,7 @@ public class GoodsStatisticsDataServiceImpl extends ServiceImpl<GoodsStatisticsD
|
||||
QueryWrapper queryWrapper = getQueryWrapper(goodsStatisticsQueryParam);
|
||||
//根据分类分组
|
||||
queryWrapper.groupBy("category_id");
|
||||
return goodsStatisticsDataMapper.getCateGoryStatisticsData(queryWrapper);
|
||||
return this.baseMapper.getCateGoryStatisticsData(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,7 +9,6 @@ import cn.lili.modules.statistics.util.StatisticsDateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
@ -24,31 +23,25 @@ import java.util.List;
|
||||
@Service
|
||||
public class MemberStatisticsDataServiceImpl extends ServiceImpl<MemberStatisticsDataMapper, MemberStatisticsData> implements MemberStatisticsDataService {
|
||||
|
||||
/**
|
||||
* 会员统计
|
||||
*/
|
||||
@Autowired
|
||||
private MemberStatisticsDataMapper memberStatisticsDataMapper;
|
||||
|
||||
@Override
|
||||
public Integer getMemberCount() {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("disabled", true);
|
||||
return memberStatisticsDataMapper.customSqlQuery(queryWrapper);
|
||||
return this.baseMapper.customSqlQuery(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer todayMemberNum() {
|
||||
QueryWrapper queryWrapper = Wrappers.query();
|
||||
queryWrapper.gt("create_time", DateUtil.beginOfDay(new Date()));
|
||||
return memberStatisticsDataMapper.customSqlQuery(queryWrapper);
|
||||
return this.baseMapper.customSqlQuery(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer memberCount(Date endTime) {
|
||||
QueryWrapper queryWrapper = Wrappers.query();
|
||||
queryWrapper.lt("create_time", endTime);
|
||||
return memberStatisticsDataMapper.customSqlQuery(queryWrapper);
|
||||
return this.baseMapper.customSqlQuery(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -56,14 +49,14 @@ public class MemberStatisticsDataServiceImpl extends ServiceImpl<MemberStatistic
|
||||
|
||||
QueryWrapper queryWrapper = Wrappers.query();
|
||||
queryWrapper.ge("last_login_date", startTime);
|
||||
return memberStatisticsDataMapper.customSqlQuery(queryWrapper);
|
||||
return this.baseMapper.customSqlQuery(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer newlyAdded(Date startTime, Date endTime) {
|
||||
QueryWrapper queryWrapper = Wrappers.query();
|
||||
queryWrapper.between("create_time", startTime, endTime);
|
||||
return memberStatisticsDataMapper.customSqlQuery(queryWrapper);
|
||||
return this.baseMapper.customSqlQuery(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,10 +36,6 @@ import java.util.*;
|
||||
*/
|
||||
@Service
|
||||
public class OrderStatisticsDataServiceImpl extends ServiceImpl<OrderStatisticsDataMapper, StoreFlow> implements OrderStatisticsDataService {
|
||||
|
||||
//订单统计
|
||||
@Autowired
|
||||
private OrderStatisticsDataMapper orderStatisticsDataMapper;
|
||||
//平台PV统计
|
||||
@Autowired
|
||||
private PlatformViewDataService platformViewDataService;
|
||||
@ -215,7 +211,7 @@ public class OrderStatisticsDataServiceImpl extends ServiceImpl<OrderStatisticsD
|
||||
queryWrapper.between("create_time", dates[0], dates[1]);
|
||||
// 格式化时间
|
||||
queryWrapper.groupBy("DATE_FORMAT(create_time,'%Y-%m-%d')");
|
||||
List<OrderStatisticsDataVO> orderStatisticsDataVOS = orderStatisticsDataMapper.getOrderStatisticsData(queryWrapper);
|
||||
List<OrderStatisticsDataVO> orderStatisticsDataVOS = this.baseMapper.getOrderStatisticsData(queryWrapper);
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(dates[0]);
|
||||
|
||||
|
@ -21,7 +21,6 @@ import cn.lili.modules.statistics.util.StatisticsSuffix;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -49,9 +48,6 @@ public class PlatformViewDataServiceImpl extends ServiceImpl<PlatformViewDataMap
|
||||
//会员
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
//平台流量统计
|
||||
@Autowired
|
||||
private PlatformViewDataMapper platformViewDataMapper;
|
||||
//缓存
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
@ -242,7 +238,7 @@ public class PlatformViewDataServiceImpl extends ServiceImpl<PlatformViewDataMap
|
||||
} else {
|
||||
queryWrapper.eq("store_id", -1);
|
||||
}
|
||||
return platformViewDataMapper.count(queryWrapper);
|
||||
return this.count(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,8 +15,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@ -28,14 +26,10 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class RefundOrderStatisticsServiceImpl extends ServiceImpl<RefundOrderStatisticsDataMapper, StoreFlow> implements RefundOrderStatisticsService {
|
||||
|
||||
//退款统计
|
||||
@Autowired
|
||||
private RefundOrderStatisticsDataMapper refundOrderStatisticsDataMapper;
|
||||
|
||||
@Override
|
||||
public IPage<RefundOrderStatisticsDataVO> getRefundOrderStatisticsData(PageVO pageVO, StatisticsQueryParam statisticsQueryParam) {
|
||||
QueryWrapper queryWrapper = getQueryWrapper(statisticsQueryParam);
|
||||
return refundOrderStatisticsDataMapper.getRefundStatisticsData(PageUtil.initPage(pageVO), queryWrapper);
|
||||
return this.baseMapper.getRefundStatisticsData(PageUtil.initPage(pageVO), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -49,9 +49,6 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
|
||||
//商家流水
|
||||
@Autowired
|
||||
private StoreFlowService storeFlowService;
|
||||
//结算单
|
||||
@Autowired
|
||||
private BillMapper billMapper;
|
||||
|
||||
@Override
|
||||
public void createBill(String storeId, Date startTime) {
|
||||
@ -77,7 +74,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
|
||||
bill.setSn(SnowFlake.createStr("B"));
|
||||
|
||||
//入账结算信息
|
||||
Bill orderBill = billMapper.getOrderBill(storeId, FlowTypeEnum.PAY.name());
|
||||
Bill orderBill = this.baseMapper.getOrderBill(storeId, FlowTypeEnum.PAY.name());
|
||||
Double orderPrice = 0D;
|
||||
if (orderBill != null) {
|
||||
bill.setOrderPrice(orderBill.getOrderPrice());
|
||||
@ -89,7 +86,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
|
||||
|
||||
|
||||
//退款结算信息
|
||||
Bill refundBill = billMapper.getRefundBill(storeId, FlowTypeEnum.REFUND.name());
|
||||
Bill refundBill = this.baseMapper.getRefundBill(storeId, FlowTypeEnum.REFUND.name());
|
||||
Double refundPrice = 0D;
|
||||
if(refundBill!=null){
|
||||
bill.setRefundPrice(refundBill.getRefundPrice());
|
||||
@ -152,7 +149,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
|
||||
@Override
|
||||
public IPage<BillListVO> billPage(BillSearchParams billSearchParams) {
|
||||
QueryWrapper<BillListVO> queryWrapper = billSearchParams.queryWrapper();
|
||||
return billMapper.queryBillPage(PageUtil.initPage(billSearchParams), queryWrapper);
|
||||
return this.baseMapper.queryBillPage(PageUtil.initPage(billSearchParams), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,8 +6,6 @@ import cn.lili.modules.store.service.FreightTemplateChildService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -23,15 +21,11 @@ import java.util.List;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class FreightTemplateServiceChildImpl extends ServiceImpl<FreightTemplateChildMapper, FreightTemplateChild> implements FreightTemplateChildService {
|
||||
|
||||
//配送子模板数据层
|
||||
@Autowired
|
||||
private FreightTemplateChildMapper freightTemplateChildMapper;
|
||||
|
||||
@Override
|
||||
public List<FreightTemplateChild> getFreightTemplateChild(String freightTemplateId) {
|
||||
LambdaQueryWrapper<FreightTemplateChild> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(FreightTemplateChild::getFreightTemplateId, freightTemplateId);
|
||||
return freightTemplateChildMapper.selectList(lambdaQueryWrapper);
|
||||
return this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,7 +19,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -37,10 +36,6 @@ import java.util.List;
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class FreightTemplateServiceImpl extends ServiceImpl<FreightTemplateMapper, FreightTemplate> implements FreightTemplateService {
|
||||
|
||||
//配送模板
|
||||
@Autowired
|
||||
private FreightTemplateMapper freightTemplateMapper;
|
||||
//配送子模板
|
||||
@Autowired
|
||||
private FreightTemplateChildService freightTemplateChildService;
|
||||
@ -60,7 +55,7 @@ public class FreightTemplateServiceImpl extends ServiceImpl<FreightTemplateMappe
|
||||
//查询运费模板
|
||||
LambdaQueryWrapper<FreightTemplate> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(FreightTemplate::getStoreId, UserContext.getCurrentUser().getId());
|
||||
List<FreightTemplate> freightTemplates = freightTemplateMapper.selectList(lambdaQueryWrapper);
|
||||
List<FreightTemplate> freightTemplates = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
if (!freightTemplates.isEmpty()) {
|
||||
//如果模板不为空则查询子模板信息
|
||||
for (FreightTemplate freightTemplate : freightTemplates) {
|
||||
@ -80,18 +75,16 @@ public class FreightTemplateServiceImpl extends ServiceImpl<FreightTemplateMappe
|
||||
|
||||
@Override
|
||||
public IPage<FreightTemplate> getFreightTemplate(PageVO pageVo) {
|
||||
//获取当前登录商家账号
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
LambdaQueryWrapper<FreightTemplate> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(FreightTemplate::getStoreId, UserContext.getCurrentUser().getId());
|
||||
return freightTemplateMapper.selectPage(PageUtil.initPage(pageVo), lambdaQueryWrapper);
|
||||
lambdaQueryWrapper.eq(FreightTemplate::getStoreId, UserContext.getCurrentUser().getStoreId());
|
||||
return this.baseMapper.selectPage(PageUtil.initPage(pageVo), lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FreightTemplateVO getFreightTemplate(String id) {
|
||||
FreightTemplateVO freightTemplateVO = new FreightTemplateVO();
|
||||
//获取运费模板
|
||||
FreightTemplate freightTemplate = freightTemplateMapper.selectById(id);
|
||||
FreightTemplate freightTemplate = this.getById(id);
|
||||
if (freightTemplate != null) {
|
||||
//复制属性
|
||||
BeanUtils.copyProperties(freightTemplate, freightTemplateVO);
|
||||
@ -112,7 +105,7 @@ public class FreightTemplateServiceImpl extends ServiceImpl<FreightTemplateMappe
|
||||
//复制属性
|
||||
BeanUtils.copyProperties(freightTemplateVO, freightTemplate);
|
||||
//添加运费模板
|
||||
freightTemplateMapper.insert(freightTemplate);
|
||||
this.save(freightTemplate);
|
||||
//给子模板赋父模板的id
|
||||
List<FreightTemplateChild> list = new ArrayList<>();
|
||||
for (FreightTemplateChild freightTemplateChild : freightTemplateVO.getFreightTemplateChildList()) {
|
||||
@ -138,7 +131,7 @@ public class FreightTemplateServiceImpl extends ServiceImpl<FreightTemplateMappe
|
||||
//复制属性
|
||||
BeanUtils.copyProperties(freightTemplateVO, freightTemplate);
|
||||
//修改运费模板
|
||||
freightTemplateMapper.updateById(freightTemplate);
|
||||
this.updateById(freightTemplate);
|
||||
//删除模板子内容
|
||||
freightTemplateChildService.removeFreightTemplate(freightTemplateVO.getId());
|
||||
//给子模板赋父模板的id
|
||||
|
@ -11,8 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -26,25 +24,20 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class StoreAddressServiceImpl extends ServiceImpl<StoreAddressMapper, StoreAddress> implements StoreAddressService {
|
||||
|
||||
@Autowired
|
||||
private StoreAddressMapper storeAddressMapper;
|
||||
|
||||
@Override
|
||||
public IPage<StoreAddress> getStoreAddress(PageVO pageVo) {
|
||||
//获取当前登录商家账号
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
LambdaQueryWrapper<StoreAddress> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(StoreAddress::getStoreId, UserContext.getCurrentUser().getStoreId());
|
||||
return storeAddressMapper.selectPage(PageUtil.initPage(pageVo), lambdaQueryWrapper);
|
||||
return this.page(PageUtil.initPage(pageVo), lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreAddress addStoreAddress(StoreAddress storeAddress) {
|
||||
//获取当前登录商家账号
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
storeAddress.setStoreId(tokenUser.getId());
|
||||
storeAddress.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
//添加自提点
|
||||
storeAddressMapper.insert(storeAddress);
|
||||
this.save(storeAddress);
|
||||
return storeAddress;
|
||||
}
|
||||
|
||||
@ -54,13 +47,12 @@ public class StoreAddressServiceImpl extends ServiceImpl<StoreAddressMapper, Sto
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
storeAddress.setStoreId(tokenUser.getId());
|
||||
//添加自提点
|
||||
storeAddressMapper.updateById(storeAddress);
|
||||
this.updateById(storeAddress);
|
||||
return storeAddress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeStoreAddress(String id) {
|
||||
storeAddressMapper.deleteById(id);
|
||||
return true;
|
||||
return this.removeById(id);
|
||||
}
|
||||
}
|
@ -19,7 +19,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -37,9 +36,6 @@ import java.util.List;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class StoreDetailServiceImpl extends ServiceImpl<StoreDetailMapper, StoreDetail> implements StoreDetailService {
|
||||
|
||||
//店铺详情数据层
|
||||
@Autowired
|
||||
private StoreDetailMapper storeDetailMapper;
|
||||
//店铺
|
||||
@Autowired
|
||||
private StoreService storeService;
|
||||
@ -49,12 +45,12 @@ public class StoreDetailServiceImpl extends ServiceImpl<StoreDetailMapper, Store
|
||||
|
||||
@Override
|
||||
public StoreDetailVO getStoreDetailVO(String storeId) {
|
||||
return storeDetailMapper.getStoreDetail(storeId);
|
||||
return this.baseMapper.getStoreDetail(storeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreDetailVO getStoreDetailVOByMemberId(String memberId) {
|
||||
return storeDetailMapper.getStoreDetailByMemberId(memberId);
|
||||
return this.baseMapper.getStoreDetailByMemberId(memberId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -75,17 +71,17 @@ public class StoreDetailServiceImpl extends ServiceImpl<StoreDetailMapper, Store
|
||||
|
||||
@Override
|
||||
public StoreBasicInfoVO getStoreBasicInfoDTO(String storeId) {
|
||||
return storeDetailMapper.getStoreBasicInfoDTO(storeId);
|
||||
return this.baseMapper.getStoreBasicInfoDTO(storeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreAfterSaleAddressDTO getStoreAfterSaleAddressDTO() {
|
||||
return storeDetailMapper.getStoreAfterSaleAddressDTO(UserContext.getCurrentUser().getStoreId());
|
||||
return this.baseMapper.getStoreAfterSaleAddressDTO(UserContext.getCurrentUser().getStoreId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreAfterSaleAddressDTO getStoreAfterSaleAddressDTO(String id) {
|
||||
StoreAfterSaleAddressDTO storeAfterSaleAddressDTO = storeDetailMapper.getStoreAfterSaleAddressDTO(id);
|
||||
StoreAfterSaleAddressDTO storeAfterSaleAddressDTO = this.baseMapper.getStoreAfterSaleAddressDTO(id);
|
||||
if (storeAfterSaleAddressDTO == null) {
|
||||
storeAfterSaleAddressDTO = new StoreAfterSaleAddressDTO();
|
||||
}
|
||||
|
@ -10,8 +10,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -28,9 +26,6 @@ import java.util.List;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMapper, StoreGoodsLabel> implements StoreGoodsLabelService {
|
||||
|
||||
@Autowired
|
||||
private StoreGoodsLabelMapper storeGoodsLabelMapper;
|
||||
|
||||
@Override
|
||||
public List<StoreGoodsLabelVO> listByStoreId(String storeId) {
|
||||
//TODO 从缓存获取店铺商品分类列表
|
||||
@ -68,7 +63,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
|
||||
private List<StoreGoodsLabel> list(String storeId) {
|
||||
LambdaQueryWrapper<StoreGoodsLabel> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(StoreGoodsLabel::getStoreId, storeId);
|
||||
return storeGoodsLabelMapper.selectList(queryWrapper);
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -76,7 +71,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
|
||||
//获取当前登录商家账号
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
storeGoodsLabel.setStoreId(tokenUser.getStoreId());
|
||||
storeGoodsLabelMapper.insert(storeGoodsLabel);
|
||||
this.save(storeGoodsLabel);
|
||||
return storeGoodsLabel;
|
||||
}
|
||||
|
||||
@ -87,12 +82,12 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
|
||||
LambdaUpdateWrapper<StoreGoodsLabel> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
||||
lambdaUpdateWrapper.eq(StoreGoodsLabel::getStoreId, tokenUser.getStoreId());
|
||||
lambdaUpdateWrapper.eq(StoreGoodsLabel::getId, storeGoodsLabel.getId());
|
||||
storeGoodsLabelMapper.update(storeGoodsLabel, lambdaUpdateWrapper);
|
||||
this.update(storeGoodsLabel, lambdaUpdateWrapper);
|
||||
return storeGoodsLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeStoreGoodsLabel(String storeLabelId) {
|
||||
storeGoodsLabelMapper.deleteById(storeLabelId);
|
||||
this.removeById(storeLabelId);
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@ package cn.lili.modules.store.serviceimpl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.lili.common.enums.SwitchEnum;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.SwitchEnum;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
@ -35,7 +35,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -52,9 +51,6 @@ import java.util.Optional;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements StoreService {
|
||||
|
||||
//店铺
|
||||
@Autowired
|
||||
private StoreMapper storeMapper;
|
||||
//会员
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
@ -76,12 +72,12 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
||||
|
||||
@Override
|
||||
public IPage<StoreVO> findByConditionPage(StoreSearchParams storeSearchParams, PageVO page) {
|
||||
return storeMapper.getStoreList(PageUtil.initPage(page), storeSearchParams.queryWrapper());
|
||||
return this.baseMapper.getStoreList(PageUtil.initPage(page), storeSearchParams.queryWrapper());
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreVO getStoreDetail() {
|
||||
StoreVO storeVO = storeMapper.getStoreDetail(UserContext.getCurrentUser().getStoreId());
|
||||
StoreVO storeVO = this.baseMapper.getStoreDetail(UserContext.getCurrentUser().getStoreId());
|
||||
storeVO.setNickName(UserContext.getCurrentUser().getNickName());
|
||||
return storeVO;
|
||||
}
|
||||
@ -169,7 +165,7 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
||||
|
||||
@Override
|
||||
public boolean audit(String id, Integer passed) {
|
||||
Store store = storeMapper.selectById(id);
|
||||
Store store = this.getById(id);
|
||||
if (store == null) {
|
||||
throw new ServiceException(ResultCode.STORE_NOT_EXIST);
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ import cn.lili.modules.system.service.StoreLogisticsService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -25,17 +24,14 @@ import java.util.List;
|
||||
|
||||
public class StoreLogisticsServiceImpl extends ServiceImpl<StoreLogisticsMapper, StoreLogistics> implements StoreLogisticsService {
|
||||
|
||||
@Autowired
|
||||
private StoreLogisticsMapper storeLogisticsMapper;
|
||||
|
||||
@Override
|
||||
public List<StoreLogisticsVO> getStoreLogistics() {
|
||||
return storeLogisticsMapper.getStoreLogistics(UserContext.getCurrentUser().getStoreId());
|
||||
return this.baseMapper.getStoreLogistics(UserContext.getCurrentUser().getStoreId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreLogisticsVO> getStoreSelectedLogistics() {
|
||||
return storeLogisticsMapper.getSelectedStoreLogistics(UserContext.getCurrentUser().getStoreId());
|
||||
return this.baseMapper.getSelectedStoreLogistics(UserContext.getCurrentUser().getStoreId());
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user