yshop1.9.3发布修复个人中心优惠券数量等问题
This commit is contained in:
@ -267,6 +267,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
|
|||||||
String siteUrl = RedisUtil.get("site_url");
|
String siteUrl = RedisUtil.get("site_url");
|
||||||
YxWechatUserQueryVo wechatUser = wechatUserService.getYxWechatUserById(orderQueryVo.getUid());
|
YxWechatUserQueryVo wechatUser = wechatUserService.getYxWechatUserById(orderQueryVo.getUid());
|
||||||
if(ObjectUtil.isNotNull(wechatUser)){
|
if(ObjectUtil.isNotNull(wechatUser)){
|
||||||
|
if(StrUtil.isNotBlank(wechatUser.getOpenid())){
|
||||||
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
|
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
|
||||||
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM410119152"));
|
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM410119152"));
|
||||||
Map<String,String> map = new HashMap<>();
|
Map<String,String> map = new HashMap<>();
|
||||||
@ -278,6 +279,10 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
|
|||||||
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
|
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
|
||||||
,WechatTemplate.getTempid(),
|
,WechatTemplate.getTempid(),
|
||||||
siteUrl+"/order/detail/"+orderQueryVo.getOrderId(),map);
|
siteUrl+"/order/detail/"+orderQueryVo.getOrderId(),map);
|
||||||
|
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){
|
||||||
|
//todo 小程序通知
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -316,6 +321,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
|
|||||||
String siteUrl = RedisUtil.get("site_url");
|
String siteUrl = RedisUtil.get("site_url");
|
||||||
YxWechatUserQueryVo wechatUser = wechatUserService.getYxWechatUserById(orderQueryVo.getUid());
|
YxWechatUserQueryVo wechatUser = wechatUserService.getYxWechatUserById(orderQueryVo.getUid());
|
||||||
if(ObjectUtil.isNotNull(wechatUser)){
|
if(ObjectUtil.isNotNull(wechatUser)){
|
||||||
|
if(StrUtil.isNotBlank(wechatUser.getOpenid())){
|
||||||
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
|
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
|
||||||
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM200565259"));
|
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM200565259"));
|
||||||
//付款成功微信模板通知用户
|
//付款成功微信模板通知用户
|
||||||
@ -328,6 +334,10 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
|
|||||||
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
|
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
|
||||||
,WechatTemplate.getTempid(),
|
,WechatTemplate.getTempid(),
|
||||||
siteUrl+"/order/detail/"+orderQueryVo.getOrderId(),map);
|
siteUrl+"/order/detail/"+orderQueryVo.getOrderId(),map);
|
||||||
|
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){
|
||||||
|
//todo 小程序通知
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -995,6 +1005,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
|
|||||||
String siteUrl = RedisUtil.get("site_url");
|
String siteUrl = RedisUtil.get("site_url");
|
||||||
YxWechatUserQueryVo wechatUser = wechatUserService.getYxWechatUserById(orderInfo.getUid());
|
YxWechatUserQueryVo wechatUser = wechatUserService.getYxWechatUserById(orderInfo.getUid());
|
||||||
if(ObjectUtil.isNotNull(wechatUser)){
|
if(ObjectUtil.isNotNull(wechatUser)){
|
||||||
|
//公众号模板通知
|
||||||
|
if(StrUtil.isNotBlank(wechatUser.getOpenid())){
|
||||||
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
|
YxWechatTemplate WechatTemplate = yxWechatTemplateService.getOne(
|
||||||
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM207791277"));
|
new QueryWrapper<YxWechatTemplate>().eq("tempkey","OPENTM207791277"));
|
||||||
//付款成功微信模板通知用户
|
//付款成功微信模板通知用户
|
||||||
@ -1006,6 +1018,10 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
|
|||||||
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
|
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
|
||||||
,WechatTemplate.getTempid(),
|
,WechatTemplate.getTempid(),
|
||||||
siteUrl+"/order/detail/"+orderInfo.getOrderId(),map);
|
siteUrl+"/order/detail/"+orderInfo.getOrderId(),map);
|
||||||
|
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){
|
||||||
|
//todo 小程序模板通知
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface YxStoreCouponUserService extends BaseService<YxStoreCouponUser> {
|
public interface YxStoreCouponUserService extends BaseService<YxStoreCouponUser> {
|
||||||
|
|
||||||
|
int getUserValidCouponCount(int uid);
|
||||||
|
|
||||||
void useCoupon(int id);
|
void useCoupon(int id);
|
||||||
|
|
||||||
YxStoreCouponUser getCoupon(int id,int uid);
|
YxStoreCouponUser getCoupon(int id,int uid);
|
||||||
|
@ -49,6 +49,13 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CouponMap couponMap;
|
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
|
@Override
|
||||||
public List<YxStoreCouponUser> beUsableCouponList(int uid, double price) {
|
public List<YxStoreCouponUser> beUsableCouponList(int uid, double price) {
|
||||||
|
@ -7,6 +7,7 @@ import co.yixiang.common.service.impl.BaseServiceImpl;
|
|||||||
import co.yixiang.common.web.vo.Paging;
|
import co.yixiang.common.web.vo.Paging;
|
||||||
import co.yixiang.modules.order.service.YxStoreOrderService;
|
import co.yixiang.modules.order.service.YxStoreOrderService;
|
||||||
import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo;
|
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.shop.service.YxSystemConfigService;
|
||||||
import co.yixiang.modules.user.entity.YxUser;
|
import co.yixiang.modules.user.entity.YxUser;
|
||||||
import co.yixiang.modules.user.entity.YxUserBill;
|
import co.yixiang.modules.user.entity.YxUserBill;
|
||||||
@ -64,6 +65,9 @@ public class YxUserServiceImpl extends BaseServiceImpl<YxUserMapper, YxUser> imp
|
|||||||
@Autowired
|
@Autowired
|
||||||
private YxUserLevelService userLevelService;
|
private YxUserLevelService userLevelService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private YxStoreCouponUserService storeCouponUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回会员价
|
* 返回会员价
|
||||||
* @param price
|
* @param price
|
||||||
@ -416,6 +420,7 @@ public class YxUserServiceImpl extends BaseServiceImpl<YxUserMapper, YxUser> imp
|
|||||||
public YxUserQueryVo getNewYxUserById(Serializable id) {
|
public YxUserQueryVo getNewYxUserById(Serializable id) {
|
||||||
YxUserQueryVo userQueryVo = yxUserMapper.getYxUserById(id);
|
YxUserQueryVo userQueryVo = yxUserMapper.getYxUserById(id);
|
||||||
userQueryVo.setOrderStatusNum(orderService.orderData((int)id));
|
userQueryVo.setOrderStatusNum(orderService.orderData((int)id));
|
||||||
|
userQueryVo.setCouponCount(storeCouponUserService.getUserValidCouponCount((int)id));
|
||||||
//判断分销类型
|
//判断分销类型
|
||||||
String statu = systemConfigService.getData("store_brokerage_statu");
|
String statu = systemConfigService.getData("store_brokerage_statu");
|
||||||
if(StrUtil.isNotEmpty(statu)){
|
if(StrUtil.isNotEmpty(statu)){
|
||||||
|
@ -15,29 +15,29 @@ import java.io.Serializable;
|
|||||||
* @date 2019-12-10
|
* @date 2019-12-10
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ApiModel(value="YxWechatTemplateQueryVo对象", description="微信模板查询参数")
|
@ApiModel(value = "YxWechatTemplateQueryVo对象", description = "微信模板查询参数")
|
||||||
public class YxWechatTemplateQueryVo implements Serializable{
|
public class YxWechatTemplateQueryVo implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ApiModelProperty(value = "模板id")
|
@ApiModelProperty(value = "模板id")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "模板编号")
|
@ApiModelProperty(value = "模板编号")
|
||||||
private String tempkey;
|
private String tempkey;
|
||||||
|
|
||||||
@ApiModelProperty(value = "模板名")
|
@ApiModelProperty(value = "模板名")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty(value = "回复内容")
|
@ApiModelProperty(value = "回复内容")
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
@ApiModelProperty(value = "模板ID")
|
@ApiModelProperty(value = "模板ID")
|
||||||
private String tempid;
|
private String tempid;
|
||||||
|
|
||||||
@ApiModelProperty(value = "添加时间")
|
@ApiModelProperty(value = "添加时间")
|
||||||
private String addTime;
|
private String addTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "状态")
|
@ApiModelProperty(value = "状态")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
}
|
}
|
@ -172,6 +172,7 @@ public class YxStoreOrderController {
|
|||||||
try{
|
try{
|
||||||
YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid());
|
YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid());
|
||||||
if(ObjectUtil.isNotNull(wechatUser)){
|
if(ObjectUtil.isNotNull(wechatUser)){
|
||||||
|
if(StrUtil.isNotBlank(wechatUser.getOpenid())){
|
||||||
YxWechatTemplate WechatTemplate = yxWechatTemplateService
|
YxWechatTemplate WechatTemplate = yxWechatTemplateService
|
||||||
.findByTempkey("OPENTM200565259");
|
.findByTempkey("OPENTM200565259");
|
||||||
Map<String,String> map = new HashMap<>();
|
Map<String,String> map = new HashMap<>();
|
||||||
@ -183,6 +184,10 @@ public class YxStoreOrderController {
|
|||||||
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
|
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
|
||||||
,WechatTemplate.getTempid(),
|
,WechatTemplate.getTempid(),
|
||||||
siteUrl+"/order/detail/"+resources.getOrderId(),map);
|
siteUrl+"/order/detail/"+resources.getOrderId(),map);
|
||||||
|
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){
|
||||||
|
//todo 小程序通知
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.info("当前用户不是微信用户不能发送模板消息哦!");
|
log.info("当前用户不是微信用户不能发送模板消息哦!");
|
||||||
@ -204,6 +209,7 @@ public class YxStoreOrderController {
|
|||||||
try{
|
try{
|
||||||
YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid());
|
YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid());
|
||||||
if(ObjectUtil.isNotNull(wechatUser)){
|
if(ObjectUtil.isNotNull(wechatUser)){
|
||||||
|
if(StrUtil.isNotBlank(wechatUser.getOpenid())){
|
||||||
YxWechatTemplate WechatTemplate = yxWechatTemplateService
|
YxWechatTemplate WechatTemplate = yxWechatTemplateService
|
||||||
.findByTempkey("OPENTM410119152");
|
.findByTempkey("OPENTM410119152");
|
||||||
Map<String,String> map = new HashMap<>();
|
Map<String,String> map = new HashMap<>();
|
||||||
@ -215,6 +221,10 @@ public class YxStoreOrderController {
|
|||||||
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
|
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid()
|
||||||
,WechatTemplate.getTempid(),
|
,WechatTemplate.getTempid(),
|
||||||
siteUrl+"/order/detail/"+resources.getOrderId(),map);
|
siteUrl+"/order/detail/"+resources.getOrderId(),map);
|
||||||
|
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){
|
||||||
|
//todo 小程序通知
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.info("当前用户不是微信用户不能发送模板消息哦!");
|
log.info("当前用户不是微信用户不能发送模板消息哦!");
|
||||||
|
Reference in New Issue
Block a user