同步master
This commit is contained in:
@@ -11,6 +11,7 @@ import cn.lili.common.sms.SmsUtil;
|
||||
import cn.lili.common.utils.CommonUtil;
|
||||
import cn.lili.common.verification.enums.VerificationEnums;
|
||||
import cn.lili.config.properties.SmsTemplateSetting;
|
||||
import cn.lili.config.properties.SystemSetting;
|
||||
import cn.lili.modules.connect.util.Base64Utils;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
import cn.lili.modules.member.service.MemberService;
|
||||
@@ -55,6 +56,9 @@ public class SmsUtilAliImplService implements SmsUtil, AliSmsUtil {
|
||||
@Autowired
|
||||
private SmsTemplateSetting smsTemplateSetting;
|
||||
|
||||
@Autowired
|
||||
private SystemSetting systemSetting;
|
||||
|
||||
@Override
|
||||
public void sendSmsCode(String mobile, VerificationEnums verificationEnums, String uuid) {
|
||||
//获取短信配置
|
||||
@@ -115,12 +119,20 @@ public class SmsUtilAliImplService implements SmsUtil, AliSmsUtil {
|
||||
default:
|
||||
return;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
log.info("短信验证码:"+code);
|
||||
=======
|
||||
|
||||
//如果是测试模式 默认验证码 6个1
|
||||
if (systemSetting.getIsTestModel()) {
|
||||
code = "111111";
|
||||
} else {
|
||||
//发送短信
|
||||
this.sendSmsCode(smsSetting.getSignName(), mobile, params, templateCode);
|
||||
}
|
||||
>>>>>>> master
|
||||
//缓存中写入要验证的信息
|
||||
cache.put(cacheKey(verificationEnums, mobile, uuid), code, 300L);
|
||||
//发送短信
|
||||
this.sendSmsCode(smsSetting.getSignName(), mobile, params, templateCode);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package cn.lili.common.utils;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.modules.payment.kit.dto.PayParam;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
@@ -56,4 +58,75 @@ public class BeanUtil {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将对象转换为key value
|
||||
* A=a&B=b&C=c 格式
|
||||
*/
|
||||
public static String formatKeyValuePair(Object object) {
|
||||
//准备接受的字符串
|
||||
StringBuilder stringBuffer = new StringBuilder();
|
||||
//获取对象字段
|
||||
String[] fieldNames = BeanUtil.getFiledName(object);
|
||||
//遍历所有属性
|
||||
for (int j = 0; j < fieldNames.length; j++) {
|
||||
//不是第一个并且不是最后一个,拼接&
|
||||
if (j != 0) {
|
||||
stringBuffer.append("&");
|
||||
}
|
||||
//获取属性的名字
|
||||
String key = fieldNames[j];
|
||||
//获取值
|
||||
Object value = BeanUtil.getFieldValueByName(key, object);
|
||||
stringBuffer.append(key).append("=").append(value.toString());
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* key value键值对 转换为 对象
|
||||
* A=a&B=b&C=c 格式 转换为对象
|
||||
*/
|
||||
public static <T> T formatKeyValuePair(String str, T t) {
|
||||
//填写对参数键值对
|
||||
String[] params = str.split("&");
|
||||
|
||||
//获取对象字段
|
||||
String[] fieldNames = BeanUtil.getFiledName(t);
|
||||
|
||||
try {
|
||||
//循环每个参数
|
||||
for (String param : params) {
|
||||
String[] keyValues = param.split("=");
|
||||
for (int i = 0; i < fieldNames.length; i++) {
|
||||
if (fieldNames[i].equals(keyValues[0])) {
|
||||
Field f = t.getClass().getDeclaredField(fieldNames[i]);
|
||||
f.setAccessible(true);
|
||||
//长度为2 才转换,否则不转
|
||||
if (keyValues.length == 2) {
|
||||
f.set(t, keyValues[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IllegalAccessException {
|
||||
PayParam payParam = new PayParam();
|
||||
payParam.setClientType("client");
|
||||
payParam.setOrderType("");
|
||||
payParam.setSn("sn");
|
||||
String val = formatKeyValuePair(payParam);
|
||||
System.out.println(val);
|
||||
|
||||
PayParam param = formatKeyValuePair(val, new PayParam());
|
||||
System.out.println(JSONUtil.toJsonStr(param));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 字串工具类
|
||||
@@ -250,6 +252,19 @@ public class StringUtils extends StrUtil {
|
||||
}
|
||||
return str.concat(appendStr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤特殊字符串
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static String filterSpecialChart(String str) {
|
||||
String regEx = "[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
|
||||
Pattern p = Pattern.compile(regEx);
|
||||
Matcher m = p.matcher(str);
|
||||
return m.replaceAll("").trim();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,12 @@ public class SystemSetting {
|
||||
*/
|
||||
private Boolean isDemoSite = false;
|
||||
|
||||
/**
|
||||
* 测试模式
|
||||
* 验证码短信为6个1
|
||||
*/
|
||||
private Boolean isTestModel = false;
|
||||
|
||||
/**
|
||||
* 授权信息
|
||||
*/
|
||||
|
||||
@@ -101,7 +101,7 @@ public class CodeGenerator {
|
||||
*/
|
||||
public static void main(String[] args) throws IOException {
|
||||
// 模板路径
|
||||
ClasspathResourceLoader resourceLoader = new ClasspathResourceLoader("/templates/java/");
|
||||
ClasspathResourceLoader resourceLoader = new ClasspathResourceLoader("/templates/");
|
||||
Configuration cfg = Configuration.defaultConfiguration();
|
||||
GroupTemplate gt = new GroupTemplate(resourceLoader, cfg);
|
||||
// 生成代码
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package cn.lili.modules.goods.entity.dos;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.base.BaseEntity;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Max;
|
||||
@@ -182,11 +185,18 @@ public class Goods extends BaseEntity {
|
||||
@ApiModelProperty(value = "销售模式", required = true)
|
||||
private String salesModel;
|
||||
|
||||
<<<<<<< HEAD
|
||||
/**
|
||||
* @see cn.lili.modules.goods.entity.enums.GoodsTypeEnum
|
||||
*/
|
||||
@ApiModelProperty(value = "商品类型", required = true)
|
||||
private String goodsType;
|
||||
=======
|
||||
@ApiModelProperty(value = "商品参数json", hidden = true)
|
||||
@Column(columnDefinition = "TEXT")
|
||||
@JsonIgnore
|
||||
private String params;
|
||||
>>>>>>> master
|
||||
|
||||
public Goods() {
|
||||
}
|
||||
@@ -207,6 +217,9 @@ public class Goods extends BaseEntity {
|
||||
this.intro = goodsOperationDTO.getIntro();
|
||||
this.mobileIntro = goodsOperationDTO.getMobileIntro();
|
||||
this.cost = goodsOperationDTO.getCost();
|
||||
if (goodsOperationDTO.getGoodsParamsList() != null && goodsOperationDTO.getGoodsParamsList().isEmpty()) {
|
||||
this.params = JSONUtil.toJsonStr(goodsOperationDTO.getGoodsParamsList());
|
||||
}
|
||||
//如果立即上架则
|
||||
this.marketEnable = goodsOperationDTO.isRelease() ? GoodsStatusEnum.UPPER.name() : GoodsStatusEnum.DOWN.name();
|
||||
this.goodsType=goodsOperationDTO.getGoodsType();
|
||||
|
||||
@@ -11,10 +11,7 @@ import cn.lili.common.rocketmq.tags.GoodsTagsEnum;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.config.rocketmq.RocketmqCustomProperties;
|
||||
import cn.lili.modules.goods.entity.dos.Goods;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||
import cn.lili.modules.goods.entity.dos.SpecValues;
|
||||
import cn.lili.modules.goods.entity.dos.Specification;
|
||||
import cn.lili.modules.goods.entity.dos.*;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSkuStockDTO;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
||||
@@ -26,6 +23,7 @@ import cn.lili.modules.member.entity.dos.FootPrint;
|
||||
import cn.lili.modules.member.entity.dos.MemberEvaluation;
|
||||
import cn.lili.modules.member.entity.enums.EvaluationGradeEnum;
|
||||
import cn.lili.modules.member.service.MemberEvaluationService;
|
||||
import cn.lili.modules.promotion.service.PromotionService;
|
||||
import cn.lili.modules.search.entity.dos.EsGoodsAttribute;
|
||||
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
||||
import cn.lili.modules.search.service.EsGoodsIndexService;
|
||||
@@ -83,14 +81,20 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
private GoodsService goodsService;
|
||||
//商品索引
|
||||
private EsGoodsIndexService goodsIndexService;
|
||||
@Autowired
|
||||
private ParametersService parametersService;
|
||||
@Autowired
|
||||
private PromotionService promotionService;
|
||||
|
||||
@Override
|
||||
public void add(List<Map<String, Object>> skuList, Goods goods) {
|
||||
// 检查是否需要生成索引
|
||||
boolean needIndex = checkNeedIndex(goods);
|
||||
List<GoodsSku> newSkuList;
|
||||
// 如果有规格
|
||||
if (skuList != null && !skuList.isEmpty()) {
|
||||
// 添加商品sku
|
||||
newSkuList = this.addGoodsSku(skuList, goods);
|
||||
newSkuList = this.addGoodsSku(skuList, goods, needIndex);
|
||||
} else {
|
||||
throw new ServiceException("规格必须要有一个!");
|
||||
}
|
||||
@@ -99,8 +103,23 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
generateEsCheck(goods);
|
||||
}
|
||||
|
||||
private boolean checkNeedIndex(Goods goods) {
|
||||
if (goods.getParams() != null && !goods.getParams().isEmpty()) {
|
||||
List<GoodsParams> goodsParams = JSONUtil.toList(goods.getParams(), GoodsParams.class);
|
||||
for (GoodsParams goodsParam : goodsParams) {
|
||||
Parameters parameters = parametersService.getById(goodsParam.getParamId());
|
||||
if (parameters.getIsIndex() == 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(List<Map<String, Object>> skuList, Goods goods, Boolean regeneratorSkuFlag) {
|
||||
// 检查是否需要生成索引
|
||||
boolean needIndex = checkNeedIndex(goods);
|
||||
// 是否存在规格
|
||||
if (skuList == null || skuList.isEmpty()) {
|
||||
throw new ServiceException("规格必须要有一个!");
|
||||
@@ -120,7 +139,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
//删除sku相册
|
||||
goodsGalleryService.removeByIds(oldSkuIds);
|
||||
// 添加商品sku
|
||||
newSkuList = this.addGoodsSku(skuList, goods);
|
||||
newSkuList = this.addGoodsSku(skuList, goods, needIndex);
|
||||
|
||||
//发送mq消息
|
||||
String destination = rocketmqCustomProperties.getGoodsTopic() + ":" + GoodsTagsEnum.SKU_DELETE.name();
|
||||
@@ -142,7 +161,9 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
this.updateBatchById(newSkuList);
|
||||
}
|
||||
this.updateStock(newSkuList);
|
||||
generateEsCheck(goods);
|
||||
if (Boolean.TRUE.equals(needIndex)) {
|
||||
generateEsCheck(goods);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -198,7 +219,8 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
// 获取当前商品的索引信息
|
||||
EsGoodsIndex goodsIndex = goodsIndexService.findById(skuId);
|
||||
if (goodsIndex == null) {
|
||||
goodsIndex = goodsIndexService.resetEsGoodsIndex(goodsSku);
|
||||
goodsIndex = new EsGoodsIndex(goodsSku);
|
||||
goodsIndex.setPromotionMap(promotionService.getGoodsCurrentPromotionMap(goodsIndex));
|
||||
}
|
||||
//商品规格
|
||||
GoodsSkuVO goodsSkuDetail = this.getGoodsSkuVO(goodsSku);
|
||||
@@ -416,7 +438,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
//修改规格
|
||||
this.update(goodsSku);
|
||||
//修改规格索引
|
||||
goodsIndexService.updateIndexCommentNum(goodsSku.getId(), goodsSku.getCommentNum(), (int) highPraiseNum, grade);
|
||||
goodsIndexService.updateIndexCommentNum(goodsSku.getId(), goodsSku.getCommentNum(), highPraiseNum, grade);
|
||||
|
||||
//修改商品的评价数量
|
||||
goodsService.updateGoodsCommentNum(goodsSku.getGoodsId());
|
||||
@@ -479,7 +501,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
* @param skuList sku列表
|
||||
* @param goods 商品信息
|
||||
*/
|
||||
private List<GoodsSku> addGoodsSku(List<Map<String, Object>> skuList, Goods goods) {
|
||||
private List<GoodsSku> addGoodsSku(List<Map<String, Object>> skuList, Goods goods, Boolean needIndex) {
|
||||
List<GoodsSku> skus = new ArrayList<>();
|
||||
List<EsGoodsIndex> goodsIndices = new ArrayList<>();
|
||||
for (Map<String, Object> skuVO : skuList) {
|
||||
@@ -495,9 +517,11 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
stringRedisTemplate.opsForValue().set(GoodsSkuService.getStockCacheKey(goodsSku.getId()), goodsSku.getQuantity().toString());
|
||||
}
|
||||
this.saveBatch(skus);
|
||||
String destination = rocketmqCustomProperties.getGoodsTopic() + ":" + GoodsTagsEnum.GENERATOR_GOODS_INDEX.name();
|
||||
//发送mq消息
|
||||
rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(goodsIndices), RocketmqSendCallbackBuilder.commonCallback());
|
||||
if (Boolean.TRUE.equals(needIndex)) {
|
||||
String destination = rocketmqCustomProperties.getGoodsTopic() + ":" + GoodsTagsEnum.GENERATOR_GOODS_INDEX.name();
|
||||
//发送mq消息
|
||||
rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(goodsIndices), RocketmqSendCallbackBuilder.commonCallback());
|
||||
}
|
||||
return skus;
|
||||
}
|
||||
|
||||
@@ -617,7 +641,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
||||
sku.setSmall(small);
|
||||
|
||||
//规格信息
|
||||
sku.setId(Convert.toStr(map.get("id"), "").toString());
|
||||
sku.setId(Convert.toStr(map.get("id"), ""));
|
||||
sku.setSn(Convert.toStr(map.get("sn")));
|
||||
sku.setWeight(Convert.toDouble(map.get("weight"), 0D));
|
||||
sku.setPrice(Convert.toDouble(map.get("price"), 0D));
|
||||
|
||||
@@ -15,6 +15,10 @@ import lombok.Data;
|
||||
@Data
|
||||
public class EvaluationQueryParams extends PageVO {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "买家ID")
|
||||
private String memberId;
|
||||
|
||||
@ApiModelProperty(value = "会员名称")
|
||||
private String memberName;
|
||||
|
||||
@@ -24,9 +28,6 @@ public class EvaluationQueryParams extends PageVO {
|
||||
@ApiModelProperty(value = "卖家ID")
|
||||
private String storeId;
|
||||
|
||||
@ApiModelProperty(value = "买家ID", hidden = true)
|
||||
private String memberId;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@@ -45,6 +46,9 @@ public class EvaluationQueryParams extends PageVO {
|
||||
@ApiModelProperty(value = "评论日期--结束时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
public EvaluationQueryParams() {
|
||||
|
||||
}
|
||||
@@ -78,6 +82,9 @@ public class EvaluationQueryParams extends PageVO {
|
||||
if (StringUtils.isNotEmpty(haveImage)) {
|
||||
queryWrapper.eq("have_image", haveImage);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(status)) {
|
||||
queryWrapper.eq("status", status);
|
||||
}
|
||||
queryWrapper.eq("delete_flag", false);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
return queryWrapper;
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
package cn.lili.modules.member.entity.dto;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 店铺评价查询参数
|
||||
*
|
||||
* @author Chopper
|
||||
* @date 2021/3/20 10:43
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class StoreEvaluationQueryParams extends PageVO {
|
||||
|
||||
@ApiModelProperty(value = "会员名称")
|
||||
private String memberName;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "好中差评 good:好评,neutral:中评,bad:差评", allowableValues = "GOOD,NEUTRAL,BAD")
|
||||
private String grade;
|
||||
|
||||
@ApiModelProperty(value = "评论日期--开始时间")
|
||||
private String startDate;
|
||||
|
||||
@ApiModelProperty(value = "评论日期--结束时间")
|
||||
private String endDate;
|
||||
|
||||
|
||||
public <T> QueryWrapper<T> queryWrapper() {
|
||||
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.eq("store_id", UserContext.getCurrentUser().getStoreId());
|
||||
|
||||
if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) {
|
||||
queryWrapper.between("create_time", DateUtil.parse(startDate), DateUtil.parse(endDate));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(grade)) {
|
||||
queryWrapper.eq("grade", grade);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(goodsName)) {
|
||||
queryWrapper.eq("goods_name", goodsName);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(memberName)) {
|
||||
queryWrapper.eq("member_name", memberName);
|
||||
}
|
||||
return queryWrapper;
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public interface MemberEvaluationMapper extends BaseMapper<MemberEvaluation> {
|
||||
@Select("select me.* from li_member_evaluation as me ${ew.customSqlSegment}")
|
||||
IPage<MemberEvaluationListVO> getMemberEvaluationList(IPage<MemberEvaluationListVO> page, @Param(Constants.WRAPPER) Wrapper<MemberEvaluationListVO> queryWrapper);
|
||||
|
||||
@Select("select grade,count(1) as num from li_member_evaluation Where goods_id=#{goodsId} GROUP BY grade")
|
||||
@Select("select grade,count(1) as num from li_member_evaluation Where goods_id=#{goodsId} and status='OPEN' GROUP BY grade")
|
||||
List<Map<String, Object>> getEvaluationNumber(String goodsId);
|
||||
|
||||
@Select("SELECT round( AVG( delivery_score ), 2 ) AS delivery_score" +
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package cn.lili.modules.member.service;
|
||||
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.modules.member.entity.dos.MemberEvaluation;
|
||||
import cn.lili.modules.member.entity.dto.EvaluationQueryParams;
|
||||
import cn.lili.modules.member.entity.dto.MemberEvaluationDTO;
|
||||
import cn.lili.modules.member.entity.dto.StoreEvaluationQueryParams;
|
||||
import cn.lili.modules.member.entity.vo.EvaluationNumberVO;
|
||||
import cn.lili.modules.member.entity.vo.MemberEvaluationListVO;
|
||||
import cn.lili.modules.member.entity.vo.MemberEvaluationVO;
|
||||
@@ -25,23 +23,14 @@ public interface MemberEvaluationService extends IService<MemberEvaluation> {
|
||||
* @param evaluationQueryParams 评价查询
|
||||
* @return 评价分页
|
||||
*/
|
||||
IPage<MemberEvaluation> queryByParams(EvaluationQueryParams evaluationQueryParams);
|
||||
|
||||
/**
|
||||
* 商家查询会员的评价分页列表
|
||||
*
|
||||
* @param storeEvaluationQueryParams 评价查询
|
||||
* @return 会员的评价分页
|
||||
*/
|
||||
IPage<MemberEvaluationListVO> queryByParams(StoreEvaluationQueryParams storeEvaluationQueryParams);
|
||||
IPage<MemberEvaluation> managerQuery(EvaluationQueryParams evaluationQueryParams);
|
||||
|
||||
/**
|
||||
* 查询评价分页列表
|
||||
* @param evaluationQueryParams 评价查询条件
|
||||
* @param page 分页查询参数
|
||||
* @return 评价分页列表
|
||||
*/
|
||||
IPage<MemberEvaluationListVO> queryPage(EvaluationQueryParams evaluationQueryParams, PageVO page);
|
||||
IPage<MemberEvaluationListVO> queryPage(EvaluationQueryParams evaluationQueryParams);
|
||||
|
||||
/**
|
||||
* 添加会员评价
|
||||
|
||||
@@ -3,8 +3,8 @@ package cn.lili.modules.member.serviceimpl;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.common.enums.SwitchEnum;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.SwitchEnum;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.rocketmq.RocketmqSendCallbackBuilder;
|
||||
import cn.lili.common.rocketmq.tags.GoodsTagsEnum;
|
||||
@@ -12,7 +12,6 @@ import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.security.enums.UserEnums;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.config.rocketmq.RocketmqCustomProperties;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||
@@ -20,7 +19,6 @@ import cn.lili.modules.member.entity.dos.Member;
|
||||
import cn.lili.modules.member.entity.dos.MemberEvaluation;
|
||||
import cn.lili.modules.member.entity.dto.EvaluationQueryParams;
|
||||
import cn.lili.modules.member.entity.dto.MemberEvaluationDTO;
|
||||
import cn.lili.modules.member.entity.dto.StoreEvaluationQueryParams;
|
||||
import cn.lili.modules.member.entity.enums.EvaluationGradeEnum;
|
||||
import cn.lili.modules.member.entity.vo.EvaluationNumberVO;
|
||||
import cn.lili.modules.member.entity.vo.MemberEvaluationListVO;
|
||||
@@ -42,7 +40,6 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -81,12 +78,13 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
|
||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||
|
||||
@Override
|
||||
public IPage<MemberEvaluation> queryByParams(EvaluationQueryParams queryParams) {
|
||||
public IPage<MemberEvaluation> managerQuery(EvaluationQueryParams queryParams) {
|
||||
//获取评价分页
|
||||
return this.page(PageUtil.initPage(queryParams), queryParams.queryWrapper());
|
||||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public IPage<MemberEvaluationListVO> queryByParams(StoreEvaluationQueryParams storeEvaluationQueryParams) {
|
||||
return this.baseMapper.getMemberEvaluationList(PageUtil.initPage(storeEvaluationQueryParams), storeEvaluationQueryParams.queryWrapper());
|
||||
}
|
||||
@@ -95,6 +93,12 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
|
||||
public IPage<MemberEvaluationListVO> queryPage(EvaluationQueryParams evaluationQueryParams, PageVO page) {
|
||||
return this.baseMapper.getMemberEvaluationList(PageUtil.initPage(page), evaluationQueryParams.queryWrapper());
|
||||
}
|
||||
=======
|
||||
public IPage<MemberEvaluationListVO> queryPage(EvaluationQueryParams evaluationQueryParams) {
|
||||
return memberEvaluationMapper.getMemberEvaluationList(PageUtil.initPage(evaluationQueryParams), evaluationQueryParams.queryWrapper());
|
||||
}
|
||||
|
||||
>>>>>>> master
|
||||
|
||||
@Override
|
||||
public MemberEvaluationDTO addMemberEvaluation(MemberEvaluationDTO memberEvaluationDTO) {
|
||||
@@ -103,7 +107,7 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
|
||||
//获取订单信息
|
||||
Order order = orderService.getBySn(orderItem.getOrderSn());
|
||||
//检测是否可以添加会员评价
|
||||
checkMemberEvaluation(orderItem,order);
|
||||
checkMemberEvaluation(orderItem, order);
|
||||
//获取用户信息
|
||||
Member member = memberService.getUserInfo();
|
||||
//获取商品信息
|
||||
@@ -162,6 +166,7 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
|
||||
EvaluationNumberVO evaluationNumberVO = new EvaluationNumberVO();
|
||||
List<Map<String, Object>> list = this.baseMapper.getEvaluationNumber(goodsId);
|
||||
|
||||
|
||||
Integer good = 0;
|
||||
Integer moderate = 0;
|
||||
Integer worse = 0;
|
||||
@@ -201,10 +206,11 @@ public class MemberEvaluationServiceImpl extends ServiceImpl<MemberEvaluationMap
|
||||
|
||||
/**
|
||||
* 检测会员评价
|
||||
*
|
||||
* @param orderItem 子订单
|
||||
* @param order 订单
|
||||
* @param order 订单
|
||||
*/
|
||||
public void checkMemberEvaluation(OrderItem orderItem,Order order){
|
||||
public void checkMemberEvaluation(OrderItem orderItem, Order order) {
|
||||
|
||||
//根据子订单编号判断是否评价过
|
||||
if (orderItem.getCommentStatus().equals(CommentStatusEnum.FINISHED.name())) {
|
||||
|
||||
@@ -4,6 +4,18 @@ import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.base.BaseEntity;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.modules.base.entity.enums.ClientTypeEnum;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
import cn.lili.modules.order.cart.entity.enums.CartTypeEnum;
|
||||
import cn.lili.modules.order.cart.entity.enums.DeliveryMethodEnum;
|
||||
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
||||
import cn.lili.modules.order.order.entity.enums.DeliverStatusEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.OrderTypeEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
||||
import cn.lili.modules.promotion.entity.dos.PromotionGoods;
|
||||
import cn.lili.modules.promotion.entity.enums.PromotionTypeEnum;
|
||||
>>>>>>> master
|
||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||
import cn.lili.modules.order.cart.entity.enums.CartTypeEnum;
|
||||
import cn.lili.modules.order.cart.entity.enums.DeliveryMethodEnum;
|
||||
@@ -209,12 +221,27 @@ public class Order extends BaseEntity {
|
||||
BeanUtil.copyProperties(tradeDTO, this);
|
||||
BeanUtil.copyProperties(cartVO.getPriceDetailDTO(), this);
|
||||
BeanUtil.copyProperties(cartVO, this);
|
||||
<<<<<<< HEAD
|
||||
|
||||
//订单类型判断--普通订单,活动订单。
|
||||
if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.CART) || tradeDTO.getCartTypeEnum().equals(CartTypeEnum.BUY_NOW)) {
|
||||
this.setOrderType(OrderTypeEnum.NORMAL.name());
|
||||
} else {
|
||||
this.setOrderType(tradeDTO.getCartTypeEnum().name());
|
||||
=======
|
||||
this.setId(oldId);
|
||||
this.setOrderType(OrderTypeEnum.NORMAL.name());
|
||||
//促销信息填充
|
||||
if (cartVO.getSkuList().get(0).getPromotions() != null && tradeDTO.getCartTypeEnum().equals(CartTypeEnum.PINTUAN)) {
|
||||
Optional<String> pintuanId = cartVO.getSkuList().get(0).getPromotions().stream().filter(i -> i.getPromotionType().equals(PromotionTypeEnum.PINTUAN.name())).map(PromotionGoods::getPromotionId).findFirst();
|
||||
if (pintuanId.isPresent()) {
|
||||
promotionId = pintuanId.get();
|
||||
this.setOrderType(OrderTypeEnum.PINTUAN.name());
|
||||
if (tradeDTO.getParentOrderSn() == null) {
|
||||
this.setParentOrderSn("");
|
||||
}
|
||||
}
|
||||
>>>>>>> master
|
||||
}
|
||||
|
||||
//设置默认支付状态
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.lili.modules.payment.kit.params.dto;
|
||||
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
@@ -41,4 +42,11 @@ public class CashierParam {
|
||||
|
||||
@ApiModelProperty(value = "剩余余额")
|
||||
private Double walletValue;
|
||||
|
||||
public String getDetail() {
|
||||
if (StringUtils.isEmpty(detail)) {
|
||||
return "清单详细";
|
||||
}
|
||||
return StringUtils.filterSpecialChart(detail);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@ import cn.hutool.core.net.URLDecoder;
|
||||
import cn.hutool.core.net.URLEncoder;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.common.utils.SnowFlake;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -63,11 +64,9 @@ public class AliPayPlugin implements Payment {
|
||||
@Autowired
|
||||
private ApiProperties apiProperties;
|
||||
|
||||
|
||||
@Override
|
||||
public ResultMessage<Object> h5pay(HttpServletRequest request, HttpServletResponse response, PayParam payParam) {
|
||||
|
||||
|
||||
CashierParam cashierParam = cashierSupport.cashierParam(payParam);
|
||||
//请求订单编号
|
||||
String outTradeNo = SnowFlake.getIdStr();
|
||||
@@ -77,12 +76,13 @@ public class AliPayPlugin implements Payment {
|
||||
payModel.setSubject(cashierParam.getDetail());
|
||||
payModel.setTotalAmount(cashierParam.getPrice() + "");
|
||||
//回传数据
|
||||
payModel.setPassbackParams(URLEncoder.createAll().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8));
|
||||
payModel.setPassbackParams(URLEncoder.createAll().encode(BeanUtil.formatKeyValuePair(payParam), StandardCharsets.UTF_8));
|
||||
//3分钟超时
|
||||
payModel.setTimeoutExpress("3m");
|
||||
payModel.setOutTradeNo(outTradeNo);
|
||||
payModel.setProductCode("QUICK_WAP_PAY");
|
||||
try {
|
||||
log.info("支付宝H5支付:{}", JSONUtil.toJsonStr(payModel));
|
||||
AliPayRequest.wapPay(response, payModel, callbackUrl(apiProperties.getBuyer(), PaymentMethodEnum.ALIPAY),
|
||||
notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.ALIPAY));
|
||||
} catch (Exception e) {
|
||||
@@ -115,11 +115,13 @@ public class AliPayPlugin implements Payment {
|
||||
//3分钟超时
|
||||
payModel.setTimeoutExpress("3m");
|
||||
//回传数据
|
||||
payModel.setPassbackParams(URLEncoder.createAll().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8));
|
||||
payModel.setPassbackParams(URLEncoder.createAll().encode(BeanUtil.formatKeyValuePair(payParam), StandardCharsets.UTF_8));
|
||||
payModel.setOutTradeNo(outTradeNo);
|
||||
payModel.setProductCode("QUICK_MSECURITY_PAY");
|
||||
|
||||
log.info("支付宝APP支付:{}", payModel);
|
||||
String orderInfo = AliPayRequest.appPayToResponse(payModel, notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.ALIPAY)).getBody();
|
||||
log.info("支付宝APP支付返回内容:{}", orderInfo);
|
||||
return ResultUtil.data(orderInfo);
|
||||
} catch (AlipayApiException e) {
|
||||
log.error("支付宝支付异常:", e);
|
||||
@@ -146,12 +148,14 @@ public class AliPayPlugin implements Payment {
|
||||
payModel.setTotalAmount(cashierParam.getPrice() + "");
|
||||
|
||||
//回传数据
|
||||
payModel.setPassbackParams(URLEncoder.createAll().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8));
|
||||
payModel.setPassbackParams(URLEncoder.createAll().encode(BeanUtil.formatKeyValuePair(payParam), StandardCharsets.UTF_8));
|
||||
// payModel.setStoreId("store_id");
|
||||
payModel.setTimeoutExpress("3m");
|
||||
payModel.setOutTradeNo(outTradeNo);
|
||||
|
||||
log.info("支付宝扫码:{}", payModel);
|
||||
String resultStr = AliPayRequest.tradePrecreatePayToResponse(payModel, notifyUrl(apiProperties.getBuyer(), PaymentMethodEnum.ALIPAY)).getBody();
|
||||
|
||||
log.info("支付宝扫码交互返回:{}", resultStr);
|
||||
JSONObject jsonObject = JSONObject.parseObject(resultStr);
|
||||
return ResultUtil.data(jsonObject.getJSONObject("alipay_trade_precreate_response").getString("qr_code"));
|
||||
} catch (Exception e) {
|
||||
@@ -212,7 +216,7 @@ public class AliPayPlugin implements Payment {
|
||||
}
|
||||
refundLogService.save(refundLog);
|
||||
} catch (Exception e) {
|
||||
log.error("支付宝退款异常",e);
|
||||
log.error("支付宝退款异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +253,7 @@ public class AliPayPlugin implements Payment {
|
||||
|
||||
String payParamStr = map.get("passback_params");
|
||||
String payParamJson = URLDecoder.decode(payParamStr, StandardCharsets.UTF_8);
|
||||
PayParam payParam = JSONUtil.toBean(payParamJson, PayParam.class);
|
||||
PayParam payParam = BeanUtil.formatKeyValuePair(payParamJson, new PayParam());
|
||||
|
||||
|
||||
if (verifyResult) {
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
package cn.lili.modules.payment.kit.plugin.wechat.model;
|
||||
//这个目录的很多类的属性都是下划线分割,不符合本产品的驼峰类型约定,后续会进行处理
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* 项目部分参考 IJPay
|
||||
* git地址 https://gitee.com/javen205/IJPay
|
||||
*/
|
||||
package cn.lili.modules.payment;
|
||||
@@ -24,6 +24,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 商品索引
|
||||
*
|
||||
* @author paulG
|
||||
* @date 2020/10/13
|
||||
**/
|
||||
@@ -248,35 +249,6 @@ public class EsGoodsIndex implements Serializable {
|
||||
private Map<String, Object> promotionMap;
|
||||
|
||||
|
||||
public void setGoodsSku(GoodsSku sku) {
|
||||
if (sku != null) {
|
||||
this.id = sku.getId();
|
||||
this.goodsId = sku.getGoodsId();
|
||||
this.goodsName = sku.getGoodsName();
|
||||
this.price = sku.getPrice();
|
||||
this.storeName = sku.getStoreName();
|
||||
this.storeId = sku.getStoreId();
|
||||
this.thumbnail = sku.getThumbnail();
|
||||
this.categoryPath = sku.getCategoryPath();
|
||||
this.goodsVideo = sku.getGoodsVideo();
|
||||
this.mobileIntro = sku.getMobileIntro();
|
||||
this.buyCount = sku.getBuyCount();
|
||||
this.commentNum = sku.getCommentNum();
|
||||
this.small = sku.getSmall();
|
||||
this.brandId = sku.getBrandId();
|
||||
this.sn = sku.getSn();
|
||||
this.storeCategoryPath = sku.getStoreCategoryPath();
|
||||
this.sellingPoint = sku.getSellingPoint();
|
||||
this.selfOperated = sku.getSelfOperated();
|
||||
this.salesModel = sku.getSalesModel();
|
||||
this.marketEnable = sku.getMarketEnable();
|
||||
this.isAuth = sku.getIsAuth();
|
||||
this.intro = sku.getIntro();
|
||||
this.grade = sku.getGrade();
|
||||
this.releaseTime = new Date();
|
||||
}
|
||||
}
|
||||
|
||||
public EsGoodsIndex(GoodsSku sku) {
|
||||
if (sku != null) {
|
||||
this.id = sku.getId();
|
||||
@@ -320,4 +292,33 @@ public class EsGoodsIndex implements Serializable {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setGoodsSku(GoodsSku sku) {
|
||||
if (sku != null) {
|
||||
this.id = sku.getId();
|
||||
this.goodsId = sku.getGoodsId();
|
||||
this.goodsName = sku.getGoodsName();
|
||||
this.price = sku.getPrice();
|
||||
this.storeName = sku.getStoreName();
|
||||
this.storeId = sku.getStoreId();
|
||||
this.thumbnail = sku.getThumbnail();
|
||||
this.categoryPath = sku.getCategoryPath();
|
||||
this.goodsVideo = sku.getGoodsVideo();
|
||||
this.mobileIntro = sku.getMobileIntro();
|
||||
this.buyCount = sku.getBuyCount();
|
||||
this.commentNum = sku.getCommentNum();
|
||||
this.small = sku.getSmall();
|
||||
this.brandId = sku.getBrandId();
|
||||
this.sn = sku.getSn();
|
||||
this.storeCategoryPath = sku.getStoreCategoryPath();
|
||||
this.sellingPoint = sku.getSellingPoint();
|
||||
this.selfOperated = sku.getSelfOperated();
|
||||
this.salesModel = sku.getSalesModel();
|
||||
this.marketEnable = sku.getMarketEnable();
|
||||
this.isAuth = sku.getIsAuth();
|
||||
this.intro = sku.getIntro();
|
||||
this.grade = sku.getGrade();
|
||||
this.releaseTime = new Date();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user