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

Commit fdb748b6 authored by zhengfuxin's avatar zhengfuxin

创建新的 项目

parent 652e1507
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-bus-api</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-service-smile-api</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-goblin-do</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.liquidnet.service.goblin.constant;
public class GoblinRedisConst {
public static final String PREFIX = "goblin:";
/* ----------------------------------------------------------------- */
/**
* 认证中店铺UID关系缓存
* {goblin:bsc:ustore:${uid}, List<store_id>}
*/
public static final String BASIC_USTORE = PREFIX.concat("bsc:ustore:");
/**
* 平台商品标签信息
* {goblin:bsc:self_tag, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinSelfTagVo>)}
*/
public static final String BASIC_SELF_TAG = PREFIX.concat("bsc:self_tag");
/**
* 平台专属标签信息
* {goblin:bsc:self_etag, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinSelfTagVo>)}
*/
public static final String BASIC_SELF_EXTAG = PREFIX.concat("bsc:self_etag");
/**
* 平台商品分类信息
* {goblin:bsc:self_g_c, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinSelfGoodsCategoryVo>)}
*/
public static final String BASIC_SELF_GOODS_CATEGORY = PREFIX.concat("bsc:self_g_c");
/**
* 平台商品分类信息
* {goblin:bsc:self_g_c_s:${cate_id}, com.liquidnet.service.goblin.dto.manage.vo.GoblinMgtCategorySpecVo}
*/
public static final String BASIC_SELF_GOODS_CATEGORY_SPEC = PREFIX.concat("bsc:self_g_c_s:");
/**
* 平台服务支持信息
* {goblin:bsc:sev_sup, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinServiceSupportVo>)}
*/
public static final String BASIC_SERVICE_SUPPORT = PREFIX.concat("bsc:sev_sup");
/**
* 店铺信息
* {goblin:bsc:store:${store_id}, com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo}
*/
public static final String BASIC_STORE = PREFIX.concat("bsc:store:");
/**
* 店铺配置信息
* {goblin:bsc:store_cf:${store_id}, com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo}
*/
public static final String BASIC_STORE_CONF = PREFIX.concat("bsc:store_cf:");
/**
* 店铺商品分类信息
* {goblin:bsc:store_g_c:${store_id}, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinStoreGoodsCategoryVo>)}
*/
public static final String BASIC_STORE_GOODS_CATEGORY = PREFIX.concat("bsc:store_g_c:");
/**
* SPU信息
* {goblin:bsc:goods:${spu_id}, com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo}
*/
public static final String BASIC_GOODS = PREFIX.concat("bsc:goods:");
public static final String BASIC_GOODS_UNSHELVES = PREFIX.concat("bsc:goods_unshelves:");
/**
* SKU信息
* {goblin:bsc:goods_sku:${sku_id}, com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo}
*/
public static final String BASIC_GOODS_SKU = PREFIX.concat("bsc:goods_sku:");
public static final String BASIC_GOODS_SKU_UNSHELVES = PREFIX.concat("bsc:goods_sku_unshelves:");
/* ----------------------------------------------------------------- */
/**
* 店铺公告
* {goblin:store_ntc:${store_id}, com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo}
*/
public static final String STORE_NOTICE = PREFIX.concat("store_ntc:");
/* ----------------------------------------------------------------- */
public static final String FRONT_TOP_BANNER = PREFIX.concat("front_top_banner"); //前端顶部banner
public static final String FRONT_MIDDLE_BANNER = PREFIX.concat("front_middle_banner"); //前端中部banner
public static final String FRONT_NAVIGATION = PREFIX.concat("front_navigation"); //前端banner
public static final String FRONT_HOTWORD = PREFIX.concat("front_hot_word"); //前端banner
public static final String FRONT_HOTWORD_INDEX = PREFIX.concat("front_hot_word_index"); //前端banner index
public static final String FRONT_FRONT_SECKILL = PREFIX.concat("front_front_seckill"); //前端 首页秒杀
public static final String FRONT_SECKILL = PREFIX.concat("front_seckill"); //前端 秒杀列表
public static final String SELECT_GOODS = PREFIX.concat("select_goods"); //配置的精选商品
public static final String SELECT_GOODS_PAGE1 = PREFIX.concat("select_goods_page1"); //精选商品 第一页
public static final String SELECT_GOODS_SORT = PREFIX.concat("select_goods_sort"); //精选商品 排序规则
public static final String SELECT_GOODS_SPUIDS = PREFIX.concat("select_goods_SPUIDS"); //精选商品 spuids
public static final String MOUDLE_INDEX = PREFIX.concat("moudle_index"); //moudle_index 组件排序
public static final String COMPLIATIONS = PREFIX.concat("goblinFrontCompilations"); // 合集
public static final String FRONT_GOBLINFRONTCUBE = PREFIX.concat("goblinFrontCube"); // 魔方
public static final String FRONT_GOBLIN_RECOMMEND= PREFIX.concat("goblinFrontRECOMMMEND"); // 新品推荐
public static final String FRONT_SHOPCART = PREFIX.concat("goblin_shopcart:"); // 购物车
public static final String FRONT_SHOPCART_TWO = PREFIX.concat("goblin_shopcartTwo:"); // 购物车第二部
/* ----------------------------------------------------------------- */
public static final String REDIS_GOBLIN_MARKET_RELATION = PREFIX.concat("market:relation:");//商铺活动-商铺款式关联关系
public static final String REDIS_GOBLIN_SELF_MARKET = PREFIX.concat("self:market:");//官方活动
public static final String REDIS_GOBLIN_ZHENGZAI_RELATION = PREFIX.concat("zhengzai:market:");//活动-正在下单-可参加商户
public static final String REDIS_GOBLIN_STORE_SELF_RELATION = PREFIX.concat("zhengzai:storeId:");//活动-当前商铺能参与的官方活动id列表
public static final String REDIS_GOBLIN_STORE_MARKET = PREFIX.concat("store:market:");//商铺活动
public static final String REDIS_GOBLIN_ZHENGZAI_LIST = PREFIX.concat("zhengzai:list");//全部正在下单内容
public static final String REDIS_GOBLIN_STORE_MARKET_ISCONFIG = PREFIX.concat("store:is_config:");//商铺活动-该活动配置了款式的商品
public static final String REDIS_GOBLIN_BUY_COUNT = PREFIX.concat("uid:");//用户sku购买数量 key:uid:skuId:$skuId
public static final String REDIS_GOBLIN_SALE_COUNT = PREFIX.concat("sale:skuId:");//用户sku购买数量 key:sale:skuId:$skuId
public static final String REDIS_GOBLIN_SALE_SPU_COUNT = PREFIX.concat("sale:skuId:");//用户sku购买数量 key:sale:skuId:$spuId
public static final String REDIS_GOBLIN_ORDER = PREFIX.concat("order:");//用户sku购买数量 key:$orderId
public static final String REDIS_GOBLIN_ORDER_BACK = PREFIX.concat("order:back:");//用户sku购买数量 key:$backOrderId
public static final String REDIS_GOBLIN_ORDER_SKU = PREFIX.concat("orderSku:");//用户sku购买数量 key:$orderSkuId
public static final String REDIS_GOBLIN_ORDER_UN_PAY = PREFIX.concat("order:un:pay:");//未支付订单id列表 key:$randomKey
public static final String REDIS_GOBLIN_ORDER_LIST = PREFIX.concat("order:id:list:");//用户订单id列表 key:$uid
public static final String REDIS_GOBLIN_ORDER_ZHENGZAI_LIST = PREFIX.concat("order:zhengzai:list:");//用户订单id列表 key:$uid
public static final String REDIS_GOBLIN_ORDER_MASTER = PREFIX.concat("order:masterCode:");//用户订单id列表 key:$masterCode
public static final String REDIS_GOBLIN_ORDER_OFFCODE = PREFIX.concat("order:offCode:");//用户订单id列表 key:$wtrieOffCode
public static final String REDIS_GOBLIN_BACK_ORDER_ID = PREFIX.concat("order:backIds:");//用户订单下的退款订单id key:$orderId
public static final String REDIS_CAN_BUY = PREFIX.concat("canBuy:");//可以购买的用户 key:$skuId:$mobile
public static final String REDIS_ZZ_MUSIC_TAG = PREFIX.concat("music:tag:ZZ:");//根据场次音乐人标签搜索列表 key:$musicTag:$performanceId
public static final String REDIS_GOBLIN_MAIL = PREFIX.concat("mail:orderId:");//快递 $key:$orderId
public static final String REDIS_GOBLIN_TEMP_COUPON_MARKET = PREFIX.concat("temp:coupon:marketId:");//id 列表 $key:$marketId
public static final String REDIS_GOBLIN_TEMP_COUPON = PREFIX.concat("temp:coupon:");//详情 $key:$ucouponId
/* ----------------------------------------------------------------- */
/**
* SKU剩余库存
*/
public static final String REAL_STOCK_SKU = PREFIX.concat("real_stock_sku:");
public static final String SKU_RELATION = PREFIX.concat("sku:relation:");//$key:$skuId
/* ----------------------------------------------------------------- */
/**
* 商铺活动:优惠券基本信息
* {goblin:s_coupon:${store_coupon_id}, com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponVo}
*/
public static final String STORE_COUPON = PREFIX.concat("s_coupon:");
/**
* 商铺活动:优惠券适用商品ID集合
* {goblin:s_coupon_r:${store_coupon_id}, JsonUtils.toJson(List<String:spu_id>)}
*/
public static final String STORE_COUPON_RULE = PREFIX.concat("s_coupon_r:");
/**
* 商铺活动:优惠券剩余库存
*/
public static final String STORE_COUPON_STOCK = PREFIX.concat("s_coupon_stock:");
/* ----------------------------------------------------------------- */
/**
* 商铺活动ID集合
* {goblin:store_markets:${store_id}, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.GoblinGoodsMarketDto>)}
*/
public static final String STORE_MARKETS = PREFIX.concat("store_markets:");
/* ----------------------------------------------------------------- */
/**
* 商城用户券
* {golblin:user_coupon:${uid}, JsonUtils.toJson(List<com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo>)}
*/
public static final String USER_COUPON = PREFIX.concat("user_coupon:");
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
}
package com.liquidnet.service.goblin.constant;
public class GoblinStatusConst {
/* ----------------------------------------------------------------- */
public enum CommonStatus {
COMMON_LIMIT_UN(0, "不限购"),
COMMON_TYPE_ALL(0, "购买条件-全部用户"),
COMMON_TYPE_MEMBER(1, "购买条件-会员用户"),
COMMON_TYPE_CAN(2, "购买条件-指定用户"),
;
private final int value;
private final String desc;
CommonStatus(int value, String desc) {
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
public enum Status {
ORDER_STATUS_0(0, "待付款(用户刚下单)"),
ORDER_STATUS_2(2, "代发货(用户付完款 等待商城发货)"),
ORDER_STATUS_3(3, "代收货(商城已经发货 等待用户确认收货)"),
ORDER_STATUS_4(4, "已完成(用户已经确认收货 订单结束)"),
ORDER_STATUS_5(5, "取消订单(用户未付款前取消订单)"),
ORDER_STATUS_6(6, "退款通过(用户已经付款但是商城还未发货,用户发出退款申请,商城同意退款)"),
ORDER_STATUS_7(7, "退货通过(用户已经确认收货后用户发出退货申请,商城同意所有退货申请 ,一个订单可能有多个单品)"),
ORDER_STATUS_61(61, "发起-退款(用户已经付款但是商城还未发货,用户发出退款申请,商城同意退款)"),
ORDER_STATUS_71(71, "发起-退货(用户已经确认收货后用户发出退货申请,商城同意所有退货申请 ,一个订单可能有多个单品)"),
ORDER_LOG_STATUS_11(11, "确认付款"),
ORDER_LOG_STATUS_12(12, "修改金额"),
ORDER_LOG_STATUS_13(13, "发货"),
ORDER_LOG_STATUS_14(14, "取消订单"),
ORDER_LOG_STATUS_15(15, "修改物流单号"),
ORDER_LOG_STATUS_16(16, "核销虚拟商品订单"),
ORDER_LOG_STATUS_17(17, "修改收货地址"),
ORDER_LOG_STATUS_20(20, "商家发起退款"),
ORDER_LOG_STATUS_201(201, "商家同意退款"),
ORDER_LOG_STATUS_21(21, "退款申请"),
ORDER_LOG_STATUS_22(22, "退款成功"),
ORDER_LOG_STATUS_23(23, "退款拒绝"),
ORDER_LOG_STATUS_24(24, "退货申请"),
ORDER_LOG_STATUS_25(25, "退货拒绝"),
ORDER_LOG_STATUS_26(26, "退货审核通过等待用户填写物流"),
ORDER_LOG_STATUS_27(27, "待收货"),
ORDER_LOG_STATUS_28(28, "退货完成"),
ORDER_LOG_STATUS_29(29, "退款拒绝"),
ORDER_BACK_STATUS_0(0, "商家发起退款(退款中)"),
ORDER_BACK_STATUS_1(1, "退款申请(用户发送退款请求)"),
ORDER_BACK_STATUS_2(2, "退款成功(商家同意退款)"),
ORDER_BACK_STATUS_3(3, "退款拒绝(商家拒绝退款)"),
ORDER_BACK_STATUS_4(4, "退货申请(用户发起退货请求)"),
ORDER_BACK_STATUS_5(5, "退货拒绝(商家拒绝退货)"),
ORDER_BACK_STATUS_6(6, "退货审核通过等待用户填写物流"),
ORDER_BACK_STATUS_7(7, "待收货(退货中)"),
ORDER_BACK_STATUS_8(8, "退货完成"),
ORDER_BACK_STATUS_9(9, "退款拒绝"),
ORDER_BACK_STATUS_10(10, "退款失败"),
ORDER_BACK_STATUS_11(11, "取消退款"),
;
private final int value;
private final String desc;
Status(int value, String desc) {
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
public enum Type {
OPERATION_TYPE_1(1, "用户"),
OPERATION_TYPE_2(2, "商家"),
BACK_REASON_TYPE_1(1, "不想买了"),
BACK_REASON_TYPE_2(2, "收货人信息有误"),
BACK_REASON_TYPE_3(3, "未按指定时间发货"),
BACK_REASON_TYPE_4(4, "其他"),
BACK_REASON_TYPE_5(5, "不想买了"),
BACK_REASON_TYPE_6(6, "商品质量问题"),
BACK_REASON_TYPE_7(7, "收到商品与描述不符"),
BACK_REASON_TYPE_8(8, "商铺发起"),//todo
BACK_REASON_TYPE_9(9, "系统自动申请"),
BACK_TYPE_1(1, "退款"),
BACK_TYPE_2(2, "退货"),
;
private final int value;
private final String desc;
Type(int value, String desc) {
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
public enum MarketingStatus {
SELF_TYPE_ZHENGZAI(1, "正在下单"),
STORE_TYPE_PURCHASE(2, "限时秒杀"),
STORE_PURCHASE_STATUS_ALL(-1, "全部"),
STORE_PURCHASE_STATUS_UN_START(0, "等待开始"),
STORE_PURCHASE_STATUS_ING_START(1, "活动中"),
STORE_PURCHASE_STATUS_END_START(2, "活动结束"),
STORE_PURCHASE_STATUS_STOP(7, "停用"),
;
private final int value;
private final String desc;
MarketingStatus(int value, String desc) {
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
public enum MarketPreStatus {
MARKET_PRE_ZHENGZAI("ZZ", "正在下单前缀"),
MARKET_PRE_PURCHASE("PC", "限时秒杀前缀"),
;
private final String value;
private final String desc;
MarketPreStatus(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
public static String getPre(String goblinId) {
if (goblinId.contains(MARKET_PRE_ZHENGZAI.getValue())) {
return MARKET_PRE_ZHENGZAI.getValue();
} else if (goblinId.contains(MARKET_PRE_PURCHASE.getValue())) {
return MARKET_PRE_PURCHASE.getValue();
}
return null;
}
}
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
}
package com.liquidnet.service.goblin.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@ApiModel(value = "GoblinGoodsSpecDto", description = "商品SKU规格")
@Data
public class GoblinGoodsSpecDto implements Serializable, Cloneable {
private static final long serialVersionUID = 8425727558228094904L;
@ApiModelProperty(position = 11, value = "规格名称")
@NotBlank(message = "规格名称不能为空")
private String specName;
@ApiModelProperty(position = 11, value = "规格值名称")
@NotBlank(message = "规格值不能为空")
private String specVname;
private static final GoblinGoodsSpecDto obj = new GoblinGoodsSpecDto();
public static GoblinGoodsSpecDto getNew() {
try {
return (GoblinGoodsSpecDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinGoodsSpecDto();
}
}
}
package com.liquidnet.service.goblin.dto.manage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
@ApiModel(value = "AddressVo")
@Data
public class AddressVo {
@ApiModelProperty(value = "收货人姓名")
private String name;
@ApiModelProperty(value = "代理id")
private String province;
@ApiModelProperty(value = "省份行政编码")
private String county;
@ApiModelProperty(value = "城市")
private String city;
@ApiModelProperty(value = "收货地址")
private String address;
@ApiModelProperty(value = "区县")
private String phone;
@ApiModelProperty(value = "区县行政编码")
private String countyId;
}
package com.liquidnet.service.goblin.dto.manage.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@ApiModel(value = "GoblinMgtCategorySpecVo", description = "分类关联的规格信息")
@Data
public class GoblinMgtCategorySpecVo implements Serializable, Cloneable {
private static final long serialVersionUID = -1807588898644126000L;
@ApiModelProperty(position = 11, value = "分类ID")
private String cateId;
@ApiModelProperty(position = 13, value = "规格名称List")
private List<String> specNameList;
public GoblinMgtCategorySpecVo setCateId(String cateId) {
this.cateId = cateId;
return this;
}
public GoblinMgtCategorySpecVo setSpecNameList(List<String> specNameList) {
this.specNameList = specNameList;
return this;
}
private static final GoblinMgtCategorySpecVo obj = new GoblinMgtCategorySpecVo();
public static GoblinMgtCategorySpecVo getNew() {
try {
return (GoblinMgtCategorySpecVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinMgtCategorySpecVo();
}
}
}
package com.liquidnet.service.goblin.dto.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.List;
@Data
@EqualsAndHashCode
public class ArDataVo implements Cloneable {
@ApiModelProperty(position = 1, value = "Spuvo")
private List<GoblinGoodsInfoVo> goodsInfoVos;
@ApiModelProperty(position = 2, value = "券vo")
private List<TempCouponVo> tempCouponVos;
private static final ArDataVo obj = new ArDataVo();
public static ArDataVo getNew() {
try {
return (ArDataVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new ArDataVo();
}
}
}
package com.liquidnet.service.goblin.enums;
/**
* 店铺配置信息
*
* @author zhanggb
* Created by IntelliJ IDEA at 2022/1/12
*/
public enum GoblinStoreConf {
/**
* 状态:营业状态
* 同步`GoblinStoreInfoVo.status`
*/
BUSINESS_STATUS,
/**
* 开关:联系客服
*/
ONOFF_CUSTOMER_SEV,
/**
* 开关:售罄展示
*/
ONOFF_SOLD_OUT_SHOW,
/**
* 指标:库存不足
*/
LIMIT_WARNING_STOCK,
}
package com.liquidnet.service.goblin.param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Api
public class BackCouponParam implements Serializable, Cloneable {
@ApiModelProperty(dataType = "String", name = "uCouponIds", value = "券唯一表示id(逗号隔开的字符串)",example = "1",required = true)
@NotNull @NotBlank
private String uCouponIds;
@ApiModelProperty(dataType = "String", name = "uid", value = "用户id",example = "10",required = true)
@NotNull @NotBlank
private String uid;
private static final BackCouponParam obj = new BackCouponParam();
public static BackCouponParam getNew() {
try {
return (BackCouponParam) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new BackCouponParam();
}
public String getuCouponIds() {
return uCouponIds;
}
public void setuCouponIds(String uCouponIds) {
this.uCouponIds = uCouponIds;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
}
package com.liquidnet.service.goblin.service;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponVo;
import com.liquidnet.service.goblin.dto.vo.GoblinUseResultVo;
import com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo;
import com.liquidnet.service.goblin.param.BackCouponParam;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public interface GoblinCouponService {
//根据spuId获取 该spu可参与的券活动
ArrayList<String> getSpuType(String spuId, String storeId);
//获取 类型券列表
ArrayList<GoblinStoreCouponVo> getSpuByType(String spuId, String storeId, String type);
//领取券
Boolean receiveCoupon(String uid, List<GoblinUserCouponVo> userCouponVoList, GoblinStoreCouponVo storeCouponVo);
//我的券列表 [类型 1可用 2过期/已使用]
List<GoblinUserCouponVo> getList(String type);
//是否可用券 [价格] [spuId逗号隔开] [uid]
GoblinUserCouponVo canUse(BigDecimal totalPrice, String spuId, String uid,String storeId);
//可用券列表 [价格] [spuId逗号隔开] [uid]
List<GoblinUserCouponVo> useList(BigDecimal totalPrice, String spuId, String uid);
//使用券 [券id] [消费内容] [价格] [spuId逗号隔开]
GoblinUseResultVo useCoupon(String ucouponId,String content, BigDecimal totalPrice, String spuId, String uid);
//回退券 [list<Data>] [券id , 用户id]
Boolean backCoupon(List<BackCouponParam> params);
}
package com.liquidnet.service.goblin.service.manage;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiCommonParam;
import com.liquidnet.service.goblin.dto.vo.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.List;
public interface IGoblinInnerService {
ResponseDto<String> insertCoupon(MultipartFile file, String performanceId);
ResponseDto<ArDataVo> getArData(String tag, String performanceId);
ResponseDto<TempCouponVo> getTempCouponData(String ucouponId);
}
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<module>liquidnet-service-slime-api</module> <module>liquidnet-service-slime-api</module>
<module>liquidnet-service-stone-api</module> <module>liquidnet-service-stone-api</module>
<module>liquidnet-service-goblin-api</module> <module>liquidnet-service-goblin-api</module>
<module>liquidnet-service-smile-api</module>
</modules> </modules>
<dependencies> <dependencies>
<dependency> <dependency>
......
server:
port: ${liquidnet.info.port}
tomcat:
uri-encoding: UTF-8
maxThreads: 2000 #默认200
minSpareThreads: 200 #默认10
maxConnections: 20000 #默认10000
acceptCount: 5000 #默认100
processorCache: -1 #默认200
servlet:
context-path: ${liquidnet.info.context}
# -----------------------------------------------------------
knife4j:
enable: true
production: ${liquidnet.knife4j.disable}
basic:
enable: true
username: ${liquidnet.security.username}
password: ${liquidnet.security.password}
# -----------------------------------------------------------
logging:
# config: ${liquidnet.logfile.config}
file:
name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}.log
max-size: ${liquidnet.logfile.file-max-size}
pattern:
file: '%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %X{lnsTranceId} [%logger{56}:%line] - %msg%n'
console: '%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %X{lnsTranceId} [%logger{56}:%line] - %msg%n'
rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level:
root: error
#以下是为指定包设置日志级别
com.liquidnet.service.feign: error
com.liquidnet: ${liquidnet.logfile.level}
# -----------------------------------------------------------
eureka:
# client:
# register-with-eureka: true
# fetch-registry: true
# serviceUrl:
# defaultZone: http://${liquidnet.security.username}:${liquidnet.security.password}@${liquidnet.eureka.host}/eureka-server/eureka
instance:
hostname: ${spring.cloud.client.ip-address}
lease-expiration-duration-in-seconds: 15 #服务过期时间配置,超过这个时间没有接收到心跳EurekaServer就会将这个实例剔除
lease-renewal-interval-in-seconds: 5 #服务刷新时间配置,每隔这个时间会主动心跳一次
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${spring.application.instance_id:${server.port}}
# -----------------------------------------------------------
#actuator/info
info:
app:
name: ${liquidnet.info.name}
company:
name: zhengzai.tv
build:
groupId: '@project.groupId@'
artifactId: '@project.artifactId@'
version: '@project.version@'
# -----------------------------------------------------------
mybatis-plus:
mapper-locations: classpath:com.liquidnet.service.smile.mapper/*Mapper.xml
# -----------------------------------------------------------
spring:
application:
name: ${liquidnet.info.name}
servlet:
multipart:
max-file-size: 5MB
max-request-size: 10MB
profiles:
include: common-service #这里加载management相关公共配置
autoconfigure:
exclude:
- org.springframework.cloud.bus.BusAutoConfiguration
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
redis:
database: 15
dbs: ${liquidnet.redis.smile.dbs}
port: ${liquidnet.redis.smile.port}
host: ${liquidnet.redis.smile.host}
password: ${liquidnet.redis.smile.password}
lettuce:
pool:
max-active: 16
max-wait: -1
max-idle: 8
min-idle: 4
data:
mongodb:
uri: mongodb://${liquidnet.mongodb.user}:${liquidnet.mongodb.pwd}@${liquidnet.mongodb.host}/?authSource=admin&maxPoolSize=200&waitQueueMultiple=100
sslEnabled: ${liquidnet.mongodb.sslEnabled}
database: ${liquidnet.mongodb.database}
# -----------------------------------------------------------
# -----------------------------------------------------------
global-auth:
exclude-url-pattern:
- ${liquidnet.info.context}/doc.html
- ${liquidnet.info.context}/webjars/**
- ${liquidnet.info.context}/swagger-resources/**
- ${liquidnet.info.context}/v2/api-docs*
- ${liquidnet.info.context}/inner/**
oncheck-url-pattern:
-
# -----------------------------------------------------------
# -----------------------------------------------------------
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-service-smile</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-service-smile-impl</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-swagger</artifactId>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<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>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.liquidnet.service;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import java.util.ArrayList;
import java.util.List;
public class MybatisPlusCodeGenerator {
/**
* @param moduleRootPath 项目模块根路径 到 /src 之前 ex:E:\projects\trlabs-bus-v1\trlabs-bus-service\trlabs-common\trlabs-mybatis
* @param dsc 数据源
* @param parentName 相当于业务模块名 com.liquidnet.service.adam 全限定类名
* @param tableNames 表名
*/
public static void doGenerator(String moduleRootPath,
DataSourceConfig dsc,
String parentName,
String[] tableNames) {
AutoGenerator mpg = new AutoGenerator();
// 全局配置BankMybatisPlusCodeGenerator
GlobalConfig gc = new GlobalConfig();
gc.setOutputDir(moduleRootPath + "/src/main/java");
gc.setAuthor("liquidnet");
gc.setOpen(false);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg.setGlobalConfig(gc);
// 数据源配置
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setParent(parentName);
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
// 自定义配置会被优先输出
focList.add(new FileOutConfig(templatePath) {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
return moduleRootPath + "/src/main/resources/com/liquidnet/service/goblin/mapper/" + pc.getModuleName()
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
templateConfig.setXml(null);
mpg.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
// strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
strategy.setInclude(tableNames);
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix(pc.getModuleName() + "_");
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
public static void main(String[] args) {
DataSourceConfig dsc = new DataSourceConfig();
// dsc.setSchemaName("public");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUrl("jdbc:mysql://39.107.71.112:3308/dev_ln_scene?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=CST");
dsc.setUsername("testmall");
dsc.setPassword("zhengzai!mYT");
String resourcePath = "/Users/hujiachen/Downloads/tmp";
String directory = "com.liquidnet.service.goblin";
String[] dbTableArray = new String[]{
"goblin_marketing_zhengzai_relation"
};
doGenerator(resourcePath, dsc, directory, dbTableArray);
}
}
package com.liquidnet.service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.core.env.Environment;
import java.net.InetAddress;
import java.util.Arrays;
@Slf4j
@EnableFeignClients
@SpringBootApplication(scanBasePackages = {"com.liquidnet"})
public class ServiceGoblinApplication implements CommandLineRunner {
@Autowired
private Environment environment;
public static void main(String[] args) {
SpringApplication.run(ServiceGoblinApplication.class, args);
}
@Override
public void run(String... strings) {
try {
log.info("\n----------------------------------------------------------\n\t" +
"Application '{}' is running! Access URLs:\n\t" +
"Local: \t\thttp://127.0.0.1:{}\n\t" +
"External: \thttp://{}:{}{}/doc.html\n\t" +
"Profile(s): \t{}\n----------------------------------------------------------",
environment.getProperty("spring.application.name"),
environment.getProperty("server.port"),
InetAddress.getLocalHost().getHostAddress(),
environment.getProperty("server.port"),
environment.getProperty("server.servlet.context-path"),
Arrays.toString(environment.getActiveProfiles()));
} catch (Exception e) {
e.printStackTrace();
}
}
}
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.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);
}
}
spring:
application:
name: liquidnet-service-smile
profiles:
active: dev
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
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