!126 适配优化的api地址,补充缺失的事务处理
Merge pull request !126 from OceansDeep/feature/pg
This commit is contained in:
commit
e655fdf67f
2
DB/version4.2.3to4.2.4.sql
Normal file
2
DB/version4.2.3to4.2.4.sql
Normal file
@ -0,0 +1,2 @@
|
||||
/** 新增已退货数量 **/
|
||||
ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 ';
|
@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,分销员接口")
|
||||
@RequestMapping("/buyer/distribution")
|
||||
@RequestMapping("/buyer/distribution/distribution")
|
||||
public class DistributionBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -30,7 +30,7 @@ import javax.validation.constraints.NotNull;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,分销商品接口")
|
||||
@RequestMapping("/buyer/distributionGoods")
|
||||
@RequestMapping("/buyer/distribution/goods")
|
||||
public class DistributionGoodsBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,商品分类接口")
|
||||
@RequestMapping("/buyer/category")
|
||||
@RequestMapping("/buyer/goods/category")
|
||||
public class CategoryBuyerController {
|
||||
/**
|
||||
* 商品分类
|
||||
|
@ -43,7 +43,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@Api(tags = "买家端,商品接口")
|
||||
@RestController
|
||||
@RequestMapping("/buyer/goods")
|
||||
@RequestMapping("/buyer/goods/goods")
|
||||
public class GoodsBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,浏览历史接口")
|
||||
@RequestMapping("/buyer/footprint")
|
||||
@RequestMapping("/buyer/member/footprint")
|
||||
public class FootprintController {
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,7 @@ import java.util.Objects;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员地址接口")
|
||||
@RequestMapping("/buyer/memberAddress")
|
||||
@RequestMapping("/buyer/member/address")
|
||||
public class MemberAddressBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,7 @@ import javax.validation.constraints.NotNull;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员商品评价接口")
|
||||
@RequestMapping("/buyer/memberEvaluation")
|
||||
@RequestMapping("/buyer/member/evaluation")
|
||||
public class MemberEvaluationBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员站内消息接口")
|
||||
@RequestMapping("/buyer/member/message")
|
||||
@RequestMapping("/buyer/message/member")
|
||||
public class MemberMessageBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -36,7 +36,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,售后管理接口")
|
||||
@RequestMapping("/buyer/afterSale")
|
||||
@RequestMapping("/buyer/order/afterSale")
|
||||
public class AfterSaleBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,7 @@ import java.util.Objects;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,订单接口")
|
||||
@RequestMapping("/buyer/orders")
|
||||
@RequestMapping("/buyer/order/order")
|
||||
public class OrderBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@ import java.util.Objects;
|
||||
**/
|
||||
@RestController
|
||||
@Api(tags = "买家端,交易投诉接口")
|
||||
@RequestMapping("/buyer/complain")
|
||||
@RequestMapping("/buyer/order/complain")
|
||||
public class OrderComplaintBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -10,7 +10,6 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,APP版本")
|
||||
@RequestMapping("/buyer/appVersion")
|
||||
@RequestMapping("/buyer/other/appVersion")
|
||||
public class AppVersionBuyerController {
|
||||
|
||||
@Autowired
|
||||
|
@ -29,7 +29,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,文章接口")
|
||||
@RequestMapping("/buyer/article")
|
||||
@RequestMapping("/buyer/other/article")
|
||||
public class ArticleBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,7 @@ import javax.validation.Valid;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,意见反馈接口")
|
||||
@RequestMapping("/buyer/feedback")
|
||||
@RequestMapping("/buyer/other/feedback")
|
||||
public class FeedbackBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,物流公司接口")
|
||||
@RequestMapping("/buyer/logistics")
|
||||
@RequestMapping("/buyer/other/logistics")
|
||||
public class LogisticsBuyerController {
|
||||
|
||||
@Autowired
|
||||
|
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,页面接口")
|
||||
@RequestMapping("/buyer/pageData")
|
||||
@RequestMapping("/buyer/other/pageData")
|
||||
public class PageBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -30,7 +30,7 @@ import javax.validation.constraints.NotNull;
|
||||
*/
|
||||
@Api(tags = "买家端,采购接口")
|
||||
@RestController
|
||||
@RequestMapping("/buyer/purchase")
|
||||
@RequestMapping("/buyer/other/purchase/purchase")
|
||||
public class PurchaseBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ import java.util.List;
|
||||
*/
|
||||
@Api(tags = "买家端,采购报价接口")
|
||||
@RestController
|
||||
@RequestMapping("/buyer/purchaseQuoted")
|
||||
@RequestMapping("/buyer/other/purchase/purchaseQuoted")
|
||||
public class PurchaseQuotedController {
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@ import javax.validation.constraints.NotNull;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员接口")
|
||||
@RequestMapping("/buyer/members")
|
||||
@RequestMapping("/buyer/passport/member")
|
||||
public class MemberBuyerController {
|
||||
|
||||
@Autowired
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,app/小程序 联合登录")
|
||||
@RequestMapping("/buyer/connect/bind")
|
||||
@RequestMapping("/buyer/passport/connect/bind")
|
||||
public class ConnectBuyerBindController {
|
||||
|
||||
@Autowired
|
||||
|
@ -33,7 +33,7 @@ import java.io.IOException;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "买家端,web联合登录")
|
||||
@RequestMapping("/buyer/connect")
|
||||
@RequestMapping("/buyer/passport/connect/connect")
|
||||
public class ConnectBuyerWebController {
|
||||
|
||||
@Autowired
|
||||
|
@ -26,7 +26,7 @@ import java.util.List;
|
||||
* @since 2021/2/19 09:28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/buyer/mini-program")
|
||||
@RequestMapping("/buyer/passport/connect/miniProgram")
|
||||
@Api(tags = "买家端,小程序登录接口")
|
||||
public class MiniProgramBuyerController {
|
||||
|
||||
|
@ -30,7 +30,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "买家端,收银台接口")
|
||||
@RequestMapping("/buyer/cashier")
|
||||
@RequestMapping("/buyer/payment/cashier")
|
||||
public class CashierController {
|
||||
|
||||
@Autowired
|
||||
|
@ -20,7 +20,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
*/
|
||||
@Api(tags = "买家端,退款回调")
|
||||
@RestController
|
||||
@RequestMapping("/buyer/cashier/refund")
|
||||
@RequestMapping("/buyer/payment/cashierRefund")
|
||||
public class CashierRefundController {
|
||||
|
||||
@Autowired
|
||||
|
@ -31,7 +31,7 @@ import java.util.List;
|
||||
* @since 2020/11/17 2:32 下午
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/buyer/store")
|
||||
@RequestMapping("/buyer/store/store")
|
||||
@Api(tags = "买家端,店铺接口")
|
||||
public class StoreBuyerController {
|
||||
|
||||
|
@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员发票接口")
|
||||
@RequestMapping("/buyer/member/receipt")
|
||||
@RequestMapping("/buyer/wallet/receipt")
|
||||
public class MemberReceiptController {
|
||||
|
||||
@Autowired
|
||||
|
@ -35,7 +35,7 @@ import javax.validation.constraints.Pattern;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员余额接口")
|
||||
@RequestMapping("/buyer/members/wallet")
|
||||
@RequestMapping("/buyer/wallet/wallet")
|
||||
public class MemberWalletBuyerController {
|
||||
|
||||
/**
|
||||
|
@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -24,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "买家端,预存款充值记录接口")
|
||||
@RequestMapping("/buyer/member/recharge")
|
||||
@RequestMapping("/buyer/wallet/recharge")
|
||||
public class RechargeBuyerController {
|
||||
|
||||
@Autowired
|
||||
|
@ -128,21 +128,21 @@ ignored:
|
||||
- /MP_verify_qSyvBPhDsPdxvOhC.txt
|
||||
- /weixin/**
|
||||
- /source/**
|
||||
- /buyer/mini-program/**
|
||||
- /buyer/cashier/**
|
||||
- /buyer/pageData/**
|
||||
- /buyer/article/**
|
||||
- /buyer/payment/cashier/**
|
||||
- /buyer/other/pageData/**
|
||||
- /buyer/other/article/**
|
||||
- /buyer/goods/**
|
||||
- /buyer/category/**
|
||||
- /buyer/store/**
|
||||
- /buyer/connect/**
|
||||
- /buyer/passport/connect/**
|
||||
- /buyer/members/**
|
||||
- /buyer/passport/member/**
|
||||
- /buyer/promotion/pintuan/**
|
||||
- /buyer/promotion/seckill/**
|
||||
- /buyer/promotion/pointsGoods/**
|
||||
- /buyer/memberEvaluation/**/goodsEvaluation
|
||||
- /buyer/memberEvaluation/**/evaluationNumber
|
||||
- /buyer/appVersion/**
|
||||
- /buyer/promotion/coupon
|
||||
- /buyer/member/evaluation/**/goodsEvaluation
|
||||
- /buyer/member/evaluation/**/evaluationNumber
|
||||
- /buyer/other/appVersion/**
|
||||
- /buyer/broadcast/studio/**
|
||||
- /druid/**
|
||||
- /swagger-ui.html
|
||||
@ -183,7 +183,7 @@ logging:
|
||||
config: classpath:logback-spring.xml
|
||||
# 输出级别
|
||||
level:
|
||||
root: error
|
||||
root: info
|
||||
# org.springframework: debug
|
||||
file:
|
||||
# 指定路径
|
||||
|
@ -30,8 +30,8 @@ import java.util.List;
|
||||
* @since 2020/11/26 15:41
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "文件管理管理接口")
|
||||
@RequestMapping("/common/file")
|
||||
@Api(tags = "文件管理接口")
|
||||
@RequestMapping("/common/common/file")
|
||||
public class FileController {
|
||||
|
||||
@Autowired
|
||||
|
@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 2021-09-16 15:32
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common/IM")
|
||||
@RequestMapping("/common/common/IM")
|
||||
@Api(tags = "IM 中心")
|
||||
public class IMController {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.lili.controller.common;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.utils.IpHelper;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -20,7 +20,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "获取IP信息以及天气")
|
||||
@RequestMapping("/common/ip")
|
||||
@RequestMapping("/common/common/ip")
|
||||
public class IpInfoManagerController {
|
||||
@Autowired
|
||||
private IpHelper ipHelper;
|
||||
@ -28,6 +28,7 @@ public class IpInfoManagerController {
|
||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "IP及天气相关信息")
|
||||
public ResultMessage<Object> upload(HttpServletRequest request) {
|
||||
|
||||
String result = ipHelper.getIpCity(request);
|
||||
return ResultUtil.data(result);
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @since 2020/11/26 15:41
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "文件管理管理接口")
|
||||
@RequestMapping("/common/logo")
|
||||
@Api(tags = "文件管理接口")
|
||||
@RequestMapping("/common/common/logo")
|
||||
public class LogoController {
|
||||
|
||||
@Autowired
|
||||
|
@ -22,7 +22,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "地址信息接口")
|
||||
@RequestMapping("/common/region")
|
||||
@RequestMapping("/common/common/region")
|
||||
public class RegionController {
|
||||
|
||||
@Autowired
|
||||
|
@ -1,7 +1,6 @@
|
||||
package cn.lili.controller.common;
|
||||
|
||||
import cn.lili.cache.limit.annotation.LimitPoint;
|
||||
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||
@ -20,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/common/slider")
|
||||
@RequestMapping("/common/common/slider")
|
||||
@Api(tags = "滑块验证码接口")
|
||||
public class SliderImageController {
|
||||
|
||||
|
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "短信验证码接口")
|
||||
@RequestMapping("/common/sms")
|
||||
@RequestMapping("/common/common/sms")
|
||||
public class SmsController {
|
||||
|
||||
@Autowired
|
||||
|
@ -5,7 +5,6 @@ import cn.lili.cache.Cache;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.properties.SystemSettingProperties;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.security.enums.UserEnums;
|
||||
@ -40,7 +39,7 @@ import java.util.Objects;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "文件上传接口")
|
||||
@RequestMapping("/common/upload")
|
||||
@RequestMapping("/common/common/upload")
|
||||
public class UploadController {
|
||||
|
||||
@Autowired
|
||||
|
@ -119,24 +119,8 @@ ignored:
|
||||
- /MP_verify_qSyvBPhDsPdxvOhC.txt
|
||||
- /weixin/**
|
||||
- /source/**
|
||||
- /buyer/mini-program/**
|
||||
- /buyer/cashier/**
|
||||
- /buyer/pageData/**
|
||||
- /buyer/article/**
|
||||
- /buyer/goods/**
|
||||
- /buyer/category/**
|
||||
- /buyer/shop/**
|
||||
- /buyer/connect/**
|
||||
- /buyer/members/smsLogin
|
||||
- /buyer/members/refresh/*
|
||||
- /buyer/members/refresh**
|
||||
- /buyer/promotion/pintuan
|
||||
- /buyer/promotion/seckill
|
||||
- /buyer/memberEvaluation/**/goodsEvaluation
|
||||
- /buyer/memberEvaluation/**/evaluationNumber
|
||||
- /store/login/**
|
||||
- /manager/user/login
|
||||
- /manager/user/refresh/**
|
||||
- /common/common/slider/**
|
||||
- /common/common/sms/**
|
||||
- /druid/**
|
||||
- /swagger-ui.html
|
||||
- /doc.html
|
||||
@ -176,7 +160,7 @@ logging:
|
||||
config: classpath:logback-spring.xml
|
||||
# 输出级别
|
||||
level:
|
||||
root: error
|
||||
root: info
|
||||
# org.hibernate: debug
|
||||
# org.springframework: debug
|
||||
file:
|
||||
|
@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -79,6 +80,7 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
||||
private PointsGoodsService pointsGoodsService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void orderChange(OrderMessage orderMessage) {
|
||||
|
||||
switch (orderMessage.getNewStatus()) {
|
||||
|
@ -179,7 +179,7 @@ logging:
|
||||
config: classpath:logback-spring.xml
|
||||
# 输出级别
|
||||
level:
|
||||
root: error
|
||||
root: info
|
||||
# org.hibernate: debug
|
||||
# org.springframework: debug
|
||||
file:
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.lili.modules.connect.serviceimpl;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
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.utils.CookieUtil;
|
||||
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.dto.ConnectAuthUser;
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
@ -55,6 +56,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Service
|
||||
public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> implements ConnectService {
|
||||
|
||||
static final boolean AUTO_REGION = true;
|
||||
|
||||
@Autowired
|
||||
private SettingService settingService;
|
||||
@ -65,10 +67,8 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
|
||||
static boolean AUTO_REGION = true;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Token unionLoginCallback(String type, String unionid, String uuid, boolean longTerm) throws NoPermissionException {
|
||||
|
||||
try {
|
||||
@ -94,6 +94,7 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Token unionLoginCallback(String type, ConnectAuthUser authUser, String uuid) {
|
||||
|
||||
Token token;
|
||||
@ -126,6 +127,7 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void unbind(String type) {
|
||||
|
||||
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
||||
@ -142,13 +144,12 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
queryWrapper.eq(Connect::getUserId, UserContext.getCurrentUser().getId());
|
||||
List<Connect> connects = this.list(queryWrapper);
|
||||
List<String> keys = new ArrayList<>();
|
||||
connects.forEach(item -> {
|
||||
keys.add(item.getUnionType());
|
||||
});
|
||||
connects.forEach(item -> keys.add(item.getUnionType()));
|
||||
return keys;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Token appLoginCallback(ConnectAuthUser authUser, String uuid) {
|
||||
try {
|
||||
return this.unionLoginCallback(authUser.getSource(), authUser.getUuid(), uuid, true);
|
||||
@ -209,6 +210,7 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
* @param unionId 微信unionid
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Token phoneMpBindAndLogin(String sessionKey, WechatMPLoginParams params, String openId, String unionId) {
|
||||
String encryptedData = params.getEncryptedData(), iv = params.getIv();
|
||||
JSONObject userInfo = this.getUserInfo(encryptedData, sessionKey, iv);
|
||||
@ -237,9 +239,9 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
public Connect queryConnect(ConnectQueryDTO connectQueryDTO) {
|
||||
|
||||
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(connectQueryDTO.getUserId()), Connect::getUserId, connectQueryDTO.getUserId())
|
||||
.eq(StringUtils.isNotEmpty(connectQueryDTO.getUnionType()), Connect::getUnionType, connectQueryDTO.getUnionType())
|
||||
.eq(StringUtils.isNotEmpty(connectQueryDTO.getUnionId()), Connect::getUnionId, connectQueryDTO.getUnionId());
|
||||
queryWrapper.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUserId()), Connect::getUserId, connectQueryDTO.getUserId())
|
||||
.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUnionType()), Connect::getUnionType, connectQueryDTO.getUnionType())
|
||||
.eq(CharSequenceUtil.isNotEmpty(connectQueryDTO.getUnionId()), Connect::getUnionId, connectQueryDTO.getUnionId());
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@ -258,7 +260,7 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
|
||||
|
||||
//如果unionid 不为空 则为账号绑定unionid
|
||||
if (StringUtils.isNotEmpty(unionId)) {
|
||||
if (CharSequenceUtil.isNotEmpty(unionId)) {
|
||||
LambdaQueryWrapper<Connect> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
lambdaQueryWrapper.eq(Connect::getUnionId, unionId);
|
||||
lambdaQueryWrapper.eq(Connect::getUnionType, ConnectEnum.WECHAT.name());
|
||||
@ -271,12 +273,12 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
this.save(connect);
|
||||
}
|
||||
}//如果openid 不为空 则为账号绑定openid
|
||||
if (StringUtils.isNotEmpty(openId)) {
|
||||
if (CharSequenceUtil.isNotEmpty(openId)) {
|
||||
LambdaQueryWrapper<Connect> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
lambdaQueryWrapper.eq(Connect::getUnionId, openId);
|
||||
lambdaQueryWrapper.eq(Connect::getUnionType, ConnectEnum.WECHAT_MP_OPEN_ID.name());
|
||||
List<Connect> connects = this.list(lambdaQueryWrapper);
|
||||
if (connects.size() == 0) {
|
||||
if (connects.isEmpty()) {
|
||||
Connect connect = new Connect();
|
||||
connect.setUnionId(openId);
|
||||
connect.setUserId(member.getId());
|
||||
@ -290,7 +292,7 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
||||
/**
|
||||
* 获取微信小程序配置
|
||||
*
|
||||
* @return
|
||||
* @return 微信小程序配置
|
||||
*/
|
||||
private WechatConnectSettingItem getWechatMPSetting() {
|
||||
Setting setting = settingService.get(SettingEnum.WECHAT_CONNECT.name());
|
||||
|
@ -57,6 +57,7 @@ public class DistributionCashServiceImpl extends ServiceImpl<DistributionCashMap
|
||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean cash(Double applyMoney) {
|
||||
|
||||
//检查分销功能开关
|
||||
@ -75,7 +76,7 @@ public class DistributionCashServiceImpl extends ServiceImpl<DistributionCashMap
|
||||
distributionService.updateById(distribution);
|
||||
//提现申请记录
|
||||
DistributionCash distributionCash = new DistributionCash("D" + SnowFlake.getId(), distribution.getId(), applyMoney, distribution.getMemberName());
|
||||
Boolean result = this.save(distributionCash);
|
||||
boolean result = this.save(distributionCash);
|
||||
if (result) {
|
||||
//发送提现消息
|
||||
MemberWithdrawalMessage memberWithdrawalMessage = new MemberWithdrawalMessage();
|
||||
@ -109,6 +110,7 @@ public class DistributionCashServiceImpl extends ServiceImpl<DistributionCashMap
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public DistributionCash audit(String id, String result) {
|
||||
|
||||
//检查分销功能开关
|
||||
@ -120,7 +122,7 @@ public class DistributionCashServiceImpl extends ServiceImpl<DistributionCashMap
|
||||
if (distributorCash != null) {
|
||||
//获取分销员
|
||||
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();
|
||||
//审核通过
|
||||
if (result.equals(WithdrawStatusEnum.VIA_AUDITING.name())) {
|
||||
|
@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
@ -79,6 +79,7 @@ public class DistributionOrderServiceImpl extends ServiceImpl<DistributionOrderM
|
||||
* @param orderSn 订单编号
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void calculationDistribution(String orderSn) {
|
||||
|
||||
//根据订单编号获取订单数据
|
||||
@ -148,6 +149,7 @@ public class DistributionOrderServiceImpl extends ServiceImpl<DistributionOrderM
|
||||
* @param orderSn 订单编号
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelOrder(String orderSn) {
|
||||
//根据订单编号获取订单数据
|
||||
Order order = orderService.getBySn(orderSn);
|
||||
|
@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 分销选择商品接口实现
|
||||
|
@ -7,7 +7,6 @@ import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.modules.distribution.entity.dos.Distribution;
|
||||
import cn.lili.modules.distribution.entity.dto.DistributionApplyDTO;
|
||||
@ -21,6 +20,7 @@ import cn.lili.modules.system.entity.dos.Setting;
|
||||
import cn.lili.modules.system.entity.dto.DistributionSetting;
|
||||
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||
import cn.lili.modules.system.service.SettingService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -69,6 +69,7 @@ public class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Dis
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Distribution applyDistribution(DistributionApplyDTO distributionApplyDTO) {
|
||||
|
||||
//检查分销开关
|
||||
@ -173,7 +174,7 @@ public class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Dis
|
||||
//获取分销是否开启
|
||||
Setting setting = settingService.get(SettingEnum.DISTRIBUTION_SETTING.name());
|
||||
DistributionSetting distributionSetting = JSONUtil.toBean(setting.getSettingValue(), DistributionSetting.class);
|
||||
if (!distributionSetting.getIsOpen()) {
|
||||
if (Boolean.FALSE.equals(distributionSetting.getIsOpen())) {
|
||||
throw new ServiceException(ResultCode.DISTRIBUTION_CLOSE);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
package cn.lili.modules.file.serviceimpl;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.SearchVO;
|
||||
import cn.lili.modules.file.entity.File;
|
||||
@ -12,12 +11,12 @@ import cn.lili.modules.file.entity.dto.FileOwnerDTO;
|
||||
import cn.lili.modules.file.mapper.FileMapper;
|
||||
import cn.lili.modules.file.plugin.FileManagerPlugin;
|
||||
import cn.lili.modules.file.service.FileService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -37,7 +36,7 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, File> implements Fi
|
||||
@Override
|
||||
public void batchDelete(List<String> ids) {
|
||||
|
||||
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper();
|
||||
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(File::getId, ids);
|
||||
|
||||
List<File> files = this.list(queryWrapper);
|
||||
@ -49,7 +48,7 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, File> implements Fi
|
||||
|
||||
@Override
|
||||
public void batchDelete(List<String> ids, AuthUser authUser) {
|
||||
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper();
|
||||
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(File::getId, ids);
|
||||
|
||||
queryWrapper.eq(File::getUserEnums, authUser.getRole().name());
|
||||
@ -76,26 +75,24 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, File> implements Fi
|
||||
@Override
|
||||
public IPage<File> customerPage(File file, SearchVO searchVO, PageVO pageVo) {
|
||||
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(StringUtils.isNotEmpty(file.getName()), File::getName, file.getName())
|
||||
.like(StringUtils.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey())
|
||||
.like(StringUtils.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType())
|
||||
.between(StringUtils.isNotEmpty(searchVO.getStartDate()) && StringUtils.isNotEmpty(searchVO.getEndDate()),
|
||||
queryWrapper.like(CharSequenceUtil.isNotEmpty(file.getName()), File::getName, file.getName())
|
||||
.like(CharSequenceUtil.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey())
|
||||
.like(CharSequenceUtil.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType())
|
||||
.between(CharSequenceUtil.isNotEmpty(searchVO.getStartDate()) && CharSequenceUtil.isNotEmpty(searchVO.getEndDate()),
|
||||
File::getCreateTime, searchVO.getStartDate(), searchVO.getEndDate());
|
||||
IPage<File> page = this.page(PageUtil.initPage(pageVo), queryWrapper);
|
||||
return page;
|
||||
return this.page(PageUtil.initPage(pageVo), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<File> customerPageOwner(FileOwnerDTO ownerDTO, File file, SearchVO searchVO, PageVO pageVo) {
|
||||
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())
|
||||
.like(StringUtils.isNotEmpty(file.getName()), File::getName, file.getName())
|
||||
.like(StringUtils.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey())
|
||||
.like(StringUtils.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType())
|
||||
.between(StringUtils.isNotEmpty(searchVO.getStartDate()) && StringUtils.isNotEmpty(searchVO.getEndDate()),
|
||||
.like(CharSequenceUtil.isNotEmpty(file.getName()), File::getName, file.getName())
|
||||
.like(CharSequenceUtil.isNotEmpty(file.getFileKey()), File::getFileKey, file.getFileKey())
|
||||
.like(CharSequenceUtil.isNotEmpty(file.getFileType()), File::getFileType, file.getFileType())
|
||||
.between(CharSequenceUtil.isNotEmpty(searchVO.getStartDate()) && CharSequenceUtil.isNotEmpty(searchVO.getEndDate()),
|
||||
File::getCreateTime, searchVO.getStartDate(), searchVO.getEndDate());
|
||||
IPage<File> page = this.page(PageUtil.initPage(pageVo), queryWrapper);
|
||||
return page;
|
||||
return this.page(PageUtil.initPage(pageVo), queryWrapper);
|
||||
}
|
||||
}
|
@ -8,7 +8,6 @@ import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -20,7 +20,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -110,7 +109,7 @@ public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements
|
||||
/**
|
||||
* 校验绑定关系
|
||||
*
|
||||
* @param brandIds
|
||||
* @param brandIds 品牌Ids
|
||||
*/
|
||||
private void checkBind(List<String> brandIds) {
|
||||
//分了绑定关系查询
|
||||
@ -130,19 +129,11 @@ public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验绑定关系
|
||||
*
|
||||
* @param brandIds
|
||||
*/
|
||||
private void checkoutGoods(List<String> brandIds) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验是否存在
|
||||
*
|
||||
* @param brandId
|
||||
* @return
|
||||
* @param brandId 品牌ID
|
||||
* @return 品牌
|
||||
*/
|
||||
private Brand checkExist(String brandId) {
|
||||
Brand brand = getById(brandId);
|
||||
|
@ -38,6 +38,7 @@ public class CategoryBrandServiceImpl extends ServiceImpl<CategoryBrandMapper, C
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveCategoryBrandList(String categoryId, List<String> brandIds) {
|
||||
//删除分类品牌绑定信息
|
||||
this.deleteByCategoryId(categoryId);
|
||||
|
@ -3,7 +3,6 @@ package cn.lili.modules.goods.serviceimpl;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
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.Goods;
|
||||
import cn.lili.modules.goods.entity.dos.Parameters;
|
||||
@ -17,7 +16,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
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.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -47,12 +45,6 @@ public class CategoryParameterGroupServiceImpl extends ServiceImpl<CategoryParam
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
|
||||
@Autowired
|
||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||
|
||||
@Autowired
|
||||
private RocketMQTemplate rocketMQTemplate;
|
||||
|
||||
@Override
|
||||
public List<ParameterGroupVO> getCategoryParams(String categoryId) {
|
||||
//根据id查询参数组
|
||||
@ -75,6 +67,7 @@ public class CategoryParameterGroupServiceImpl extends ServiceImpl<CategoryParam
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateCategoryGroup(CategoryParameterGroup categoryParameterGroup) {
|
||||
CategoryParameterGroup origin = this.getById(categoryParameterGroup.getId());
|
||||
if (origin == null) {
|
||||
|
@ -6,10 +6,7 @@ import cn.lili.cache.CachePrefix;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
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.GoodsParamsGroupVO;
|
||||
import cn.lili.modules.goods.entity.vos.GoodsParamsVO;
|
||||
import cn.lili.modules.goods.mapper.CategoryMapper;
|
||||
import cn.lili.modules.goods.service.CategoryBrandService;
|
||||
import cn.lili.modules.goods.service.CategoryParameterGroupService;
|
||||
@ -25,7 +22,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
|
||||
|
||||
@ -199,6 +199,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean saveCategory(Category category) {
|
||||
//判断分类佣金是否正确
|
||||
if (category.getCommissionRate() < 0) {
|
||||
@ -215,6 +216,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateCategory(Category category) {
|
||||
//判断分类佣金是否正确
|
||||
if (category.getCommissionRate() < 0) {
|
||||
@ -240,6 +242,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(String id) {
|
||||
this.removeById(id);
|
||||
removeCache();
|
||||
@ -250,6 +253,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateCategoryStatus(String categoryId, Boolean enableOperations) {
|
||||
//禁用子分类
|
||||
CategoryVO categoryVO = new CategoryVO(this.getById(categoryId));
|
||||
@ -303,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
|
||||
*
|
||||
|
@ -7,7 +7,6 @@ import cn.lili.modules.goods.service.CategorySpecificationService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@ -46,6 +47,7 @@ public class CommodityServiceImpl extends ServiceImpl<CommodityMapper, Commodity
|
||||
private GoodsSkuService goodsSkuService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean addCommodity(List<Commodity> commodityList) {
|
||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||
for (Commodity commodity : commodityList) {
|
||||
@ -54,7 +56,7 @@ public class CommodityServiceImpl extends ServiceImpl<CommodityMapper, Commodity
|
||||
commodity.setStoreId(storeId);
|
||||
//添加直播商品
|
||||
JSONObject json = wechatLivePlayerUtil.addGoods(commodity);
|
||||
if(!"0".equals(json.getStr("errcode"))){
|
||||
if (!"0".equals(json.getStr("errcode"))) {
|
||||
log.error(json.getStr("errmsg"));
|
||||
throw new ServiceException(ResultCode.COMMODITY_ERROR);
|
||||
}
|
||||
@ -93,10 +95,11 @@ public class CommodityServiceImpl extends ServiceImpl<CommodityMapper, Commodity
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void getGoodsWareHouse() {
|
||||
//查询审核中的商品
|
||||
List<String> goodsIdList = this.baseMapper.getAuditCommodity();
|
||||
if (goodsIdList.size() > 0) {
|
||||
if (!goodsIdList.isEmpty()) {
|
||||
//同步状态
|
||||
JSONObject json = wechatLivePlayerUtil.getGoodsWareHouse(goodsIdList);
|
||||
//修改状态
|
||||
|
@ -8,7 +8,6 @@ import cn.lili.modules.goods.entity.dos.Category;
|
||||
import cn.lili.modules.goods.entity.dos.DraftGoods;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsGallery;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import cn.lili.modules.goods.entity.dto.DraftGoodsDTO;
|
||||
import cn.lili.modules.goods.entity.dto.DraftGoodsSearchParams;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsParamsDTO;
|
||||
@ -18,11 +17,11 @@ import cn.lili.modules.goods.service.CategoryService;
|
||||
import cn.lili.modules.goods.service.DraftGoodsService;
|
||||
import cn.lili.modules.goods.service.GoodsGalleryService;
|
||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -36,6 +36,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void add(List<String> goodsGalleryList, String goodsId) {
|
||||
//删除原来商品相册信息
|
||||
this.baseMapper.delete(new UpdateWrapper<GoodsGallery>().eq("goods_id", goodsId));
|
||||
|
@ -121,6 +121,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void underStoreGoods(String storeId) {
|
||||
//获取商品ID列表
|
||||
List<String> list = this.baseMapper.getGoodsIdByStoreId(storeId);
|
||||
@ -135,6 +136,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
* @param params 商品参数
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateGoodsParams(String goodsId, String params) {
|
||||
LambdaUpdateWrapper<Goods> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(Goods::getId, goodsId);
|
||||
@ -151,6 +153,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addGoods(GoodsOperationDTO goodsOperationDTO) {
|
||||
Goods goods = new Goods(goodsOperationDTO);
|
||||
//检查商品
|
||||
@ -174,6 +177,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId) {
|
||||
Goods goods = new Goods(goodsOperationDTO);
|
||||
goods.setId(goodsId);
|
||||
@ -264,6 +268,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean auditGoods(List<String> goodsIds, GoodsAuthEnum goodsAuthEnum) {
|
||||
boolean result = false;
|
||||
for (String goodsId : goodsIds) {
|
||||
@ -282,6 +287,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) {
|
||||
boolean result;
|
||||
|
||||
@ -311,6 +317,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean managerUpdateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) {
|
||||
boolean result;
|
||||
|
||||
@ -342,6 +349,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteGoods(List<String> goodsIds) {
|
||||
|
||||
LambdaUpdateWrapper<Goods> updateWrapper = this.getUpdateWrapperByStoreAuthority();
|
||||
@ -365,6 +373,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean freight(List<String> goodsIds, String templateId) {
|
||||
|
||||
AuthUser authUser = this.checkStoreAuthority();
|
||||
@ -383,7 +392,6 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateStock(String goodsId, Integer quantity) {
|
||||
LambdaUpdateWrapper<Goods> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
||||
lambdaUpdateWrapper.set(Goods::getQuantity, quantity);
|
||||
@ -425,6 +433,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateStoreDetail(Store store) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper<>()
|
||||
.eq("store_id", store.getId())
|
||||
|
@ -7,6 +7,7 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.cache.Cache;
|
||||
import cn.lili.cache.CachePrefix;
|
||||
import cn.lili.common.enums.PromotionTypeEnum;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
@ -113,6 +114,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
private ApplicationEventPublisher applicationEventPublisher;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void add(List<Map<String, Object>> skuList, Goods goods) {
|
||||
// 检查是否需要生成索引
|
||||
List<GoodsSku> newSkuList;
|
||||
@ -186,6 +188,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
* @param goodsSku sku信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(GoodsSku goodsSku) {
|
||||
this.updateById(goodsSku);
|
||||
cache.remove(GoodsSkuService.getCacheKeys(goodsSku.getId()));
|
||||
@ -319,6 +322,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
* @param goods 商品信息(Id,MarketEnable/AuthFlag)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateGoodsSkuStatus(Goods goods) {
|
||||
LambdaUpdateWrapper<GoodsSku> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(GoodsSku::getGoodsId, goods.getId());
|
||||
@ -431,6 +435,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateStocks(List<GoodsSkuStockDTO> goodsSkuStockDTOS) {
|
||||
for (GoodsSkuStockDTO goodsSkuStockDTO : goodsSkuStockDTOS) {
|
||||
this.updateStock(goodsSkuStockDTO.getSkuId(), goodsSkuStockDTO.getQuantity());
|
||||
@ -438,6 +443,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateStock(String skuId, Integer quantity) {
|
||||
GoodsSku goodsSku = getGoodsSkuByIdFromCache(skuId);
|
||||
if (goodsSku != null) {
|
||||
@ -445,7 +451,10 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
goodsIndexService.deleteIndexById(goodsSku.getId());
|
||||
}
|
||||
goodsSku.setQuantity(quantity);
|
||||
this.update(new LambdaUpdateWrapper<GoodsSku>().eq(GoodsSku::getId, skuId).set(GoodsSku::getQuantity, quantity));
|
||||
boolean update = this.update(new LambdaUpdateWrapper<GoodsSku>().eq(GoodsSku::getId, skuId).set(GoodsSku::getQuantity, quantity));
|
||||
if (update) {
|
||||
cache.remove(CachePrefix.GOODS.getPrefix() + goodsSku.getGoodsId());
|
||||
}
|
||||
cache.put(GoodsSkuService.getCacheKeys(skuId), goodsSku);
|
||||
cache.put(GoodsSkuService.getStockCacheKey(skuId), quantity);
|
||||
|
||||
@ -470,6 +479,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateGoodsStuck(List<GoodsSku> goodsSkus) {
|
||||
//商品id集合 hashset 去重复
|
||||
Set<String> goodsIds = new HashSet<>();
|
||||
@ -498,6 +508,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateGoodsSkuCommentNum(String skuId) {
|
||||
//获取商品信息
|
||||
GoodsSku goodsSku = this.getGoodsSkuByIdFromCache(skuId);
|
||||
@ -578,7 +589,6 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
* @param skuList sku列表
|
||||
* @param goods 商品信息
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
List<GoodsSku> addGoodsSku(List<Map<String, Object>> skuList, Goods goods) {
|
||||
List<GoodsSku> skus = new ArrayList<>();
|
||||
for (Map<String, Object> skuVO : skuList) {
|
||||
|
@ -5,7 +5,6 @@ import cn.lili.modules.goods.mapper.GoodsWordsMapper;
|
||||
import cn.lili.modules.goods.service.GoodsWordsService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 商品关键字业务层实现
|
||||
|
@ -19,6 +19,7 @@ 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.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -51,6 +52,7 @@ public class ParametersServiceImpl extends ServiceImpl<ParametersMapper, Paramet
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateParameter(Parameters parameters) {
|
||||
Parameters origin = this.getById(parameters.getId());
|
||||
if (origin == null) {
|
||||
|
@ -3,13 +3,11 @@ package cn.lili.modules.goods.serviceimpl;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
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.Specification;
|
||||
import cn.lili.modules.goods.mapper.SpecificationMapper;
|
||||
import cn.lili.modules.goods.service.CategorySpecificationService;
|
||||
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.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -41,21 +39,20 @@ public class SpecificationServiceImpl extends ServiceImpl<SpecificationMapper, S
|
||||
|
||||
@Override
|
||||
public boolean deleteSpecification(List<String> ids) {
|
||||
boolean result = false;
|
||||
for (String id : ids) {
|
||||
//如果此规格绑定分类则不允许删除
|
||||
List<CategorySpecification> list = categorySpecificationService.list(new QueryWrapper<CategorySpecification>().eq("specification_id", id));
|
||||
if (!list.isEmpty()) {
|
||||
List<String> categoryIds = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
categoryIds.add(item.getCategoryId());
|
||||
});
|
||||
list.forEach(item -> categoryIds.add(item.getCategoryId()));
|
||||
throw new ServiceException(ResultCode.SPEC_DELETE_ERROR,
|
||||
JSONUtil.toJsonStr(categoryService.getCategoryNameByIds(categoryIds)));
|
||||
}
|
||||
//删除规格
|
||||
this.removeById(id);
|
||||
result = this.removeById(id);
|
||||
}
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -83,6 +83,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public StoreGoodsLabel addStoreGoodsLabel(StoreGoodsLabel storeGoodsLabel) {
|
||||
//获取当前登录商家账号
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
@ -98,6 +99,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public StoreGoodsLabel editStoreGoodsLabel(StoreGoodsLabel storeGoodsLabel) {
|
||||
//修改当前店铺的商品分类
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
|
@ -35,6 +35,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
@ -63,6 +64,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
||||
private GoodsService goodsService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean create(Studio studio) {
|
||||
studio.setStoreId(Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId());
|
||||
//创建小程序直播
|
||||
@ -97,6 +99,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean edit(Studio studio) {
|
||||
Studio oldStudio = this.getById(studio.getId());
|
||||
wechatLivePlayerUtil.editRoom(studio);
|
||||
@ -153,6 +156,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean push(Integer roomId, Integer goodsId, String storeId) {
|
||||
|
||||
//判断直播间是否已添加商品
|
||||
@ -183,6 +187,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean goodsDeleteInRoom(Integer roomId, Integer goodsId, String storeId) {
|
||||
Goods goods = goodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getId, goodsId).eq(Goods::getStoreId, storeId));
|
||||
if (goods == null) {
|
||||
|
@ -36,6 +36,7 @@ public class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint
|
||||
private EsGoodsSearchService esGoodsSearchService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public FootPrint saveFootprint(FootPrint footPrint) {
|
||||
LambdaQueryWrapper<FootPrint> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(FootPrint::getMemberId, footPrint.getMemberId());
|
||||
@ -69,8 +70,7 @@ public class FootprintServiceImpl extends ServiceImpl<FootprintMapper, FootPrint
|
||||
LambdaQueryWrapper<FootPrint> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(FootPrint::getMemberId, UserContext.getCurrentUser().getId());
|
||||
lambdaQueryWrapper.in(FootPrint::getGoodsId, ids);
|
||||
this.remove(lambdaQueryWrapper);
|
||||
return true;
|
||||
return this.remove(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,7 +14,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -55,6 +55,7 @@ public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, M
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public MemberAddress saveMemberAddress(MemberAddress memberAddress) {
|
||||
//判断当前地址是否为默认地址,如果为默认需要将其他的地址修改为非默认
|
||||
removeDefaultAddress(memberAddress);
|
||||
@ -65,6 +66,7 @@ public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, M
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public MemberAddress updateMemberAddress(MemberAddress memberAddress) {
|
||||
MemberAddress originalMemberAddress = this.getMemberAddress(memberAddress.getId());
|
||||
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.enums.UserEnums;
|
||||
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.service.GoodsSkuService;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
@ -161,7 +160,7 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
|
||||
UpdateWrapper<MemberEvaluation> updateWrapper = Wrappers.update();
|
||||
updateWrapper.set("reply_status", true);
|
||||
updateWrapper.set("reply", reply);
|
||||
if (StringUtils.isNotEmpty(replyImage)) {
|
||||
if (CharSequenceUtil.isNotEmpty(replyImage)) {
|
||||
updateWrapper.set("have_reply_image", true);
|
||||
updateWrapper.set("reply_image", replyImage);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
package cn.lili.modules.member.serviceimpl;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
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.MemberNotice;
|
||||
import cn.lili.modules.member.entity.dos.MemberNoticeSenter;
|
||||
@ -42,6 +42,7 @@ public class MemberNoticeSenterServiceImpl extends ServiceImpl<MemberNoticeSente
|
||||
private MemberNoticeService memberNoticeService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean customSave(MemberNoticeSenter memberNoticeSenter) {
|
||||
|
||||
if (this.saveOrUpdate(memberNoticeSenter)) {
|
||||
@ -49,7 +50,7 @@ public class MemberNoticeSenterServiceImpl extends ServiceImpl<MemberNoticeSente
|
||||
//如果是选中会员发送
|
||||
if (memberNoticeSenter.getSendType().equals(SendTypeEnum.SELECT.name())) {
|
||||
//判定消息是否有效
|
||||
if (!StringUtils.isEmpty(memberNoticeSenter.getMemberIds())) {
|
||||
if (!CharSequenceUtil.isEmpty(memberNoticeSenter.getMemberIds())) {
|
||||
String[] ids = memberNoticeSenter.getMemberIds().split(",");
|
||||
MemberNotice memberNotice;
|
||||
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)) {
|
||||
return true;
|
||||
|
@ -2,7 +2,6 @@ package cn.lili.modules.member.serviceimpl;
|
||||
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
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)
|
||||
.like(CharSequenceUtil.isNotEmpty(memberName), MemberPointsHistory::getMemberName, memberName);
|
||||
//如果排序为空,则默认创建时间倒序
|
||||
if (StringUtils.isEmpty(page.getSort())) {
|
||||
if (CharSequenceUtil.isEmpty(page.getSort())) {
|
||||
page.setSort("createTime");
|
||||
page.setOrder("desc");
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ package cn.lili.modules.member.serviceimpl;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
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.service.MemberReceiptService;
|
||||
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.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -40,13 +41,14 @@ public class MemberReceiptServiceImpl extends ServiceImpl<MemberReceiptMapper, M
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean addMemberReceipt(MemberReceiptAddVO memberReceiptAddVO, String memberId) {
|
||||
//校验发票抬头是否重复
|
||||
List<MemberReceipt> receipts = this.baseMapper.selectList(new QueryWrapper<MemberReceipt>()
|
||||
.eq("member_id", memberId)
|
||||
.eq("receipt_title", memberReceiptAddVO.getReceiptTitle())
|
||||
);
|
||||
if (receipts.size() > 0) {
|
||||
if (!receipts.isEmpty()) {
|
||||
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));
|
||||
//如果当前会员只有一个发票则默认为默认发票,反之需要校验参数默认值,做一些处理
|
||||
if (list.size() <= 0) {
|
||||
if (list.isEmpty()) {
|
||||
memberReceipt.setIsDefault(1);
|
||||
} else {
|
||||
if (memberReceiptAddVO.getIsDefault().equals(1)) {
|
||||
@ -78,6 +80,7 @@ public class MemberReceiptServiceImpl extends ServiceImpl<MemberReceiptMapper, M
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean editMemberReceipt(MemberReceiptAddVO memberReceiptAddVO, String memberId) {
|
||||
//根据会员id查询发票信息
|
||||
MemberReceipt memberReceiptDb = this.baseMapper.selectById(memberReceiptAddVO.getId());
|
||||
@ -92,7 +95,7 @@ public class MemberReceiptServiceImpl extends ServiceImpl<MemberReceiptMapper, M
|
||||
.eq("receipt_title", memberReceiptAddVO.getReceiptTitle())
|
||||
.ne("id", memberReceiptAddVO.getId())
|
||||
);
|
||||
if (receipts.size() > 0) {
|
||||
if (!receipts.isEmpty()) {
|
||||
throw new ServiceException(ResultCode.USER_RECEIPT_REPEAT_ERROR);
|
||||
}
|
||||
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.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -380,6 +381,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
|
||||
@Override
|
||||
@PointLogPoint
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateMemberPoint(Long point, String type, String memberId, String content) {
|
||||
//获取当前会员信息
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@ -50,6 +51,7 @@ public class StoreCollectionServiceImpl extends ServiceImpl<StoreCollectionMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public StoreCollection addStoreCollection(String storeId) {
|
||||
if (this.getOne(new LambdaUpdateWrapper<StoreCollection>()
|
||||
.eq(StoreCollection::getMemberId, UserContext.getCurrentUser().getId())
|
||||
@ -63,6 +65,7 @@ public class StoreCollectionServiceImpl extends ServiceImpl<StoreCollectionMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean deleteStoreCollection(String storeId) {
|
||||
QueryWrapper<StoreCollection> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("member_id", UserContext.getCurrentUser().getId());
|
||||
|
@ -1,14 +1,14 @@
|
||||
package cn.lili.modules.message.serviceimpl;
|
||||
|
||||
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
||||
import cn.lili.rocketmq.tags.OtherTagsEnum;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.properties.RocketmqCustomProperties;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.modules.message.entity.dos.Message;
|
||||
import cn.lili.modules.message.entity.vos.MessageVO;
|
||||
import cn.lili.modules.message.mapper.MessageMapper;
|
||||
import cn.lili.modules.message.service.MessageService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
||||
import cn.lili.rocketmq.tags.OtherTagsEnum;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
@ -38,6 +38,7 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean sendMessage(Message message) {
|
||||
//保存站内信信息
|
||||
this.save(message);
|
||||
|
@ -1,8 +1,7 @@
|
||||
package cn.lili.modules.message.serviceimpl;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
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.modules.message.entity.dos.MemberMessage;
|
||||
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.service.MemberMessageService;
|
||||
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.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -38,7 +38,7 @@ public class NoticeMessageServiceImpl extends ServiceImpl<NoticeMessageTemplateM
|
||||
//构建查询参数
|
||||
QueryWrapper<NoticeMessage> messageTemplateQueryWrapper = new QueryWrapper<>();
|
||||
//消息模板类型
|
||||
messageTemplateQueryWrapper.eq(!StringUtils.isEmpty(type), "type", type);
|
||||
messageTemplateQueryWrapper.eq(!CharSequenceUtil.isEmpty(type), "type", type);
|
||||
messageTemplateQueryWrapper.orderByDesc("create_time");
|
||||
//查询数据返回
|
||||
return this.page(PageUtil.initPage(pageVO), messageTemplateQueryWrapper);
|
||||
@ -85,10 +85,10 @@ public class NoticeMessageServiceImpl extends ServiceImpl<NoticeMessageTemplateM
|
||||
* @return 替换后站内信内容
|
||||
*/
|
||||
String replaceNoticeContent(String noticeContent, Map<String, String> parameter) {
|
||||
for (String key : parameter.keySet()) {
|
||||
String description = NoticeMessageParameterEnum.getValueByType(key);
|
||||
if (description != null && parameter.get(key) != null) {
|
||||
noticeContent = noticeContent.replace("#{" + description + "}".trim(), parameter.get(key));
|
||||
for (Map.Entry<String, String> entry : parameter.entrySet()) {
|
||||
String description = NoticeMessageParameterEnum.getValueByType(entry.getKey());
|
||||
if (description != null && entry.getValue() != null) {
|
||||
noticeContent = noticeContent.replace("#{" + description + "}".trim(), entry.getValue());
|
||||
}
|
||||
}
|
||||
return noticeContent;
|
||||
|
@ -6,7 +6,6 @@ import cn.lili.modules.message.service.ShortLinkService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
package cn.lili.modules.message.serviceimpl;
|
||||
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
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.modules.message.entity.dos.StoreMessage;
|
||||
import cn.lili.modules.message.entity.vos.StoreMessageQueryVO;
|
||||
import cn.lili.modules.message.mapper.StoreMessageMapper;
|
||||
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.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -42,11 +42,11 @@ public class StoreMessageServiceImpl extends ServiceImpl<StoreMessageMapper, Sto
|
||||
|
||||
QueryWrapper<StoreMessage> queryWrapper = new QueryWrapper<>();
|
||||
//消息id查询
|
||||
if (StringUtils.isNotEmpty(storeMessageQueryVO.getMessageId())) {
|
||||
if (CharSequenceUtil.isNotEmpty(storeMessageQueryVO.getMessageId())) {
|
||||
queryWrapper.eq("message_id", storeMessageQueryVO.getMessageId());
|
||||
}
|
||||
//商家id
|
||||
if (StringUtils.isNotEmpty(storeMessageQueryVO.getStoreId())) {
|
||||
if (CharSequenceUtil.isNotEmpty(storeMessageQueryVO.getStoreId())) {
|
||||
queryWrapper.eq("store_id", storeMessageQueryVO.getStoreId());
|
||||
}
|
||||
//状态查询
|
||||
|
@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -168,6 +168,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
||||
@Override
|
||||
@AfterSaleLogPoint(sn = "#rvt.sn", description = "'售后申请:售后编号['+#rvt.sn+']'")
|
||||
@SystemLogPoint(description = "售后-售后申请", customerLog = "'售后申请:售后编号['+#rvt.sn+']'")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AfterSale saveAfterSale(AfterSaleDTO afterSaleDTO) {
|
||||
|
||||
//检查当前订单是否可申请售后
|
||||
@ -179,6 +180,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
||||
|
||||
@AfterSaleLogPoint(sn = "#afterSaleSn", description = "'审核售后:售后编号['+#afterSaleSn+'],'+ #serviceStatus")
|
||||
@SystemLogPoint(description = "售后-审核售后", customerLog = "'审核售后:售后编号['+#afterSaleSn+'],'+ #serviceStatus")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AfterSale review(String afterSaleSn, String serviceStatus, String remark, Double actualRefundPrice) {
|
||||
//根据售后单号获取售后单
|
||||
@ -205,7 +207,6 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
||||
if (afterSale.getRefundWay().equals(AfterSaleRefundWayEnum.ORIGINAL.name())) {
|
||||
//如果为退款操作 && 在线支付 则直接进行退款
|
||||
refundSupport.refund(afterSale);
|
||||
afterSale.setRefundTime(new Date());
|
||||
afterSaleStatusEnum = AfterSaleStatusEnum.COMPLETE;
|
||||
} else {
|
||||
afterSaleStatusEnum = AfterSaleStatusEnum.WAIT_REFUND;
|
||||
@ -276,6 +277,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
||||
",处理结果['+serviceStatus='PASS'?'商家收货':'商家拒收'+']'")
|
||||
@SystemLogPoint(description = "售后-商家收货", customerLog = "'售后-商家收货:单号['+#afterSaleSn+'],物流单号为['+#logisticsNo+']" +
|
||||
",处理结果['+serviceStatus='PASS'?'商家收货':'商家拒收'+']'")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AfterSale storeConfirm(String afterSaleSn, String serviceStatus, String remark) {
|
||||
//根据售后单号获取售后单
|
||||
AfterSale afterSale = OperationalJudgment.judgment(this.getBySn(afterSaleSn));
|
||||
@ -313,6 +315,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
||||
@Override
|
||||
@AfterSaleLogPoint(sn = "#afterSaleSn", description = "'售后-平台退款:单号['+#afterSaleSn+'],备注为['+#remark+']'")
|
||||
@SystemLogPoint(description = "售后-平台退款", customerLog = "'售后-平台退款:单号['+#afterSaleSn+'],备注为['+#remark+']'")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AfterSale refund(String afterSaleSn, String remark) {
|
||||
//根据售后单号获取售后单
|
||||
AfterSale afterSale = OperationalJudgment.judgment(this.getBySn(afterSaleSn));
|
||||
@ -339,6 +342,7 @@ public class AfterSaleServiceImpl extends ServiceImpl<AfterSaleMapper, AfterSale
|
||||
@Override
|
||||
@AfterSaleLogPoint(sn = "#afterSaleSn", description = "'售后-买家取消:单号['+#afterSaleSn+']'")
|
||||
@SystemLogPoint(description = "售后-取消售后", customerLog = "'售后-买家取消:单号['+#afterSaleSn+']'")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AfterSale cancel(String afterSaleSn) {
|
||||
|
||||
//根据售后单号获取售后单
|
||||
|
@ -11,7 +11,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -50,6 +50,7 @@ import cn.lili.modules.search.service.EsGoodsSearchService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -271,6 +272,7 @@ public class CartServiceImpl implements CartService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(String[] skuIds) {
|
||||
TradeDTO tradeDTO = this.readDTO(CartTypeEnum.CART);
|
||||
List<CartSkuVO> cartSkuVOS = tradeDTO.getSkuList();
|
||||
@ -496,6 +498,7 @@ public class CartServiceImpl implements CartService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void selectCoupon(String couponId, String way, boolean use) {
|
||||
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
||||
//获取购物车,然后重新写入优惠券
|
||||
|
@ -1,10 +1,10 @@
|
||||
package cn.lili.modules.order.order.entity.dos;
|
||||
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||
import cn.lili.modules.order.cart.entity.enums.DeliveryMethodEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
||||
import cn.lili.mybatis.BaseEntity;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.modules.order.cart.entity.enums.DeliveryMethodEnum;
|
||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
@ -32,6 +32,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -118,6 +119,7 @@ public class OrderComplaintServiceImpl extends ServiceImpl<OrderComplaintMapper,
|
||||
* @return 添加结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public OrderComplaint addOrderComplain(OrderComplaintDTO orderComplaintDTO) {
|
||||
|
||||
try {
|
||||
|
@ -13,7 +13,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -19,7 +19,6 @@ import cn.lili.modules.system.aspect.annotation.SystemLogPoint;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
@ -16,7 +16,6 @@ import cn.lili.common.security.OperationalJudgment;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.security.enums.UserEnums;
|
||||
import cn.lili.common.utils.SnowFlake;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsCompleteMessage;
|
||||
import cn.lili.modules.member.entity.dto.MemberAddressDTO;
|
||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||
@ -281,6 +280,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
|
||||
@Override
|
||||
@OrderLogPoint(description = "'订单['+#orderSn+']取消,原因为:'+#reason", orderSn = "#orderSn")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Order cancel(String orderSn, String reason) {
|
||||
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
||||
//如果订单促销类型不为空&&订单是拼团订单,并且订单未成团,则抛出异常
|
||||
@ -307,6 +307,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
|
||||
@Override
|
||||
@OrderLogPoint(description = "'订单['+#orderSn+']系统取消,原因为:'+#reason", orderSn = "#orderSn")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void systemCancel(String orderSn, String reason) {
|
||||
Order order = this.getBySn(orderSn);
|
||||
order.setOrderStatus(OrderStatusEnum.CANCELLED.name());
|
||||
@ -327,6 +328,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void payOrder(String orderSn, String paymentMethod, String receivableNo) {
|
||||
|
||||
Order order = this.getBySn(orderSn);
|
||||
@ -362,6 +364,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
|
||||
@Override
|
||||
@OrderLogPoint(description = "'库存确认'", orderSn = "#orderSn")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void afterOrderConfirm(String orderSn) {
|
||||
Order order = this.getBySn(orderSn);
|
||||
//判断是否为拼团订单,进行特殊处理
|
||||
@ -382,6 +385,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
|
||||
@Override
|
||||
@SystemLogPoint(description = "修改订单", customerLog = "'订单[' + #orderSn + ']收货信息修改,修改为'+#memberAddressDTO.consigneeDetail+'")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Order updateConsignee(String orderSn, MemberAddressDTO memberAddressDTO) {
|
||||
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
||||
|
||||
@ -399,6 +403,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
|
||||
@Override
|
||||
@OrderLogPoint(description = "'订单['+#orderSn+']发货,发货单号['+#logisticsNo+']'", orderSn = "#orderSn")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Order delivery(String orderSn, String logisticsNo, String logisticsId) {
|
||||
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
||||
//如果订单未发货,并且订单状态值等于待发货
|
||||
@ -465,6 +470,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
|
||||
@Override
|
||||
@OrderLogPoint(description = "'订单['+#orderSn+']完成'", orderSn = "#orderSn")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void complete(String orderSn) {
|
||||
//是否可以查询到订单
|
||||
Order order = OperationalJudgment.judgment(this.getBySn(orderSn));
|
||||
@ -473,6 +479,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
|
||||
@Override
|
||||
@OrderLogPoint(description = "'订单['+#orderSn+']完成'", orderSn = "#orderSn")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void systemComplete(String orderSn) {
|
||||
Order order = this.getBySn(orderSn);
|
||||
complete(order, orderSn);
|
||||
@ -530,6 +537,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteOrder(String sn) {
|
||||
Order order = this.getBySn(sn);
|
||||
if (order == null) {
|
||||
@ -563,6 +571,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
* @param parentOrderSn 拼团订单sn
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void agglomeratePintuanOrder(String pintuanId, String parentOrderSn) {
|
||||
//获取拼团配置
|
||||
Pintuan pintuan = pintuanService.getById(pintuanId);
|
||||
@ -610,7 +619,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
@Override
|
||||
public void batchDeliver(MultipartFile files) {
|
||||
|
||||
InputStream inputStream = null;
|
||||
InputStream inputStream;
|
||||
List<OrderBatchDeliverDTO> orderBatchDeliverDTOList = new ArrayList<>();
|
||||
try {
|
||||
inputStream = files.getInputStream();
|
||||
@ -643,7 +652,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
Order order = this.getBySn(orderSn);
|
||||
Trade trade = tradeService.getBySn(order.getTradeSn());
|
||||
//如果交易不为空,则返回交易的金额,否则返回订单金额
|
||||
if (StringUtils.isNotEmpty(trade.getPayStatus())
|
||||
if (CharSequenceUtil.isNotEmpty(trade.getPayStatus())
|
||||
&& trade.getPayStatus().equals(PayStatusEnum.PAID.name())) {
|
||||
return trade.getFlowPrice();
|
||||
}
|
||||
@ -679,7 +688,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
orderBatchDeliverDTO.setLogisticsId(item.getId());
|
||||
}
|
||||
});
|
||||
if (StringUtils.isEmpty(orderBatchDeliverDTO.getLogisticsId())) {
|
||||
if (CharSequenceUtil.isEmpty(orderBatchDeliverDTO.getLogisticsId())) {
|
||||
throw new ServiceException("物流公司:'" + orderBatchDeliverDTO.getLogisticsName() + " '不存在");
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
package cn.lili.modules.order.order.serviceimpl;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.common.utils.CurrencyUtil;
|
||||
import cn.lili.common.utils.SnowFlake;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
||||
import cn.lili.modules.order.order.entity.dos.Order;
|
||||
@ -32,7 +32,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -104,7 +103,7 @@ public class StoreFlowServiceImpl extends ServiceImpl<StoreFlowMapper, StoreFlow
|
||||
storeFlow.setDistributionRebate(item.getPriceDetailDTO().getDistributionCommission());
|
||||
storeFlow.setBillPrice(item.getPriceDetailDTO().getBillPrice());
|
||||
//兼容为空,以及普通订单操作
|
||||
if (StringUtils.isNotEmpty(orderPromotionType)) {
|
||||
if (CharSequenceUtil.isNotEmpty(orderPromotionType)) {
|
||||
if (orderPromotionType.equals(OrderPromotionTypeEnum.NORMAL.name())) {
|
||||
//普通订单操作
|
||||
}
|
||||
@ -221,21 +220,21 @@ public class StoreFlowServiceImpl extends ServiceImpl<StoreFlowMapper, StoreFlow
|
||||
StoreFlow::getDistributionRebate);
|
||||
|
||||
//流水类型判定
|
||||
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(storeFlowQueryDTO.getType()),
|
||||
lambdaQueryWrapper.eq(CharSequenceUtil.isNotEmpty(storeFlowQueryDTO.getType()),
|
||||
StoreFlow::getFlowType, storeFlowQueryDTO.getType());
|
||||
|
||||
//售后编号判定
|
||||
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(storeFlowQueryDTO.getRefundSn()),
|
||||
lambdaQueryWrapper.eq(CharSequenceUtil.isNotEmpty(storeFlowQueryDTO.getRefundSn()),
|
||||
StoreFlow::getRefundSn, storeFlowQueryDTO.getRefundSn());
|
||||
|
||||
//售后编号判定
|
||||
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(storeFlowQueryDTO.getOrderSn()),
|
||||
lambdaQueryWrapper.eq(CharSequenceUtil.isNotEmpty(storeFlowQueryDTO.getOrderSn()),
|
||||
StoreFlow::getOrderSn, storeFlowQueryDTO.getOrderSn());
|
||||
|
||||
//结算单非空,则校对结算单参数
|
||||
if (storeFlowQueryDTO.getBill() != null) {
|
||||
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,
|
||||
StoreFlow::getCreateTime, bill.getStartTime(), bill.getEndTime());
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -51,6 +51,7 @@ public class ArticleCategoryServiceImpl extends ServiceImpl<ArticleCategoryMappe
|
||||
private int maxLevel = 2;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ArticleCategory saveArticleCategory(ArticleCategory articleCategory) {
|
||||
//非顶级分类
|
||||
if (articleCategory.getParentId() != null && !parentId.equals(articleCategory.getParentId())) {
|
||||
|
@ -1,17 +1,17 @@
|
||||
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.exception.ServiceException;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import cn.lili.modules.page.entity.dos.Article;
|
||||
import cn.lili.modules.page.entity.dto.ArticleSearchParams;
|
||||
import cn.lili.modules.page.entity.enums.ArticleEnum;
|
||||
import cn.lili.modules.page.entity.vos.ArticleVO;
|
||||
import cn.lili.modules.page.mapper.ArticleMapper;
|
||||
import cn.lili.modules.page.service.ArticleService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -19,7 +19,6 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -42,7 +41,7 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
|
||||
public IPage<ArticleVO> articlePage(ArticleSearchParams articleSearchParams) {
|
||||
articleSearchParams.setSort("a.sort");
|
||||
QueryWrapper queryWrapper = articleSearchParams.queryWrapper();
|
||||
queryWrapper.eq("open_status",true);
|
||||
queryWrapper.eq("open_status", true);
|
||||
return this.baseMapper.getArticleList(PageUtil.initPage(articleSearchParams), queryWrapper);
|
||||
}
|
||||
|
||||
@ -66,9 +65,9 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
|
||||
@Override
|
||||
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);
|
||||
}else{
|
||||
} else {
|
||||
throw new ServiceException(ResultCode.ARTICLE_NO_DELETION);
|
||||
}
|
||||
}
|
||||
@ -80,15 +79,15 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
|
||||
|
||||
@Override
|
||||
public Article customGetByType(String type) {
|
||||
if(!StrUtil.equals(type, ArticleEnum.OTHER.name())){
|
||||
return this.getOne(new LambdaUpdateWrapper<Article>().eq(Article::getType,type));
|
||||
if (!CharSequenceUtil.equals(type, ArticleEnum.OTHER.name())) {
|
||||
return this.getOne(new LambdaUpdateWrapper<Article>().eq(Article::getType, type));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateArticleStatus(String id, boolean status) {
|
||||
Article article=this.getById(id);
|
||||
Article article = this.getById(id);
|
||||
article.setOpenStatus(status);
|
||||
return this.updateById(article);
|
||||
}
|
||||
|
@ -5,10 +5,7 @@ import cn.lili.modules.page.entity.dos.Feedback;
|
||||
import cn.lili.modules.page.mapper.FeedbackMapper;
|
||||
import cn.lili.modules.page.service.FeedbackService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 意见反馈业务层实现
|
||||
|
@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 楼层装修管理业务层实现
|
||||
@ -36,6 +37,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
||||
private SystemSettingProperties systemSettingProperties;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addStorePageData(String storeId) {
|
||||
//设置店铺的PC页面
|
||||
PageData pageData = new PageData();
|
||||
@ -55,6 +57,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public PageData addPageData(PageData pageData) {
|
||||
//如果页面为发布,则关闭其他页面,开启此页面
|
||||
//演示站点不可以开启楼层
|
||||
@ -72,6 +75,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public PageData updatePageData(PageData pageData) {
|
||||
//如果页面为发布,则关闭其他页面,开启此页面
|
||||
if (pageData.getPageShow() != null && pageData.getPageShow().equals(SwitchEnum.OPEN.name())) {
|
||||
@ -91,6 +95,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public PageData releasePageData(String id) {
|
||||
PageData pageData = this.getById(id);
|
||||
|
||||
@ -120,6 +125,7 @@ public class PageDataServiceImpl extends ServiceImpl<PageDataMapper, PageData> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean removePageData(String 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 org.springframework.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Special addSpecial(Special special) {
|
||||
//新建页面
|
||||
PageData pageData = new PageData();
|
||||
@ -37,6 +39,7 @@ public class SpecialServiceImpl extends ServiceImpl<SpecialMapper, Special> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean removeSpecial(String id) {
|
||||
|
||||
//删除页面内容
|
||||
|
@ -7,18 +7,18 @@ import cn.lili.common.context.ThreadContextHolder;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.properties.ApiProperties;
|
||||
import cn.lili.common.properties.DomainProperties;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.common.utils.SnowFlake;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.common.properties.ApiProperties;
|
||||
import cn.lili.modules.payment.entity.RefundLog;
|
||||
import cn.lili.modules.payment.entity.enums.PaymentMethodEnum;
|
||||
import cn.lili.modules.payment.kit.CashierSupport;
|
||||
import cn.lili.modules.payment.kit.Payment;
|
||||
import cn.lili.modules.payment.kit.dto.PayParam;
|
||||
import cn.lili.modules.payment.kit.dto.PaymentSuccessParams;
|
||||
import cn.lili.modules.payment.entity.enums.PaymentMethodEnum;
|
||||
import cn.lili.modules.payment.kit.params.dto.CashierParam;
|
||||
import cn.lili.modules.payment.service.PaymentService;
|
||||
import cn.lili.modules.payment.service.RefundLogService;
|
||||
|
@ -7,7 +7,6 @@ import cn.lili.modules.payment.service.PaymentService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -6,7 +6,6 @@ import cn.lili.modules.payment.service.RefundLogService;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 退款日志 业务实现
|
||||
|
@ -56,7 +56,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||
/**
|
||||
* 角色长度
|
||||
*/
|
||||
private int rolesMaxSize = 10;
|
||||
private final int rolesMaxSize = 10;
|
||||
|
||||
@Override
|
||||
public IPage<AdminUserVO> adminUserPage(Page initPage, QueryWrapper<AdminUser> initWrapper) {
|
||||
@ -72,7 +72,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||
try {
|
||||
adminUserVO.setDepartmentTitle(
|
||||
departments.stream().filter
|
||||
(department -> department.getId().equals(adminUser.getDepartmentId()))
|
||||
(department -> department.getId().equals(adminUser.getDepartmentId()))
|
||||
.collect(Collectors.toList())
|
||||
.get(0)
|
||||
.getTitle()
|
||||
@ -81,12 +81,12 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||
log.error("填充部门信息异常", e);
|
||||
}
|
||||
}
|
||||
if (!StringUtils.isEmpty(adminUser.getRoleIds())) {
|
||||
if (!CharSequenceUtil.isEmpty(adminUser.getRoleIds())) {
|
||||
try {
|
||||
List<String> memberRoles = Arrays.asList(adminUser.getRoleIds().split(","));
|
||||
adminUserVO.setRoles(
|
||||
roles.stream().filter
|
||||
(role -> memberRoles.contains(role.getId()))
|
||||
(role -> memberRoles.contains(role.getId()))
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
} catch (Exception e) {
|
||||
@ -156,14 +156,15 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||
|
||||
@Override
|
||||
@SystemLogPoint(description = "修改管理员", customerLog = "'修改管理员:'+#adminUser.username")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateAdminUser(AdminUser adminUser, List<String> roles) {
|
||||
|
||||
if (roles != null && roles.size() > 0) {
|
||||
if (roles != null && !roles.isEmpty()) {
|
||||
|
||||
if (roles.size() > rolesMaxSize) {
|
||||
throw new ServiceException(ResultCode.PERMISSION_BEYOND_TEN);
|
||||
}
|
||||
adminUser.setRoleIds(StringUtils.join(",", roles));
|
||||
adminUser.setRoleIds(CharSequenceUtil.join(",", roles));
|
||||
|
||||
} else {
|
||||
adminUser.setRoleIds("");
|
||||
@ -194,13 +195,14 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||
List<AdminUser> adminUsers = this.list(lambdaQueryWrapper);
|
||||
String password = StringUtils.md5("123456");
|
||||
String newEncryptPass = new BCryptPasswordEncoder().encode(password);
|
||||
if (null != adminUsers && adminUsers.size() > 0) {
|
||||
if (null != adminUsers && !adminUsers.isEmpty()) {
|
||||
adminUsers.forEach(item -> item.setPassword(newEncryptPass));
|
||||
this.updateBatchById(adminUsers);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveAdminUser(AdminUserDTO adminUser, List<String> roles) {
|
||||
AdminUser dbUser = new AdminUser();
|
||||
BeanUtil.copyProperties(adminUser, dbUser);
|
||||
@ -240,7 +242,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||
queryWrapper.eq("user_id", userId);
|
||||
userRoleService.remove(queryWrapper);
|
||||
|
||||
if (roles.isEmpty() || roles == null) {
|
||||
if (roles.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<UserRole> userRoles = new ArrayList<>(roles.size());
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user