去除冗余代码

This commit is contained in:
lifenlong 2021-05-17 12:55:40 +08:00
parent b0f46a78a6
commit c049552fc7
48 changed files with 125 additions and 313 deletions

View File

@ -7,8 +7,6 @@ import cn.lili.modules.connect.mapper.ConnectConfigMapper;
import cn.lili.modules.connect.service.ConnectConfigService; import cn.lili.modules.connect.service.ConnectConfigService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -23,8 +21,6 @@ import java.util.List;
@Service @Service
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class ConnectConfigServiceImpl extends ServiceImpl<ConnectConfigMapper, ConnectConfig> implements ConnectConfigService { public class ConnectConfigServiceImpl extends ServiceImpl<ConnectConfigMapper, ConnectConfig> implements ConnectConfigService {
@Autowired
private ConnectConfigMapper connectConfigMapper;
@Override @Override
public List<ConnectConfigForm> listForms() { public List<ConnectConfigForm> listForms() {

View File

@ -34,9 +34,6 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional @Transactional
public class DistributionGoodsServiceImpl extends ServiceImpl<DistributionGoodsMapper, DistributionGoods> implements DistributionGoodsService { public class DistributionGoodsServiceImpl extends ServiceImpl<DistributionGoodsMapper, DistributionGoods> implements DistributionGoodsService {
//分销商品
@Autowired
private DistributionGoodsMapper distributionGoodsMapper;
//分销员 //分销员
@Autowired @Autowired
private DistributionService distributionService; private DistributionService distributionService;
@ -48,22 +45,22 @@ public class DistributionGoodsServiceImpl extends ServiceImpl<DistributionGoodsM
public IPage<DistributionGoodsVO> goodsPage(DistributionGoodsSearchParams searchParams) { public IPage<DistributionGoodsVO> goodsPage(DistributionGoodsSearchParams searchParams) {
//获取商家的分销商品列表 //获取商家的分销商品列表
if (UserContext.getCurrentUser().getRole().equals(UserEnums.STORE)) { 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)) { } else if (UserContext.getCurrentUser().getRole().equals(UserEnums.MEMBER)) {
//判断当前登录用户是否为分销员 //判断当前登录用户是否为分销员
Distribution distribution = distributionService.getDistribution(); Distribution distribution = distributionService.getDistribution();
if (distribution != null) { if (distribution != null) {
//判断查看已选择的分销商品列表 //判断查看已选择的分销商品列表
if (searchParams.isChecked()) { 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 { } 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); 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 @Override

View File

@ -43,10 +43,6 @@ public class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Dis
@Autowired @Autowired
private MemberService memberService; private MemberService memberService;
//分销员
@Autowired
private DistributionMapper distributionMapper;
//缓存 //缓存
@Autowired @Autowired
private Cache cache; private Cache cache;
@ -176,7 +172,7 @@ public class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Dis
@Override @Override
public void updateCanRebate(Double canRebate, String distributionId) { public void updateCanRebate(Double canRebate, String distributionId) {
this.distributionMapper.updateCanRebate(canRebate,distributionId); this.baseMapper.updateCanRebate(canRebate,distributionId);
} }
} }

View File

@ -24,18 +24,14 @@ import java.util.List;
@Transactional @Transactional
public class CategoryBrandServiceImpl extends ServiceImpl<CategoryBrandMapper, CategoryBrand> implements CategoryBrandService { public class CategoryBrandServiceImpl extends ServiceImpl<CategoryBrandMapper, CategoryBrand> implements CategoryBrandService {
//分类品牌绑定
@Autowired
private CategoryBrandMapper categoryBrandMapper;
@Override @Override
public List<CategoryBrandVO> getCategoryBrandList(String categoryId) { public List<CategoryBrandVO> getCategoryBrandList(String categoryId) {
return categoryBrandMapper.getCategoryBrandList(categoryId); return this.baseMapper.getCategoryBrandList(categoryId);
} }
@Override @Override
public void deleteByCategoryId(String categoryId) { 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 @Override

View File

@ -40,9 +40,6 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
//缓存 //缓存
@Autowired @Autowired
private Cache cache; private Cache cache;
//分类
@Autowired
private CategoryMapper categoryMapper;
@Override @Override
public List<Category> dbList(String parentId) { 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()) .ne(category.getId() != null, "id", category.getId())
.eq(DELETE_FLAG_COLUMN, false) .eq(DELETE_FLAG_COLUMN, false)
.orderByAsc("sort_order"); .orderByAsc("sort_order");
return this.categoryMapper.selectList(queryWrapper); return this.baseMapper.selectList(queryWrapper);
} }
@Override @Override
@ -187,7 +184,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
.set("sort_order", category.getSortOrder()) .set("sort_order", category.getSortOrder())
.set(DELETE_FLAG_COLUMN, category.getDeleteFlag()) .set(DELETE_FLAG_COLUMN, category.getDeleteFlag())
.set("commission_rate", category.getCommissionRate()); .set("commission_rate", category.getCommissionRate());
categoryMapper.update(category, updateWrapper); this.baseMapper.update(category, updateWrapper);
removeCache(); removeCache();
} }

View File

@ -23,12 +23,10 @@ import java.util.List;
@Service @Service
@Transactional @Transactional
public class CategorySpecificationServiceImpl extends ServiceImpl<CategorySpecificationMapper, CategorySpecification> implements CategorySpecificationService { public class CategorySpecificationServiceImpl extends ServiceImpl<CategorySpecificationMapper, CategorySpecification> implements CategorySpecificationService {
@Autowired
private CategorySpecificationMapper categorySpecificationMapper;
@Override @Override
public List<CategorySpecificationVO> getCategorySpecList(String categoryId) { public List<CategorySpecificationVO> getCategorySpecList(String categoryId) {
return categorySpecificationMapper.getCategorySpecList(categoryId); return this.baseMapper.getCategorySpecList(categoryId);
} }
@Override @Override
@ -38,6 +36,6 @@ public class CategorySpecificationServiceImpl extends ServiceImpl<CategorySpecif
@Override @Override
public void deleteByCategoryId(String categoryId) { public void deleteByCategoryId(String categoryId) {
categorySpecificationMapper.delete(new LambdaQueryWrapper<CategorySpecification>().eq(CategorySpecification::getCategoryId,categoryId)); this.baseMapper.delete(new LambdaQueryWrapper<CategorySpecification>().eq(CategorySpecification::getCategoryId,categoryId));
} }
} }

View File

@ -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.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -33,9 +32,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
//文件 //文件
@Autowired @Autowired
private FileManagerPlugin fileManagerPlugin; private FileManagerPlugin fileManagerPlugin;
//商品相册数据层
@Autowired
private GoodsGalleryMapper goodsGalleryMapper;
//设置 //设置
@Autowired @Autowired
private SettingService settingService; private SettingService settingService;
@ -44,7 +41,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
@Override @Override
public void add(List<String> goodsGalleryList, String goodsId) { 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; int i = 0;
for (String origin : goodsGalleryList) { for (String origin : goodsGalleryList) {
@ -54,7 +51,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
// 默认第一个为默认图片 // 默认第一个为默认图片
galley.setIsDefault(i == 0 ? 1 : 0); galley.setIsDefault(i == 0 ? 1 : 0);
i++; i++;
this.goodsGalleryMapper.insert(galley); this.baseMapper.insert(galley);
} }
} }
@ -78,6 +75,6 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
@Override @Override
public List<GoodsGallery> goodsGalleryList(String goodsId) { public List<GoodsGallery> goodsGalleryList(String goodsId) {
//根据商品id查询商品相册 //根据商品id查询商品相册
return goodsGalleryMapper.selectList(new QueryWrapper<GoodsGallery>().eq("goods_id", goodsId)); return this.baseMapper.selectList(new QueryWrapper<GoodsGallery>().eq("goods_id", goodsId));
} }
} }

View File

@ -55,9 +55,6 @@ import java.util.List;
@Transactional @Transactional
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService { public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {
//商品
@Autowired
private GoodsMapper goodsMapper;
//商品属性 //商品属性
@Autowired @Autowired
private GoodsParamsService goodsParamsService; private GoodsParamsService goodsParamsService;
@ -85,7 +82,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
@Override @Override
public void underStoreGoods(String storeId) { public void underStoreGoods(String storeId) {
this.goodsMapper.underStoreGoods(storeId); this.baseMapper.underStoreGoods(storeId);
} }
@Override @Override

View File

@ -11,7 +11,6 @@ import cn.lili.modules.search.service.EsGoodsSearchService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -30,9 +29,6 @@ import java.util.Objects;
@Transactional @Transactional
public class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint> implements FootprintService { public class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint> implements FootprintService {
//足迹数据层
@Autowired
private FootprintMapper footprintMapper;
//es商品业务层 //es商品业务层
@Autowired @Autowired
private EsGoodsSearchService esGoodsSearchService; private EsGoodsSearchService esGoodsSearchService;
@ -54,7 +50,7 @@ public class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint
footPrint.setCreateTime(new Date()); footPrint.setCreateTime(new Date());
this.save(footPrint); this.save(footPrint);
//删除超过100条后的记录 //删除超过100条后的记录
footprintMapper.deleteLastFootPrint(footPrint.getMemberId()); this.baseMapper.deleteLastFootPrint(footPrint.getMemberId());
return footPrint; return footPrint;
} }
} }
@ -82,7 +78,7 @@ public class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint
lambdaQueryWrapper.eq(FootPrint::getMemberId, UserContext.getCurrentUser().getId()); lambdaQueryWrapper.eq(FootPrint::getMemberId, UserContext.getCurrentUser().getId());
lambdaQueryWrapper.eq(FootPrint::getDeleteFlag,false); lambdaQueryWrapper.eq(FootPrint::getDeleteFlag,false);
lambdaQueryWrapper.orderByDesc(FootPrint::getUpdateTime); 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) { if (skuIdList.size() > 0) {
List<EsGoodsIndex> list = esGoodsSearchService.getEsGoodsBySkuIds(skuIdList); List<EsGoodsIndex> list = esGoodsSearchService.getEsGoodsBySkuIds(skuIdList);
//去除为空的商品数据 //去除为空的商品数据

View File

@ -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.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -37,9 +36,6 @@ import java.util.Optional;
public class GoodsCollectionServiceImpl extends ServiceImpl<GoodsCollectionMapper, GoodsCollection> implements GoodsCollectionService { public class GoodsCollectionServiceImpl extends ServiceImpl<GoodsCollectionMapper, GoodsCollection> implements GoodsCollectionService {
//商品收藏
@Autowired
private GoodsCollectionMapper goodsCollectionMapper;
//rocketMq //rocketMq
@Autowired @Autowired
private RocketMQTemplate rocketMQTemplate; private RocketMQTemplate rocketMQTemplate;
@ -53,7 +49,7 @@ public class GoodsCollectionServiceImpl extends ServiceImpl<GoodsCollectionMappe
queryWrapper.eq("gc.member_id", UserContext.getCurrentUser().getId()); queryWrapper.eq("gc.member_id", UserContext.getCurrentUser().getId());
queryWrapper.groupBy("gc.id"); queryWrapper.groupBy("gc.id");
queryWrapper.orderByDesc("gc.create_time"); queryWrapper.orderByDesc("gc.create_time");
return goodsCollectionMapper.goodsCollectionVOList(PageUtil.initPage(pageVo), queryWrapper); return this.baseMapper.goodsCollectionVOList(PageUtil.initPage(pageVo), queryWrapper);
} }
@Override @Override

View File

@ -61,9 +61,6 @@ import java.util.Map;
@Transactional @Transactional
public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMapper, MemberEvaluation> implements MemberEvaluationService { public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMapper, MemberEvaluation> implements MemberEvaluationService {
//会员评价数据层
@Autowired
private MemberEvaluationMapper memberEvaluationMapper;
//订单 //订单
@Autowired @Autowired
private OrderService orderService; private OrderService orderService;
@ -91,12 +88,12 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
@Override @Override
public IPage<MemberEvaluationListVO> queryByParams(StoreEvaluationQueryParams storeEvaluationQueryParams) { public IPage<MemberEvaluationListVO> queryByParams(StoreEvaluationQueryParams storeEvaluationQueryParams) {
return memberEvaluationMapper.getMemberEvaluationList(PageUtil.initPage(storeEvaluationQueryParams), storeEvaluationQueryParams.queryWrapper()); return this.baseMapper.getMemberEvaluationList(PageUtil.initPage(storeEvaluationQueryParams), storeEvaluationQueryParams.queryWrapper());
} }
@Override @Override
public IPage<MemberEvaluationListVO> queryPage(EvaluationQueryParams evaluationQueryParams, PageVO page) { 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 @Override
@ -163,7 +160,7 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
@Override @Override
public EvaluationNumberVO getEvaluationNumber(String goodsId) { public EvaluationNumberVO getEvaluationNumber(String goodsId) {
EvaluationNumberVO evaluationNumberVO = new EvaluationNumberVO(); 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 good = 0;
Integer moderate = 0; Integer moderate = 0;

View File

@ -22,8 +22,6 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional @Transactional
public class MemberPointsHistoryServiceImpl extends ServiceImpl<MemberPointsHistoryMapper, MemberPointsHistory> implements MemberPointsHistoryService { public class MemberPointsHistoryServiceImpl extends ServiceImpl<MemberPointsHistoryMapper, MemberPointsHistory> implements MemberPointsHistoryService {
@Autowired
private MemberPointsHistoryMapper memberPointsHistoryMapper;
@Override @Override
public MemberPointsHistoryVO getMemberPointsHistoryVO(String memberId) { public MemberPointsHistoryVO getMemberPointsHistoryVO(String memberId) {
@ -32,12 +30,12 @@ public class MemberPointsHistoryServiceImpl extends ServiceImpl<MemberPointsHist
Long variablePoint = 0L; Long variablePoint = 0L;
if (StringUtils.isNotEmpty(memberId)) { if (StringUtils.isNotEmpty(memberId)) {
point = memberPointsHistoryMapper.getMemberPointsHistoryVO(1, memberId); point = this.baseMapper.getMemberPointsHistoryVO(1, memberId);
variablePoint = memberPointsHistoryMapper.getMemberPointsHistoryVO(0, memberId); variablePoint = this.baseMapper.getMemberPointsHistoryVO(0, memberId);
} else { } else {
point = memberPointsHistoryMapper.getALLMemberPointsHistoryVO(0); point = this.baseMapper.getALLMemberPointsHistoryVO(0);
variablePoint = memberPointsHistoryMapper.getALLMemberPointsHistoryVO(1); variablePoint = this.baseMapper.getALLMemberPointsHistoryVO(1);
} }
memberPointsHistoryVO.setPoint(point == null ? 0 : point); memberPointsHistoryVO.setPoint(point == null ? 0 : point);
memberPointsHistoryVO.setVariablePoint(variablePoint == null ? 0 : variablePoint); memberPointsHistoryVO.setVariablePoint(variablePoint == null ? 0 : variablePoint);

View File

@ -62,9 +62,6 @@ import java.util.List;
@Transactional @Transactional
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements MemberService { public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements MemberService {
//会员数据处理层
@Autowired
private MemberMapper memberMapper;
//会员token //会员token
@Autowired @Autowired
private MemberTokenGenerate memberTokenGenerate; private MemberTokenGenerate memberTokenGenerate;
@ -90,7 +87,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
public Member findByUsername(String userName) { public Member findByUsername(String userName) {
QueryWrapper<Member> queryWrapper = new QueryWrapper(); QueryWrapper<Member> queryWrapper = new QueryWrapper();
queryWrapper.eq("username", userName); 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) { public boolean findByMobile(String uuid, String mobile) {
QueryWrapper<Member> queryWrapper = new QueryWrapper(); QueryWrapper<Member> queryWrapper = new QueryWrapper();
queryWrapper.eq("mobile", mobile); queryWrapper.eq("mobile", mobile);
Member member = memberMapper.selectOne(queryWrapper); Member member = this.baseMapper.selectOne(queryWrapper);
if (member == null) { if (member == null) {
throw new ServiceException(ResultCode.USER_NOT_PHONE); throw new ServiceException(ResultCode.USER_NOT_PHONE);
} }
@ -204,7 +201,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
public Token mobilePhoneLogin(String mobilePhone) { public Token mobilePhoneLogin(String mobilePhone) {
QueryWrapper<Member> queryWrapper = new QueryWrapper(); QueryWrapper<Member> queryWrapper = new QueryWrapper();
queryWrapper.eq("mobile", mobilePhone); queryWrapper.eq("mobile", mobilePhone);
Member member = memberMapper.selectOne(queryWrapper); Member member = this.baseMapper.selectOne(queryWrapper);
//如果手机号不存在则自动注册用户 //如果手机号不存在则自动注册用户
if (member == null) { if (member == null) {
member = new Member(mobilePhone, UuidUtils.getUUID(), mobilePhone); member = new Member(mobilePhone, UuidUtils.getUUID(), mobilePhone);
@ -413,7 +410,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
@Override @Override
public List<MemberDistributionVO> distribution() { public List<MemberDistributionVO> distribution() {
List<MemberDistributionVO> memberDistributionVOS = memberMapper.distribution(); List<MemberDistributionVO> memberDistributionVOS = this.baseMapper.distribution();
return memberDistributionVOS; return memberDistributionVOS;
} }
@ -426,7 +423,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
private Member findByPhone(String mobilePhone) { private Member findByPhone(String mobilePhone) {
QueryWrapper<Member> queryWrapper = new QueryWrapper(); QueryWrapper<Member> queryWrapper = new QueryWrapper();
queryWrapper.eq("mobile", mobilePhone); queryWrapper.eq("mobile", mobilePhone);
return memberMapper.selectOne(queryWrapper); return this.baseMapper.selectOne(queryWrapper);
} }
/** /**

View File

@ -40,9 +40,6 @@ import java.util.Map;
@Transactional @Transactional
public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberSign> implements MemberSignService { public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberSign> implements MemberSignService {
//会员签到
@Autowired
private MemberSignMapper memberSignMapper;
//RocketMQ //RocketMQ
@Autowired @Autowired
private RocketMQTemplate rocketMQTemplate; private RocketMQTemplate rocketMQTemplate;
@ -66,12 +63,12 @@ public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberS
queryWrapper.eq("member_id",authUser.getId()); queryWrapper.eq("member_id",authUser.getId());
queryWrapper.between("create_time",new Date(DateUtil.startOfTodDay()*1000),DateUtil.getCurrentDayEndTime()); 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) { if (todaySigns.size() > 0) {
throw new ServiceException(ResultCode.MEMBER_SIGN_REPEAT); 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 memberSign = new MemberSign();
memberSign.setMemberId(authUser.getId()); memberSign.setMemberId(authUser.getId());
@ -84,7 +81,7 @@ public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberS
} else { } else {
memberSign.setSignDay(1); memberSign.setSignDay(1);
} }
Integer result = memberSignMapper.insert(memberSign); Integer result = this.baseMapper.insert(memberSign);
//签到成功后发送消息赠送积分 //签到成功后发送消息赠送积分
if (result > 0) { if (result > 0) {
String destination = rocketmqCustomProperties.getMemberTopic() + ":" + MemberTagsEnum.MEMBER_SING.name(); String destination = rocketmqCustomProperties.getMemberTopic() + ":" + MemberTagsEnum.MEMBER_SING.name();
@ -101,7 +98,7 @@ public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberS
//获取当前会员 //获取当前会员
AuthUser authUser = UserContext.getCurrentUser(); AuthUser authUser = UserContext.getCurrentUser();
if (authUser != null) { if (authUser != null) {
return memberSignMapper.getMonthMemberSign(authUser.getId(), time); return this.baseMapper.getMonthMemberSign(authUser.getId(), time);
} }
throw new ServiceException(ResultCode.USER_NOT_LOGIN); throw new ServiceException(ResultCode.USER_NOT_LOGIN);
} }

View File

@ -45,9 +45,6 @@ import java.util.Date;
@Transactional @Transactional
public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, MemberWallet> implements MemberWalletService { public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, MemberWallet> implements MemberWalletService {
//预存款数据层
@Autowired
private MemberWalletMapper walletMapper;
//预存款日志 //预存款日志
@Autowired @Autowired
private WalletLogService walletLogService; private WalletLogService walletLogService;
@ -67,7 +64,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
QueryWrapper<MemberWallet> queryWrapper = new QueryWrapper<>(); QueryWrapper<MemberWallet> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("member_id", memberId); queryWrapper.eq("member_id", memberId);
//执行查询 //执行查询
MemberWallet memberWallet = this.walletMapper.selectOne(queryWrapper); MemberWallet memberWallet = this.baseMapper.selectOne(queryWrapper);
//如果没有钱包则创建钱包 //如果没有钱包则创建钱包
if (memberWallet == null) { if (memberWallet == null) {
memberWallet = this.save(memberId, memberService.getById(memberId).getUsername()); 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.setMemberWallet(CurrencyUtil.add(memberWallet.getMemberWallet(), money));
memberWallet.setMemberFrozenWallet(CurrencyUtil.sub(memberWallet.getMemberFrozenWallet(), 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); WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), money, detail, serviceType);
walletLogService.save(walletLog); walletLogService.save(walletLog);
@ -96,7 +93,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
MemberWallet memberWallet = this.checkMemberWallet(memberId); MemberWallet memberWallet = this.checkMemberWallet(memberId);
//新增预存款 //新增预存款
memberWallet.setMemberWallet(CurrencyUtil.add(memberWallet.getMemberWallet(), money)); 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); WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), money, detail, serviceType);
walletLogService.save(walletLog); walletLogService.save(walletLog);
@ -114,7 +111,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
} }
memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), money)); 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); WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), -money, detail, serviceType);
walletLogService.save(walletLog); walletLogService.save(walletLog);
@ -133,7 +130,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), money)); memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), money));
memberWallet.setMemberFrozenWallet(CurrencyUtil.add(memberWallet.getMemberFrozenWallet(), 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); WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), -money, detail, serviceType);
walletLogService.save(walletLog); walletLogService.save(walletLog);
@ -150,7 +147,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
throw new ServiceException(ResultCode.WALLET_WITHDRAWAL_INSUFFICIENT); throw new ServiceException(ResultCode.WALLET_WITHDRAWAL_INSUFFICIENT);
} }
memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), money)); memberWallet.setMemberWallet(CurrencyUtil.sub(memberWallet.getMemberWallet(), money));
this.walletMapper.updateById(memberWallet); this.updateById(memberWallet);
//新增预存款日志 //新增预存款日志
WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), -money, "提现金额已冻结,审核通过提现成功", serviceType); WalletLog walletLog = new WalletLog(memberWallet.getMemberId(), memberWallet.getMemberName(), -money, "提现金额已冻结,审核通过提现成功", serviceType);
walletLogService.save(walletLog); walletLogService.save(walletLog);
@ -164,7 +161,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
*/ */
private MemberWallet checkMemberWallet(String memberId) { 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) { if (memberWallet == null) {
Member member = memberService.getById(memberId); Member member = memberService.getById(memberId);
@ -184,11 +181,11 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
//校验会员预存款是否存在 //校验会员预存款是否存在
QueryWrapper<MemberWallet> queryWrapper = new QueryWrapper<>(); QueryWrapper<MemberWallet> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("member_id", member.getId()); queryWrapper.eq("member_id", member.getId());
MemberWallet memberWallet = this.walletMapper.selectOne(queryWrapper); MemberWallet memberWallet = this.getOne(queryWrapper);
//如果 预存款信息不为空 执行设置密码 //如果 预存款信息不为空 执行设置密码
if (memberWallet != null) { if (memberWallet != null) {
memberWallet.setWalletPassword(pwd); 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<MemberWallet> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("member_id", authUser.getId()); queryWrapper.eq("member_id", authUser.getId());
MemberWallet wallet = this.walletMapper.selectOne(queryWrapper); MemberWallet wallet = this.getOne(queryWrapper);
return wallet != null && !StringUtils.isEmpty(wallet.getWalletPassword()); return wallet != null && !StringUtils.isEmpty(wallet.getWalletPassword());
} }
@ -211,7 +208,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
memberWallet.setMemberName(memberName); memberWallet.setMemberName(memberName);
memberWallet.setMemberWallet(0D); memberWallet.setMemberWallet(0D);
memberWallet.setMemberFrozenWallet(0D); memberWallet.setMemberFrozenWallet(0D);
this.walletMapper.insert(memberWallet); this.save(memberWallet);
return memberWallet; return memberWallet;
} }

View File

@ -33,9 +33,7 @@ import java.util.Date;
@Service @Service
@Transactional @Transactional
public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawApplyMapper, MemberWithdrawApply> implements MemberWithdrawApplyService { public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawApplyMapper, MemberWithdrawApply> implements MemberWithdrawApplyService {
//提现申请数据层
@Autowired
private MemberWithdrawApplyMapper memberWithdrawApplyMapper;
//会员余额 //会员余额
@Autowired @Autowired
private MemberWalletService memberWalletService; private MemberWalletService memberWalletService;
@ -43,7 +41,7 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
@Override @Override
public Boolean audit(String applyId, Boolean result, String remark) { public Boolean audit(String applyId, Boolean result, String remark) {
//查询申请记录 //查询申请记录
MemberWithdrawApply memberWithdrawApply = memberWithdrawApplyMapper.selectById(applyId); MemberWithdrawApply memberWithdrawApply = this.getById(applyId);
memberWithdrawApply.setInspectRemark(remark); memberWithdrawApply.setInspectRemark(remark);
if (memberWithdrawApply != null) { if (memberWithdrawApply != null) {
//如果审核通过 则微信直接提现反之则记录审核状态 //如果审核通过 则微信直接提现反之则记录审核状态
@ -55,7 +53,7 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
} }
memberWithdrawApply.setApplyStatus(WithdrawStatusEnum.VIA_AUDITING.name()); memberWithdrawApply.setApplyStatus(WithdrawStatusEnum.VIA_AUDITING.name());
//保存审核记录 //保存审核记录
memberWithdrawApplyMapper.updateById(memberWithdrawApply); this.updateById(memberWithdrawApply);
//提现微信提现成功后扣减冻结金额 //提现微信提现成功后扣减冻结金额
Boolean bool = memberWalletService.withdrawal(memberWithdrawApply); Boolean bool = memberWalletService.withdrawal(memberWithdrawApply);
if (bool) { if (bool) {
@ -68,7 +66,7 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
throw new ServiceException(ResultCode.WALLET_REMARK_ERROR); throw new ServiceException(ResultCode.WALLET_REMARK_ERROR);
} }
memberWithdrawApply.setApplyStatus(WithdrawStatusEnum.FAIL_AUDITING.name()); memberWithdrawApply.setApplyStatus(WithdrawStatusEnum.FAIL_AUDITING.name());
memberWithdrawApplyMapper.updateById(memberWithdrawApply); this.updateById(memberWithdrawApply);
//需要从冻结金额扣减到余额 //需要从冻结金额扣减到余额
memberWalletService.increaseWithdrawal(memberWithdrawApply.getApplyMoney(), memberWithdrawApply.getMemberId(), "审核拒绝,提现金额解冻到余额", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name()); memberWalletService.increaseWithdrawal(memberWithdrawApply.getApplyMoney(), memberWithdrawApply.getMemberId(), "审核拒绝,提现金额解冻到余额", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name());
return true; return true;
@ -98,6 +96,6 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
} }
queryWrapper.orderByDesc("create_time"); queryWrapper.orderByDesc("create_time");
//查询返回数据 //查询返回数据
return this.memberWithdrawApplyMapper.selectPage(PageUtil.initPage(pageVO), queryWrapper); return this.baseMapper.selectPage(PageUtil.initPage(pageVO), queryWrapper);
} }
} }

View File

@ -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.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -29,15 +27,13 @@ import java.util.Optional;
@Service @Service
@Transactional @Transactional
public class StoreCollectionServiceImpl extends ServiceImpl<StoreCollectionMapper, StoreCollection> implements StoreCollectionService { public class StoreCollectionServiceImpl extends ServiceImpl<StoreCollectionMapper, StoreCollection> implements StoreCollectionService {
@Autowired
private StoreCollectionMapper storeCollectionMapper;
@Override @Override
public IPage<StoreCollectionVO> storeCollection(PageVO pageVo) { public IPage<StoreCollectionVO> storeCollection(PageVO pageVo) {
QueryWrapper<StoreCollectionVO> queryWrapper = new QueryWrapper(); QueryWrapper<StoreCollectionVO> queryWrapper = new QueryWrapper();
queryWrapper.eq("sc.member_id", UserContext.getCurrentUser().getId()); queryWrapper.eq("sc.member_id", UserContext.getCurrentUser().getId());
queryWrapper.orderByDesc("sc.create_time"); queryWrapper.orderByDesc("sc.create_time");
return storeCollectionMapper.storeCollectionVOList(PageUtil.initPage(pageVo), queryWrapper); return this.baseMapper.storeCollectionVOList(PageUtil.initPage(pageVo), queryWrapper);
} }
@Override @Override

View File

@ -14,7 +14,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.ResourceNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -29,15 +28,12 @@ import java.util.List;
@Service @Service
@Transactional @Transactional
public class StoreMessageServiceImpl extends ServiceImpl<StoreMessageMapper, StoreMessage> implements StoreMessageService { public class StoreMessageServiceImpl extends ServiceImpl<StoreMessageMapper, StoreMessage> implements StoreMessageService {
@Autowired
private StoreMessageMapper storeMessageMapper;
@Override @Override
public boolean deleteByMessageId(String messageId) { public boolean deleteByMessageId(String messageId) {
StoreMessage storeMessage = this.getById(messageId); StoreMessage storeMessage = this.getById(messageId);
if (storeMessage != null) { if (storeMessage != null) {
int result = storeMessageMapper.deleteById(messageId); return this.removeById(messageId);
return result > 0;
} }
return false; return false;
@ -60,7 +56,7 @@ public class StoreMessageServiceImpl extends ServiceImpl<StoreMessageMapper, Sto
queryWrapper.eq("status", storeMessageQueryVO.getStatus()); queryWrapper.eq("status", storeMessageQueryVO.getStatus());
} }
queryWrapper.orderByDesc("status"); 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()); throw new ResourceNotFoundException(ResultCode.USER_AUTHORITY_ERROR.message());
} }
storeMessage.setStatus(status); storeMessage.setStatus(status);
int result = this.storeMessageMapper.updateById(storeMessage); return this.updateById(storeMessage);
return result > 0;
} }
return false; return false;
} }

View File

@ -36,8 +36,6 @@ import java.util.Map;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class WechatMPMessageServiceImpl extends ServiceImpl<WechatMPMessageMapper, WechatMPMessage> implements WechatMPMessageService { public class WechatMPMessageServiceImpl extends ServiceImpl<WechatMPMessageMapper, WechatMPMessage> implements WechatMPMessageService {
@Autowired
private WechatMPMessageMapper wechatMPMessageMapper;
@Autowired @Autowired
private WechatAccessTokenUtil wechatAccessTokenUtil; private WechatAccessTokenUtil wechatAccessTokenUtil;
@ -53,7 +51,7 @@ public class WechatMPMessageServiceImpl extends ServiceImpl<WechatMPMessageMappe
@Override @Override
public void init() { public void init() {
wechatMPMessageMapper.deleteAll(); this.baseMapper.deleteAll();
try { try {
String accessToken = wechatAccessTokenUtil.cgiAccessToken(ClientTypeEnum.WECHAT_MP); String accessToken = wechatAccessTokenUtil.cgiAccessToken(ClientTypeEnum.WECHAT_MP);
//获取已有模版删除 //获取已有模版删除

View File

@ -17,7 +17,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -35,8 +34,7 @@ import java.util.Map;
@Service @Service
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class WechatMessageServiceImpl extends ServiceImpl<WechatMessageMapper, WechatMessage> implements WechatMessageService { public class WechatMessageServiceImpl extends ServiceImpl<WechatMessageMapper, WechatMessage> implements WechatMessageService {
@Autowired
private WechatMessageMapper wechatMessageMapper;
@Autowired @Autowired
private WechatAccessTokenUtil wechatAccessTokenUtil; private WechatAccessTokenUtil wechatAccessTokenUtil;
@ -50,7 +48,7 @@ public class WechatMessageServiceImpl extends ServiceImpl<WechatMessageMapper, W
@Override @Override
public void init() { public void init() {
try { try {
wechatMessageMapper.deleteAll(); this.baseMapper.deleteAll();
String accessToken = wechatAccessTokenUtil.cgiAccessToken(ClientTypeEnum.H5); String accessToken = wechatAccessTokenUtil.cgiAccessToken(ClientTypeEnum.H5);
//获取已有模版删除 //获取已有模版删除

View File

@ -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.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.stereotype.Service;
import javax.transaction.Transactional; import javax.transaction.Transactional;
@ -30,9 +28,6 @@ import java.util.List;
@Transactional @Transactional
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements OrderItemService { public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements OrderItemService {
@Autowired
private OrderItemMapper orderItemMapper;
@Override @Override
public void updateCommentStatus(String orderItemSn, CommentStatusEnum commentStatusEnum) { public void updateCommentStatus(String orderItemSn, CommentStatusEnum commentStatusEnum) {
LambdaUpdateWrapper<OrderItem> lambdaUpdateWrapper = Wrappers.lambdaUpdate(); LambdaUpdateWrapper<OrderItem> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
@ -89,6 +84,6 @@ public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem
QueryWrapper queryWrapper = new QueryWrapper(); QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.ge("o.complete_time", date); queryWrapper.ge("o.complete_time", date);
queryWrapper.eq("oi.comment_status", CommentStatusEnum.UNFINISHED.name()); queryWrapper.eq("oi.comment_status", CommentStatusEnum.UNFINISHED.name());
return orderItemMapper.waitEvaluate(queryWrapper); return this.baseMapper.waitEvaluate(queryWrapper);
} }
} }

View File

@ -82,9 +82,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
private static final String ORDER_SN_COLUMN = "order_sn"; private static final String ORDER_SN_COLUMN = "order_sn";
//订单数据层
@Autowired
private OrderMapper orderMapper;
//延时任务 //延时任务
@Autowired @Autowired
private TimeTrigger timeTrigger; private TimeTrigger timeTrigger;
@ -479,7 +476,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
queryWrapper.eq("o.delete_flag", false); queryWrapper.eq("o.delete_flag", false);
queryWrapper.groupBy("o.id"); queryWrapper.groupBy("o.id");
queryWrapper.orderByDesc("o.id"); queryWrapper.orderByDesc("o.id");
return orderMapper.queryByParams(PageUtil.initPage(pageVO), queryWrapper); return this.baseMapper.queryByParams(PageUtil.initPage(pageVO), queryWrapper);
} }
@Override @Override

View File

@ -2,21 +2,17 @@ package cn.lili.modules.order.order.serviceimpl;
import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException; import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.utils.PageUtil; import cn.lili.common.utils.PageUtil;
import cn.lili.common.vo.PageVO; import cn.lili.common.vo.PageVO;
import cn.lili.modules.order.order.entity.dos.Receipt; 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.OrderReceiptDTO;
import cn.lili.modules.order.order.entity.dto.ReceiptSearchParams; 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.mapper.ReceiptMapper;
import cn.lili.modules.order.order.service.ReceiptService; import cn.lili.modules.order.order.service.ReceiptService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -30,14 +26,9 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional @Transactional
public class ReceiptServiceImpl extends ServiceImpl<ReceiptMapper, Receipt> implements ReceiptService { public class ReceiptServiceImpl extends ServiceImpl<ReceiptMapper, Receipt> implements ReceiptService {
//发票mapper
@Autowired
private ReceiptMapper receiptMapper;
@Override @Override
public IPage<OrderReceiptDTO> getReceiptData(ReceiptSearchParams searchParams, PageVO pageVO) { 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 @Override

View File

@ -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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -35,9 +34,6 @@ import java.util.Date;
@Transactional @Transactional
public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> implements RechargeService { public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> implements RechargeService {
//预存款
@Autowired
private RechargeMapper rechargeMapper;
//会员预存款 //会员预存款
@Autowired @Autowired
private MemberWalletService memberWalletService; 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); Recharge recharge = new Recharge(sn, authUser.getId(), authUser.getUsername(), price);
//添加预存款充值账单 //添加预存款充值账单
this.rechargeMapper.insert(recharge); this.save(recharge);
//返回预存款 //返回预存款
return recharge; return recharge;
} }
@ -75,20 +71,20 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
queryWrapper.between("pay_time", start, end); queryWrapper.between("pay_time", start, end);
} }
//查询返回数据 //查询返回数据
return this.rechargeMapper.selectPage(PageUtil.initPage(page), queryWrapper); return this.page(PageUtil.initPage(page), queryWrapper);
} }
@Override @Override
public void paySuccess(String sn, String receivableNo) { public void paySuccess(String sn, String receivableNo) {
//根据sn获取支付账单 //根据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) { if (recharge != null) {
//将此账单支付状态更改为已支付 //将此账单支付状态更改为已支付
recharge.setPayStatus(PayStatusEnum.PAID.name()); recharge.setPayStatus(PayStatusEnum.PAID.name());
recharge.setReceivableNo(receivableNo); recharge.setReceivableNo(receivableNo);
//执行保存操作 //执行保存操作
this.rechargeMapper.updateById(recharge); this.updateById(recharge);
//增加预存款余额 //增加预存款余额
memberWalletService.increase(recharge.getRechargeMoney(), recharge.getMemberId(), "会员余额充值,充值单号为:" + recharge.getRechargeSn(), DepositServiceTypeEnum.WALLET_RECHARGE.name()); 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 @Override
public Recharge getRecharge(String sn) { 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) { if (recharge != null) {
return recharge; return recharge;
} }

View File

@ -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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -26,9 +25,6 @@ import java.util.Date;
@Transactional @Transactional
public class WalletLogServiceImpl extends ServiceImpl<WalletLogMapper, WalletLog> implements WalletLogService { public class WalletLogServiceImpl extends ServiceImpl<WalletLogMapper, WalletLog> implements WalletLogService {
@Autowired
private WalletLogMapper walletLogMapper;
@Override @Override
public IPage<WalletLog> depositLogPage(PageVO page, DepositQueryVO depositQueryVO) { 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); depositLogQueryWrapper.between("create_time", start, end);
} }
//查询返回数据 //查询返回数据
return this.walletLogMapper.selectPage(PageUtil.initPage(page), depositLogQueryWrapper); return this.page(PageUtil.initPage(page), depositLogQueryWrapper);
} }
} }

View File

@ -18,7 +18,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -34,9 +33,6 @@ import java.util.List;
@Transactional @Transactional
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> implements ArticleService { public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> implements ArticleService {
@Autowired
private ArticleMapper articleMapper;
@Override @Override
public IPage<ArticleVO> articlePage(ArticleSearchParams articleSearchParams) { public IPage<ArticleVO> articlePage(ArticleSearchParams articleSearchParams) {
articleSearchParams.setSort("a.sort"); articleSearchParams.setSort("a.sort");

View File

@ -1,7 +1,7 @@
package cn.lili.modules.page.serviceimpl; package cn.lili.modules.page.serviceimpl;
import cn.lili.common.enums.SwitchEnum;
import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.SwitchEnum;
import cn.lili.common.exception.ServiceException; import cn.lili.common.exception.ServiceException;
import cn.lili.common.utils.PageUtil; import cn.lili.common.utils.PageUtil;
import cn.lili.common.vo.PageVO; 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.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.stereotype.Service;
/** /**
@ -30,8 +28,6 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> implements PageDataService { public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> implements PageDataService {
@Autowired
private PageDataMapper pageDataMapper;
@Override @Override
public void addStorePageData(String storeId) { 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()); 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); throw new ServiceException(ResultCode.PAGE_DELETE_ERROR);
} }
return this.removeById(id); return this.removeById(id);
@ -136,7 +132,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
queryWrapper.eq("page_client_type", pageDataDTO.getPageClientType()); queryWrapper.eq("page_client_type", pageDataDTO.getPageClientType());
return pageDataMapper.getPageData(queryWrapper); return this.baseMapper.getPageData(queryWrapper);
} }
@Override @Override
@ -146,7 +142,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
queryWrapper.eq(pageDataDTO.getNum() != null, "num", pageDataDTO.getNum()); queryWrapper.eq(pageDataDTO.getNum() != null, "num", pageDataDTO.getNum());
queryWrapper.eq(pageDataDTO.getPageClientType() != null, "page_client_type", pageDataDTO.getPageClientType()); 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);
} }
} }

View File

@ -18,9 +18,6 @@ import org.springframework.stereotype.Service;
@Service @Service
public class SpecialServiceImpl extends ServiceImpl<SpecialMapper, Special> implements SpecialService { public class SpecialServiceImpl extends ServiceImpl<SpecialMapper, Special> implements SpecialService {
//专题
@Autowired
private SpecialMapper specialMapper;
//页面数据 //页面数据
@Autowired @Autowired
private PageDataService pageDataService; private PageDataService pageDataService;

View File

@ -5,8 +5,6 @@ import cn.lili.modules.permission.mapper.DepartmentRoleMapper;
import cn.lili.modules.permission.service.DepartmentRoleService; import cn.lili.modules.permission.service.DepartmentRoleService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -21,21 +19,20 @@ import java.util.List;
@Service @Service
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class DepartmentRoleServiceImpl extends ServiceImpl<DepartmentRoleMapper, DepartmentRole> implements DepartmentRoleService { public class DepartmentRoleServiceImpl extends ServiceImpl<DepartmentRoleMapper, DepartmentRole> implements DepartmentRoleService {
@Autowired
private DepartmentRoleMapper departmentRoleMapper;
@Override @Override
public List<DepartmentRole> listByDepartmentId(String departmentId) { public List<DepartmentRole> listByDepartmentId(String departmentId) {
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("department_id", departmentId); queryWrapper.eq("department_id", departmentId);
return departmentRoleMapper.selectList(queryWrapper); return this.baseMapper.selectList(queryWrapper);
} }
@Override @Override
public void updateByDepartmentId(String departmentId, List<DepartmentRole> departmentRoles) { public void updateByDepartmentId(String departmentId, List<DepartmentRole> departmentRoles) {
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("department_id", departmentId); queryWrapper.eq("department_id", departmentId);
departmentRoleMapper.delete(queryWrapper); this.remove(queryWrapper);
this.saveBatch(departmentRoles); this.saveBatch(departmentRoles);
} }
@ -44,6 +41,6 @@ public class DepartmentRoleServiceImpl extends ServiceImpl<DepartmentRoleMapper,
public void deleteByDepartment(List<String> ids) { public void deleteByDepartment(List<String> ids) {
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.in("department_id", ids); queryWrapper.in("department_id", ids);
departmentRoleMapper.delete(queryWrapper); this.remove(queryWrapper);
} }
} }

View File

@ -1,6 +1,5 @@
package cn.lili.modules.permission.serviceimpl; package cn.lili.modules.permission.serviceimpl;
import cn.lili.common.enums.MessageCode;
import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException; import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.AuthUser; 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.PageUtil;
import cn.lili.common.utils.StringUtils; import cn.lili.common.utils.StringUtils;
import cn.lili.common.vo.SearchVO; 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.Menu;
import cn.lili.modules.permission.entity.dos.RoleMenu; 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.entity.vo.MenuVO;
import cn.lili.modules.permission.mapper.MenuMapper; import cn.lili.modules.permission.mapper.MenuMapper;
import cn.lili.modules.permission.service.MenuService; import cn.lili.modules.permission.service.MenuService;
import cn.lili.modules.permission.service.RoleMenuService; import cn.lili.modules.permission.service.RoleMenuService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -35,9 +33,6 @@ import java.util.List;
@Service @Service
@Transactional @Transactional
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService { public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService {
//菜单
@Autowired
private MenuMapper menuMapper;
//菜单角色 //菜单角色
@Autowired @Autowired
private RoleMenuService roleMenuService; private RoleMenuService roleMenuService;
@ -62,13 +57,13 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me
if (authUser.getIsSuper()) { if (authUser.getIsSuper()) {
return this.tree(); return this.tree();
} }
List<Menu> userMenus = menuMapper.findByUserId(authUser.getId()); List<Menu> userMenus = this.baseMapper.findByUserId(authUser.getId());
return this.tree(userMenus); return this.tree(userMenus);
} }
@Override @Override
public List<Menu> findUserList(String userId) { public List<Menu> findUserList(String userId) {
return menuMapper.findByUserId(userId); return this.baseMapper.findByUserId(userId);
} }
@Override @Override
@ -91,7 +86,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me
queryWrapper.like("title", title); queryWrapper.like("title", title);
} }
queryWrapper.orderByDesc("sort_order"); queryWrapper.orderByDesc("sort_order");
return menuMapper.selectList(queryWrapper); return this.baseMapper.selectList(queryWrapper);
} }

View File

@ -7,7 +7,6 @@ import cn.lili.modules.permission.mapper.RoleMenuMapper;
import cn.lili.modules.permission.service.RoleMenuService; import cn.lili.modules.permission.service.RoleMenuService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -27,15 +26,12 @@ public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> i
//菜单 //菜单
@Autowired @Autowired
private MenuMapper menuMapper; private MenuMapper menuMapper;
//角色菜单
@Autowired
private RoleMenuMapper roleMenuMapper;
@Override @Override
public List<RoleMenu> findByRoleId(String roleId) { public List<RoleMenu> findByRoleId(String roleId) {
QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>(); QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("role_id", roleId); queryWrapper.eq("role_id", roleId);
return roleMenuMapper.selectList(queryWrapper); return this.baseMapper.selectList(queryWrapper);
} }
@Override @Override
@ -61,13 +57,13 @@ public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> i
//删除 //删除
QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>(); QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("role_id", roleId); queryWrapper.eq("role_id", roleId);
roleMenuMapper.delete(queryWrapper); this.remove(queryWrapper);
} }
@Override @Override
public void deleteRoleMenu(List<String> roleId) { public void deleteRoleMenu(List<String> roleId) {
//删除 //删除
QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>(); QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>();
queryWrapper.in("role_id", roleId); queryWrapper.in("role_id", roleId);
roleMenuMapper.delete(queryWrapper); this.remove(queryWrapper);
} }
} }

View File

@ -22,14 +22,12 @@ import java.util.List;
@Service @Service
@Transactional @Transactional
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService { public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {
@Autowired
private UserRoleMapper userRoleMapper;
@Override @Override
public List<UserRole> listByUserId(String userId) { public List<UserRole> listByUserId(String userId) {
QueryWrapper<UserRole> queryWrapper = new QueryWrapper<>(); QueryWrapper<UserRole> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", userId); queryWrapper.eq("user_id", userId);
return userRoleMapper.selectList(queryWrapper); return this.baseMapper.selectList(queryWrapper);
} }
@Override @Override
@ -46,7 +44,7 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
//删除 //删除
QueryWrapper<UserRole> queryWrapper = new QueryWrapper<>(); QueryWrapper<UserRole> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", userId); queryWrapper.eq("user_id", userId);
userRoleMapper.delete(queryWrapper); this.remove(queryWrapper);
//保存 //保存
this.saveBatch(userRoles); this.saveBatch(userRoles);

View File

@ -27,7 +27,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
@ -57,9 +56,6 @@ public class FullDiscountServiceImpl extends ServiceImpl<FullDiscountMapper, Ful
//Mongo //Mongo
@Autowired @Autowired
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;
//满额活动
@Autowired
private FullDiscountMapper fullDiscountMapper;
//Rocketmq //Rocketmq
@Autowired @Autowired
private RocketmqCustomProperties rocketmqCustomProperties; 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) { private void checkSameActiveExist(Date statTime, Date endTime, String storeId, String id) {
// 同一时间段内相同的活动 // 同一时间段内相同的活动
QueryWrapper<FullDiscount> queryWrapper = PromotionTools.checkActiveTime(statTime, endTime, PromotionTypeEnum.FULL_DISCOUNT, storeId, 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) { if (sameNum > 0) {
throw new ServiceException("当前时间内已存在同类活动"); throw new ServiceException("当前时间内已存在同类活动");
} }

View File

@ -25,8 +25,6 @@ import java.util.List;
@Service @Service
@Transactional @Transactional
public class PurchaseQuotedServiceImpl extends ServiceImpl<PurchaseQuotedMapper, PurchaseQuoted> implements PurchaseQuotedService { public class PurchaseQuotedServiceImpl extends ServiceImpl<PurchaseQuotedMapper, PurchaseQuoted> implements PurchaseQuotedService {
@Autowired
private PurchaseQuotedMapper purchaseQuotedMapper;
@Autowired @Autowired
private PurchaseQuotedItemService purchaseQuotedItemService; private PurchaseQuotedItemService purchaseQuotedItemService;

View File

@ -24,7 +24,6 @@ import java.util.List;
@Service @Service
public class CustomWordsServiceImpl extends ServiceImpl<CustomWordsMapper, CustomWords> implements CustomWordsService { public class CustomWordsServiceImpl extends ServiceImpl<CustomWordsMapper, CustomWords> implements CustomWordsService {
@Override @Override
public String deploy() { public String deploy() {
LambdaQueryWrapper<CustomWords> queryWrapper = new LambdaQueryWrapper<CustomWords>().eq(CustomWords::getDisabled, 1); LambdaQueryWrapper<CustomWords> queryWrapper = new LambdaQueryWrapper<CustomWords>().eq(CustomWords::getDisabled, 1);

View File

@ -30,12 +30,6 @@ import java.util.List;
@Service @Service
public class GoodsStatisticsDataServiceImpl extends ServiceImpl<GoodsStatisticsDataMapper, StoreFlow> implements GoodsStatisticsDataService { public class GoodsStatisticsDataServiceImpl extends ServiceImpl<GoodsStatisticsDataMapper, StoreFlow> implements GoodsStatisticsDataService {
/**
* 商品统计
*/
@Autowired
private GoodsStatisticsDataMapper goodsStatisticsDataMapper;
@Override @Override
public List<GoodsStatisticsDataVO> getGoodsStatisticsData(GoodsStatisticsQueryParam goodsStatisticsQueryParam, Integer num) { 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()); queryWrapper.eq(!StringUtils.isEmpty(goodsStatisticsQueryParam.getStoreId()), "store_id", goodsStatisticsQueryParam.getStoreId());
//查询前一百条记录 //查询前一百条记录
Page page = new Page<GoodsStatisticsDataVO>(1, num); Page page = new Page<GoodsStatisticsDataVO>(1, num);
return goodsStatisticsDataMapper.getGoodsStatisticsData(page, queryWrapper); return this.baseMapper.getGoodsStatisticsData(page, queryWrapper);
} }
@Override @Override
@ -56,7 +50,7 @@ public class GoodsStatisticsDataServiceImpl extends ServiceImpl<GoodsStatisticsD
QueryWrapper queryWrapper = getQueryWrapper(goodsStatisticsQueryParam); QueryWrapper queryWrapper = getQueryWrapper(goodsStatisticsQueryParam);
//根据分类分组 //根据分类分组
queryWrapper.groupBy("category_id"); queryWrapper.groupBy("category_id");
return goodsStatisticsDataMapper.getCateGoryStatisticsData(queryWrapper); return this.baseMapper.getCateGoryStatisticsData(queryWrapper);
} }

View File

@ -9,7 +9,6 @@ import cn.lili.modules.statistics.util.StatisticsDateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
@ -24,31 +23,25 @@ import java.util.List;
@Service @Service
public class MemberStatisticsDataServiceImpl extends ServiceImpl<MemberStatisticsDataMapper, MemberStatisticsData> implements MemberStatisticsDataService { public class MemberStatisticsDataServiceImpl extends ServiceImpl<MemberStatisticsDataMapper, MemberStatisticsData> implements MemberStatisticsDataService {
/**
* 会员统计
*/
@Autowired
private MemberStatisticsDataMapper memberStatisticsDataMapper;
@Override @Override
public Integer getMemberCount() { public Integer getMemberCount() {
QueryWrapper queryWrapper = new QueryWrapper(); QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("disabled", true); queryWrapper.eq("disabled", true);
return memberStatisticsDataMapper.customSqlQuery(queryWrapper); return this.baseMapper.customSqlQuery(queryWrapper);
} }
@Override @Override
public Integer todayMemberNum() { public Integer todayMemberNum() {
QueryWrapper queryWrapper = Wrappers.query(); QueryWrapper queryWrapper = Wrappers.query();
queryWrapper.gt("create_time", DateUtil.beginOfDay(new Date())); queryWrapper.gt("create_time", DateUtil.beginOfDay(new Date()));
return memberStatisticsDataMapper.customSqlQuery(queryWrapper); return this.baseMapper.customSqlQuery(queryWrapper);
} }
@Override @Override
public Integer memberCount(Date endTime) { public Integer memberCount(Date endTime) {
QueryWrapper queryWrapper = Wrappers.query(); QueryWrapper queryWrapper = Wrappers.query();
queryWrapper.lt("create_time", endTime); queryWrapper.lt("create_time", endTime);
return memberStatisticsDataMapper.customSqlQuery(queryWrapper); return this.baseMapper.customSqlQuery(queryWrapper);
} }
@Override @Override
@ -56,14 +49,14 @@ public class MemberStatisticsDataServiceImpl extends ServiceImpl<MemberStatistic
QueryWrapper queryWrapper = Wrappers.query(); QueryWrapper queryWrapper = Wrappers.query();
queryWrapper.ge("last_login_date", startTime); queryWrapper.ge("last_login_date", startTime);
return memberStatisticsDataMapper.customSqlQuery(queryWrapper); return this.baseMapper.customSqlQuery(queryWrapper);
} }
@Override @Override
public Integer newlyAdded(Date startTime, Date endTime) { public Integer newlyAdded(Date startTime, Date endTime) {
QueryWrapper queryWrapper = Wrappers.query(); QueryWrapper queryWrapper = Wrappers.query();
queryWrapper.between("create_time", startTime, endTime); queryWrapper.between("create_time", startTime, endTime);
return memberStatisticsDataMapper.customSqlQuery(queryWrapper); return this.baseMapper.customSqlQuery(queryWrapper);
} }
@Override @Override

View File

@ -36,10 +36,6 @@ import java.util.*;
*/ */
@Service @Service
public class OrderStatisticsDataServiceImpl extends ServiceImpl<OrderStatisticsDataMapper, StoreFlow> implements OrderStatisticsDataService { public class OrderStatisticsDataServiceImpl extends ServiceImpl<OrderStatisticsDataMapper, StoreFlow> implements OrderStatisticsDataService {
//订单统计
@Autowired
private OrderStatisticsDataMapper orderStatisticsDataMapper;
//平台PV统计 //平台PV统计
@Autowired @Autowired
private PlatformViewDataService platformViewDataService; private PlatformViewDataService platformViewDataService;
@ -215,7 +211,7 @@ public class OrderStatisticsDataServiceImpl extends ServiceImpl<OrderStatisticsD
queryWrapper.between("create_time", dates[0], dates[1]); queryWrapper.between("create_time", dates[0], dates[1]);
// 格式化时间 // 格式化时间
queryWrapper.groupBy("DATE_FORMAT(create_time,'%Y-%m-%d')"); 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 calendar = Calendar.getInstance();
calendar.setTime(dates[0]); calendar.setTime(dates[0]);

View File

@ -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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -49,9 +48,6 @@ public class PlatformViewDataServiceImpl extends ServiceImpl<PlatformViewDataMap
//会员 //会员
@Autowired @Autowired
private MemberService memberService; private MemberService memberService;
//平台流量统计
@Autowired
private PlatformViewDataMapper platformViewDataMapper;
//缓存 //缓存
@Autowired @Autowired
private Cache cache; private Cache cache;
@ -242,7 +238,7 @@ public class PlatformViewDataServiceImpl extends ServiceImpl<PlatformViewDataMap
} else { } else {
queryWrapper.eq("store_id", -1); queryWrapper.eq("store_id", -1);
} }
return platformViewDataMapper.count(queryWrapper); return this.count(queryWrapper);
} }
} }

View File

@ -15,8 +15,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.stereotype.Service;
/** /**
@ -28,14 +26,10 @@ import org.springframework.stereotype.Service;
@Service @Service
public class RefundOrderStatisticsServiceImpl extends ServiceImpl<RefundOrderStatisticsDataMapper, StoreFlow> implements RefundOrderStatisticsService { public class RefundOrderStatisticsServiceImpl extends ServiceImpl<RefundOrderStatisticsDataMapper, StoreFlow> implements RefundOrderStatisticsService {
//退款统计
@Autowired
private RefundOrderStatisticsDataMapper refundOrderStatisticsDataMapper;
@Override @Override
public IPage<RefundOrderStatisticsDataVO> getRefundOrderStatisticsData(PageVO pageVO, StatisticsQueryParam statisticsQueryParam) { public IPage<RefundOrderStatisticsDataVO> getRefundOrderStatisticsData(PageVO pageVO, StatisticsQueryParam statisticsQueryParam) {
QueryWrapper queryWrapper = getQueryWrapper(statisticsQueryParam); QueryWrapper queryWrapper = getQueryWrapper(statisticsQueryParam);
return refundOrderStatisticsDataMapper.getRefundStatisticsData(PageUtil.initPage(pageVO), queryWrapper); return this.baseMapper.getRefundStatisticsData(PageUtil.initPage(pageVO), queryWrapper);
} }
@Override @Override

View File

@ -49,9 +49,6 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
//商家流水 //商家流水
@Autowired @Autowired
private StoreFlowService storeFlowService; private StoreFlowService storeFlowService;
//结算单
@Autowired
private BillMapper billMapper;
@Override @Override
public void createBill(String storeId, Date startTime) { 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.setSn(SnowFlake.createStr("B"));
//入账结算信息 //入账结算信息
Bill orderBill = billMapper.getOrderBill(storeId, FlowTypeEnum.PAY.name()); Bill orderBill = this.baseMapper.getOrderBill(storeId, FlowTypeEnum.PAY.name());
Double orderPrice = 0D; Double orderPrice = 0D;
if (orderBill != null) { if (orderBill != null) {
bill.setOrderPrice(orderBill.getOrderPrice()); 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; Double refundPrice = 0D;
if(refundBill!=null){ if(refundBill!=null){
bill.setRefundPrice(refundBill.getRefundPrice()); bill.setRefundPrice(refundBill.getRefundPrice());
@ -152,7 +149,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
@Override @Override
public IPage<BillListVO> billPage(BillSearchParams billSearchParams) { public IPage<BillListVO> billPage(BillSearchParams billSearchParams) {
QueryWrapper<BillListVO> queryWrapper = billSearchParams.queryWrapper(); QueryWrapper<BillListVO> queryWrapper = billSearchParams.queryWrapper();
return billMapper.queryBillPage(PageUtil.initPage(billSearchParams), queryWrapper); return this.baseMapper.queryBillPage(PageUtil.initPage(billSearchParams), queryWrapper);
} }
@Override @Override

View File

@ -6,8 +6,6 @@ import cn.lili.modules.store.service.FreightTemplateChildService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -23,15 +21,11 @@ import java.util.List;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class FreightTemplateServiceChildImpl extends ServiceImpl<FreightTemplateChildMapper, FreightTemplateChild> implements FreightTemplateChildService { public class FreightTemplateServiceChildImpl extends ServiceImpl<FreightTemplateChildMapper, FreightTemplateChild> implements FreightTemplateChildService {
//配送子模板数据层
@Autowired
private FreightTemplateChildMapper freightTemplateChildMapper;
@Override @Override
public List<FreightTemplateChild> getFreightTemplateChild(String freightTemplateId) { public List<FreightTemplateChild> getFreightTemplateChild(String freightTemplateId) {
LambdaQueryWrapper<FreightTemplateChild> lambdaQueryWrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<FreightTemplateChild> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(FreightTemplateChild::getFreightTemplateId, freightTemplateId); lambdaQueryWrapper.eq(FreightTemplateChild::getFreightTemplateId, freightTemplateId);
return freightTemplateChildMapper.selectList(lambdaQueryWrapper); return this.baseMapper.selectList(lambdaQueryWrapper);
} }
@Override @Override

View File

@ -19,7 +19,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -37,10 +36,6 @@ import java.util.List;
@Service @Service
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class FreightTemplateServiceImpl extends ServiceImpl<FreightTemplateMapper, FreightTemplate> implements FreightTemplateService { public class FreightTemplateServiceImpl extends ServiceImpl<FreightTemplateMapper, FreightTemplate> implements FreightTemplateService {
//配送模板
@Autowired
private FreightTemplateMapper freightTemplateMapper;
//配送子模板 //配送子模板
@Autowired @Autowired
private FreightTemplateChildService freightTemplateChildService; private FreightTemplateChildService freightTemplateChildService;
@ -60,7 +55,7 @@ public class FreightTemplateServiceImpl extends ServiceImpl<FreightTemplateMappe
//查询运费模板 //查询运费模板
LambdaQueryWrapper<FreightTemplate> lambdaQueryWrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<FreightTemplate> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(FreightTemplate::getStoreId, UserContext.getCurrentUser().getId()); lambdaQueryWrapper.eq(FreightTemplate::getStoreId, UserContext.getCurrentUser().getId());
List<FreightTemplate> freightTemplates = freightTemplateMapper.selectList(lambdaQueryWrapper); List<FreightTemplate> freightTemplates = this.baseMapper.selectList(lambdaQueryWrapper);
if (!freightTemplates.isEmpty()) { if (!freightTemplates.isEmpty()) {
//如果模板不为空则查询子模板信息 //如果模板不为空则查询子模板信息
for (FreightTemplate freightTemplate : freightTemplates) { for (FreightTemplate freightTemplate : freightTemplates) {
@ -80,18 +75,16 @@ public class FreightTemplateServiceImpl extends ServiceImpl<FreightTemplateMappe
@Override @Override
public IPage<FreightTemplate> getFreightTemplate(PageVO pageVo) { public IPage<FreightTemplate> getFreightTemplate(PageVO pageVo) {
//获取当前登录商家账号
AuthUser tokenUser = UserContext.getCurrentUser();
LambdaQueryWrapper<FreightTemplate> lambdaQueryWrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<FreightTemplate> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(FreightTemplate::getStoreId, UserContext.getCurrentUser().getId()); lambdaQueryWrapper.eq(FreightTemplate::getStoreId, UserContext.getCurrentUser().getStoreId());
return freightTemplateMapper.selectPage(PageUtil.initPage(pageVo), lambdaQueryWrapper); return this.baseMapper.selectPage(PageUtil.initPage(pageVo), lambdaQueryWrapper);
} }
@Override @Override
public FreightTemplateVO getFreightTemplate(String id) { public FreightTemplateVO getFreightTemplate(String id) {
FreightTemplateVO freightTemplateVO = new FreightTemplateVO(); FreightTemplateVO freightTemplateVO = new FreightTemplateVO();
//获取运费模板 //获取运费模板
FreightTemplate freightTemplate = freightTemplateMapper.selectById(id); FreightTemplate freightTemplate = this.getById(id);
if (freightTemplate != null) { if (freightTemplate != null) {
//复制属性 //复制属性
BeanUtils.copyProperties(freightTemplate, freightTemplateVO); BeanUtils.copyProperties(freightTemplate, freightTemplateVO);
@ -112,7 +105,7 @@ public class FreightTemplateServiceImpl extends ServiceImpl<FreightTemplateMappe
//复制属性 //复制属性
BeanUtils.copyProperties(freightTemplateVO, freightTemplate); BeanUtils.copyProperties(freightTemplateVO, freightTemplate);
//添加运费模板 //添加运费模板
freightTemplateMapper.insert(freightTemplate); this.save(freightTemplate);
//给子模板赋父模板的id //给子模板赋父模板的id
List<FreightTemplateChild> list = new ArrayList<>(); List<FreightTemplateChild> list = new ArrayList<>();
for (FreightTemplateChild freightTemplateChild : freightTemplateVO.getFreightTemplateChildList()) { for (FreightTemplateChild freightTemplateChild : freightTemplateVO.getFreightTemplateChildList()) {
@ -138,7 +131,7 @@ public class FreightTemplateServiceImpl extends ServiceImpl<FreightTemplateMappe
//复制属性 //复制属性
BeanUtils.copyProperties(freightTemplateVO, freightTemplate); BeanUtils.copyProperties(freightTemplateVO, freightTemplate);
//修改运费模板 //修改运费模板
freightTemplateMapper.updateById(freightTemplate); this.updateById(freightTemplate);
//删除模板子内容 //删除模板子内容
freightTemplateChildService.removeFreightTemplate(freightTemplateVO.getId()); freightTemplateChildService.removeFreightTemplate(freightTemplateVO.getId());
//给子模板赋父模板的id //给子模板赋父模板的id

View File

@ -11,8 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -26,25 +24,20 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class StoreAddressServiceImpl extends ServiceImpl<StoreAddressMapper, StoreAddress> implements StoreAddressService { public class StoreAddressServiceImpl extends ServiceImpl<StoreAddressMapper, StoreAddress> implements StoreAddressService {
@Autowired
private StoreAddressMapper storeAddressMapper;
@Override @Override
public IPage<StoreAddress> getStoreAddress(PageVO pageVo) { public IPage<StoreAddress> getStoreAddress(PageVO pageVo) {
//获取当前登录商家账号 //获取当前登录商家账号
AuthUser tokenUser = UserContext.getCurrentUser();
LambdaQueryWrapper<StoreAddress> lambdaQueryWrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<StoreAddress> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(StoreAddress::getStoreId, UserContext.getCurrentUser().getStoreId()); lambdaQueryWrapper.eq(StoreAddress::getStoreId, UserContext.getCurrentUser().getStoreId());
return storeAddressMapper.selectPage(PageUtil.initPage(pageVo), lambdaQueryWrapper); return this.page(PageUtil.initPage(pageVo), lambdaQueryWrapper);
} }
@Override @Override
public StoreAddress addStoreAddress(StoreAddress storeAddress) { public StoreAddress addStoreAddress(StoreAddress storeAddress) {
//获取当前登录商家账号 //获取当前登录商家账号
AuthUser tokenUser = UserContext.getCurrentUser(); storeAddress.setStoreId(UserContext.getCurrentUser().getStoreId());
storeAddress.setStoreId(tokenUser.getId());
//添加自提点 //添加自提点
storeAddressMapper.insert(storeAddress); this.save(storeAddress);
return storeAddress; return storeAddress;
} }
@ -54,13 +47,12 @@ public class StoreAddressServiceImpl extends ServiceImpl<StoreAddressMapper, Sto
AuthUser tokenUser = UserContext.getCurrentUser(); AuthUser tokenUser = UserContext.getCurrentUser();
storeAddress.setStoreId(tokenUser.getId()); storeAddress.setStoreId(tokenUser.getId());
//添加自提点 //添加自提点
storeAddressMapper.updateById(storeAddress); this.updateById(storeAddress);
return storeAddress; return storeAddress;
} }
@Override @Override
public Boolean removeStoreAddress(String id) { public Boolean removeStoreAddress(String id) {
storeAddressMapper.deleteById(id); return this.removeById(id);
return true;
} }
} }

View File

@ -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.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -37,9 +36,6 @@ import java.util.List;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class StoreDetailServiceImpl extends ServiceImpl<StoreDetailMapper, StoreDetail> implements StoreDetailService { public class StoreDetailServiceImpl extends ServiceImpl<StoreDetailMapper, StoreDetail> implements StoreDetailService {
//店铺详情数据层
@Autowired
private StoreDetailMapper storeDetailMapper;
//店铺 //店铺
@Autowired @Autowired
private StoreService storeService; private StoreService storeService;
@ -49,12 +45,12 @@ public class StoreDetailServiceImpl extends ServiceImpl<StoreDetailMapper, Store
@Override @Override
public StoreDetailVO getStoreDetailVO(String storeId) { public StoreDetailVO getStoreDetailVO(String storeId) {
return storeDetailMapper.getStoreDetail(storeId); return this.baseMapper.getStoreDetail(storeId);
} }
@Override @Override
public StoreDetailVO getStoreDetailVOByMemberId(String memberId) { public StoreDetailVO getStoreDetailVOByMemberId(String memberId) {
return storeDetailMapper.getStoreDetailByMemberId(memberId); return this.baseMapper.getStoreDetailByMemberId(memberId);
} }
@Override @Override
@ -75,17 +71,17 @@ public class StoreDetailServiceImpl extends ServiceImpl<StoreDetailMapper, Store
@Override @Override
public StoreBasicInfoVO getStoreBasicInfoDTO(String storeId) { public StoreBasicInfoVO getStoreBasicInfoDTO(String storeId) {
return storeDetailMapper.getStoreBasicInfoDTO(storeId); return this.baseMapper.getStoreBasicInfoDTO(storeId);
} }
@Override @Override
public StoreAfterSaleAddressDTO getStoreAfterSaleAddressDTO() { public StoreAfterSaleAddressDTO getStoreAfterSaleAddressDTO() {
return storeDetailMapper.getStoreAfterSaleAddressDTO(UserContext.getCurrentUser().getStoreId()); return this.baseMapper.getStoreAfterSaleAddressDTO(UserContext.getCurrentUser().getStoreId());
} }
@Override @Override
public StoreAfterSaleAddressDTO getStoreAfterSaleAddressDTO(String id) { public StoreAfterSaleAddressDTO getStoreAfterSaleAddressDTO(String id) {
StoreAfterSaleAddressDTO storeAfterSaleAddressDTO = storeDetailMapper.getStoreAfterSaleAddressDTO(id); StoreAfterSaleAddressDTO storeAfterSaleAddressDTO = this.baseMapper.getStoreAfterSaleAddressDTO(id);
if (storeAfterSaleAddressDTO == null) { if (storeAfterSaleAddressDTO == null) {
storeAfterSaleAddressDTO = new StoreAfterSaleAddressDTO(); storeAfterSaleAddressDTO = new StoreAfterSaleAddressDTO();
} }

View File

@ -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.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -28,9 +26,6 @@ import java.util.List;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMapper, StoreGoodsLabel> implements StoreGoodsLabelService { public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMapper, StoreGoodsLabel> implements StoreGoodsLabelService {
@Autowired
private StoreGoodsLabelMapper storeGoodsLabelMapper;
@Override @Override
public List<StoreGoodsLabelVO> listByStoreId(String storeId) { public List<StoreGoodsLabelVO> listByStoreId(String storeId) {
//TODO 从缓存获取店铺商品分类列表 //TODO 从缓存获取店铺商品分类列表
@ -68,7 +63,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
private List<StoreGoodsLabel> list(String storeId) { private List<StoreGoodsLabel> list(String storeId) {
LambdaQueryWrapper<StoreGoodsLabel> queryWrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<StoreGoodsLabel> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(StoreGoodsLabel::getStoreId, storeId); queryWrapper.eq(StoreGoodsLabel::getStoreId, storeId);
return storeGoodsLabelMapper.selectList(queryWrapper); return this.baseMapper.selectList(queryWrapper);
} }
@Override @Override
@ -76,7 +71,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
//获取当前登录商家账号 //获取当前登录商家账号
AuthUser tokenUser = UserContext.getCurrentUser(); AuthUser tokenUser = UserContext.getCurrentUser();
storeGoodsLabel.setStoreId(tokenUser.getStoreId()); storeGoodsLabel.setStoreId(tokenUser.getStoreId());
storeGoodsLabelMapper.insert(storeGoodsLabel); this.save(storeGoodsLabel);
return storeGoodsLabel; return storeGoodsLabel;
} }
@ -87,12 +82,12 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
LambdaUpdateWrapper<StoreGoodsLabel> lambdaUpdateWrapper = Wrappers.lambdaUpdate(); LambdaUpdateWrapper<StoreGoodsLabel> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
lambdaUpdateWrapper.eq(StoreGoodsLabel::getStoreId, tokenUser.getStoreId()); lambdaUpdateWrapper.eq(StoreGoodsLabel::getStoreId, tokenUser.getStoreId());
lambdaUpdateWrapper.eq(StoreGoodsLabel::getId, storeGoodsLabel.getId()); lambdaUpdateWrapper.eq(StoreGoodsLabel::getId, storeGoodsLabel.getId());
storeGoodsLabelMapper.update(storeGoodsLabel, lambdaUpdateWrapper); this.update(storeGoodsLabel, lambdaUpdateWrapper);
return storeGoodsLabel; return storeGoodsLabel;
} }
@Override @Override
public void removeStoreGoodsLabel(String storeLabelId) { public void removeStoreGoodsLabel(String storeLabelId) {
storeGoodsLabelMapper.deleteById(storeLabelId); this.removeById(storeLabelId);
} }
} }

View File

@ -2,8 +2,8 @@ package cn.lili.modules.store.serviceimpl;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.lili.common.enums.SwitchEnum;
import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.SwitchEnum;
import cn.lili.common.exception.ServiceException; import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.context.UserContext; import cn.lili.common.security.context.UserContext;
import cn.lili.common.utils.BeanUtil; 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.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -52,9 +51,6 @@ import java.util.Optional;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements StoreService { public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements StoreService {
//店铺
@Autowired
private StoreMapper storeMapper;
//会员 //会员
@Autowired @Autowired
private MemberService memberService; private MemberService memberService;
@ -76,12 +72,12 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
@Override @Override
public IPage<StoreVO> findByConditionPage(StoreSearchParams storeSearchParams, PageVO page) { 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 @Override
public StoreVO getStoreDetail() { public StoreVO getStoreDetail() {
StoreVO storeVO = storeMapper.getStoreDetail(UserContext.getCurrentUser().getStoreId()); StoreVO storeVO = this.baseMapper.getStoreDetail(UserContext.getCurrentUser().getStoreId());
storeVO.setNickName(UserContext.getCurrentUser().getNickName()); storeVO.setNickName(UserContext.getCurrentUser().getNickName());
return storeVO; return storeVO;
} }
@ -169,7 +165,7 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
@Override @Override
public boolean audit(String id, Integer passed) { public boolean audit(String id, Integer passed) {
Store store = storeMapper.selectById(id); Store store = this.getById(id);
if (store == null) { if (store == null) {
throw new ServiceException(ResultCode.STORE_NOT_EXIST); throw new ServiceException(ResultCode.STORE_NOT_EXIST);
} }

View File

@ -8,7 +8,6 @@ import cn.lili.modules.system.service.StoreLogisticsService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -25,17 +24,14 @@ import java.util.List;
public class StoreLogisticsServiceImpl extends ServiceImpl<StoreLogisticsMapper, StoreLogistics> implements StoreLogisticsService { public class StoreLogisticsServiceImpl extends ServiceImpl<StoreLogisticsMapper, StoreLogistics> implements StoreLogisticsService {
@Autowired
private StoreLogisticsMapper storeLogisticsMapper;
@Override @Override
public List<StoreLogisticsVO> getStoreLogistics() { public List<StoreLogisticsVO> getStoreLogistics() {
return storeLogisticsMapper.getStoreLogistics(UserContext.getCurrentUser().getStoreId()); return this.baseMapper.getStoreLogistics(UserContext.getCurrentUser().getStoreId());
} }
@Override @Override
public List<StoreLogisticsVO> getStoreSelectedLogistics() { public List<StoreLogisticsVO> getStoreSelectedLogistics() {
return storeLogisticsMapper.getSelectedStoreLogistics(UserContext.getCurrentUser().getStoreId()); return this.baseMapper.getSelectedStoreLogistics(UserContext.getCurrentUser().getStoreId());
} }