记得上下班打卡 | git大法好,push需谨慎

Commit 8ad52480 authored by 解彦博's avatar 解彦博

Merge branch 'dev_performance_subscribe' into 'master'

1.0开票提醒

See merge request !362
parents 0fa62b8d d4deeb64
......@@ -49,4 +49,6 @@ public interface ICandyCouponService {
ResponseDto<CandyCouponVo> receiveCouponDetails(String ccode);
ResponseDto<List<CandyCouponVo>> couponListById(String uCouponIds,String uid);
}
......@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.constant;
public class KylinRedisConst {
public static final String FIELDS = "kylin:fields:id";
public static final String PERFORMANCES = "kylin:performances:id:";
public static final String PERFORMANCES_INVOICE_REMINDER = "kylin:performances:invoice_reminder:id:";
public static final String PERFORMANCES_TRUE_NAME = "kylin:performances_true_name:id:";
public static final String PERFORMANCES_LIST_CITY = "kylin:performances:city:";
public static final String PERFORMANCES_LIST_SYSTEM_RECOMMEND = "kylin:performances:systemRecommend";
......@@ -90,7 +91,12 @@ public class KylinRedisConst {
public static final String KYLIN_EXPRESS_MODULES = "kylin:express:modules";
public static final String REDIS_KEY_KYLIN_PERFORM_SUBSCRIBE = "kylin:performSubscribe:uid:";
public static final String REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE = "kylin:performance:subscribe:"; //演出预约
public static final String REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE_TICKETS = "kylin:performance:subscribe:tickets";//演出票种预约
public static final String REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE_LIST = "kylin:performance:subscribe:list"; //预约列表
public static final String REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE_READ = "kylin:performance:subscribe:read"; //预约列表是否已读
public static final String REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE_LOCK = "kylin:performance:subscribe:lock"; //预约提醒加锁
public static final String REDIS_WQ_ORDER_FIX = "kylin:wq:order:";//纪录万青 订单填写快递地址
public static final String REDIS_WQ_ORDER_EXPRESS = "kylin:wq:pxress:order:";//万青补偿快递vo 订单填写快递地址
......
......@@ -108,5 +108,30 @@ public class KylinTableStatusConst {
return desc;
}
}
/**
* 演出预约提醒类型
* @author zjp
* @return: null
* @date 2024/3/14 11:31
*/
public enum SubscribeTypeEnum {
TYPE1(0, "开票提醒");
private final Integer key;
private final String desc;
SubscribeTypeEnum(Integer key, String desc) {
this.key = key;
this.desc = desc;
}
public Integer getKey() {
return key;
}
public String getDesc() {
return desc;
}
}
}
package com.liquidnet.service.kylin.dto.param;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.liquidnet.commons.lang.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.scheduling.support.SimpleTriggerContext;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author zjp
* @create 2024-03-12 14:36
*/
@ApiModel(value = "KylinPerformanceSubscribeParam", description = "预约入参")
@Data
public class KylinPerformanceSubscribeParam implements Serializable {
@ApiModelProperty(position = 1, value = "演出id")
@NotBlank(message = "演出ID不能为空")
private String performancesId;
@ApiModelProperty(position = 2,value = "演出名称")
@NotBlank(message = "演出名称不能为空")
private String performancesTitle;
@ApiModelProperty(position = 3,value = "场次id")
@NotBlank(message = "场次ID不能为空")
private String ticketTimesId;
@ApiModelProperty(position = 4,value = "场次名称")
@NotBlank(message = "场次名称不能为空")
private String ticketTimesTitle;
@ApiModelProperty(position = 5,value = "票种id")
@NotBlank(message = "票种ID不能为空")
private String ticketsId;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(position = 7,value = "票种开始时间")
private LocalDateTime timeStart;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(position = 8,value = "票种结束时间")
private LocalDateTime timeEnd;
@ApiModelProperty(position = 9,value = "设备唯一标识")
@NotBlank(message = "设备唯一标识不能为空")
private String deviceTokens;
@ApiModelProperty(position = 10,value = "演出图片")
@NotBlank(message = "演出图片不能为空")
private String imgPoster;
@ApiModelProperty(position = 11,value = "会员提前分钟")
private Integer advanceMinuteMember;
@ApiModelProperty(position = 12,value = "本场场次全部的票种id")
private List<String> ticketsIds;
}
......@@ -27,6 +27,10 @@ public class PerformanceStep2Param implements Serializable,Cloneable {
@NotNull(message = "不能为空")
private Integer idCount;
@ApiModelProperty(value = "开票提醒 0为不提醒", example = "0")
@NotNull(message = "不能为空")
private Integer isInvoiceReminder;
@ApiModelProperty(value = "是否提交 1提交 0不提交(不验证参数)", example = "0")
@NotNull(message = "不能为空")
private Integer isSubmit;
......
package com.liquidnet.service.kylin.dto.vo;
import com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeTicketStatisticalDao;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@ApiModel(value = "KylinPerformanceSubscribeStatisticalVo", description = "预约统计")
@Data
public class KylinPerformanceSubscribeStatisticalVo implements Serializable, Cloneable {
@ApiModelProperty(value = "主键")
private String performancesId;
@ApiModelProperty(value = "演出名称")
private String title;
@ApiModelProperty(value = "演出开始时间")
private String timeStart;
@ApiModelProperty(value = "城市名称")
private String cityName;
@ApiModelProperty(value = "101音乐节 102小型演出(livehouse演出) 103巡演")
// @ApiModelProperty(value = "演出类型 1音乐节 2演唱会 3小型演出 4展览 6舞台剧 101音乐节 102小型演出(livehouse演出) 103巡演")
private String type;
@ApiModelProperty(value = "预约总人数")
private Integer subscribeTotal;
@ApiModelProperty(value = "详情页浏览人数")
private Integer visitorNumber;
@ApiModelProperty(value = "详情页浏览次数")
private Integer visitorNumberCount;
@ApiModelProperty(value = "票种浏览人数")
private Integer visitorNumberTicket;
@ApiModelProperty(value = "票种浏览次数")
private Integer visitorNumberTicketCount;
@ApiModelProperty(value = "票种详情")
private List<KylinPerformanceSubscribeTicketStatisticalDao> kylinPerformanceSubscribeTicketStatisticalDaoList;
}
package com.liquidnet.service.kylin.dto.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* upush 系统消息
* </p>
*
* @author jiangxiulong
* @since 2021-07-15
*/
@ApiModel(value = "KylinPerformanceSubscribeUpushVo", description = "预约出参")
@Data
public class KylinPerformanceSubscribeUpushVo implements Serializable, Cloneable {
@ApiModelProperty(value = "推送标题")
private String pushTitle;
@ApiModelProperty(value = "推送内容")
private String pushContent;
@ApiModelProperty(value = "封面图")
private String img;
@ApiModelProperty(value = "跳转类型 0打开APP,16演出首页,17商城首页,5场地详情,6票务详情,7商品详情,14商品集合,20音乐人详情,24音乐人集合,21歌曲详情,22专辑详情,26摩登会员,12活动跳转可分享,100活动跳转,32系统消息列表")
private Integer jumpType;
@ApiModelProperty(value = "跳转值 id或者url或者空 根据type区分")
private String jumpValue;
@ApiModelProperty(value = "推送时间")
private String pushTime;
@ApiModelProperty(value = "推送类型 0 开票提醒")
private Integer type;
@ApiModelProperty(value = "演出开始时间")
private String timeStart;
@ApiModelProperty( value = "演出id")
private String performancesId;
@ApiModelProperty(value = "场次id")
private String ticketTimesId;
@ApiModelProperty(position = 5,value = "票种id")
private String ticketsId;
}
......@@ -138,6 +138,13 @@ public class KylinPerformanceVo implements Serializable, Cloneable {
private String merchantId;
@ApiModelProperty(value = "场地审核状态 [0-审核完成|1-待审核|2-已拒绝]", hidden = true)
private Integer fieldAuditStatus;
@ApiModelProperty(value = "是否预约演出 0 无 1有")
private Integer isSubscribe;
@ApiModelProperty(value = "判断用户是否是vip 0不是 1是")
private Integer isVip;
@ApiModelProperty(value = "开票提醒 0为不提醒", example = "0")
private Integer isInvoiceReminder;
public Integer getIdCount() {
return idCount == null ? limitCount : idCount;
......
......@@ -2,8 +2,10 @@ package com.liquidnet.service.kylin.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dto.param.KylinCandyItemParam;
import com.liquidnet.service.kylin.dto.param.KylinPerformanceSubscribeParam;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinCandyVo;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
......@@ -30,4 +32,33 @@ public interface IKylinPerformancesService {
ResponseDto<Integer> isSubscribe(String performancesId);
ResponseDto<List<KylinCandyVo>> kylinCandy(List<KylinCandyItemParam> data, String roadShowId);
/**
* 演出预约
* @author zjp
* @param param
* @return: com.liquidnet.service.base.ResponseDto<java.lang.String>
* @date 2024/3/12 14:39
*/
ResponseDto<String> performanceSubscribe(HttpServletRequest request,KylinPerformanceSubscribeParam param);
/**
* 是否演出预约
* @author zjp
* @param performancesId
* @param ticketTimesId
* @return: com.liquidnet.service.base.ResponseDto<java.lang.Integer>
* @date 2024/3/6 14:45
*/
ResponseDto<Integer> performanceIsSubscribe(String performancesId,String ticketTimesId,String ticketsId);
/*
* @description:删除预约演出票种
* @author: zjp
* @date: 2024/5/15 14:10
* @param:
* @return:
**/
void deleteIsSubscribe(String performancesId,String ticketTimesId,String ticketsId);
}
......@@ -8,6 +8,7 @@ import com.liquidnet.service.kylin.dto.param.PerformancePartnerListParam;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo;
import com.liquidnet.service.kylin.dto.param.PerformanceStep1Param;
import com.liquidnet.service.kylin.dto.param.PerformanceStep2Param;
import com.liquidnet.service.kylin.dto.vo.KylinPerformanceSubscribeStatisticalVo;
import com.liquidnet.service.kylin.dto.vo.KylinTimePerformanceVo;
import com.liquidnet.service.kylin.dto.vo.PerformanceOrderStatisticalVo;
import com.liquidnet.service.kylin.entity.KylinPerformances;
......@@ -173,4 +174,14 @@ public interface IKylinPerformancesPartnerService {
ResponseDto<String> fieldsAuditPerformance(String performancesId,Integer status,String rejectTxt);
List<PerformanceOrderStatisticalVo> getPerformanceOrderStatisticalList(String performancesId);
/**
* 演出预约统计
* @author zjp
* @param performancesId
* @return: com.liquidnet.service.kylin.dto.vo.KylinPerformanceSubscribeStatisticalVo
* @date 2024/3/18 13:50
*/
KylinPerformanceSubscribeStatisticalVo getSubscribeStatistical(String performancesId);
}
package com.liquidnet.commons.lang.constant;
import java.util.*;
/**
* <p>
* 友盟推送 跳转类型
* </p>
*
* @author jiangxiulong
* @since 2021-07-13
*/
public enum UpushTargetType {
TARGET_TYPE0("打开APP", 0, "go_app"),
TARGET_TYPE16("演出首页", 16, "ticket_home"),
TARGET_TYPE17("商城首页", 17, "goods_home"),
// TARGET_TYPE5("场地详情", 5, "area"),
TARGET_TYPE6("票务详情", 6, "ticket"),
TARGET_TYPE7("商品详情", 7, "goods"),
TARGET_TYPE14("商品集合", 14, "goods_collection"),
// TARGET_TYPE20("音乐人详情", 20, "musician"),
// TARGET_TYPE24("音乐人集合", 24, "musician_collection"),
// TARGET_TYPE21("歌曲详情", 21, "song"),
// TARGET_TYPE22("专辑详情", 22, "album"),
// TARGET_TYPE26("摩登会员", 26, "member"),
TARGET_TYPE12("活动跳转-可分享", 12, "ad_link"),
TARGET_TYPE100("活动跳转", 100, "promotion"),
// TARGET_TYPE28("消息列表", 28, "area),
TARGET_TYPE32("系统消息列表", 32, "show_message_list");
// TARGET_TYPE33("会员消息列表", 33);
private String name;
private int index;
private String action;
UpushTargetType(String name, int index, String action) {
this.name = name;
this.index = index;
this.action = action;
}
public String getName() {
return this.name;
}
public int getIndex() {
return this.index;
}
public String getAction() {
return this.action;
}
private static List<Object> resultTypeListR = null;
static {
ArrayList<Object> resultTypeList = new ArrayList<>();
for (UpushTargetType resultType : UpushTargetType.values()) {
Map<String, Object> mapTemp = new HashMap<>();
mapTemp.put("id", resultType.index);
mapTemp.put("name", resultType.name);
mapTemp.put("action", resultType.action);
resultTypeList.add(mapTemp);
}
resultTypeListR = Collections.unmodifiableList(resultTypeList);
}
public static List<Object> getResultType() {
return resultTypeListR;
}
public static String getTypeName(int index) {
for (UpushTargetType c : UpushTargetType.values()) {
if (c.getIndex() == index) {
return c.name;
}
}
return null;
}
public static String getTypeAction(int index) {
for (UpushTargetType c : UpushTargetType.values()) {
if (c.getIndex() == index) {
return c.action;
}
}
return null;
}
}
package com.liquidnet.commons.lang.util;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* @version V1.0
* @Title: BeanConverterUtil.java
* @Package com.tzcpa.expenses.util
* @Description: entity转DTO
* @author: yhw
* @date: 2019年4月23日 上午10:08:55
*/
@Slf4j
public class BeanConverterUtil {
private BeanConverterUtil() {
}
/**
* 单个对象转换
*/
public static <F, T> T convert(F from, Class<T> clazz) {
if (from == null) {
return null;
}
T to = null;
try {
to = clazz.newInstance();
} catch (Exception e) {
log.error("初始化{}对象失败。", clazz, e);
}
convert(from, to);
return to;
}
/**
* 批量对象转换
*/
public static <F, T> List<T> convert(List<F> fromList, Class<T> clazz) {
if (fromList == null) {
return Collections.emptyList();
}
List<T> toList = new ArrayList<>();
if (fromList.isEmpty()) {
return toList;
}
for (F from : fromList) {
toList.add(convert(from, clazz));
}
return toList;
}
/**
* 属性拷贝方法,有特殊需求时子类覆写此方法
*/
private static <F, T> void convert(F from, T to) {
BeanUtils.copyProperties(from, to);
}
}
\ No newline at end of file
package com.liquidnet.commons.lang.util.upush;
import org.json.JSONObject;
import java.util.Arrays;
import java.util.HashSet;
public abstract class AndroidNotification extends UmengNotification {
// Keys can be set in the payload level
protected static final HashSet<String> PAYLOAD_KEYS = new HashSet<String>(Arrays.asList(new String[]{
"display_type"}));
// Keys can be set in the body level
protected static final HashSet<String> BODY_KEYS = new HashSet<String>(Arrays.asList(new String[]{
"ticker", "title", "text", "builder_id", "icon", "largeIcon", "img", "play_vibrate", "play_lights", "play_sound",
"sound", "after_open", "url", "activity", "custom", "badge"}));
public enum DisplayType{
NOTIFICATION{public String getValue(){return "notification";}},///通知:消息送达到用户设备后,由友盟SDK接管处理并在通知栏上显示通知内容。
MESSAGE{public String getValue(){return "message";}};///消息:消息送达到用户设备后,消息内容透传给应用自身进行解析处理。
public abstract String getValue();
}
public enum AfterOpenAction{
go_app,//打开应用
go_url,//跳转到URL
go_activity,//打开特定的activity
go_custom//用户自定义内容。
}
// Set key/value in the rootJson, for the keys can be set please see ROOT_KEYS, PAYLOAD_KEYS,
// BODY_KEYS and POLICY_KEYS.
@Override
public boolean setPredefinedKeyValue(String key, Object value) throws Exception {
if (ROOT_KEYS.contains(key)) {
// This key should be in the root level
rootJson.put(key, value);
} else if (PAYLOAD_KEYS.contains(key)) {
// This key should be in the payload level
JSONObject payloadJson = null;
if (rootJson.has("payload")) {
payloadJson = rootJson.getJSONObject("payload");
} else {
payloadJson = new JSONObject();
rootJson.put("payload", payloadJson);
}
payloadJson.put(key, value);
} else if (BODY_KEYS.contains(key)) {
// This key should be in the body level
JSONObject bodyJson = null;
JSONObject payloadJson = null;
// 'body' is under 'payload', so build a payload if it doesn't exist
if (rootJson.has("payload")) {
payloadJson = rootJson.getJSONObject("payload");
} else {
payloadJson = new JSONObject();
rootJson.put("payload", payloadJson);
}
// Get body JSONObject, generate one if not existed
if (payloadJson.has("body")) {
bodyJson = payloadJson.getJSONObject("body");
} else {
bodyJson = new JSONObject();
payloadJson.put("body", bodyJson);
}
bodyJson.put(key, value);
} else if (POLICY_KEYS.contains(key)) {
// This key should be in the body level
JSONObject policyJson = null;
if (rootJson.has("policy")) {
policyJson = rootJson.getJSONObject("policy");
} else {
policyJson = new JSONObject();
rootJson.put("policy", policyJson);
}
policyJson.put(key, value);
} else if(CHANNEL_PROPERTIES.contains(key)){
JSONObject channelJson = null;
if (rootJson.has("channel_properties")) {
channelJson = rootJson.getJSONObject("channel_properties");
} else {
channelJson = new JSONObject();
rootJson.put("channel_properties", channelJson);
}
channelJson.put(key, value);
} else {
if (key == "payload" || key == "body" || key == "policy" || key == "extra") {
throw new Exception("You don't need to set value for " + key + " , just set values for the sub keys in it.");
} else {
throw new Exception("Unknown key: " + key);
}
}
return true;
}
public void setBadge(Integer badge) throws Exception {
setPredefinedKeyValue("badge", badge);
}
// Set extra key/value for Android notification
public boolean setExtraField(String key, String value) throws Exception {
JSONObject payloadJson = null;
JSONObject extraJson = null;
if (rootJson.has("payload")) {
payloadJson = rootJson.getJSONObject("payload");
} else {
payloadJson = new JSONObject();
rootJson.put("payload", payloadJson);
}
if (payloadJson.has("extra")) {
extraJson = payloadJson.getJSONObject("extra");
} else {
extraJson = new JSONObject();
payloadJson.put("extra", extraJson);
}
extraJson.put(key, value);
return true;
}
public void setDisplayType(DisplayType d) throws Exception {
setPredefinedKeyValue("display_type", d.getValue());
}
///通知栏提示文字
public void setTicker(String ticker) throws Exception {
setPredefinedKeyValue("ticker", ticker);
}
///通知标题
public void setTitle(String title) throws Exception {
setPredefinedKeyValue("title", title);
}
///通知文字描述
public void setText(String text) throws Exception {
setPredefinedKeyValue("text", text);
}
///用于标识该通知采用的样式。使用该参数时, 必须在SDK里面实现自定义通知栏样式。
public void setBuilderId(Integer builder_id) throws Exception {
setPredefinedKeyValue("builder_id", builder_id);
}
///状态栏图标ID, R.drawable.[smallIcon],如果没有, 默认使用应用图标。
public void setIcon(String icon) throws Exception {
setPredefinedKeyValue("icon", icon);
}
///通知栏拉开后左侧图标ID
public void setLargeIcon(String largeIcon) throws Exception {
setPredefinedKeyValue("largeIcon", largeIcon);
}
///通知栏大图标的URL链接。该字段的优先级大于largeIcon。该字段要求以http或者https开头。
public void setImg(String img) throws Exception {
setPredefinedKeyValue("img", img);
}
///收到通知是否震动,默认为"true"
public void setPlayVibrate(Boolean play_vibrate) throws Exception {
setPredefinedKeyValue("play_vibrate", play_vibrate.toString());
}
///收到通知是否闪灯,默认为"true"
public void setPlayLights(Boolean play_lights) throws Exception {
setPredefinedKeyValue("play_lights", play_lights.toString());
}
///收到通知是否发出声音,默认为"true"
public void setPlaySound(Boolean play_sound) throws Exception {
setPredefinedKeyValue("play_sound", play_sound.toString());
}
///通知声音,R.raw.[sound]. 如果该字段为空,采用SDK默认的声音
public void setSound(String sound) throws Exception {
setPredefinedKeyValue("sound", sound);
}
///收到通知后播放指定的声音文件
public void setPlaySound(String sound) throws Exception {
setPlaySound(true);
setSound(sound);
}
///点击"通知"的后续行为,默认为打开app。
public void goAppAfterOpen() throws Exception {
setAfterOpenAction(AfterOpenAction.go_app);
}
public void goUrlAfterOpen(String url) throws Exception {
setAfterOpenAction(AfterOpenAction.go_url);
setUrl(url);
}
public void goActivityAfterOpen(String activity) throws Exception {
setAfterOpenAction(AfterOpenAction.go_activity);
setActivity(activity);
}
public void goCustomAfterOpen(String custom) throws Exception {
setAfterOpenAction(AfterOpenAction.go_custom);
setCustomField(custom);
}
public void goCustomAfterOpen(JSONObject custom) throws Exception {
setAfterOpenAction(AfterOpenAction.go_custom);
setCustomField(custom);
}
///点击"通知"的后续行为,默认为打开app。原始接口
public void setAfterOpenAction(AfterOpenAction action) throws Exception {
setPredefinedKeyValue("after_open", action.toString());
}
public void setUrl(String url) throws Exception {
setPredefinedKeyValue("url", url);
}
public void setActivity(String activity) throws Exception {
setPredefinedKeyValue("activity", activity);
}
///can be a string of json
public void setCustomField(String custom) throws Exception {
setPredefinedKeyValue("custom", custom);
}
public void setCustomField(JSONObject custom) throws Exception {
setPredefinedKeyValue("custom", custom);
}
}
package com.liquidnet.commons.lang.util.upush;
import org.json.JSONObject;
import java.util.Arrays;
import java.util.HashSet;
public abstract class IOSNotification extends UmengNotification {
// Keys can be set in the aps level
protected static final HashSet<String> APS_KEYS = new HashSet<String>(Arrays.asList(new String[]{
"alert", "badge", "sound", "content-available"
}));
@Override
public boolean setPredefinedKeyValue(String key, Object value) throws Exception {
if (ROOT_KEYS.contains(key)) {
// This key should be in the root level
rootJson.put(key, value);
} else if (APS_KEYS.contains(key)) {
// This key should be in the aps level
JSONObject apsJson = null;
JSONObject payloadJson = null;
if (rootJson.has("payload")) {
payloadJson = rootJson.getJSONObject("payload");
} else {
payloadJson = new JSONObject();
rootJson.put("payload", payloadJson);
}
if (payloadJson.has("aps")) {
apsJson = payloadJson.getJSONObject("aps");
} else {
apsJson = new JSONObject();
payloadJson.put("aps", apsJson);
}
apsJson.put(key, value);
} else if (POLICY_KEYS.contains(key)) {
// This key should be in the body level
JSONObject policyJson = null;
if (rootJson.has("policy")) {
policyJson = rootJson.getJSONObject("policy");
} else {
policyJson = new JSONObject();
rootJson.put("policy", policyJson);
}
policyJson.put(key, value);
} else {
if (key == "payload" || key == "aps" || key == "policy") {
throw new Exception("You don't need to set value for " + key + " , just set values for the sub keys in it.");
} else {
throw new Exception("Unknownd key: " + key);
}
}
return true;
}
// Set customized key/value for IOS notification
public boolean setCustomizedField(String key, String value) throws Exception {
//rootJson.put(key, value);
JSONObject payloadJson = null;
if (rootJson.has("payload")) {
payloadJson = rootJson.getJSONObject("payload");
} else {
payloadJson = new JSONObject();
rootJson.put("payload", payloadJson);
}
payloadJson.put(key, value);
return true;
}
public void setAlert(String token) throws Exception {
setPredefinedKeyValue("alert", token);
}
public void setAlert(String title ,String subtitle , String body) throws Exception{
JSONObject object = new JSONObject();
object.put("title" , title);
object.put("subtitle" , subtitle);
object.put("body" , body);
setPredefinedKeyValue("alert",object );
}
public void setBadge(Integer badge) throws Exception {
setPredefinedKeyValue("badge", badge);
}
public void setSound(String sound) throws Exception {
setPredefinedKeyValue("sound", sound);
}
public void setContentAvailable(Integer contentAvailable) throws Exception {
setPredefinedKeyValue("content-available", contentAvailable);
}
}
package com.liquidnet.commons.lang.util.upush;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class PushClient {
// The user agent
protected final String USER_AGENT = "Mozilla/5.0";
// This object is used for sending the post request to Umeng
// protected HttpClient client = new DefaultHttpClient();
protected CloseableHttpClient client = HttpClients.createDefault();
// The host
protected static final String host = "http://msg.umeng.com"; // https://msgapi.umeng.com
// The upload path
protected static final String uploadPath = "/upload";
// The post path
protected static final String postPath = "/api/send";
public String send(UmengNotification msg) throws Exception {
// msg.setTestMode();
String timestamp = Integer.toString((int)(System.currentTimeMillis() / 1000));
msg.setPredefinedKeyValue("timestamp", timestamp);
String url = host + postPath;
String postBody = msg.getPostBody();
String sign = DigestUtils.md5Hex(("POST" + url + postBody + msg.getAppMasterSecret()).getBytes("utf8"));
url = url + "?sign=" + sign;
HttpPost post = new HttpPost(url);
post.setHeader("User-Agent", USER_AGENT);
StringEntity se = new StringEntity(postBody, "UTF-8");
post.setEntity(se);
// Send the post request and get the response
HttpResponse response = client.execute(post);
int status = response.getStatusLine().getStatusCode();
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
return result.toString();
}
// Upload file with device_tokens to Umeng
public String uploadContents(String appkey,String appMasterSecret,String contents) throws Exception {
// Construct the json string
JSONObject uploadJson = new JSONObject();
uploadJson.put("appkey", appkey);
String timestamp = Integer.toString((int)(System.currentTimeMillis() / 1000));
uploadJson.put("timestamp", timestamp);
uploadJson.put("content", contents);
// Construct the request
String url = host + uploadPath;
String postBody = uploadJson.toString();
String sign = DigestUtils.md5Hex(("POST" + url + postBody + appMasterSecret).getBytes("utf8"));
url = url + "?sign=" + sign;
HttpPost post = new HttpPost(url);
post.setHeader("User-Agent", USER_AGENT);
StringEntity se = new StringEntity(postBody, "UTF-8");
post.setEntity(se);
// Send the post request and get the response
HttpResponse response = client.execute(post);
System.out.println("Response Code : " + response.getStatusLine().getStatusCode());
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
System.out.println(result.toString());
// Decode response string and get file_id from it
JSONObject respJson = new JSONObject(result.toString());
String ret = respJson.getString("ret");
if (!ret.equals("SUCCESS")) {
throw new Exception("Failed to upload file");
}
JSONObject data = respJson.getJSONObject("data");
String fileId = data.getString("file_id");
// Set file_id into rootJson using setPredefinedKeyValue
return fileId;
}
}
package com.liquidnet.commons.lang.util.upush;
import org.json.JSONObject;
import java.util.Arrays;
import java.util.HashSet;
public abstract class UmengNotification {
// This JSONObject is used for constructing the whole request string.
protected final JSONObject rootJson = new JSONObject();
// The app master secret
protected String appMasterSecret;
// Keys can be set in the root level
protected static final HashSet<String> ROOT_KEYS = new HashSet<String>(Arrays.asList(new String[]{
"appkey", "timestamp", "type", "device_tokens", "alias", "alias_type", "file_id",
"filter", "production_mode", "feedback", "description", "thirdparty_id" , "mipush" , "mi_activity" , "channel_properties","device_tokens"}));
// Keys can be set in the policy level
protected static final HashSet<String> POLICY_KEYS = new HashSet<String>(Arrays.asList(new String[]{
"start_time", "expire_time", "max_send_num"
}));
protected static final HashSet<String> CHANNEL_PROPERTIES = new HashSet<String>(Arrays.asList(new String[]{
"channel_activity"
}));
// Set predefined keys in the rootJson, for extra keys(Android) or customized keys(IOS) please
// refer to corresponding methods in the subclass.
public abstract boolean setPredefinedKeyValue(String key, Object value) throws Exception;
public void setAppMasterSecret(String secret) {
appMasterSecret = secret;
}
public String getPostBody(){
return rootJson.toString();
}
protected final String getAppMasterSecret(){
return appMasterSecret;
}
protected void setProductionMode(Boolean prod) throws Exception {
setPredefinedKeyValue("production_mode", prod.toString());
}
///正式模式
public void setProductionMode() throws Exception {
setProductionMode(true);
}
///测试模式
public void setTestMode() throws Exception {
setProductionMode(false);
}
///发送消息描述,建议填写。
public void setDescription(String description) throws Exception {
setPredefinedKeyValue("description", description);
}
///定时发送时间,若不填写表示立即发送。格式: "YYYY-MM-DD hh:mm:ss"。
public void setStartTime(String startTime) throws Exception {
setPredefinedKeyValue("start_time", startTime);
}
///消息过期时间,格式: "YYYY-MM-DD hh:mm:ss"。
public void setExpireTime(String expireTime) throws Exception {
setPredefinedKeyValue("expire_time", expireTime);
}
///发送限速,每秒发送的最大条数。
public void setMaxSendNum(Integer num) throws Exception {
setPredefinedKeyValue("max_send_num", num);
}
//厂商弹窗activity
public void setChannelActivity(String activity) throws Exception{
setPredefinedKeyValue("mipush", "true");
setPredefinedKeyValue("mi_activity",activity );
}
//厂商属性配置
public void setChannelProperties(String xiaoMiChannelId) throws Exception{
JSONObject object = new JSONObject();
object.put("xiaomi_channel_id" , xiaoMiChannelId);
setPredefinedKeyValue("channel_properties", object);
}
}
package com.liquidnet.commons.lang.util.upush.android;
import com.liquidnet.commons.lang.util.upush.AndroidNotification;
public class AndroidBroadcast extends AndroidNotification {
public AndroidBroadcast(String appkey,String appMasterSecret) throws Exception {
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", "broadcast");
}
}
package com.liquidnet.commons.lang.util.upush.android;
import com.liquidnet.commons.lang.util.upush.AndroidNotification;
public class AndroidCustomizedcast extends AndroidNotification {
public AndroidCustomizedcast(String appkey,String appMasterSecret) throws Exception {
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", "customizedcast");
}
public void setAlias(String alias,String aliasType) throws Exception {
setPredefinedKeyValue("alias", alias);
setPredefinedKeyValue("alias_type", aliasType);
}
public void setFileId(String fileId,String aliasType) throws Exception {
setPredefinedKeyValue("file_id", fileId);
setPredefinedKeyValue("alias_type", aliasType);
}
}
package com.liquidnet.commons.lang.util.upush.android;
import com.liquidnet.commons.lang.util.upush.AndroidNotification;
public class AndroidFilecast extends AndroidNotification {
public AndroidFilecast(String appkey,String appMasterSecret) throws Exception {
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", "filecast");
}
public void setFileId(String fileId) throws Exception {
setPredefinedKeyValue("file_id", fileId);
}
}
\ No newline at end of file
package com.liquidnet.commons.lang.util.upush.android;
import com.liquidnet.commons.lang.util.upush.AndroidNotification;
import org.json.JSONObject;
public class AndroidGroupcast extends AndroidNotification {
public AndroidGroupcast(String appkey,String appMasterSecret) throws Exception {
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", "groupcast");
}
public void setFilter(JSONObject filter) throws Exception {
setPredefinedKeyValue("filter", filter);
}
}
package com.liquidnet.commons.lang.util.upush.android;
import com.liquidnet.commons.lang.util.upush.AndroidNotification;
public class AndroidUnicast extends AndroidNotification {
public AndroidUnicast(String appkey,String appMasterSecret) throws Exception {
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", "unicast");
}
public void setDeviceToken(String token) throws Exception {
setPredefinedKeyValue("device_tokens", token);
}
}
\ No newline at end of file
package com.liquidnet.commons.lang.util.upush.ios;
import com.liquidnet.commons.lang.util.upush.IOSNotification;
public class IOSBroadcast extends IOSNotification {
public IOSBroadcast(String appkey,String appMasterSecret) throws Exception {
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", "broadcast");
}
}
package com.liquidnet.commons.lang.util.upush.ios;
import com.liquidnet.commons.lang.util.upush.IOSNotification;
public class IOSCustomizedcast extends IOSNotification {
public IOSCustomizedcast(String appkey,String appMasterSecret) throws Exception {
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", "customizedcast");
}
public void setAlias(String alias,String aliasType) throws Exception {
setPredefinedKeyValue("alias", alias);
setPredefinedKeyValue("alias_type", aliasType);
}
public void setFileId(String fileId, String aliasType) throws Exception {
setPredefinedKeyValue("file_id", fileId);
setPredefinedKeyValue("alias_type", aliasType);
}
}
package com.liquidnet.commons.lang.util.upush.ios;
import com.liquidnet.commons.lang.util.upush.IOSNotification;
public class IOSFilecast extends IOSNotification {
public IOSFilecast(String appkey,String appMasterSecret) throws Exception {
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", "filecast");
}
public void setFileId(String fileId) throws Exception {
setPredefinedKeyValue("file_id", fileId);
}
}
package com.liquidnet.commons.lang.util.upush.ios;
import com.liquidnet.commons.lang.util.upush.IOSNotification;
import org.json.JSONObject;
public class IOSGroupcast extends IOSNotification {
public IOSGroupcast(String appkey,String appMasterSecret) throws Exception {
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", "groupcast");
}
public void setFilter(JSONObject filter) throws Exception {
setPredefinedKeyValue("filter", filter);
}
}
package com.liquidnet.commons.lang.util.upush.ios;
import com.liquidnet.commons.lang.util.upush.IOSNotification;
public class IOSUnicast extends IOSNotification {
public IOSUnicast(String appkey,String appMasterSecret) throws Exception{
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", "unicast");
}
public void setDeviceToken(String token) throws Exception {
setPredefinedKeyValue("device_tokens", token);
}
}
......@@ -37,6 +37,7 @@ public class MQConst {
public enum KylinQueue {
SMS_NOTICE("adam:stream:rk.sms.notice", "group.sms.sender", "短信通知"),
// SMS_SPREAD("adam:stream:rk.sms.spread", "group.sms.sender", "短信推广"),
SQL_PERFORMANCE_SUBSCRIBE("kylin:stream:rk.performance.subscribe", "group.performance.subscribe", "演出预约"),
SQL_PERFORMANCE_LACK("kylin:stream:rk.performance.lack", "group.performance.lack", "缺票登记"),
SQL_ORDER_CREATE("kylin:stream:rk.order.create", "group.order.create", "创建订单"),
......
......@@ -83,6 +83,11 @@
<artifactId>okhttp</artifactId>
<version>4.9.3</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
</dependencies>
<dependencyManagement>
......
package com.liquidnet.service.candy.dto;
import lombok.Data;
/**
* @author zjp
* @create 2024-03-13 11:42
*/
@Data
public class CouponDao {
private String uCouponId;
private String uid;
}
......@@ -2,6 +2,8 @@ package com.liquidnet.service.candy.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto;
import com.liquidnet.service.candy.dto.CouponDao;
import com.liquidnet.service.candy.entity.CandyUserCoupon;
import org.apache.ibatis.annotations.Param;
......@@ -27,4 +29,19 @@ public interface CandyUserCouponMapper extends BaseMapper<CandyUserCoupon> {
* @return List<CandyUserCouponBasicDto>
*/
List<CandyUserCouponBasicDto> selectMultiForUserCouponBasicDto(@Param("uid") String uid);
/**
* 查询优惠卷信息
* @author zjp
* @return: java.util.List<com.liquidnet.service.stone.dto.CouponDao>
* @date 2024/3/13 13:56
*/
List<CouponDao> couponReturn();
/**
* 查询羊毛卷信息
*/
List<CouponDao> WoolRoll();
}
......@@ -60,4 +60,53 @@
WHERE cuc.state in (1,3,5)
AND cuc.uid = #{uid,jdbcType=VARCHAR}
</select>
<select id="couponReturn" resultType="com.liquidnet.service.candy.dto.CouponDao">
select a.ucoupon_id AS uCouponId,
a.coupon_id,
a.uid,
au.mobile,
a.mcoupon_id,
a.used_for,
a.used_at,
a.dued_at,
a.state,
c.order_id
from candy_user_coupon as a
join candy_coupon as b on a.coupon_id = b.coupon_id
left join kylin_order_coupons as c on c.coupon_code = a.ucoupon_id
join adam_user au on au.uid = a.uid
join adam_member am on a.uid = au.uid
where 1 = 1
and b.cou_type = 101
and a.state = 5
and c.order_id is null
and a.dued_at > sysdate()
and am.state = 1
order by a.used_at
</select>
<select id="WoolRoll" resultType="com.liquidnet.service.candy.dto.CouponDao">
select a.ucoupon_id AS uCouponId,
a.coupon_id,
a.uid,
au.mobile,
a.mcoupon_id,
a.used_for,
a.used_at,
a.dued_at,
a.state,
c.order_id,
o.order_code
from candy_user_coupon as a
join candy_coupon as b on a.coupon_id = b.coupon_id
join kylin_order_coupons as c on c.coupon_code = a.ucoupon_id
join adam_user au on au.uid = a.uid
join kylin_order_tickets as o on o.order_tickets_id = c.order_id
join kylin_order_ticket_status as d on d.order_id = c.order_id
where 1 = 1
and b.cou_type = 1
and a.state = 5
and a.dued_at > sysdate()
and d.status = 6
order by a.used_at;
</select>
</mapper>
package com.liquidnet.service.kylin.dao;
import lombok.Data;
/**
* @author zjp
* @create 2024-03-21 15:44
*/
@Data
public class KylinPerformancesSubscribeDao {
private Integer mid;
private String pushTitle;
private String deviceTokens;
private String pushRange;
private String jumpValue;
}
package com.liquidnet.service.kylin.dao.report;
import lombok.Data;
import java.io.Serializable;
@Data
public class KylinPerformanceSubscribeStatisticalDao implements Serializable, Cloneable {
private String performancesId;
private String title;
private String timeStart;
private String cityName;
private String type;
private Integer visitorNumber;
private Integer visitorNumberCount;
private Integer visitorNumberTicket;
private Integer visitorNumberTicketCount;
}
package com.liquidnet.service.kylin.dao.report;
import lombok.Data;
import java.io.Serializable;
@Data
public class KylinPerformanceSubscribeTicketStatisticalDao implements Serializable, Cloneable {
private String ticketTimesTitle;
private String timeTitle;
private Integer subscribeTotal;
}
......@@ -2,6 +2,8 @@ package com.liquidnet.service.kylin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.kylin.dao.*;
import com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeStatisticalDao;
import com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeTicketStatisticalDao;
import com.liquidnet.service.kylin.dao.report.KylinPerformancesDto;
import com.liquidnet.service.kylin.entity.KylinPerformances;
import org.apache.ibatis.annotations.Param;
......@@ -84,4 +86,42 @@ public interface KylinPerformancesMapper extends BaseMapper<KylinPerformances> {
List<CommodityOrderExportDao> exportCommodityOrder(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime);
List<KylinPerformancesDto> getListAll(String title);
/**
* 演出预约统计
* @author zjp
* @param performancesId
* @return: com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeStatisticalDao
* @date 2024/3/18 14:19
*/
KylinPerformanceSubscribeStatisticalDao getSubscribeStatisticalByPerformancesId(@Param("performancesId")String performancesId);
/**
* 获取演出票种预约人数
* @author zjp
* @param performancesId
* @return: java.util.List<com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeTicketStatisticalDao>
* @date 2024/3/18 16:06
*/
List<KylinPerformanceSubscribeTicketStatisticalDao> getSubscribeTicketStatisticalByPerformancesId(@Param("performancesId")String performancesId);
/**
* 获取开票提醒需要push用户信息
* @author zjp
* @param type 推送类型 0 开票提醒
* @param pushRange 推送设备唯一标识
* @param isPush 推送设备 ios android
* @return: java.util.List<com.liquidnet.service.kylin.dao.KylinPerformancesSubscribeDao>
* @date 2024/3/21 16:29
*/
List<KylinPerformancesSubscribeDao> performanceSubscribePush(@Param("type")Integer type,@Param("pushRange")String pushRange,@Param("isPush")Integer isPush);
/**
* 批量修改开票提醒推送状态
* @author zjp
* @param ids
* @return: void
* @date 2024/3/21 18:02
*/
void updatePerformanceSubscribePushById(@Param("ids")List<Integer> ids);
}
......@@ -27,4 +27,7 @@ public interface KylinTicketsMapper extends BaseMapper<KylinTickets> {
List<TicketAndStatusDao> selectTicketsByIds(List<String> ticketsIdList);
ShowAgentDao selectOneByPerIdAndTicketId(@Param("ticketId")String ticketId);
}
......@@ -1139,5 +1139,115 @@ GROUP BY user_mobile,tickets_id;
and gso.status not in (0, 5)
group by do.code) temtable group by temtable.code
</select>
<select id="getSubscribeStatisticalByPerformancesId" resultType="com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeStatisticalDao">
SELECT A.*,
B.visitorNumberCount,
C.visitorNumber,
D.visitorNumberTicketCount,
E.visitorNumberTicket
FROM (SELECT kp.performances_id AS performancesId,
kp.title,
kp.city_name AS cityName,
kp.time_start AS timeStart,
CASE
WHEN (kp.type = '1') THEN
'音乐节'
WHEN (kp.type = '2') THEN
'演唱会'
WHEN (kp.type = '3') THEN
'小型演出'
WHEN (kp.type = '4') THEN
'展览'
WHEN (kp.type = '6') THEN
'舞台剧'
WHEN (kp.type = '101') THEN
'音乐节'
WHEN (kp.type = '102') THEN
'小型演出(livehouse演出)'
WHEN (kp.type = '103') THEN
'巡演'
END type
FROM kylin_performances AS kp
WHERE kp.performances_id = #{performancesId}) A
LEFT JOIN (SELECT count(*) AS visitorNumberCount,
btar.performance_id AS performancesId
FROM bi_ticket_access_records AS btar
WHERE btar.access_type = "now_tk_detail"
AND btar.performance_id = #{performancesId}) B ON A.performancesId = B.performancesId
LEFT JOIN (SELECT count(A.user_id) AS visitorNumber,
A.performancesId AS performancesId
FROM (SELECT user_id,
btar.performance_id AS performancesId
FROM bi_ticket_access_records AS btar
WHERE btar.access_type = "now_tk_detail"
AND btar.performance_id = #{performancesId}
GROUP BY btar.user_id) A) C ON A.performancesId = B.performancesId
LEFT JOIN (SELECT count(*) AS visitorNumberTicketCount,
btar.performance_id AS performancesId
FROM bi_ticket_access_records AS btar
WHERE btar.access_type = "now_tk_ticket"
AND btar.performance_id = #{performancesId}) D ON D.performancesId = A.performancesId
LEFT JOIN (SELECT count(A.user_id) AS visitorNumberTicket,
A.performancesId AS performancesId
FROM (SELECT user_id,
btar.performance_id AS performancesId
FROM bi_ticket_access_records AS btar
WHERE btar.access_type = "now_tk_ticket"
AND btar.performance_id = #{performancesId}
GROUP BY btar.user_id) A) E ON E.performancesId = A.performancesId
</select>
<select id="getSubscribeTicketStatisticalByPerformancesId" resultType="com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeTicketStatisticalDao">
SELECT A.ticketTimesTitle,
A.timeTitle,
IFNULL(B.subscribeTotal, 0) AS subscribeTotal
FROM (SELECT kp.title,
kp.performances_id,
ktt.title AS ticketTimesTitle,
ktt.ticket_times_id,
kt.title AS timeTitle,
kt.tickets_id
FROM kylin_performances AS kp
LEFT JOIN kylin_ticket_time_relation AS kttr ON kttr.performance_id = kp.performances_id
LEFT JOIN kylin_ticket_times AS ktt ON ktt.ticket_times_id = kttr.times_id
LEFT JOIN kylin_ticket_relations AS ktr ON ktr.times_id = ktt.ticket_times_id
LEFT JOIN kylin_tickets AS kt ON kt.tickets_id = ktr.ticket_id
WHERE kp.performances_id = #{performancesId}) A
LEFT JOIN
(SELECT COUNT(*) AS subscribeTotal,
kps.performance_id,
kps.ticket_times_id,
kps.tickets_id
FROM kylin_performance_subscribe kps
WHERE kps.performance_id = #{performancesId}
GROUP BY kps.performance_id,
kps.ticket_times_id,
kps.tickets_id) B ON A.performances_id = B.performance_id AND A.ticket_times_id = B.ticket_times_id AND A.tickets_id = B.tickets_id
ORDER BY A.ticket_times_id
</select>
<select id="performanceSubscribePush" resultType="com.liquidnet.service.kylin.dao.KylinPerformancesSubscribeDao">
SELECT mid,
push_title AS pushTitle,
device_tokens AS deviceTokens,
push_range AS pushRange,
performance_id AS jumpValue
FROM kylin_performance_subscribe
WHERE
push_time &lt;= NOW()
<if test="type!=null">
and type=#{type}
</if>
<if test="pushRange!=null and pushRange!=''">
and push_range=#{pushRange}
</if>
<if test="isPush!=null">
and is_push=#{isPush}
</if>
</select>
<update id="updatePerformanceSubscribePushById" parameterType="java.util.List">
update kylin_performance_subscribe set is_push=1
where mid in
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</update>
</mapper>
......@@ -25,4 +25,7 @@ public interface StoneScoreUserMapper extends BaseMapper<StoneScoreUser> {
List<StoneScoreListDto> listExport(@Param("uids")String[] uids);
}
......@@ -31,4 +31,13 @@ public interface FeignPlatformTaskClient {
@GetMapping("platform/performance/line")
ResponseDto<Boolean> performanceLine();
/**
* 定时开票提醒
* @author zjp
* @return: com.liquidnet.service.base.ResponseDto<java.lang.Boolean>
* @date 2024/3/21 18:03
*/
@GetMapping("platform/performance/subscribePush")
ResponseDto<Boolean> performanceSubscribePush();
}
package com.liquidnet.service.consumer.base.config.kylin;
import com.liquidnet.common.cache.redis.config.RedisStreamConfig;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.consumer.base.receiver.kylin.ConsumerKylinSqlPerformanceLackRdsReceiver;
import com.liquidnet.service.consumer.base.receiver.kylin.ConsumerKylinSqlPerformanceSubscribeRdsReceiver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.stream.Consumer;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.connection.stream.ReadOffset;
import org.springframework.data.redis.connection.stream.StreamOffset;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.stream.StreamMessageListenerContainer;
import org.springframework.data.redis.stream.Subscription;
import java.util.ArrayList;
import java.util.List;
@Configuration
public class ConsumerKylinSqlPerformanceSubscribeRedisStreamConfig extends RedisStreamConfig {
@Autowired
ConsumerKylinSqlPerformanceSubscribeRdsReceiver consumerKylinSqlPerformanceSubscribeRdsReceiver;
@Autowired
StringRedisTemplate stringRedisTemplate;
@Bean//
public List<Subscription> subscribe(RedisConnectionFactory factory) {
List<Subscription> subscriptionList = new ArrayList<>();
MQConst.KylinQueue stream = MQConst.KylinQueue.SQL_PERFORMANCE_SUBSCRIBE;
this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
for (int i = 0; i < 1; i++) {
StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer = this.buildStreamMessageListenerContainer(factory);
subscriptionList.add(listenerContainer.receiveAutoAck(
Consumer.from(stream.getGroup(), getConsumerName(stream.name() + i)),
StreamOffset.create(stream.getKey(), ReadOffset.lastConsumed()), consumerKylinSqlPerformanceSubscribeRdsReceiver
));
listenerContainer.start();
}
return subscriptionList;
}
}
package com.liquidnet.service.consumer.base.receiver.kylin;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.consumer.base.receiver.AbstractSqlRedisReceiver;
import org.springframework.stereotype.Component;
@Component
public class ConsumerKylinSqlPerformanceSubscribeRdsReceiver extends AbstractSqlRedisReceiver {
@Override
protected String getRedisStreamKey() {
return MQConst.KylinQueue.SQL_PERFORMANCE_SUBSCRIBE.getKey();
}
@Override
protected String getRedisStreamGroup() {
return MQConst.KylinQueue.SQL_PERFORMANCE_SUBSCRIBE.getGroup();
}
}
......@@ -82,4 +82,21 @@ public class KylinTaskHandler {
XxlJobHelper.handleFail();
}
}
/**
* 开票提醒定时推送
* @author zjp
* @param null
* @return: null
* @date 2024/3/21 15:32
*/
@XxlJob(value = "sev-platform:performanceSubscribePush")
public void performanceSubscribePush() {
try {
XxlJobHelper.handleSuccess("结果:" + feignPlatformTaskClient.performanceSubscribePush().getData());
} catch (Exception e) {
XxlJobHelper.log(e);
XxlJobHelper.handleFail();
}
}
}
......@@ -114,4 +114,7 @@ public class GoblinStoreZhengzaiController {
// public String refundDetails(HttpServletRequest request) {
// return goblinOrderAppService.huiFuSync(request);
// }
}
CREATE TABLE `kylin_performance_subscribe` (
`mid` int(11) NOT NULL AUTO_INCREMENT,
`performance_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '演出id',
`ticket_times_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '场次id',
`tickets_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '票种id',
`user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '用户id',
`type` tinyint(2) DEFAULT '0' COMMENT '推送类型 0 开票提醒 ',
`device_tokens` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '推送设备唯一标识',
`push_range` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '推送设备 ios android',
`push_title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '推送标题',
`push_time` timestamp NULL DEFAULT NULL COMMENT '推送时间',
`is_push` tinyint(2) DEFAULT '0' COMMENT '是否推送 0 未推送 1推送',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`mid`),
KEY `idx_performance_id` (`performance_id`),
KEY `idx_ticket_times_id` (`ticket_times_id`),
KEY `idx_tickets_id` (`tickets_id`),
KEY `idx_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='演出预约表';
\ No newline at end of file
......@@ -40,3 +40,6 @@ XGROUP CREATE kylin:stream:rk.refundOrderExpress group.refundOrderExpress 0
# ==================================================
# XGROUP DESTROY adam:stream:rk.sms.notice group.sms.sender 0
-- 演出预约 --
XADD kylin:stream:rk.performance.subscribe * 0 0
XGROUP CREATE kylin:stream:rk.performance.subscribe group.performance.subscribe 0
\ No newline at end of file
package com.liquidnet.service.kylin.controller;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.service.IGoblinOrderService;
import com.liquidnet.service.kylin.dto.param.KylinPerformanceSubscribeParam;
import com.liquidnet.service.kylin.service.IKylinPerformancesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* @author zjp
* @create 2024-03-06 14:13
*/
@Api(tags = "前端-演出预约")
@RestController
@RequestMapping("performanceSubscribe")
@Slf4j
public class KylinPerformanceSubscribeController {
@Autowired
private IKylinPerformancesService iKylinPerformancesService;
@PostMapping("")
@ApiOperation("演出预约")
public ResponseDto<String> performanceSubscribe(HttpServletRequest request, @RequestBody @Validated KylinPerformanceSubscribeParam param) {
return iKylinPerformancesService.performanceSubscribe(request,param);
}
@GetMapping("")
@ApiOperation("是否预约演出票种")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "performancesId", value = "演出id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "ticketTimesId", value = "场次id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "ticketsId", value = "票种id", required = true),
})
public ResponseDto<Integer> isSubscribe(@RequestParam("performancesId") String performancesId,
@RequestParam("ticketTimesId") String ticketTimesId,
@RequestParam("ticketsId") String ticketsId) {
return iKylinPerformancesService.performanceIsSubscribe(performancesId, ticketTimesId,ticketsId);
}
@DeleteMapping("")
@ApiOperation("删除预约演出票种")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "performancesId", value = "演出id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "ticketTimesId", value = "场次id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "ticketsId", value = "票种id", required = true),
})
public ResponseDto deleteIsSubscribe(@RequestParam("performancesId") String performancesId,
@RequestParam("ticketTimesId") String ticketTimesId,
@RequestParam("ticketsId") String ticketsId) {
iKylinPerformancesService.deleteIsSubscribe(performancesId, ticketTimesId,ticketsId);
return ResponseDto.success();
}
}
......@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.controller;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.adam.dto.vo.admin.AdminUpushVo;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dto.vo.KylinPerformanceSubscribeUpushVo;
import com.liquidnet.service.kylin.service.impl.KylinUpushServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.LinkedList;
/**
* <p>
......@@ -55,4 +57,16 @@ public class KylinUpushController {
return ResponseDto.success(num);
}
@GetMapping("billingReminderList")
@ApiOperation("开票提醒消息列表")
public ResponseDto<LinkedList<KylinPerformanceSubscribeUpushVo>> billingReminderList() {
return ResponseDto.success(upushServiceImpl.billingReminderList());
}
@GetMapping("billingReminderUnread")
@ApiOperation("开票提醒用户未读数量")
public ResponseDto<Integer> billingReminderUnread() {
return ResponseDto.success(upushServiceImpl.billingReminderUnread());
}
}
......@@ -5,10 +5,13 @@ import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.adam.dto.vo.admin.AdminUpushVo;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dto.vo.KylinPerformanceSubscribeUpushVo;
import com.liquidnet.service.kylin.utils.DataUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;
......@@ -36,6 +39,9 @@ public class KylinUpushServiceImpl {
@Autowired
private RedisUtil redisUtil;
@Autowired
private DataUtils dataUtils;
public PageInfo<AdminUpushVo> lists(HttpServletRequest request, Integer page, Integer size) {
String uid = CurrentUtil.getCurrentUid();
String source = request.getHeader("source");
......@@ -118,4 +124,56 @@ public class KylinUpushServiceImpl {
}
return num;
}
/**
* 开票提醒消息列表
* @author zjp
* @return: java.util.LinkedList<com.liquidnet.service.kylin.dto.vo.KylinPerformanceSubscribeUpushVo>
* @date 2024/3/14 14:53
*/
public LinkedList<KylinPerformanceSubscribeUpushVo> billingReminderList(){
String uid = CurrentUtil.getCurrentUid();
LinkedList<KylinPerformanceSubscribeUpushVo> performanceSubscribeList = dataUtils.getPerformanceSubscribeList(uid);
if(!CollectionUtils.isEmpty(performanceSubscribeList)){
for (Iterator<KylinPerformanceSubscribeUpushVo> it = performanceSubscribeList.iterator(); it.hasNext(); ) {
KylinPerformanceSubscribeUpushVo info = it.next();
//剔除推送时间比当前时间大的数据
String pushTime = info.getPushTime();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime pushTimeL = LocalDateTime.parse(pushTime, formatter);
if(pushTimeL.isAfter(LocalDateTime.now())){
it.remove();
continue;
}
//设置当前消息用户已读
dataUtils.setPerformanceSubscribeRead(uid,info.getPerformancesId(),info.getTicketTimesId());
}
}
return performanceSubscribeList;
}
public Integer billingReminderUnread(){
int num=0;
String uid = CurrentUtil.getCurrentUid();
LinkedList<KylinPerformanceSubscribeUpushVo> performanceSubscribeList = dataUtils.getPerformanceSubscribeList(uid);
if(!CollectionUtils.isEmpty(performanceSubscribeList)){
for (Iterator<KylinPerformanceSubscribeUpushVo> it = performanceSubscribeList.iterator(); it.hasNext(); ) {
KylinPerformanceSubscribeUpushVo info = it.next();
//剔除推送时间比当前时间大的数据
String pushTime = info.getPushTime();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime pushTimeL = LocalDateTime.parse(pushTime, formatter);
if(pushTimeL.isAfter(LocalDateTime.now())){
it.remove();
continue;
}
//判断当前用户消息是否已读
Integer performanceSubscribeRead = dataUtils.getPerformanceSubscribeRead(uid, info.getPerformancesId(), info.getTicketTimesId());
if(performanceSubscribeRead==0){
num++;
}
}
}
return num;
}
}
......@@ -3,6 +3,9 @@ package com.liquidnet.service.kylin.utils;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.adam.constant.AdamRedisConst;
import com.liquidnet.service.adam.dto.vo.AdamMemberVo;
import com.liquidnet.service.adam.dto.vo.AdamUserMemberVo;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo;
import com.liquidnet.service.goblin.dto.vo.*;
......@@ -10,6 +13,7 @@ import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.dao.KylinTicketActive;
import com.liquidnet.service.kylin.dto.vo.KylinApiCameraDevicesVo;
import com.liquidnet.service.kylin.dto.vo.KylinPerformanceSubscribeUpushVo;
import com.liquidnet.service.kylin.dto.vo.WqTempVo;
import com.liquidnet.service.kylin.dto.vo.admin.OrderRefundAddress;
import com.liquidnet.service.kylin.dto.vo.admin.OrderRefundPoundage;
......@@ -1446,7 +1450,111 @@ public class DataUtils {
return (List<String>) obj;
}
}
public void setPerformanceTicketsSubscribe(String uid,String performancesId,String ticketTimesId,String ticketsId,long expirationTime) {
String redisKey=getPerformanceTicketsSubscribeKey(uid,performancesId,ticketTimesId,ticketsId);
redisUtil.set(redisKey, 1,expirationTime);
}
public Integer getPerformanceTicketsSubscribe(String uid,String performancesId,String ticketTimesId,String ticketsId) {
String redisKey=getPerformanceTicketsSubscribeKey(uid,performancesId,ticketTimesId,ticketsId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return 0;
} else {
return (Integer) obj;
}
}
public void setPerformanceSubscribe(String uid,String performancesId,long expirationTime) {
String redisKey=getPerformanceSubscribeKey(uid,performancesId);
redisUtil.set(redisKey, 1,expirationTime);
}
public Integer getPerformanceSubscribe(String uid,String performancesId) {
String redisKey=getPerformanceSubscribeKey(uid,performancesId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return 0;
} else {
return (Integer) obj;
}
}
public void deleteIsSubscribe(String uid,String performancesId,String ticketTimesId,String ticketsId){
String redisKey=getPerformanceTicketsSubscribeKey(uid,performancesId,ticketTimesId,ticketsId);
redisUtil.del(redisKey);
}
private String getPerformanceTicketsSubscribeKey(String uid,String performancesId,String ticketTimesId,String ticketsId){
String redisKey = KylinRedisConst.REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE_TICKETS
.concat(uid)
.concat(":")
.concat(performancesId)
.concat(":")
.concat(ticketTimesId)
.concat(":")
.concat(ticketsId);
return redisKey;
}
private String getPerformanceSubscribeKey(String uid,String performancesId){
String redisKey = KylinRedisConst.REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE
.concat(uid)
.concat(":")
.concat(performancesId);
return redisKey;
}
public void setPerformanceSubscribeList(String uid, LinkedList<KylinPerformanceSubscribeUpushVo> list) {
String redisKey=getPerformanceSubscribeListKey(uid);
redisUtil.set(redisKey, list);
}
public LinkedList<KylinPerformanceSubscribeUpushVo> getPerformanceSubscribeList(String uid) {
String redisKey=getPerformanceSubscribeListKey(uid);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return new LinkedList<KylinPerformanceSubscribeUpushVo>();
} else {
return (LinkedList<KylinPerformanceSubscribeUpushVo>) obj;
}
}
private String getPerformanceSubscribeListKey(String uid){
String redisKey = KylinRedisConst.REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE_LIST
.concat(uid);
return redisKey;
}
public void deleteIsSubscribeRead(String uid,String performancesId,String ticketTimesId){
String redisKey=getPerformanceSubscribeReadKey(uid,performancesId,ticketTimesId);
redisUtil.del(redisKey);
}
public void setPerformanceSubscribeRead(String uid,String performancesId,String ticketTimesId) {
String redisKey=getPerformanceSubscribeReadKey(uid,performancesId,ticketTimesId);
redisUtil.set(redisKey, 1);
}
public Integer getPerformanceSubscribeRead(String uid,String performancesId,String ticketTimesId) {
String redisKey=getPerformanceSubscribeReadKey(uid,performancesId,ticketTimesId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return 0;
} else {
return (Integer) obj;
}
}
public void deletePerformanceSubscribeRead(String uid,String performancesId,String ticketTimesId) {
String redisKey=getPerformanceSubscribeReadKey(uid,performancesId,ticketTimesId);
redisUtil.del(redisKey);
}
private String getPerformanceSubscribeReadKey(String uid,String performancesId,String ticketTimesId){
String redisKey = KylinRedisConst.REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE_READ
.concat(uid)
.concat(":")
.concat(performancesId)
.concat(":")
.concat(ticketTimesId);
return redisKey;
}
//添加激活码使用量
public void incrArCode() {
redisUtil.incr(KylinRedisConst.ACTIVE_USE_AR_COUNT, 1);
......@@ -1455,4 +1563,36 @@ public class DataUtils {
public int incrOrderRefundCode(String orderCode) {
return (int) redisUtil.incr(KylinRedisConst.ORDER_REFUND_TEMP + orderCode,1);
}
//判断是否是会员
public Integer isMemberByUser(String uid) {
Integer isMember=0;
AdamUserMemberVo userMemberVo = getUserMemberVoByUid(uid);
if (null != userMemberVo && userMemberVo.isActive()){
isMember=1;
}
return isMember;
}
//获取用户信息
public AdamUserMemberVo getUserMemberVoByUid(String uid) {
String rk = AdamRedisConst.INFO_USER_MEMBER.concat(uid);
long s = System.currentTimeMillis();
AdamUserMemberVo vo = (AdamUserMemberVo) redisUtil.get(rk);
if (null != vo) {
vo.setState(vo.getState() == 1 ? (vo.getExpiryAt().isAfter(LocalDateTime.now()) ? 1 : 2) : vo.getState());
}
log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s);
return vo;
}
public int getPerformanceInvoiceReminder(String performanceId) {
String redisKey = KylinRedisConst.PERFORMANCES_INVOICE_REMINDER + performanceId;
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return 0;
}else {
return (int) obj;
}
}
}
kylin_order_ticket_entities.updateStatusByStation=UPDATE kylin_order_ticket_entities SET `status`=?,check_client=?,updated_at=? WHERE order_ticket_entities_id=?
# ------------------------缺票登记(不用考虑并发)----------------------------
# ------------------------\u7F3A\u7968\u767B\u8BB0(\u4E0D\u7528\u8003\u8651\u5E76\u53D1)----------------------------
kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id` ,`performance_id` ,`ticket_id` ,`user_id` ,`user_name` ,`user_mobile` ,`send_status` ,`ip_address` ,`created_at`)VALUES(? ,? ,? ,? ,? ,? ,? ,? ,?);
# ------------------------PV/UV----------------------------
bi_ticket_access_records.insert=INSERT INTO `bi_ticket_access_records` ( `user_id`, `access_type`, `performance_id`, `order_id`, `order_code`,`ip_address`, `area`, `area_province`, `area_city`, `area_county`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?);
# ------------------------创建订单----------------------------
# ------------------------\u521B\u5EFA\u8BA2\u5355----------------------------
kylin_order_ticket.add=INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,`number`,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at,pay_code,ip_address,area,area_province,area_city,area_county)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_relation.add=INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id ,ticket_id ,created_at ,updated_at,agent_status,agent_distributions,agent_id_master,agent_distributions_master)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status , produce_code, created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------支付回调----------------------------
# ------------------------\u652F\u4ED8\u56DE\u8C03----------------------------
kylin_order_ticket.synPay=UPDATE kylin_order_tickets SET payment_type = ? ,pay_code = ? , time_pay = ?, qr_code = ? , updated_at = ? WHERE order_tickets_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_order_ticket_status.synPay=UPDATE kylin_order_ticket_status SET `status` = ?,pay_status = ?,updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_order_ticket_relation.synPay=UPDATE kylin_order_ticket_relations SET updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_order_ticket_entities.synPay=UPDATE kylin_order_ticket_entities SET is_payment = ?,updated_at = ?,sys_damai = 1 WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
# ------------------------用户发起订单退款----------------------------
# ------------------------\u7528\u6237\u53D1\u8D77\u8BA2\u5355\u9000\u6B3E----------------------------
kylin_order_ticket_status.refund=UPDATE kylin_order_ticket_status SET status = ? ,updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_order_ticket_entities.refund=UPDATE kylin_order_ticket_entities SET is_payment = ? ,updated_at = ? WHERE order_ticket_entities_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_order_refund.refund=INSERT INTO kylin_order_refunds (order_refunds_id,order_tickets_id,order_refund_code,price,price_express,price_charges,ticket_num,status,type,applicant_id,applicant_name,applicant_at,reason,created_at) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_refund_entities.refund=INSERT INTO kylin_order_refund_entities (order_refunds_entities_id,order_refunds_id,refund_price,order_ticket_entities_id,created_at) VALUES(?,?,?,?,?)
kylin_order_refund_pic.refund=INSERT INTO kylin_order_refund_pic (refund_pic_id,order_refunds_id,pic_url,created_at) VALUES (?,?,?,?)
kylin_order_refund.refundOrderExpress=INSERT INTO kylin_order_express (order_express_id,performances_id,order_tickets_id,order_refunds_id,order_express_code,mailno,express_type,filter_result,remark,express_status,send_type,send_express_type,express_contacts,express_phone,send_express_address,appointment_time,pro_name,cargo_type_code,limit_type_code,express_type_code,goods_value_total,goods_number,created_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------用户发起订单退款撤回----------------------------
# ------------------------\u7528\u6237\u53D1\u8D77\u8BA2\u5355\u9000\u6B3E\u64A4\u56DE----------------------------
kylin_order_ticket_status.withDraw=UPDATE kylin_order_ticket_status SET status = ? ,updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_order_ticket_entities.withDraw=UPDATE kylin_order_ticket_entities SET is_payment = ?,updated_at = ?,sys_damai = 1 WHERE order_ticket_entities_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_order_refund.withDraw=UPDATE kylin_order_refunds SET status = ? ,updated_at = ? WHERE order_refunds_id = ?
# ------------------------用户转赠相关接口----------------------------
# ------------------------\u7528\u6237\u8F6C\u8D60\u76F8\u5173\u63A5\u53E3----------------------------
kylin_order_task.insert=INSERT INTO `kylin_order_task`(`order_id` , `status` , `created_at`) VALUES (? ,? ,?);
kylin_order_task.delete=DELETE FROM kylin_order_task WHERE order_id = ?;
kylin_order_ticket_status.transfer.update=UPDATE kylin_order_ticket_status SET transfer_status = ? ,updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_order_ticket_relation.transfer.update=UPDATE kylin_order_ticket_relations SET transfer_uid = ?, transfer_id = ? ,updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
# ------------------------ 订单补充入场人 ----------------------------
# ------------------------ \u8BA2\u5355\u8865\u5145\u5165\u573A\u4EBA ----------------------------
kylin_order_refund_entities.supplementEnter=UPDATE kylin_order_ticket_entities SET enter_type = ?,enter_name = ?,enter_mobile = ?,enter_id_code = ?,updated_at = ? WHERE order_ticket_entities_id = ?
# ------------------------ 演出预约 ----------------------------
# ------------------------ \u6F14\u51FA\u9884\u7EA6 ----------------------------
kylin_perform_sub.insert=INSERT INTO kylin_perform_sub (perform_sub_id,performance_id,user_id,user_name,user_mobile,source_type) VALUES (?,?,?,?,?,?)
# ------------------------ 万青弥补订单 ----------------------------
# ------------------------ \u4E07\u9752\u5F25\u8865\u8BA2\u5355 ----------------------------
kylin_order_express_ex.insert = INSERT INTO kylin_order_express_ex (`order_id`,`express_contacts`,`express_address`,`province`,`city`,`county`,`express_phone`,`created_at`) VALUES (?,?,?,?,?,?,?,?)
kylin_order_express_ex.sendMail = UPDATE kylin_order_express_ex SET mail_no = ? , updated_at = ? where order_id = ?
# ------------------------ ar演出队列 ----------------------------
# ------------------------ ar\u6F14\u51FA\u961F\u5217 ----------------------------
kylin_ar_ticket.update =update kylin_ticket_active set state=?,redeem_uid= ?,redeem_at= ? where `code`= ?
kylin_order_ticket_entities.update_status_bystation_pad=UPDATE kylin_order_ticket_entities SET `status`=?,check_client=?,updated_at=?, comment=? WHERE order_ticket_entities_id=?
# ------------------------ \u6F14\u51FA\u9884\u7EA6 ----------------------------
kylin_performance_subscribe.insert=INSERT INTO kylin_performance_subscribe(performance_id,ticket_times_id,tickets_id,user_id,type,device_tokens,push_range,push_time,push_title,is_push)VALUES(?,?,?,?,?,?,?,?,?,?)
kylin_performance_subscribe.delete=DELETE FROM kylin_performance_subscribe WHERE performance_id= ? and ticket_times_id = ? and user_id = ?;
\ No newline at end of file
......@@ -8,6 +8,8 @@ import com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto;
import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto;
import com.liquidnet.service.platform.service.impl.candy.PlatformCandyUserCouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
......@@ -53,4 +55,14 @@ public class PlatformCandyDemoteController {
return ResponseDto.success(basicDtoList);
}
@GetMapping("volumeRollback")
@ApiOperation("退卷相关接口")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = "退卷类型 1 优先卷 2 羊毛卷", required = true),
})
public ResponseDto<Integer> volumeRollback(@RequestParam("type") Integer type) {
platformCandyUserCouponService.volumeRollback(type);
return ResponseDto.success();
}
}
package com.liquidnet.service.platform.controller.kylin;
import com.liquidnet.common.cache.redis.util.RedisKylinUtil;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dto.vo.KylinTimePerformanceVo;
import com.liquidnet.service.kylin.dto.vo.PerformanceOrderStatisticalVo;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketVo;
......@@ -45,6 +48,8 @@ public class KylinPerformancesController {
private IKylinPerformancesPartnerService performancesPartnerService;
@Autowired
private MongoTemplate mongoTemplate;
@Autowired
private RedisKylinUtil redisKylinUtil;
@PostMapping("/checkPerformanceTime")
@ApiOperation("演出脚本")
......@@ -86,4 +91,27 @@ public class KylinPerformancesController {
return ResponseDto.success(false);
}
}
@GetMapping(value = "subscribePush")
@ApiOperation(value = "开票提醒定时推送")
public ResponseDto<Boolean> performanceSubscribePush() {
try {
//加锁10分钟避免数据量大重复提醒
boolean lock = redisKylinUtil.lock(KylinRedisConst.REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE_LOCK, 1, 60*10);
if(lock){
log.info("kylin:performance:subscribe:lock开票提醒定时推送我没有加锁!!!!!!!");
performanceVoTask.performanceSubscribePush();
//解锁
redisKylinUtil.uLock(KylinRedisConst.REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE_LOCK);
log.info("kylin:performance:subscribe:lock开票提醒定时推送我解锁了!!!!!!!");
}
return ResponseDto.success(true);
} catch (Exception e) {
e.printStackTrace();
//解锁
redisKylinUtil.uLock(KylinRedisConst.REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE_LOCK);
return ResponseDto.success(false);
}
}
}
......@@ -7,6 +7,7 @@ import com.liquidnet.service.kylin.dto.param.PerformancePartnerListParam;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo;
import com.liquidnet.service.kylin.dto.param.PerformanceStep1Param;
import com.liquidnet.service.kylin.dto.param.PerformanceStep2Param;
import com.liquidnet.service.kylin.dto.vo.KylinPerformanceSubscribeStatisticalVo;
import com.liquidnet.service.kylin.dto.vo.PerformanceOrderStatisticalVo;
import com.liquidnet.service.kylin.service.partner.IKylinPerformancesPartnerService;
import io.swagger.annotations.Api;
......@@ -121,4 +122,12 @@ public class PerformancePartnerController {
List<PerformanceOrderStatisticalVo> list =performancesPartnerService.getPerformanceOrderStatisticalList(performancesId);
return ResponseDto.success(list);
}
@GetMapping(value = "subscribeStatistical")
@ApiOperation(value = "演出预约统计",position = 10)
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<KylinPerformanceSubscribeStatisticalVo> getSubscribeStatistical(@RequestParam("performancesId") @NotNull(message = "演出ID不能为空") String performancesId) {
return ResponseDto.success(performancesPartnerService.getSubscribeStatistical(performancesId));
}
}
package com.liquidnet.service.platform.controller.stone;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.platform.service.impl.stone.StoneServerImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
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.bind.annotation.*;
@Api(tags = "数据迁移 (会重复)")
......
package com.liquidnet.service.platform.service.impl.candy;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -7,6 +8,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.common.cache.redis.util.AbstractRedisUtil;
import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.HttpUtil;
import com.liquidnet.service.adam.constant.AdamRedisConst;
import com.liquidnet.service.base.OrderCloseMapping;
import com.liquidnet.service.base.constant.MQConst;
......@@ -14,17 +18,21 @@ import com.liquidnet.service.candy.constant.CandyRedisConst;
import com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto;
import com.liquidnet.service.candy.dto.CandyCouponRuleDto;
import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto;
import com.liquidnet.service.candy.dto.CouponDao;
import com.liquidnet.service.candy.entity.CandyUserCoupon;
import com.liquidnet.service.candy.mapper.CandyCommonCouponMapper;
import com.liquidnet.service.candy.mapper.CandyCouponRuleMapper;
import com.liquidnet.service.candy.mapper.CandyUserCouponMapper;
import com.liquidnet.service.goblin.param.BackCouponParam;
import com.liquidnet.service.platform.utils.ObjectUtil;
import com.liquidnet.service.platform.utils.QueueUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.MultiValueMap;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.LinkedList;
......@@ -32,7 +40,6 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@Slf4j
@Service
public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponMapper, CandyUserCoupon> {
......@@ -48,6 +55,8 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM
@Autowired
private RedisDataSourceUtil redisDataSourceUtil;
@Value("${liquidnet.service.candy.url}")
private String candyUrl;
/**
* @param uCouponUidList 内容 uCouponId,uid List
* @param uCouponIdList 内容 uCouponId List
......@@ -205,4 +214,45 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM
}
return pl.get();
}
public void volumeRollback(Integer type) {
//优惠卷
if(type==1){
List<CouponDao> couponDaos = candyUserCouponMapper.couponReturn();
if(null!=couponDaos && couponDaos.size()>0){
for (CouponDao dao : couponDaos) {
backCoupon(dao.getUCouponId(),dao.getUid());
}
}
}
//羊毛卷
if(type==2){
List<CouponDao> couponDaos = candyUserCouponMapper.WoolRoll();
if(null!=couponDaos && couponDaos.size()>0){
for (CouponDao dao : couponDaos) {
backCoupon(dao.getUCouponId(),dao.getUid());
}
}
}
}
public void backCoupon(String uCouponId, String uid) {
try {
BackCouponParam param = BackCouponParam.getNew();
param.setuCouponIds(uCouponId);
param.setUid(uid);
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString();
header.add("Authorization", "Bearer " + CurrentUtil.getToken());
header.add("Accept", "application/json;charset=UTF-8");
ArrayList<BackCouponParam> params = new ArrayList();
params.add(param);
String jsonString = JSON.toJSONString(params);
String returnData = HttpUtil.postRaw(candyUrl + "/candy-coupon/useBack", jsonString, header);
System.out.println(returnData);
} catch (Exception e) {
log.error("回退券ERROR:{}", e);
}
}
}
......@@ -5,20 +5,20 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil;
import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.UserPathDto;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dao.PerformanceOrderStatisticalDao;
import com.liquidnet.service.kylin.dao.PerformancePartnerListDao;
import com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeStatisticalDao;
import com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeTicketStatisticalDao;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerListParam;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo;
import com.liquidnet.service.kylin.dto.param.PerformanceStep1Param;
import com.liquidnet.service.kylin.dto.param.PerformanceStep2Param;
import com.liquidnet.service.kylin.dto.vo.KylinPerformanceSubscribeStatisticalVo;
import com.liquidnet.service.kylin.dto.vo.KylinTimePerformanceVo;
import com.liquidnet.service.kylin.dto.vo.PerformanceOrderStatisticalVo;
import com.liquidnet.service.kylin.dto.vo.partner.*;
......@@ -753,4 +753,24 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
voList.add(vo);
return voList;
}
@Override
public KylinPerformanceSubscribeStatisticalVo getSubscribeStatistical(String performancesId) {
//预约总人数
Integer subscribeTotal=0;
//获取演出详情预约人数
KylinPerformanceSubscribeStatisticalDao subscribeStatisticalByPerformancesId = performancesMapper.getSubscribeStatisticalByPerformancesId(performancesId);
KylinPerformanceSubscribeStatisticalVo kylinPerformanceSubscribeStatisticalVo = BeanConverterUtil.convert(subscribeStatisticalByPerformancesId, KylinPerformanceSubscribeStatisticalVo.class);
//获取演出票种预约人数
List<KylinPerformanceSubscribeTicketStatisticalDao> subscribeTicketStatisticalDaoList = performancesMapper.getSubscribeTicketStatisticalByPerformancesId(performancesId);
if(!CollectionUtil.isEmpty(subscribeTicketStatisticalDaoList)){
for (KylinPerformanceSubscribeTicketStatisticalDao kylinPerformanceSubscribeTicketStatisticalDao : subscribeTicketStatisticalDaoList) {
subscribeTotal+=kylinPerformanceSubscribeTicketStatisticalDao.getSubscribeTotal();
}
}
kylinPerformanceSubscribeStatisticalVo.setKylinPerformanceSubscribeTicketStatisticalDaoList(subscribeTicketStatisticalDaoList);
kylinPerformanceSubscribeStatisticalVo.setSubscribeTotal(subscribeTotal);
return kylinPerformanceSubscribeStatisticalVo;
}
}
......@@ -19,7 +19,6 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
......@@ -39,6 +38,7 @@ public class StoneServerImpl {
@Autowired
TempScoreMapper tempScoreMapper;
public boolean refreshScore(String time) {
//获取需要跑积分的用户
LocalDate et = LocalDate.parse(time);
......
......@@ -2,11 +2,19 @@ package com.liquidnet.service.platform.utils;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.commons.lang.constant.LnsEnum;
import com.liquidnet.commons.lang.constant.UpushTargetType;
import com.liquidnet.commons.lang.util.*;
import com.liquidnet.commons.lang.util.upush.AndroidNotification;
import com.liquidnet.commons.lang.util.upush.PushClient;
import com.liquidnet.commons.lang.util.upush.android.AndroidBroadcast;
import com.liquidnet.commons.lang.util.upush.android.AndroidUnicast;
import com.liquidnet.commons.lang.util.upush.ios.IOSBroadcast;
import com.liquidnet.commons.lang.util.upush.ios.IOSUnicast;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dao.KylinPerformancesSubscribeDao;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo;
import com.liquidnet.service.kylin.dto.vo.KylinPerformanceSubscribeUpushVo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketVo;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo;
......@@ -25,6 +33,8 @@ import lombok.extern.slf4j.Slf4j;
import org.bson.Document;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.convert.MongoConverter;
import org.springframework.data.mongodb.core.query.Criteria;
......@@ -38,6 +48,8 @@ import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
@Component
@Slf4j
......@@ -87,6 +99,18 @@ public class PerformanceVoTask {
private KylinTicketsPartnerServiceImpl ticketsPartnerService;
@Value("${liquidnet.umeng.ios.appkey}")
private String iosAppkey;
@Value("${liquidnet.umeng.ios.appMasterSecret}")
private String iosAppMasterSecret;
@Value("${liquidnet.umeng.android.appkey}")
private String androidAppkey;
@Value("${liquidnet.umeng.android.appMasterSecret}")
private String androidAppMasterSecret;
@Autowired
Environment environment;
private PushClient client = new PushClient();
/**
* 根据票状态判断 演出状态 票状态
*
......@@ -476,4 +500,113 @@ public class PerformanceVoTask {
}
return false;
}
public void performanceSubscribePush()throws Exception{
//异步处理ios
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
try {
//IOS开票提醒推送
IOSPush();
} catch (Exception e) {
e.printStackTrace();
}
log.info("IOS开票提醒推送异步任务执行完毕");
});
//Android开票提醒推送
log.info("Android开票提醒推送主线程继续执行");
AndroidPush();
future.get(); // 等待异步任务完成
log.info("开票提醒推送所有任务执行完毕");
}
public void AndroidPush(){
List<KylinPerformancesSubscribeDao> kylinPerformancesSubscribeDaoAndroidList = performancesMapper.performanceSubscribePush(0, "Android", 0);
if(!CollectionUtil.isEmpty(kylinPerformancesSubscribeDaoAndroidList)){
long startTime = System.currentTimeMillis(); // 获取开始时间
log.info("友盟Android开票提醒推送开始startTime===={}",startTime);
for (KylinPerformancesSubscribeDao kylinPerformancesSubscribeDao : kylinPerformancesSubscribeDaoAndroidList) {
//友盟推送
sendAndroidUnicast(kylinPerformancesSubscribeDao.getDeviceTokens(),kylinPerformancesSubscribeDao.getPushTitle(),6,kylinPerformancesSubscribeDao.getJumpValue());
}
long endTime = System.currentTimeMillis(); // 获取结束时间
log.info("友盟Android开票提醒推送结束方法执行时间秒===={}",(startTime-endTime)/1000);
List<Integer> IOSIds = kylinPerformancesSubscribeDaoAndroidList.stream().map(KylinPerformancesSubscribeDao::getMid).collect(Collectors.toList());
//批量修改变成已推送
performancesMapper.updatePerformanceSubscribePushById(IOSIds);
}
}
public void IOSPush(){
List<KylinPerformancesSubscribeDao> kylinPerformancesSubscribeDaoIOSList = performancesMapper.performanceSubscribePush(0, "IOS", 0);
if(!CollectionUtil.isEmpty(kylinPerformancesSubscribeDaoIOSList)){
long startTime = System.currentTimeMillis(); // 获取开始时间
log.info("友盟IOS开票提醒推送开始startTime===={}",startTime);
for (KylinPerformancesSubscribeDao kylinPerformancesSubscribeDao : kylinPerformancesSubscribeDaoIOSList) {
//友盟推送
sendIOSUnicast(kylinPerformancesSubscribeDao.getDeviceTokens(),kylinPerformancesSubscribeDao.getPushTitle(),6,kylinPerformancesSubscribeDao.getJumpValue());
}
long endTime = System.currentTimeMillis(); // 获取结束时间
log.info("友盟IOS开票提醒推送结束方法执行时间秒===={}",(startTime-endTime)/1000);
List<Integer> IOSIds = kylinPerformancesSubscribeDaoIOSList.stream().map(KylinPerformancesSubscribeDao::getMid).collect(Collectors.toList());
//批量修改变成已推送
performancesMapper.updatePerformanceSubscribePushById(IOSIds);
}
}
public void sendAndroidUnicast(String deviceTokens,String pushTitle,Integer jumpType,String jumpValue) {
try {
AndroidUnicast unicast = new AndroidUnicast(androidAppkey, androidAppMasterSecret);
unicast.setBadge(1);
unicast.setTicker("【正在现场】开票提醒");
unicast.setTitle("【正在现场】开票提醒");
unicast.setText(pushTitle);
String custom = UpushTargetType.getTypeAction(jumpType);
unicast.goCustomAfterOpen(custom);
unicast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
if (!LnsEnum.ENV.prod.name().equals(environment.getProperty(CurrentUtil.CK_ENV_ACTIVE))) {
unicast.setTestMode();
} else {
unicast.setProductionMode();
}
// Set customized fields
unicast.setExtraField("type", jumpType.toString());
unicast.setExtraField("id", jumpValue);
unicast.setExtraField("url", jumpValue);
//表示指定的单个设备
unicast.setDeviceToken(deviceTokens);
//配置华为离线通知
unicast.setPredefinedKeyValue("channel_activity","com.modernsky.istv.ui.activity.MfrMessageActivity");
log.info("友盟消息推送开始Android============deviceTokens========={},pushTitle========={}",deviceTokens,pushTitle);
String sendRes = client.send(unicast);
log.info("友盟消息推送成功AndroidReturn============sendRes===={}",sendRes);
} catch (Exception e) {
log.info("友盟消息推送失败Android============deviceTokens={},pushTitle={},e={}",deviceTokens,pushTitle,e);
}
}
public void sendIOSUnicast(String deviceTokens,String pushTitle,Integer jumpType,String jumpValue) {
AdminUpush updatePush = new AdminUpush();
try {
IOSUnicast unicast = new IOSUnicast(iosAppkey, iosAppMasterSecret);
//alert的值设置为字典
unicast.setAlert("【正在现场】开票提醒", "", pushTitle);
unicast.setBadge(1);
unicast.setSound("default");
if (!LnsEnum.ENV.prod.name().equals(environment.getProperty(CurrentUtil.CK_ENV_ACTIVE))) {
unicast.setTestMode();
} else {
unicast.setProductionMode();
}
// Set customized fields
unicast.setCustomizedField("type", jumpType.toString());
unicast.setCustomizedField("id", jumpValue);
unicast.setCustomizedField("url", jumpValue);
//表示指定的单个设备
unicast.setDeviceToken(deviceTokens);
log.info("友盟消息推送开始IOS============deviceTokens========={},pushTitle========={}",deviceTokens,pushTitle);
String sendRes = client.send(unicast);
log.info("友盟消息推送成功IOS============sendRes===={}",sendRes);
} catch (Exception e) {
log.info("友盟消息推送失败IOS============deviceTokens={},pushTitle={},e={}",deviceTokens,pushTitle,e);;
}
}
}
......@@ -14,6 +14,7 @@ import com.liquidnet.service.kylin.dto.param.PerformancePartnerListParam;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo;
import com.liquidnet.service.kylin.dto.param.PerformanceStep1Param;
import com.liquidnet.service.kylin.dto.param.PerformanceStep2Param;
import com.liquidnet.service.kylin.dto.vo.KylinPerformanceSubscribeStatisticalVo;
import com.liquidnet.service.kylin.dto.vo.KylinTimePerformanceVo;
import com.liquidnet.service.kylin.dto.vo.PerformanceOrderStatisticalVo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo;
......@@ -210,6 +211,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
step2Param.setMerchantId(CurrentUtil.getCurrentSlimeUid());
// 无 performancesId 则 创建
if (!step2Param.getPerformancesId().isEmpty()) { // 获取 create 数据 status = 0 或 无数据 创建
redisSlimeUtils.setPerformanceInvoiceReminder(step2Param.getPerformancesId(), step2Param.getIsInvoiceReminder());
KylinPerformanceVo vo = redisSlimeUtils.getPerformanceVo(step2Param.getPerformancesId());
if (vo == null || vo.getAppStatus() == 0 || vo.getAppStatus() == 1 || (vo.getAppStatus() == 4 && vo.getAuditStatus() == 2)) {
result = createStep2(step2Param);
......@@ -547,6 +549,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
}
performanceStep2Param.setTicketTimes(ticketTimesTicketCreatePartnerVoList);
performanceStep2Param.setIsInvoiceReminder(redisSlimeUtils.getPerformanceInvoiceReminder(performancesId));
log.info(UserPathDto.setPartnerData("0", "getStep2", "performancesId=" + performancesId, performanceStep2Param));
return ResponseDto.success(performanceStep2Param);
}
......@@ -952,4 +955,9 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
return null;
}
@Override
public KylinPerformanceSubscribeStatisticalVo getSubscribeStatistical(String performancesId) {
return null;
}
}
......@@ -296,4 +296,19 @@ public class RedisSlimeUtils {
return (List<HashMap<String, String>>) redisUtil.get(redisKey);
}
}
public int getPerformanceInvoiceReminder(String performanceId) {
String redisKey = KylinRedisConst.PERFORMANCES_INVOICE_REMINDER + performanceId;
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return 0;
}else {
return (int) obj;
}
}
public void setPerformanceInvoiceReminder(String performanceId, int invoiceReminder) {
String redisKey = KylinRedisConst.PERFORMANCES_INVOICE_REMINDER + performanceId;
redisUtil.set(redisKey, invoiceReminder);
}
}
......@@ -27,20 +27,20 @@ kylin_order_ticket_entities.update_status_bystation=UPDATE kylin_order_ticket_en
# ---- 演出修改 ----
# ---- \u6F14\u51FA\u4FEE\u6539 ----
kylin_performances.auditTime=UPDATE kylin_performances SET audit_time = ? WHERE performances_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_performances_status.withdraw=UPDATE kylin_performance_status SET audit_status = ? WHERE performance_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_performances_status.withdraw2=UPDATE kylin_performance_status SET audit_status = ? , field_audit_status = ?, status = ? WHERE performance_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_performances_status.outLine=UPDATE kylin_performance_status SET status = ? AND updated_at = ? WHERE performance_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_performances_status.onLine=UPDATE kylin_performance_status SET status = ? AND updated_at = ? WHERE performance_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
# ---- 票种状态修改 ----
# ---- \u7968\u79CD\u72B6\u6001\u4FEE\u6539 ----
kylin_ticket_status.update_status=UPDATE kylin_ticket_status SET status = ?, updated_at = ? WHERE ticket_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_ticket_status.onLine=UPDATE kylin_ticket_status SET status = ?, updated_at = ? WHERE ticket_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
# ---- 场地审核演出 ----
# ---- \u573A\u5730\u5BA1\u6838\u6F14\u51FA ----
kylin_performance_status.fieldsStatus = UPDATE kylin_performance_status SET field_audit_status = ? , audit_status = ? ,status = ? WHERE performance_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_performances_reject_txt.fieldsStatus = UPDATE kylin_performances SET reject_txt = ? WHERE performances_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
# ---- 演出第二步骤操作 ----
# ---- \u6F14\u51FA\u7B2C\u4E8C\u6B65\u9AA4\u64CD\u4F5C ----
kylin_performance.updateStep2=UPDATE kylin_performances SET audit_time = ? , notice_image = ? WHERE performances_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_performance_status.updateStep2=UPDATE kylin_performance_status SET field_audit_status = ? ,audit_status = ? , is_true_name = ? , limit_count = ?,id_count =? WHERE performance_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_ticket.updateStep2=UPDATE kylin_tickets SET time_end = ? , time_start = ? ,time_end_express = ? ,pay_countdown_minute = ? ,price = ? WHERE tickets_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment