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

Commit 80181142 authored by zhoujianping's avatar zhoujianping

1.演出预约相关功能开发

parent 0fa62b8d
...@@ -49,4 +49,7 @@ public interface ICandyCouponService { ...@@ -49,4 +49,7 @@ public interface ICandyCouponService {
ResponseDto<CandyCouponVo> receiveCouponDetails(String ccode); ResponseDto<CandyCouponVo> receiveCouponDetails(String ccode);
ResponseDto<List<CandyCouponVo>> couponListById(String uCouponIds,String uid); ResponseDto<List<CandyCouponVo>> couponListById(String uCouponIds,String uid);
void volumeRollback(Integer type);
} }
...@@ -90,7 +90,10 @@ public class KylinRedisConst { ...@@ -90,7 +90,10 @@ public class KylinRedisConst {
public static final String KYLIN_EXPRESS_MODULES = "kylin:express:modules"; 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_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_LIST = "kylin:performance:subscribe:list"; //预约列表
public static final String REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE_READ = "kylin:performance:subscribe:read"; //预约列表是否已读
public static final String REDIS_WQ_ORDER_FIX = "kylin:wq:order:";//纪录万青 订单填写快递地址 public static final String REDIS_WQ_ORDER_FIX = "kylin:wq:order:";//纪录万青 订单填写快递地址
public static final String REDIS_WQ_ORDER_EXPRESS = "kylin:wq:pxress:order:";//万青补偿快递vo 订单填写快递地址 public static final String REDIS_WQ_ORDER_EXPRESS = "kylin:wq:pxress:order:";//万青补偿快递vo 订单填写快递地址
......
...@@ -108,5 +108,30 @@ public class KylinTableStatusConst { ...@@ -108,5 +108,30 @@ public class KylinTableStatusConst {
return desc; 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 javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @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 timeId;
@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;
}
package com.liquidnet.service.kylin.dto.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
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;
}
...@@ -138,7 +138,8 @@ public class KylinPerformanceVo implements Serializable, Cloneable { ...@@ -138,7 +138,8 @@ public class KylinPerformanceVo implements Serializable, Cloneable {
private String merchantId; private String merchantId;
@ApiModelProperty(value = "场地审核状态 [0-审核完成|1-待审核|2-已拒绝]", hidden = true) @ApiModelProperty(value = "场地审核状态 [0-审核完成|1-待审核|2-已拒绝]", hidden = true)
private Integer fieldAuditStatus; private Integer fieldAuditStatus;
@ApiModelProperty(value = "是否预约演出 0 无 1有")
private Integer isSubscribe;
public Integer getIdCount() { public Integer getIdCount() {
return idCount == null ? limitCount : idCount; return idCount == null ? limitCount : idCount;
} }
......
...@@ -2,8 +2,10 @@ package com.liquidnet.service.kylin.service; ...@@ -2,8 +2,10 @@ package com.liquidnet.service.kylin.service;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dto.param.KylinCandyItemParam; 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 com.liquidnet.service.kylin.dto.vo.mongo.KylinCandyVo;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
/** /**
...@@ -30,4 +32,23 @@ public interface IKylinPerformancesService { ...@@ -30,4 +32,23 @@ public interface IKylinPerformancesService {
ResponseDto<Integer> isSubscribe(String performancesId); ResponseDto<Integer> isSubscribe(String performancesId);
ResponseDto<List<KylinCandyVo>> kylinCandy(List<KylinCandyItemParam> data, String roadShowId); 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);
} }
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.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 (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"
}));
// 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,String type) throws Exception {
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", type);
}
}
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,String type) throws Exception {
setAppMasterSecret(appMasterSecret);
setPredefinedKeyValue("appkey", appkey);
this.setPredefinedKeyValue("type", type);
}
}
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 { ...@@ -37,6 +37,7 @@ public class MQConst {
public enum KylinQueue { public enum KylinQueue {
SMS_NOTICE("adam:stream:rk.sms.notice", "group.sms.sender", "短信通知"), SMS_NOTICE("adam:stream:rk.sms.notice", "group.sms.sender", "短信通知"),
// SMS_SPREAD("adam:stream:rk.sms.spread", "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_PERFORMANCE_LACK("kylin:stream:rk.performance.lack", "group.performance.lack", "缺票登记"),
SQL_ORDER_CREATE("kylin:stream:rk.order.create", "group.order.create", "创建订单"), SQL_ORDER_CREATE("kylin:stream:rk.order.create", "group.order.create", "创建订单"),
......
...@@ -83,6 +83,11 @@ ...@@ -83,6 +83,11 @@
<artifactId>okhttp</artifactId> <artifactId>okhttp</artifactId>
<version>4.9.3</version> <version>4.9.3</version>
</dependency> </dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
</dependencies> </dependencies>
<dependencyManagement> <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; ...@@ -2,6 +2,8 @@ package com.liquidnet.service.candy.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto; 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.entity.CandyUserCoupon;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -27,4 +29,19 @@ public interface CandyUserCouponMapper extends BaseMapper<CandyUserCoupon> { ...@@ -27,4 +29,19 @@ public interface CandyUserCouponMapper extends BaseMapper<CandyUserCoupon> {
* @return List<CandyUserCouponBasicDto> * @return List<CandyUserCouponBasicDto>
*/ */
List<CandyUserCouponBasicDto> selectMultiForUserCouponBasicDto(@Param("uid") String uid); 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 @@ ...@@ -60,4 +60,53 @@
WHERE cuc.state in (1,3,5) WHERE cuc.state in (1,3,5)
AND cuc.uid = #{uid,jdbcType=VARCHAR} AND cuc.uid = #{uid,jdbcType=VARCHAR}
</select> </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> </mapper>
...@@ -25,4 +25,7 @@ public interface StoneScoreUserMapper extends BaseMapper<StoneScoreUser> { ...@@ -25,4 +25,7 @@ public interface StoneScoreUserMapper extends BaseMapper<StoneScoreUser> {
List<StoneScoreListDto> listExport(@Param("uids")String[] uids); List<StoneScoreListDto> listExport(@Param("uids")String[] uids);
} }
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();
}
}
...@@ -114,4 +114,7 @@ public class GoblinStoreZhengzaiController { ...@@ -114,4 +114,7 @@ public class GoblinStoreZhengzaiController {
// public String refundDetails(HttpServletRequest request) { // public String refundDetails(HttpServletRequest request) {
// return goblinOrderAppService.huiFuSync(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',
`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 ...@@ -40,3 +40,6 @@ XGROUP CREATE kylin:stream:rk.refundOrderExpress group.refundOrderExpress 0
# ================================================== # ==================================================
# XGROUP DESTROY adam:stream:rk.sms.notice group.sms.sender 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),
})
public ResponseDto<Integer> isSubscribe(@RequestParam("performancesId") String performancesId,
@RequestParam("ticketTimesId") String ticketTimesId) {
return iKylinPerformancesService.performanceIsSubscribe(performancesId, ticketTimesId);
}
}
...@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.controller; ...@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.controller;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.liquidnet.service.adam.dto.vo.admin.AdminUpushVo; import com.liquidnet.service.adam.dto.vo.admin.AdminUpushVo;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dto.vo.KylinPerformanceSubscribeUpushVo;
import com.liquidnet.service.kylin.service.impl.KylinUpushServiceImpl; import com.liquidnet.service.kylin.service.impl.KylinUpushServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.LinkedList;
/** /**
* <p> * <p>
...@@ -55,4 +57,16 @@ public class KylinUpushController { ...@@ -55,4 +57,16 @@ public class KylinUpushController {
return ResponseDto.success(num); 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; ...@@ -5,10 +5,13 @@ import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CurrentUtil; import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.adam.dto.vo.admin.AdminUpushVo; import com.liquidnet.service.adam.dto.vo.admin.AdminUpushVo;
import com.liquidnet.service.kylin.constant.KylinRedisConst; 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.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -36,6 +39,9 @@ public class KylinUpushServiceImpl { ...@@ -36,6 +39,9 @@ public class KylinUpushServiceImpl {
@Autowired @Autowired
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Autowired
private DataUtils dataUtils;
public PageInfo<AdminUpushVo> lists(HttpServletRequest request, Integer page, Integer size) { public PageInfo<AdminUpushVo> lists(HttpServletRequest request, Integer page, Integer size) {
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
String source = request.getHeader("source"); String source = request.getHeader("source");
...@@ -118,4 +124,56 @@ public class KylinUpushServiceImpl { ...@@ -118,4 +124,56 @@ public class KylinUpushServiceImpl {
} }
return num; 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;
}
} }
...@@ -10,6 +10,7 @@ import com.liquidnet.service.kylin.constant.KylinRedisConst; ...@@ -10,6 +10,7 @@ import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst; import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.dao.KylinTicketActive; import com.liquidnet.service.kylin.dao.KylinTicketActive;
import com.liquidnet.service.kylin.dto.vo.KylinApiCameraDevicesVo; 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.WqTempVo;
import com.liquidnet.service.kylin.dto.vo.admin.OrderRefundAddress; import com.liquidnet.service.kylin.dto.vo.admin.OrderRefundAddress;
import com.liquidnet.service.kylin.dto.vo.admin.OrderRefundPoundage; import com.liquidnet.service.kylin.dto.vo.admin.OrderRefundPoundage;
...@@ -1446,7 +1447,77 @@ public class DataUtils { ...@@ -1446,7 +1447,77 @@ public class DataUtils {
return (List<String>) obj; return (List<String>) obj;
} }
} }
public void setPerformanceSubscribe(String uid,String performancesId,String ticketTimesId,long expirationTime) {
String redisKey=getPerformanceSubscribeKey(uid,performancesId,ticketTimesId);
redisUtil.set(redisKey, 1,expirationTime);
}
public Integer getPerformanceSubscribe(String uid,String performancesId,String ticketTimesId) {
String redisKey=getPerformanceSubscribeKey(uid,performancesId,ticketTimesId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return 0;
} else {
return (Integer) obj;
}
}
private String getPerformanceSubscribeKey(String uid,String performancesId,String ticketTimesId){
String redisKey = KylinRedisConst.REDIS_KEY_KYLIN_PERFORMANCE_SUBSCRIBE
.concat(uid)
.concat(":")
.concat(performancesId)
.concat(":")
.concat(ticketTimesId);
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 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() { public void incrArCode() {
redisUtil.incr(KylinRedisConst.ACTIVE_USE_AR_COUNT, 1); redisUtil.incr(KylinRedisConst.ACTIVE_USE_AR_COUNT, 1);
......
kylin_order_ticket_entities.updateStatusByStation=UPDATE kylin_order_ticket_entities SET `status`=?,check_client=?,updated_at=? WHERE order_ticket_entities_id=? 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(? ,? ,? ,? ,? ,? ,? ,? ,?); 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---------------------------- # ------------------------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 (?,?,?,?,?,?,?,?,?,?,?); 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.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_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_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(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) 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.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_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_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) 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_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_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.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_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_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 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) 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_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_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 = ? 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.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_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_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) 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 = ? 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 (?,?,?,?,?,?) 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.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 = ? 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_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=? 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)VALUES(?,?,?,?,?,?,?)
\ No newline at end of file
...@@ -8,6 +8,8 @@ import com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto; ...@@ -8,6 +8,8 @@ import com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto;
import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto; import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto;
import com.liquidnet.service.platform.service.impl.candy.PlatformCandyUserCouponService; import com.liquidnet.service.platform.service.impl.candy.PlatformCandyUserCouponService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -53,4 +55,14 @@ public class PlatformCandyDemoteController { ...@@ -53,4 +55,14 @@ public class PlatformCandyDemoteController {
return ResponseDto.success(basicDtoList); 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.stone; package com.liquidnet.service.platform.controller.stone;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.platform.service.impl.stone.StoneServerImpl; import com.liquidnet.service.platform.service.impl.stone.StoneServerImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "数据迁移 (会重复)") @Api(tags = "数据迁移 (会重复)")
......
package com.liquidnet.service.platform.service.impl.candy; 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.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...@@ -7,6 +8,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -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.AbstractRedisUtil;
import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil; import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil;
import com.liquidnet.common.exception.LiquidnetServiceException; 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.adam.constant.AdamRedisConst;
import com.liquidnet.service.base.OrderCloseMapping; import com.liquidnet.service.base.OrderCloseMapping;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
...@@ -14,17 +18,21 @@ import com.liquidnet.service.candy.constant.CandyRedisConst; ...@@ -14,17 +18,21 @@ import com.liquidnet.service.candy.constant.CandyRedisConst;
import com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto; import com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto;
import com.liquidnet.service.candy.dto.CandyCouponRuleDto; import com.liquidnet.service.candy.dto.CandyCouponRuleDto;
import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto; 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.entity.CandyUserCoupon;
import com.liquidnet.service.candy.mapper.CandyCommonCouponMapper; import com.liquidnet.service.candy.mapper.CandyCommonCouponMapper;
import com.liquidnet.service.candy.mapper.CandyCouponRuleMapper; import com.liquidnet.service.candy.mapper.CandyCouponRuleMapper;
import com.liquidnet.service.candy.mapper.CandyUserCouponMapper; 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.ObjectUtil;
import com.liquidnet.service.platform.utils.QueueUtils; import com.liquidnet.service.platform.utils.QueueUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.MultiValueMap;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList; import java.util.LinkedList;
...@@ -32,7 +40,6 @@ import java.util.List; ...@@ -32,7 +40,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponMapper, CandyUserCoupon> { public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponMapper, CandyUserCoupon> {
...@@ -48,6 +55,8 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM ...@@ -48,6 +55,8 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM
@Autowired @Autowired
private RedisDataSourceUtil redisDataSourceUtil; private RedisDataSourceUtil redisDataSourceUtil;
@Value("${liquidnet.service.candy.url}")
private String candyUrl;
/** /**
* @param uCouponUidList 内容 uCouponId,uid List * @param uCouponUidList 内容 uCouponId,uid List
* @param uCouponIdList 内容 uCouponId List * @param uCouponIdList 内容 uCouponId List
...@@ -205,4 +214,45 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM ...@@ -205,4 +214,45 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM
} }
return pl.get(); 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);
}
}
} }
...@@ -19,7 +19,6 @@ import org.springframework.stereotype.Service; ...@@ -19,7 +19,6 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
...@@ -39,6 +38,7 @@ public class StoneServerImpl { ...@@ -39,6 +38,7 @@ public class StoneServerImpl {
@Autowired @Autowired
TempScoreMapper tempScoreMapper; TempScoreMapper tempScoreMapper;
public boolean refreshScore(String time) { public boolean refreshScore(String time) {
//获取需要跑积分的用户 //获取需要跑积分的用户
LocalDate et = LocalDate.parse(time); LocalDate et = LocalDate.parse(time);
......
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