修复优惠券部分
This commit is contained in:
@@ -169,6 +169,11 @@
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.14.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -57,7 +58,7 @@ public class CouponController {
|
||||
private final YxStoreCouponUserService storeCouponUserService;
|
||||
|
||||
/**
|
||||
* 可领取优惠券列表
|
||||
* 领券中心优惠券列表
|
||||
*/
|
||||
@AuthCheck
|
||||
@GetMapping("/coupons")
|
||||
@@ -67,7 +68,7 @@ public class CouponController {
|
||||
@ApiImplicitParam(name = "productId", value = "产品ID", paramType = "query", dataType = "int",dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "type", value = "优惠券类型 0通用券 1商品券 2内部券", paramType = "query", dataType = "int",dataTypeClass = Integer.class)
|
||||
})
|
||||
@ApiOperation(value = "可领取优惠券列表",notes = "可领取优惠券列表")
|
||||
@ApiOperation(value = "领券中心优惠券列表",notes = "领券中心优惠券列表")
|
||||
public ApiResult<List<YxStoreCouponIssueQueryVo>> getList(@RequestParam(value = "page",defaultValue = "1") int page,
|
||||
@RequestParam(value = "limit",defaultValue = "10") int limit,
|
||||
@RequestParam(value = "productId",required = false) Long productId,
|
||||
@@ -76,6 +77,9 @@ public class CouponController {
|
||||
return ApiResult.ok(couponIssueService.getCouponList(page, limit,uid,productId,type));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 领取优惠券
|
||||
*/
|
||||
@@ -107,6 +111,53 @@ public class CouponController {
|
||||
return ApiResult.ok(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户已失效优惠券
|
||||
*/
|
||||
@AppLog(value = "查看用户已失效优惠券", type = 1)
|
||||
@AuthCheck
|
||||
@GetMapping("/coupons/userFailure/{type}")
|
||||
@ApiOperation(value = "用户已失效优惠券",notes = "用户已失效优惠券")
|
||||
public ApiResult<List<YxStoreCouponUserQueryVo>> getUserFailureList(){
|
||||
Long uid = LocalUser.getUser().getUid();
|
||||
List<YxStoreCouponUserQueryVo> list = storeCouponUserService.getUserCoupon(uid);
|
||||
List<YxStoreCouponUserQueryVo> list1 = new ArrayList<>();
|
||||
for (YxStoreCouponUserQueryVo couponUser : list) {
|
||||
if (couponUser.getIsFail() == 1){//已失效
|
||||
list1.add(couponUser);
|
||||
}
|
||||
}
|
||||
return ApiResult.ok(list1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户可领取优惠券列表
|
||||
*/
|
||||
@AuthCheck
|
||||
@GetMapping("/coupons/canReceive")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "页码,默认为1", paramType = "query", dataType = "int",dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "limit", value = "页大小,默认为10", paramType = "query", dataType = "int",dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "productId", value = "产品ID", paramType = "query", dataType = "int",dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "type", value = "优惠券类型 0通用券 1商品券 2内部券", paramType = "query", dataType = "int",dataTypeClass = Integer.class)
|
||||
})
|
||||
@ApiOperation(value = "用户可领取优惠券列表",notes = "用户可领取优惠券列表")
|
||||
public ApiResult<List<YxStoreCouponIssueQueryVo>> canReceive(@RequestParam(value = "page",defaultValue = "1") int page,
|
||||
@RequestParam(value = "limit",defaultValue = "10") int limit,
|
||||
@RequestParam(value = "productId",required = false) Long productId,
|
||||
@RequestParam(value = "type",required = false) Integer type){
|
||||
Long uid = LocalUser.getUser().getUid();
|
||||
List<YxStoreCouponIssueQueryVo> list=couponIssueService.getCouponList(page, limit,uid,productId,type);
|
||||
List<YxStoreCouponIssueQueryVo> list1 = new ArrayList<>();
|
||||
for (YxStoreCouponIssueQueryVo couponIssue : list) {
|
||||
if(!couponIssue.getIsUse()){
|
||||
list1.add(couponIssue);
|
||||
}
|
||||
}
|
||||
return ApiResult.ok(list1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户已领取优惠券pc
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package co.yixiang.app.modules.user.rest;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
|
||||
import co.yixiang.modules.shop.service.YxSystemConfigService;
|
||||
import co.yixiang.tools.domain.QiniuContent;
|
||||
import co.yixiang.tools.service.QiNiuService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/upload")
|
||||
public class AppUploadController {
|
||||
|
||||
@Autowired
|
||||
private YxSystemConfigService systemConfigService;
|
||||
|
||||
@Autowired
|
||||
private QiNiuService qiNiuService;
|
||||
|
||||
@ApiOperation("上传文件")
|
||||
@PostMapping
|
||||
public ApiResult<?> create(@RequestParam(defaultValue = "") String name,
|
||||
@RequestParam(defaultValue = "") String type,
|
||||
@RequestParam("file") MultipartFile[] files) {
|
||||
|
||||
StringBuilder url = new StringBuilder();
|
||||
for (MultipartFile file : files) {
|
||||
QiniuContent qiniuContent = qiNiuService.upload(file, qiNiuService.find());
|
||||
if ("".equals(url.toString())) {
|
||||
url = url.append(qiniuContent.getUrl());
|
||||
System.out.println("".equals(url.toString()));
|
||||
}else{
|
||||
url = url.append(",").append(qiniuContent.getUrl());
|
||||
}
|
||||
}
|
||||
|
||||
return ApiResult.ok(url);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -184,7 +184,9 @@ public class LetterAppUserController {
|
||||
@RequestParam(value = "limit",defaultValue = "10") int limit,
|
||||
@RequestParam(value = "type") String type){
|
||||
Long uid = LocalUser.getUser().getUid();
|
||||
return ApiResult.ok(evaluationRelationService.userCollectEvaluation(page,limit,uid,type));
|
||||
List list=evaluationRelationService.userCollectEvaluation(page,limit,uid,type);
|
||||
// return ApiResult.ok(evaluationRelationService.userCollectEvaluation(page,limit,uid,type));
|
||||
return ApiResult.ok(list);
|
||||
}
|
||||
/**
|
||||
* 用户资金统计
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package co.yixiang.constant;
|
||||
|
||||
public class SystemConfigConstants {
|
||||
//机器人链接地址
|
||||
public final static String ROBOT_URL="robotUrl";
|
||||
//机器人消息跳转网址
|
||||
public final static String CARD_ACTION_URL="cardActionUrl";
|
||||
|
||||
//地址配置
|
||||
public final static String API="api";
|
||||
public final static String API_URL="api_url";
|
||||
|
||||
@@ -72,14 +72,14 @@ public class YxStoreCoupon extends BaseDomain {
|
||||
// @ApiModelProperty(value = "优惠券有效期限(单位:天;几号到几号)")
|
||||
// private Object useTime;
|
||||
|
||||
/** 优惠券开始使用期限(单位:天) */
|
||||
/** 优惠券开始使用时间 */
|
||||
@NotNull(message = "请输入开始期限")
|
||||
@ApiModelProperty(value = "优惠券使用期限(单位:天)")
|
||||
@ApiModelProperty(value = "优惠券开始使用时间")
|
||||
private String useStartTime;
|
||||
|
||||
/** 优惠券结束使用期限(单位:天) */
|
||||
/** 优惠券结束使用时间 */
|
||||
@NotNull(message = "请输入有效结束期限")
|
||||
@ApiModelProperty(value = "优惠券失效期限(单位:天)")
|
||||
@ApiModelProperty(value = "优惠券结束使用时间")
|
||||
private String useEndTime;
|
||||
|
||||
/** 排序 */
|
||||
|
||||
@@ -63,10 +63,13 @@ public class YxStoreCouponUser extends BaseDomain {
|
||||
private BigDecimal useMinPrice;
|
||||
|
||||
|
||||
/** 优惠券结束时间 */
|
||||
@ApiModelProperty(value = "优惠券结束时间")
|
||||
private Date endTime;
|
||||
/** 优惠券有效期结束时间 */
|
||||
@ApiModelProperty(value = "优惠券有效期结束时间")
|
||||
private Date useEndTime;
|
||||
|
||||
/** 优惠券有效期开始时间 */
|
||||
@ApiModelProperty(value = "优惠券有效期开始时间")
|
||||
private Date useStartTime;
|
||||
|
||||
// /** 使用时间 */
|
||||
// @ApiModelProperty(value = "使用时间")
|
||||
|
||||
+6
-7
@@ -194,7 +194,7 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
|
||||
}else if (couponUser.getStatus() == 2){
|
||||
queryVo.set_type(CouponEnum.USE_0.getValue());
|
||||
queryVo.set_msg("已过期");
|
||||
}else if(couponUser.getCreateTime().getTime() > nowTime || couponUser.getEndTime().getTime() < nowTime){
|
||||
}else if(couponUser.getCreateTime().getTime() > nowTime || couponUser.getUseEndTime().getTime() < nowTime){
|
||||
queryVo.set_type(CouponEnum.USE_0.getValue());
|
||||
queryVo.set_msg("已过期");
|
||||
}else{
|
||||
@@ -222,16 +222,15 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
|
||||
// Date now = new Date();
|
||||
// Date endTime = DateUtil.offsetDay(now,storeCoupon.getCouponTime());
|
||||
|
||||
// //有效期改为时间段,不需要偏移,切割开始日期和截止日期
|
||||
// DateTime endTime = new DateTime(time[1]);
|
||||
DateTime endTime =new DateTime(storeCoupon.getUseEndTime().toString());
|
||||
DateTime endTime =new DateTime(storeCoupon.getUseEndTime());
|
||||
YxStoreCouponUser storeCouponUser = YxStoreCouponUser.builder()
|
||||
.cid(storeCoupon.getId())
|
||||
.uid(uid)
|
||||
.couponPrice(storeCoupon.getCouponPrice())
|
||||
.couponTitle(storeCoupon.getTitle())
|
||||
.useMinPrice(storeCoupon.getUseMinPrice())
|
||||
.endTime(endTime)
|
||||
.useStartTime(new Date(storeCoupon.getUseStartTime()))
|
||||
.useEndTime(new Date(storeCoupon.getUseEndTime()))
|
||||
.type(CouponGetEnum.GET.getValue())
|
||||
.build();
|
||||
|
||||
@@ -270,7 +269,7 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
|
||||
private void checkInvalidCoupon() {
|
||||
Date nowTime = new Date();
|
||||
LambdaQueryWrapper<YxStoreCouponUser> wrapper= new LambdaQueryWrapper<>();
|
||||
wrapper.lt(YxStoreCouponUser::getEndTime,nowTime)
|
||||
wrapper.lt(YxStoreCouponUser::getUseEndTime,nowTime)
|
||||
.eq(YxStoreCouponUser::getStatus,CouponEnum.STATUS_0.getValue());
|
||||
YxStoreCouponUser couponUser = new YxStoreCouponUser();
|
||||
couponUser.setStatus(CouponEnum.STATUS_2.getValue());
|
||||
@@ -344,7 +343,7 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
|
||||
}else if (couponUser.getStatus() == 2){
|
||||
queryVo.set_type(CouponEnum.USE_0.getValue());
|
||||
queryVo.set_msg("已过期");
|
||||
}else if(couponUser.getCreateTime().getTime() > nowTime || couponUser.getEndTime().getTime() < nowTime){
|
||||
}else if(couponUser.getCreateTime().getTime() > nowTime || couponUser.getUseEndTime().getTime() < nowTime){
|
||||
queryVo.set_type(CouponEnum.USE_0.getValue());
|
||||
queryVo.set_msg("已过期");
|
||||
}else{
|
||||
|
||||
@@ -44,12 +44,20 @@ public class YxStoreCouponUserQueryVo implements Serializable {
|
||||
@ApiModelProperty(value = "优惠券创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "优惠券结束时间")
|
||||
@ApiModelProperty(value = "优惠券有效期开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
||||
private Date endTime;
|
||||
private Date useStartTime;
|
||||
|
||||
@ApiModelProperty(value = "使用时间")
|
||||
private Date useTime;
|
||||
// @ApiModelProperty(value = "优惠券结束时间")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
||||
// private Date endTime;
|
||||
|
||||
@ApiModelProperty(value = "优惠券有效期结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
||||
private Date useEndTime;
|
||||
|
||||
// @ApiModelProperty(value = "使用时间")
|
||||
// private Date useTime;
|
||||
|
||||
@ApiModelProperty(value = "获取方式")
|
||||
private String type;
|
||||
|
||||
+2
-2
@@ -55,8 +55,8 @@ import java.util.*;
|
||||
* @date 2022-10-21
|
||||
*/
|
||||
@Service
|
||||
//@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
||||
//@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class YxEvaluationServiceImpl extends BaseServiceImpl<YxEvaluationMapper, YxEvaluation> implements YxEvaluationService {
|
||||
|
||||
@Autowired
|
||||
|
||||
+2
-1
@@ -23,7 +23,8 @@ import java.util.List;
|
||||
public interface YxEvaluationRelationMapper extends CoreMapper<YxStoreEvaluationRelation> {
|
||||
|
||||
|
||||
@Select("select B.id,B.home_image as homeImage" +
|
||||
@Select("select B.id evaluation_id,B.home_image as homeImage,A.id id," +
|
||||
"B.is_show as isShow"+
|
||||
" from yx_store_evaluation_relation A left join yx_evaluation B " +
|
||||
"on A.evaluation_id = B.id where A.uid=#{uid} and A.is_del = 0 and B.is_del = 0 order by A.create_time desc")
|
||||
List<YxStoreEvaluationRelationQueryVo> selectRelationList(Page page, @Param("uid") Long uid);
|
||||
|
||||
+6
-3
@@ -1,9 +1,12 @@
|
||||
package co.yixiang.modules.evaluation.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "YxStoreEvaluationRelationQueryVo对象", description = "评测收藏表查询参数")
|
||||
public class YxStoreEvaluationRelationQueryVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -13,8 +16,8 @@ public class YxStoreEvaluationRelationQueryVo {
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Long uid;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Long productId;
|
||||
@ApiModelProperty(value = "评测ID")
|
||||
private Long evaluationId;
|
||||
|
||||
@ApiModelProperty(value = "类型(收藏(collect")
|
||||
private String type;
|
||||
|
||||
@@ -2,11 +2,23 @@ package co.yixiang.modules.inform.domin;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/****整体卡片的点击跳转事件,text_notice模版卡片中该字段为必填项
|
||||
* 卡片跳转类型,1 代表跳转url,2 代表打开小程序。text_notice模版卡片中该字段取值范围为[1,2]
|
||||
*/
|
||||
@Data
|
||||
public class CardAction {
|
||||
|
||||
/**代表跳转url,2 代表打开小程序*/
|
||||
private Integer type;
|
||||
|
||||
/**跳转事件的url,card_action.type是1时必填*/
|
||||
private String url;
|
||||
|
||||
/**跳转事件的小程序的appid,card_action.type是2时必填*/
|
||||
private String appid;
|
||||
|
||||
/**跳转事件的小程序的pagepath,card_action.type是2时选填*/
|
||||
private String pagepath;
|
||||
|
||||
}
|
||||
|
||||
@@ -16,10 +16,16 @@ import lombok.Data;
|
||||
}*/
|
||||
@Data
|
||||
public class Jump {
|
||||
/***,0或不填代表不是链接,1 代表跳转url,2 代表跳转小程序
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
private String appid;
|
||||
|
||||
private String url;
|
||||
|
||||
private String title;
|
||||
|
||||
private String pagepath;
|
||||
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ import java.util.ArrayList;
|
||||
@Service
|
||||
public class TemplateCard {
|
||||
|
||||
// /**消息类型*/
|
||||
// private String msgtype ;
|
||||
/** 模板卡片的模板类型*/
|
||||
private String card_type;
|
||||
|
||||
|
||||
+27
-9
@@ -18,14 +18,18 @@ import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Node;
|
||||
import org.jsoup.nodes.TextNode;
|
||||
@Service
|
||||
public class SendMsgServiceImpl implements SendMsgService {
|
||||
|
||||
@@ -75,27 +79,41 @@ public class SendMsgServiceImpl implements SendMsgService {
|
||||
public TemplateCard creatTemplatecard(long orderId,int type){
|
||||
YxStoreOrderDto yxStoreOrderDto=yxStoreOrderService.getOrderDetailByOrderId(orderId);
|
||||
String mainTitle;
|
||||
ArrayList<HorizontalContent> arrayList=new ArrayList<>();
|
||||
arrayList.add(new HorizontalContent().setKeyname("会员名称").setValue(yxStoreOrderDto.getRealName()));
|
||||
arrayList.add(new HorizontalContent().setKeyname("会员手机号").setValue(yxStoreOrderDto.getUserPhone()));
|
||||
if (type==0){//支付时候
|
||||
mainTitle="有新的在线订单来啦";
|
||||
arrayList.add(new HorizontalContent().setKeyname("下单地址").setValue(yxStoreOrderDto.getUserAddress()));
|
||||
arrayList.add(new HorizontalContent().setKeyname("下单时间").setValue(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(yxStoreOrderDto.getCreateTime())));
|
||||
}else {
|
||||
mainTitle="有新的退款申请";
|
||||
//获取Document模型
|
||||
Document docDesc = Jsoup.parse(yxStoreOrderDto.getStatusName());
|
||||
//获取span节点
|
||||
ArrayList<Element> list=docDesc.getElementsByTag("span");
|
||||
//获取文本内容,并且截取只需要标题后面的
|
||||
arrayList.add(new HorizontalContent().setKeyname("退款原因").setValue(list.get(0).text().substring(5)));
|
||||
arrayList.add(new HorizontalContent().setKeyname("备注说明").setValue(list.get(1).text().substring(5).length()==0?list.get(1).text().substring(5):"本次退款无备注"));
|
||||
arrayList.add(new HorizontalContent().setKeyname("申请时间").setValue(list.get(2).text().substring(5)));
|
||||
}
|
||||
templateCard.setHorizontal_content_list(arrayList);
|
||||
templateCard.setCard_type("text_notice");
|
||||
templateCard.setSource(new Souce().setDesc("眼界甄选").setIcon_url("https://wework.qpic.cn/wwpic/252813_jOfDHtcISzuodLa_1629280209/0").setDesc_color(0));
|
||||
templateCard.setMain_title(new MainTitle().setTitle(mainTitle).setDesc("订单号:"+orderId));
|
||||
templateCard.setEmphasis_content(new EmphasisContent().setTitle(yxStoreOrderDto.getPayPrice().toString()).setDesc("订单总金额"));
|
||||
// templateCard.setQuote_area(new QuoteArea().setType(0).setUrl("").setAppid("APPID").setTitle("订单详情").setQuote_text("眼镜*1 0.01"));
|
||||
templateCard.setSub_title_text("订单类型:"+yxStoreOrderDto.getPinkName());//订单类型
|
||||
ArrayList<HorizontalContent> arrayList=new ArrayList<>();
|
||||
arrayList.add(new HorizontalContent().setKeyname("下单地址").setValue(yxStoreOrderDto.getUserAddress()));
|
||||
arrayList.add(new HorizontalContent().setKeyname("下单时间").setValue(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(yxStoreOrderDto.getCreateTime())));
|
||||
arrayList.add(new HorizontalContent().setKeyname("会员名称").setValue(yxStoreOrderDto.getRealName()));
|
||||
arrayList.add(new HorizontalContent().setKeyname("会员手机号").setValue(yxStoreOrderDto.getUserPhone()));
|
||||
templateCard.setHorizontal_content_list(arrayList);
|
||||
ArrayList<Jump> arrayList1=new ArrayList<>();
|
||||
arrayList1.add(new Jump().setType(1).setUrl("https://work.weixin.qq.com/?from=openApi").setTitle("前去处理订单"));
|
||||
//机器人消息跳转地址
|
||||
String cardActionUrl = systemConfigService.getData(SystemConfigConstants.CARD_ACTION_URL);
|
||||
if(StrUtil.isBlank(cardActionUrl)){
|
||||
// throw new YshopException("未配置企业微信群机器人跳转地址");
|
||||
cardActionUrl="未配置跳转网址";
|
||||
}
|
||||
arrayList1.add(new Jump().setType(1).setUrl(cardActionUrl).setTitle("前去处理订单"));
|
||||
templateCard.setJump_list(arrayList1);
|
||||
templateCard.setCard_action(new CardAction().setType(1).setUrl("https://work.weixin.qq.com/?from=openApi"));
|
||||
templateCard.setCard_action(new CardAction().setType(1).setUrl(cardActionUrl));
|
||||
return templateCard;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,6 +133,11 @@ public class YxStoreOrder extends BaseDomain {
|
||||
/** 退款时间 */
|
||||
private Date refundReasonTime;
|
||||
|
||||
/** 退款联系人 */
|
||||
private String refundName;
|
||||
|
||||
/** 退款联系电话 */
|
||||
private String refundPhone;
|
||||
|
||||
/** 前台退款原因 */
|
||||
private String refundReasonWap;
|
||||
|
||||
@@ -112,6 +112,12 @@ public class YxStoreOrderDto implements Serializable {
|
||||
// 退款用户说明
|
||||
private String refundReasonWapExplain;
|
||||
|
||||
/** 退款联系人 */
|
||||
private String refundName;
|
||||
|
||||
/** 退款联系电话 */
|
||||
private String refundPhone;
|
||||
|
||||
// 退款时间
|
||||
private Date refundReasonTime;
|
||||
|
||||
|
||||
+11
-3
@@ -75,6 +75,7 @@ import co.yixiang.modules.user.service.YxUserBillService;
|
||||
import co.yixiang.modules.user.service.YxUserLevelService;
|
||||
import co.yixiang.modules.user.service.YxUserService;
|
||||
import co.yixiang.modules.user.service.dto.YxUserDto;
|
||||
import co.yixiang.modules.user.service.mapper.BxgUserMapper;
|
||||
import co.yixiang.modules.user.vo.YxUserQueryVo;
|
||||
import co.yixiang.tools.domain.AlipayConfig;
|
||||
import co.yixiang.tools.domain.vo.TradeVo;
|
||||
@@ -122,6 +123,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
||||
@Autowired
|
||||
private IGenerator generator;
|
||||
|
||||
@Autowired
|
||||
private StoreOrderMapper storeOrderMapper;
|
||||
@Autowired
|
||||
private YxStorePinkService storePinkService;
|
||||
@Autowired
|
||||
@@ -130,6 +133,9 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
||||
private YxStoreCartService storeCartService;
|
||||
@Autowired
|
||||
private YxUserAddressService userAddressService;
|
||||
|
||||
@Autowired
|
||||
private BxgUserMapper bxgUserMapper;
|
||||
@Autowired
|
||||
private YxStoreOrderCartInfoService orderCartInfoService;
|
||||
@Autowired
|
||||
@@ -1082,7 +1088,6 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
||||
throw new YshopException("订单当前无法退款");
|
||||
}
|
||||
|
||||
|
||||
YxStoreOrder storeOrder = new YxStoreOrder();
|
||||
storeOrder.setRefundStatus(OrderInfoEnum.REFUND_STATUS_1.getValue());
|
||||
storeOrder.setRefundReasonTime(new Date());
|
||||
@@ -1096,8 +1101,6 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
||||
orderStatusService.create(order.getId(),
|
||||
OrderLogEnum.REFUND_ORDER_APPLY.getValue(),
|
||||
"用户申请退款,原因:" + text);
|
||||
//申请退款企业微信
|
||||
sendMsgService.inform(Long.valueOf(orderId),1);
|
||||
//模板消息发布事件
|
||||
TemplateBean templateBean = TemplateBean.builder()
|
||||
.orderId(order.getOrderId())
|
||||
@@ -1536,6 +1539,11 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
||||
|
||||
//增加用户购买次数
|
||||
userService.incPayCount(orderInfo.getUid());
|
||||
//用户累计消费
|
||||
double sumPrice=storeOrderMapper.sumPrice(orderInfo.getUid());
|
||||
//修改用户当前成长值
|
||||
bxgUserMapper.selectById(orderInfo.getUid()).setGrowth((int) Math.round(sumPrice));
|
||||
|
||||
//增加状态
|
||||
orderStatusService.create(orderInfo.getId(), OrderLogEnum.PAY_ORDER_SUCCESS.getValue(),
|
||||
OrderLogEnum.PAY_ORDER_SUCCESS.getDesc());
|
||||
|
||||
@@ -34,6 +34,16 @@ public class StoreAfterSalesParam {
|
||||
*/
|
||||
private String applicationInstructions;
|
||||
|
||||
/**
|
||||
* 申请退款联系人
|
||||
*/
|
||||
private String applicationName;
|
||||
|
||||
/**
|
||||
* 申请申请退款联系电话
|
||||
*/
|
||||
private String applicationPhone;
|
||||
|
||||
/**
|
||||
* 申请说明图片
|
||||
*/
|
||||
|
||||
+8
-1
@@ -10,6 +10,7 @@ import co.yixiang.enums.OrderInfoEnum;
|
||||
import co.yixiang.enums.ShopCommonEnum;
|
||||
import co.yixiang.exception.ErrorRequestException;
|
||||
import co.yixiang.modules.cart.vo.YxStoreCartQueryVo;
|
||||
import co.yixiang.modules.inform.service.SendMsgService;
|
||||
import co.yixiang.modules.order.domain.YxStoreOrder;
|
||||
import co.yixiang.modules.order.domain.YxStoreOrderCartInfo;
|
||||
import co.yixiang.modules.order.service.mapper.StoreOrderCartInfoMapper;
|
||||
@@ -37,6 +38,7 @@ import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
@@ -64,6 +66,8 @@ public class StoreAfterSalesServiceImpl extends BaseServiceImpl<StoreAfterSalesM
|
||||
private final StoreAfterSalesStatusMapper storeAfterSalesStatusMapper;
|
||||
private final IGenerator generator;
|
||||
|
||||
@Autowired
|
||||
private SendMsgService sendMsgService;
|
||||
@Override
|
||||
public void applyForAfterSales(Long userId, String nickname, StoreAfterSalesParam storeAfterSalesParam) {
|
||||
|
||||
@@ -94,6 +98,8 @@ public class StoreAfterSalesServiceImpl extends BaseServiceImpl<StoreAfterSalesM
|
||||
yxStoreOrder.setRefundStatus(OrderInfoEnum.REFUND_STATUS_1.getValue());
|
||||
yxStoreOrder.setRefundReasonWap(storeAfterSalesParam.getReasonForApplication());
|
||||
yxStoreOrder.setRefundReasonWapExplain(storeAfterSalesParam.getApplicationInstructions());
|
||||
yxStoreOrder.setRefundName(storeAfterSalesParam.getApplicationName());
|
||||
yxStoreOrder.setRefundPhone(storeAfterSalesParam.getApplicationPhone());
|
||||
yxStoreOrder.setRefundReasonTime(new Date());
|
||||
storeOrderMapper.updateById(yxStoreOrder);
|
||||
//生成售后订单
|
||||
@@ -121,6 +127,8 @@ public class StoreAfterSalesServiceImpl extends BaseServiceImpl<StoreAfterSalesM
|
||||
storeAfterSalesItemMapper.insert(storeAfterSalesItem);
|
||||
}
|
||||
|
||||
//申请退款企业微信
|
||||
sendMsgService.inform(Long.valueOf(yxStoreOrder.getOrderId()),1);
|
||||
//操作记录
|
||||
StoreAfterSalesStatus storeAfterSalesStatus = new StoreAfterSalesStatus();
|
||||
storeAfterSalesStatus.setStoreAfterSalesId(storeAfterSales.getId());
|
||||
@@ -129,7 +137,6 @@ public class StoreAfterSalesServiceImpl extends BaseServiceImpl<StoreAfterSalesM
|
||||
storeAfterSalesStatus.setChangeTime(Timestamp.valueOf(LocalDateTime.now()));
|
||||
storeAfterSalesStatus.setOperator(nickname);
|
||||
storeAfterSalesStatusMapper.insert(storeAfterSalesStatus);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,6 +49,11 @@ public class YxStoreBrand implements Serializable {
|
||||
/** 是否展示 */
|
||||
private Integer isShow;
|
||||
|
||||
/** 商品种类虚拟总数 */
|
||||
private Integer goodsNumber;
|
||||
|
||||
/** 虚拟总销量(单位w) */
|
||||
private Integer sellNumber;
|
||||
|
||||
/** 添加时间 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
|
||||
@@ -31,6 +31,12 @@ public class YxStoreBrandDto implements Serializable {
|
||||
/** 排序 */
|
||||
private Integer sort;
|
||||
|
||||
/** 商品种类虚拟总数 */
|
||||
private Integer goodsNumber;
|
||||
|
||||
/** 虚拟总销量(单位w) */
|
||||
private Integer sellNumber;
|
||||
|
||||
/** 图标 */
|
||||
private String pic;
|
||||
|
||||
|
||||
+2
@@ -90,6 +90,8 @@ public class YxStoreBrandServiceImpl extends BaseServiceImpl<YxStoreBrandMapper,
|
||||
map.put("品牌名称", yxStoreBrand.getBrandName());
|
||||
map.put("排序", yxStoreBrand.getSort());
|
||||
map.put("图标", yxStoreBrand.getPic());
|
||||
map.put("虚拟商品种类总数",yxStoreBrand.getGoodsNumber());
|
||||
map.put("虚拟销售量",yxStoreBrand.getSellNumber());
|
||||
map.put("背景图", yxStoreBrand.getBackgroundImage());
|
||||
map.put("是否推荐", yxStoreBrand.getIsShow());
|
||||
map.put("添加时间", yxStoreBrand.getCreateTime());
|
||||
|
||||
@@ -22,7 +22,7 @@ public class BrandDTO implements Serializable {
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商品分类名称
|
||||
* 商品品牌名称
|
||||
*/
|
||||
private String brandName;
|
||||
|
||||
@@ -31,6 +31,12 @@ public class BrandDTO implements Serializable {
|
||||
*/
|
||||
private String pic;
|
||||
|
||||
/** 商品虚拟总数 */
|
||||
private Integer goodsNumber;
|
||||
|
||||
/** 虚拟总销量(单位w) */
|
||||
private Integer sellNumber;
|
||||
|
||||
/**
|
||||
* 背景图url
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user