记得上下班打卡 | git大法好,push需谨慎

Commit 8cc9af0c authored by zhengfuxin's avatar zhengfuxin

创建项目

parent 6bf2b7ea
......@@ -73,6 +73,12 @@ liquidnet:
host: 39.107.71.112
port: 6379
password: 3Xa%8p
smile:
dbs: 0,16
database: 15
host: 39.107.71.112
port: 6379
password: 3Xa%8p
# goblin:
# dbs: 0,256
# database: 255
......@@ -108,6 +114,8 @@ liquidnet:
url: http://devcandy.zhengzai.tv/candy
goblin:
url: http://devgoblin.zhengzai.tv
smile:
url: http://devsmile.zhengzai.tv
stone:
url: http://devstone.zhengzai.tv/stone
dragon:
......
......@@ -31,39 +31,11 @@
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-goblin-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-smile-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-adam-api</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-candy-api</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-sms</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>
</dependencies>
<build>
......
package com.liquidnet.service.goblin.config;
import com.liquidnet.common.web.config.WebMvcConfig;
import com.liquidnet.common.web.filter.GlobalAuthorityInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
@Configuration
public class GoblinWebMvcConfig extends WebMvcConfig {
@Autowired
public GlobalAuthorityInterceptor globalAuthorityInterceptor;
@Override
protected void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(this.globalAuthorityInterceptor).addPathPatterns("/**");
super.addInterceptors(registry);
}
}
package com.liquidnet.service.goblin.controller;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.IGoblinAppZhengzaiService;
import com.liquidnet.service.goblin.service.IGoblinOrderAppService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
@Slf4j
@Api(tags = "正在下单相关")
@RestController
@RequestMapping("/zhengzai/app")
public class GoblinAppZhengzaiController {
@Autowired
IGoblinAppZhengzaiService goblinAppZhengzaiService;
// @Autowired
// IGoblinOrderService goblinOrderService;
@Autowired
IGoblinOrderAppService goblinOrderAppService;
@GetMapping("market/list")
@ApiOperation("正在下单-活动列表")
public ResponseDto<List<GoblinSelfMarketingVo>> getZhengzaiMarketList() {
return ResponseDto.success(goblinAppZhengzaiService.getZhengzaiMarketList());
}
@GetMapping("store/list")
@ApiOperation("正在下单-参与活动的店铺")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
})
public ResponseDto<List<GoblinShowStoreInfoVo>> getStoreList(@RequestParam("marketId") @Valid String marketId) {
return ResponseDto.success(goblinAppZhengzaiService.getStoreList(marketId));
}
@GetMapping("spu/list")
@ApiOperation("正在下单-参与活动的spu")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
})
public ResponseDto<List<GoblinZhengzaiGoodVo>> getStoreList(@RequestParam("marketId") @Valid String marketId,
@RequestParam("storeId") @Valid String storeId) {
return ResponseDto.success(goblinAppZhengzaiService.getSpuList(marketId, storeId));
}
@PostMapping("listByCode")
@ApiOperation("列表[根据masterCode]")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderMasterCode", value = "主订单号"),
})
public ResponseDto<List<GoblinAppOrderListVo>> orderListByMaster(@RequestParam("orderMasterCode") @Valid String orderMasterCode) {
return goblinOrderAppService.orderListByMaster(orderMasterCode);
}
@PostMapping("details")
@ApiOperation("详情")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderId", value = "订单id", example = "1"),
})
public ResponseDto<GoblinAppOrderDetailsVo> orderDetails(@RequestParam("orderId") @Valid String orderId) {
String uid = CurrentUtil.getCurrentUid();
return goblinOrderAppService.orderDetails(orderId, uid);
}
@PostMapping("orderPush")
@ApiOperation("正在下单-出货")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "offCode", value = "取货码", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
})
public ResponseDto<Boolean> orderPush(@RequestParam("offCode") @Valid String offCode,
@RequestParam("marketId") @Valid String marketId) {
return goblinAppZhengzaiService.orderPush(offCode, "ZZ" +marketId);
}
@PostMapping("orderPushDetails")
@ApiOperation("正在下单-出货详情")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "offCode", value = "取货码", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
})
public ResponseDto<List<GoblinZhengzaiPushVo>> orderPushDetails(@RequestParam("offCode") @Valid String offCode,
@RequestParam("marketId") @Valid String marketId) {
return goblinAppZhengzaiService.orderPushDetails(offCode, "ZZ" + marketId);
}
@PostMapping("orderBind")
@ApiOperation("正在下单-绑定订单号")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "masterCode", value = "masterCode", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "uid", value = "uid", example = "1"),
})
public ResponseDto<Boolean> orderBind(@RequestParam("masterCode") @Valid String masterCode,
@RequestParam("uid") @Valid String uid) {
return goblinAppZhengzaiService.orderBind(uid, masterCode);
}
@PostMapping("mailData")
@ApiOperation("快递详情")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderId", value = "orderId", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mailId", value = "mailId", example = "1"),
})
public ResponseDto<List<GoblinMailVo>> getMail(@RequestParam("orderId") @Valid String orderId,
@RequestParam("mailId") @Valid String mailId) {
return goblinOrderAppService.getMail(orderId, mailId);
}
}
package com.liquidnet.service.goblin.controller;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.entity.GoblinFrontHotWord;
import com.liquidnet.service.goblin.service.GoblinFrontService;
import com.liquidnet.service.goblin.service.impl.GoblinFrontServiceImpl;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhangfuxin
* @Description:前端接口
* @date 2021/12/27 下午6:25
*/
@Api(tags = "前端接口管理")
@RestController
@RequestMapping("/front")
public class GoblinFrontController {
@Autowired
private RedisUtil redisUtil;
@Autowired
private GoblinRedisUtils goblinRedisUtils;
@Autowired
private GoblinFrontServiceImpl goblinFrontService;
@GetMapping("getTopBanner")
@ApiOperation("获取顶部banner")
public ResponseDto<ArrayList<GoblinFrontBannerVo>> getBanner() {
return ResponseDto.success(goblinFrontService.getListBanner());
}
@GetMapping("getMiddleBanner")
@ApiOperation("获取中部banner")
public ResponseDto<ArrayList<GoblinFrontBannerVo>> getMiddleBanner() {
return ResponseDto.success(goblinFrontService.getMiddleBanner());
}
@GetMapping("getHotWord")
@ApiOperation("获得热词")
public ResponseDto<GoblinFrontHotWord> getHotWord() {
return ResponseDto.success(goblinFrontService.getHotWord());
}
@GetMapping("getNavigation")
@ApiOperation("获得金刚栏")
public ResponseDto<GoblinFrontNavigationVoo> getNavigation() {
return ResponseDto.success(goblinFrontService.getNavigation());
}
@GetMapping("getSeckilll")
@ApiOperation("获得秒杀首页要用的")
public ResponseDto<GoblinFrontSeckillVo> getSeckilll() throws ParseException {
return ResponseDto.success(goblinFrontService.getSeckilll());
}
@GetMapping("getSelectGoods")
@ApiOperation("获得精选商品列表(pageNumber从0开始)")
public ResponseDto<GoblinFrontSelectGoodVo> getSelectGoods(@RequestParam(name = "pageSize", required = true) int pageSize, @RequestParam(name = "pageNumber", required = true) int pageNumber) throws ParseException {
return ResponseDto.success(goblinFrontService.getSelectGoods(pageNumber, pageSize));
}
@GetMapping("getGoodsDetail")
@ApiOperation("获得商品详情")
public ResponseDto<GoblinFrontGoodDetailVo> getGoodsDetail(@RequestParam(name = "spuId", required = true) String spuId) throws ParseException {
return ResponseDto.success(goblinFrontService.getGoodsDetail(spuId));
}
@GetMapping("getMoudleIndex")
@ApiOperation("获取组件排序")
public ResponseDto getMoudleIndex() throws ParseException {
return ResponseDto.success(goblinFrontService.getMoudleIndex());
}
@GetMapping("getCube")
@ApiOperation("获取魔方")
public ResponseDto<GoblinFrontCubeVo> getCube() throws ParseException {
return ResponseDto.success(goblinFrontService.getCube());
}
@GetMapping("getRecommend")
@ApiOperation("获取新品推荐")
public ResponseDto<GoblinFrontCubeVo> getRecommend() throws ParseException {
return ResponseDto.success(goblinFrontService.getRecommend());
}
@GetMapping("getCategoryList")
@ApiOperation("获取分类列表商品( 1、销量优先、2、新品优先、3、价格降序、4、价格升序)")
public ResponseDto<GoblinFrontCategoryListVo> getCategoryList(@RequestParam(name = "type", required = true) String type, @RequestParam(name = "categoryId", required = true) String categoryId, @RequestParam(name = "page", required = true) int page, @RequestParam(name = "pageSize", required = true) int pageSize) throws ParseException {
return ResponseDto.success(goblinFrontService.getCategoryList(type, categoryId, page, pageSize));
}
@GetMapping("getMusicList")
@ApiOperation("获取音乐标签列表( 1、销量优先、2、新品优先、3、价格降序、4、价格升序)")
public ResponseDto<GoblinFrontCategoryListVo> getMusicList(@RequestParam(name = "type", required = true) String type, @RequestParam(name = "musicId", required = true) String musicId, @RequestParam(name = "page", required = true) int page, @RequestParam(name = "pageSize", required = true) int pageSize) throws ParseException {
return ResponseDto.success(goblinFrontService.getMusic(musicId, type, page, pageSize));
}
@GetMapping("getCategory")
@ApiOperation("获取分类子集")
public ResponseDto<GoblinCategoryzfVo> getCategory(@RequestParam(name = "categoryId", required = true) String categoryId) throws ParseException {
return ResponseDto.success(goblinFrontService.getCategory(categoryId));
}
@GetMapping("getStore")
@ApiOperation("获得店铺详情")
public ResponseDto<GoblinStoreInfoVo> getStore(@RequestParam(name = "storeId", required = true) String storeId) throws ParseException {
return ResponseDto.success(goblinFrontService.getStore(storeId));
}
@GetMapping("getStoreCategory")
@ApiOperation("获得店铺分类")
public ResponseDto<List<GoblinStoreGoodsCategoryVo>> getStoreCategory(@RequestParam(name = "storeId", required = true) String storeId) throws ParseException {
return ResponseDto.success(goblinFrontService.getStoreCategory(storeId));
}
@GetMapping("getStoreGoodes")
@ApiOperation("获得店铺商品")
public ResponseDto<GoblinFrontCategoryListVo> getStoreGoodes(@RequestParam(name = "storeId", required = true) String storeId, @RequestParam(name = "categoryId", required = false) String categoryId, @RequestParam(name = "name", required = false) String name) throws ParseException {
return ResponseDto.success(goblinFrontService.getStoreGoodes(storeId, categoryId, name));
}
@GetMapping("searchGoodesName")
@ApiOperation("搜索商品名字、或商铺名字")
public ResponseDto<List<GoblinGoodsInfoListVo>> searchGoodesName(@RequestParam(name = "name", required = true) String name) throws ParseException {
if (StringUtil.isNotBlank(name)) {
return ResponseDto.success(goblinFrontService.searchGoodesName(name));
}
return ResponseDto.success(null);
}
@GetMapping("tagPerformance")
@ApiOperation("标签,演出id获取演出列表")
public ResponseDto<List<GoblinGoodsInfoVo>> getGoodByMusicTagP(@RequestParam(name = "musicTag", required = true) String musicTag,
@RequestParam(name = "performanceId", required = true) String performanceId) {
return ResponseDto.success(goblinFrontService.getGoodByMusicTagP(musicTag, performanceId));
}
}
package com.liquidnet.service.goblin.controller;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.GoblinShoppingCartVoo;
import com.liquidnet.service.goblin.service.impl.GoblinFrontServiceImpl;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author zhangfuxin
* @Description:前端接口
* @date 2021/12/27 下午6:25
*/
@Api(tags = "前端需要登陆接口管理")
@RestController
@RequestMapping("/frontLogin")
public class GoblinFrontLoginController {
@Autowired
private RedisUtil redisUtil;
@Autowired
private GoblinRedisUtils goblinRedisUtils;
@Autowired
private GoblinFrontServiceImpl goblinFrontService;
@GetMapping("addShopCart")
@ApiOperation("加入购物车")
public ResponseDto addShopCart(@RequestParam(name = "spuId", required = true) String spuId, @RequestParam(name = "storeId", required = true) String storeId, @RequestParam(name = "skuId", required = true) String skuId, @RequestParam(name = "number", required = false) Integer number, @RequestParam(name = "type", required = true) String type) {
String userId = CurrentUtil.getCurrentUid();
String pre = GoblinStatusConst.MarketPreStatus.getPre(type);
if (pre != null) {
type = type.split(pre)[0];
}
return goblinFrontService.addShoopCart(spuId, storeId, skuId, number, userId, type);
}
@GetMapping("updateShopCart")
@ApiOperation("修改购物车")
public ResponseDto updateShopCart(@RequestParam(name = "spuId", required = true) String spuId, @RequestParam(name = "storeId", required = true) String storeId, @RequestParam(name = "skuId", required = true) String skuId, @RequestParam(name = "number", required = false) Integer number, @RequestParam(name = "type", required = true) String type) {
String userId = CurrentUtil.getCurrentUid();
String pre = GoblinStatusConst.MarketPreStatus.getPre(type);
if (pre != null) {
type = type.split(pre)[0];
}
return ResponseDto.success(goblinFrontService.updateShopCart(spuId, storeId, skuId, number, userId, type));
}
@GetMapping("getShopCartCount")
@ApiOperation("获取购物车数量")
public ResponseDto getShopCartCount(@RequestParam(name = "type", required = true) String type) {
String userId = CurrentUtil.getCurrentUid();
String pre = GoblinStatusConst.MarketPreStatus.getPre(type);
if (pre != null) {
type = type.split(pre)[0];
}
return ResponseDto.success(goblinFrontService.getShopCartCount(userId, type));
}
@PostMapping("deleteShopCart")
@ApiOperation("删除购物车")
public ResponseDto deleteShopCart(@RequestParam(name = "skuIds", required = false) String skuIds, @RequestParam(name = "type", required = true) String type) {
String userId = CurrentUtil.getCurrentUid();
String pre = GoblinStatusConst.MarketPreStatus.getPre(type);
if (pre != null) {
type = type.split(pre)[0];
}
return ResponseDto.success(goblinFrontService.delteShoppingCart(skuIds.split(","), userId, type));
}
@PostMapping("saveData")
@ApiOperation("保存数据购物车过度")
public ResponseDto saveData(@RequestParam(name = "data", required = false) String data, @RequestParam(name = "type", required = true) String type) {
String userId = CurrentUtil.getCurrentUid();
String pre = GoblinStatusConst.MarketPreStatus.getPre(type);
if (pre != null) {
type = type.split(pre)[0];
}
return ResponseDto.success(goblinFrontService.saveDate(data, userId, type));
}
@PostMapping("getData")
@ApiOperation("获得购物车过度")
public ResponseDto getData(@RequestParam(name = "type", required = true) String type) {
String userId = CurrentUtil.getCurrentUid();
String pre = GoblinStatusConst.MarketPreStatus.getPre(type);
if (pre != null) {
type = type.split(pre)[0];
}
return goblinFrontService.getDate(userId, type);
}
@GetMapping("getShopCart")
@ApiOperation("获得购物车列表")
public ResponseDto<GoblinShoppingCartVoo> getShopCart(@RequestParam(name = "type", required = true) String type) {
String userId = CurrentUtil.getCurrentUid();
String pre = GoblinStatusConst.MarketPreStatus.getPre(type);
if (pre != null) {
type = type.split(pre)[0];
}
return ResponseDto.success(goblinFrontService.getShoppCart(userId, type));
}
@GetMapping("deleteShopCartTest")
@ApiOperation("请勿调用,测试用")
public ResponseDto<GoblinShoppingCartVoo> deleteShopCart(@RequestParam(name = "type", required = true) String type) {
String userId = CurrentUtil.getCurrentUid();
String pre = GoblinStatusConst.MarketPreStatus.getPre(type);
if (pre != null) {
type = type.split(pre)[0];
}
redisUtil.del(GoblinRedisConst.FRONT_SHOPCART.concat(userId).concat(type));
return ResponseDto.success(null);
}
}
package com.liquidnet.service.goblin.controller;
import com.github.pagehelper.PageInfo;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.codec.vo.EncryptedReq;
import com.liquidnet.service.goblin.dto.manage.GoblinOrderParam;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.param.GoblinAppOrderRefundParam;
import com.liquidnet.service.goblin.param.PayAgainParam;
import com.liquidnet.service.goblin.param.SyncOrderParam;
import com.liquidnet.service.goblin.service.IGoblinOrderAppService;
import com.liquidnet.service.goblin.service.IGoblinOrderService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.List;
@Slf4j
@Api(tags = "订单相关-App")
@RestController
@RequestMapping("/order")
public class GoblinOrderAppController {
@Autowired
IGoblinOrderAppService goblinOrderAppService;
@PostMapping("list")
@ApiOperation("列表")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数", example = "1"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "pre", value = "活动前缀[ZZ-正在下单|不传为普通订单]", example = "ZZ"),
})
public ResponseDto<PageInfo<GoblinAppOrderListVo>> orderList(@RequestParam("page") @Valid int page,
@RequestParam(value = "pre", required = false) String pre) {
return goblinOrderAppService.orderList(page, pre);
}
@PostMapping("listByCode")
@ApiOperation("列表[根据masterCode]")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderMasterCode", value = "主订单号"),
})
public ResponseDto<List<GoblinAppOrderListVo>> orderListByMaster(@RequestParam("orderMasterCode") @Valid String orderMasterCode) {
return goblinOrderAppService.orderListByMaster(orderMasterCode);
}
@PostMapping("details")
@ApiOperation("详情")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderId", value = "订单id", example = "1"),
})
public ResponseDto<GoblinAppOrderDetailsVo> orderDetails(@RequestParam("orderId") @Valid String orderId) {
String uid = CurrentUtil.getCurrentUid();
return goblinOrderAppService.orderDetails(orderId, uid);
}
@PostMapping("getProduce")
@ApiOperation("已收货")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderId", value = "订单id", example = "1"),
})
public ResponseDto<Boolean> getProduce(@RequestParam("orderId") @Valid String orderId) {
String uid = CurrentUtil.getCurrentUid();
return goblinOrderAppService.getProduce(orderId, uid);
}
@PostMapping("applyRefund")
@ApiOperation("退款申请")
public ResponseDto<Boolean> applyRefund(@RequestBody GoblinAppOrderRefundParam param) {
return goblinOrderAppService.applyRefund(param);
}
@PostMapping("againRefund")
@ApiOperation("再次退款申请")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderBackId", value = "退款订单id", example = "1"),
})
public ResponseDto<Boolean> againRefund(@RequestBody GoblinAppOrderRefundParam param) {
return goblinOrderAppService.againRefund(param);
}
@PostMapping("refundDetails")
@ApiOperation("退款详情")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderId", value = "订单id", example = "1"),
})
public ResponseDto<List<GoblinBackOrderVo>> refundDetails(@RequestParam("orderId") @Valid String orderId) {
return goblinOrderAppService.refundDetails(orderId);
}
@PostMapping("mailData")
@ApiOperation("快递详情")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderId", value = "orderId", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mailId", value = "mailId", example = "1"),
})
public ResponseDto<List<GoblinMailVo>> getMail(@RequestParam("orderId") @Valid String orderId,
@RequestParam("mailId") @Valid String mailId) {
return goblinOrderAppService.getMail(orderId, mailId);
}
}
package com.liquidnet.service.goblin.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.common.exception.constant.ErrorCode;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.GoblinCouponService;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import com.liquidnet.service.goblin.util.ObjectUtil;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
import java.util.List;
@ApiSupport(order = 145001)
@Api(tags = "商城:POS机相关")
@Slf4j
@RestController
@RequestMapping("store/pos")
public class GoblinPosController {
@Autowired
GoblinRedisUtils goblinRedisUtils;
@Autowired
GoblinCouponService goblinCouponService;
@PostMapping("coupon/receive")
@ApiOperation("领券")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeCouponId", value = "平台券id"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "uid", value = "UID"),
})
public ResponseDto<GoblinUserCouponVo> checkOrderResult(@NotBlank(message = "参数无效:storeCouponId") @RequestParam("storeCouponId") String storeCouponId,
@NotBlank(message = "参数无效:uid") @RequestParam("uid") String uid) {
String currentUid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVoByUid(currentUid);
GoblinStoreCouponVo storeCouponVo = goblinRedisUtils.getStoreCouponVo(storeCouponId);
if (null == storeCouponVo) {
log.warn("商城:POS机相关:领取券:优惠券不存在:[uid={},storeCouponId={}]", uid, storeCouponId);
return ResponseDto.failure(ErrorMapping.get("140050"));
} else if (null == storeInfoVo) {
log.warn("商城:POS机相关:领取券:未创建店铺不可领取优惠券:[uid={},storeCouponId={}]", uid, storeCouponId);
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "店铺不存在");
} else if (!storeCouponVo.getStoreId().equals(storeInfoVo.getStoreId())) {
log.warn("商城:POS机相关:领取券:非本店铺优惠券不可领取:[uid={},storeId={},storeCouponId={}]", uid, storeInfoVo.getStoreId(), storeCouponId);
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "非本店铺优惠券不可领取");
} else if (!storeCouponVo.getState().equals("1")) {
return ResponseDto.failure(ErrorMapping.get("140051"));
}
// TODO: 2022/2/24 zhanggb==暂不进行UID真实校验
List<GoblinUserCouponVo> userCouponVos = goblinRedisUtils.getUserCouponVos(uid);
if (!CollectionUtils.isEmpty(userCouponVos)) {
int beforeSize = userCouponVos.size();
userCouponVos.removeIf(vo -> vo.getStoreCouponId().equals(storeCouponId));
if ((beforeSize - userCouponVos.size()) >= storeCouponVo.getReceiveLimit()) {
return ResponseDto.failure(ErrorMapping.get("140052"));
}
}
if (storeCouponVo.getStock().equals(0) || goblinRedisUtils.getStoreCouponStock(storeCouponId) > 0) {
Boolean resultFlg = goblinCouponService.receiveCoupon(uid, userCouponVos, storeCouponVo);
return resultFlg ? ResponseDto.success(userCouponVos.stream().filter(r -> r.getStoreCouponId().equals(storeCouponId)).findFirst().get()) : ResponseDto.failure();
}
return ResponseDto.failure(ErrorMapping.get("140053"));
}
@ApiOperationSupport(order = 1)
@ApiOperation(value = "商品信息")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "skuids", value = "多个skuId以,分隔"),
})
@PostMapping("goods/skuinfo")
public ResponseDto<List<GoblinPosGoodsVo>> skuInfoList(@NotBlank(message = "参数无效:skuIds") @RequestBody String skuids) {
log.info("商城:POS机相关:SKU列表[skuIds={}]", skuids);
String currentUid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVoByUid(currentUid);
if (null == storeInfoVo) {
log.warn("商城:POS机相关:SKU明细:店铺不存在[uid={},skuIds={}]", currentUid, skuids);
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "店铺不存在");
}
String storeId = storeInfoVo.getStoreId();
String[] skuIdArr = skuids.split(",");
List<GoblinPosGoodsVo> posGoodsVoList = ObjectUtil.getGoblinPosGoodsVoArrayList();
for (String skuId : skuIdArr) {
GoblinGoodsSkuInfoVo goodsSkuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(skuId);
if (null != goodsSkuInfoVo && goodsSkuInfoVo.getDelFlg().equals("0") && storeId.equals(goodsSkuInfoVo.getStoreId())) {
String spuId = goodsSkuInfoVo.getSpuId();
GoblinGoodsInfoVo goodsInfoVo = goblinRedisUtils.getGoodsInfoVo(spuId);
if (null != goodsInfoVo && goodsInfoVo.getDelFlg().equals("0")) {
GoblinPosGoodsVo posGoodsVo = GoblinPosGoodsVo.getNew();
posGoodsVo.setSkuId(skuId);
posGoodsVo.setName(goodsSkuInfoVo.getName());
posGoodsVo.setPrice(goodsSkuInfoVo.getPrice());
posGoodsVo.setSpuId(spuId);
posGoodsVo.setSpuName(goodsInfoVo.getName());
posGoodsVoList.add(posGoodsVo);
}
}
}
return ResponseDto.success(posGoodsVoList);
}
}
package com.liquidnet.service.goblin.controller;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinOrderParam;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.IGoblinOrderAppService;
import com.liquidnet.service.goblin.service.IGoblinStoreZhengzaiService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.List;
@Slf4j
@Api(tags = "正在下单相关-商铺")
@RestController
@RequestMapping("/zhengzai/store")
public class GoblinStoreZhengzaiController {
@Autowired
IGoblinStoreZhengzaiService goblinStoreZhengzaiService;
// @Autowired
// IGoblinOrderService goblinOrderService;
@Autowired
IGoblinOrderAppService goblinOrderAppService;
@GetMapping("market/list")
@ApiOperation("正在下单-活动列表")
public ResponseDto<List<GoblinSelfMarketingVo>> getZhengzaiMarketList() {
return goblinStoreZhengzaiService.getZhengzaiMarketList();
}
@GetMapping("spu/list")
@ApiOperation("正在下单-参与活动的spu")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
})
public ResponseDto<List<GoblinZhengzaiGoodVo>> getStoreList(@RequestParam("marketId") @Valid String marketId) {
return goblinStoreZhengzaiService.getSpuList(marketId);
}
@PostMapping("list")
@ApiOperation("订单列表[商铺]")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数", example = "1"),
})
public ResponseDto<List<GoblinAppOrderListVo>> orderList(@RequestParam("page") @Valid int page) {
return goblinStoreZhengzaiService.orderList(page);
}
@PostMapping("orderPush")
@ApiOperation("正在下单-出货")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderMasterCode", value = "主订单号"),
})
public ResponseDto<Boolean> orderPush(@RequestParam("orderMasterCode") @Valid String orderMasterCode) {
return goblinStoreZhengzaiService.orderPush(orderMasterCode);
}
@PostMapping("listByCode")
@ApiOperation("列表[根据masterCode]")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderMasterCode", value = "主订单号"),
})
public ResponseDto<List<GoblinAppOrderListVo>> orderListByMaster(@RequestParam("orderMasterCode") @Valid String orderMasterCode) {
return goblinOrderAppService.orderListByMaster(orderMasterCode);
}
@PostMapping("details")
@ApiOperation("订单详情")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderId", value = "订单id", example = "1"),
})
public ResponseDto<GoblinAppOrderDetailsVo> orderDetails(@RequestParam("orderId") @Valid String orderId) {
return goblinOrderAppService.orderDetails(orderId, null);
}
@PostMapping("paySuccess")
@ApiOperation("汇付支付成功回调")
@ResponseBody
public String refundDetails(HttpServletRequest request) {
return goblinOrderAppService.huiFuSync(request);
}
}
package com.liquidnet.service.goblin.controller.Inner;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiCommonParam;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.manage.IGoblinInnerService;
import com.liquidnet.service.goblin.service.manage.IGoblinZhengzaiService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.util.List;
/**
* 正在下单活动管理
*/
@Slf4j
@RestController
@Api(tags = "活动-内部接口调用")
@RequestMapping("inner")
public class GoblinInnerZhengzaiController {
@Autowired
IGoblinZhengzaiService goblinZhengzaiService;
@Autowired
IGoblinInnerService goblinInnerService;
@PostMapping("config/del/noAuth")
@ApiOperation("活动详情-正在下单-删除商铺spu")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "spuId", example = "1"),
})
public ResponseDto<Boolean> zhengzaiStoreDelNoAuth(@RequestParam("storeId") @Valid String storeId,
@RequestParam("selfMarketId") @Valid String selfMarketId,
@RequestParam("spuId") @Valid String spuId) {
return goblinZhengzaiService.zhengzaiSpuDel(selfMarketId, storeId, spuId);
}
@GetMapping("config/spu")
@ApiOperation("活动详情-正在下单-获取商铺spu")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数", example = "1")
})
public ResponseDto<PageInfo<GoblinMarketSpuListVo>> zhengzaiStoreConfigSpuList(@RequestParam("storeId") @Valid String storeId,
@RequestParam("selfMarketId") @Valid String selfMarketId,
@RequestParam("page") @Valid int page) {
return goblinZhengzaiService.zhengzaiSpuList(selfMarketId, storeId, page);
}
@GetMapping("config/sku")
@ApiOperation("活动详情-正在下单-获取商铺sku")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "spuId", example = "1")
})
public ResponseDto<List<GoblinSelfZhengzaiSkuVo>> zhengzaiStoreConfigSkuList(@RequestParam("storeId") @Valid String storeId,
@RequestParam("spuId") @Valid String spuId,
@RequestParam("selfMarketId") @Valid String selfMarketId) {
return goblinZhengzaiService.zhengzaiSkuList(selfMarketId, storeId, spuId);
}
@PostMapping("add/temp/coupon")
@ApiOperation("添加活动临时券")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "File", name = "file", value = "文件", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "performanceId", value = "演出id", required = true),
})
public ResponseDto<String> insertCoupon(@RequestParam("file") MultipartFile file,
@RequestParam("performanceId") String performanceId) {
return goblinInnerService.insertCoupon(file, performanceId);
}
@PostMapping("ar/data")
@ApiOperation("获取ar相关离线数据")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "String", name = "tag", value = "标签", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "performanceId", value = "演出id", required = true),
})
public ResponseDto<ArDataVo> getArData(@RequestParam("tag") String tag,
@RequestParam("performanceId") String performanceId) {
return goblinInnerService.getArData(tag, performanceId);
}
@PostMapping("temp/coupon/data")
@ApiOperation("获取临时券数据")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "String", name = "ucouponId", value = "券id", required = true),
})
public ResponseDto<TempCouponVo> getArData(@RequestParam("ucouponId") String ucouponId) {
return goblinInnerService.getTempCouponData(ucouponId);
}
}
package com.liquidnet.service.goblin.controller.manage;
import com.github.pagehelper.PageInfo;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinBackOrderDetailsVo;
import com.liquidnet.service.goblin.dto.vo.GoblinBackOrderVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreBackOrderListVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreOrderListVo;
import com.liquidnet.service.goblin.param.RefundCallbackParam;
import com.liquidnet.service.goblin.service.manage.IGoblinStoreBackOrderService;
import com.liquidnet.service.goblin.service.manage.IGoblinStoreOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.math.BigDecimal;
@ApiSupport(order = 149101)
@Api(tags = "店铺-退款订单")
@Slf4j
@Validated
@RestController
@RequestMapping("store/orderBack")
public class GoblinStoreBackOrderController {
@Autowired
IGoblinStoreBackOrderService goblinStoreBackOrderService;
@ApiOperation(value = "订单列表")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderBackCode", value = "订单退款编号"),
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "type", value = "退款类型[1-退款|2-退货|3-退款退货]"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "cst", value = "申请起始时间"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "cet", value = "申请终止时间"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderCode", value = "订单编号"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "spuName", value = "商品名称"),
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "status", value = "订单状态[1-待处理|2-已退款|9-已拒绝|11-已取消|0-退款中|7-退货中]"),
})
@GetMapping(value = "list")
public ResponseDto<PageInfo<GoblinStoreBackOrderListVo>> orderBackList(@RequestParam(value = "page", required = true) @Valid Integer page,
@RequestParam(value = "orderBackCode", required = false) String orderBackCode,
@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "cst", required = false) String cst,
@RequestParam(value = "cet", required = false) String cet,
@RequestParam(value = "orderCode", required = false) String orderCode,
@RequestParam(value = "spuName", required = false) String spuName,
@RequestParam(value = "status", required = false) Integer status) {
return goblinStoreBackOrderService.orderBackList(page, orderBackCode, type, cst, cet, orderCode, spuName, status);
}
@ApiOperation(value = "退款订单详情")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "backOrderId", value = "订单id"),
})
@GetMapping(value = "details")
public ResponseDto<GoblinBackOrderDetailsVo> orderList(@RequestParam(value = "backOrderId", required = true) @Valid String backOrderId) {
return goblinStoreBackOrderService.orderDetails(backOrderId);
}
@ApiOperation(value = "同意退款")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "backOrderId", value = "订单id"),
})
@GetMapping(value = "agree")
public ResponseDto<Boolean> agreeRefund(@RequestParam(value = "backOrderId", required = true) @Valid String backOrderId) {
return goblinStoreBackOrderService.agreeRefund(backOrderId);
}
@ApiOperation(value = "拒绝退款")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "backOrderId", value = "订单id"),
})
@GetMapping(value = "refused")
public ResponseDto<Boolean> refusedRefund(@RequestParam(value = "backOrderId", required = true) @Valid String backOrderId) {
return goblinStoreBackOrderService.refusedRefund(backOrderId);
}
@ApiOperation(value = "修改金额")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "backOrderId", value = "订单id"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "changeType", value = "类型[1-物流金额|2-退款金额]"),
@ApiImplicitParam(type = "form", required = true, dataType = "Number", name = "refundPrice", value = "价格"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderSkuId", value = "orderSkuId"),
})
@GetMapping(value = "change")
public ResponseDto<Boolean> changeRefund(@RequestParam(value = "backOrderId", required = true) @Valid String backOrderId,
@RequestParam(value = "changeType", required = true) @Valid Integer changeType,
@RequestParam(value = "refundPrice", required = true) @Valid BigDecimal refundPrice,
@RequestParam(value = "orderSkuId", required = false) String orderSkuId) {
if (changeType == 1) {
return goblinStoreBackOrderService.changeExpressRefund(backOrderId, refundPrice);
} else if (changeType == 2) {
return goblinStoreBackOrderService.changeSkuRefund(backOrderId, refundPrice, orderSkuId);
} else {
return ResponseDto.failure("参数异常");
}
}
}
package com.liquidnet.service.goblin.controller.manage;
import com.fasterxml.jackson.databind.JsonNode;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.IdentityUtils;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtCertificationParam;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtCompleteParam;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo;
import com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtCertificationService;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.Arrays;
import java.util.List;
@ApiSupport(order = 149001)
@Api(tags = "店铺认证")
@Slf4j
@Validated
@RestController
@RequestMapping("store/mgt/cert")
public class GoblinStoreMgtCertificationController {
@Autowired
IGoblinStoreMgtCertificationService goblinStoreMgtCertificationService;
@Autowired
GoblinMongoUtils goblinMongoUtils;
@Autowired
GoblinRedisUtils goblinRedisUtils;
public static final List<String> ENABLE_CERT_STATUS = Arrays.asList("0", "2");
@ApiOperationSupport(order = 1)
@ApiOperation(value = "店铺认证第一步:认证资料")
@PostMapping("fstep")
public ResponseDto<String> certificationFirstStep(@Valid @RequestBody GoblinStoreMgtCertificationParam certificationParam) {
String currentUid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVoByUid(currentUid);
if (null != storeInfoVo && !ENABLE_CERT_STATUS.contains(storeInfoVo.getStatus())) {
log.warn("店铺认证:无效请求:店铺已认证,无需再次认证[UID={},storeId={},storeStatus={}]", currentUid, storeInfoVo.getStoreId(), storeInfoVo.getStatus());
return ResponseDto.failure(ErrorMapping.get("149001"));
}
if (log.isDebugEnabled()) {
log.debug("店铺认证[UID={},GoblinStoreMgtCertificationParam:{}]", currentUid, JsonUtils.toJson(certificationParam));
}
if (certificationParam.getPersonCertType().equals("1")) {
String personName = certificationParam.getPersonName();
String personCertCode = certificationParam.getPersonCertCode();
String respStr = IdentityUtils.aliThird(personName, personCertCode);
JsonNode respJNode = JsonUtils.fromJson(respStr, JsonNode.class);
if (null == respJNode || !"0".equals(String.valueOf(respJNode.get("error_code")))) {
log.info("###实名认证失败[UID={},name={},idcard={},respStr={}]", currentUid, personName, personCertCode, respStr);
return ResponseDto.failure(ErrorMapping.get("149004"));
}
}
storeInfoVo = goblinStoreMgtCertificationService.certificationInformationProcessing(certificationParam, storeInfoVo);
return ResponseDto.success(storeInfoVo.getStoreId());
}
@ApiOperationSupport(order = 2)
@ApiOperation(value = "店铺认证第二步:完善信息")
@PostMapping("sstep")
public ResponseDto<Object> certificationSecondStep(@Valid @RequestBody GoblinStoreMgtCompleteParam completeParam) {
String currentUid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVoByUid(currentUid);
if (null == storeInfoVo) {
log.warn("店铺认证:完善信息:店铺信息不存在,请按流程完成第一步:[UID={}]", currentUid);
return ResponseDto.failure(ErrorMapping.get("149001"));
}
if (!ENABLE_CERT_STATUS.contains(storeInfoVo.getStatus())) {
log.warn("店铺认证:无效请求:店铺已认证,无需再次认证[UID={},storeId={},storeStatus={}]", currentUid, storeInfoVo.getStoreId(), storeInfoVo.getStatus());
return ResponseDto.failure(ErrorMapping.get("149001"));
}
if (log.isDebugEnabled()) {
log.debug("店铺认证[UID={},GoblinStoreMgtCompleteParam:{}]", currentUid, JsonUtils.toJson(completeParam));
}
boolean resultFlg = goblinStoreMgtCertificationService.certificationCompleteProcessing(completeParam, storeInfoVo);
return resultFlg ? ResponseDto.success() : ResponseDto.failure();
}
@ApiOperationSupport(order = 3)
@ApiOperation(value = "店铺认证编辑中:资料详情")
@PostMapping("einfo")
public ResponseDto<GoblinStoreInfoVo> certificationInfo() {
return ResponseDto.success(goblinRedisUtils.getStoreInfoVoByUid(CurrentUtil.getCurrentUid()));
}
@ApiOperationSupport(order = 4)
@ApiOperation(value = "店铺认证认证中:店铺状态", notes = "认证状态[-1-未申请|0-填写资料中|1-店铺审核中|2-审核不通过|3-审核通过|4-停业|5-营业]")
@PostMapping("status")
public ResponseDto<String> certificationStatus() {
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVoByUid(CurrentUtil.getCurrentUid());
return ResponseDto.success(null == storeInfoVo ? "-1" : storeInfoVo.getStatus());
}
@ApiOperationSupport(order = 3)
@ApiOperation(value = "删除店铺")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "店铺ID"),
})
@PostMapping("cancel")
public ResponseDto<Object> certificationCancel(@NotBlank(message = "店铺ID不能为空") @RequestParam String storeId) {
String currentUid = CurrentUtil.getCurrentUid();
if (!goblinRedisUtils.hasStoreId(currentUid, storeId)) {
return ResponseDto.failure(ErrorMapping.get("149002"));
}
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVo(storeId);
if (null == storeInfoVo || Arrays.asList("3","4","5").contains(storeInfoVo.getStatus())) {
return ResponseDto.success();// 店铺认证通过后不允许删除
}
log.info("删除店铺[UID={},storeId={}]", currentUid, storeId);
boolean resultFlg = goblinStoreMgtCertificationService.certificationCancelProcessing(storeId, currentUid);
return resultFlg ? ResponseDto.success() : ResponseDto.failure();
}
}
package com.liquidnet.service.goblin.controller.manage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinMgtCategorySpecVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfGoodsCategoryVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfTagVo;
import com.liquidnet.service.goblin.dto.vo.GoblinServiceSupportVo;
import com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtExtraService;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.List;
@ApiSupport(order = 149003)
@Api(tags = "附加数据")
@Slf4j
@Validated
@RestController
@RequestMapping("store/mgt/extra")
public class GoblinStoreMgtExtraController {
@Autowired
GoblinRedisUtils goblinRedisUtils;
@Autowired
GoblinMongoUtils goblinMongoUtils;
@Autowired
IGoblinStoreMgtExtraService goblinStoreMgtExtraService;
@ApiOperationSupport(order = 1)
@ApiOperation(value = "平台商品分类")
@GetMapping("sg_categorys")
public ResponseDto<List<GoblinSelfGoodsCategoryVo>> selfGoodsCategoryList() {
return ResponseDto.success(goblinStoreMgtExtraService.listCategoryVo());
}
@ApiOperationSupport(order = 2)
@ApiOperation(value = "平台分类规格")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "cateId", value = "分类ID"),
})
@GetMapping("sg_catespecs")
public ResponseDto<GoblinMgtCategorySpecVo> categorySpecList(@RequestParam String cateId) {
if (StringUtils.isBlank(cateId)) return ResponseDto.success();
return ResponseDto.success(goblinMongoUtils.getCategorySpecVo(cateId));
}
@ApiOperationSupport(order = 3)
@ApiOperation(value = "服务支持列表")
@PostMapping("list")
public ResponseDto<List<GoblinServiceSupportVo>> list() {
return ResponseDto.success(goblinStoreMgtExtraService.listServiceSupportVo());
}
@ApiOperationSupport(order = 4)
@ApiOperation(value = "标签数据", notes = "获取商品标签与音乐人、艺人、IP")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "keyword", value = "标签关键字"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "belong", value = "标签所属[0-普通标签|1-专属标签]", allowableValues = "0,1"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "range", value = "查询标签类型范围,belong=1时有效,多个以,分隔[1-音乐人|2-艺术家|3-品牌方|4-厂牌|5-AR]", example = "1,2,3,4,5"),
})
@GetMapping("tags")
public ResponseDto<List<GoblinSelfTagVo>> tagList(@RequestParam(required = false) String keyword,
@NotBlank(message = "标签所属参数无效")
@Pattern(regexp = "\\b(0|1)\\b", message = "标签所属[0-普通标签|1-专属标签]")
@RequestParam String belong,
@RequestParam(defaultValue = "1,2,3,4") String range) {
return ResponseDto.success(goblinStoreMgtExtraService.listTagVo(keyword, belong, range.split(",")));
}
}
package com.liquidnet.service.goblin.controller.manage;
import com.github.pagehelper.PageInfo;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinOrderLogVo;
import com.liquidnet.service.goblin.service.manage.IGoblinStoreMoneyService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.HashMap;
@ApiSupport(order = 149102)
@Api(tags = "店铺资金模块")
@Slf4j
@Validated
@RestController
@RequestMapping("store/money")
public class GoblinStoreMoneyController {
@Autowired
IGoblinStoreMoneyService goblinStoreMoneyService;
@GetMapping("money")
@ApiOperation("商品资金总收入")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "spuId", value = "spuId"),
})
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<HashMap<String,String>> money(@RequestParam(value = "spuId", required = false) String spuId) {
return goblinStoreMoneyService.money(spuId);
}
@GetMapping("spu/list")
@ApiOperation("商品资金列表")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "spuName", value = "商品名称"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "st", value = "起始时间"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "et", value = "终止时间"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数"),
})
public ResponseDto<PageInfo<GoblinOrderLogVo>> getSpuList(@RequestParam(value = "spuName", required = false) String spuName,
@RequestParam(value = "st", required = false) String st,
@RequestParam(value = "et", required = false) String et,
@RequestParam(value = "page") Integer page) {
return goblinStoreMoneyService.getSpuList(spuName, st, et, page);
}
@GetMapping("orderOpera/list")
@ApiOperation("商品订单操作日志列表")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "spuId", value = "spuId"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderCode", value = "订单号"),
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "type", value = "交易类型[1-订单交易,2-订单退款,3-正在下单[订单交易],4-正在下单[订单退款]]"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "st", value = "起始时间"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "et", value = "终止时间"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数"),
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "type2", value = "[1-收入|2-支出]"),
})
public ResponseDto<PageInfo<GoblinOrderLogVo>> getOrderOperaList(@RequestParam(value = "spuId", required = true) String spuId,
@RequestParam(value = "orderCode", required = false) String orderCode,
@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "st", required = false) String st,
@RequestParam(value = "et", required = false) String et,
@RequestParam(value = "page") Integer page) {
return goblinStoreMoneyService.getOrderOperaList(spuId, orderCode, type, st, et, page);
}
}
package com.liquidnet.service.goblin.controller.manage;
import com.github.pagehelper.PageInfo;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseCommonParam;
import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseParam;
import com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreMarketVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStorePurchaseSkuVo;
import com.liquidnet.service.goblin.service.manage.IGoblinStorePurchasingService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* 商铺活动管理
*/
@ApiSupport(order = 149202)
@Slf4j
@RestController
@Api(tags = "活动-限时秒杀")
@RequestMapping("store/marketing")
public class GoblinStorePurchasingController {
@Autowired
IGoblinStorePurchasingService goblinStorePurchasingService;
@GetMapping("purchasing/list")
@ApiOperation("活动详情-限时秒杀列表")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "page", value = "页数", example = "1"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "purchaseName", value = "活动名称", example = ""),
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "status", value = "活动状态[-1-全部|0-等待开始|1-活动中|2-活动结束|7-停用]", example = ""),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "startTime", value = "活动开始时间", example = ""),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "endTime", value = "活动结束时间", example = ""),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "createdAt", value = "活动创建时间", example = ""),
})
public ResponseDto<PageInfo<GoblinStoreMarketVo>> purchasingList(@RequestParam(value = "page", required = false) @Valid Integer page,
@RequestParam(value = "purchaseName", required = false) String purchaseName,
@RequestParam(value = "status", required = true) Integer status,
@RequestParam(value = "startTime", required = false) String st,
@RequestParam(value = "endTime", required = false) String et,
@RequestParam(value = "createdAt", required = false) String ct) {
return goblinStorePurchasingService.purchasingList(page, purchaseName, status, st, et, ct);
}
@PostMapping("purchasing/status")
@ApiOperation("活动操作-限时秒杀")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = ""),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = ""),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "status", value = "活动状态[0-等待开始(启用)|7-停用|-1-删除]", example = ""),
})
public ResponseDto<Boolean> purchasingStatus(@RequestParam(value = "marketId") @Valid String marketId,
@RequestParam(value = "storeId") @Valid String storeId,
@RequestParam(value = "status") @Valid Integer status) {
return goblinStorePurchasingService.purchasingStatus(marketId, storeId, status);
}
@PostMapping("purchasing")
@ApiOperation("创建活动-限时秒杀")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<Boolean> purchasingInsert(@RequestBody GoblinStorePurchaseParam goblinStorePurchaseParam) {
return goblinStorePurchasingService.purchasingInsert(goblinStorePurchaseParam.getName(), goblinStorePurchaseParam.getStoreId(), goblinStorePurchaseParam.getStartTime(), goblinStorePurchaseParam.getEndTime(), goblinStorePurchaseParam.getIsPre(), goblinStorePurchaseParam.getPreTime());
}
@PutMapping("purchasing")
@ApiOperation("修改活动-限时秒杀")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<String> purchasingUpdate(@RequestBody GoblinStorePurchaseParam goblinStorePurchaseParam) {
goblinStorePurchasingService.purchasingUpdate(goblinStorePurchaseParam.getMarketId(), goblinStorePurchaseParam.getName(), goblinStorePurchaseParam.getStoreId(), goblinStorePurchaseParam.getStartTime(), goblinStorePurchaseParam.getEndTime(), goblinStorePurchaseParam.getIsPre(), goblinStorePurchaseParam.getPreTime());
return ResponseDto.success();
}
@GetMapping("purchasing/details")
@ApiOperation("活动详情-限时秒杀")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
})
public ResponseDto<GoblinStoreMarketVo> purchasingDetails(@RequestParam("marketId") @Valid String marketId) {
return goblinStorePurchasingService.purchasingDetails(marketId);
}
@GetMapping("purchasing/spu")
@ApiOperation("活动详情-限时秒杀-spu列表")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数", example = "1"),
})
public ResponseDto<List<GoblinMarketSpuListVo>> purchasingSpuList(@RequestParam("marketId") @Valid String marketId,
@RequestParam("storeId") @Valid String storeId,
@RequestParam("page") @Valid Integer page) {
return goblinStorePurchasingService.purchasingSpuList(marketId, storeId, page);
}
@GetMapping("purchasing/sku")
@ApiOperation("活动详情-限时秒杀-sku列表")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "spuMarketId", example = "1"),
})
public ResponseDto<List<GoblinStorePurchaseSkuVo>> purchasingSkuList(@RequestParam("marketId") @Valid String marketId,
@RequestParam("storeId") @Valid String storeId,
@RequestParam("spuMarketId") @Valid String spuId) {
return goblinStorePurchasingService.purchasingSkuList(marketId, storeId, spuId);
}
@PostMapping("purchasing/sku")
@ApiOperation("活动详情-限时秒杀-sku新增")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<Boolean> purchasingSkuInsert(@RequestBody GoblinStorePurchaseCommonParam params) {
return goblinStorePurchasingService.purchasingSkuInsert(params);
}
@PutMapping("purchasing/sku")
@ApiOperation("活动详情-限时秒杀-sku修改")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<Boolean> purchasingSkuUpdate(@RequestBody GoblinStorePurchaseCommonParam params) {
return goblinStorePurchasingService.purchasingSkuUpdate(params);
}
@DeleteMapping("purchasing/spu")
@ApiOperation("活动详情-限时秒杀-spu删除")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "spuId", example = "1")
})
public ResponseDto<Boolean> purchasingSpuDel(@RequestParam("marketId") @Valid String marketId,
@RequestParam("storeId") @Valid String storeId,
@RequestParam("spuId") @Valid String spuId) {
return goblinStorePurchasingService.purchasingSpuDel(marketId, storeId, spuId);
}
}
package com.liquidnet.service.goblin.controller.manage;
import com.github.pagehelper.PageInfo;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiCommonParam;
import com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfZhengzaiSkuVo;
import com.liquidnet.service.goblin.service.manage.IGoblinZhengzaiService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* 正在下单活动管理
*/
@ApiSupport(order = 149201)
@Slf4j
@RestController
@Api(tags = "活动-正在下单")
@RequestMapping("store/zhengzai")
public class GoblinZhengzaiController {
@Autowired
IGoblinZhengzaiService goblinZhengzaiService;
@GetMapping("list")
@ApiOperation("活动详情-正在下单-可参与活动列表")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1")
})
public ResponseDto<List<GoblinSelfMarketingVo>> zhengzaiCanJoin(@RequestParam("storeId") @Valid String storeId) {
return ResponseDto.success(goblinZhengzaiService.zhengzaiCanJoin(storeId));
}
@GetMapping("detals")
@ApiOperation("活动详情-正在下单-可参与活动详情")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1")
})
public ResponseDto<GoblinSelfMarketingVo> zhengzaiCanJoinDetails(@RequestParam("storeId") @Valid String storeId,
@RequestParam("selfMarketId") @Valid String selfMarketId) {
return ResponseDto.success(goblinZhengzaiService.zhengzaiCanJoinDetails(selfMarketId, storeId));
}
@GetMapping("config/spu")
@ApiOperation("活动详情-正在下单-获取商铺spu")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数", example = "1")
})
public ResponseDto<PageInfo<GoblinMarketSpuListVo>> zhengzaiStoreConfigSpuList(@RequestParam("storeId") @Valid String storeId,
@RequestParam("selfMarketId") @Valid String selfMarketId,
@RequestParam("page") @Valid int page) {
return goblinZhengzaiService.zhengzaiSpuList(selfMarketId, storeId, page);
}
@GetMapping("config/sku")
@ApiOperation("活动详情-正在下单-获取商铺sku")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "spuId", example = "1")
})
public ResponseDto<List<GoblinSelfZhengzaiSkuVo>> zhengzaiStoreConfigSkuList(@RequestParam("storeId") @Valid String storeId,
@RequestParam("spuId") @Valid String spuId,
@RequestParam("selfMarketId") @Valid String selfMarketId) {
return goblinZhengzaiService.zhengzaiSkuList(selfMarketId, storeId, spuId);
}
@PostMapping("config/insert")
@ApiOperation("活动详情-正在下单-添加商铺sku")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<Boolean> zhengzaiStoreInsert(@RequestBody GoblinStoreZhengzaiCommonParam params) {
return goblinZhengzaiService.zhengzaiSkuInsert(params);
}
@PostMapping("config/update")
@ApiOperation("活动详情-正在下单-修改商铺sku")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<Boolean> zhengzaiStoreUpdate(@RequestBody GoblinStoreZhengzaiCommonParam params) {
return goblinZhengzaiService.zhengzaiSkuUpdate(params);
}
@PostMapping("config/del")
@ApiOperation("活动详情-正在下单-删除商铺spu")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "spuId", example = "1"),
})
public ResponseDto<Boolean> zhengzaiStoreDel(@RequestParam("storeId") @Valid String storeId,
@RequestParam("selfMarketId") @Valid String selfMarketId,
@RequestParam("spuId") @Valid String spuId) {
return goblinZhengzaiService.zhengzaiSpuDel(selfMarketId, storeId, spuId);
}
}
package com.liquidnet.service.goblin.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtCouponListVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
@Getter
@Setter
@EqualsAndHashCode
public class GoblinStoreMgtCouponListVoExcel implements Serializable, Cloneable {
private static final long serialVersionUID = 3264197773499339729L;
@ExcelProperty("卡券编码")
private String storeCouponNo;
@ExcelProperty("卡券名称")
private String title;
@ExcelProperty("卡券状态")
private String state;
@ExcelProperty("开始时间")
private String startTime;
@ExcelProperty("结束时间")
private String endTime;
@ExcelProperty("创建时间")
private String createdAt;
@ExcelProperty("领取数量")
private int receiveNum;
@ExcelProperty("使用数量")
private int usedNum;
@ExcelProperty("总库存")
private Integer stock;
private static final GoblinStoreMgtCouponListVoExcel obj = new GoblinStoreMgtCouponListVoExcel();
public static GoblinStoreMgtCouponListVoExcel getNew() {
try {
return (GoblinStoreMgtCouponListVoExcel) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinStoreMgtCouponListVoExcel();
}
}
public GoblinStoreMgtCouponListVoExcel copy(GoblinStoreMgtCouponListVo source) {
if (null == source) return this;
this.setStoreCouponNo(source.getStoreCouponNo());
this.setTitle(source.getTitle());
switch (source.getState()) {
case "0":
this.setState("等待开始");break;
case "1":
this.setState("活动中");break;
case "2":
this.setState("活动结束");break;
case "3":
this.setState("已上架");break;
default:
this.setState("停用");break;
}
DateUtil.Formatter yyyyMMddHHmmss = DateUtil.Formatter.yyyyMMddHHmmss;
this.setStartTime(yyyyMMddHHmmss.format(source.getStartTime()));
this.setEndTime(yyyyMMddHHmmss.format(source.getEndTime()));
this.setCreatedAt(yyyyMMddHHmmss.format(source.getCreatedAt()));
this.setReceiveNum(source.getReceiveNum());
this.setUsedNum(source.getUsedNum());
this.setStock(source.getStock());
return this;
}
}
package com.liquidnet.service.goblin.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsInfoVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import java.math.BigDecimal;
@Getter
@Setter
@EqualsAndHashCode
public class GoblinStoreMgtGoodsListVoExcel implements Serializable, Cloneable {
private static final long serialVersionUID = -5926827517337445529L;
@ExcelProperty("店铺ID")
private String storeId;
@ExcelProperty("商品ID")
private String spuId;
@ExcelProperty("商品编码")
private String spuNo;
@ExcelProperty("封面图片")
private String coverPic;
@ExcelProperty("商品名称")
private String name;
@ExcelProperty("分类")
private String cateMerge;
@ExcelProperty("价格区间")
private String priceRange;
// @ExcelProperty("审核状态")
// private String status;
// @ExcelProperty("审核拒绝原因")
// private String reason;
@ExcelProperty("上架状态")
private String shelvesStatus;
@ExcelProperty("总库存")
private Integer totalStock;
@ExcelProperty("剩余库存")
private Integer surplusStock;
private static final GoblinStoreMgtGoodsListVoExcel obj = new GoblinStoreMgtGoodsListVoExcel();
public static GoblinStoreMgtGoodsListVoExcel getNew() {
try {
return (GoblinStoreMgtGoodsListVoExcel) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinStoreMgtGoodsListVoExcel();
}
}
public GoblinStoreMgtGoodsListVoExcel copy(GoblinStoreMgtGoodsListVo source) {
if (null == source) return this;
this.setStoreId(source.getStoreId());
this.setSpuId(source.getSpuId());
this.setSpuNo(source.getSpuNo());
this.setCoverPic(source.getCoverPic());
this.setName(source.getName());
this.setCateMerge(StringUtils.defaultString(source.getCateFid(), "") + "/"
+ StringUtils.defaultString(source.getCateSid(), "") + "/"
+ StringUtils.defaultString(source.getCateTid(), ""));
this.setPriceRange("¥" + source.getPriceGe().toString() + " - ¥" + source.getPriceLe().toString());
switch (source.getShelvesStatus()) {
case "0":
this.setShelvesStatus("待上架");break;
case "1":
this.setShelvesStatus("已下架");break;
case "2":
this.setShelvesStatus("违规");break;
case "3":
this.setShelvesStatus("已上架");break;
default:
this.setShelvesStatus("其它");break;
}
this.setTotalStock(source.getTotalStock());
this.setSurplusStock(source.getSurplusStock());
return this;
}
}
package com.liquidnet.service.goblin.service.impl;
import com.liquidnet.service.goblin.service.GoblinStoreService;
import org.springframework.stereotype.Service;
@Service
public class GoblinStoreServiceImpl implements GoblinStoreService {
}
package com.liquidnet.service.goblin.service.impl;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.IGoblinStoreZhengzaiService;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import com.liquidnet.service.goblin.util.ObjectUtil;
import com.liquidnet.service.goblin.util.QueueUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
@Service
public class GoblinStoreZhengzaiServiceImpl implements IGoblinStoreZhengzaiService {
@Autowired
GoblinRedisUtils redisUtils;
@Autowired
GoblinMongoUtils mongoUtils;
@Autowired
QueueUtils queueUtils;
@Override
public ResponseDto<List<GoblinSelfMarketingVo>> getZhengzaiMarketList() {
String uid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVoByUid(uid);
if (storeInfoVo == null) {
return ResponseDto.failure("店铺不存在");
}
String storeId = storeInfoVo.getStoreId();
List<String> marketIds = redisUtils.getStoreZhengzaiRelation(storeId);//可参加的正在活动id
List<GoblinSelfMarketingVo> list = redisUtils.getGoblinSelfMarketingVoList();//所有正在下单活动列表
List<GoblinSelfMarketingVo> voList = ObjectUtil.getGoblinSelfMarketingVoList();
LocalDateTime now = LocalDateTime.now();
for (GoblinSelfMarketingVo item : list) {
GoblinMarketingZhengzaiRelationVo zhengzaiRelationVo = redisUtils.getZhengzaiRelation(item.getSelfMarketId(), storeId);
if (LocalDateTime.parse(item.getEndTime(), DTF_YMD_HMS).isAfter(now) && zhengzaiRelationVo != null) {
if (marketIds.contains(item.getSelfMarketId())) {
List<GoblinMarketRelationVo> relationVo = redisUtils.getMarketRelation(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue(), item.getSelfMarketId());
List<String> storeIdList = relationVo.stream().map(GoblinMarketRelationVo::getStoreId).distinct().collect(Collectors.toList());//配置了商铺的店铺
if (storeIdList.contains(storeId)) {
voList.add(item);
}
}
}
}
return ResponseDto.success(voList);
}
@Override
public ResponseDto<List<GoblinZhengzaiGoodVo>> getSpuList(String marketId) {
String uid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVoByUid(uid);
if (storeInfoVo == null) {
return ResponseDto.failure("店铺不存在");
}
String storeId = storeInfoVo.getStoreId();
List<GoblinMarketRelationVo> relationVo = redisUtils.getMarketRelation(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue(), marketId);
List<String> spuIdList = relationVo.stream().map(GoblinMarketRelationVo::getSpuId).collect(Collectors.toList());
List<GoblinZhengzaiGoodVo> voList = ObjectUtil.getGoblinZhengzaiGoodVoArrayList();
for (String spuId : spuIdList) {
GoblinGoodsInfoVo vo = redisUtils.getGoodsInfoVo(spuId);
if (vo.getShelvesStatus().equals("3") && vo.getStoreId().equals(storeId)) {
GoblinZhengzaiGoodVo returnVo = GoblinZhengzaiGoodVo.getNew();
BeanUtils.copyProperties(vo, returnVo);
voList.add(returnVo);
}
}
return ResponseDto.success(voList);
}
@Override
public ResponseDto<List<GoblinAppOrderListVo>> orderList(int page) {
String uid = CurrentUtil.getCurrentUid();
List<GoblinAppOrderListVo> orderVoList = ObjectUtil.goblinAppOrderListVoArrayList();
GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVoByUid(uid);
List<GoblinStoreOrderVo> mongoVoList = mongoUtils.storeZhengzaiOrderList(page, storeInfoVo.getStoreId());
for (GoblinStoreOrderVo orderVo : mongoVoList) {
GoblinAppOrderListVo vo = GoblinAppOrderListVo.getNew();
BeanUtils.copyProperties(orderVo, vo);
vo.setRestTime(getRestTime(orderVo));
List<GoblinOrderSkuVo> skuVos = ObjectUtil.getGoblinOrderSkuVoArrayList();
for (String orderSkuId : orderVo.getOrderSkuVoIds()) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId);
skuVos.add(orderSkuVo);
}
vo.setOrderSkuVos(skuVos);
orderVoList.add(vo);
}
return ResponseDto.success(orderVoList);
}
@Override
public ResponseDto<Boolean> orderPush(String orderMasterCode) {
String[] orderIds = redisUtils.getMasterCode(orderMasterCode);
LocalDateTime now = LocalDateTime.now();
LinkedList<Object[]> sqlDataOrder = CollectionUtil.linkedListObjectArr();
if (orderIds == null) {
return ResponseDto.failure("订单不存在");
} else {
for (String orderId : orderIds) {
GoblinStoreOrderVo storeOrderVo = redisUtils.getGoblinOrder(orderId);
storeOrderVo.setZhengzaiStatus(1);
//mongo
mongoUtils.updateGoblinStoreOrderVo(storeOrderVo.getOrderId(), storeOrderVo);
//redis
redisUtils.setGoblinOrder(storeOrderVo.getOrderId(), storeOrderVo);
sqlDataOrder.add(new Object[]{
1, now, storeOrderVo.getOrderId(), now, now
});
}
//mysql
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_STORE_ORDER_OPERA.getKey(),
SqlMapping.get("goblin_order.zhengzai.bind", sqlDataOrder));
}
return ResponseDto.success();
}
//获取 订单剩余可支付时间[S]
private long getRestTime(GoblinStoreOrderVo orderVo) {
long restTime = 0L;
if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_0.getValue()) {
try {
Date OverdueAt = DateUtil.addMin(DateUtil.parse(orderVo.getCreatedAt(), "yyyy-MM-dd HH:mm:ss"), orderVo.getPayCountdownMinute());
restTime = DateUtil.intervalSeconds(
OverdueAt,
DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd HH:mm:ss")
);
if (restTime <= 0L) {
restTime = 0L;
}
} catch (Exception e) {
e.printStackTrace();
}
}
return restTime;
}
}
package com.liquidnet.service.goblin.service.impl.inner;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.listener.PageReadListener;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.TempCouponDto;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.GoblinFrontService;
import com.liquidnet.service.goblin.service.manage.IGoblinInnerService;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import com.liquidnet.service.goblin.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Slf4j
@Service
public class GoblinInnerServiceImpl implements IGoblinInnerService {
@Autowired
GoblinRedisUtils redisUtils;
@Autowired
GoblinFrontService goblinFrontService;
@Override
public ResponseDto<String> insertCoupon(MultipartFile file, String performanceId) {
try {
EasyExcel.read(file.getInputStream(), TempCouponDto.class, new PageReadListener<TempCouponDto>(dataList -> {
redisUtils.delMarketTempCoupon(performanceId);
for (TempCouponDto data : dataList) {
if (data.getSpuId() == null) {
continue;
}
List<String> spuList = Arrays.asList(data.getSpuId().split(","));
TempCouponVo vo = TempCouponVo.getNew();
vo.setName(data.getName());
vo.setType(data.getType());
vo.setValue(data.getValue());
vo.setIsDefault(data.getIsDefault());
vo.setSpuIdList(spuList);
vo.setStoreCouponId(data.getStoreCouponId());
redisUtils.addMarketTempCoupon(performanceId, vo.getStoreCouponId());
redisUtils.setTempCoupon(vo.getStoreCouponId(), vo);
}
})).sheet().doRead();
} catch (Exception e) {
e.printStackTrace();
}
return ResponseDto.success("完成");
}
@Override
public ResponseDto<ArDataVo> getArData(String tag, String performanceId) {
ArDataVo vo = ArDataVo.getNew();
//券
ArrayList<TempCouponVo> tempCouponVos = ObjectUtil.getTempCouponVo();
List<String> ucouponIds = redisUtils.getMarketTempCoupon(performanceId);
for (String ucouponId : ucouponIds) {
TempCouponVo tempCouponVo = redisUtils.getTempCoupon(ucouponId);
tempCouponVos.add(tempCouponVo);
}
vo.setTempCouponVos(tempCouponVos);
//商品
List<GoblinGoodsInfoVo> goodsInfoVos = goblinFrontService.getGoodByMusicTagP(tag, performanceId);
for (GoblinGoodsInfoVo spuVo : goodsInfoVos) {
List<GoblinGoodsSkuInfoVo> skuVoList = ObjectUtil.getGoblinGoodsSkuInfoVoArrayList();
for (String skuId : spuVo.getSkuIdList()) {
GoblinGoodsSkuInfoVo skuVo = redisUtils.getGoodsSkuInfoVo(skuId);
skuVoList.add(skuVo);
}
spuVo.setGoblinOrderSkuVos(skuVoList);
}
vo.setGoodsInfoVos(goodsInfoVos);
return ResponseDto.success(vo);
}
@Override
public ResponseDto<TempCouponVo> getTempCouponData(String ucouponId) {
TempCouponVo tempCouponVo = redisUtils.getTempCoupon(ucouponId);
return ResponseDto.success(tempCouponVo);
}
}
package com.liquidnet.service.goblin.service.impl.manage;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreGoodsCategoryVo;
import com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtCategoryService;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import com.liquidnet.service.goblin.util.QueueUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.LinkedList;
import java.util.List;
@Slf4j
@Service
public class GoblinStoreMgtCategoryServiceImpl implements IGoblinStoreMgtCategoryService {
@Autowired
private QueueUtils queueUtils;
@Autowired
private GoblinRedisUtils goblinRedisUtils;
@Autowired
private GoblinMongoUtils goblinMongoUtils;
@Override
public List<GoblinStoreGoodsCategoryVo> list(String storeId) {
return goblinRedisUtils.getStoreGoodsCategoryVos(storeId);
}
@Override
public void add(String storeId, List<GoblinStoreGoodsCategoryVo> addStoreGoodsCategoryVos, List<GoblinStoreGoodsCategoryVo> storeGoodsCategoryVosCache) {
goblinMongoUtils.setStoreGoodsCategoryVos(addStoreGoodsCategoryVos);
if (CollectionUtils.isEmpty(storeGoodsCategoryVosCache)) {
storeGoodsCategoryVosCache = addStoreGoodsCategoryVos;
} else {
storeGoodsCategoryVosCache.addAll(addStoreGoodsCategoryVos);
}
goblinRedisUtils.setStoreGoodsCategoryVos(storeId, storeGoodsCategoryVosCache);
LinkedList<Object[]> initStoreGoodsCategoryObjs = CollectionUtil.linkedListObjectArr();
addStoreGoodsCategoryVos.forEach(r -> initStoreGoodsCategoryObjs.add(new Object[]{
r.getStoreId(), r.getCateId(), r.getName(), r.getSort(), r.getGrade(), r.getCatePid(), r.getNeIsbn(), r.getCreatedBy(), r.getCreatedAt()
}));
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_STORE.getKey(),
SqlMapping.get("goblin_store_goods_category.insert", initStoreGoodsCategoryObjs));
}
@Override
public boolean edit(GoblinStoreGoodsCategoryVo updateStoreGoodsCategoryVo, List<GoblinStoreGoodsCategoryVo> storeGoodsCategoryVosCache) {
if (goblinMongoUtils.updateStoreGoodsCategoryVo(updateStoreGoodsCategoryVo)) {
goblinRedisUtils.setStoreGoodsCategoryVos(updateStoreGoodsCategoryVo.getStoreId(), storeGoodsCategoryVosCache);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_STORE.getKey(), SqlMapping.get("goblin_store_goods_category.update",
updateStoreGoodsCategoryVo.getName(), updateStoreGoodsCategoryVo.getSort(), updateStoreGoodsCategoryVo.getUpdatedBy(),
updateStoreGoodsCategoryVo.getUpdatedAt(), updateStoreGoodsCategoryVo.getStoreId(), updateStoreGoodsCategoryVo.getCateId())
);
return true;
}
return false;
}
@Override
public boolean del(String uid, String storeId, String cateId) {
List<GoblinStoreGoodsCategoryVo> storeGoodsCategoryVosCache = goblinRedisUtils.getStoreGoodsCategoryVos(storeId);
int beforeSize = storeGoodsCategoryVosCache.size();
storeGoodsCategoryVosCache.removeIf(r -> r.getCateId().equals(cateId));
int afterSize = storeGoodsCategoryVosCache.size();
if (beforeSize > afterSize) {
LocalDateTime now = LocalDateTime.now();
GoblinStoreGoodsCategoryVo delStoreGoodsCategoryVo = GoblinStoreGoodsCategoryVo.getNew();
delStoreGoodsCategoryVo.setStoreId(storeId);
delStoreGoodsCategoryVo.setCateId(cateId);
delStoreGoodsCategoryVo.setDelFlg("1");
delStoreGoodsCategoryVo.setUpdatedBy(uid);
delStoreGoodsCategoryVo.setUpdatedAt(now);
delStoreGoodsCategoryVo.setDeletedBy(uid);
delStoreGoodsCategoryVo.setDeletedAt(now);
if (goblinMongoUtils.updateStoreGoodsCategoryVo(delStoreGoodsCategoryVo)) {
goblinRedisUtils.setStoreGoodsCategoryVos(storeId, storeGoodsCategoryVosCache);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_STORE.getKey(),
SqlMapping.get("goblin_store_goods_category.remove",
uid, now, uid, now, storeId, cateId)
);
return true;
}
} else {
log.warn("###店铺商品分类管理:删除:分类不存在[uid={},storeId={},cateId={}]", uid, storeId, cateId);
}
return false;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment