补充缺失的事务处理
This commit is contained in:
parent
1d5a2008e1
commit
9aa253b56f
@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -79,6 +80,7 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
private PointsGoodsService pointsGoodsService;
|
private PointsGoodsService pointsGoodsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void orderChange(OrderMessage orderMessage) {
|
public void orderChange(OrderMessage orderMessage) {
|
||||||
|
|
||||||
switch (orderMessage.getNewStatus()) {
|
switch (orderMessage.getNewStatus()) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.lili.modules.connect.serviceimpl;
|
package cn.lili.modules.connect.serviceimpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
@ -13,7 +14,6 @@ import cn.lili.common.security.context.UserContext;
|
|||||||
import cn.lili.common.security.token.Token;
|
import cn.lili.common.security.token.Token;
|
||||||
import cn.lili.common.utils.CookieUtil;
|
import cn.lili.common.utils.CookieUtil;
|
||||||
import cn.lili.common.utils.HttpUtils;
|
import cn.lili.common.utils.HttpUtils;
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.modules.connect.entity.Connect;
|
import cn.lili.modules.connect.entity.Connect;
|
||||||
import cn.lili.modules.connect.entity.dto.ConnectAuthUser;
|
import cn.lili.modules.connect.entity.dto.ConnectAuthUser;
|
||||||
import cn.lili.modules.connect.entity.dto.WechatMPLoginParams;
|
import cn.lili.modules.connect.entity.dto.WechatMPLoginParams;
|
||||||
@ -35,6 +35,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||||
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 javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
import javax.crypto.spec.IvParameterSpec;
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
@ -55,6 +56,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Service
|
@Service
|
||||||
public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> implements ConnectService {
|
public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> implements ConnectService {
|
||||||
|
|
||||||
|
static final boolean AUTO_REGION = true;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SettingService settingService;
|
private SettingService settingService;
|
||||||
@ -65,10 +67,8 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
@Autowired
|
@Autowired
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
||||||
static boolean AUTO_REGION = true;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Token unionLoginCallback(String type, String unionid, String uuid, boolean longTerm) throws NoPermissionException {
|
public Token unionLoginCallback(String type, String unionid, String uuid, boolean longTerm) throws NoPermissionException {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -94,6 +94,7 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Token unionLoginCallback(String type, ConnectAuthUser authUser, String uuid) {
|
public Token unionLoginCallback(String type, ConnectAuthUser authUser, String uuid) {
|
||||||
|
|
||||||
Token token;
|
Token token;
|
||||||
@ -126,6 +127,7 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void unbind(String type) {
|
public void unbind(String type) {
|
||||||
|
|
||||||
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
@ -142,13 +144,12 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
queryWrapper.eq(Connect::getUserId, UserContext.getCurrentUser().getId());
|
queryWrapper.eq(Connect::getUserId, UserContext.getCurrentUser().getId());
|
||||||
List<Connect> connects = this.list(queryWrapper);
|
List<Connect> connects = this.list(queryWrapper);
|
||||||
List<String> keys = new ArrayList<>();
|
List<String> keys = new ArrayList<>();
|
||||||
connects.forEach(item -> {
|
connects.forEach(item -> keys.add(item.getUnionType()));
|
||||||
keys.add(item.getUnionType());
|
|
||||||
});
|
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Token appLoginCallback(ConnectAuthUser authUser, String uuid) {
|
public Token appLoginCallback(ConnectAuthUser authUser, String uuid) {
|
||||||
try {
|
try {
|
||||||
return this.unionLoginCallback(authUser.getSource(), authUser.getUuid(), uuid, true);
|
return this.unionLoginCallback(authUser.getSource(), authUser.getUuid(), uuid, true);
|
||||||
@ -209,6 +210,7 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
* @param unionId 微信unionid
|
* @param unionId 微信unionid
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Token phoneMpBindAndLogin(String sessionKey, WechatMPLoginParams params, String openId, String unionId) {
|
public Token phoneMpBindAndLogin(String sessionKey, WechatMPLoginParams params, String openId, String unionId) {
|
||||||
String encryptedData = params.getEncryptedData(), iv = params.getIv();
|
String encryptedData = params.getEncryptedData(), iv = params.getIv();
|
||||||
JSONObject userInfo = this.getUserInfo(encryptedData, sessionKey, iv);
|
JSONObject userInfo = this.getUserInfo(encryptedData, sessionKey, iv);
|
||||||
@ -237,9 +239,9 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
public Connect queryConnect(ConnectQueryDTO connectQueryDTO) {
|
public Connect queryConnect(ConnectQueryDTO connectQueryDTO) {
|
||||||
|
|
||||||
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(StringUtils.isNotEmpty(connectQueryDTO.getUserId()), Connect::getUserId, connectQueryDTO.getUserId())
|
queryWrapper.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUserId()), Connect::getUserId, connectQueryDTO.getUserId())
|
||||||
.eq(StringUtils.isNotEmpty(connectQueryDTO.getUnionType()), Connect::getUnionType, connectQueryDTO.getUnionType())
|
.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUnionType()), Connect::getUnionType, connectQueryDTO.getUnionType())
|
||||||
.eq(StringUtils.isNotEmpty(connectQueryDTO.getUnionId()), Connect::getUnionId, connectQueryDTO.getUnionId());
|
.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUnionId()), Connect::getUnionId, connectQueryDTO.getUnionId());
|
||||||
return this.getOne(queryWrapper);
|
return this.getOne(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,7 +260,7 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
|
|
||||||
|
|
||||||
//如果unionid 不为空 则为账号绑定unionid
|
//如果unionid 不为空 则为账号绑定unionid
|
||||||
if (StringUtils.isNotEmpty(unionId)) {
|
if (CharSequenceUtil.isNotEmpty(unionId)) {
|
||||||
LambdaQueryWrapper<Connect> lambdaQueryWrapper = new LambdaQueryWrapper();
|
LambdaQueryWrapper<Connect> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||||
lambdaQueryWrapper.eq(Connect::getUnionId, unionId);
|
lambdaQueryWrapper.eq(Connect::getUnionId, unionId);
|
||||||
lambdaQueryWrapper.eq(Connect::getUnionType, ConnectEnum.WECHAT.name());
|
lambdaQueryWrapper.eq(Connect::getUnionType, ConnectEnum.WECHAT.name());
|
||||||
@ -271,12 +273,12 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
this.save(connect);
|
this.save(connect);
|
||||||
}
|
}
|
||||||
}//如果openid 不为空 则为账号绑定openid
|
}//如果openid 不为空 则为账号绑定openid
|
||||||
if (StringUtils.isNotEmpty(openId)) {
|
if (CharSequenceUtil.isNotEmpty(openId)) {
|
||||||
LambdaQueryWrapper<Connect> lambdaQueryWrapper = new LambdaQueryWrapper();
|
LambdaQueryWrapper<Connect> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||||
lambdaQueryWrapper.eq(Connect::getUnionId, openId);
|
lambdaQueryWrapper.eq(Connect::getUnionId, openId);
|
||||||
lambdaQueryWrapper.eq(Connect::getUnionType, ConnectEnum.WECHAT_MP_OPEN_ID.name());
|
lambdaQueryWrapper.eq(Connect::getUnionType, ConnectEnum.WECHAT_MP_OPEN_ID.name());
|
||||||
List<Connect> connects = this.list(lambdaQueryWrapper);
|
List<Connect> connects = this.list(lambdaQueryWrapper);
|
||||||
if (connects.size() == 0) {
|
if (connects.isEmpty()) {
|
||||||
Connect connect = new Connect();
|
Connect connect = new Connect();
|
||||||
connect.setUnionId(openId);
|
connect.setUnionId(openId);
|
||||||
connect.setUserId(member.getId());
|
connect.setUserId(member.getId());
|
||||||
@ -290,7 +292,7 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
/**
|
/**
|
||||||
* 获取微信小程序配置
|
* 获取微信小程序配置
|
||||||
*
|
*
|
||||||
* @return
|
* @return 微信小程序配置
|
||||||
*/
|
*/
|
||||||
private WechatConnectSettingItem getWechatMPSetting() {
|
private WechatConnectSettingItem getWechatMPSetting() {
|
||||||
Setting setting = settingService.get(SettingEnum.WECHAT_CONNECT.name());
|
Setting setting = settingService.get(SettingEnum.WECHAT_CONNECT.name());
|
||||||
|
@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
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;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@ -56,6 +57,7 @@ public class DistributionCashServiceImpl extends ServiceImpl<DistributionCashMap
|
|||||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean cash(Double applyMoney) {
|
public Boolean cash(Double applyMoney) {
|
||||||
|
|
||||||
//检查分销功能开关
|
//检查分销功能开关
|
||||||
@ -74,7 +76,7 @@ public class DistributionCashServiceImpl extends ServiceImpl<DistributionCashMap
|
|||||||
distributionService.updateById(distribution);
|
distributionService.updateById(distribution);
|
||||||
//提现申请记录
|
//提现申请记录
|
||||||
DistributionCash distributionCash = new DistributionCash("D" + SnowFlake.getId(), distribution.getId(), applyMoney, distribution.getMemberName());
|
DistributionCash distributionCash = new DistributionCash("D" + SnowFlake.getId(), distribution.getId(), applyMoney, distribution.getMemberName());
|
||||||
Boolean result = this.save(distributionCash);
|
boolean result = this.save(distributionCash);
|
||||||
if (result) {
|
if (result) {
|
||||||
//发送提现消息
|
//发送提现消息
|
||||||
MemberWithdrawalMessage memberWithdrawalMessage = new MemberWithdrawalMessage();
|
MemberWithdrawalMessage memberWithdrawalMessage = new MemberWithdrawalMessage();
|
||||||
@ -108,6 +110,7 @@ public class DistributionCashServiceImpl extends ServiceImpl<DistributionCashMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public DistributionCash audit(String id, String result) {
|
public DistributionCash audit(String id, String result) {
|
||||||
|
|
||||||
//检查分销功能开关
|
//检查分销功能开关
|
||||||
@ -119,7 +122,7 @@ public class DistributionCashServiceImpl extends ServiceImpl<DistributionCashMap
|
|||||||
if (distributorCash != null) {
|
if (distributorCash != null) {
|
||||||
//获取分销员
|
//获取分销员
|
||||||
Distribution distribution = distributionService.getById(distributorCash.getDistributionId());
|
Distribution distribution = distributionService.getById(distributorCash.getDistributionId());
|
||||||
if (distribution != null && distributorCash != null && distribution.getDistributionStatus().equals(DistributionStatusEnum.PASS.name())) {
|
if (distribution != null && distribution.getDistributionStatus().equals(DistributionStatusEnum.PASS.name())) {
|
||||||
MemberWithdrawalMessage memberWithdrawalMessage = new MemberWithdrawalMessage();
|
MemberWithdrawalMessage memberWithdrawalMessage = new MemberWithdrawalMessage();
|
||||||
//审核通过
|
//审核通过
|
||||||
if (result.equals(WithdrawStatusEnum.VIA_AUDITING.name())) {
|
if (result.equals(WithdrawStatusEnum.VIA_AUDITING.name())) {
|
||||||
|
@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
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 java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -78,6 +79,7 @@ public class DistributionOrderServiceImpl extends ServiceImpl<DistributionOrderM
|
|||||||
* @param orderSn 订单编号
|
* @param orderSn 订单编号
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void calculationDistribution(String orderSn) {
|
public void calculationDistribution(String orderSn) {
|
||||||
|
|
||||||
//根据订单编号获取订单数据
|
//根据订单编号获取订单数据
|
||||||
@ -147,6 +149,7 @@ public class DistributionOrderServiceImpl extends ServiceImpl<DistributionOrderM
|
|||||||
* @param orderSn 订单编号
|
* @param orderSn 订单编号
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void cancelOrder(String orderSn) {
|
public void cancelOrder(String orderSn) {
|
||||||
//根据订单编号获取订单数据
|
//根据订单编号获取订单数据
|
||||||
Order order = orderService.getBySn(orderSn);
|
Order order = orderService.getBySn(orderSn);
|
||||||
|
@ -26,6 +26,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@ -68,6 +69,7 @@ public class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Dis
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Distribution applyDistribution(DistributionApplyDTO distributionApplyDTO) {
|
public Distribution applyDistribution(DistributionApplyDTO distributionApplyDTO) {
|
||||||
|
|
||||||
//检查分销开关
|
//检查分销开关
|
||||||
@ -172,7 +174,7 @@ public class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Dis
|
|||||||
//获取分销是否开启
|
//获取分销是否开启
|
||||||
Setting setting = settingService.get(SettingEnum.DISTRIBUTION_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.DISTRIBUTION_SETTING.name());
|
||||||
DistributionSetting distributionSetting = JSONUtil.toBean(setting.getSettingValue(), DistributionSetting.class);
|
DistributionSetting distributionSetting = JSONUtil.toBean(setting.getSettingValue(), DistributionSetting.class);
|
||||||
if (!distributionSetting.getIsOpen()) {
|
if (Boolean.FALSE.equals(distributionSetting.getIsOpen())) {
|
||||||
throw new ServiceException(ResultCode.DISTRIBUTION_CLOSE);
|
throw new ServiceException(ResultCode.DISTRIBUTION_CLOSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package cn.lili.modules.file.serviceimpl;
|
package cn.lili.modules.file.serviceimpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
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;
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.SearchVO;
|
import cn.lili.common.vo.SearchVO;
|
||||||
import cn.lili.modules.file.entity.File;
|
import cn.lili.modules.file.entity.File;
|
||||||
@ -36,7 +36,7 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, File> implements Fi
|
|||||||
@Override
|
@Override
|
||||||
public void batchDelete(List<String> ids) {
|
public void batchDelete(List<String> ids) {
|
||||||
|
|
||||||
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper();
|
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.in(File::getId, ids);
|
queryWrapper.in(File::getId, ids);
|
||||||
|
|
||||||
List<File> files = this.list(queryWrapper);
|
List<File> files = this.list(queryWrapper);
|
||||||
@ -48,7 +48,7 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, File> implements Fi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void batchDelete(List<String> ids, AuthUser authUser) {
|
public void batchDelete(List<String> ids, AuthUser authUser) {
|
||||||
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper();
|
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.in(File::getId, ids);
|
queryWrapper.in(File::getId, ids);
|
||||||
|
|
||||||
queryWrapper.eq(File::getUserEnums, authUser.getRole().name());
|
queryWrapper.eq(File::getUserEnums, authUser.getRole().name());
|
||||||
@ -75,26 +75,24 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, File> implements Fi
|
|||||||
@Override
|
@Override
|
||||||
public IPage<File> customerPage(File file, SearchVO searchVO, PageVO pageVo) {
|
public IPage<File> customerPage(File file, SearchVO searchVO, PageVO pageVo) {
|
||||||
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(file.getName()), File::getName, file.getName())
|
queryWrapper.like(CharSequenceUtil.isNotEmpty(file.getName()), File::getName, file.getName())
|
||||||
.like(StringUtils.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey())
|
.like(CharSequenceUtil.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey())
|
||||||
.like(StringUtils.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType())
|
.like(CharSequenceUtil.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType())
|
||||||
.between(StringUtils.isNotEmpty(searchVO.getStartDate()) && StringUtils.isNotEmpty(searchVO.getEndDate()),
|
.between(CharSequenceUtil.isNotEmpty(searchVO.getStartDate()) && CharSequenceUtil.isNotEmpty(searchVO.getEndDate()),
|
||||||
File::getCreateTime, searchVO.getStartDate(), searchVO.getEndDate());
|
File::getCreateTime, searchVO.getStartDate(), searchVO.getEndDate());
|
||||||
IPage<File> page = this.page(PageUtil.initPage(pageVo), queryWrapper);
|
return this.page(PageUtil.initPage(pageVo), queryWrapper);
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<File> customerPageOwner(FileOwnerDTO ownerDTO, File file, SearchVO searchVO, PageVO pageVo) {
|
public IPage<File> customerPageOwner(FileOwnerDTO ownerDTO, File file, SearchVO searchVO, PageVO pageVo) {
|
||||||
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(StringUtils.isNotEmpty(ownerDTO.getOwnerId()), File::getOwnerId, ownerDTO.getOwnerId())
|
queryWrapper.eq(CharSequenceUtil.isNotEmpty(ownerDTO.getOwnerId()), File::getOwnerId, ownerDTO.getOwnerId())
|
||||||
.eq(File::getUserEnums, ownerDTO.getUserEnums())
|
.eq(File::getUserEnums, ownerDTO.getUserEnums())
|
||||||
.like(StringUtils.isNotEmpty(file.getName()), File::getName, file.getName())
|
.like(CharSequenceUtil.isNotEmpty(file.getName()), File::getName, file.getName())
|
||||||
.like(StringUtils.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey())
|
.like(CharSequenceUtil.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey())
|
||||||
.like(StringUtils.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType())
|
.like(CharSequenceUtil.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType())
|
||||||
.between(StringUtils.isNotEmpty(searchVO.getStartDate()) && StringUtils.isNotEmpty(searchVO.getEndDate()),
|
.between(CharSequenceUtil.isNotEmpty(searchVO.getStartDate()) && CharSequenceUtil.isNotEmpty(searchVO.getEndDate()),
|
||||||
File::getCreateTime, searchVO.getStartDate(), searchVO.getEndDate());
|
File::getCreateTime, searchVO.getStartDate(), searchVO.getEndDate());
|
||||||
IPage<File> page = this.page(PageUtil.initPage(pageVo), queryWrapper);
|
return this.page(PageUtil.initPage(pageVo), queryWrapper);
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -109,7 +109,7 @@ public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements
|
|||||||
/**
|
/**
|
||||||
* 校验绑定关系
|
* 校验绑定关系
|
||||||
*
|
*
|
||||||
* @param brandIds
|
* @param brandIds 品牌Ids
|
||||||
*/
|
*/
|
||||||
private void checkBind(List<String> brandIds) {
|
private void checkBind(List<String> brandIds) {
|
||||||
//分了绑定关系查询
|
//分了绑定关系查询
|
||||||
@ -129,19 +129,11 @@ public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验绑定关系
|
|
||||||
*
|
|
||||||
* @param brandIds
|
|
||||||
*/
|
|
||||||
private void checkoutGoods(List<String> brandIds) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验是否存在
|
* 校验是否存在
|
||||||
*
|
*
|
||||||
* @param brandId
|
* @param brandId 品牌ID
|
||||||
* @return
|
* @return 品牌
|
||||||
*/
|
*/
|
||||||
private Brand checkExist(String brandId) {
|
private Brand checkExist(String brandId) {
|
||||||
Brand brand = getById(brandId);
|
Brand brand = getById(brandId);
|
||||||
|
@ -8,6 +8,7 @@ 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.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -37,6 +38,7 @@ public class CategoryBrandServiceImpl extends ServiceImpl<CategoryBrandMapper, C
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void saveCategoryBrandList(String categoryId, List<String> brandIds) {
|
public void saveCategoryBrandList(String categoryId, List<String> brandIds) {
|
||||||
//删除分类品牌绑定信息
|
//删除分类品牌绑定信息
|
||||||
this.deleteByCategoryId(categoryId);
|
this.deleteByCategoryId(categoryId);
|
||||||
|
@ -3,7 +3,6 @@ package cn.lili.modules.goods.serviceimpl;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
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.properties.RocketmqCustomProperties;
|
|
||||||
import cn.lili.modules.goods.entity.dos.CategoryParameterGroup;
|
import cn.lili.modules.goods.entity.dos.CategoryParameterGroup;
|
||||||
import cn.lili.modules.goods.entity.dos.Goods;
|
import cn.lili.modules.goods.entity.dos.Goods;
|
||||||
import cn.lili.modules.goods.entity.dos.Parameters;
|
import cn.lili.modules.goods.entity.dos.Parameters;
|
||||||
@ -17,9 +16,9 @@ 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.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
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;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -46,12 +45,6 @@ public class CategoryParameterGroupServiceImpl extends ServiceImpl<CategoryParam
|
|||||||
@Autowired
|
@Autowired
|
||||||
private GoodsService goodsService;
|
private GoodsService goodsService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RocketMQTemplate rocketMQTemplate;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ParameterGroupVO> getCategoryParams(String categoryId) {
|
public List<ParameterGroupVO> getCategoryParams(String categoryId) {
|
||||||
//根据id查询参数组
|
//根据id查询参数组
|
||||||
@ -74,6 +67,7 @@ public class CategoryParameterGroupServiceImpl extends ServiceImpl<CategoryParam
|
|||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean updateCategoryGroup(CategoryParameterGroup categoryParameterGroup) {
|
public boolean updateCategoryGroup(CategoryParameterGroup categoryParameterGroup) {
|
||||||
CategoryParameterGroup origin = this.getById(categoryParameterGroup.getId());
|
CategoryParameterGroup origin = this.getById(categoryParameterGroup.getId());
|
||||||
if (origin == null) {
|
if (origin == null) {
|
||||||
|
@ -6,10 +6,7 @@ import cn.lili.cache.CachePrefix;
|
|||||||
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.modules.goods.entity.dos.Category;
|
import cn.lili.modules.goods.entity.dos.Category;
|
||||||
import cn.lili.modules.goods.entity.dos.CategoryParameterGroup;
|
|
||||||
import cn.lili.modules.goods.entity.vos.CategoryVO;
|
import cn.lili.modules.goods.entity.vos.CategoryVO;
|
||||||
import cn.lili.modules.goods.entity.vos.GoodsParamsGroupVO;
|
|
||||||
import cn.lili.modules.goods.entity.vos.GoodsParamsVO;
|
|
||||||
import cn.lili.modules.goods.mapper.CategoryMapper;
|
import cn.lili.modules.goods.mapper.CategoryMapper;
|
||||||
import cn.lili.modules.goods.service.CategoryBrandService;
|
import cn.lili.modules.goods.service.CategoryBrandService;
|
||||||
import cn.lili.modules.goods.service.CategoryParameterGroupService;
|
import cn.lili.modules.goods.service.CategoryParameterGroupService;
|
||||||
@ -23,8 +20,12 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@ -198,6 +199,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean saveCategory(Category category) {
|
public boolean saveCategory(Category category) {
|
||||||
//判断分类佣金是否正确
|
//判断分类佣金是否正确
|
||||||
if (category.getCommissionRate() < 0) {
|
if (category.getCommissionRate() < 0) {
|
||||||
@ -214,6 +216,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateCategory(Category category) {
|
public void updateCategory(Category category) {
|
||||||
//判断分类佣金是否正确
|
//判断分类佣金是否正确
|
||||||
if (category.getCommissionRate() < 0) {
|
if (category.getCommissionRate() < 0) {
|
||||||
@ -239,6 +242,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void delete(String id) {
|
public void delete(String id) {
|
||||||
this.removeById(id);
|
this.removeById(id);
|
||||||
removeCache();
|
removeCache();
|
||||||
@ -249,6 +253,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateCategoryStatus(String categoryId, Boolean enableOperations) {
|
public void updateCategoryStatus(String categoryId, Boolean enableOperations) {
|
||||||
//禁用子分类
|
//禁用子分类
|
||||||
CategoryVO categoryVO = new CategoryVO(this.getById(categoryId));
|
CategoryVO categoryVO = new CategoryVO(this.getById(categoryId));
|
||||||
@ -302,34 +307,6 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼装返回值
|
|
||||||
*
|
|
||||||
* @param paramList 参数列表
|
|
||||||
* @return 拼装后的返回值
|
|
||||||
*/
|
|
||||||
private List<GoodsParamsGroupVO> convertParamList(List<CategoryParameterGroup> groupList, List<GoodsParamsVO> paramList) {
|
|
||||||
Map<String, List<GoodsParamsVO>> map = new HashMap<>(16);
|
|
||||||
for (GoodsParamsVO param : paramList) {
|
|
||||||
if (map.get(param.getGroupId()) != null) {
|
|
||||||
map.get(param.getGroupId()).add(param);
|
|
||||||
} else {
|
|
||||||
List<GoodsParamsVO> list = new ArrayList<>();
|
|
||||||
list.add(param);
|
|
||||||
map.put(param.getGroupId(), list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
List<GoodsParamsGroupVO> resList = new ArrayList<>();
|
|
||||||
for (CategoryParameterGroup group : groupList) {
|
|
||||||
GoodsParamsGroupVO list = new GoodsParamsGroupVO();
|
|
||||||
list.setGroupName(group.getGroupName());
|
|
||||||
list.setGroupId(group.getId());
|
|
||||||
list.setParams(map.get(group.getId()));
|
|
||||||
resList.add(list);
|
|
||||||
}
|
|
||||||
return resList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有的子分类ID
|
* 获取所有的子分类ID
|
||||||
*
|
*
|
||||||
|
@ -27,6 +27,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -46,6 +47,7 @@ public class CommodityServiceImpl extends ServiceImpl<CommodityMapper, Commodity
|
|||||||
private GoodsSkuService goodsSkuService;
|
private GoodsSkuService goodsSkuService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean addCommodity(List<Commodity> commodityList) {
|
public boolean addCommodity(List<Commodity> commodityList) {
|
||||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||||
for (Commodity commodity : commodityList) {
|
for (Commodity commodity : commodityList) {
|
||||||
@ -54,7 +56,7 @@ public class CommodityServiceImpl extends ServiceImpl<CommodityMapper, Commodity
|
|||||||
commodity.setStoreId(storeId);
|
commodity.setStoreId(storeId);
|
||||||
//添加直播商品
|
//添加直播商品
|
||||||
JSONObject json = wechatLivePlayerUtil.addGoods(commodity);
|
JSONObject json = wechatLivePlayerUtil.addGoods(commodity);
|
||||||
if(!"0".equals(json.getStr("errcode"))){
|
if (!"0".equals(json.getStr("errcode"))) {
|
||||||
log.error(json.getStr("errmsg"));
|
log.error(json.getStr("errmsg"));
|
||||||
throw new ServiceException(ResultCode.COMMODITY_ERROR);
|
throw new ServiceException(ResultCode.COMMODITY_ERROR);
|
||||||
}
|
}
|
||||||
@ -93,10 +95,11 @@ public class CommodityServiceImpl extends ServiceImpl<CommodityMapper, Commodity
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void getGoodsWareHouse() {
|
public void getGoodsWareHouse() {
|
||||||
//查询审核中的商品
|
//查询审核中的商品
|
||||||
List<String> goodsIdList = this.baseMapper.getAuditCommodity();
|
List<String> goodsIdList = this.baseMapper.getAuditCommodity();
|
||||||
if (goodsIdList.size() > 0) {
|
if (!goodsIdList.isEmpty()) {
|
||||||
//同步状态
|
//同步状态
|
||||||
JSONObject json = wechatLivePlayerUtil.getGoodsWareHouse(goodsIdList);
|
JSONObject json = wechatLivePlayerUtil.getGoodsWareHouse(goodsIdList);
|
||||||
//修改状态
|
//修改状态
|
||||||
|
@ -14,6 +14,7 @@ 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 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 java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -35,6 +36,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void add(List<String> goodsGalleryList, String goodsId) {
|
public void add(List<String> goodsGalleryList, String goodsId) {
|
||||||
//删除原来商品相册信息
|
//删除原来商品相册信息
|
||||||
this.baseMapper.delete(new UpdateWrapper<GoodsGallery>().eq("goods_id", goodsId));
|
this.baseMapper.delete(new UpdateWrapper<GoodsGallery>().eq("goods_id", goodsId));
|
||||||
|
@ -121,6 +121,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void underStoreGoods(String storeId) {
|
public void underStoreGoods(String storeId) {
|
||||||
//获取商品ID列表
|
//获取商品ID列表
|
||||||
List<String> list = this.baseMapper.getGoodsIdByStoreId(storeId);
|
List<String> list = this.baseMapper.getGoodsIdByStoreId(storeId);
|
||||||
@ -135,6 +136,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
* @param params 商品参数
|
* @param params 商品参数
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateGoodsParams(String goodsId, String params) {
|
public void updateGoodsParams(String goodsId, String params) {
|
||||||
LambdaUpdateWrapper<Goods> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<Goods> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
updateWrapper.eq(Goods::getId, goodsId);
|
updateWrapper.eq(Goods::getId, goodsId);
|
||||||
@ -151,6 +153,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void addGoods(GoodsOperationDTO goodsOperationDTO) {
|
public void addGoods(GoodsOperationDTO goodsOperationDTO) {
|
||||||
Goods goods = new Goods(goodsOperationDTO);
|
Goods goods = new Goods(goodsOperationDTO);
|
||||||
//检查商品
|
//检查商品
|
||||||
@ -174,6 +177,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId) {
|
public void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId) {
|
||||||
Goods goods = new Goods(goodsOperationDTO);
|
Goods goods = new Goods(goodsOperationDTO);
|
||||||
goods.setId(goodsId);
|
goods.setId(goodsId);
|
||||||
@ -264,6 +268,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean auditGoods(List<String> goodsIds, GoodsAuthEnum goodsAuthEnum) {
|
public boolean auditGoods(List<String> goodsIds, GoodsAuthEnum goodsAuthEnum) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
for (String goodsId : goodsIds) {
|
for (String goodsId : goodsIds) {
|
||||||
@ -282,6 +287,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean updateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) {
|
public Boolean updateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) {
|
||||||
boolean result;
|
boolean result;
|
||||||
|
|
||||||
@ -311,6 +317,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean managerUpdateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) {
|
public Boolean managerUpdateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) {
|
||||||
boolean result;
|
boolean result;
|
||||||
|
|
||||||
@ -342,6 +349,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteGoods(List<String> goodsIds) {
|
public Boolean deleteGoods(List<String> goodsIds) {
|
||||||
|
|
||||||
LambdaUpdateWrapper<Goods> updateWrapper = this.getUpdateWrapperByStoreAuthority();
|
LambdaUpdateWrapper<Goods> updateWrapper = this.getUpdateWrapperByStoreAuthority();
|
||||||
@ -365,6 +373,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean freight(List<String> goodsIds, String templateId) {
|
public Boolean freight(List<String> goodsIds, String templateId) {
|
||||||
|
|
||||||
AuthUser authUser = this.checkStoreAuthority();
|
AuthUser authUser = this.checkStoreAuthority();
|
||||||
@ -383,7 +392,6 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void updateStock(String goodsId, Integer quantity) {
|
public void updateStock(String goodsId, Integer quantity) {
|
||||||
LambdaUpdateWrapper<Goods> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
LambdaUpdateWrapper<Goods> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
||||||
lambdaUpdateWrapper.set(Goods::getQuantity, quantity);
|
lambdaUpdateWrapper.set(Goods::getQuantity, quantity);
|
||||||
@ -425,6 +433,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateStoreDetail(Store store) {
|
public void updateStoreDetail(Store store) {
|
||||||
UpdateWrapper updateWrapper = new UpdateWrapper<>()
|
UpdateWrapper updateWrapper = new UpdateWrapper<>()
|
||||||
.eq("store_id", store.getId())
|
.eq("store_id", store.getId())
|
||||||
|
@ -188,6 +188,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
* @param goodsSku sku信息
|
* @param goodsSku sku信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(GoodsSku goodsSku) {
|
public void update(GoodsSku goodsSku) {
|
||||||
this.updateById(goodsSku);
|
this.updateById(goodsSku);
|
||||||
cache.remove(GoodsSkuService.getCacheKeys(goodsSku.getId()));
|
cache.remove(GoodsSkuService.getCacheKeys(goodsSku.getId()));
|
||||||
@ -434,6 +435,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateStocks(List<GoodsSkuStockDTO> goodsSkuStockDTOS) {
|
public void updateStocks(List<GoodsSkuStockDTO> goodsSkuStockDTOS) {
|
||||||
for (GoodsSkuStockDTO goodsSkuStockDTO : goodsSkuStockDTOS) {
|
for (GoodsSkuStockDTO goodsSkuStockDTO : goodsSkuStockDTOS) {
|
||||||
this.updateStock(goodsSkuStockDTO.getSkuId(), goodsSkuStockDTO.getQuantity());
|
this.updateStock(goodsSkuStockDTO.getSkuId(), goodsSkuStockDTO.getQuantity());
|
||||||
@ -441,6 +443,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateStock(String skuId, Integer quantity) {
|
public void updateStock(String skuId, Integer quantity) {
|
||||||
GoodsSku goodsSku = getGoodsSkuByIdFromCache(skuId);
|
GoodsSku goodsSku = getGoodsSkuByIdFromCache(skuId);
|
||||||
if (goodsSku != null) {
|
if (goodsSku != null) {
|
||||||
@ -476,6 +479,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateGoodsStuck(List<GoodsSku> goodsSkus) {
|
public void updateGoodsStuck(List<GoodsSku> goodsSkus) {
|
||||||
//商品id集合 hashset 去重复
|
//商品id集合 hashset 去重复
|
||||||
Set<String> goodsIds = new HashSet<>();
|
Set<String> goodsIds = new HashSet<>();
|
||||||
@ -504,6 +508,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateGoodsSkuCommentNum(String skuId) {
|
public void updateGoodsSkuCommentNum(String skuId) {
|
||||||
//获取商品信息
|
//获取商品信息
|
||||||
GoodsSku goodsSku = this.getGoodsSkuByIdFromCache(skuId);
|
GoodsSku goodsSku = this.getGoodsSkuByIdFromCache(skuId);
|
||||||
@ -584,7 +589,6 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
* @param skuList sku列表
|
* @param skuList sku列表
|
||||||
* @param goods 商品信息
|
* @param goods 商品信息
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
List<GoodsSku> addGoodsSku(List<Map<String, Object>> skuList, Goods goods) {
|
List<GoodsSku> addGoodsSku(List<Map<String, Object>> skuList, Goods goods) {
|
||||||
List<GoodsSku> skus = new ArrayList<>();
|
List<GoodsSku> skus = new ArrayList<>();
|
||||||
for (Map<String, Object> skuVO : skuList) {
|
for (Map<String, Object> skuVO : skuList) {
|
||||||
|
@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
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;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -51,6 +52,7 @@ public class ParametersServiceImpl extends ServiceImpl<ParametersMapper, Paramet
|
|||||||
* @return 是否更新成功
|
* @return 是否更新成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean updateParameter(Parameters parameters) {
|
public boolean updateParameter(Parameters parameters) {
|
||||||
Parameters origin = this.getById(parameters.getId());
|
Parameters origin = this.getById(parameters.getId());
|
||||||
if (origin == null) {
|
if (origin == null) {
|
||||||
|
@ -3,13 +3,11 @@ package cn.lili.modules.goods.serviceimpl;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
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.modules.goods.entity.dos.Category;
|
|
||||||
import cn.lili.modules.goods.entity.dos.CategorySpecification;
|
import cn.lili.modules.goods.entity.dos.CategorySpecification;
|
||||||
import cn.lili.modules.goods.entity.dos.Specification;
|
import cn.lili.modules.goods.entity.dos.Specification;
|
||||||
import cn.lili.modules.goods.mapper.SpecificationMapper;
|
import cn.lili.modules.goods.mapper.SpecificationMapper;
|
||||||
import cn.lili.modules.goods.service.CategorySpecificationService;
|
import cn.lili.modules.goods.service.CategorySpecificationService;
|
||||||
import cn.lili.modules.goods.service.SpecificationService;
|
import cn.lili.modules.goods.service.SpecificationService;
|
||||||
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 org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -41,21 +39,20 @@ public class SpecificationServiceImpl extends ServiceImpl<SpecificationMapper, S
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean deleteSpecification(List<String> ids) {
|
public boolean deleteSpecification(List<String> ids) {
|
||||||
|
boolean result = false;
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
//如果此规格绑定分类则不允许删除
|
//如果此规格绑定分类则不允许删除
|
||||||
List<CategorySpecification> list = categorySpecificationService.list(new QueryWrapper<CategorySpecification>().eq("specification_id", id));
|
List<CategorySpecification> list = categorySpecificationService.list(new QueryWrapper<CategorySpecification>().eq("specification_id", id));
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
List<String> categoryIds = new ArrayList<>();
|
List<String> categoryIds = new ArrayList<>();
|
||||||
list.forEach(item -> {
|
list.forEach(item -> categoryIds.add(item.getCategoryId()));
|
||||||
categoryIds.add(item.getCategoryId());
|
|
||||||
});
|
|
||||||
throw new ServiceException(ResultCode.SPEC_DELETE_ERROR,
|
throw new ServiceException(ResultCode.SPEC_DELETE_ERROR,
|
||||||
JSONUtil.toJsonStr(categoryService.getCategoryNameByIds(categoryIds)));
|
JSONUtil.toJsonStr(categoryService.getCategoryNameByIds(categoryIds)));
|
||||||
}
|
}
|
||||||
//删除规格
|
//删除规格
|
||||||
this.removeById(id);
|
result = this.removeById(id);
|
||||||
}
|
}
|
||||||
return true;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -17,6 +17,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@ -82,6 +83,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public StoreGoodsLabel addStoreGoodsLabel(StoreGoodsLabel storeGoodsLabel) {
|
public StoreGoodsLabel addStoreGoodsLabel(StoreGoodsLabel storeGoodsLabel) {
|
||||||
//获取当前登录商家账号
|
//获取当前登录商家账号
|
||||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||||
@ -97,6 +99,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public StoreGoodsLabel editStoreGoodsLabel(StoreGoodsLabel storeGoodsLabel) {
|
public StoreGoodsLabel editStoreGoodsLabel(StoreGoodsLabel storeGoodsLabel) {
|
||||||
//修改当前店铺的商品分类
|
//修改当前店铺的商品分类
|
||||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||||
|
@ -35,6 +35,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -63,6 +64,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
private GoodsService goodsService;
|
private GoodsService goodsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean create(Studio studio) {
|
public Boolean create(Studio studio) {
|
||||||
studio.setStoreId(Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId());
|
studio.setStoreId(Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId());
|
||||||
//创建小程序直播
|
//创建小程序直播
|
||||||
@ -97,6 +99,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean edit(Studio studio) {
|
public Boolean edit(Studio studio) {
|
||||||
Studio oldStudio = this.getById(studio.getId());
|
Studio oldStudio = this.getById(studio.getId());
|
||||||
wechatLivePlayerUtil.editRoom(studio);
|
wechatLivePlayerUtil.editRoom(studio);
|
||||||
@ -153,6 +156,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean push(Integer roomId, Integer goodsId, String storeId) {
|
public Boolean push(Integer roomId, Integer goodsId, String storeId) {
|
||||||
|
|
||||||
//判断直播间是否已添加商品
|
//判断直播间是否已添加商品
|
||||||
@ -183,6 +187,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean goodsDeleteInRoom(Integer roomId, Integer goodsId, String storeId) {
|
public Boolean goodsDeleteInRoom(Integer roomId, Integer goodsId, String storeId) {
|
||||||
Goods goods = goodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getId, goodsId).eq(Goods::getStoreId, storeId));
|
Goods goods = goodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getId, goodsId).eq(Goods::getStoreId, storeId));
|
||||||
if (goods == null) {
|
if (goods == null) {
|
||||||
|
@ -13,6 +13,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -35,6 +36,7 @@ public class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint
|
|||||||
private EsGoodsSearchService esGoodsSearchService;
|
private EsGoodsSearchService esGoodsSearchService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public FootPrint saveFootprint(FootPrint footPrint) {
|
public FootPrint saveFootprint(FootPrint footPrint) {
|
||||||
LambdaQueryWrapper<FootPrint> queryWrapper = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<FootPrint> queryWrapper = Wrappers.lambdaQuery();
|
||||||
queryWrapper.eq(FootPrint::getMemberId, footPrint.getMemberId());
|
queryWrapper.eq(FootPrint::getMemberId, footPrint.getMemberId());
|
||||||
@ -68,8 +70,7 @@ public class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint
|
|||||||
LambdaQueryWrapper<FootPrint> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<FootPrint> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||||
lambdaQueryWrapper.eq(FootPrint::getMemberId, UserContext.getCurrentUser().getId());
|
lambdaQueryWrapper.eq(FootPrint::getMemberId, UserContext.getCurrentUser().getId());
|
||||||
lambdaQueryWrapper.in(FootPrint::getGoodsId, ids);
|
lambdaQueryWrapper.in(FootPrint::getGoodsId, ids);
|
||||||
this.remove(lambdaQueryWrapper);
|
return this.remove(lambdaQueryWrapper);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -12,6 +12,7 @@ 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 org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@ -54,6 +55,7 @@ public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, M
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public MemberAddress saveMemberAddress(MemberAddress memberAddress) {
|
public MemberAddress saveMemberAddress(MemberAddress memberAddress) {
|
||||||
//判断当前地址是否为默认地址,如果为默认需要将其他的地址修改为非默认
|
//判断当前地址是否为默认地址,如果为默认需要将其他的地址修改为非默认
|
||||||
removeDefaultAddress(memberAddress);
|
removeDefaultAddress(memberAddress);
|
||||||
@ -64,6 +66,7 @@ public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, M
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public MemberAddress updateMemberAddress(MemberAddress memberAddress) {
|
public MemberAddress updateMemberAddress(MemberAddress memberAddress) {
|
||||||
MemberAddress originalMemberAddress = this.getMemberAddress(memberAddress.getId());
|
MemberAddress originalMemberAddress = this.getMemberAddress(memberAddress.getId());
|
||||||
if (originalMemberAddress != null &&
|
if (originalMemberAddress != null &&
|
||||||
|
@ -11,7 +11,6 @@ import cn.lili.common.properties.RocketmqCustomProperties;
|
|||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.security.enums.UserEnums;
|
import cn.lili.common.security.enums.UserEnums;
|
||||||
import cn.lili.common.sensitive.SensitiveWordsFilter;
|
import cn.lili.common.sensitive.SensitiveWordsFilter;
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
@ -161,7 +160,7 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
|
|||||||
UpdateWrapper<MemberEvaluation> updateWrapper = Wrappers.update();
|
UpdateWrapper<MemberEvaluation> updateWrapper = Wrappers.update();
|
||||||
updateWrapper.set("reply_status", true);
|
updateWrapper.set("reply_status", true);
|
||||||
updateWrapper.set("reply", reply);
|
updateWrapper.set("reply", reply);
|
||||||
if (StringUtils.isNotEmpty(replyImage)) {
|
if (CharSequenceUtil.isNotEmpty(replyImage)) {
|
||||||
updateWrapper.set("have_reply_image", true);
|
updateWrapper.set("have_reply_image", true);
|
||||||
updateWrapper.set("reply_image", replyImage);
|
updateWrapper.set("reply_image", replyImage);
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package cn.lili.modules.member.serviceimpl;
|
package cn.lili.modules.member.serviceimpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
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.utils.StringUtils;
|
|
||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
import cn.lili.modules.member.entity.dos.MemberNotice;
|
import cn.lili.modules.member.entity.dos.MemberNotice;
|
||||||
import cn.lili.modules.member.entity.dos.MemberNoticeSenter;
|
import cn.lili.modules.member.entity.dos.MemberNoticeSenter;
|
||||||
@ -42,6 +42,7 @@ public class MemberNoticeSenterServiceImpl extends ServiceImpl<MemberNoticeSente
|
|||||||
private MemberNoticeService memberNoticeService;
|
private MemberNoticeService memberNoticeService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean customSave(MemberNoticeSenter memberNoticeSenter) {
|
public boolean customSave(MemberNoticeSenter memberNoticeSenter) {
|
||||||
|
|
||||||
if (this.saveOrUpdate(memberNoticeSenter)) {
|
if (this.saveOrUpdate(memberNoticeSenter)) {
|
||||||
@ -49,7 +50,7 @@ public class MemberNoticeSenterServiceImpl extends ServiceImpl<MemberNoticeSente
|
|||||||
//如果是选中会员发送
|
//如果是选中会员发送
|
||||||
if (memberNoticeSenter.getSendType().equals(SendTypeEnum.SELECT.name())) {
|
if (memberNoticeSenter.getSendType().equals(SendTypeEnum.SELECT.name())) {
|
||||||
//判定消息是否有效
|
//判定消息是否有效
|
||||||
if (!StringUtils.isEmpty(memberNoticeSenter.getMemberIds())) {
|
if (!CharSequenceUtil.isEmpty(memberNoticeSenter.getMemberIds())) {
|
||||||
String[] ids = memberNoticeSenter.getMemberIds().split(",");
|
String[] ids = memberNoticeSenter.getMemberIds().split(",");
|
||||||
MemberNotice memberNotice;
|
MemberNotice memberNotice;
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
@ -77,7 +78,7 @@ public class MemberNoticeSenterServiceImpl extends ServiceImpl<MemberNoticeSente
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//防止没有会员导致报错
|
//防止没有会员导致报错
|
||||||
if (memberNotices.size() > 0) {
|
if (!memberNotices.isEmpty()) {
|
||||||
//批量保存
|
//批量保存
|
||||||
if (memberNoticeService.saveBatch(memberNotices)) {
|
if (memberNoticeService.saveBatch(memberNotices)) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -2,7 +2,6 @@ package cn.lili.modules.member.serviceimpl;
|
|||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
import cn.lili.modules.member.entity.dos.MemberPointsHistory;
|
import cn.lili.modules.member.entity.dos.MemberPointsHistory;
|
||||||
@ -49,7 +48,7 @@ public class MemberPointsHistoryServiceImpl extends ServiceImpl<MemberPointsHist
|
|||||||
.eq(CharSequenceUtil.isNotEmpty(memberId), MemberPointsHistory::getMemberId, memberId)
|
.eq(CharSequenceUtil.isNotEmpty(memberId), MemberPointsHistory::getMemberId, memberId)
|
||||||
.like(CharSequenceUtil.isNotEmpty(memberName), MemberPointsHistory::getMemberName, memberName);
|
.like(CharSequenceUtil.isNotEmpty(memberName), MemberPointsHistory::getMemberName, memberName);
|
||||||
//如果排序为空,则默认创建时间倒序
|
//如果排序为空,则默认创建时间倒序
|
||||||
if (StringUtils.isEmpty(page.getSort())) {
|
if (CharSequenceUtil.isEmpty(page.getSort())) {
|
||||||
page.setSort("createTime");
|
page.setSort("createTime");
|
||||||
page.setOrder("desc");
|
page.setOrder("desc");
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ package cn.lili.modules.member.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.utils.BeanUtil;
|
import cn.lili.common.utils.BeanUtil;
|
||||||
import cn.lili.mybatis.util.PageUtil;
|
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
import cn.lili.modules.member.entity.dos.MemberReceipt;
|
import cn.lili.modules.member.entity.dos.MemberReceipt;
|
||||||
@ -13,12 +12,14 @@ import cn.lili.modules.member.entity.vo.MemberReceiptVO;
|
|||||||
import cn.lili.modules.member.mapper.MemberReceiptMapper;
|
import cn.lili.modules.member.mapper.MemberReceiptMapper;
|
||||||
import cn.lili.modules.member.service.MemberReceiptService;
|
import cn.lili.modules.member.service.MemberReceiptService;
|
||||||
import cn.lili.modules.member.service.MemberService;
|
import cn.lili.modules.member.service.MemberService;
|
||||||
|
import cn.lili.mybatis.util.PageUtil;
|
||||||
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.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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -40,13 +41,14 @@ public class MemberReceiptServiceImpl extends ServiceImpl<MemberReceiptMapper, M
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean addMemberReceipt(MemberReceiptAddVO memberReceiptAddVO, String memberId) {
|
public Boolean addMemberReceipt(MemberReceiptAddVO memberReceiptAddVO, String memberId) {
|
||||||
//校验发票抬头是否重复
|
//校验发票抬头是否重复
|
||||||
List<MemberReceipt> receipts = this.baseMapper.selectList(new QueryWrapper<MemberReceipt>()
|
List<MemberReceipt> receipts = this.baseMapper.selectList(new QueryWrapper<MemberReceipt>()
|
||||||
.eq("member_id", memberId)
|
.eq("member_id", memberId)
|
||||||
.eq("receipt_title", memberReceiptAddVO.getReceiptTitle())
|
.eq("receipt_title", memberReceiptAddVO.getReceiptTitle())
|
||||||
);
|
);
|
||||||
if (receipts.size() > 0) {
|
if (!receipts.isEmpty()) {
|
||||||
throw new ServiceException(ResultCode.USER_RECEIPT_REPEAT_ERROR);
|
throw new ServiceException(ResultCode.USER_RECEIPT_REPEAT_ERROR);
|
||||||
}
|
}
|
||||||
//参数封装
|
//参数封装
|
||||||
@ -60,7 +62,7 @@ public class MemberReceiptServiceImpl extends ServiceImpl<MemberReceiptMapper, M
|
|||||||
//设置发票默认
|
//设置发票默认
|
||||||
List<MemberReceipt> list = this.baseMapper.selectList(new QueryWrapper<MemberReceipt>().eq("member_id", memberId));
|
List<MemberReceipt> list = this.baseMapper.selectList(new QueryWrapper<MemberReceipt>().eq("member_id", memberId));
|
||||||
//如果当前会员只有一个发票则默认为默认发票,反之需要校验参数默认值,做一些处理
|
//如果当前会员只有一个发票则默认为默认发票,反之需要校验参数默认值,做一些处理
|
||||||
if (list.size() <= 0) {
|
if (list.isEmpty()) {
|
||||||
memberReceipt.setIsDefault(1);
|
memberReceipt.setIsDefault(1);
|
||||||
} else {
|
} else {
|
||||||
if (memberReceiptAddVO.getIsDefault().equals(1)) {
|
if (memberReceiptAddVO.getIsDefault().equals(1)) {
|
||||||
@ -78,6 +80,7 @@ public class MemberReceiptServiceImpl extends ServiceImpl<MemberReceiptMapper, M
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean editMemberReceipt(MemberReceiptAddVO memberReceiptAddVO, String memberId) {
|
public Boolean editMemberReceipt(MemberReceiptAddVO memberReceiptAddVO, String memberId) {
|
||||||
//根据会员id查询发票信息
|
//根据会员id查询发票信息
|
||||||
MemberReceipt memberReceiptDb = this.baseMapper.selectById(memberReceiptAddVO.getId());
|
MemberReceipt memberReceiptDb = this.baseMapper.selectById(memberReceiptAddVO.getId());
|
||||||
@ -92,7 +95,7 @@ public class MemberReceiptServiceImpl extends ServiceImpl<MemberReceiptMapper, M
|
|||||||
.eq("receipt_title", memberReceiptAddVO.getReceiptTitle())
|
.eq("receipt_title", memberReceiptAddVO.getReceiptTitle())
|
||||||
.ne("id", memberReceiptAddVO.getId())
|
.ne("id", memberReceiptAddVO.getId())
|
||||||
);
|
);
|
||||||
if (receipts.size() > 0) {
|
if (!receipts.isEmpty()) {
|
||||||
throw new ServiceException(ResultCode.USER_RECEIPT_REPEAT_ERROR);
|
throw new ServiceException(ResultCode.USER_RECEIPT_REPEAT_ERROR);
|
||||||
}
|
}
|
||||||
BeanUtil.copyProperties(memberReceiptAddVO, memberReceiptDb);
|
BeanUtil.copyProperties(memberReceiptAddVO, memberReceiptDb);
|
||||||
|
@ -50,6 +50,7 @@ import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -380,6 +381,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PointLogPoint
|
@PointLogPoint
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean updateMemberPoint(Long point, String type, String memberId, String content) {
|
public Boolean updateMemberPoint(Long point, String type, String memberId, String content) {
|
||||||
//获取当前会员信息
|
//获取当前会员信息
|
||||||
Member member = this.getById(memberId);
|
Member member = this.getById(memberId);
|
||||||
|
@ -17,6 +17,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@ -50,6 +51,7 @@ public class StoreCollectionServiceImpl extends ServiceImpl<StoreCollectionMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public StoreCollection addStoreCollection(String storeId) {
|
public StoreCollection addStoreCollection(String storeId) {
|
||||||
if (this.getOne(new LambdaUpdateWrapper<StoreCollection>()
|
if (this.getOne(new LambdaUpdateWrapper<StoreCollection>()
|
||||||
.eq(StoreCollection::getMemberId, UserContext.getCurrentUser().getId())
|
.eq(StoreCollection::getMemberId, UserContext.getCurrentUser().getId())
|
||||||
@ -63,6 +65,7 @@ public class StoreCollectionServiceImpl extends ServiceImpl<StoreCollectionMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean deleteStoreCollection(String storeId) {
|
public boolean deleteStoreCollection(String storeId) {
|
||||||
QueryWrapper<StoreCollection> queryWrapper = new QueryWrapper();
|
QueryWrapper<StoreCollection> queryWrapper = new QueryWrapper();
|
||||||
queryWrapper.eq("member_id", UserContext.getCurrentUser().getId());
|
queryWrapper.eq("member_id", UserContext.getCurrentUser().getId());
|
||||||
|
@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
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;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理端发送消息内容业务层实现
|
* 管理端发送消息内容业务层实现
|
||||||
@ -37,6 +38,7 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean sendMessage(Message message) {
|
public Boolean sendMessage(Message message) {
|
||||||
//保存站内信信息
|
//保存站内信信息
|
||||||
this.save(message);
|
this.save(message);
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
package cn.lili.modules.message.serviceimpl;
|
package cn.lili.modules.message.serviceimpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.common.enums.SwitchEnum;
|
import cn.lili.common.enums.SwitchEnum;
|
||||||
import cn.lili.mybatis.util.PageUtil;
|
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.modules.message.entity.dos.MemberMessage;
|
import cn.lili.modules.message.entity.dos.MemberMessage;
|
||||||
import cn.lili.modules.message.entity.dos.NoticeMessage;
|
import cn.lili.modules.message.entity.dos.NoticeMessage;
|
||||||
@ -12,6 +11,7 @@ import cn.lili.modules.message.entity.enums.NoticeMessageParameterEnum;
|
|||||||
import cn.lili.modules.message.mapper.NoticeMessageTemplateMapper;
|
import cn.lili.modules.message.mapper.NoticeMessageTemplateMapper;
|
||||||
import cn.lili.modules.message.service.MemberMessageService;
|
import cn.lili.modules.message.service.MemberMessageService;
|
||||||
import cn.lili.modules.message.service.NoticeMessageService;
|
import cn.lili.modules.message.service.NoticeMessageService;
|
||||||
|
import cn.lili.mybatis.util.PageUtil;
|
||||||
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.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -38,7 +38,7 @@ public class NoticeMessageServiceImpl extends ServiceImpl<NoticeMessageTemplateM
|
|||||||
//构建查询参数
|
//构建查询参数
|
||||||
QueryWrapper<NoticeMessage> messageTemplateQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<NoticeMessage> messageTemplateQueryWrapper = new QueryWrapper<>();
|
||||||
//消息模板类型
|
//消息模板类型
|
||||||
messageTemplateQueryWrapper.eq(!StringUtils.isEmpty(type), "type", type);
|
messageTemplateQueryWrapper.eq(!CharSequenceUtil.isEmpty(type), "type", type);
|
||||||
messageTemplateQueryWrapper.orderByDesc("create_time");
|
messageTemplateQueryWrapper.orderByDesc("create_time");
|
||||||
//查询数据返回
|
//查询数据返回
|
||||||
return this.page(PageUtil.initPage(pageVO), messageTemplateQueryWrapper);
|
return this.page(PageUtil.initPage(pageVO), messageTemplateQueryWrapper);
|
||||||
@ -85,10 +85,10 @@ public class NoticeMessageServiceImpl extends ServiceImpl<NoticeMessageTemplateM
|
|||||||
* @return 替换后站内信内容
|
* @return 替换后站内信内容
|
||||||
*/
|
*/
|
||||||
String replaceNoticeContent(String noticeContent, Map<String, String> parameter) {
|
String replaceNoticeContent(String noticeContent, Map<String, String> parameter) {
|
||||||
for (String key : parameter.keySet()) {
|
for (Map.Entry<String, String> entry : parameter.entrySet()) {
|
||||||
String description = NoticeMessageParameterEnum.getValueByType(key);
|
String description = NoticeMessageParameterEnum.getValueByType(entry.getKey());
|
||||||
if (description != null && parameter.get(key) != null) {
|
if (description != null && entry.getValue() != null) {
|
||||||
noticeContent = noticeContent.replace("#{" + description + "}".trim(), parameter.get(key));
|
noticeContent = noticeContent.replace("#{" + description + "}".trim(), entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return noticeContent;
|
return noticeContent;
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package cn.lili.modules.message.serviceimpl;
|
package cn.lili.modules.message.serviceimpl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.mybatis.util.PageUtil;
|
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.modules.message.entity.dos.StoreMessage;
|
import cn.lili.modules.message.entity.dos.StoreMessage;
|
||||||
import cn.lili.modules.message.entity.vos.StoreMessageQueryVO;
|
import cn.lili.modules.message.entity.vos.StoreMessageQueryVO;
|
||||||
import cn.lili.modules.message.mapper.StoreMessageMapper;
|
import cn.lili.modules.message.mapper.StoreMessageMapper;
|
||||||
import cn.lili.modules.message.service.StoreMessageService;
|
import cn.lili.modules.message.service.StoreMessageService;
|
||||||
|
import cn.lili.mybatis.util.PageUtil;
|
||||||
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;
|
||||||
@ -42,11 +42,11 @@ public class StoreMessageServiceImpl extends ServiceImpl<StoreMessageMapper, Sto
|
|||||||
|
|
||||||
QueryWrapper<StoreMessage> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<StoreMessage> queryWrapper = new QueryWrapper<>();
|
||||||
//消息id查询
|
//消息id查询
|
||||||
if (StringUtils.isNotEmpty(storeMessageQueryVO.getMessageId())) {
|
if (CharSequenceUtil.isNotEmpty(storeMessageQueryVO.getMessageId())) {
|
||||||
queryWrapper.eq("message_id", storeMessageQueryVO.getMessageId());
|
queryWrapper.eq("message_id", storeMessageQueryVO.getMessageId());
|
||||||
}
|
}
|
||||||
//商家id
|
//商家id
|
||||||
if (StringUtils.isNotEmpty(storeMessageQueryVO.getStoreId())) {
|
if (CharSequenceUtil.isNotEmpty(storeMessageQueryVO.getStoreId())) {
|
||||||
queryWrapper.eq("store_id", storeMessageQueryVO.getStoreId());
|
queryWrapper.eq("store_id", storeMessageQueryVO.getStoreId());
|
||||||
}
|
}
|
||||||
//状态查询
|
//状态查询
|
||||||
|
@ -51,6 +51,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
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;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -167,6 +168,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
|||||||
@Override
|
@Override
|
||||||
@AfterSaleLogPoint(sn = "#rvt.sn", description = "'售后申请:售后编号['+#rvt.sn+']'")
|
@AfterSaleLogPoint(sn = "#rvt.sn", description = "'售后申请:售后编号['+#rvt.sn+']'")
|
||||||
@SystemLogPoint(description = "售后-售后申请", customerLog = "'售后申请:售后编号['+#rvt.sn+']'")
|
@SystemLogPoint(description = "售后-售后申请", customerLog = "'售后申请:售后编号['+#rvt.sn+']'")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AfterSale saveAfterSale(AfterSaleDTO afterSaleDTO) {
|
public AfterSale saveAfterSale(AfterSaleDTO afterSaleDTO) {
|
||||||
|
|
||||||
//检查当前订单是否可申请售后
|
//检查当前订单是否可申请售后
|
||||||
@ -178,6 +180,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
|||||||
|
|
||||||
@AfterSaleLogPoint(sn = "#afterSaleSn", description = "'审核售后:售后编号['+#afterSaleSn+'],'+ #serviceStatus")
|
@AfterSaleLogPoint(sn = "#afterSaleSn", description = "'审核售后:售后编号['+#afterSaleSn+'],'+ #serviceStatus")
|
||||||
@SystemLogPoint(description = "售后-审核售后", customerLog = "'审核售后:售后编号['+#afterSaleSn+'],'+ #serviceStatus")
|
@SystemLogPoint(description = "售后-审核售后", customerLog = "'审核售后:售后编号['+#afterSaleSn+'],'+ #serviceStatus")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public AfterSale review(String afterSaleSn, String serviceStatus, String remark, Double actualRefundPrice) {
|
public AfterSale review(String afterSaleSn, String serviceStatus, String remark, Double actualRefundPrice) {
|
||||||
//根据售后单号获取售后单
|
//根据售后单号获取售后单
|
||||||
@ -274,6 +277,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
|||||||
",处理结果['+serviceStatus='PASS'?'商家收货':'商家拒收'+']'")
|
",处理结果['+serviceStatus='PASS'?'商家收货':'商家拒收'+']'")
|
||||||
@SystemLogPoint(description = "售后-商家收货", customerLog = "'售后-商家收货:单号['+#afterSaleSn+'],物流单号为['+#logisticsNo+']" +
|
@SystemLogPoint(description = "售后-商家收货", customerLog = "'售后-商家收货:单号['+#afterSaleSn+'],物流单号为['+#logisticsNo+']" +
|
||||||
",处理结果['+serviceStatus='PASS'?'商家收货':'商家拒收'+']'")
|
",处理结果['+serviceStatus='PASS'?'商家收货':'商家拒收'+']'")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AfterSale storeConfirm(String afterSaleSn, String serviceStatus, String remark) {
|
public AfterSale storeConfirm(String afterSaleSn, String serviceStatus, String remark) {
|
||||||
//根据售后单号获取售后单
|
//根据售后单号获取售后单
|
||||||
AfterSale afterSale = OperationalJudgment.judgment(this.getBySn(afterSaleSn));
|
AfterSale afterSale = OperationalJudgment.judgment(this.getBySn(afterSaleSn));
|
||||||
@ -311,6 +315,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
|||||||
@Override
|
@Override
|
||||||
@AfterSaleLogPoint(sn = "#afterSaleSn", description = "'售后-平台退款:单号['+#afterSaleSn+'],备注为['+#remark+']'")
|
@AfterSaleLogPoint(sn = "#afterSaleSn", description = "'售后-平台退款:单号['+#afterSaleSn+'],备注为['+#remark+']'")
|
||||||
@SystemLogPoint(description = "售后-平台退款", customerLog = "'售后-平台退款:单号['+#afterSaleSn+'],备注为['+#remark+']'")
|
@SystemLogPoint(description = "售后-平台退款", customerLog = "'售后-平台退款:单号['+#afterSaleSn+'],备注为['+#remark+']'")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AfterSale refund(String afterSaleSn, String remark) {
|
public AfterSale refund(String afterSaleSn, String remark) {
|
||||||
//根据售后单号获取售后单
|
//根据售后单号获取售后单
|
||||||
AfterSale afterSale = OperationalJudgment.judgment(this.getBySn(afterSaleSn));
|
AfterSale afterSale = OperationalJudgment.judgment(this.getBySn(afterSaleSn));
|
||||||
@ -337,6 +342,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
|||||||
@Override
|
@Override
|
||||||
@AfterSaleLogPoint(sn = "#afterSaleSn", description = "'售后-买家取消:单号['+#afterSaleSn+']'")
|
@AfterSaleLogPoint(sn = "#afterSaleSn", description = "'售后-买家取消:单号['+#afterSaleSn+']'")
|
||||||
@SystemLogPoint(description = "售后-取消售后", customerLog = "'售后-买家取消:单号['+#afterSaleSn+']'")
|
@SystemLogPoint(description = "售后-取消售后", customerLog = "'售后-买家取消:单号['+#afterSaleSn+']'")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AfterSale cancel(String afterSaleSn) {
|
public AfterSale cancel(String afterSaleSn) {
|
||||||
|
|
||||||
//根据售后单号获取售后单
|
//根据售后单号获取售后单
|
||||||
|
@ -50,6 +50,7 @@ import cn.lili.modules.search.service.EsGoodsSearchService;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
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 java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -271,6 +272,7 @@ public class CartServiceImpl implements CartService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void delete(String[] skuIds) {
|
public void delete(String[] skuIds) {
|
||||||
TradeDTO tradeDTO = this.readDTO(CartTypeEnum.CART);
|
TradeDTO tradeDTO = this.readDTO(CartTypeEnum.CART);
|
||||||
List<CartSkuVO> cartSkuVOS = tradeDTO.getSkuList();
|
List<CartSkuVO> cartSkuVOS = tradeDTO.getSkuList();
|
||||||
@ -496,6 +498,7 @@ public class CartServiceImpl implements CartService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void selectCoupon(String couponId, String way, boolean use) {
|
public void selectCoupon(String couponId, String way, boolean use) {
|
||||||
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
||||||
//获取购物车,然后重新写入优惠券
|
//获取购物车,然后重新写入优惠券
|
||||||
|
@ -32,6 +32,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -118,6 +119,7 @@ public class OrderComplaintServiceImpl extends ServiceImpl<OrderComplaintMapper,
|
|||||||
* @return 添加结果
|
* @return 添加结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public OrderComplaint addOrderComplain(OrderComplaintDTO orderComplaintDTO) {
|
public OrderComplaint addOrderComplain(OrderComplaintDTO orderComplaintDTO) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -16,7 +16,6 @@ import cn.lili.common.security.OperationalJudgment;
|
|||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.security.enums.UserEnums;
|
import cn.lili.common.security.enums.UserEnums;
|
||||||
import cn.lili.common.utils.SnowFlake;
|
import cn.lili.common.utils.SnowFlake;
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsCompleteMessage;
|
import cn.lili.modules.goods.entity.dto.GoodsCompleteMessage;
|
||||||
import cn.lili.modules.member.entity.dto.MemberAddressDTO;
|
import cn.lili.modules.member.entity.dto.MemberAddressDTO;
|
||||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||||
@ -281,6 +280,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OrderLogPoint(description = "'订单['+#orderSn+']取消,原因为:'+#reason", orderSn = "#orderSn")
|
@OrderLogPoint(description = "'订单['+#orderSn+']取消,原因为:'+#reason", orderSn = "#orderSn")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Order cancel(String orderSn, String reason) {
|
public Order cancel(String orderSn, String reason) {
|
||||||
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
||||||
//如果订单促销类型不为空&&订单是拼团订单,并且订单未成团,则抛出异常
|
//如果订单促销类型不为空&&订单是拼团订单,并且订单未成团,则抛出异常
|
||||||
@ -307,6 +307,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OrderLogPoint(description = "'订单['+#orderSn+']系统取消,原因为:'+#reason", orderSn = "#orderSn")
|
@OrderLogPoint(description = "'订单['+#orderSn+']系统取消,原因为:'+#reason", orderSn = "#orderSn")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void systemCancel(String orderSn, String reason) {
|
public void systemCancel(String orderSn, String reason) {
|
||||||
Order order = this.getBySn(orderSn);
|
Order order = this.getBySn(orderSn);
|
||||||
order.setOrderStatus(OrderStatusEnum.CANCELLED.name());
|
order.setOrderStatus(OrderStatusEnum.CANCELLED.name());
|
||||||
@ -327,6 +328,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void payOrder(String orderSn, String paymentMethod, String receivableNo) {
|
public void payOrder(String orderSn, String paymentMethod, String receivableNo) {
|
||||||
|
|
||||||
Order order = this.getBySn(orderSn);
|
Order order = this.getBySn(orderSn);
|
||||||
@ -362,6 +364,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OrderLogPoint(description = "'库存确认'", orderSn = "#orderSn")
|
@OrderLogPoint(description = "'库存确认'", orderSn = "#orderSn")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void afterOrderConfirm(String orderSn) {
|
public void afterOrderConfirm(String orderSn) {
|
||||||
Order order = this.getBySn(orderSn);
|
Order order = this.getBySn(orderSn);
|
||||||
//判断是否为拼团订单,进行特殊处理
|
//判断是否为拼团订单,进行特殊处理
|
||||||
@ -382,6 +385,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SystemLogPoint(description = "修改订单", customerLog = "'订单[' + #orderSn + ']收货信息修改,修改为'+#memberAddressDTO.consigneeDetail+'")
|
@SystemLogPoint(description = "修改订单", customerLog = "'订单[' + #orderSn + ']收货信息修改,修改为'+#memberAddressDTO.consigneeDetail+'")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Order updateConsignee(String orderSn, MemberAddressDTO memberAddressDTO) {
|
public Order updateConsignee(String orderSn, MemberAddressDTO memberAddressDTO) {
|
||||||
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
||||||
|
|
||||||
@ -399,6 +403,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OrderLogPoint(description = "'订单['+#orderSn+']发货,发货单号['+#logisticsNo+']'", orderSn = "#orderSn")
|
@OrderLogPoint(description = "'订单['+#orderSn+']发货,发货单号['+#logisticsNo+']'", orderSn = "#orderSn")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Order delivery(String orderSn, String logisticsNo, String logisticsId) {
|
public Order delivery(String orderSn, String logisticsNo, String logisticsId) {
|
||||||
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
||||||
//如果订单未发货,并且订单状态值等于待发货
|
//如果订单未发货,并且订单状态值等于待发货
|
||||||
@ -465,6 +470,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OrderLogPoint(description = "'订单['+#orderSn+']完成'", orderSn = "#orderSn")
|
@OrderLogPoint(description = "'订单['+#orderSn+']完成'", orderSn = "#orderSn")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void complete(String orderSn) {
|
public void complete(String orderSn) {
|
||||||
//是否可以查询到订单
|
//是否可以查询到订单
|
||||||
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
||||||
@ -473,6 +479,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@OrderLogPoint(description = "'订单['+#orderSn+']完成'", orderSn = "#orderSn")
|
@OrderLogPoint(description = "'订单['+#orderSn+']完成'", orderSn = "#orderSn")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void systemComplete(String orderSn) {
|
public void systemComplete(String orderSn) {
|
||||||
Order order = this.getBySn(orderSn);
|
Order order = this.getBySn(orderSn);
|
||||||
complete(order, orderSn);
|
complete(order, orderSn);
|
||||||
@ -530,6 +537,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteOrder(String sn) {
|
public void deleteOrder(String sn) {
|
||||||
Order order = this.getBySn(sn);
|
Order order = this.getBySn(sn);
|
||||||
if (order == null) {
|
if (order == null) {
|
||||||
@ -563,6 +571,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
* @param parentOrderSn 拼团订单sn
|
* @param parentOrderSn 拼团订单sn
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void agglomeratePintuanOrder(String pintuanId, String parentOrderSn) {
|
public void agglomeratePintuanOrder(String pintuanId, String parentOrderSn) {
|
||||||
//获取拼团配置
|
//获取拼团配置
|
||||||
Pintuan pintuan = pintuanService.getById(pintuanId);
|
Pintuan pintuan = pintuanService.getById(pintuanId);
|
||||||
@ -610,7 +619,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
@Override
|
@Override
|
||||||
public void batchDeliver(MultipartFile files) {
|
public void batchDeliver(MultipartFile files) {
|
||||||
|
|
||||||
InputStream inputStream = null;
|
InputStream inputStream;
|
||||||
List<OrderBatchDeliverDTO> orderBatchDeliverDTOList = new ArrayList<>();
|
List<OrderBatchDeliverDTO> orderBatchDeliverDTOList = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
inputStream = files.getInputStream();
|
inputStream = files.getInputStream();
|
||||||
@ -643,7 +652,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
Order order = this.getBySn(orderSn);
|
Order order = this.getBySn(orderSn);
|
||||||
Trade trade = tradeService.getBySn(order.getTradeSn());
|
Trade trade = tradeService.getBySn(order.getTradeSn());
|
||||||
//如果交易不为空,则返回交易的金额,否则返回订单金额
|
//如果交易不为空,则返回交易的金额,否则返回订单金额
|
||||||
if (StringUtils.isNotEmpty(trade.getPayStatus())
|
if (CharSequenceUtil.isNotEmpty(trade.getPayStatus())
|
||||||
&& trade.getPayStatus().equals(PayStatusEnum.PAID.name())) {
|
&& trade.getPayStatus().equals(PayStatusEnum.PAID.name())) {
|
||||||
return trade.getFlowPrice();
|
return trade.getFlowPrice();
|
||||||
}
|
}
|
||||||
@ -679,7 +688,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
orderBatchDeliverDTO.setLogisticsId(item.getId());
|
orderBatchDeliverDTO.setLogisticsId(item.getId());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (StringUtils.isEmpty(orderBatchDeliverDTO.getLogisticsId())) {
|
if (CharSequenceUtil.isEmpty(orderBatchDeliverDTO.getLogisticsId())) {
|
||||||
throw new ServiceException("物流公司:'" + orderBatchDeliverDTO.getLogisticsName() + " '不存在");
|
throw new ServiceException("物流公司:'" + orderBatchDeliverDTO.getLogisticsName() + " '不存在");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package cn.lili.modules.order.order.serviceimpl;
|
package cn.lili.modules.order.order.serviceimpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.common.utils.BeanUtil;
|
import cn.lili.common.utils.BeanUtil;
|
||||||
import cn.lili.common.utils.CurrencyUtil;
|
import cn.lili.common.utils.CurrencyUtil;
|
||||||
import cn.lili.common.utils.SnowFlake;
|
import cn.lili.common.utils.SnowFlake;
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
||||||
import cn.lili.modules.order.order.entity.dos.Order;
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
@ -103,7 +103,7 @@ public class StoreFlowServiceImpl extends ServiceImpl<StoreFlowMapper, StoreFlow
|
|||||||
storeFlow.setDistributionRebate(item.getPriceDetailDTO().getDistributionCommission());
|
storeFlow.setDistributionRebate(item.getPriceDetailDTO().getDistributionCommission());
|
||||||
storeFlow.setBillPrice(item.getPriceDetailDTO().getBillPrice());
|
storeFlow.setBillPrice(item.getPriceDetailDTO().getBillPrice());
|
||||||
//兼容为空,以及普通订单操作
|
//兼容为空,以及普通订单操作
|
||||||
if (StringUtils.isNotEmpty(orderPromotionType)) {
|
if (CharSequenceUtil.isNotEmpty(orderPromotionType)) {
|
||||||
if (orderPromotionType.equals(OrderPromotionTypeEnum.NORMAL.name())) {
|
if (orderPromotionType.equals(OrderPromotionTypeEnum.NORMAL.name())) {
|
||||||
//普通订单操作
|
//普通订单操作
|
||||||
}
|
}
|
||||||
@ -220,21 +220,21 @@ public class StoreFlowServiceImpl extends ServiceImpl<StoreFlowMapper, StoreFlow
|
|||||||
StoreFlow::getDistributionRebate);
|
StoreFlow::getDistributionRebate);
|
||||||
|
|
||||||
//流水类型判定
|
//流水类型判定
|
||||||
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(storeFlowQueryDTO.getType()),
|
lambdaQueryWrapper.eq(CharSequenceUtil.isNotEmpty(storeFlowQueryDTO.getType()),
|
||||||
StoreFlow::getFlowType, storeFlowQueryDTO.getType());
|
StoreFlow::getFlowType, storeFlowQueryDTO.getType());
|
||||||
|
|
||||||
//售后编号判定
|
//售后编号判定
|
||||||
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(storeFlowQueryDTO.getRefundSn()),
|
lambdaQueryWrapper.eq(CharSequenceUtil.isNotEmpty(storeFlowQueryDTO.getRefundSn()),
|
||||||
StoreFlow::getRefundSn, storeFlowQueryDTO.getRefundSn());
|
StoreFlow::getRefundSn, storeFlowQueryDTO.getRefundSn());
|
||||||
|
|
||||||
//售后编号判定
|
//售后编号判定
|
||||||
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(storeFlowQueryDTO.getOrderSn()),
|
lambdaQueryWrapper.eq(CharSequenceUtil.isNotEmpty(storeFlowQueryDTO.getOrderSn()),
|
||||||
StoreFlow::getOrderSn, storeFlowQueryDTO.getOrderSn());
|
StoreFlow::getOrderSn, storeFlowQueryDTO.getOrderSn());
|
||||||
|
|
||||||
//结算单非空,则校对结算单参数
|
//结算单非空,则校对结算单参数
|
||||||
if (storeFlowQueryDTO.getBill() != null) {
|
if (storeFlowQueryDTO.getBill() != null) {
|
||||||
Bill bill = storeFlowQueryDTO.getBill();
|
Bill bill = storeFlowQueryDTO.getBill();
|
||||||
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(bill.getStoreId()), StoreFlow::getStoreId, bill.getStoreId());
|
lambdaQueryWrapper.eq(CharSequenceUtil.isNotEmpty(bill.getStoreId()), StoreFlow::getStoreId, bill.getStoreId());
|
||||||
lambdaQueryWrapper.between(bill.getStartTime() != null && bill.getEndTime() != null,
|
lambdaQueryWrapper.between(bill.getStartTime() != null && bill.getEndTime() != null,
|
||||||
StoreFlow::getCreateTime, bill.getStartTime(), bill.getEndTime());
|
StoreFlow::getCreateTime, bill.getStartTime(), bill.getEndTime());
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import 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 java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@ -50,6 +51,7 @@ public class ArticleCategoryServiceImpl extends ServiceImpl<ArticleCategoryMappe
|
|||||||
private int maxLevel = 2;
|
private int maxLevel = 2;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ArticleCategory saveArticleCategory(ArticleCategory articleCategory) {
|
public ArticleCategory saveArticleCategory(ArticleCategory articleCategory) {
|
||||||
//非顶级分类
|
//非顶级分类
|
||||||
if (articleCategory.getParentId() != null && !parentId.equals(articleCategory.getParentId())) {
|
if (articleCategory.getParentId() != null && !parentId.equals(articleCategory.getParentId())) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package cn.lili.modules.page.serviceimpl;
|
package cn.lili.modules.page.serviceimpl;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
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.utils.BeanUtil;
|
import cn.lili.common.utils.BeanUtil;
|
||||||
@ -41,7 +41,7 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
|
|||||||
public IPage<ArticleVO> articlePage(ArticleSearchParams articleSearchParams) {
|
public IPage<ArticleVO> articlePage(ArticleSearchParams articleSearchParams) {
|
||||||
articleSearchParams.setSort("a.sort");
|
articleSearchParams.setSort("a.sort");
|
||||||
QueryWrapper queryWrapper = articleSearchParams.queryWrapper();
|
QueryWrapper queryWrapper = articleSearchParams.queryWrapper();
|
||||||
queryWrapper.eq("open_status",true);
|
queryWrapper.eq("open_status", true);
|
||||||
return this.baseMapper.getArticleList(PageUtil.initPage(articleSearchParams), queryWrapper);
|
return this.baseMapper.getArticleList(PageUtil.initPage(articleSearchParams), queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,9 +65,9 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
|
|||||||
@Override
|
@Override
|
||||||
public void customRemove(String id) {
|
public void customRemove(String id) {
|
||||||
//判断是否为默认文章
|
//判断是否为默认文章
|
||||||
if(this.getById(id).getType().equals(ArticleEnum.OTHER.name())){
|
if (this.getById(id).getType().equals(ArticleEnum.OTHER.name())) {
|
||||||
this.removeById(id);
|
this.removeById(id);
|
||||||
}else{
|
} else {
|
||||||
throw new ServiceException(ResultCode.ARTICLE_NO_DELETION);
|
throw new ServiceException(ResultCode.ARTICLE_NO_DELETION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,15 +79,15 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Article customGetByType(String type) {
|
public Article customGetByType(String type) {
|
||||||
if(!StrUtil.equals(type, ArticleEnum.OTHER.name())){
|
if (!CharSequenceUtil.equals(type, ArticleEnum.OTHER.name())) {
|
||||||
return this.getOne(new LambdaUpdateWrapper<Article>().eq(Article::getType,type));
|
return this.getOne(new LambdaUpdateWrapper<Article>().eq(Article::getType, type));
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateArticleStatus(String id, boolean status) {
|
public Boolean updateArticleStatus(String id, boolean status) {
|
||||||
Article article=this.getById(id);
|
Article article = this.getById(id);
|
||||||
article.setOpenStatus(status);
|
article.setOpenStatus(status);
|
||||||
return this.updateById(article);
|
return this.updateById(article);
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 楼层装修管理业务层实现
|
* 楼层装修管理业务层实现
|
||||||
@ -36,6 +37,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
|||||||
private SystemSettingProperties systemSettingProperties;
|
private SystemSettingProperties systemSettingProperties;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void addStorePageData(String storeId) {
|
public void addStorePageData(String storeId) {
|
||||||
//设置店铺的PC页面
|
//设置店铺的PC页面
|
||||||
PageData pageData = new PageData();
|
PageData pageData = new PageData();
|
||||||
@ -55,6 +57,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public PageData addPageData(PageData pageData) {
|
public PageData addPageData(PageData pageData) {
|
||||||
//如果页面为发布,则关闭其他页面,开启此页面
|
//如果页面为发布,则关闭其他页面,开启此页面
|
||||||
//演示站点不可以开启楼层
|
//演示站点不可以开启楼层
|
||||||
@ -72,6 +75,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public PageData updatePageData(PageData pageData) {
|
public PageData updatePageData(PageData pageData) {
|
||||||
//如果页面为发布,则关闭其他页面,开启此页面
|
//如果页面为发布,则关闭其他页面,开启此页面
|
||||||
if (pageData.getPageShow() != null && pageData.getPageShow().equals(SwitchEnum.OPEN.name())) {
|
if (pageData.getPageShow() != null && pageData.getPageShow().equals(SwitchEnum.OPEN.name())) {
|
||||||
@ -91,6 +95,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public PageData releasePageData(String id) {
|
public PageData releasePageData(String id) {
|
||||||
PageData pageData = this.getById(id);
|
PageData pageData = this.getById(id);
|
||||||
|
|
||||||
@ -120,6 +125,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean removePageData(String id) {
|
public boolean removePageData(String id) {
|
||||||
PageData pageData = this.getById(id);
|
PageData pageData = this.getById(id);
|
||||||
//专题则直接进行删除
|
//专题则直接进行删除
|
||||||
|
@ -8,6 +8,7 @@ import cn.lili.modules.page.service.SpecialService;
|
|||||||
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 专题活动业务层实现
|
* 专题活动业务层实现
|
||||||
@ -25,6 +26,7 @@ public class SpecialServiceImpl extends ServiceImpl<SpecialMapper, Special> impl
|
|||||||
private PageDataService pageDataService;
|
private PageDataService pageDataService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Special addSpecial(Special special) {
|
public Special addSpecial(Special special) {
|
||||||
//新建页面
|
//新建页面
|
||||||
PageData pageData = new PageData();
|
PageData pageData = new PageData();
|
||||||
@ -37,6 +39,7 @@ public class SpecialServiceImpl extends ServiceImpl<SpecialMapper, Special> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean removeSpecial(String id) {
|
public boolean removeSpecial(String id) {
|
||||||
|
|
||||||
//删除页面内容
|
//删除页面内容
|
||||||
|
@ -27,6 +27,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -55,7 +56,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|||||||
/**
|
/**
|
||||||
* 角色长度
|
* 角色长度
|
||||||
*/
|
*/
|
||||||
private int rolesMaxSize = 10;
|
private final int rolesMaxSize = 10;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<AdminUserVO> adminUserPage(Page initPage, QueryWrapper<AdminUser> initWrapper) {
|
public IPage<AdminUserVO> adminUserPage(Page initPage, QueryWrapper<AdminUser> initWrapper) {
|
||||||
@ -80,7 +81,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|||||||
log.error("填充部门信息异常", e);
|
log.error("填充部门信息异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!StringUtils.isEmpty(adminUser.getRoleIds())) {
|
if (!CharSequenceUtil.isEmpty(adminUser.getRoleIds())) {
|
||||||
try {
|
try {
|
||||||
List<String> memberRoles = Arrays.asList(adminUser.getRoleIds().split(","));
|
List<String> memberRoles = Arrays.asList(adminUser.getRoleIds().split(","));
|
||||||
adminUserVO.setRoles(
|
adminUserVO.setRoles(
|
||||||
@ -155,14 +156,15 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SystemLogPoint(description = "修改管理员", customerLog = "'修改管理员:'+#adminUser.username")
|
@SystemLogPoint(description = "修改管理员", customerLog = "'修改管理员:'+#adminUser.username")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean updateAdminUser(AdminUser adminUser, List<String> roles) {
|
public boolean updateAdminUser(AdminUser adminUser, List<String> roles) {
|
||||||
|
|
||||||
if (roles != null && roles.size() > 0) {
|
if (roles != null && !roles.isEmpty()) {
|
||||||
|
|
||||||
if (roles.size() > rolesMaxSize) {
|
if (roles.size() > rolesMaxSize) {
|
||||||
throw new ServiceException(ResultCode.PERMISSION_BEYOND_TEN);
|
throw new ServiceException(ResultCode.PERMISSION_BEYOND_TEN);
|
||||||
}
|
}
|
||||||
adminUser.setRoleIds(StringUtils.join(",", roles));
|
adminUser.setRoleIds(CharSequenceUtil.join(",", roles));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
adminUser.setRoleIds("");
|
adminUser.setRoleIds("");
|
||||||
@ -193,13 +195,14 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|||||||
List<AdminUser> adminUsers = this.list(lambdaQueryWrapper);
|
List<AdminUser> adminUsers = this.list(lambdaQueryWrapper);
|
||||||
String password = StringUtils.md5("123456");
|
String password = StringUtils.md5("123456");
|
||||||
String newEncryptPass = new BCryptPasswordEncoder().encode(password);
|
String newEncryptPass = new BCryptPasswordEncoder().encode(password);
|
||||||
if (null != adminUsers && adminUsers.size() > 0) {
|
if (null != adminUsers && !adminUsers.isEmpty()) {
|
||||||
adminUsers.forEach(item -> item.setPassword(newEncryptPass));
|
adminUsers.forEach(item -> item.setPassword(newEncryptPass));
|
||||||
this.updateBatchById(adminUsers);
|
this.updateBatchById(adminUsers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void saveAdminUser(AdminUserDTO adminUser, List<String> roles) {
|
public void saveAdminUser(AdminUserDTO adminUser, List<String> roles) {
|
||||||
AdminUser dbUser = new AdminUser();
|
AdminUser dbUser = new AdminUser();
|
||||||
BeanUtil.copyProperties(adminUser, dbUser);
|
BeanUtil.copyProperties(adminUser, dbUser);
|
||||||
@ -239,7 +242,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|||||||
queryWrapper.eq("user_id", userId);
|
queryWrapper.eq("user_id", userId);
|
||||||
userRoleService.remove(queryWrapper);
|
userRoleService.remove(queryWrapper);
|
||||||
|
|
||||||
if (roles.isEmpty() || roles == null) {
|
if (roles.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<UserRole> userRoles = new ArrayList<>(roles.size());
|
List<UserRole> userRoles = new ArrayList<>(roles.size());
|
||||||
|
@ -6,6 +6,7 @@ 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 org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -27,6 +28,7 @@ public class DepartmentRoleServiceImpl extends ServiceImpl<DepartmentRoleMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
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);
|
||||||
|
@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
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 java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -40,6 +41,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|||||||
private DepartmentRoleService departmentRoleService;
|
private DepartmentRoleService departmentRoleService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteByIds(List<String> ids) {
|
public void deleteByIds(List<String> ids) {
|
||||||
QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.in("department_id", ids);
|
queryWrapper.in("department_id", ids);
|
||||||
|
@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import groovy.util.logging.Slf4j;
|
import groovy.util.logging.Slf4j;
|
||||||
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 javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -57,6 +58,7 @@ public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> i
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateRoleMenu(String roleId, List<RoleMenu> roleMenus) {
|
public void updateRoleMenu(String roleId, List<RoleMenu> roleMenus) {
|
||||||
try {
|
try {
|
||||||
//删除角色已经绑定的菜单
|
//删除角色已经绑定的菜单
|
||||||
|
@ -12,6 +12,7 @@ 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 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 java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -46,6 +47,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteRoles(List<String> roleIds) {
|
public void deleteRoles(List<String> roleIds) {
|
||||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.in("role_id", roleIds);
|
queryWrapper.in("role_id", roleIds);
|
||||||
|
@ -6,6 +6,7 @@ import cn.lili.modules.permission.service.UserRoleService;
|
|||||||
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 org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -35,6 +36,7 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateUserRole(String userId, List<UserRole> userRoles) {
|
public void updateUserRole(String userId, List<UserRole> userRoles) {
|
||||||
|
|
||||||
//删除
|
//删除
|
||||||
|
@ -7,7 +7,6 @@ import cn.lili.modules.promotion.service.CouponActivityItemService;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -38,7 +37,6 @@ public class CouponActivityItemServiceImpl extends ServiceImpl<CouponActivityIte
|
|||||||
* @param couponIds 优惠券id集合
|
* @param couponIds 优惠券id集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
|
||||||
public void removeByCouponId(List<String> couponIds) {
|
public void removeByCouponId(List<String> couponIds) {
|
||||||
this.remove(new LambdaQueryWrapper<CouponActivityItem>()
|
this.remove(new LambdaQueryWrapper<CouponActivityItem>()
|
||||||
.in(CouponActivityItem::getCouponId, couponIds));
|
.in(CouponActivityItem::getCouponId, couponIds));
|
||||||
|
@ -54,6 +54,7 @@ public class CouponActivityServiceImpl extends AbstractPromotionsServiceImpl<Cou
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void specify(String couponActivityId) {
|
public void specify(String couponActivityId) {
|
||||||
//获取优惠券
|
//获取优惠券
|
||||||
CouponActivity couponActivity = this.getById(couponActivityId);
|
CouponActivity couponActivity = this.getById(couponActivityId);
|
||||||
@ -79,6 +80,7 @@ public class CouponActivityServiceImpl extends AbstractPromotionsServiceImpl<Cou
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void registered(List<CouponActivity> couponActivityList, Member member) {
|
public void registered(List<CouponActivity> couponActivityList, Member member) {
|
||||||
for (CouponActivity couponActivity : couponActivityList) {
|
for (CouponActivity couponActivity : couponActivityList) {
|
||||||
//获取会员信息
|
//获取会员信息
|
||||||
@ -164,6 +166,7 @@ public class CouponActivityServiceImpl extends AbstractPromotionsServiceImpl<Cou
|
|||||||
* @param couponActivity 促销实体
|
* @param couponActivity 促销实体
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateEsGoodsIndex(CouponActivity couponActivity) {
|
public void updateEsGoodsIndex(CouponActivity couponActivity) {
|
||||||
//如果是精准发券,进行发送优惠券
|
//如果是精准发券,进行发送优惠券
|
||||||
if (!PromotionsStatusEnum.CLOSE.name().equals(couponActivity.getPromotionStatus()) && couponActivity.getCouponActivityType().equals(CouponActivityTypeEnum.SPECIFY.name())) {
|
if (!PromotionsStatusEnum.CLOSE.name().equals(couponActivity.getPromotionStatus()) && couponActivity.getCouponActivityType().equals(CouponActivityTypeEnum.SPECIFY.name())) {
|
||||||
@ -191,7 +194,6 @@ public class CouponActivityServiceImpl extends AbstractPromotionsServiceImpl<Cou
|
|||||||
* @param memberList 用户列表
|
* @param memberList 用户列表
|
||||||
* @param couponActivityItems 优惠券列表
|
* @param couponActivityItems 优惠券列表
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
|
||||||
void sendCoupon(List<Map<String, Object>> memberList, List<CouponActivityItem> couponActivityItems) {
|
void sendCoupon(List<Map<String, Object>> memberList, List<CouponActivityItem> couponActivityItems) {
|
||||||
|
|
||||||
for (CouponActivityItem couponActivityItem : couponActivityItems) {
|
for (CouponActivityItem couponActivityItem : couponActivityItems) {
|
||||||
|
@ -77,7 +77,6 @@ public class CouponServiceImpl extends AbstractPromotionsServiceImpl<CouponMappe
|
|||||||
* @param receiveNum 领取数量
|
* @param receiveNum 领取数量
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
|
||||||
public void receiveCoupon(String couponId, Integer receiveNum) {
|
public void receiveCoupon(String couponId, Integer receiveNum) {
|
||||||
Coupon coupon = this.getById(couponId);
|
Coupon coupon = this.getById(couponId);
|
||||||
if (coupon == null) {
|
if (coupon == null) {
|
||||||
@ -105,7 +104,6 @@ public class CouponServiceImpl extends AbstractPromotionsServiceImpl<CouponMappe
|
|||||||
* @param usedNum 使用数量
|
* @param usedNum 使用数量
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
|
||||||
public void usedCoupon(String couponId, Integer usedNum) {
|
public void usedCoupon(String couponId, Integer usedNum) {
|
||||||
Coupon coupon = this.getById(couponId);
|
Coupon coupon = this.getById(couponId);
|
||||||
if (coupon == null) {
|
if (coupon == null) {
|
||||||
|
@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
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;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -54,6 +55,7 @@ public class KanjiaActivityGoodsServiceImpl extends AbstractPromotionsServiceImp
|
|||||||
private PromotionGoodsService promotionGoodsService;
|
private PromotionGoodsService promotionGoodsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean add(KanjiaActivityGoodsOperationDTO kanJiaActivityGoodsOperationDTO) {
|
public Boolean add(KanjiaActivityGoodsOperationDTO kanJiaActivityGoodsOperationDTO) {
|
||||||
List<KanjiaActivityGoods> kanjiaActivityGoodsList = new ArrayList<>();
|
List<KanjiaActivityGoods> kanjiaActivityGoodsList = new ArrayList<>();
|
||||||
List<PromotionGoods> promotionGoodsList = new ArrayList<>();
|
List<PromotionGoods> promotionGoodsList = new ArrayList<>();
|
||||||
@ -242,6 +244,7 @@ public class KanjiaActivityGoodsServiceImpl extends AbstractPromotionsServiceImp
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean updateKanjiaActivityGoods(KanjiaActivityGoodsDTO kanJiaActivityGoodsDTO) {
|
public boolean updateKanjiaActivityGoods(KanjiaActivityGoodsDTO kanJiaActivityGoodsDTO) {
|
||||||
//校验砍价商品是否存在
|
//校验砍价商品是否存在
|
||||||
KanjiaActivityGoods dbKanJiaActivityGoods = this.getKanjiaGoodsDetail(kanJiaActivityGoodsDTO.getId());
|
KanjiaActivityGoods dbKanJiaActivityGoods = this.getKanjiaGoodsDetail(kanJiaActivityGoodsDTO.getId());
|
||||||
|
@ -35,6 +35,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
@ -93,6 +94,7 @@ public class KanjiaActivityServiceImpl extends ServiceImpl<KanJiaActivityMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public KanjiaActivityLog add(String id) {
|
public KanjiaActivityLog add(String id) {
|
||||||
AuthUser authUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
AuthUser authUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
||||||
//根据skuId查询当前sku是否参与活动并且是在活动进行中
|
//根据skuId查询当前sku是否参与活动并且是在活动进行中
|
||||||
|
@ -26,6 +26,7 @@ import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|||||||
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;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@ -64,6 +65,7 @@ public class PointsGoodsServiceImpl extends AbstractPromotionsServiceImpl<Points
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean savePointsGoodsBatch(List<PointsGoods> promotionsList) {
|
public boolean savePointsGoodsBatch(List<PointsGoods> promotionsList) {
|
||||||
List<PromotionGoods> promotionGoodsList = new ArrayList<>();
|
List<PromotionGoods> promotionGoodsList = new ArrayList<>();
|
||||||
for (PointsGoods pointsGoods : promotionsList) {
|
for (PointsGoods pointsGoods : promotionsList) {
|
||||||
@ -106,6 +108,7 @@ public class PointsGoodsServiceImpl extends AbstractPromotionsServiceImpl<Points
|
|||||||
* @return 是否更新成功
|
* @return 是否更新成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean updatePromotions(PointsGoods promotions) {
|
public boolean updatePromotions(PointsGoods promotions) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
this.checkStatus(promotions);
|
this.checkStatus(promotions);
|
||||||
@ -126,6 +129,7 @@ public class PointsGoodsServiceImpl extends AbstractPromotionsServiceImpl<Points
|
|||||||
* @return 是否移除成功
|
* @return 是否移除成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean removePromotions(List<String> ids) {
|
public boolean removePromotions(List<String> ids) {
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
PointsGoods pointsGoods = this.getById(id);
|
PointsGoods pointsGoods = this.getById(id);
|
||||||
@ -205,6 +209,7 @@ public class PointsGoodsServiceImpl extends AbstractPromotionsServiceImpl<Points
|
|||||||
* @return 是否更新成功
|
* @return 是否更新成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean updatePromotionsGoods(PointsGoods promotions) {
|
public boolean updatePromotionsGoods(PointsGoods promotions) {
|
||||||
this.promotionGoodsService.deletePromotionGoods(Collections.singletonList(promotions.getId()));
|
this.promotionGoodsService.deletePromotionGoods(Collections.singletonList(promotions.getId()));
|
||||||
return this.promotionGoodsService.save(new PromotionGoods(promotions, this.checkSkuExist(promotions.getSkuId())));
|
return this.promotionGoodsService.save(new PromotionGoods(promotions, this.checkSkuExist(promotions.getSkuId())));
|
||||||
|
@ -36,6 +36,7 @@ import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|||||||
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;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -84,6 +85,7 @@ public class SeckillServiceImpl extends AbstractPromotionsServiceImpl<SeckillMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void init() {
|
public void init() {
|
||||||
//清除演示数据
|
//清除演示数据
|
||||||
|
|
||||||
|
@ -4,8 +4,6 @@ import cn.lili.modules.purchase.entity.dos.PurchaseOrderItem;
|
|||||||
import cn.lili.modules.purchase.mapper.PurchaseOrderItemMapper;
|
import cn.lili.modules.purchase.mapper.PurchaseOrderItemMapper;
|
||||||
import cn.lili.modules.purchase.service.PurchaseOrderItemService;
|
import cn.lili.modules.purchase.service.PurchaseOrderItemService;
|
||||||
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;
|
||||||
|
|
||||||
@ -22,6 +20,7 @@ import java.util.List;
|
|||||||
public class PurchaseOrderItemServiceImpl extends ServiceImpl<PurchaseOrderItemMapper, PurchaseOrderItem> implements PurchaseOrderItemService {
|
public class PurchaseOrderItemServiceImpl extends ServiceImpl<PurchaseOrderItemMapper, PurchaseOrderItem> implements PurchaseOrderItemService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean addPurchaseOrderItem(String purchaseOrderId, List<PurchaseOrderItem> purchaseOrderItemList) {
|
public boolean addPurchaseOrderItem(String purchaseOrderId, List<PurchaseOrderItem> purchaseOrderItemList) {
|
||||||
//添加采购单子内容
|
//添加采购单子内容
|
||||||
for (PurchaseOrderItem purchaseOrderItem : purchaseOrderItemList) {
|
for (PurchaseOrderItem purchaseOrderItem : purchaseOrderItemList) {
|
||||||
|
@ -17,6 +17,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -31,6 +32,7 @@ public class PurchaseOrderServiceImpl extends ServiceImpl<PurchaseOrderMapper, P
|
|||||||
private PurchaseOrderItemService purchaseOrderItemService;
|
private PurchaseOrderItemService purchaseOrderItemService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public PurchaseOrderVO addPurchaseOrder(PurchaseOrderVO purchaseOrderVO) {
|
public PurchaseOrderVO addPurchaseOrder(PurchaseOrderVO purchaseOrderVO) {
|
||||||
PurchaseOrder purchaseOrder = new PurchaseOrder();
|
PurchaseOrder purchaseOrder = new PurchaseOrder();
|
||||||
BeanUtil.copyProperties(purchaseOrderVO, purchaseOrder);
|
BeanUtil.copyProperties(purchaseOrderVO, purchaseOrder);
|
||||||
@ -72,6 +74,7 @@ public class PurchaseOrderServiceImpl extends ServiceImpl<PurchaseOrderMapper, P
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean close(String id) {
|
public boolean close(String id) {
|
||||||
PurchaseOrder purchaseOrder = this.getById(id);
|
PurchaseOrder purchaseOrder = this.getById(id);
|
||||||
purchaseOrder.setStatus("CLOSE");
|
purchaseOrder.setStatus("CLOSE");
|
||||||
|
@ -6,6 +6,7 @@ import cn.lili.modules.purchase.service.PurchaseQuotedItemService;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -20,6 +21,7 @@ import java.util.List;
|
|||||||
public class PurchaseQuotedItemServiceImpl extends ServiceImpl<PurchaseQuotedItemMapper, PurchaseQuotedItem> implements PurchaseQuotedItemService {
|
public class PurchaseQuotedItemServiceImpl extends ServiceImpl<PurchaseQuotedItemMapper, PurchaseQuotedItem> implements PurchaseQuotedItemService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean addPurchaseQuotedItem(String purchaseQuotedId, List<PurchaseQuotedItem> purchaseQuotedItemList) {
|
public boolean addPurchaseQuotedItem(String purchaseQuotedId, List<PurchaseQuotedItem> purchaseQuotedItemList) {
|
||||||
for (PurchaseQuotedItem purchaseQuotedItem : purchaseQuotedItemList) {
|
for (PurchaseQuotedItem purchaseQuotedItem : purchaseQuotedItemList) {
|
||||||
purchaseQuotedItem.setPurchaseQuotedId(purchaseQuotedId);
|
purchaseQuotedItem.setPurchaseQuotedId(purchaseQuotedId);
|
||||||
|
@ -11,6 +11,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -26,6 +27,7 @@ public class PurchaseQuotedServiceImpl extends ServiceImpl<PurchaseQuotedMapper,
|
|||||||
@Autowired
|
@Autowired
|
||||||
private PurchaseQuotedItemService purchaseQuotedItemService;
|
private PurchaseQuotedItemService purchaseQuotedItemService;
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public PurchaseQuotedVO addPurchaseQuoted(PurchaseQuotedVO purchaseQuotedVO) {
|
public PurchaseQuotedVO addPurchaseQuoted(PurchaseQuotedVO purchaseQuotedVO) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ 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.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
@ -62,6 +63,7 @@ public class CustomWordsServiceImpl extends ServiceImpl<CustomWordsMapper, Custo
|
|||||||
* @return 是否添加成功
|
* @return 是否添加成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean addCustomWords(CustomWordsVO customWordsVO) {
|
public boolean addCustomWords(CustomWordsVO customWordsVO) {
|
||||||
LambdaQueryWrapper<CustomWords> queryWrapper = new LambdaQueryWrapper<CustomWords>().eq(CustomWords::getName, customWordsVO.getName());
|
LambdaQueryWrapper<CustomWords> queryWrapper = new LambdaQueryWrapper<CustomWords>().eq(CustomWords::getName, customWordsVO.getName());
|
||||||
CustomWords one = this.getOne(queryWrapper, false);
|
CustomWords one = this.getOne(queryWrapper, false);
|
||||||
@ -81,6 +83,7 @@ public class CustomWordsServiceImpl extends ServiceImpl<CustomWordsMapper, Custo
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean deleteCustomWords(String id) {
|
public boolean deleteCustomWords(String id) {
|
||||||
if (this.getById(id) == null) {
|
if (this.getById(id) == null) {
|
||||||
throw new ServiceException(ResultCode.CUSTOM_WORDS_NOT_EXIST_ERROR);
|
throw new ServiceException(ResultCode.CUSTOM_WORDS_NOT_EXIST_ERROR);
|
||||||
|
@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
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;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -31,6 +32,7 @@ public class SmsReachServiceImpl extends ServiceImpl<SmsReachMapper, SmsReach> i
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void addSmsReach(SmsReach smsReach,List<String> mobile) {
|
public void addSmsReach(SmsReach smsReach,List<String> mobile) {
|
||||||
String destination = rocketmqCustomProperties.getNoticeSendTopic() + ":" + OtherTagsEnum.SMS.name();
|
String destination = rocketmqCustomProperties.getNoticeSendTopic() + ":" + OtherTagsEnum.SMS.name();
|
||||||
SmsReachDTO smsReachDTO = new SmsReachDTO();
|
SmsReachDTO smsReachDTO = new SmsReachDTO();
|
||||||
|
@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
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 java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -32,6 +33,7 @@ public class SmsSignServiceImpl extends ServiceImpl<SmsSignMapper, SmsSign> impl
|
|||||||
private AliSmsUtil aliSmsUtil;
|
private AliSmsUtil aliSmsUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void addSmsSign(SmsSign smsSign) {
|
public void addSmsSign(SmsSign smsSign) {
|
||||||
try {
|
try {
|
||||||
//如果短信签名已存在,不能重复申请
|
//如果短信签名已存在,不能重复申请
|
||||||
@ -47,6 +49,7 @@ public class SmsSignServiceImpl extends ServiceImpl<SmsSignMapper, SmsSign> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteSmsSign(String id) {
|
public void deleteSmsSign(String id) {
|
||||||
try {
|
try {
|
||||||
SmsSign smsSign = this.getById(id);
|
SmsSign smsSign = this.getById(id);
|
||||||
@ -61,6 +64,7 @@ public class SmsSignServiceImpl extends ServiceImpl<SmsSignMapper, SmsSign> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void querySmsSign() {
|
public void querySmsSign() {
|
||||||
try {
|
try {
|
||||||
Map<String, Object> map = new HashMap<>(16);
|
Map<String, Object> map = new HashMap<>(16);
|
||||||
@ -79,6 +83,7 @@ public class SmsSignServiceImpl extends ServiceImpl<SmsSignMapper, SmsSign> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void modifySmsSign(SmsSign smsSign) {
|
public void modifySmsSign(SmsSign smsSign) {
|
||||||
try {
|
try {
|
||||||
aliSmsUtil.modifySmsSign(smsSign);
|
aliSmsUtil.modifySmsSign(smsSign);
|
||||||
|
@ -14,7 +14,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
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 java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -59,7 +58,7 @@ public class SmsTemplateServiceImpl extends ServiceImpl<SmsTemplateMapper, SmsTe
|
|||||||
@Override
|
@Override
|
||||||
public void querySmsTemplate() {
|
public void querySmsTemplate() {
|
||||||
try {
|
try {
|
||||||
Map<String, Object> map = new HashMap<>(16);
|
Map<String, Object> map;
|
||||||
//获取未审核通过的签名列表
|
//获取未审核通过的签名列表
|
||||||
List<SmsTemplate> list = list(new LambdaQueryWrapper<SmsTemplate>().eq(SmsTemplate::getTemplateStatus, 0));
|
List<SmsTemplate> list = list(new LambdaQueryWrapper<SmsTemplate>().eq(SmsTemplate::getTemplateStatus, 0));
|
||||||
//查询签名状态
|
//查询签名状态
|
||||||
|
@ -30,6 +30,7 @@ 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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@ -73,6 +74,7 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Store add(AdminStoreApplyDTO adminStoreApplyDTO) {
|
public Store add(AdminStoreApplyDTO adminStoreApplyDTO) {
|
||||||
|
|
||||||
//判断店铺名称是否存在
|
//判断店铺名称是否存在
|
||||||
@ -111,6 +113,7 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Store edit(StoreEditDTO storeEditDTO) {
|
public Store edit(StoreEditDTO storeEditDTO) {
|
||||||
if (storeEditDTO != null) {
|
if (storeEditDTO != null) {
|
||||||
//判断店铺名是否唯一
|
//判断店铺名是否唯一
|
||||||
@ -157,6 +160,7 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean audit(String id, Integer passed) {
|
public boolean audit(String id, Integer passed) {
|
||||||
Store store = this.getById(id);
|
Store store = this.getById(id);
|
||||||
if (store == null) {
|
if (store == null) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cn.lili.modules.system.serviceimpl;
|
package cn.lili.modules.system.serviceimpl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.SwitchEnum;
|
import cn.lili.common.enums.SwitchEnum;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
@ -70,7 +70,7 @@ public class LogisticsServiceImpl extends ServiceImpl<LogisticsMapper, Logistics
|
|||||||
*/
|
*/
|
||||||
private Traces getOrderTracesByJson(String logisticsId, String expNo) throws Exception {
|
private Traces getOrderTracesByJson(String logisticsId, String expNo) throws Exception {
|
||||||
Setting setting = settingService.get(SettingEnum.KUAIDI_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.KUAIDI_SETTING.name());
|
||||||
if (StrUtil.isBlank(setting.getSettingValue())) {
|
if (CharSequenceUtil.isBlank(setting.getSettingValue())) {
|
||||||
throw new ServiceException(ResultCode.LOGISTICS_NOT_SETTING);
|
throw new ServiceException(ResultCode.LOGISTICS_NOT_SETTING);
|
||||||
}
|
}
|
||||||
KuaidiSetting kuaidiSetting = new Gson().fromJson(setting.getSettingValue(), KuaidiSetting.class);
|
KuaidiSetting kuaidiSetting = new Gson().fromJson(setting.getSettingValue(), KuaidiSetting.class);
|
||||||
@ -88,7 +88,7 @@ public class LogisticsServiceImpl extends ServiceImpl<LogisticsMapper, Logistics
|
|||||||
|
|
||||||
if (logistics != null) {
|
if (logistics != null) {
|
||||||
String requestData = "{'OrderCode':'','ShipperCode':'" + logistics.getCode() + "','LogisticCode':'" + expNo + "'}";
|
String requestData = "{'OrderCode':'','ShipperCode':'" + logistics.getCode() + "','LogisticCode':'" + expNo + "'}";
|
||||||
Map<String, String> params = new HashMap<String, String>(8);
|
Map<String, String> params = new HashMap<>(8);
|
||||||
params.put("RequestData", urlEncoder(requestData, "UTF-8"));
|
params.put("RequestData", urlEncoder(requestData, "UTF-8"));
|
||||||
params.put("EBusinessID", EBusinessID);
|
params.put("EBusinessID", EBusinessID);
|
||||||
params.put("RequestType", "1002");
|
params.put("RequestType", "1002");
|
||||||
@ -134,14 +134,12 @@ public class LogisticsServiceImpl extends ServiceImpl<LogisticsMapper, Logistics
|
|||||||
* @throws UnsupportedEncodingException
|
* @throws UnsupportedEncodingException
|
||||||
*/
|
*/
|
||||||
private String base64(String str, String charset) throws UnsupportedEncodingException {
|
private String base64(String str, String charset) throws UnsupportedEncodingException {
|
||||||
String encoded = base64Encode(str.getBytes(charset));
|
return base64Encode(str.getBytes(charset));
|
||||||
return encoded;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private String urlEncoder(String str, String charset) throws UnsupportedEncodingException {
|
private String urlEncoder(String str, String charset) throws UnsupportedEncodingException {
|
||||||
String result = URLEncoder.encode(str, charset);
|
return URLEncoder.encode(str, charset);
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package cn.lili.modules.system.serviceimpl;
|
package cn.lili.modules.system.serviceimpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
import cn.lili.common.utils.HttpClientUtils;
|
import cn.lili.common.utils.HttpClientUtils;
|
||||||
import cn.lili.common.utils.SnowFlake;
|
import cn.lili.common.utils.SnowFlake;
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.modules.system.entity.dos.Region;
|
import cn.lili.modules.system.entity.dos.Region;
|
||||||
import cn.lili.modules.system.entity.vo.RegionVO;
|
import cn.lili.modules.system.entity.vo.RegionVO;
|
||||||
import cn.lili.modules.system.mapper.RegionMapper;
|
import cn.lili.modules.system.mapper.RegionMapper;
|
||||||
@ -31,7 +31,7 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
|||||||
/**
|
/**
|
||||||
* 同步请求地址
|
* 同步请求地址
|
||||||
*/
|
*/
|
||||||
private String syncUrl = "https://restapi.amap.com/v3/config/district?subdistrict=4&key=e456d77800e2084a326f7b777278f89d";
|
private final String syncUrl = "https://restapi.amap.com/v3/config/district?subdistrict=4&key=e456d77800e2084a326f7b777278f89d";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
@ -41,12 +41,12 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
//清空数据
|
//清空数据
|
||||||
QueryWrapper<Region> queryWrapper = new QueryWrapper();
|
QueryWrapper<Region> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.ne("id", "-1");
|
queryWrapper.ne("id", "-1");
|
||||||
this.remove(queryWrapper);
|
this.remove(queryWrapper);
|
||||||
|
|
||||||
//读取数据
|
//读取数据
|
||||||
String jsonString = HttpClientUtils.doGet(StringUtils.isEmpty(url) ? syncUrl : url, null);
|
String jsonString = HttpClientUtils.doGet(CharSequenceUtil.isEmpty(url) ? syncUrl : url, null);
|
||||||
|
|
||||||
//构造存储数据库的对象集合
|
//构造存储数据库的对象集合
|
||||||
List<Region> regions = this.initData(jsonString);
|
List<Region> regions = this.initData(jsonString);
|
||||||
@ -66,12 +66,7 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
|||||||
LambdaQueryWrapper<Region> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Region> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(Region::getParentId, id);
|
lambdaQueryWrapper.eq(Region::getParentId, id);
|
||||||
List<Region> regions = this.list(lambdaQueryWrapper);
|
List<Region> regions = this.list(lambdaQueryWrapper);
|
||||||
regions.sort(new Comparator<Region>() {
|
regions.sort(Comparator.comparing(Region::getOrderNum));
|
||||||
@Override
|
|
||||||
public int compare(Region o1, Region o2) {
|
|
||||||
return o1.getOrderNum().compareTo(o2.getOrderNum());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return regions;
|
return regions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,26 +84,26 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
|||||||
result = ArrayUtils.remove(result, 0);
|
result = ArrayUtils.remove(result, 0);
|
||||||
result = ArrayUtils.remove(result, 0);
|
result = ArrayUtils.remove(result, 0);
|
||||||
//地址id
|
//地址id
|
||||||
String regionIds = "";
|
StringBuilder regionIds = new StringBuilder();
|
||||||
//地址名称
|
//地址名称
|
||||||
String regionNames = "";
|
StringBuilder regionNames = new StringBuilder();
|
||||||
//循环构建新的数据
|
//循环构建新的数据
|
||||||
for (String regionId : result) {
|
for (String regionId : result) {
|
||||||
Region reg = this.baseMapper.selectById(regionId);
|
Region reg = this.baseMapper.selectById(regionId);
|
||||||
if (reg != null) {
|
if (reg != null) {
|
||||||
regionIds += regionId + ",";
|
regionIds.append(regionId).append(",");
|
||||||
regionNames += reg.getName() + ",";
|
regionNames.append(reg.getName()).append(",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
regionIds += region.getId();
|
regionIds.append(region.getId());
|
||||||
regionNames += region.getName();
|
regionNames.append(region.getName());
|
||||||
//构建返回数据
|
//构建返回数据
|
||||||
Map<String, Object> obj = new HashMap<>(2);
|
Map<String, Object> obj = new HashMap<>(2);
|
||||||
obj.put("id", regionIds);
|
obj.put("id", regionIds.toString());
|
||||||
obj.put("name", regionNames);
|
obj.put("name", regionNames.toString());
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
return null;
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -121,9 +116,7 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
|||||||
|
|
||||||
private List<RegionVO> regionTree(List<Region> regions) {
|
private List<RegionVO> regionTree(List<Region> regions) {
|
||||||
List<RegionVO> regionVOS = new ArrayList<>();
|
List<RegionVO> regionVOS = new ArrayList<>();
|
||||||
regions.stream().filter(region -> ("province").equals(region.getLevel())).forEach(item -> {
|
regions.stream().filter(region -> ("province").equals(region.getLevel())).forEach(item -> regionVOS.add(new RegionVO(item)));
|
||||||
regionVOS.add(new RegionVO(item));
|
|
||||||
});
|
|
||||||
regions.stream().filter(region -> ("city").equals(region.getLevel())).forEach(item -> {
|
regions.stream().filter(region -> ("city").equals(region.getLevel())).forEach(item -> {
|
||||||
for (RegionVO region : regionVOS) {
|
for (RegionVO region : regionVOS) {
|
||||||
if (region.getId().equals(item.getParentId())) {
|
if (region.getId().equals(item.getParentId())) {
|
||||||
@ -238,9 +231,9 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
|||||||
record.setParentId(parentId);
|
record.setParentId(parentId);
|
||||||
record.setOrderNum(order);
|
record.setOrderNum(order);
|
||||||
record.setId(String.valueOf(SnowFlake.getId()));
|
record.setId(String.valueOf(SnowFlake.getId()));
|
||||||
StringBuffer megName = new StringBuffer(",");
|
StringBuilder megName = new StringBuilder(",");
|
||||||
for (int i = 0; i < ids.length; i++) {
|
for (int i = 0; i < ids.length; i++) {
|
||||||
megName = megName.append(ids[i]) ;
|
megName.append(ids[i]);
|
||||||
if (i < ids.length - 1) {
|
if (i < ids.length - 1) {
|
||||||
megName.append(",");
|
megName.append(",");
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ public class VerificationServiceImpl implements VerificationService {
|
|||||||
@Override
|
@Override
|
||||||
public boolean check(String uuid, VerificationEnums verificationEnums) {
|
public boolean check(String uuid, VerificationEnums verificationEnums) {
|
||||||
//如果有校验标记,则返回校验结果
|
//如果有校验标记,则返回校验结果
|
||||||
if (cache.remove(cacheResult(verificationEnums, uuid))) {
|
if (Boolean.TRUE.equals(cache.remove(cacheResult(verificationEnums, uuid)))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
throw new ServiceException(ResultCode.VERIFICATION_CODE_INVALID);
|
throw new ServiceException(ResultCode.VERIFICATION_CODE_INVALID);
|
||||||
|
@ -37,6 +37,7 @@ import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@ -93,6 +94,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean increaseWithdrawal(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
public Boolean increaseWithdrawal(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
||||||
//检测会员预存款讯息是否存在,如果不存在则新建
|
//检测会员预存款讯息是否存在,如果不存在则新建
|
||||||
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
||||||
@ -107,6 +109,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean increase(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
public Boolean increase(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
||||||
//检测会员预存款讯息是否存在,如果不存在则新建
|
//检测会员预存款讯息是否存在,如果不存在则新建
|
||||||
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
||||||
@ -121,6 +124,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean reduce(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
public Boolean reduce(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
||||||
//检测会员预存款讯息是否存在,如果不存在则新建
|
//检测会员预存款讯息是否存在,如果不存在则新建
|
||||||
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
||||||
@ -139,6 +143,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean reduceWithdrawal(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
public Boolean reduceWithdrawal(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
||||||
//检测会员预存款讯息是否存在,如果不存在则新建
|
//检测会员预存款讯息是否存在,如果不存在则新建
|
||||||
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
||||||
@ -158,6 +163,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean reduceFrozen(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
public Boolean reduceFrozen(MemberWalletUpdateDTO memberWalletUpdateDTO) {
|
||||||
//检测会员预存款讯息是否存在,如果不存在则新建
|
//检测会员预存款讯息是否存在,如果不存在则新建
|
||||||
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
MemberWallet memberWallet = this.checkMemberWallet(memberWalletUpdateDTO.getMemberId());
|
||||||
@ -245,6 +251,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean applyWithdrawal(Double price) {
|
public Boolean applyWithdrawal(Double price) {
|
||||||
MemberWithdrawalMessage memberWithdrawalMessage = new MemberWithdrawalMessage();
|
MemberWithdrawalMessage memberWithdrawalMessage = new MemberWithdrawalMessage();
|
||||||
AuthUser authUser = UserContext.getCurrentUser();
|
AuthUser authUser = UserContext.getCurrentUser();
|
||||||
@ -260,7 +267,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
|||||||
if (setting != null) {
|
if (setting != null) {
|
||||||
//如果不需要审核则审核自动通过
|
//如果不需要审核则审核自动通过
|
||||||
WithdrawalSetting withdrawalSetting = new Gson().fromJson(setting.getSettingValue(), WithdrawalSetting.class);
|
WithdrawalSetting withdrawalSetting = new Gson().fromJson(setting.getSettingValue(), WithdrawalSetting.class);
|
||||||
if (!withdrawalSetting.getApply()) {
|
if (Boolean.FALSE.equals(withdrawalSetting.getApply())) {
|
||||||
memberWithdrawApply.setApplyStatus(WithdrawStatusEnum.VIA_AUDITING.name());
|
memberWithdrawApply.setApplyStatus(WithdrawStatusEnum.VIA_AUDITING.name());
|
||||||
memberWithdrawApply.setInspectRemark("系统自动审核通过");
|
memberWithdrawApply.setInspectRemark("系统自动审核通过");
|
||||||
//校验金额是否满足提现,因为是从余额扣减,所以校验的是余额
|
//校验金额是否满足提现,因为是从余额扣减,所以校验的是余额
|
||||||
@ -271,7 +278,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
|||||||
memberWithdrawalMessage.setStatus(WithdrawStatusEnum.VIA_AUDITING.name());
|
memberWithdrawalMessage.setStatus(WithdrawStatusEnum.VIA_AUDITING.name());
|
||||||
//微信零钱提现
|
//微信零钱提现
|
||||||
Boolean result = withdrawal(memberWithdrawApply);
|
Boolean result = withdrawal(memberWithdrawApply);
|
||||||
if (result) {
|
if (Boolean.TRUE.equals(result)) {
|
||||||
this.reduce(new MemberWalletUpdateDTO(price, authUser.getId(), "余额提现成功", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name()));
|
this.reduce(new MemberWalletUpdateDTO(price, authUser.getId(), "余额提现成功", DepositServiceTypeEnum.WALLET_WITHDRAWAL.name()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
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;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@ -51,6 +52,7 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
|
|||||||
private MemberWalletService memberWalletService;
|
private MemberWalletService memberWalletService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean audit(String applyId, Boolean result, String remark) {
|
public Boolean audit(String applyId, Boolean result, String remark) {
|
||||||
MemberWithdrawalMessage memberWithdrawalMessage = new MemberWithdrawalMessage();
|
MemberWithdrawalMessage memberWithdrawalMessage = new MemberWithdrawalMessage();
|
||||||
//查询申请记录
|
//查询申请记录
|
||||||
@ -65,11 +67,11 @@ public class MemberWithdrawApplyServiceImpl extends ServiceImpl<MemberWithdrawAp
|
|||||||
throw new ServiceException(ResultCode.WALLET_WITHDRAWAL_FROZEN_AMOUNT_INSUFFICIENT);
|
throw new ServiceException(ResultCode.WALLET_WITHDRAWAL_FROZEN_AMOUNT_INSUFFICIENT);
|
||||||
}
|
}
|
||||||
//如果审核通过 则微信直接提现,反之则记录审核状态
|
//如果审核通过 则微信直接提现,反之则记录审核状态
|
||||||
if (result) {
|
if (Boolean.TRUE.equals(result)) {
|
||||||
memberWithdrawApply.setApplyStatus(WithdrawStatusEnum.VIA_AUDITING.name());
|
memberWithdrawApply.setApplyStatus(WithdrawStatusEnum.VIA_AUDITING.name());
|
||||||
//提现,微信提现成功后扣减冻结金额
|
//提现,微信提现成功后扣减冻结金额
|
||||||
Boolean bool = memberWalletService.withdrawal(memberWithdrawApply);
|
Boolean bool = memberWalletService.withdrawal(memberWithdrawApply);
|
||||||
if (bool) {
|
if (Boolean.TRUE.equals(bool)) {
|
||||||
memberWithdrawalMessage.setStatus(WithdrawStatusEnum.VIA_AUDITING.name());
|
memberWithdrawalMessage.setStatus(WithdrawStatusEnum.VIA_AUDITING.name());
|
||||||
//保存修改审核记录
|
//保存修改审核记录
|
||||||
this.updateById(memberWithdrawApply);
|
this.updateById(memberWithdrawApply);
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package cn.lili.modules.wallet.serviceimpl;
|
package cn.lili.modules.wallet.serviceimpl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
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;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.utils.SnowFlake;
|
import cn.lili.common.utils.SnowFlake;
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
||||||
import cn.lili.modules.order.trade.entity.vo.RechargeQueryVO;
|
import cn.lili.modules.order.trade.entity.vo.RechargeQueryVO;
|
||||||
@ -59,13 +59,13 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
|
|||||||
//构建查询条件
|
//构建查询条件
|
||||||
QueryWrapper<Recharge> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<Recharge> queryWrapper = new QueryWrapper<>();
|
||||||
//会员名称
|
//会员名称
|
||||||
queryWrapper.like(!StringUtils.isEmpty(rechargeQueryVO.getMemberName()), "member_name", rechargeQueryVO.getMemberName());
|
queryWrapper.like(!CharSequenceUtil.isEmpty(rechargeQueryVO.getMemberName()), "member_name", rechargeQueryVO.getMemberName());
|
||||||
//充值订单号
|
//充值订单号
|
||||||
queryWrapper.eq(!StringUtils.isEmpty(rechargeQueryVO.getRechargeSn()), "recharge_sn", rechargeQueryVO.getRechargeSn());
|
queryWrapper.eq(!CharSequenceUtil.isEmpty(rechargeQueryVO.getRechargeSn()), "recharge_sn", rechargeQueryVO.getRechargeSn());
|
||||||
//会员id
|
//会员id
|
||||||
queryWrapper.eq(!StringUtils.isEmpty(rechargeQueryVO.getMemberId()), "member_id", rechargeQueryVO.getMemberId());
|
queryWrapper.eq(!CharSequenceUtil.isEmpty(rechargeQueryVO.getMemberId()), "member_id", rechargeQueryVO.getMemberId());
|
||||||
//支付时间 开始时间和结束时间
|
//支付时间 开始时间和结束时间
|
||||||
if (!StringUtils.isEmpty(rechargeQueryVO.getStartDate()) && !StringUtils.isEmpty(rechargeQueryVO.getEndDate())) {
|
if (!CharSequenceUtil.isEmpty(rechargeQueryVO.getStartDate()) && !CharSequenceUtil.isEmpty(rechargeQueryVO.getEndDate())) {
|
||||||
Date start = cn.hutool.core.date.DateUtil.parse(rechargeQueryVO.getStartDate());
|
Date start = cn.hutool.core.date.DateUtil.parse(rechargeQueryVO.getStartDate());
|
||||||
Date end = cn.hutool.core.date.DateUtil.parse(rechargeQueryVO.getEndDate());
|
Date end = cn.hutool.core.date.DateUtil.parse(rechargeQueryVO.getEndDate());
|
||||||
queryWrapper.between("pay_time", start, end);
|
queryWrapper.between("pay_time", start, end);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cn.lili.modules.wallet.serviceimpl;
|
package cn.lili.modules.wallet.serviceimpl;
|
||||||
|
|
||||||
import cn.lili.common.utils.StringUtils;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.modules.order.trade.entity.vo.DepositQueryVO;
|
import cn.lili.modules.order.trade.entity.vo.DepositQueryVO;
|
||||||
import cn.lili.modules.wallet.entity.dos.WalletLog;
|
import cn.lili.modules.wallet.entity.dos.WalletLog;
|
||||||
@ -28,11 +28,11 @@ public class WalletLogServiceImpl extends ServiceImpl<WalletLogMapper, WalletLog
|
|||||||
//构建查询条件
|
//构建查询条件
|
||||||
QueryWrapper<WalletLog> depositLogQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<WalletLog> depositLogQueryWrapper = new QueryWrapper<>();
|
||||||
//会员名称
|
//会员名称
|
||||||
depositLogQueryWrapper.like(!StringUtils.isEmpty(depositQueryVO.getMemberName()), "member_name", depositQueryVO.getMemberName());
|
depositLogQueryWrapper.like(!CharSequenceUtil.isEmpty(depositQueryVO.getMemberName()), "member_name", depositQueryVO.getMemberName());
|
||||||
//会员id
|
//会员id
|
||||||
depositLogQueryWrapper.eq(!StringUtils.isEmpty(depositQueryVO.getMemberId()), "member_id", depositQueryVO.getMemberId());
|
depositLogQueryWrapper.eq(!CharSequenceUtil.isEmpty(depositQueryVO.getMemberId()), "member_id", depositQueryVO.getMemberId());
|
||||||
//开始时间和技术时间
|
//开始时间和技术时间
|
||||||
if (!StringUtils.isEmpty(depositQueryVO.getStartDate()) && !StringUtils.isEmpty(depositQueryVO.getEndDate())) {
|
if (!CharSequenceUtil.isEmpty(depositQueryVO.getStartDate()) && !CharSequenceUtil.isEmpty(depositQueryVO.getEndDate())) {
|
||||||
Date start = cn.hutool.core.date.DateUtil.parse(depositQueryVO.getStartDate());
|
Date start = cn.hutool.core.date.DateUtil.parse(depositQueryVO.getStartDate());
|
||||||
Date end = cn.hutool.core.date.DateUtil.parse(depositQueryVO.getEndDate());
|
Date end = cn.hutool.core.date.DateUtil.parse(depositQueryVO.getEndDate());
|
||||||
depositLogQueryWrapper.between("create_time", start, end);
|
depositLogQueryWrapper.between("create_time", start, end);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user