Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop into feature/pg
This commit is contained in:
commit
c729726dd6
@ -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;
|
||||
|
||||
/**
|
||||
@ -42,6 +41,9 @@ public abstract class AbstractDelayQueueMachineFactory {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 延时队列机器开始运作
|
||||
*/
|
||||
private void startDelayQueueMachine() {
|
||||
log.info(String.format("延时队列机器{%s}开始运作", setDelayQueueName()));
|
||||
|
||||
@ -66,11 +68,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();
|
||||
}
|
||||
|
@ -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.error("延时任务添加失败!");
|
||||
log.error("延时任务添加失败:{}", timeTriggerMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -55,9 +55,6 @@ import java.util.List;
|
||||
@Transactional
|
||||
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {
|
||||
|
||||
//商品
|
||||
@Autowired
|
||||
private GoodsMapper goodsMapper;
|
||||
//商品属性
|
||||
@Autowired
|
||||
private GoodsParamsService goodsParamsService;
|
||||
@ -85,7 +82,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
|
||||
@Override
|
||||
public void underStoreGoods(String storeId) {
|
||||
this.goodsMapper.underStoreGoods(storeId);
|
||||
this.baseMapper.underStoreGoods(storeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -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