提交
This commit is contained in:
parent
0ac0ea05e3
commit
ca865242f3
@ -45,7 +45,7 @@ spring:
|
||||
host: 127.0.0.1 #地址
|
||||
port: 6379 #端口
|
||||
timeout: 10000 # 连接超时时间(毫秒)
|
||||
database: 3 #默认数据库
|
||||
database: 10 #默认数据库
|
||||
jedis:
|
||||
pool:
|
||||
max-active: 200 # 连接池最大连接数(使用负值表示没有限制)
|
||||
|
@ -351,6 +351,7 @@ public class Constants {
|
||||
public static final String ORDER_STATUS_ALL = "all"; //所有
|
||||
public static final String ORDER_STATUS_UNPAID = "unPaid"; //未支付
|
||||
public static final String ORDER_STATUS_NOT_SHIPPED = "notShipped"; //未发货
|
||||
public static final String ORDER_STATUS_PREPARE_ING = "prepareIng"; //备货中
|
||||
public static final String ORDER_STATUS_SPIKE = "spike"; //待收货
|
||||
public static final String ORDER_STATUS_BARGAIN = "bargain"; //已收货待评价
|
||||
public static final String ORDER_STATUS_COMPLETE = "complete"; //交易完成
|
||||
@ -362,6 +363,7 @@ public class Constants {
|
||||
|
||||
public static final String ORDER_STATUS_STR_UNPAID = "未支付"; //未支付
|
||||
public static final String ORDER_STATUS_STR_NOT_SHIPPED = "未发货"; //未发货
|
||||
public static final String ORDER_STATUS_STR_PREPARE_ING = "备货中"; //未发货
|
||||
public static final String ORDER_STATUS_STR_SPIKE = "待收货"; //待收货
|
||||
public static final String ORDER_STATUS_STR_BARGAIN = "待评价"; //已收货待评价
|
||||
public static final String ORDER_STATUS_STR_TAKE = "用户已收货"; //用户已收货
|
||||
@ -378,7 +380,8 @@ public class Constants {
|
||||
public static final int ORDER_STATUS_H5_SPIKE = 2; // 待收货
|
||||
public static final int ORDER_STATUS_H5_JUDGE = 3; // 待评价
|
||||
public static final int ORDER_STATUS_H5_COMPLETE = 4; // 已完成
|
||||
public static final int ORDER_STATUS_H5_VERIFICATION = 5; // 待核销
|
||||
public static final int ORDER_STATUS_H5_PREPARE_ING = 5; // 备货中
|
||||
|
||||
public static final int ORDER_STATUS_H5_REFUNDING = -1; // 退款中
|
||||
public static final int ORDER_STATUS_H5_REFUNDED = -2; // 已退款
|
||||
public static final int ORDER_STATUS_H5_REFUND = -3; // 退款
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.zbkj.common.model.deliveryset;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@ -15,7 +16,7 @@ public class DeliverySetTime implements Serializable {
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 预约配送天数
|
||||
|
@ -18,7 +18,7 @@ public class Home implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 名称
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.zbkj.common.model.home;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@ -15,7 +16,7 @@ public class HomeProducts implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 楼层编号
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.zbkj.common.model.order;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@ -150,9 +149,6 @@ public class StoreOrder implements Serializable {
|
||||
@ApiModelProperty(value = "成本价")
|
||||
private BigDecimal cost;
|
||||
|
||||
@ApiModelProperty(value = "茶果兑换商品ID")
|
||||
private Integer fruitExchangeId;
|
||||
|
||||
@ApiModelProperty(value = "秒杀商品ID")
|
||||
private Integer seckillId;
|
||||
|
||||
|
@ -61,6 +61,9 @@ public class StoreOrderInfo implements Serializable {
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "商品优惠金额")
|
||||
private BigDecimal couponPrice;
|
||||
|
||||
@ApiModelProperty(value = "购买数量")
|
||||
private Integer payNum;
|
||||
|
||||
@ -84,4 +87,7 @@ public class StoreOrderInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "商品类型:0-普通,1-秒杀,2-砍价,3-拼团,4-视频号")
|
||||
private Integer productType;
|
||||
|
||||
@ApiModelProperty(value = "预约送达时间")
|
||||
private String deliveryTime;
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
package com.zbkj.common.model.order;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@TableName("eb_store_order_return")
|
||||
public class StoreOrderReturn implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 联系人电话
|
||||
*/
|
||||
private String contactPhone;
|
||||
/**
|
||||
* 退款审核时间
|
||||
*/
|
||||
private Date returnVerifyDate;
|
||||
/**
|
||||
* 退款原因
|
||||
*/
|
||||
private String returnReason;
|
||||
/**
|
||||
* 退款图片
|
||||
*/
|
||||
private String returnImage;
|
||||
/**
|
||||
* 申请退款失败原因
|
||||
*/
|
||||
private String refundVerifyFailReason;
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private BigDecimal returnAmount;
|
||||
/**
|
||||
* 1退款审核中 2审核通过 3审核拒绝 4退款失败
|
||||
*/
|
||||
private Integer returnState;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private List<StoreOrderReturnInfo> returnInfos;
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.zbkj.common.model.order;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("eb_store_order_return_info")
|
||||
public class StoreOrderReturnInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 退款表id
|
||||
*/
|
||||
private Integer returnId;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Integer productId;
|
||||
/**
|
||||
* 规格属性值id
|
||||
*/
|
||||
private Integer attrValueId;
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer returnNum;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.zbkj.common.model.product;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@ -15,7 +16,7 @@ public class ReviewTag implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 标签名
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.zbkj.common.model.product;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@ -15,7 +16,7 @@ public class ReviewTagCategory implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 标签id
|
||||
|
@ -88,4 +88,7 @@ public class StoreProductReply implements Serializable {
|
||||
@ApiModelProperty(value = "商品评论标签id,多个,号隔开")
|
||||
private String reviewTags;
|
||||
|
||||
@ApiModelProperty(value = "是否匿名 0否,1是")
|
||||
private Integer isPrivacy = 0;
|
||||
|
||||
}
|
||||
|
@ -14,11 +14,12 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class GetProductReply {
|
||||
|
||||
@ApiModelProperty(value = "商品attrid")
|
||||
@NotBlank(message = "商品uniId不能为空")
|
||||
private String uni;
|
||||
// @ApiModelProperty(value = "商品attrid")
|
||||
// @NotBlank(message = "商品uniId不能为空")
|
||||
// private String uni;
|
||||
|
||||
@ApiModelProperty(value = "订单id")
|
||||
@NotNull(message = "订单id不能为空")
|
||||
private Integer orderId;
|
||||
@NotNull(message = "订单号不能为空")
|
||||
private String orderNo;
|
||||
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class OrderComputedPriceRequest {
|
||||
|
||||
@ApiModelProperty(value = "快递类型: 1-快递配送,2-到店自提,3-骑手配送")
|
||||
@NotNull(message = "快递类型不能为空")
|
||||
@Range(min = 1, max = 2, message = "未知的快递类型")
|
||||
@Range(min = 1, max = 3, message = "未知的快递类型")
|
||||
private Integer shippingType;
|
||||
|
||||
@ApiModelProperty(value = "是否使用积分")
|
||||
|
@ -12,6 +12,7 @@ import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 添加购物车参数Request对象
|
||||
@ -24,23 +25,27 @@ import javax.validation.constraints.NotNull;
|
||||
public class OrderRefundApplyRequest {
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "订单id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "待退款订单", required = true)
|
||||
@NotNull(message = "待退款订单 不能为空")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "退款原因", required = true)
|
||||
@NotNull(message = "退款原因必须填写")
|
||||
@Length(max = 255, message = "退款原因不能超过255个字符")
|
||||
private String text;
|
||||
|
||||
@ApiModelProperty(value = "订单id", required = true)
|
||||
private Integer id;
|
||||
private String returnReason;
|
||||
|
||||
@ApiModelProperty(value = "退款凭证图片(多个图片请用,(英文逗号)隔开)")
|
||||
@JsonProperty("refund_reason_wap_img")
|
||||
private String reasonImage;
|
||||
@JsonProperty("return_image")
|
||||
private String returnImage;
|
||||
|
||||
@ApiModelProperty(value = "备注说明")
|
||||
@JsonProperty("refund_reason_wap_explain")
|
||||
private String explain;
|
||||
@ApiModelProperty(value = "联系人电话", required = true)
|
||||
@NotNull(message = "联系人电话 不能为空")
|
||||
private String contactPhone;
|
||||
|
||||
@ApiModelProperty(value = "退款商品", required = true)
|
||||
private List<OrderRefundInfoRequest> returnInfo;
|
||||
|
||||
@ApiModelProperty(value = "待退款订单")
|
||||
@NotNull(message = "待退款订单 不能为空")
|
||||
private String uni;
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.zbkj.common.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="OrderRefundInfoRequest对象", description="OrderRefundInfoRequest对象")
|
||||
public class OrderRefundInfoRequest {
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "商品编号", required = true)
|
||||
@NotNull(message = "商品不能为空")
|
||||
private Integer productId;
|
||||
|
||||
@ApiModelProperty(value = "商品编号", required = true)
|
||||
@NotNull(message = "商品不能为空")
|
||||
private String unique;
|
||||
|
||||
@ApiModelProperty(value = "退款数量", required = true)
|
||||
@NotNull(message = "退款数量不能为空")
|
||||
private Integer returnNum;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.zbkj.common.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="RefundComputedPriceRequest对象", description="RefundComputedPriceRequest对象")
|
||||
public class RefundComputedRequest {
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "待退款订单", required = true)
|
||||
@NotNull(message = "待退款订单 不能为空")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "退款商品", required = true)
|
||||
private List<OrderRefundInfoRequest> returnInfo;
|
||||
|
||||
}
|
@ -32,4 +32,5 @@ public class StoreOrderRefundRequest {
|
||||
private BigDecimal amount;
|
||||
|
||||
private Integer orderId;
|
||||
|
||||
}
|
||||
|
@ -30,8 +30,8 @@ public class StoreOrderSearchRequest implements Serializable {
|
||||
@ApiModelProperty(value = "创建时间区间")
|
||||
private String dateLimit;
|
||||
|
||||
@ApiModelProperty(value = "订单状态(all 总数; 未支付 unPaid; 未发货 notShipped;待收货 spike;待评价 bargain;已完成 complete;待核销 toBeWrittenOff;退款中:refunding;已退款:refunded;已删除:deleted")
|
||||
@StringContains(limitValues = {"all","unPaid","notShipped","spike","bargain","complete","toBeWrittenOff","refunding","refunded","deleted"}, message = "未知的订单状态")
|
||||
@ApiModelProperty(value = "订单状态(all 总数; 未支付 unPaid; 未发货 notShipped;备货中 prepareIng; 待收货 spike;待评价 bargain;已完成 complete;待核销 toBeWrittenOff;退款中:refunding;已退款:refunded;已删除:deleted")
|
||||
@StringContains(limitValues = {"all","unPaid","notShipped","prepareIng","spike","bargain","complete","toBeWrittenOff","refunding","refunded","deleted"}, message = "未知的订单状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "订单类型:0普通订单,1-视频号订单, 2-全部订单")
|
||||
|
@ -65,4 +65,7 @@ public class StoreProductReplyAddRequest implements Serializable {
|
||||
@ApiModelProperty(value = "商品评论标签,多个,号隔开")
|
||||
private String reviewTags;
|
||||
|
||||
@ApiModelProperty(value = "是否匿名 0否,1是")
|
||||
private Integer isPrivacy = 0;
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ public class ComputedOrderPriceResponse implements Serializable {
|
||||
private static final long serialVersionUID = 7282892323898493847L;
|
||||
|
||||
@ApiModelProperty(value = "优惠券优惠金额")
|
||||
private BigDecimal couponFee;
|
||||
private BigDecimal couponFee = BigDecimal.ZERO;
|
||||
|
||||
@ApiModelProperty(value = "积分抵扣金额")
|
||||
private BigDecimal deductionPrice;
|
||||
|
@ -30,7 +30,6 @@ public class OrderDetailResponse implements Serializable {
|
||||
private String statusPic;
|
||||
private Integer offlinePayStatus;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "订单id")
|
||||
private Integer id;
|
||||
|
||||
@ -49,6 +48,9 @@ public class OrderDetailResponse implements Serializable {
|
||||
@ApiModelProperty(value = "支付金额")
|
||||
private BigDecimal payPrice;
|
||||
|
||||
@ApiModelProperty(value = "优惠金额")
|
||||
private BigDecimal couponPrice;
|
||||
|
||||
@ApiModelProperty(value = "订单状态(0:待发货;1:待收货;2:已收货,待评价;3:已完成;)")
|
||||
private Integer status;
|
||||
|
||||
|
@ -53,4 +53,8 @@ public class OrderInfoResponse implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "规格属性值")
|
||||
private String sku;
|
||||
|
||||
@ApiModelProperty(value = "商品优惠金额")
|
||||
private BigDecimal couponPrice;
|
||||
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public class OrderReplyListResponse implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "订单编号")
|
||||
private String orderId;
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
@ -25,8 +25,8 @@ public class ProductProblemResponse {
|
||||
@ApiModelProperty(value = "用户昵称")
|
||||
private String nickName;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称")
|
||||
private String imageUrl;
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
private String avatar;
|
||||
|
||||
@ApiModelProperty(value = "时间")
|
||||
private String createTime;
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.zbkj.common.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="RefundComputedResponse对象", description="RefundComputedResponse对象")
|
||||
public class RefundComputedResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7282892323898493847L;
|
||||
|
||||
@ApiModelProperty(value = "退款金额")
|
||||
private String returnAmount;
|
||||
|
||||
}
|
@ -26,7 +26,7 @@ public class StoreOrderCountItemResponse implements Serializable {
|
||||
@ApiModelProperty(value = "未支付")
|
||||
private Integer unPaid;
|
||||
|
||||
@ApiModelProperty(value = "未发货")
|
||||
@ApiModelProperty(value = "待发货")
|
||||
private Integer notShipped;
|
||||
|
||||
@ApiModelProperty(value = "待收货")
|
||||
@ -38,6 +38,9 @@ public class StoreOrderCountItemResponse implements Serializable {
|
||||
@ApiModelProperty(value = "交易完成")
|
||||
private Integer complete;
|
||||
|
||||
@ApiModelProperty(value = "备货中")
|
||||
private Integer prepareIng;
|
||||
|
||||
@ApiModelProperty(value = "待核销")
|
||||
private Integer toBeWrittenOff;
|
||||
|
||||
|
@ -30,8 +30,8 @@ public class OrderInfoDetailVo {
|
||||
/** 单价 */
|
||||
private BigDecimal price;
|
||||
|
||||
/** 茶果兑换id*/
|
||||
private Integer fruitExchangeId;
|
||||
/** 优惠金额*/
|
||||
private BigDecimal couponPrice;
|
||||
|
||||
/** 购买数量 */
|
||||
private Integer payNum;
|
||||
|
@ -79,12 +79,31 @@ public class ProductController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品评论列表
|
||||
* 商品规格详情
|
||||
*/
|
||||
@ApiOperation(value = "商品评论列表")
|
||||
@RequestMapping(value = "/reply/list", method = RequestMethod.GET)
|
||||
public CommonResult<CommonPage<ProductReplyResponse>> getReplyList(@Validated GetReplyListRequest request, @Validated PageParamRequest pageParamRequest) {
|
||||
return CommonResult.success(CommonPage.restPage(productService.getReplyList(request, pageParamRequest)));
|
||||
@ApiOperation(value = "商品规格详情")
|
||||
@RequestMapping(value = "/product/sku/detail/{id}", method = RequestMethod.GET)
|
||||
public CommonResult<ProductDetailResponse> getSkuDetail(@PathVariable Integer id) {
|
||||
return CommonResult.success(productService.getSkuDetail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
@ApiOperation(value = "商品列表(个别分类模型使用)")
|
||||
@RequestMapping(value = "/product/list", method = RequestMethod.GET)
|
||||
public CommonResult<CommonPage<IndexProductResponse>> getProductList(@Validated ProductListRequest request, @Validated PageParamRequest pageParamRequest) {
|
||||
return CommonResult.success(productService.getCategoryProductList(request, pageParamRequest));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 商品详情评论
|
||||
*/
|
||||
@ApiOperation(value = "商品详情评论")
|
||||
@RequestMapping(value = "/reply/product/{id}", method = RequestMethod.GET)
|
||||
public CommonResult<ProductDetailReplyResponse> getProductReply(@PathVariable Integer id) {
|
||||
return CommonResult.success(productService.getProductReply(id));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -97,30 +116,12 @@ public class ProductController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品详情评论
|
||||
* 商品评论列表
|
||||
*/
|
||||
@ApiOperation(value = "商品详情评论")
|
||||
@RequestMapping(value = "/reply/product/{id}", method = RequestMethod.GET)
|
||||
public CommonResult<ProductDetailReplyResponse> getProductReply(@PathVariable Integer id) {
|
||||
return CommonResult.success(productService.getProductReply(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
@ApiOperation(value = "商品列表(个别分类模型使用)")
|
||||
@RequestMapping(value = "/product/list", method = RequestMethod.GET)
|
||||
public CommonResult<CommonPage<IndexProductResponse>> getProductList(@Validated ProductListRequest request, @Validated PageParamRequest pageParamRequest) {
|
||||
return CommonResult.success(productService.getCategoryProductList(request, pageParamRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品规格详情
|
||||
*/
|
||||
@ApiOperation(value = "商品规格详情")
|
||||
@RequestMapping(value = "/product/sku/detail/{id}", method = RequestMethod.GET)
|
||||
public CommonResult<ProductDetailResponse> getSkuDetail(@PathVariable Integer id) {
|
||||
return CommonResult.success(productService.getSkuDetail(id));
|
||||
@ApiOperation(value = "商品评论列表")
|
||||
@RequestMapping(value = "/reply/list", method = RequestMethod.GET)
|
||||
public CommonResult<CommonPage<ProductReplyResponse>> getReplyList(@Validated GetReplyListRequest request, @Validated PageParamRequest pageParamRequest) {
|
||||
return CommonResult.success(CommonPage.restPage(productService.getReplyList(request, pageParamRequest)));
|
||||
}
|
||||
|
||||
// /**
|
||||
|
@ -11,7 +11,6 @@ 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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -102,7 +101,7 @@ public class StoreOrderController {
|
||||
@ApiOperation(value = "订单列表")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ApiImplicitParams ({
|
||||
@ApiImplicitParam(name = "type", value = "评价等级|null=全部,0=未支付,1=待发货/备货中,2=待收货,3=待评价,4=已完成,-3=售后/退款"),
|
||||
@ApiImplicitParam(name = "type", value = "评价等级|null=全部,0=未支付,1=待发货,2=待收货,3=待评价,4=已完成,5=备货中,-3=售后/退款"),
|
||||
})
|
||||
public CommonResult<CommonPage<OrderDetailResponse>> orderList(@RequestParam(name = "type") Integer type, @ModelAttribute PageParamRequest pageRequest) {
|
||||
return CommonResult.success(orderService.list(type, pageRequest));
|
||||
@ -172,52 +171,34 @@ public class StoreOrderController {
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 查询订单退款理由
|
||||
// * @return 退款理由
|
||||
// */
|
||||
// @ApiOperation(value = "订单退款理由(商家提供)")
|
||||
// @RequestMapping(value = "/refund/reason", method = RequestMethod.GET)
|
||||
// public CommonResult<List<String>> refundReason() {
|
||||
// return CommonResult.success(orderService.getRefundReason());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取申请订单退款信息
|
||||
* @param orderId 订单编号
|
||||
* 根据订单号查询物流信息
|
||||
* @param orderId 订单号
|
||||
* @return 物流信息
|
||||
*/
|
||||
@ApiOperation(value = "获取申请订单退款信息")
|
||||
@RequestMapping(value = "/apply/refund/{orderId}", method = RequestMethod.GET)
|
||||
public CommonResult<ApplyRefundOrderInfoResponse> refundApplyOrder(@PathVariable String orderId) {
|
||||
return CommonResult.success(orderService.applyRefundOrderInfo(orderId));
|
||||
@ApiOperation(value = "物流信息查询")
|
||||
@RequestMapping(value = "/express/{orderId}", method = RequestMethod.GET)
|
||||
public CommonResult<Object> getExpressInfo(@PathVariable String orderId) {
|
||||
return CommonResult.success(orderService.expressOrder(orderId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单退款申请
|
||||
* @param request OrderRefundApplyRequest 订单id
|
||||
* 获取支付配置
|
||||
*/
|
||||
@ApiOperation(value = "订单退款申请")
|
||||
@RequestMapping(value = "/refund", method = RequestMethod.POST)
|
||||
public CommonResult<Boolean> refundApply(@RequestBody @Validated OrderRefundApplyRequest request) {
|
||||
if(orderService.refundApply(request)) {
|
||||
return CommonResult.success();
|
||||
}else{
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单退款理由
|
||||
* @return 退款理由
|
||||
*/
|
||||
@ApiOperation(value = "订单退款理由(商家提供)")
|
||||
@RequestMapping(value = "/refund/reason", method = RequestMethod.GET)
|
||||
public CommonResult<List<String>> refundReason() {
|
||||
return CommonResult.success(orderService.getRefundReason());
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单评价
|
||||
* @param request StoreProductReplyAddRequest 评论参数
|
||||
*/
|
||||
@ApiOperation(value = "评价订单")
|
||||
@RequestMapping(value = "/comment", method = RequestMethod.POST)
|
||||
public CommonResult<Boolean> comment(@RequestBody @Validated StoreProductReplyAddRequest request) {
|
||||
if(orderService.reply(request)) {
|
||||
return CommonResult.success();
|
||||
}else{
|
||||
return CommonResult.failed();
|
||||
}
|
||||
@ApiOperation(value = "获取支付配置")
|
||||
@RequestMapping(value = "get/pay/config", method = RequestMethod.GET)
|
||||
public CommonResult<PreOrderResponse> getPayConfig() {
|
||||
return CommonResult.success(orderService.getPayConfig());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -241,28 +222,22 @@ public class StoreOrderController {
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "待评价商品信息查询")
|
||||
@RequestMapping(value = "/product", method = RequestMethod.POST)
|
||||
public CommonResult<OrderProductReplyResponse> getOrderProductForReply(@Validated @RequestBody GetProductReply request) {
|
||||
@RequestMapping(value = "/orderReply/product", method = RequestMethod.POST)
|
||||
public CommonResult<List<OrderProductReplyResponse>> getOrderProductForReply(@Validated @RequestBody GetProductReply request) {
|
||||
return CommonResult.success(orderService.getReplyProduct(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单号查询物流信息
|
||||
* @param orderId 订单号
|
||||
* @return 物流信息
|
||||
* 订单评价
|
||||
* @param request StoreProductReplyAddRequest 评论参数
|
||||
*/
|
||||
@ApiOperation(value = "物流信息查询")
|
||||
@RequestMapping(value = "/express/{orderId}", method = RequestMethod.GET)
|
||||
public CommonResult<Object> getExpressInfo(@PathVariable String orderId) {
|
||||
return CommonResult.success(orderService.expressOrder(orderId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付配置
|
||||
*/
|
||||
@ApiOperation(value = "获取支付配置")
|
||||
@RequestMapping(value = "get/pay/config", method = RequestMethod.GET)
|
||||
public CommonResult<PreOrderResponse> getPayConfig() {
|
||||
return CommonResult.success(orderService.getPayConfig());
|
||||
@ApiOperation(value = "评价订单")
|
||||
@RequestMapping(value = "/orderReply/comment", method = RequestMethod.POST)
|
||||
public CommonResult<Boolean> comment(@RequestBody @Validated List<StoreProductReplyAddRequest> request) {
|
||||
if(orderService.reply(request)) {
|
||||
return CommonResult.success();
|
||||
}else{
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,55 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.request.*;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.service.service.OrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
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.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController("StoreOrderFrontController")
|
||||
@RequestMapping("api/front/return")
|
||||
@Api(tags = "售后")
|
||||
public class StoreOrderReturnController {
|
||||
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
/**
|
||||
* 获取申请订单退款信息
|
||||
* @param orderId 订单编号
|
||||
*/
|
||||
@ApiOperation(value = "获取申请订单退款信息")
|
||||
@RequestMapping(value = "/refund/{orderId}", method = RequestMethod.GET)
|
||||
public CommonResult<ApplyRefundOrderInfoResponse> refundApplyOrder(@PathVariable String orderId) {
|
||||
return CommonResult.success(orderService.applyRefundOrderInfo(orderId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数计算订单价格
|
||||
*/
|
||||
@ApiOperation(value = "获取退款计算")
|
||||
@RequestMapping(value = "/refund/computedPrice", method = RequestMethod.POST)
|
||||
public CommonResult<RefundComputedResponse> refundComputedPrice(@Validated @RequestBody RefundComputedRequest request) {
|
||||
return CommonResult.success(orderService.refundComputedPrice(request));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 订单退款申请
|
||||
* @param request OrderRefundApplyRequest 订单id
|
||||
*/
|
||||
@ApiOperation(value = "订单退款申请")
|
||||
@RequestMapping(value = "/refund", method = RequestMethod.POST)
|
||||
public CommonResult<Boolean> refundApply(@RequestBody @Validated OrderRefundApplyRequest request) {
|
||||
if(orderService.refundApply(request)) {
|
||||
return CommonResult.success();
|
||||
}else{
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.zbkj.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zbkj.common.model.order.StoreOrderReturn;
|
||||
|
||||
public interface StoreOrderReturnDao extends BaseMapper<StoreOrderReturn> {
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.zbkj.service.dao;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zbkj.common.model.order.StoreOrderReturnInfo;
|
||||
|
||||
public interface StoreOrderReturnInfoDao extends BaseMapper<StoreOrderReturnInfo> {
|
||||
|
||||
}
|
@ -162,6 +162,11 @@ public class OrderUtils {
|
||||
queryWrapper.eq(StoreOrder::getStatus, 2);
|
||||
queryWrapper.eq(StoreOrder::getRefundStatus, 0);
|
||||
break;
|
||||
case Constants.ORDER_STATUS_H5_PREPARE_ING: // 备货中
|
||||
queryWrapper.eq(StoreOrder::getPaid, true);
|
||||
queryWrapper.eq(StoreOrder::getStatus, 4);
|
||||
queryWrapper.eq(StoreOrder::getRefundStatus, 0);
|
||||
break;
|
||||
case Constants.ORDER_STATUS_H5_COMPLETE: // 已完成
|
||||
queryWrapper.eq(StoreOrder::getPaid, true);
|
||||
queryWrapper.eq(StoreOrder::getStatus, 3);
|
||||
|
@ -65,7 +65,7 @@ public interface OrderService {
|
||||
* @param request 请求参数
|
||||
* @return Boolean
|
||||
*/
|
||||
Boolean reply(StoreProductReplyAddRequest request);
|
||||
Boolean reply(List<StoreProductReplyAddRequest> request);
|
||||
|
||||
/**
|
||||
* 订单收货
|
||||
@ -105,7 +105,7 @@ public interface OrderService {
|
||||
* @param getProductReply 订单详情参数
|
||||
* @return 待评价
|
||||
*/
|
||||
OrderProductReplyResponse getReplyProduct(GetProductReply getProductReply);
|
||||
List<OrderProductReplyResponse> getReplyProduct(GetProductReply getProductReply);
|
||||
|
||||
/**
|
||||
* 获取申请订单退款信息
|
||||
@ -148,4 +148,11 @@ public interface OrderService {
|
||||
*/
|
||||
PreOrderResponse getPayConfig();
|
||||
|
||||
/**
|
||||
* 计算退款金额
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
RefundComputedResponse refundComputedPrice(RefundComputedRequest request);
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.zbkj.service.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zbkj.common.model.order.StoreOrder;
|
||||
import com.zbkj.common.request.StoreOrderRefundRequest;
|
||||
|
||||
@ -9,7 +8,8 @@ import com.zbkj.common.request.StoreOrderRefundRequest;
|
||||
* StoreOrderRefundService 接口
|
||||
|
||||
*/
|
||||
public interface StoreOrderRefundService extends IService<StoreOrder> {
|
||||
public interface StoreOrderRefundService {
|
||||
|
||||
void refund(StoreOrderRefundRequest request, StoreOrder storeOrder);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,10 @@
|
||||
package com.zbkj.service.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zbkj.common.model.order.StoreOrderReturnInfo;
|
||||
|
||||
public interface StoreOrderReturnInfoService extends IService<StoreOrderReturnInfo> {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.zbkj.service.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zbkj.common.model.order.StoreOrderReturn;
|
||||
|
||||
public interface StoreOrderReturnService extends IService<StoreOrderReturn> {
|
||||
|
||||
void createReturn(StoreOrderReturn oReturn);
|
||||
|
||||
void refundErr(Integer orderId, String verifyFailReason);
|
||||
|
||||
void refundOk(Integer orderId);
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ import com.zbkj.common.vo.MyRecord;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.model.product.StoreProductReply;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* StoreProductReplyService 接口
|
||||
|
||||
@ -28,7 +30,7 @@ public interface StoreProductReplyService extends IService<StoreProductReply> {
|
||||
* @param request 请求参数
|
||||
* @return Boolean
|
||||
*/
|
||||
Boolean create(StoreProductReplyAddRequest request);
|
||||
Boolean create(List<StoreProductReplyAddRequest> request);
|
||||
|
||||
/**
|
||||
* 添加虚拟评论
|
||||
|
@ -83,6 +83,8 @@ public interface StoreProductService extends IService<StoreProduct> {
|
||||
*/
|
||||
StoreProductRequest importProductFromUrl(String url, int tag) throws IOException, JSONException;
|
||||
|
||||
Map<Integer, List<Integer>> getCategoryByProductIds(String productIdStr);
|
||||
|
||||
List<Integer> getSecondaryCategoryByProductId(String productId);
|
||||
|
||||
/**
|
||||
|
@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.zbkj.common.constants.*;
|
||||
import com.zbkj.common.exception.CrmebException;
|
||||
@ -18,9 +19,7 @@ import com.zbkj.common.model.express.Express;
|
||||
import com.zbkj.common.model.express.ShippingTemplates;
|
||||
import com.zbkj.common.model.express.ShippingTemplatesFree;
|
||||
import com.zbkj.common.model.express.ShippingTemplatesRegion;
|
||||
import com.zbkj.common.model.order.StoreOrder;
|
||||
import com.zbkj.common.model.order.StoreOrderInfo;
|
||||
import com.zbkj.common.model.order.StoreOrderStatus;
|
||||
import com.zbkj.common.model.order.*;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.model.product.StoreProductAttrValue;
|
||||
import com.zbkj.common.model.seckill.StoreSeckill;
|
||||
@ -112,13 +111,10 @@ public class OrderServiceImpl implements OrderService {
|
||||
@Autowired
|
||||
private StoreSeckillService storeSeckillService;
|
||||
|
||||
|
||||
private StoreCombinationService storeCombinationService;
|
||||
@Autowired private StoreOrderReturnService storeOrderReturnService;
|
||||
|
||||
@Autowired
|
||||
public void setStoreCombinationService(ApplicationContext applicationContext) {
|
||||
this.storeCombinationService = applicationContext.getBean(StoreCombinationService.class);
|
||||
}
|
||||
private StoreCombinationService storeCombinationService;
|
||||
|
||||
@Autowired
|
||||
private StoreBargainService storeBargainService;
|
||||
@ -240,8 +236,8 @@ public class OrderServiceImpl implements OrderService {
|
||||
* @return Boolean
|
||||
*/
|
||||
@Override
|
||||
public Boolean reply(StoreProductReplyAddRequest request) {
|
||||
if (StrUtil.isBlank(request.getOrderNo())) {
|
||||
public Boolean reply(List<StoreProductReplyAddRequest> request) {
|
||||
if (StrUtil.isBlank(request.get(0).getOrderNo())) {
|
||||
throw new CrmebException("订单号参数不能为空");
|
||||
}
|
||||
return storeProductReplyService.create(request);
|
||||
@ -274,7 +270,10 @@ public class OrderServiceImpl implements OrderService {
|
||||
@Override
|
||||
public Boolean cancel(Integer id) {
|
||||
StoreOrder storeOrder = orderUtils.getInfoById(id);
|
||||
//已收货,待评价
|
||||
if (storeOrder.getStatus() == 4) { // 备货中,订单不能取消
|
||||
throw new CrmebException("订单已备货,无法取消");
|
||||
}
|
||||
|
||||
storeOrder.setIsDel(true);
|
||||
storeOrder.setIsSystemDel(true);
|
||||
boolean result = storeOrderService.updateById(storeOrder);
|
||||
@ -291,7 +290,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
@Override
|
||||
public Boolean refundApply(OrderRefundApplyRequest request) {
|
||||
StoreOrder storeOrderPram = new StoreOrder();
|
||||
storeOrderPram.setOrderId(request.getUni());
|
||||
storeOrderPram.setOrderId(request.getOrderNo());
|
||||
storeOrderPram.setIsDel(false);
|
||||
storeOrderPram.setPaid(true);
|
||||
StoreOrder existStoreOrder = storeOrderService.getByEntityOne(storeOrderPram);
|
||||
@ -299,25 +298,46 @@ public class OrderServiceImpl implements OrderService {
|
||||
if (existStoreOrder.getRefundStatus() == 1) {
|
||||
throw new CrmebException("正在申请退款中");
|
||||
}
|
||||
|
||||
if (existStoreOrder.getRefundStatus() == 2) {
|
||||
throw new CrmebException("订单已退款");
|
||||
}
|
||||
|
||||
if (existStoreOrder.getRefundStatus() == 3) {
|
||||
throw new CrmebException("订单退款中");
|
||||
}
|
||||
RefundComputedRequest rcRequest = new RefundComputedRequest();
|
||||
rcRequest.setOrderNo(request.getOrderNo());
|
||||
rcRequest.setReturnInfo(request.getReturnInfo());
|
||||
RefundComputedResponse refundComputedResponse = refundComputedPrice(rcRequest);
|
||||
|
||||
existStoreOrder.setRefundStatus(1);
|
||||
existStoreOrder.setRefundReasonTime(DateUtil.nowDateTime());
|
||||
existStoreOrder.setRefundReasonWap(request.getText());
|
||||
existStoreOrder.setRefundReasonWapExplain(request.getExplain());
|
||||
existStoreOrder.setRefundReasonWapImg(systemAttachmentService.clearPrefix(request.getReasonImage()));
|
||||
existStoreOrder.setRefundPrice(BigDecimal.ZERO);
|
||||
existStoreOrder.setRefundReasonWap(request.getReturnReason());
|
||||
existStoreOrder.setRefundReasonWapExplain(request.getReturnReason());
|
||||
existStoreOrder.setRefundReasonWapImg(systemAttachmentService.clearPrefix(request.getReturnImage()));
|
||||
existStoreOrder.setRefundPrice(new BigDecimal(refundComputedResponse.getReturnAmount()));
|
||||
|
||||
StoreOrderReturn oReturn = new StoreOrderReturn();
|
||||
oReturn.setOrderId(existStoreOrder.getId());
|
||||
oReturn.setContactPhone(request.getContactPhone());
|
||||
oReturn.setReturnReason(existStoreOrder.getRefundReasonWap());
|
||||
oReturn.setReturnImage(existStoreOrder.getRefundReasonWapImg());
|
||||
oReturn.setReturnAmount(existStoreOrder.getRefundPrice());
|
||||
oReturn.setReturnState(1);
|
||||
List<StoreOrderReturnInfo> rInfos = new ArrayList<>();
|
||||
for (OrderRefundInfoRequest orderRefundInfoRequest : request.getReturnInfo()) {
|
||||
StoreOrderReturnInfo rInfo = new StoreOrderReturnInfo();
|
||||
rInfo.setAttrValueId(Integer.parseInt(orderRefundInfoRequest.getUnique()));
|
||||
rInfo.setProductId(orderRefundInfoRequest.getProductId());
|
||||
rInfo.setReturnNum(orderRefundInfoRequest.getReturnNum());
|
||||
rInfo.setOrderId(existStoreOrder.getId());
|
||||
rInfos.add(rInfo);
|
||||
}
|
||||
oReturn.setReturnInfos(rInfos);
|
||||
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
storeOrderService.updateById(existStoreOrder);
|
||||
storeOrderStatusService.createLog(existStoreOrder.getId(), Constants.ORDER_LOG_REFUND_APPLY, "用户申请退款原因:" + request.getText());
|
||||
storeOrderReturnService.createReturn(oReturn);
|
||||
storeOrderStatusService.createLog(existStoreOrder.getId(), Constants.ORDER_LOG_REFUND_APPLY, "用户申请退款原因:" + request.getReturnReason());
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
|
||||
@ -378,10 +398,10 @@ public class OrderServiceImpl implements OrderService {
|
||||
continue;
|
||||
}
|
||||
|
||||
storeOrder.setRefundReasonWapImg(systemAttachmentService.clearPrefix(request.getReasonImage()));
|
||||
storeOrder.setRefundReasonWapImg(systemAttachmentService.clearPrefix(request.getReturnImage()));
|
||||
storeOrder.setRefundStatus(1);
|
||||
storeOrder.setRefundReasonWapExplain(request.getExplain());
|
||||
storeOrder.setRefundReason(request.getText());
|
||||
storeOrder.setRefundReasonWapExplain(request.getReturnReason());
|
||||
storeOrder.setRefundReason(request.getReturnReason());
|
||||
storeOrder.setRefundPrice(BigDecimal.ZERO);
|
||||
storeOrder.setRefundReasonTime(DateUtil.nowDateTime());
|
||||
orderList.add(storeOrder);
|
||||
@ -426,6 +446,8 @@ public class OrderServiceImpl implements OrderService {
|
||||
orderInfoResponse.setCartNum(e.getPayNum());
|
||||
orderInfoResponse.setPrice(ObjectUtil.isNotNull(e.getVipPrice()) ? e.getVipPrice() : e.getPrice());
|
||||
orderInfoResponse.setProductId(e.getProductId());
|
||||
orderInfoResponse.setCouponPrice(e.getCouponPrice());
|
||||
orderInfoResponse.setAttrId(e.getAttrValueId());
|
||||
infoResponseList.add(orderInfoResponse);
|
||||
});
|
||||
infoResponse.setOrderInfoList(infoResponseList);
|
||||
@ -480,9 +502,6 @@ public class OrderServiceImpl implements OrderService {
|
||||
if (storeOrder.getShippingType().equals(2)) {
|
||||
return "核销";
|
||||
}
|
||||
if (null != storeOrder.getFruitExchangeId() && storeOrder.getFruitExchangeId() > 0) {
|
||||
return "兑换";
|
||||
}
|
||||
return "普通";
|
||||
}
|
||||
|
||||
@ -504,7 +523,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
return "退款中";
|
||||
}
|
||||
if (storeOrder.getStatus().equals(0)) {
|
||||
return "备货中";
|
||||
return "待发货";
|
||||
}
|
||||
if (storeOrder.getStatus().equals(1)) {
|
||||
return "待收货";
|
||||
@ -515,6 +534,9 @@ public class OrderServiceImpl implements OrderService {
|
||||
if (storeOrder.getStatus().equals(3)) {
|
||||
return "已完成";
|
||||
}
|
||||
if (storeOrder.getStatus().equals(4)) {
|
||||
return "备货中";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -778,8 +800,10 @@ public class OrderServiceImpl implements OrderService {
|
||||
*获取待评价信息
|
||||
*/
|
||||
@Override
|
||||
public OrderProductReplyResponse getReplyProduct(GetProductReply productReply) {
|
||||
StoreOrderInfo storeOrderInfo = storeOrderInfoService.getByUniAndOrderId(productReply.getUni(), productReply.getOrderId());
|
||||
public List<OrderProductReplyResponse> getReplyProduct(GetProductReply productReply) {
|
||||
List<OrderProductReplyResponse> resList = new ArrayList<>();
|
||||
List<StoreOrderInfo> storeOrderInfos = storeOrderInfoService.getListByOrderNo(productReply.getOrderNo());
|
||||
for (StoreOrderInfo storeOrderInfo : storeOrderInfos) {
|
||||
OrderInfoDetailVo scr = JSONObject.parseObject(storeOrderInfo.getInfo(), OrderInfoDetailVo.class);
|
||||
OrderProductReplyResponse response = new OrderProductReplyResponse();
|
||||
response.setCartNum(scr.getPayNum());
|
||||
@ -790,7 +814,9 @@ public class OrderServiceImpl implements OrderService {
|
||||
response.setStoreName(scr.getProductName());
|
||||
List<String> reviewTags = reviewTagService.getReviewTagsByProductId(scr.getProductId());
|
||||
response.setReviewTags(reviewTags);
|
||||
return response;
|
||||
resList.add(response);
|
||||
}
|
||||
return resList;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -819,6 +845,189 @@ public class OrderServiceImpl implements OrderService {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品和数量计算退款金额
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public RefundComputedResponse refundComputedPrice(RefundComputedRequest request) {
|
||||
RefundComputedResponse res = new RefundComputedResponse();
|
||||
BigDecimal returnAmount = BigDecimal.ZERO;
|
||||
Map<String, Integer> returnMap = request.getReturnInfo().stream().collect(Collectors.toMap(OrderRefundInfoRequest::getUnique, OrderRefundInfoRequest::getReturnNum));
|
||||
List<StoreOrderInfo> orderInfos = storeOrderInfoService.getListByOrderNo(request.getOrderNo());
|
||||
List<StoreOrderInfo> returnInfos = orderInfos.stream().filter(i-> returnMap.containsKey(i.getUnique())).collect(Collectors.toList());
|
||||
for (StoreOrderInfo returnInfo : returnInfos) {
|
||||
Integer payNum = returnInfo.getPayNum();
|
||||
Integer retNum = returnMap.get(returnInfo.getUnique());
|
||||
BigDecimal price = returnInfo.getPrice();
|
||||
BigDecimal couponPrice = returnInfo.getCouponPrice();
|
||||
if (retNum > payNum) { throw new CrmebException("售后数量已超出购买数量"); }
|
||||
if (payNum.toString().equals(retNum.toString())) {
|
||||
returnAmount = returnAmount.add(price.multiply(new BigDecimal(payNum)).subtract(couponPrice));
|
||||
} else {
|
||||
// 计算出要退的商品优惠金额
|
||||
BigDecimal resCouponPrice = couponPrice.divide(new BigDecimal(payNum), 4, BigDecimal.ROUND_HALF_DOWN).multiply(new BigDecimal(retNum));
|
||||
returnAmount = returnAmount.add(((price.subtract(resCouponPrice)).multiply(new BigDecimal(retNum))).setScale(2, BigDecimal.ROUND_HALF_DOWN));
|
||||
}
|
||||
}
|
||||
res.setReturnAmount(String.valueOf(returnAmount));
|
||||
return res;
|
||||
}
|
||||
|
||||
private ComputedOrderPriceResponse computedPrice(OrderComputedPriceRequest request, OrderInfoVo orderInfoVo, User user) {
|
||||
// 计算各种价格
|
||||
ComputedOrderPriceResponse priceResponse = new ComputedOrderPriceResponse();
|
||||
// 计算运费
|
||||
if (request.getShippingType().equals(2)) {// 到店自提,不计算运费
|
||||
priceResponse.setFreightFee(BigDecimal.ZERO);
|
||||
} else if (ObjectUtil.isNull(request.getAddressId()) || request.getAddressId() <= 0) {
|
||||
// 快递配送,无地址
|
||||
priceResponse.setFreightFee(BigDecimal.ZERO);
|
||||
} else if (request.getShippingType().equals(3)) { // 骑手配送,计算距离公里数
|
||||
UserAddress userAddress = userAddressService.getById(request.getAddressId());
|
||||
if (ObjectUtil.isNull(userAddress)) {
|
||||
priceResponse.setFreightFee(BigDecimal.ZERO);
|
||||
} else {
|
||||
getFreightFeeRider(orderInfoVo, userAddress);
|
||||
priceResponse.setFreightFee(orderInfoVo.getFreightFee());
|
||||
}
|
||||
} else {// 快递配送,有地址
|
||||
UserAddress userAddress = userAddressService.getById(request.getAddressId());
|
||||
if (ObjectUtil.isNull(userAddress)) {
|
||||
priceResponse.setFreightFee(BigDecimal.ZERO);
|
||||
} else {
|
||||
getFreightFee(orderInfoVo, userAddress);
|
||||
priceResponse.setFreightFee(orderInfoVo.getFreightFee());
|
||||
}
|
||||
}
|
||||
// 计算优惠券金额
|
||||
if (ObjectUtil.isNull(request.getCouponId()) || request.getCouponId() <= 0) {
|
||||
priceResponse.setCouponFee(BigDecimal.ZERO);
|
||||
} else if (orderInfoVo.getSeckillId() > 0 || orderInfoVo.getBargainId() > 0 || orderInfoVo.getCombinationId() > 0) {
|
||||
throw new CrmebException("营销活动商品无法使用优惠券");
|
||||
} else if (orderInfoVo.getIsVideo()) {
|
||||
throw new CrmebException("视频号商品无法使用优惠券");
|
||||
} else {
|
||||
// 判断优惠券是否可以使用
|
||||
StoreCouponUser storeCouponUser = storeCouponUserService.getById(request.getCouponId());
|
||||
if (ObjectUtil.isNull(storeCouponUser) || !storeCouponUser.getUid().equals(user.getUid())) {
|
||||
throw new CrmebException("优惠券领取记录不存在!");
|
||||
}
|
||||
if (storeCouponUser.getStatus() == 1) {
|
||||
throw new CrmebException("此优惠券已使用!");
|
||||
}
|
||||
if (storeCouponUser.getStatus() == 2) {
|
||||
throw new CrmebException("此优惠券已失效!");
|
||||
}
|
||||
//判断是否在使用时间内
|
||||
Date date = DateUtil.nowDateTime();
|
||||
if (storeCouponUser.getStartTime().compareTo(date) > 0) {
|
||||
throw new CrmebException("此优惠券还未到达使用时间范围之内!");
|
||||
}
|
||||
if (date.compareTo(storeCouponUser.getEndTime()) > 0) {
|
||||
throw new CrmebException("此优惠券已经失效了");
|
||||
}
|
||||
if (storeCouponUser.getMinPrice().compareTo(orderInfoVo.getProTotalFee()) > 0) {
|
||||
throw new CrmebException("总金额小于优惠券最小使用金额");
|
||||
}
|
||||
List<Integer> productIdList = orderInfoVo.getOrderDetailList().stream().map(OrderInfoDetailVo::getProductId).collect(Collectors.toList());
|
||||
if (productIdList.isEmpty()) {
|
||||
throw new CrmebException("没有找到商品");
|
||||
}
|
||||
BigDecimal useCouponPrice = BigDecimal.ZERO;
|
||||
BigDecimal couponPrice = storeCouponUser.getMoney();
|
||||
BigDecimal remainCouponPrice = storeCouponUser.getMoney();
|
||||
List<OrderInfoDetailVo> products = orderInfoVo.getOrderDetailList();
|
||||
// 使用类型 1 全场通用, 2 商品券, 3 品类券
|
||||
if (storeCouponUser.getUseType() == 2) {
|
||||
// 设置优惠券所提供的集合
|
||||
// 取两个集合的交集,如果是false则证明没有相同的值
|
||||
// 交集:listA.retainAll(listB) ——listA内容变为listA和listB都存在的对象;listB不变
|
||||
List<Integer> primaryKeyIdList = CrmebUtil.stringToArray(storeCouponUser.getPrimaryKey());
|
||||
primaryKeyIdList.retainAll(productIdList);
|
||||
if (CollUtil.isEmpty(primaryKeyIdList)) {
|
||||
throw new CrmebException("此优惠券为商品券,请购买相关商品之后再使用!");
|
||||
}
|
||||
products = orderInfoVo.getOrderDetailList().stream().filter(i -> primaryKeyIdList.contains(i.getProductId())).collect(Collectors.toList());
|
||||
} else if (storeCouponUser.getUseType() == 3) {
|
||||
// 拿出需要使用优惠券的商品分类集合
|
||||
Map<Integer, List<Integer>> proCategoryMap = storeProductService.getCategoryByProductIds(StringUtils.join(productIdList, ","));
|
||||
products = orderInfoVo.getOrderDetailList().stream().map(i -> {
|
||||
List<Integer> categoryIds = proCategoryMap.get(i.getProductId());
|
||||
List<Integer> primaryKeyIdList = CrmebUtil.stringToArray(storeCouponUser.getPrimaryKey());
|
||||
primaryKeyIdList.retainAll(categoryIds);
|
||||
if (!CollUtil.isEmpty(primaryKeyIdList)) { return i; }
|
||||
return new OrderInfoDetailVo();
|
||||
}).filter(i-> null != i.getProductId()).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(products)) {
|
||||
throw new CrmebException("此优惠券为分类券,请购买相关分类下的商品之后再使用!");
|
||||
}
|
||||
}
|
||||
// 计算每个商品的优惠
|
||||
BigDecimal productTotalPrice = products.stream().map(i -> i.getPrice().multiply(new BigDecimal(i.getPayNum()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
for (int i = 0; i < products.size(); i++) {
|
||||
OrderInfoDetailVo product = products.get(i);
|
||||
BigDecimal itemCouponPrice = BigDecimal.ZERO;
|
||||
BigDecimal productPrice = product.getPrice().multiply(new BigDecimal(product.getPayNum()));
|
||||
// 最后一个商品,优惠券兜底
|
||||
if (i == products.size() - 1) {
|
||||
itemCouponPrice = remainCouponPrice.compareTo(productPrice) > 0 ? productPrice : remainCouponPrice;
|
||||
} else {
|
||||
itemCouponPrice = (productPrice.divide(productTotalPrice, 4, BigDecimal.ROUND_HALF_DOWN).multiply(couponPrice)).setScale(2, BigDecimal.ROUND_HALF_DOWN);
|
||||
remainCouponPrice = remainCouponPrice.subtract(itemCouponPrice);
|
||||
}
|
||||
product.setCouponPrice(itemCouponPrice);
|
||||
useCouponPrice = useCouponPrice.add(itemCouponPrice);
|
||||
}
|
||||
// 商品总金额 - 使用优惠券金额 <= 0
|
||||
priceResponse.setCouponFee(useCouponPrice);
|
||||
if (orderInfoVo.getProTotalFee().subtract(useCouponPrice).compareTo(BigDecimal.ZERO) <= 0) {
|
||||
priceResponse.setDeductionPrice(BigDecimal.ZERO);
|
||||
priceResponse.setSurplusIntegral(user.getIntegral());
|
||||
priceResponse.setPayFee(priceResponse.getFreightFee());
|
||||
priceResponse.setUsedIntegral(0);
|
||||
priceResponse.setUseIntegral(false);
|
||||
priceResponse.setProTotalFee(orderInfoVo.getProTotalFee());
|
||||
return priceResponse;
|
||||
}
|
||||
}
|
||||
// 积分部分
|
||||
BigDecimal payPrice = orderInfoVo.getProTotalFee().add(priceResponse.getFreightFee()).subtract(priceResponse.getCouponFee());
|
||||
priceResponse.setUseIntegral(request.getUseIntegral());
|
||||
priceResponse.setProTotalFee(orderInfoVo.getProTotalFee());
|
||||
if (!request.getUseIntegral() || user.getIntegral() <= 0) {// 不使用积分
|
||||
priceResponse.setDeductionPrice(BigDecimal.ZERO);
|
||||
priceResponse.setSurplusIntegral(user.getIntegral());
|
||||
priceResponse.setPayFee(payPrice);
|
||||
priceResponse.setUsedIntegral(0);
|
||||
return priceResponse;
|
||||
}
|
||||
// 使用积分
|
||||
// 查询积分使用比例
|
||||
String integralRatio = systemConfigService.getValueByKey(SysConfigConstants.CONFIG_KEY_INTEGRAL_RATE);
|
||||
BigDecimal deductionPrice = new BigDecimal(user.getIntegral()).multiply(new BigDecimal(integralRatio));
|
||||
if (request.getUseIntegral()) {
|
||||
// 积分兑换金额小于实际支付金额
|
||||
if (deductionPrice.compareTo(payPrice) < 0) {
|
||||
payPrice = payPrice.subtract(deductionPrice);
|
||||
priceResponse.setSurplusIntegral(0);
|
||||
priceResponse.setUsedIntegral(user.getIntegral());
|
||||
} else {
|
||||
deductionPrice = payPrice;
|
||||
if (payPrice.compareTo(BigDecimal.ZERO) > 0) {
|
||||
int usedIntegral = payPrice.divide(new BigDecimal(integralRatio), 0, BigDecimal.ROUND_UP).intValue();
|
||||
priceResponse.setSurplusIntegral(user.getIntegral() - usedIntegral);
|
||||
priceResponse.setUsedIntegral(usedIntegral);
|
||||
}
|
||||
payPrice = BigDecimal.ZERO;
|
||||
}
|
||||
priceResponse.setPayFee(payPrice);
|
||||
priceResponse.setDeductionPrice(deductionPrice);
|
||||
}
|
||||
return priceResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单预下单
|
||||
* @param request 预下单请求参数
|
||||
@ -984,7 +1193,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
verifyCode = CrmebUtil.randomCount(1000000000L, 9999999999L) + "";
|
||||
userAddressStr = systemStore.getName();
|
||||
} else if (request.getShippingType() == 3) { // 骑手配送
|
||||
String deliveryTime = request.getDeliveryTime();
|
||||
String deliveryTime = request.getDeliveryTime().split("-")[0];
|
||||
if (request.getAddressId() <= 0) throw new CrmebException("请选择配送地址");
|
||||
if (StringUtils.isEmpty(deliveryTime)) throw new CrmebException("请选择配送时间");
|
||||
|
||||
@ -1000,9 +1209,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
LocalDateTime dTime = LocalDateTime.parse(deliveryTime, ymdHmFor);
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
Integer isNowDay = DeliveryUtil.isNowDay(dTime);
|
||||
// 选择配送的时间满足条件才可通过
|
||||
// 配送时间不是今天 通过
|
||||
// 配送时间是今天下午 && 当前时间是上午 通过
|
||||
// 配送时间不是今天 或 (是今天下午 && 当前时间是上午) 通过
|
||||
if (!(isNowDay == 0 || (isNowDay == 1 && DeliveryUtil.isAmOrPm(dTime) == 1 && DeliveryUtil.isAmOrPm(now) == 0))) {
|
||||
throw new CrmebException("请重新选择配送时间");
|
||||
}
|
||||
@ -1062,6 +1269,8 @@ public class OrderServiceImpl implements OrderService {
|
||||
soInfo.setPayNum(detailVo.getPayNum());
|
||||
soInfo.setWeight(detailVo.getWeight());
|
||||
soInfo.setVolume(detailVo.getVolume());
|
||||
soInfo.setCouponPrice(detailVo.getCouponPrice());
|
||||
soInfo.setDeliveryTime(request.getDeliveryTime());
|
||||
if (ObjectUtil.isNotNull(detailVo.getGiveIntegral()) && detailVo.getGiveIntegral() > 0) {
|
||||
soInfo.setGiveIntegral(detailVo.getGiveIntegral());
|
||||
} else {
|
||||
@ -2123,140 +2332,4 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
orderInfoVo.setFreightFee(storePostage);
|
||||
}
|
||||
|
||||
private ComputedOrderPriceResponse computedPrice(OrderComputedPriceRequest request, OrderInfoVo orderInfoVo, User user) {
|
||||
// 计算各种价格
|
||||
ComputedOrderPriceResponse priceResponse = new ComputedOrderPriceResponse();
|
||||
// 计算运费
|
||||
if (request.getShippingType().equals(2)) {// 到店自提,不计算运费
|
||||
priceResponse.setFreightFee(BigDecimal.ZERO);
|
||||
} else if (ObjectUtil.isNull(request.getAddressId()) || request.getAddressId() <= 0) {
|
||||
// 快递配送,无地址
|
||||
priceResponse.setFreightFee(BigDecimal.ZERO);
|
||||
} else if (request.getShippingType().equals(3)) { // 骑手配送,计算距离公里数
|
||||
UserAddress userAddress = userAddressService.getById(request.getAddressId());
|
||||
if (ObjectUtil.isNull(userAddress)) {
|
||||
priceResponse.setFreightFee(BigDecimal.ZERO);
|
||||
} else {
|
||||
getFreightFeeRider(orderInfoVo, userAddress);
|
||||
priceResponse.setFreightFee(orderInfoVo.getFreightFee());
|
||||
}
|
||||
} else {// 快递配送,有地址
|
||||
UserAddress userAddress = userAddressService.getById(request.getAddressId());
|
||||
if (ObjectUtil.isNull(userAddress)) {
|
||||
priceResponse.setFreightFee(BigDecimal.ZERO);
|
||||
} else {
|
||||
getFreightFee(orderInfoVo, userAddress);
|
||||
priceResponse.setFreightFee(orderInfoVo.getFreightFee());
|
||||
}
|
||||
}
|
||||
// 计算优惠券金额
|
||||
if (ObjectUtil.isNull(request.getCouponId()) || request.getCouponId() <= 0) {
|
||||
priceResponse.setCouponFee(BigDecimal.ZERO);
|
||||
} else if (orderInfoVo.getSeckillId() > 0 || orderInfoVo.getBargainId() > 0 || orderInfoVo.getCombinationId() > 0) {
|
||||
throw new CrmebException("营销活动商品无法使用优惠券");
|
||||
} else if (orderInfoVo.getIsVideo()) {
|
||||
throw new CrmebException("视频号商品无法使用优惠券");
|
||||
} else {
|
||||
// 判断优惠券是否可以使用
|
||||
StoreCouponUser storeCouponUser = storeCouponUserService.getById(request.getCouponId());
|
||||
if (ObjectUtil.isNull(storeCouponUser) || !storeCouponUser.getUid().equals(user.getUid())) {
|
||||
throw new CrmebException("优惠券领取记录不存在!");
|
||||
}
|
||||
if (storeCouponUser.getStatus() == 1) {
|
||||
throw new CrmebException("此优惠券已使用!");
|
||||
}
|
||||
|
||||
if (storeCouponUser.getStatus() == 2) {
|
||||
throw new CrmebException("此优惠券已失效!");
|
||||
}
|
||||
//判断是否在使用时间内
|
||||
Date date = DateUtil.nowDateTime();
|
||||
if (storeCouponUser.getStartTime().compareTo(date) > 0) {
|
||||
throw new CrmebException("此优惠券还未到达使用时间范围之内!");
|
||||
}
|
||||
if (date.compareTo(storeCouponUser.getEndTime()) > 0) {
|
||||
throw new CrmebException("此优惠券已经失效了");
|
||||
}
|
||||
if (storeCouponUser.getMinPrice().compareTo(orderInfoVo.getProTotalFee()) > 0) {
|
||||
throw new CrmebException("总金额小于优惠券最小使用金额");
|
||||
}
|
||||
//检测优惠券信息
|
||||
if (storeCouponUser.getUseType() > 1) {
|
||||
List<Integer> productIdList = orderInfoVo.getOrderDetailList().stream().map(OrderInfoDetailVo::getProductId).collect(Collectors.toList());
|
||||
if (productIdList.size() < 1) {
|
||||
throw new CrmebException("没有找到商品");
|
||||
}
|
||||
|
||||
//设置优惠券所提供的集合
|
||||
List<Integer> primaryKeyIdList = CrmebUtil.stringToArray(storeCouponUser.getPrimaryKey());
|
||||
|
||||
//取两个集合的交集,如果是false则证明没有相同的值
|
||||
//oldList.retainAll(newList)返回值代表oldList是否保持原样,如果old和new完全相同,那old保持原样并返回false。
|
||||
//交集:listA.retainAll(listB) ——listA内容变为listA和listB都存在的对象;listB不变
|
||||
if (storeCouponUser.getUseType() == 2) {
|
||||
primaryKeyIdList.retainAll(productIdList);
|
||||
if (CollUtil.isEmpty(primaryKeyIdList)) {
|
||||
throw new CrmebException("此优惠券为商品券,请购买相关商品之后再使用!");
|
||||
}
|
||||
}
|
||||
|
||||
if (storeCouponUser.getUseType() == 3) {
|
||||
//拿出需要使用优惠券的商品分类集合
|
||||
List<Integer> categoryIdList = storeProductService.getSecondaryCategoryByProductId(StringUtils.join(productIdList, ","));
|
||||
|
||||
primaryKeyIdList.retainAll(categoryIdList);
|
||||
if (CollUtil.isEmpty(primaryKeyIdList)) {
|
||||
throw new CrmebException("此优惠券为分类券,请购买相关分类下的商品之后再使用!");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (orderInfoVo.getProTotalFee().compareTo(storeCouponUser.getMoney()) <= 0) {
|
||||
priceResponse.setCouponFee(orderInfoVo.getProTotalFee());
|
||||
priceResponse.setDeductionPrice(BigDecimal.ZERO);
|
||||
priceResponse.setSurplusIntegral(user.getIntegral());
|
||||
priceResponse.setPayFee(priceResponse.getFreightFee());
|
||||
priceResponse.setUsedIntegral(0);
|
||||
priceResponse.setUseIntegral(false);
|
||||
priceResponse.setProTotalFee(orderInfoVo.getProTotalFee());
|
||||
return priceResponse;
|
||||
} else {
|
||||
priceResponse.setCouponFee(storeCouponUser.getMoney());
|
||||
}
|
||||
}
|
||||
// 积分部分
|
||||
BigDecimal payPrice = orderInfoVo.getProTotalFee().add(priceResponse.getFreightFee()).subtract(priceResponse.getCouponFee());
|
||||
priceResponse.setUseIntegral(request.getUseIntegral());
|
||||
priceResponse.setProTotalFee(orderInfoVo.getProTotalFee());
|
||||
if (!request.getUseIntegral() || user.getIntegral() <= 0) {// 不使用积分
|
||||
priceResponse.setDeductionPrice(BigDecimal.ZERO);
|
||||
priceResponse.setSurplusIntegral(user.getIntegral());
|
||||
priceResponse.setPayFee(payPrice);
|
||||
priceResponse.setUsedIntegral(0);
|
||||
return priceResponse;
|
||||
}
|
||||
// 使用积分
|
||||
// 查询积分使用比例
|
||||
String integralRatio = systemConfigService.getValueByKey(SysConfigConstants.CONFIG_KEY_INTEGRAL_RATE);
|
||||
BigDecimal deductionPrice = new BigDecimal(user.getIntegral()).multiply(new BigDecimal(integralRatio));
|
||||
if (request.getUseIntegral()) {
|
||||
// 积分兑换金额小于实际支付金额
|
||||
if (deductionPrice.compareTo(payPrice) < 0) {
|
||||
payPrice = payPrice.subtract(deductionPrice);
|
||||
priceResponse.setSurplusIntegral(0);
|
||||
priceResponse.setUsedIntegral(user.getIntegral());
|
||||
} else {
|
||||
deductionPrice = payPrice;
|
||||
if (payPrice.compareTo(BigDecimal.ZERO) > 0) {
|
||||
int usedIntegral = payPrice.divide(new BigDecimal(integralRatio), 0, BigDecimal.ROUND_UP).intValue();
|
||||
priceResponse.setSurplusIntegral(user.getIntegral() - usedIntegral);
|
||||
priceResponse.setUsedIntegral(usedIntegral);
|
||||
}
|
||||
payPrice = BigDecimal.ZERO;
|
||||
}
|
||||
priceResponse.setPayFee(payPrice);
|
||||
priceResponse.setDeductionPrice(deductionPrice);
|
||||
}
|
||||
return priceResponse;
|
||||
}
|
||||
}
|
||||
|
@ -844,9 +844,10 @@ public class StoreCombinationServiceImpl extends ServiceImpl<StoreCombinationDao
|
||||
// 订单申请退款
|
||||
OrderRefundApplyRequest refundRequest = new OrderRefundApplyRequest();
|
||||
refundRequest.setId(order.getId());
|
||||
refundRequest.setUni(order.getOrderId());
|
||||
refundRequest.setText("拼团订单取消,申请退款");
|
||||
refundRequest.setExplain("用户取消拼团订单,申请退款");
|
||||
refundRequest.setOrderNo(order.getOrderId());
|
||||
refundRequest.setReturnReason("拼团订单取消,申请退款");
|
||||
// refundRequest.setExplain("用户取消拼团订单,申请退款");
|
||||
// todo 需要改
|
||||
boolean apply = orderService.refundApply(refundRequest);
|
||||
if (!apply) throw new CrmebException("订单申请退款失败");
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.zbkj.service.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.constants.PayConstants;
|
||||
import com.zbkj.common.request.StoreOrderRefundRequest;
|
||||
@ -8,7 +7,6 @@ import com.zbkj.common.utils.RestTemplateUtil;
|
||||
import com.zbkj.common.utils.WxPayUtil;
|
||||
import com.zbkj.common.vo.WxRefundVo;
|
||||
import com.zbkj.common.model.order.StoreOrder;
|
||||
import com.zbkj.service.dao.StoreOrderDao;
|
||||
import com.zbkj.service.service.StoreOrderRefundService;
|
||||
import com.zbkj.service.service.SystemConfigService;
|
||||
import com.zbkj.service.service.WechatNewService;
|
||||
@ -22,7 +20,7 @@ import java.math.BigDecimal;
|
||||
|
||||
*/
|
||||
@Service
|
||||
public class StoreOrderRefundServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder> implements StoreOrderRefundService {
|
||||
public class StoreOrderRefundServiceImpl implements StoreOrderRefundService {
|
||||
|
||||
@Autowired
|
||||
private SystemConfigService systemConfigService;
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.zbkj.service.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zbkj.common.model.order.StoreOrderReturnInfo;
|
||||
import com.zbkj.service.dao.StoreOrderReturnInfoDao;
|
||||
import com.zbkj.service.service.StoreOrderReturnInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class StoreOrderReturnInfoServiceImpl extends ServiceImpl<StoreOrderReturnInfoDao, StoreOrderReturnInfo> implements StoreOrderReturnInfoService {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.zbkj.service.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zbkj.common.model.order.StoreOrderReturn;
|
||||
import com.zbkj.service.dao.StoreOrderReturnDao;
|
||||
import com.zbkj.service.service.StoreOrderReturnInfoService;
|
||||
import com.zbkj.service.service.StoreOrderReturnService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
public class StoreOrderReturnServiceImpl extends ServiceImpl<StoreOrderReturnDao, StoreOrderReturn> implements StoreOrderReturnService {
|
||||
|
||||
@Autowired private StoreOrderReturnDao dao;
|
||||
@Autowired private StoreOrderReturnInfoService storeOrderReturnInfoService;
|
||||
|
||||
@Override
|
||||
public void createReturn(StoreOrderReturn oReturn) {
|
||||
dao.insert(oReturn);
|
||||
oReturn.getReturnInfos().forEach(info -> info.setReturnId(oReturn.getId()));
|
||||
storeOrderReturnInfoService.saveBatch(oReturn.getReturnInfos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refundErr(Integer orderId, String verifyFailReason) {
|
||||
LambdaQueryWrapper<StoreOrderReturn> lw = new LambdaQueryWrapper<>();
|
||||
lw.eq(StoreOrderReturn::getOrderId, orderId);
|
||||
StoreOrderReturn one = getOne(lw);
|
||||
StoreOrderReturn upd = new StoreOrderReturn();
|
||||
upd.setId(one.getId());
|
||||
upd.setReturnVerifyDate(new Date());
|
||||
upd.setRefundVerifyFailReason(verifyFailReason);
|
||||
upd.setReturnState(3);
|
||||
dao.updateById(upd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refundOk(Integer orderId) {
|
||||
LambdaQueryWrapper<StoreOrderReturn> lw = new LambdaQueryWrapper<>();
|
||||
lw.eq(StoreOrderReturn::getOrderId, orderId);
|
||||
StoreOrderReturn one = getOne(lw);
|
||||
StoreOrderReturn upd = new StoreOrderReturn();
|
||||
upd.setId(one.getId());
|
||||
upd.setReturnVerifyDate(new Date());
|
||||
upd.setReturnState(2);
|
||||
dao.updateById(upd);
|
||||
}
|
||||
}
|
@ -118,6 +118,8 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
@Autowired
|
||||
private SmsTemplateService smsTemplateService;
|
||||
|
||||
@Autowired private StoreOrderReturnService storeOrderReturnService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param request 请求参数
|
||||
@ -306,10 +308,6 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
if (ObjectUtil.isNotNull(storeOrder.getBargainId()) && storeOrder.getBargainId() > 0) {
|
||||
orderType = StrUtil.format(orderTypeFormat, "砍价", "");
|
||||
}
|
||||
// 兑换
|
||||
if (ObjectUtil.isNotNull(storeOrder.getFruitExchangeId()) && storeOrder.getFruitExchangeId() > 0) {
|
||||
orderType = StrUtil.format(orderTypeFormat, "兑换", "");
|
||||
}
|
||||
// 拼团
|
||||
if (ObjectUtil.isNotNull(storeOrder.getCombinationId()) && storeOrder.getCombinationId() > 0) {
|
||||
StorePink storePink = storePinkService.getById(storeOrder.getPinkId());
|
||||
@ -507,7 +505,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
if (!storeOrder.getPaid()) {
|
||||
throw new CrmebException("未支付无法退款");
|
||||
}
|
||||
if (storeOrder.getRefundPrice().add(request.getAmount()).compareTo(storeOrder.getPayPrice()) > 0) {
|
||||
if (request.getAmount().compareTo(storeOrder.getPayPrice()) > 0) {
|
||||
throw new CrmebException("退款金额大于支付金额,请修改退款金额");
|
||||
}
|
||||
if (request.getAmount().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
@ -532,24 +530,20 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
//修改订单退款状态
|
||||
storeOrder.setRefundStatus(3);
|
||||
storeOrder.setRefundPrice(request.getAmount());
|
||||
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
updateById(storeOrder);
|
||||
if (storeOrder.getPayType().equals(Constants.PAY_TYPE_YUE)) {
|
||||
//新增日志
|
||||
request.setOrderId(storeOrder.getId());
|
||||
userBillService.saveRefundBill(request, user);
|
||||
|
||||
// 更新用户金额
|
||||
userService.operationNowMoney(user.getUid(), request.getAmount(), user.getNowMoney(), "add");
|
||||
|
||||
// 退款task
|
||||
redisUtil.lPush(Constants.ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER, storeOrder.getId());
|
||||
}
|
||||
if (storeOrder.getPayType().equals(Constants.PAY_TYPE_WE_CHAT) && request.getAmount().compareTo(BigDecimal.ZERO) == 0) {
|
||||
//新增日志
|
||||
userBillService.saveRefundBill(request, user);
|
||||
|
||||
// 退款task
|
||||
redisUtil.lPush(Constants.ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER, storeOrder.getId());
|
||||
}
|
||||
@ -559,7 +553,6 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
storeOrderStatusService.saveRefund(storeOrder.getId(), request.getAmount(), "失败");
|
||||
throw new CrmebException("订单更新失败");
|
||||
}
|
||||
|
||||
// 发送消息通知
|
||||
return execute;
|
||||
}
|
||||
@ -659,10 +652,9 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
storeOrder.setRefundReason(reason);
|
||||
storeOrder.setRefundStatus(0);
|
||||
|
||||
User user = userService.getById(storeOrder.getUid());
|
||||
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
updateById(storeOrder);
|
||||
storeOrderReturnService.refundErr(storeOrder.getId(), reason);
|
||||
storeOrderStatusService.createLog(storeOrder.getId(), Constants.ORDER_LOG_REFUND_REFUSE, Constants.ORDER_LOG_MESSAGE_REFUND_REFUSE.replace("{reason}", reason));
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
@ -1095,6 +1087,8 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
response.setUnPaid(getCount(dateLimit, Constants.ORDER_STATUS_UNPAID, type));
|
||||
// 未发货订单
|
||||
response.setNotShipped(getCount(dateLimit, Constants.ORDER_STATUS_NOT_SHIPPED, type));
|
||||
// 备货中订单
|
||||
response.setNotShipped(getCount(dateLimit, Constants.ORDER_STATUS_PREPARE_ING, type));
|
||||
// 待收货订单
|
||||
response.setSpike(getCount(dateLimit, Constants.ORDER_STATUS_SPIKE, type));
|
||||
// 待评价订单
|
||||
@ -1848,7 +1842,14 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
queryWrapper.eq("paid", 1);
|
||||
queryWrapper.eq("status", 0);
|
||||
queryWrapper.eq("refund_status", 0);
|
||||
queryWrapper.eq("shipping_type", 1);//配送方式
|
||||
queryWrapper.eq("shipping_type", 3);//配送方式
|
||||
queryWrapper.eq("is_del", 0);
|
||||
break;
|
||||
case Constants.ORDER_STATUS_PREPARE_ING: //备货中
|
||||
queryWrapper.eq("paid", 1);
|
||||
queryWrapper.eq("status", 4);
|
||||
queryWrapper.eq("refund_status", 0);
|
||||
queryWrapper.eq("shipping_type", 3);//配送方式
|
||||
queryWrapper.eq("is_del", 0);
|
||||
break;
|
||||
case Constants.ORDER_STATUS_SPIKE: //待收货
|
||||
@ -1919,6 +1920,13 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
queryWrapper.eq("shipping_type", 1);//配送方式
|
||||
queryWrapper.eq("is_del", 0);
|
||||
break;
|
||||
case Constants.ORDER_STATUS_PREPARE_ING: //备货中
|
||||
queryWrapper.eq("paid", 1);
|
||||
queryWrapper.eq("status", 4);
|
||||
queryWrapper.eq("refund_status", 0);
|
||||
queryWrapper.eq("shipping_type", 1);//配送方式
|
||||
queryWrapper.eq("is_del", 0);
|
||||
break;
|
||||
case Constants.ORDER_STATUS_SPIKE: //待收货
|
||||
queryWrapper.eq("paid", 1);
|
||||
queryWrapper.eq("status", 1);
|
||||
@ -1999,6 +2007,17 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
map.put("value", Constants.ORDER_STATUS_STR_NOT_SHIPPED);
|
||||
return map;
|
||||
}
|
||||
// 备货中
|
||||
if (storeOrder.getPaid()
|
||||
&& storeOrder.getStatus() == 4
|
||||
&& storeOrder.getRefundStatus() == 0
|
||||
&& storeOrder.getShippingType() == 1
|
||||
&& !storeOrder.getIsDel()
|
||||
&& !storeOrder.getIsSystemDel()) {
|
||||
map.put("key", Constants.ORDER_STATUS_PREPARE_ING);
|
||||
map.put("value", Constants.ORDER_STATUS_STR_PREPARE_ING);
|
||||
return map;
|
||||
}
|
||||
// 待收货
|
||||
if (storeOrder.getPaid()
|
||||
&& storeOrder.getStatus() == 1
|
||||
|
@ -51,6 +51,8 @@ public class StoreOrderTaskServiceImpl implements StoreOrderTaskService {
|
||||
@Autowired
|
||||
private StoreOrderInfoService storeOrderInfoService;
|
||||
|
||||
@Autowired private StoreOrderReturnService storeOrderReturnService;
|
||||
|
||||
@Autowired
|
||||
private StoreProductService storeProductService;
|
||||
|
||||
@ -244,6 +246,7 @@ public class StoreOrderTaskServiceImpl implements StoreOrderTaskService {
|
||||
* 5、回滚经验
|
||||
* 6、回滚库存
|
||||
* 7、发送通知
|
||||
* 8、售后单处理
|
||||
* 实际上2-5就是user数据的处理+userBill的记录
|
||||
*/
|
||||
// 获取用户对象
|
||||
@ -332,6 +335,9 @@ public class StoreOrderTaskServiceImpl implements StoreOrderTaskService {
|
||||
|
||||
storeOrderService.updateById(tempOrder);
|
||||
|
||||
// 售后单处理
|
||||
storeOrderReturnService.refundOk(storeOrder.getId());
|
||||
|
||||
// 拼团状态处理
|
||||
if (storeOrder.getCombinationId() > 0) {
|
||||
StorePink storePink = storePinkService.getByOrderId(storeOrder.getOrderId());
|
||||
|
@ -226,8 +226,7 @@ public class StorePinkServiceImpl extends ServiceImpl<StorePinkDao, StorePink> i
|
||||
// 订单申请退款
|
||||
OrderRefundApplyRequest refundRequest = new OrderRefundApplyRequest();
|
||||
refundRequest.setId(headPink.getOrderIdKey());
|
||||
refundRequest.setText("拼团订单取消,申请退款");
|
||||
refundRequest.setExplain("用户取消拼团订单,申请退款");
|
||||
refundRequest.setReturnReason("拼团订单取消,申请退款");
|
||||
pinkFailList.add(headPink);
|
||||
applyList.add(refundRequest);
|
||||
|
||||
@ -237,8 +236,7 @@ public class StorePinkServiceImpl extends ServiceImpl<StorePinkDao, StorePink> i
|
||||
List<OrderRefundApplyRequest> tempApplyList = memberList.stream().map(i -> {
|
||||
OrderRefundApplyRequest tempRefundRequest = new OrderRefundApplyRequest();
|
||||
tempRefundRequest.setId(headPink.getOrderIdKey());
|
||||
tempRefundRequest.setText("拼团订单取消,申请退款");
|
||||
tempRefundRequest.setExplain("用户取消拼团订单,申请退款");
|
||||
tempRefundRequest.setReturnReason("拼团订单取消,申请退款");
|
||||
return tempRefundRequest;
|
||||
}).collect(Collectors.toList());
|
||||
pinkFailList.addAll(memberList);
|
||||
|
@ -70,9 +70,6 @@ public class StoreProductProblemServiceImpl extends ServiceImpl<StoreProductProb
|
||||
@Override
|
||||
public Integer commitProblem(CommitProblemRequest request) {
|
||||
User user = userService.getInfo();
|
||||
if (null == user) {
|
||||
throw new CrmebException("请先登录");
|
||||
}
|
||||
Integer pId = 0;
|
||||
Integer topId = 0;
|
||||
String businessId = request.getBusinessId();
|
||||
|
@ -51,8 +51,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
*/
|
||||
@Service
|
||||
public class StoreProductReplyServiceImpl extends ServiceImpl<StoreProductReplyDao, StoreProductReply>
|
||||
implements StoreProductReplyService {
|
||||
public class StoreProductReplyServiceImpl extends ServiceImpl<StoreProductReplyDao, StoreProductReply> implements StoreProductReplyService {
|
||||
|
||||
@Resource
|
||||
private StoreProductReplyDao dao;
|
||||
@ -152,21 +151,21 @@ public class StoreProductReplyServiceImpl extends ServiceImpl<StoreProductReplyD
|
||||
* @return Boolean
|
||||
*/
|
||||
@Override
|
||||
public Boolean create(StoreProductReplyAddRequest request) {
|
||||
public Boolean create(List<StoreProductReplyAddRequest> request) {
|
||||
User user = userService.getInfoException();
|
||||
StoreOrder storeOrder = storeOrderService.getByOderId(request.getOrderNo());
|
||||
StoreOrder storeOrder = storeOrderService.getByOderId(request.get(0).getOrderNo());
|
||||
if (ObjectUtil.isNull(storeOrder) || !storeOrder.getUid().equals(user.getUid())) {
|
||||
throw new CrmebException("该订单不存在");
|
||||
}
|
||||
for (StoreProductReplyAddRequest rAddRequest : request) {
|
||||
StoreProductReply storeProductReply = new StoreProductReply();
|
||||
BeanUtils.copyProperties(request, storeProductReply);
|
||||
BeanUtils.copyProperties(rAddRequest, storeProductReply);
|
||||
storeProductReply.setOid(storeOrder.getId());
|
||||
Integer count = checkIsReply(storeProductReply);
|
||||
storeProductReply.setAvatar(systemAttachmentService.clearPrefix(user.getAvatar()));
|
||||
storeProductReply.setNickname(user.getNickname());
|
||||
if (StringUtils.isNotBlank(request.getPics())) {
|
||||
String pics = request.getPics().replace("[\"","").replace("\"]","")
|
||||
.replace("\"","");
|
||||
if (StringUtils.isNotBlank(rAddRequest.getPics())) {
|
||||
String pics = rAddRequest.getPics().replace("[\"","").replace("\"]","").replace("\"","");
|
||||
storeProductReply.setPics(systemAttachmentService.clearPrefix(ArrayUtils.toString(pics)));
|
||||
}
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
@ -178,7 +177,8 @@ public class StoreProductReplyServiceImpl extends ServiceImpl<StoreProductReplyD
|
||||
if (!execute) {
|
||||
throw new CrmebException("评价订单失败");
|
||||
}
|
||||
return execute;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -466,7 +466,6 @@ public class StoreProductReplyServiceImpl extends ServiceImpl<StoreProductReplyD
|
||||
*/
|
||||
private void completeOrder(StoreProductReply storeProductReply, Integer count, StoreOrder storeOrder) {
|
||||
Integer replyCount = getReplyCountByEntity(storeProductReply, true);
|
||||
|
||||
if (replyCount.equals(count)) {
|
||||
//全部商品都已评价
|
||||
storeOrder.setStatus(Constants.ORDER_STATUS_INT_COMPLETE);
|
||||
|
@ -850,6 +850,46 @@ public class StoreProductServiceImpl extends ServiceImpl<StoreProductDao, StoreP
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品对于的分类
|
||||
* @param productIdStr
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<Integer, List<Integer>> getCategoryByProductIds(String productIdStr) {
|
||||
Map<Integer, List<Integer>> resMap = new HashMap<>();
|
||||
if (StringUtils.isBlank(productIdStr)) {
|
||||
return resMap;
|
||||
}
|
||||
List<Integer> productIdList = CrmebUtil.stringToArray(productIdStr);
|
||||
LambdaQueryWrapper<StoreProduct> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(StoreProduct::getId, productIdList);
|
||||
List<StoreProduct> productList = dao.selectList(lambdaQueryWrapper);
|
||||
if (productIdList.isEmpty()) {
|
||||
return resMap;
|
||||
}
|
||||
// 遍历商品
|
||||
for (StoreProduct storeProduct : productList) {
|
||||
// 取出商品分类
|
||||
List<Integer> categoryIdList = CrmebUtil.stringToArray(storeProduct.getCateId());
|
||||
resMap.put(storeProduct.getId(), categoryIdList);
|
||||
// 取出分类二级分类
|
||||
List<Category> categoryList = categoryService.getByIds(categoryIdList);
|
||||
if (categoryList.isEmpty()) { continue; }
|
||||
for (Category category : categoryList) {
|
||||
List<Integer> parentIdList = CrmebUtil.stringToArrayByRegex(category.getPath(), "/");
|
||||
if (parentIdList.size() > 2) {
|
||||
Integer secondaryCategoryId = parentIdList.get(2);
|
||||
if (secondaryCategoryId > 0) {
|
||||
categoryIdList.add(secondaryCategoryId);
|
||||
resMap.put(storeProduct.getId(), categoryIdList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品id取出二级分类
|
||||
* @param productIdStr String 商品分类
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
<select id="selectOrderReplyList" resultType="com.zbkj.common.response.OrderReplyListResponse">
|
||||
SELECT
|
||||
o.id, o.order_id orderId, o.create_time createTime,
|
||||
o.id, o.order_id orderNo, o.create_time createTime,
|
||||
oi.product_id productId,
|
||||
oi.product_name productName,
|
||||
oi.unique uni, oi.image,
|
||||
|
@ -8,7 +8,7 @@
|
||||
c.id majorId,
|
||||
u.uid userId,
|
||||
u.nickname nickName,
|
||||
u.avatar imageUrl,
|
||||
u.avatar,
|
||||
c.content,
|
||||
DATE_FORMAT(c.create_time, '%Y-%m-%d %H:%i:%s') createTime,
|
||||
(select count(1) from eb_store_product_problem c1 where c1.top_id = c.id and c1.top_id <![CDATA[ <> ]]> 0 and c1.is_del = 0) sonNum
|
||||
@ -22,7 +22,7 @@
|
||||
a.id majorId,
|
||||
u.uid userId,
|
||||
u.nickname nickName,
|
||||
u.avatar imageUrl,
|
||||
u.avatar,
|
||||
a.content,
|
||||
DATE_FORMAT(a.create_time, '%Y-%m-%d %H:%i:%s') createTime,
|
||||
u1.nickname beReplier
|
||||
|
Loading…
Reference in New Issue
Block a user