yshop1.9.3发布修复个人中心优惠券数量等问题

This commit is contained in:
hupeng
2020-02-04 13:37:53 +08:00
parent 533209cf74
commit 2de7be905b
6 changed files with 112 additions and 72 deletions

View File

@ -267,17 +267,22 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
String siteUrl = RedisUtil.get("site_url");
YxWechatUserQueryVo wechatUser = wechatUserService.getYxWechatUserById(orderQueryVo.getUid());
if(ObjectUtil.isNotNull(wechatUser)){
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM410119152"));
Map<String,String> map = new HashMap<>();
map.put("first","您在yshop的订单退款申请被通过钱款将很快还至您的支付账户。");
map.put("keyword1",orderQueryVo.getOrderId());//订单号
map.put("keyword2",orderQueryVo.getPayPrice().toString());
map.put("keyword3",OrderUtil.stampToDate(orderQueryVo.getAddTime().toString()));
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+orderQueryVo.getOrderId(),map);
if(StrUtil.isNotBlank(wechatUser.getOpenid())){
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM410119152"));
Map<String,String> map = new HashMap<>();
map.put("first","您在yshop的订单退款申请被通过钱款将很快还至您的支付账户。");
map.put("keyword1",orderQueryVo.getOrderId());//订单号
map.put("keyword2",orderQueryVo.getPayPrice().toString());
map.put("keyword3",OrderUtil.stampToDate(orderQueryVo.getAddTime().toString()));
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+orderQueryVo.getOrderId(),map);
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){
//todo 小程序通知
}
}
@ -316,18 +321,23 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
String siteUrl = RedisUtil.get("site_url");
YxWechatUserQueryVo wechatUser = wechatUserService.getYxWechatUserById(orderQueryVo.getUid());
if(ObjectUtil.isNotNull(wechatUser)){
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM200565259"));
//付款成功微信模板通知用户
Map<String,String> map = new HashMap<>();
map.put("first","亲,宝贝已经启程了,好想快点来到你身边。");
map.put("keyword1",storeOrder.getOrderId());//订单号
map.put("keyword2",expressQueryVo.getName());
map.put("keyword3",param.getDeliveryId());
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+orderQueryVo.getOrderId(),map);
if(StrUtil.isNotBlank(wechatUser.getOpenid())){
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM200565259"));
//付款成功微信模板通知用户
Map<String,String> map = new HashMap<>();
map.put("first","亲,宝贝已经启程了,好想快点来到你身边。");
map.put("keyword1",storeOrder.getOrderId());//订单号
map.put("keyword2",expressQueryVo.getName());
map.put("keyword3",param.getDeliveryId());
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+orderQueryVo.getOrderId(),map);
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){
//todo 小程序通知
}
}
}
@ -995,17 +1005,23 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
String siteUrl = RedisUtil.get("site_url");
YxWechatUserQueryVo wechatUser = wechatUserService.getYxWechatUserById(orderInfo.getUid());
if(ObjectUtil.isNotNull(wechatUser)){
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM207791277"));
//付款成功微信模板通知用户
Map<String,String> map = new HashMap<>();
map.put("first","您的订单已支付成功,我们会尽快为您发货。");
map.put("keyword1",orderInfo.getOrderId());//订单号
map.put("keyword2",orderInfo.getPayPrice().toString());
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+orderInfo.getOrderId(),map);
//公众号模板通知
if(StrUtil.isNotBlank(wechatUser.getOpenid())){
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM207791277"));
//付款成功微信模板通知用户
Map<String,String> map = new HashMap<>();
map.put("first","您的订单已支付成功,我们会尽快为您发货。");
map.put("keyword1",orderInfo.getOrderId());//订单号
map.put("keyword2",orderInfo.getPayPrice().toString());
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+orderInfo.getOrderId(),map);
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){
//todo 小程序模板通知
}
}
}

View File

@ -19,6 +19,8 @@ import java.util.List;
*/
public interface YxStoreCouponUserService extends BaseService<YxStoreCouponUser> {
int getUserValidCouponCount(int uid);
void useCoupon(int id);
YxStoreCouponUser getCoupon(int id,int uid);

View File

@ -49,6 +49,13 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
@Autowired
private CouponMap couponMap;
@Override
public int getUserValidCouponCount(int uid) {
checkInvalidCoupon(uid);
QueryWrapper<YxStoreCouponUser> wrapper= new QueryWrapper<>();
wrapper.eq("status",0).eq("uid",uid);
return yxStoreCouponUserMapper.selectCount(wrapper);
}
@Override
public List<YxStoreCouponUser> beUsableCouponList(int uid, double price) {

View File

@ -7,6 +7,7 @@ import co.yixiang.common.service.impl.BaseServiceImpl;
import co.yixiang.common.web.vo.Paging;
import co.yixiang.modules.order.service.YxStoreOrderService;
import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo;
import co.yixiang.modules.shop.service.YxStoreCouponUserService;
import co.yixiang.modules.shop.service.YxSystemConfigService;
import co.yixiang.modules.user.entity.YxUser;
import co.yixiang.modules.user.entity.YxUserBill;
@ -64,6 +65,9 @@ public class YxUserServiceImpl extends BaseServiceImpl<YxUserMapper, YxUser> imp
@Autowired
private YxUserLevelService userLevelService;
@Autowired
private YxStoreCouponUserService storeCouponUserService;
/**
* 返回会员价
* @param price
@ -416,6 +420,7 @@ public class YxUserServiceImpl extends BaseServiceImpl<YxUserMapper, YxUser> imp
public YxUserQueryVo getNewYxUserById(Serializable id) {
YxUserQueryVo userQueryVo = yxUserMapper.getYxUserById(id);
userQueryVo.setOrderStatusNum(orderService.orderData((int)id));
userQueryVo.setCouponCount(storeCouponUserService.getUserValidCouponCount((int)id));
//判断分销类型
String statu = systemConfigService.getData("store_brokerage_statu");
if(StrUtil.isNotEmpty(statu)){

View File

@ -15,29 +15,29 @@ import java.io.Serializable;
* @date 2019-12-10
*/
@Data
@ApiModel(value="YxWechatTemplateQueryVo对象", description="微信模板查询参数")
public class YxWechatTemplateQueryVo implements Serializable{
@ApiModel(value = "YxWechatTemplateQueryVo对象", description = "微信模板查询参数")
public class YxWechatTemplateQueryVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "模板id")
private Integer id;
@ApiModelProperty(value = "模板id")
private Integer id;
@ApiModelProperty(value = "模板编号")
private String tempkey;
@ApiModelProperty(value = "模板编号")
private String tempkey;
@ApiModelProperty(value = "模板名")
private String name;
@ApiModelProperty(value = "模板名")
private String name;
@ApiModelProperty(value = "回复内容")
private String content;
@ApiModelProperty(value = "回复内容")
private String content;
@ApiModelProperty(value = "模板ID")
private String tempid;
@ApiModelProperty(value = "模板ID")
private String tempid;
@ApiModelProperty(value = "添加时间")
private String addTime;
@ApiModelProperty(value = "添加时间")
private String addTime;
@ApiModelProperty(value = "状态")
private Integer status;
@ApiModelProperty(value = "状态")
private Integer status;
}

View File

@ -172,17 +172,22 @@ public class YxStoreOrderController {
try{
YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid());
if(ObjectUtil.isNotNull(wechatUser)){
YxWechatTemplate WechatTemplate = yxWechatTemplateService
.findByTempkey("OPENTM200565259");
Map<String,String> map = new HashMap<>();
map.put("first","亲,宝贝已经启程了,好想快点来到你身边。");
map.put("keyword1",resources.getOrderId());//订单号
map.put("keyword2",expressDTO.getName());
map.put("keyword3",resources.getDeliveryId());
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+resources.getOrderId(),map);
if(StrUtil.isNotBlank(wechatUser.getOpenid())){
YxWechatTemplate WechatTemplate = yxWechatTemplateService
.findByTempkey("OPENTM200565259");
Map<String,String> map = new HashMap<>();
map.put("first","亲,宝贝已经启程了,好想快点来到你身边。");
map.put("keyword1",resources.getOrderId());//订单号
map.put("keyword2",expressDTO.getName());
map.put("keyword3",resources.getDeliveryId());
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+resources.getOrderId(),map);
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){
//todo 小程序通知
}
}
}catch (Exception e){
log.info("当前用户不是微信用户不能发送模板消息哦!");
@ -204,17 +209,22 @@ public class YxStoreOrderController {
try{
YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid());
if(ObjectUtil.isNotNull(wechatUser)){
YxWechatTemplate WechatTemplate = yxWechatTemplateService
.findByTempkey("OPENTM410119152");
Map<String,String> map = new HashMap<>();
map.put("first","您在yshop的订单退款申请被通过钱款将很快还至您的支付账户。");
map.put("keyword1",resources.getOrderId());//订单号
map.put("keyword2",resources.getPayPrice().toString());
map.put("keyword3", OrderUtil.stampToDate(resources.getAddTime().toString()));
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+resources.getOrderId(),map);
if(StrUtil.isNotBlank(wechatUser.getOpenid())){
YxWechatTemplate WechatTemplate = yxWechatTemplateService
.findByTempkey("OPENTM410119152");
Map<String,String> map = new HashMap<>();
map.put("first","您在yshop的订单退款申请被通过钱款将很快还至您的支付账户。");
map.put("keyword1",resources.getOrderId());//订单号
map.put("keyword2",resources.getPayPrice().toString());
map.put("keyword3", OrderUtil.stampToDate(resources.getAddTime().toString()));
map.put("remark","yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
,WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+resources.getOrderId(),map);
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){
//todo 小程序通知
}
}
}catch (Exception e){
log.info("当前用户不是微信用户不能发送模板消息哦!");