Merge branch 'master' into Bulbasaur
This commit is contained in:
commit
a15d5d7c36
@ -1,6 +1,5 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@ -75,21 +74,16 @@ public class GoodsBuyerController {
|
||||
@ApiOperation(value = "通过id获取商品信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "path"),
|
||||
@ApiImplicitParam(name = "skuId", value = "skuId", required = true, paramType = "path"),
|
||||
@ApiImplicitParam(name = "distributionId", value = "分销员ID", dataType = "String", paramType = "query")
|
||||
@ApiImplicitParam(name = "skuId", value = "skuId", required = true, paramType = "path")
|
||||
})
|
||||
@GetMapping(value = "/sku/{goodsId}/{skuId}")
|
||||
@PageViewPoint(type = PageViewEnum.SKU, id = "#id")
|
||||
public ResultMessage<Map<String, Object>> getSku(@NotNull(message = "商品ID不能为空") @PathVariable("goodsId") String goodsId,
|
||||
@NotNull(message = "SKU ID不能为空") @PathVariable("skuId") String skuId,
|
||||
String distributionId) {
|
||||
@NotNull(message = "SKU ID不能为空") @PathVariable("skuId") String skuId) {
|
||||
|
||||
Map<String, Object> map = goodsSkuService.getGoodsSkuDetail(goodsId, skuId);
|
||||
|
||||
//判断如果传递分销员则进行记录
|
||||
if (CharSequenceUtil.isNotEmpty(distributionId)) {
|
||||
distributionService.bindingDistribution(distributionId);
|
||||
}
|
||||
|
||||
|
||||
return ResultUtil.data(map);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.lili.controller.other.distribution;
|
||||
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.distribution.entity.dos.Distribution;
|
||||
import cn.lili.modules.distribution.entity.dos.DistributionOrder;
|
||||
@ -65,4 +65,13 @@ public class DistributionBuyerController {
|
||||
|
||||
return ResultUtil.data(distributionService.getDistribution());
|
||||
}
|
||||
|
||||
//申请分销员
|
||||
@ApiOperation(value = "绑定分销员")
|
||||
@ApiImplicitParam(name = "distributionId", value = "分销员ID", required = true, paramType = "path")
|
||||
@GetMapping("/bindingDistribution/{distributionId}")
|
||||
public ResultMessage<Object> bindingDistribution(@PathVariable String distributionId){
|
||||
distributionService.bindingDistribution(distributionId);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package cn.lili.controller.other.distribution;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.distribution.entity.dos.DistributionCash;
|
||||
@ -48,9 +50,11 @@ public class DistributionCashBuyerController {
|
||||
@ApiImplicitParam(name = "price", value = "申请金额", required = true, paramType = "query", dataType = "double")
|
||||
})
|
||||
@PostMapping
|
||||
public ResultMessage<Boolean> cash(@NotNull @ApiIgnore Double price) {
|
||||
Boolean result = distributionCashService.cash(price);
|
||||
return ResultUtil.data(result);
|
||||
public ResultMessage<Object> cash(@NotNull @ApiIgnore Double price) {
|
||||
if(distributionCashService.cash(price)){
|
||||
return ResultUtil.success();
|
||||
}
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分销员提现历史")
|
||||
|
@ -1,6 +1,8 @@
|
||||
package cn.lili.controller.other.distribution;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.distribution.entity.dto.DistributionGoodsSearchParams;
|
||||
import cn.lili.modules.distribution.entity.vos.DistributionGoodsVO;
|
||||
@ -50,9 +52,11 @@ public class DistributionGoodsBuyerController {
|
||||
@ApiOperation(value = "选择分销商品")
|
||||
@ApiImplicitParam(name = "distributionGoodsId", value = "分销ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping(value = "/checked/{distributionGoodsId}")
|
||||
public ResultMessage<IPage<DistributionGoodsVO>> distributionCheckGoods(
|
||||
public ResultMessage<Object> distributionCheckGoods(
|
||||
@NotNull(message = "分销商品不能为空") @PathVariable("distributionGoodsId") String distributionGoodsId) {
|
||||
distributionSelectedGoodsService.add(distributionGoodsId);
|
||||
return ResultUtil.success();
|
||||
if(distributionSelectedGoodsService.add(distributionGoodsId)){
|
||||
return ResultUtil.success();
|
||||
}
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import org.springframework.util.CollectionUtils;
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.Calendar;
|
||||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
@ -40,6 +39,9 @@ public abstract class AbstractDelayQueueMachineFactory {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 延时队列机器开始运作
|
||||
*/
|
||||
private void startDelayQueueMachine() {
|
||||
log.info(String.format("延时队列机器{%s}开始运作", setDelayQueueName()));
|
||||
|
||||
@ -64,11 +66,11 @@ public abstract class AbstractDelayQueueMachineFactory {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// log.warn(String.format("处理延时任务发生异常,异常原因为{%s}", e.getMessage()), e);
|
||||
log.error(String.format("处理延时任务发生异常,异常原因为{%s}", e.getMessage()), e);
|
||||
} finally {
|
||||
// 间隔一秒钟搞一次
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(1L);
|
||||
TimeUnit.SECONDS.sleep(5L);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -1,166 +0,0 @@
|
||||
package cn.lili.common.enums;
|
||||
|
||||
/**
|
||||
* @author Chopper
|
||||
* @version v4.1
|
||||
* @Description: 错误码 5位
|
||||
* 第一位 1:商品;2:会员;3:订单,4:店铺,5:页面,6:其他
|
||||
* @since 2020/11/17 4:44 下午
|
||||
*/
|
||||
public enum MessageCode {
|
||||
|
||||
E401("认证过期"),
|
||||
|
||||
E10001("商品ID不存在"),
|
||||
E10002("商品名称不正确,名称应为2-50字符"),
|
||||
E10003("此规格已绑定分类不允许删除"),
|
||||
E10004("该分类名称已存在"),
|
||||
E10005("父分类不存在"),
|
||||
E10006("最多为三级分类,添加失败"),
|
||||
E10007("此类别下存在子类别不能删除"),
|
||||
E10008("此类别下存在商品不能删除"),
|
||||
E10009("通过categoryId获取分类失败"),
|
||||
E10010("不能重复添加分销商品"),
|
||||
E10011("无法将此商品放入回收站"),
|
||||
E10012("无法彻底删除从此商品"),
|
||||
E10013("无法下架此商品"),
|
||||
E10014("无法还原此商品"),
|
||||
|
||||
|
||||
E20001("用户名密码不能为空"),
|
||||
E20002("该用户名已被注册"),
|
||||
E20003("该手机号已被注册"),
|
||||
E20004("用户不存在"),
|
||||
E20005("修改资料成功"),
|
||||
E20006("修改资料失败"),
|
||||
E20007("手机号不存在"),
|
||||
E20008("重置密码成功"),
|
||||
E20009("修改手机号成功"),
|
||||
E20010("旧密码不正确"),
|
||||
E20011("修改密码成功"),
|
||||
E20012("用户未登录"),
|
||||
E20013("发布评价成功"),
|
||||
E20014("领取优惠券成功"),
|
||||
E20015("分销商不存在"),
|
||||
E20016("分销商已申请,无需重复提交"),
|
||||
E20017("密码错误"),
|
||||
E20018("分销商清退失败"),
|
||||
E20019("审核分销商失败"),
|
||||
E20020("用户名或密码错误"),
|
||||
E20021("订单状态不允许申请售后,请联系平台或商家"),
|
||||
E20022("无权操作此数据!"),
|
||||
E20023("此用户已禁用!"),
|
||||
E20024("未对当前用户做手机号码校验!"),
|
||||
E20025("可提现金额不足!"),
|
||||
E20026("零钱提现失败!"),
|
||||
E20027("请填写审核备注!"),
|
||||
E20028("请勿重复签到"),
|
||||
E20029("分销商不存在或已被清退"),
|
||||
E20030("分销商提现记录不存在"),
|
||||
E20031("分销商提现状态不正确,无法提现"),
|
||||
E20032("余额账户不存在,无法操作"),
|
||||
E20033("验证码错误,请重新输入"),
|
||||
E20034("最多可以设置10个角色"),
|
||||
E20035("订单已支付,请勿反复支付"),
|
||||
E20036("该订单已部分支付,请前往订单中心进行支付"),
|
||||
E20037("余额充值已支付成功,请勿重复支付"),
|
||||
E20038("余额不足以支付订单,请充值"),
|
||||
E20039("支付业务异常,请稍后重试"),
|
||||
E20040("当前订单不需要付款,请返回订单列表重新操作"),
|
||||
E20041("非当前用户的手机号"),
|
||||
E20101("联合第三方登录,未绑定会员"),
|
||||
E20102("联合第三方登录,授权信息错误"),
|
||||
E20103("会员发票信息重复"),
|
||||
E20104("会员发票信息不存在"),
|
||||
E20105("权限不足"),
|
||||
|
||||
E30001("购物车添加成功"),
|
||||
E30002("购物车数量更新成功"),
|
||||
E30003("购物车选中更新成功"),
|
||||
E30004("清空购物车成功"),
|
||||
E30005("删除购物车中的一个或多个产品成功"),
|
||||
E30006("读取结算页的购物车异常"),
|
||||
E30007("创建订单异常,请稍后重试"),
|
||||
E30008("订单状态错误,无法进行确认收货"),
|
||||
E30009("订单确定收货成功"),
|
||||
E30010("订单不存在"),
|
||||
E30011("已支付的订单不能修改金额"),
|
||||
E30013("物流错误"),
|
||||
E30014("当前订单不能发货"),
|
||||
E30015("非当前会员的订单"),
|
||||
E30016("无法重复提交评价"),
|
||||
E30017("付款金额和应付金额不一致"),
|
||||
E30018("售后已审核,无法重复操作"),
|
||||
E30019("物流公司错误,请重新选择"),
|
||||
E30020("请选择要投诉的商品"),
|
||||
E30021("当前订单无法核销"),
|
||||
E30022("当前售后单无法取消"),
|
||||
E30023("当前订单未支付,不能申请售后"),
|
||||
E30024("订单已支付,不能再次进行支付"),
|
||||
E30025("收银台信息获取错误"),
|
||||
E30026("积分不足,不能兑换"),
|
||||
E30027("优惠券已使用/已过期,不能使用"),
|
||||
E30028("投诉异常,请稍后重试"),
|
||||
|
||||
E40001("非当前店铺数据,无法操作"),
|
||||
E40002("此店铺不存在"),
|
||||
E40003("店铺名称已存在!"),
|
||||
E40004("参数有误!"),
|
||||
E40005("已有店铺,无需重复申请"),
|
||||
E40006("只有已出账结算单可以核对"),
|
||||
E40007("只有已核对结算单可以审核"),
|
||||
E40008("只有已审核结算单可以支付"),
|
||||
E40009("只有商家可以操作结算单核对"),
|
||||
E40010("只有管理可以操作结算单核对"),
|
||||
E40011("存在不属于此店铺的商品"),
|
||||
|
||||
E50001("该分类名称已存在"),
|
||||
E50002("父分类不存在"),
|
||||
E50003("最多为三级分类,添加失败"),
|
||||
E50004("最多为三级分类,修改失败"),
|
||||
E50005("文章分类名称重复,修改失败"),
|
||||
E50006("该文章分类下存在子分类,不能删除"),
|
||||
E50007("专题自动发布,无需操作发布"),
|
||||
E50008("当前页面为开启状态,无法删除"),
|
||||
E50009("当前页面为唯一页面,无法删除"),
|
||||
E50010("页面已发布,无需重复提交"),
|
||||
E50011("需传入查询ID"),
|
||||
E50012("当前消息模板不存在"),
|
||||
E50013("短信签名已存在"),
|
||||
E50014("该文章分类下存在文章,不能删除"),
|
||||
|
||||
E60000("请先登录再访问此接口"),
|
||||
E60001("操作失败"),
|
||||
E60002("非法请求"),
|
||||
E60003("请求正在处理,请稍后再试"),
|
||||
E60004("验证码为空或已过期,请重新获取"),
|
||||
E60005("验证失败"),
|
||||
E60007("OSS未配置"),
|
||||
E60008("支付暂不支持"),
|
||||
E60009("错误的客户端"),
|
||||
|
||||
E60010("角色已绑定部门,请逐个删除"),
|
||||
E60011("角色已绑定管理员,请逐个删除"),
|
||||
E60012("菜单已绑定角色,请先删除或编辑角色"),
|
||||
E60013("部门已经绑定管理员,请先删除或编辑管理员"),
|
||||
|
||||
S21001("分销商清退成功"),
|
||||
S21002("审核分销商成功"),
|
||||
|
||||
S44000("操作成功"),
|
||||
S50001("删除文章分类成功");
|
||||
|
||||
private final String value;
|
||||
|
||||
MessageCode(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return Integer.parseInt(this.name().replace("E", "").replace("S", ""));
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -4,6 +4,8 @@ package cn.lili.common.enums;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
|
||||
/**
|
||||
* 返回结果工具类
|
||||
*
|
||||
* @author lili
|
||||
*/
|
||||
public class ResultUtil<T> {
|
||||
@ -74,17 +76,21 @@ public class ResultUtil<T> {
|
||||
public static <T> ResultMessage<T> success() {
|
||||
return new ResultUtil<T>().setSuccessMsg(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回失败
|
||||
*
|
||||
* @param resultCode 返回状态码
|
||||
*/
|
||||
public static <T> ResultMessage<T> error(ResultCode resultCode) {
|
||||
return new ResultUtil<T>().setErrorMsg(resultCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回失败
|
||||
*
|
||||
* @param code 状态码
|
||||
* @param msg 返回消息
|
||||
* @param msg 返回消息
|
||||
*/
|
||||
public static <T> ResultMessage<T> error(Integer code, String msg) {
|
||||
return new ResultUtil<T>().setErrorMsg(code, msg);
|
||||
@ -104,8 +110,9 @@ public class ResultUtil<T> {
|
||||
|
||||
/**
|
||||
* 服务器异常 追加状态码
|
||||
*
|
||||
* @param code 状态码
|
||||
* @param msg 返回消息
|
||||
* @param msg 返回消息
|
||||
*/
|
||||
public ResultMessage<T> setErrorMsg(Integer code, String msg) {
|
||||
this.resultMessage.setSuccess(false);
|
||||
|
@ -1,129 +0,0 @@
|
||||
package cn.lili.common.enums;
|
||||
|
||||
/**
|
||||
* 日志枚举
|
||||
*
|
||||
* @author Chopper
|
||||
*/
|
||||
public enum StoreLogType {
|
||||
|
||||
/**
|
||||
* 默认0操作
|
||||
*/
|
||||
OPERATION,
|
||||
|
||||
/**
|
||||
* 1登录
|
||||
*/
|
||||
LOGIN,
|
||||
|
||||
/**
|
||||
* 商品
|
||||
*/
|
||||
|
||||
//商品上架
|
||||
|
||||
//商品下架
|
||||
|
||||
//发布商品
|
||||
|
||||
//修改商品
|
||||
|
||||
//删除商品
|
||||
|
||||
//添加商品模板
|
||||
|
||||
//编辑商品库存
|
||||
|
||||
//增加店铺商品分类
|
||||
|
||||
//编辑店铺商品分类
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
|
||||
//发货
|
||||
|
||||
//修改收件信息
|
||||
|
||||
/**
|
||||
* 售后
|
||||
*/
|
||||
|
||||
//审核退货单
|
||||
|
||||
//确定收货
|
||||
|
||||
//拒绝收货
|
||||
|
||||
//退款
|
||||
|
||||
//拒绝退款
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 营销
|
||||
*/
|
||||
|
||||
//添加分销商品
|
||||
|
||||
//下架分销商品
|
||||
|
||||
//编辑分销商品
|
||||
|
||||
//创建满减活动
|
||||
|
||||
//编辑满减活动
|
||||
|
||||
//下架满减活动
|
||||
|
||||
//上架满减活动
|
||||
|
||||
//删除满减活动
|
||||
|
||||
//添加优惠券
|
||||
|
||||
//编辑优惠券
|
||||
|
||||
//关闭优惠券
|
||||
|
||||
//参与秒杀活动
|
||||
|
||||
//编辑秒杀活动
|
||||
|
||||
//下架秒杀活动
|
||||
|
||||
//上架秒杀活动
|
||||
|
||||
//删除秒杀活动
|
||||
|
||||
|
||||
/**
|
||||
* 设置
|
||||
*/
|
||||
|
||||
//选择物流公司
|
||||
|
||||
//取消物流公司
|
||||
|
||||
//添加运费模板
|
||||
|
||||
//编辑运费模板
|
||||
|
||||
//删除运费模板
|
||||
|
||||
//设置店铺信息
|
||||
|
||||
//修改店铺退货地址
|
||||
|
||||
//新增自提点
|
||||
|
||||
//编辑自提点
|
||||
|
||||
//删除自提点
|
||||
|
||||
//发布店铺首页
|
||||
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package cn.lili.common.security.context;
|
||||
|
||||
import cn.lili.common.cache.Cache;
|
||||
import cn.lili.common.enums.MessageCode;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
|
@ -52,13 +52,15 @@ public class RocketmqTimerTrigger implements TimeTrigger {
|
||||
if (StringUtils.isEmpty(uniqueKey)) {
|
||||
uniqueKey = StringUtils.getRandStr(10);
|
||||
}
|
||||
//执行任务key
|
||||
String generateKey = TimeTriggerUtil.generateKey(timeTriggerMsg.getTriggerExecutor(), timeTriggerMsg.getTriggerTime(), uniqueKey);
|
||||
this.cache.put(generateKey, 1);
|
||||
//设置延时任务
|
||||
if (Boolean.TRUE.equals(promotionDelayQueue.addJobId(JSONUtil.toJsonStr(timeTriggerMsg), delayTime))) {
|
||||
log.info("add Redis key {} --------------------------", generateKey);
|
||||
log.info("add Redis key {}", generateKey);
|
||||
log.info("定时执行在【" + DateUtil.toString(timeTriggerMsg.getTriggerTime(), "yyyy-MM-dd HH:mm:ss") + "】,消费【" + timeTriggerMsg.getParam().toString() + "】");
|
||||
} else {
|
||||
log.info("延时任务添加失败!");
|
||||
log.error("延时任务添加失败:{}", timeTriggerMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package cn.lili.common.utils;
|
||||
|
||||
import cn.lili.common.enums.MessageCode;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
|
@ -146,6 +146,11 @@ public class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Dis
|
||||
|
||||
@Override
|
||||
public void bindingDistribution(String distributionId) {
|
||||
|
||||
//判断用户是否登录,未登录不能进行绑定
|
||||
if(UserContext.getCurrentUser()==null){
|
||||
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
|
||||
}
|
||||
//储存分销关系为3天
|
||||
Distribution distribution = this.getById(distributionId);
|
||||
if (distribution!=null) {
|
||||
|
@ -234,10 +234,15 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
public Integer goodsNum(GoodsStatusEnum goodsStatusEnum, GoodsAuthEnum goodsAuthEnum) {
|
||||
LambdaQueryWrapper<Goods> queryWrapper = Wrappers.lambdaQuery();
|
||||
|
||||
queryWrapper.eq(Goods::getDeleteFlag,false)
|
||||
.eq(goodsStatusEnum != null,Goods::getMarketEnable, goodsStatusEnum.name())
|
||||
.eq(goodsAuthEnum != null,Goods::getIsAuth, goodsAuthEnum.name())
|
||||
.eq(StringUtils.equals(UserContext.getCurrentUser().getRole().name(), UserEnums.STORE.name()),
|
||||
queryWrapper.eq(Goods::getDeleteFlag,false);
|
||||
|
||||
if (goodsStatusEnum != null) {
|
||||
queryWrapper.eq(Goods::getMarketEnable, goodsStatusEnum.name());
|
||||
}
|
||||
if (goodsAuthEnum != null) {
|
||||
queryWrapper.eq(Goods::getIsAuth, goodsAuthEnum.name());
|
||||
}
|
||||
queryWrapper.eq(StringUtils.equals(UserContext.getCurrentUser().getRole().name(), UserEnums.STORE.name()),
|
||||
Goods::getStoreId, UserContext.getCurrentUser().getStoreId());
|
||||
|
||||
return this.count(queryWrapper);
|
||||
|
@ -89,7 +89,7 @@ public class CartVO extends CartBase implements Serializable {
|
||||
this.remark = "";
|
||||
}
|
||||
|
||||
public void add(Integer goodsNum) {
|
||||
public void addGoodsNum(Integer goodsNum) {
|
||||
if (this.goodsNum == null) {
|
||||
this.goodsNum = goodsNum;
|
||||
} else {
|
||||
|
@ -8,7 +8,6 @@ import cn.lili.modules.order.cart.entity.vo.CartSkuVO;
|
||||
import cn.lili.modules.order.cart.entity.vo.CartVO;
|
||||
import cn.lili.modules.order.cart.render.CartRenderStep;
|
||||
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -53,7 +52,7 @@ public class CartPriceRender implements CartRenderStep {
|
||||
if (Boolean.FALSE.equals(sku.getChecked())) {
|
||||
continue;
|
||||
}
|
||||
cart.setGoodsNum(sku.getNum());
|
||||
cart.addGoodsNum(sku.getNum());
|
||||
if (cart.getStoreId().equals(sku.getStoreId()) && !cart.getSkuList().contains(sku)) {
|
||||
cart.getSkuList().add(sku);
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package cn.lili.modules.page.entity.dos;
|
||||
|
||||
import cn.lili.base.BaseEntity;
|
||||
import cn.lili.common.enums.SwitchEnum;
|
||||
import cn.lili.modules.page.entity.enums.ArticleEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@ -45,11 +44,8 @@ public class Article extends BaseEntity {
|
||||
@NotEmpty(message = "文章内容不能为空")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* @see SwitchEnum
|
||||
*/
|
||||
@ApiModelProperty(value = "状态", allowableValues = "OPEN,CLOSE")
|
||||
private String openStatus;
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Boolean openStatus;
|
||||
/**
|
||||
* @see ArticleEnum
|
||||
*/
|
||||
|
@ -25,5 +25,5 @@ public class ArticleVO {
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "状态, allowableValues = OPEN,CLOSE")
|
||||
private String openStatus;
|
||||
private Boolean openStatus;
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package cn.lili.modules.page.serviceimpl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.SwitchEnum;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
@ -83,7 +82,7 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
|
||||
@Override
|
||||
public Boolean updateArticleStatus(String id, boolean status) {
|
||||
Article article=this.getById(id);
|
||||
article.setOpenStatus(status? SwitchEnum.OPEN.name():SwitchEnum.CLOSE.name());
|
||||
article.setOpenStatus(status);
|
||||
return this.updateById(article);
|
||||
}
|
||||
}
|
@ -2,7 +2,6 @@ package cn.lili.modules.payment.kit.plugin.alipay;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.common.enums.MessageCode;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.SpringContextUtil;
|
||||
|
@ -139,7 +139,7 @@ public class IndexStatisticsServiceImpl implements IndexStatisticsService {
|
||||
//获取总会员数量
|
||||
indexStatisticsVO.setMemberNum(memberStatisticsDataService.getMemberCount());
|
||||
//获取总上架商品数量
|
||||
indexStatisticsVO.setGoodsNum(goodsService.goodsNum(GoodsStatusEnum.UPPER, null));
|
||||
indexStatisticsVO.setGoodsNum(goodsService.goodsNum(GoodsStatusEnum.UPPER, GoodsAuthEnum.PASS));
|
||||
//获取总店铺数量
|
||||
indexStatisticsVO.setStoreNum(storeService.storeNum());
|
||||
|
||||
|
@ -59,7 +59,6 @@ public class AppVersionDO{
|
||||
@ApiModelProperty(value = "版本名称")
|
||||
private String versionName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "更新内容")
|
||||
private String content;
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package cn.lili.controller.setting;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
@ -45,8 +47,11 @@ public class AppVersionManagerController {
|
||||
|
||||
@ApiOperation(value = "添加app版本信息", response = AppVersionDO.class)
|
||||
@PostMapping
|
||||
public ResultMessage<Boolean> add(@Valid AppVersionDO appVersionDO) {
|
||||
return ResultUtil.data(this.appVersionService.save(appVersionDO));
|
||||
public ResultMessage<Object> add(@Valid AppVersionDO appVersionDO) {
|
||||
if(this.appVersionService.save(appVersionDO)){
|
||||
return ResultUtil.success();
|
||||
}
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@PutMapping(value = "/{id}")
|
||||
@ -55,10 +60,10 @@ public class AppVersionManagerController {
|
||||
@ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "String", paramType = "path")
|
||||
})
|
||||
public ResultMessage<Boolean> edit(@Valid AppVersionDO appVersionDO, @PathVariable String id) {
|
||||
if (appVersionService.getById(id) != null) {
|
||||
return ResultUtil.data(this.appVersionService.updateById(appVersionDO));
|
||||
if(this.appVersionService.updateById(appVersionDO)){
|
||||
return ResultUtil.success();
|
||||
}
|
||||
return ResultUtil.data(false);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/{id}")
|
||||
@ -67,10 +72,10 @@ public class AppVersionManagerController {
|
||||
@ApiImplicitParam(name = "id", value = "要删除的app版本主键", required = true, dataType = "String", paramType = "path")
|
||||
})
|
||||
public ResultMessage<Boolean> delete(@PathVariable String id) {
|
||||
if (appVersionService.getById(id) != null) {
|
||||
return ResultUtil.data(this.appVersionService.removeById(id));
|
||||
if(this.appVersionService.removeById(id)){
|
||||
return ResultUtil.success();
|
||||
}
|
||||
return ResultUtil.data(true);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -66,4 +66,20 @@ public class AfterSaleManagerController {
|
||||
return ResultUtil.data(afterSaleService.refund(afterSaleSn, remark));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "审核售后申请")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "afterSaleSn", value = "售后sn", required = true, paramType = "path"),
|
||||
@ApiImplicitParam(name = "serviceStatus", value = "PASS:审核通过,REFUSE:审核未通过", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "remark", value = "备注", paramType = "query"),
|
||||
@ApiImplicitParam(name = "actualRefundPrice", value = "实际退款金额", paramType = "query")
|
||||
})
|
||||
@PutMapping(value = "/review/{afterSaleSn}")
|
||||
public ResultMessage<AfterSale> review(@NotNull(message = "请选择售后单") @PathVariable String afterSaleSn,
|
||||
@NotNull(message = "请审核") String serviceStatus,
|
||||
String remark,
|
||||
Double actualRefundPrice) {
|
||||
|
||||
return ResultUtil.data(afterSaleService.review(afterSaleSn, serviceStatus, remark,actualRefundPrice));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user