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

Commit 3fa77856 authored by 张禹's avatar 张禹

Merge branch 'pre' into 'master'

Pre

See merge request !289
parents 7d39ddce 9d6f36d7
...@@ -338,6 +338,11 @@ public class GoblinRedisConst { ...@@ -338,6 +338,11 @@ public class GoblinRedisConst {
public static final String GOBLIN_MIX_LIMIT = PREFIX.concat("mix:limit:");//$key:$mixId:$uid 混合售开始列表 public static final String GOBLIN_MIX_LIMIT = PREFIX.concat("mix:limit:");//$key:$mixId:$uid 混合售开始列表
public static final String GOBLIN_MIX_RESERVE_UID = PREFIX.concat("mix:reserve:uid:");//$mixId:$uid 混合售用户预约保存
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
public static final String GOBLIN_ORDER_LOG = PREFIX.concat("order:log:");//无用 public static final String GOBLIN_ORDER_LOG = PREFIX.concat("order:log:");//无用
......
package com.liquidnet.service.goblin.dto.vo; package com.liquidnet.service.goblin.dto.vo;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.goblin.param.GoblinMixDetailsParam;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
...@@ -27,7 +26,7 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable { ...@@ -27,7 +26,7 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
private String intro; private String intro;
@ApiModelProperty(position = 10, value = "封面图片地址") @ApiModelProperty(position = 10, value = "封面图片地址")
private String coverPic; private String coverPic;
@ApiModelProperty(position = 11, value = "商品视频地址/数字昌平视频地址") @ApiModelProperty(position = 11, value = "展示类型为1[详情图片地址]展示类型为2[商品视频地址/数字藏品视频地址]")
private String video; private String video;
@ApiModelProperty(position = 12, value = "商品详情/藏品详情") @ApiModelProperty(position = 12, value = "商品详情/藏品详情")
private String details; private String details;
...@@ -51,6 +50,14 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable { ...@@ -51,6 +50,14 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
private BigDecimal sellPrice; private BigDecimal sellPrice;
@ApiModelProperty(position = 23, value = "原价") @ApiModelProperty(position = 23, value = "原价")
private BigDecimal price; private BigDecimal price;
@ApiModelProperty(position = 22, value = "上架时间")
private String shelvesTime;
@ApiModelProperty(position = 23, value = "预约开启标识[0:未开启,1:开启]")
private int reserve;
@ApiModelProperty(value = "系统时间")
private String sysTime;
@ApiModelProperty(value = "用户预约标识[0:未预约,1:预约]")
private int userReserve;
private static final GoblinMixAppDetailsVo obj = new GoblinMixAppDetailsVo(); private static final GoblinMixAppDetailsVo obj = new GoblinMixAppDetailsVo();
...@@ -82,6 +89,9 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable { ...@@ -82,6 +89,9 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
this.setStoreName(storeName); this.setStoreName(storeName);
this.setPrice(source.getPrice()); this.setPrice(source.getPrice());
this.setSellPrice(source.getSellPrice()); this.setSellPrice(source.getSellPrice());
this.setShelvesTime(source.getShelvesTime() != null && !"".equals(source.getShelvesTime()) ? source.getShelvesTime() : source.getTimeStart());
this.setReserve(source.getReserve());
this.setSysTime(DateUtil.getNowTime());
return this; return this;
} }
} }
...@@ -33,6 +33,12 @@ public class GoblinMixAppListVo implements Serializable, Cloneable { ...@@ -33,6 +33,12 @@ public class GoblinMixAppListVo implements Serializable, Cloneable {
private BigDecimal price; private BigDecimal price;
@ApiModelProperty(position = 9, value = "活动创建时间") @ApiModelProperty(position = 9, value = "活动创建时间")
private String createdAt; private String createdAt;
@ApiModelProperty(position = 10,value = "当前时间")
private String nowTime;
@ApiModelProperty(position = 22, value = "上架时间")
private String shelvesTime;
@ApiModelProperty(position = 23, value = "预约开启标识[0:未开启,1开启]")
private int reserve;
private static final GoblinMixAppListVo obj = new GoblinMixAppListVo(); private static final GoblinMixAppListVo obj = new GoblinMixAppListVo();
...@@ -44,7 +50,7 @@ public class GoblinMixAppListVo implements Serializable, Cloneable { ...@@ -44,7 +50,7 @@ public class GoblinMixAppListVo implements Serializable, Cloneable {
} }
} }
public GoblinMixAppListVo copy(GoblinMixDetailsVo source) { public GoblinMixAppListVo copy(GoblinMixDetailsVo source,String nowTime) {
if (null == source) return this; if (null == source) return this;
this.setMixId(source.getMixId()); this.setMixId(source.getMixId());
this.setName(source.getName()); this.setName(source.getName());
...@@ -55,6 +61,9 @@ public class GoblinMixAppListVo implements Serializable, Cloneable { ...@@ -55,6 +61,9 @@ public class GoblinMixAppListVo implements Serializable, Cloneable {
this.setSellPrice(source.getSellPrice()); this.setSellPrice(source.getSellPrice());
this.setPrice(source.getPrice()); this.setPrice(source.getPrice());
this.setCreatedAt(source.getCreatedAt()); this.setCreatedAt(source.getCreatedAt());
this.setShelvesTime(source.getShelvesTime());
this.setNowTime(nowTime);
this.setReserve(source.getReserve());
return this; return this;
} }
} }
...@@ -34,7 +34,7 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable { ...@@ -34,7 +34,7 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
private String intro; private String intro;
@ApiModelProperty(position = 10, value = "封面图片地址") @ApiModelProperty(position = 10, value = "封面图片地址")
private String coverPic; private String coverPic;
@ApiModelProperty(position = 11, value = "商品视频地址/数字昌平视频地址") @ApiModelProperty(position = 11, value = "展示类型为1[详情图片地址]展示类型为2[商品视频地址/数字藏品视频地址]")
private String video; private String video;
@ApiModelProperty(position = 12, value = "商品详情/藏品详情") @ApiModelProperty(position = 12, value = "商品详情/藏品详情")
private String details; private String details;
...@@ -70,6 +70,10 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable { ...@@ -70,6 +70,10 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
private String xlsName; private String xlsName;
@ApiModelProperty(position = 26, value = "店铺id") @ApiModelProperty(position = 26, value = "店铺id")
private String storeId; private String storeId;
@ApiModelProperty(position = 22, value = "上架时间")
private String shelvesTime;
@ApiModelProperty(value = "预约开启标识")
private int reserve;
private static final GoblinMixDetailsVo obj = new GoblinMixDetailsVo(); private static final GoblinMixDetailsVo obj = new GoblinMixDetailsVo();
...@@ -111,6 +115,16 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable { ...@@ -111,6 +115,16 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
this.setPayType(source.getPayType()); this.setPayType(source.getPayType());
this.setXlsName(source.getXlsName()); this.setXlsName(source.getXlsName());
this.setStoreId(source.getStoreId()); this.setStoreId(source.getStoreId());
this.setShelvesTime(source.getShelvesTime());
this.setReserve(source.getReserve());
return this; return this;
} }
//上架时间不为空则返回上架时间否则返回开始时间
public CharSequence getTimeStartOrShelvesTime(GoblinMixDetailsVo item) {
if (item.getShelvesTime()!=null){
return item.getShelvesTime();
}
return item.getTimeStart();
}
} }
package com.liquidnet.service.goblin.dto.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.liquidnet.commons.lang.util.DateUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 商城订单表
* </p>
*
* @author liquidnet
* @since 2021-12-27
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinMixReserveVo implements Serializable, Cloneable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = " mix预约表生成id")
private String mid;
@ApiModelProperty(value = " mixId")
private String mixId;
@ApiModelProperty(value = " uid")
private String uid;
@ApiModelProperty(value = " 预约人手机号")
private String phone;
@ApiModelProperty(value = " 预约时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime createdDate;
private static final GoblinMixReserveVo obj = new GoblinMixReserveVo();
public static GoblinMixReserveVo getNew() {
try {
return (GoblinMixReserveVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinMixReserveVo();
}
}
}
...@@ -25,7 +25,7 @@ public class GoblinMixDetailsParam implements Serializable, Cloneable { ...@@ -25,7 +25,7 @@ public class GoblinMixDetailsParam implements Serializable, Cloneable {
private String intro; private String intro;
@ApiModelProperty(position = 10, value = "封面图片地址") @ApiModelProperty(position = 10, value = "封面图片地址")
private String coverPic; private String coverPic;
@ApiModelProperty(position = 11, value = "商品视频地址/数字昌平视频地址") @ApiModelProperty(position = 11, value = "展示类型为1[详情图片地址]展示类型为2[商品视频地址/数字藏品视频地址]")
private String video; private String video;
@ApiModelProperty(position = 12, value = "商品详情/藏品详情") @ApiModelProperty(position = 12, value = "商品详情/藏品详情")
private String details; private String details;
...@@ -53,7 +53,10 @@ public class GoblinMixDetailsParam implements Serializable, Cloneable { ...@@ -53,7 +53,10 @@ public class GoblinMixDetailsParam implements Serializable, Cloneable {
private String xlsName; private String xlsName;
@ApiModelProperty(position = 21, value = "店铺id") @ApiModelProperty(position = 21, value = "店铺id")
private String storeId; private String storeId;
@ApiModelProperty(position = 22, value = "上架时间")
private String shelvesTime;
@ApiModelProperty(position = 23, value = "预约开启标识[0:未开启,1开启]")
private int reserve;
private static final GoblinMixDetailsParam obj = new GoblinMixDetailsParam(); private static final GoblinMixDetailsParam obj = new GoblinMixDetailsParam();
......
...@@ -22,6 +22,10 @@ public class GoblinMixUpdateParam implements Serializable, Cloneable { ...@@ -22,6 +22,10 @@ public class GoblinMixUpdateParam implements Serializable, Cloneable {
private String whiteUrl; private String whiteUrl;
@ApiModelProperty(position = 20, value = "xls名称") @ApiModelProperty(position = 20, value = "xls名称")
private String xlsName; private String xlsName;
@ApiModelProperty(position = 22, value = "上架时间")
private String shelvesTime;
@ApiModelProperty(position = 23, value = "预约开启标识[0:未开启,1开启]")
private int reserve;
private static final GoblinMixUpdateParam obj = new GoblinMixUpdateParam(); private static final GoblinMixUpdateParam obj = new GoblinMixUpdateParam();
......
...@@ -57,4 +57,18 @@ public interface IGoblinGoodsAnticipateService { ...@@ -57,4 +57,18 @@ public interface IGoblinGoodsAnticipateService {
ResponseDto<String> getTurnOnHelp(String skuId); ResponseDto<String> getTurnOnHelp(String skuId);
ResponseDto<Boolean> helpSid(String sid); ResponseDto<Boolean> helpSid(String sid);
/**
* 组合购用户预约
* @param mixId 组合购id
* @return Boolean
*/
ResponseDto<Boolean> reserveByMix(String mixId);
/**
* 根据mixId查询用户是否预约该混合购
* @param mixId 组合购id
* @return Boolean
*/
ResponseDto<Boolean> reserveMixByUid(String mixId);
} }
...@@ -55,4 +55,6 @@ public interface IGoblinGoodsAnticipateMgService { ...@@ -55,4 +55,6 @@ public interface IGoblinGoodsAnticipateMgService {
* @return 预约关联sku和spu表 * @return 预约关联sku和spu表
*/ */
AnticipateValueVo getAnticipateValueBySkuId(String skuId,int hasHead); AnticipateValueVo getAnticipateValueBySkuId(String skuId,int hasHead);
} }
...@@ -94,12 +94,16 @@ public class KylinRedisConst { ...@@ -94,12 +94,16 @@ public class KylinRedisConst {
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 订单填写快递地址
public static final String ACTIVE_TICKET_AR_TICKET = "kylin:active:ar:ticket:";//互动券 public static final String ACTIVE_TICKET_AR_TICKET = "kylin:active:ar:ticket:";//互动券
public static final String ACTIVE_TICKET_AR_USER = "kylin:active:ar:user:";//互动券 绑定的用户 public static final String ACTIVE_TICKET_AR_USER = "kylin:active:ar:user:";//互动券 绑定的用户
/** /**
* 巡演券 * 巡演券
* eg:{kylin:c_rs:${couponId}, List<巡演ID>} * eg:{kylin:c_rs:${couponId}, List<巡演ID>}
*/ */
public static final String COUPON_ROADSHOWS = "kylin:c_rs:"; public static final String COUPON_ROADSHOWS = "kylin:c_rs:";
public static final String COUPON_COUNT = "kylin:coupon:count:";//$key + $uid:$performance_id
public static final String MEMBER_COUNT = "kylin:member:count:";//$key + $uid:$performance_id
} }
...@@ -76,6 +76,9 @@ public class PerformancePartnerVo implements Serializable, Cloneable { ...@@ -76,6 +76,9 @@ public class PerformancePartnerVo implements Serializable, Cloneable {
@ApiModelProperty(value = "限购数量 0为不限购", example = "0") @ApiModelProperty(value = "限购数量 0为不限购", example = "0")
private Integer limitCount; private Integer limitCount;
@ApiModelProperty(value = "实名数量 0为不限购", example = "0")
private Integer idCount;
@ApiModelProperty(value = "是否提交 1提交 0不提交(不验证参数)", example = "0") @ApiModelProperty(value = "是否提交 1提交 0不提交(不验证参数)", example = "0")
private Integer isSubmit; private Integer isSubmit;
...@@ -121,6 +124,10 @@ public class PerformancePartnerVo implements Serializable, Cloneable { ...@@ -121,6 +124,10 @@ public class PerformancePartnerVo implements Serializable, Cloneable {
@ApiModelProperty(value = "是否保存", example = "") @ApiModelProperty(value = "是否保存", example = "")
private Integer isCreateSave; private Integer isCreateSave;
public Integer getIdCount() {
return idCount==null?limitCount:idCount;
}
private static final PerformancePartnerVo obj = new PerformancePartnerVo(); private static final PerformancePartnerVo obj = new PerformancePartnerVo();
public static PerformancePartnerVo getNew() { public static PerformancePartnerVo getNew() {
...@@ -151,6 +158,7 @@ public class PerformancePartnerVo implements Serializable, Cloneable { ...@@ -151,6 +158,7 @@ public class PerformancePartnerVo implements Serializable, Cloneable {
this.setNoticeImage(performances.getNoticeImage()); this.setNoticeImage(performances.getNoticeImage());
this.setIsTrueName(performanceStatus.getIsTrueName()); this.setIsTrueName(performanceStatus.getIsTrueName());
this.setLimitCount(performanceStatus.getLimitCount()); this.setLimitCount(performanceStatus.getLimitCount());
this.setIdCount(performanceStatus.getIdCount());
this.setStatus(performanceStatus.getStatus()); this.setStatus(performanceStatus.getStatus());
this.setMerchantId(kylinPerformanceRelations.getMerchantId()); this.setMerchantId(kylinPerformanceRelations.getMerchantId());
this.setDescribes(performances.getDescribes()); this.setDescribes(performances.getDescribes());
......
...@@ -23,6 +23,10 @@ public class PerformanceStep2Param implements Serializable,Cloneable { ...@@ -23,6 +23,10 @@ public class PerformanceStep2Param implements Serializable,Cloneable {
@NotNull(message = "不能为空") @NotNull(message = "不能为空")
private Integer limitCount; private Integer limitCount;
@ApiModelProperty(value = "实名限购 0为不限购", example = "0")
@NotNull(message = "不能为空")
private Integer idCount;
@ApiModelProperty(value = "是否提交 1提交 0不提交(不验证参数)", example = "0") @ApiModelProperty(value = "是否提交 1提交 0不提交(不验证参数)", example = "0")
@NotNull(message = "不能为空") @NotNull(message = "不能为空")
private Integer isSubmit; private Integer isSubmit;
......
...@@ -75,6 +75,10 @@ public class TicketCreateParam implements Serializable { ...@@ -75,6 +75,10 @@ public class TicketCreateParam implements Serializable {
@NotNull(message = "限购数量不能为空") @NotNull(message = "限购数量不能为空")
private Integer limitCount; private Integer limitCount;
@ApiModelProperty(value = "实名数量", example = "0")
@NotNull(message = "限购数量不能为空")
private Integer idCount;
@ApiModelProperty(value = "票种开售时间", example = "2020-12-01T12:00:00") @ApiModelProperty(value = "票种开售时间", example = "2020-12-01T12:00:00")
@NotNull(message = "票种开售时间不能为空") @NotNull(message = "票种开售时间不能为空")
private LocalDateTime timeStart; private LocalDateTime timeStart;
......
...@@ -7,12 +7,13 @@ import io.swagger.annotations.ApiModel; ...@@ -7,12 +7,13 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
@Data @Data
@ApiModel @ApiModel
public class KylinTicketTimesVo { public class KylinTicketTimesVo implements Serializable,Cloneable{
private Integer mid; private Integer mid;
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
...@@ -32,6 +33,15 @@ public class KylinTicketTimesVo { ...@@ -32,6 +33,15 @@ public class KylinTicketTimesVo {
@ApiModelProperty(value = "票种") @ApiModelProperty(value = "票种")
private List<KylinTicketVo> ticketList; private List<KylinTicketVo> ticketList;
private static final KylinTicketTimesVo obj = new KylinTicketTimesVo();
public static KylinTicketTimesVo getNew() {
try {
return (KylinTicketTimesVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinTicketTimesVo();
}
}
public void setTicketTimes(KylinTicketTimes ticketTimes) { public void setTicketTimes(KylinTicketTimes ticketTimes) {
this.mid = ticketTimes.getMid(); this.mid = ticketTimes.getMid();
this.ticketTimesId = ticketTimes.getTicketTimesId(); this.ticketTimesId = ticketTimes.getTicketTimesId();
......
...@@ -18,7 +18,7 @@ import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS; ...@@ -18,7 +18,7 @@ import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
@Data @Data
@ApiModel @ApiModel
public class KylinTicketVo implements Serializable,Cloneable{ public class KylinTicketVo implements Serializable, Cloneable {
private Integer mid; private Integer mid;
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
...@@ -79,6 +79,8 @@ public class KylinTicketVo implements Serializable,Cloneable{ ...@@ -79,6 +79,8 @@ public class KylinTicketVo implements Serializable,Cloneable{
private Integer isTrueName; private Integer isTrueName;
@ApiModelProperty(value = "限购张数") @ApiModelProperty(value = "限购张数")
private Integer limitCount; private Integer limitCount;
@ApiModelProperty(value = "实名限购张数")
private Integer idCount;
@ApiModelProperty(value = "会员限购张数") @ApiModelProperty(value = "会员限购张数")
private Integer limitCountMember; private Integer limitCountMember;
@ApiModelProperty(value = "是否会员专属 0 1") @ApiModelProperty(value = "是否会员专属 0 1")
...@@ -100,6 +102,10 @@ public class KylinTicketVo implements Serializable,Cloneable{ ...@@ -100,6 +102,10 @@ public class KylinTicketVo implements Serializable,Cloneable{
@ApiModelProperty(value = "总兑换库存") @ApiModelProperty(value = "总兑换库存")
private Integer totalExchange; private Integer totalExchange;
public Integer getIdCount() {
return idCount == null ? limitCount : idCount;
}
public void setTicket(KylinTickets ticket) { public void setTicket(KylinTickets ticket) {
this.mid = ticket.getMid(); this.mid = ticket.getMid();
this.ticketsId = ticket.getTicketsId(); this.ticketsId = ticket.getTicketsId();
...@@ -140,6 +146,7 @@ public class KylinTicketVo implements Serializable,Cloneable{ ...@@ -140,6 +146,7 @@ public class KylinTicketVo implements Serializable,Cloneable{
this.isStudent = ticketStatus.getIsStudent(); this.isStudent = ticketStatus.getIsStudent();
this.limitCountMember = ticketStatus.getMemberLimitCount(); this.limitCountMember = ticketStatus.getMemberLimitCount();
this.limitCount = ticketStatus.getLimitCount(); this.limitCount = ticketStatus.getLimitCount();
this.idCount = ticketStatus.getIdCount();
this.counts = ticketStatus.getCounts(); this.counts = ticketStatus.getCounts();
this.sysDamai = ticketStatus.getSyncDamai(); this.sysDamai = ticketStatus.getSyncDamai();
this.isShowCode = ticketStatus.getIsShowCode(); this.isShowCode = ticketStatus.getIsShowCode();
...@@ -162,7 +169,7 @@ public class KylinTicketVo implements Serializable,Cloneable{ ...@@ -162,7 +169,7 @@ public class KylinTicketVo implements Serializable,Cloneable{
this.timeStart = ticket.getTimeStart(); this.timeStart = ticket.getTimeStart();
this.timeEnd = ticket.getTimeEnd(); this.timeEnd = ticket.getTimeEnd();
this.advanceMinuteMember = 5; this.advanceMinuteMember = 5;
this.memberTimeStart = DateUtil.Formatter.yyyyMMddHHmmss.format(LocalDateTime.parse(ticket.getTimeStart(),DTF_YMD_HMS).plusMinutes(-5)); this.memberTimeStart = DateUtil.Formatter.yyyyMMddHHmmss.format(LocalDateTime.parse(ticket.getTimeStart(), DTF_YMD_HMS).plusMinutes(-5));
if (ticket.getTimeEndExpress() != null) { if (ticket.getTimeEndExpress() != null) {
this.timeEndExpress = ticket.getTimeEndExpress(); this.timeEndExpress = ticket.getTimeEndExpress();
} else { } else {
...@@ -187,6 +194,7 @@ public class KylinTicketVo implements Serializable,Cloneable{ ...@@ -187,6 +194,7 @@ public class KylinTicketVo implements Serializable,Cloneable{
this.isStudent = ticketStatus.getIsStudent(); this.isStudent = ticketStatus.getIsStudent();
this.limitCountMember = 1; this.limitCountMember = 1;
this.limitCount = ticketStatus.getLimitCount(); this.limitCount = ticketStatus.getLimitCount();
this.idCount = ticketStatus.getIdCount();
this.counts = ticketStatus.getCounts(); this.counts = ticketStatus.getCounts();
this.sysDamai = 0; this.sysDamai = 0;
this.isShowCode = ticketStatus.getIsShowCode(); this.isShowCode = ticketStatus.getIsShowCode();
...@@ -196,6 +204,7 @@ public class KylinTicketVo implements Serializable,Cloneable{ ...@@ -196,6 +204,7 @@ public class KylinTicketVo implements Serializable,Cloneable{
} }
private static final KylinTicketVo obj = new KylinTicketVo(); private static final KylinTicketVo obj = new KylinTicketVo();
public static KylinTicketVo getNew() { public static KylinTicketVo getNew() {
try { try {
return (KylinTicketVo) obj.clone(); return (KylinTicketVo) obj.clone();
......
...@@ -85,6 +85,8 @@ public class KylinPerformanceVo implements Serializable, Cloneable{ ...@@ -85,6 +85,8 @@ public class KylinPerformanceVo implements Serializable, Cloneable{
private Integer isTrueName; private Integer isTrueName;
@ApiModelProperty(value = "限购张数") @ApiModelProperty(value = "限购张数")
private Integer limitCount; private Integer limitCount;
@ApiModelProperty(value = "实名数量 0为不限购")
private Integer idCount;
@ApiModelProperty(value = "会员限购张数") @ApiModelProperty(value = "会员限购张数")
private Integer limitCountMember; private Integer limitCountMember;
@ApiModelProperty(value = "是否专属") @ApiModelProperty(value = "是否专属")
...@@ -130,6 +132,10 @@ public class KylinPerformanceVo implements Serializable, Cloneable{ ...@@ -130,6 +132,10 @@ public class KylinPerformanceVo implements Serializable, Cloneable{
@ApiModelProperty(value = "场地审核状态 [0-审核完成|1-待审核|2-已拒绝]", hidden = true) @ApiModelProperty(value = "场地审核状态 [0-审核完成|1-待审核|2-已拒绝]", hidden = true)
private Integer fieldAuditStatus; private Integer fieldAuditStatus;
public Integer getIdCount() {
return idCount==null?limitCount:idCount;
}
private static final KylinPerformanceVo obj = new KylinPerformanceVo(); private static final KylinPerformanceVo obj = new KylinPerformanceVo();
public static KylinPerformanceVo getNew() { public static KylinPerformanceVo getNew() {
...@@ -209,6 +215,7 @@ public class KylinPerformanceVo implements Serializable, Cloneable{ ...@@ -209,6 +215,7 @@ public class KylinPerformanceVo implements Serializable, Cloneable{
this.isRecommend = performanceStatus.getIsRecommend(); this.isRecommend = performanceStatus.getIsRecommend();
this.isTrueName = performanceStatus.getIsTrueName(); this.isTrueName = performanceStatus.getIsTrueName();
this.limitCount = performanceStatus.getLimitCount(); this.limitCount = performanceStatus.getLimitCount();
this.idCount = performanceStatus.getIdCount();
this.limitCountMember = performanceStatus.getLimitCountMember(); this.limitCountMember = performanceStatus.getLimitCountMember();
this.sysDamai = performanceStatus.getSyncDamai(); this.sysDamai = performanceStatus.getSyncDamai();
this.isShow = performanceStatus.getIsShow(); this.isShow = performanceStatus.getIsShow();
...@@ -233,6 +240,7 @@ public class KylinPerformanceVo implements Serializable, Cloneable{ ...@@ -233,6 +240,7 @@ public class KylinPerformanceVo implements Serializable, Cloneable{
this.isRecommend = 0; this.isRecommend = 0;
this.isTrueName = performanceStatus.getIsTrueName(); this.isTrueName = performanceStatus.getIsTrueName();
this.limitCount = performanceStatus.getLimitCount(); this.limitCount = performanceStatus.getLimitCount();
this.idCount = performanceStatus.getIdCount();
this.limitCountMember = 1; this.limitCountMember = 1;
this.sysDamai = 0; this.sysDamai = 0;
this.isShow = performanceStatus.getIsShow(); this.isShow = performanceStatus.getIsShow();
......
...@@ -88,6 +88,9 @@ public class KylinPerformanceMisVo implements Cloneable{ ...@@ -88,6 +88,9 @@ public class KylinPerformanceMisVo implements Cloneable{
@ApiModelProperty(value = "限购数量") @ApiModelProperty(value = "限购数量")
private Integer limitCount; private Integer limitCount;
@ApiModelProperty(value = "实名限购数量")
private Integer idCount;
@ApiModelProperty(value = "限购数量") @ApiModelProperty(value = "限购数量")
private String createdAt; private String createdAt;
......
...@@ -48,6 +48,9 @@ public class KylinTicketPartnerVo implements Serializable,Cloneable { ...@@ -48,6 +48,9 @@ public class KylinTicketPartnerVo implements Serializable,Cloneable {
@ApiModelProperty(value = "限购数量", example = "0") @ApiModelProperty(value = "限购数量", example = "0")
private Integer limitCount; private Integer limitCount;
@ApiModelProperty(value = "限购数量", example = "0")
private Integer idCount;
@ApiModelProperty(value = "次数", example = "0") @ApiModelProperty(value = "次数", example = "0")
private Integer counts; private Integer counts;
...@@ -122,6 +125,10 @@ public class KylinTicketPartnerVo implements Serializable,Cloneable { ...@@ -122,6 +125,10 @@ public class KylinTicketPartnerVo implements Serializable,Cloneable {
this.setSurplusGeneral(this.getTotalGeneral()); this.setSurplusGeneral(this.getTotalGeneral());
} }
public Integer getIdCount() {
return idCount==null?limitCount:idCount;
}
private static final KylinTicketPartnerVo obj = new KylinTicketPartnerVo(); private static final KylinTicketPartnerVo obj = new KylinTicketPartnerVo();
public static KylinTicketPartnerVo getNew() { public static KylinTicketPartnerVo getNew() {
try { try {
...@@ -143,6 +150,7 @@ public class KylinTicketPartnerVo implements Serializable,Cloneable { ...@@ -143,6 +150,7 @@ public class KylinTicketPartnerVo implements Serializable,Cloneable {
this.totalGeneral = ts.getTotalGeneral(); this.totalGeneral = ts.getTotalGeneral();
this.totalExchange = ts.getTotalExchange(); this.totalExchange = ts.getTotalExchange();
this.limitCount = ts.getLimitCount(); this.limitCount = ts.getLimitCount();
this.idCount = ts.getIdCount();
this.counts = ts.getCounts(); this.counts = ts.getCounts();
this.timeStart = DateUtil.Formatter.yyyyMMddHHmmss.format(t.getTimeStart()); this.timeStart = DateUtil.Formatter.yyyyMMddHHmmss.format(t.getTimeStart());
this.timeEnd = DateUtil.Formatter.yyyyMMddHHmmss.format(t.getTimeEnd()); this.timeEnd = DateUtil.Formatter.yyyyMMddHHmmss.format(t.getTimeEnd());
......
...@@ -264,7 +264,7 @@ public class KylinOrderRefundAdminController extends BaseController { ...@@ -264,7 +264,7 @@ public class KylinOrderRefundAdminController extends BaseController {
@ResponseBody @ResponseBody
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "code", value = "订单号", example = ""), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "code", value = "订单号", example = ""),
@ApiImplicitParam(type = "form", required = true, dataType = "int", name = "type", value = "1退款单号 2订单号", example = ""), @ApiImplicitParam(type = "form", required = true, dataType = "int", name = "type", value = "1退款单号 2订单号 3大麦单号", example = ""),
}) })
public AjaxResult loginSmsSwitch(@NotNull(message = "订单号不能为空") @RequestParam String code, public AjaxResult loginSmsSwitch(@NotNull(message = "订单号不能为空") @RequestParam String code,
@NotNull(message = "类型不能为空") @RequestParam int type) { @NotNull(message = "类型不能为空") @RequestParam int type) {
......
...@@ -30,7 +30,7 @@ public class OrderSwitchAdminController { ...@@ -30,7 +30,7 @@ public class OrderSwitchAdminController {
@ApiOperation(value = "根据截取订单号获取全量订单号") @ApiOperation(value = "根据截取订单号获取全量订单号")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "code", value = "订单号", example = ""), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "code", value = "订单号", example = ""),
@ApiImplicitParam(type = "form", required = true, dataType = "int", name = "type", value = "1退款单号 2订单号", example = ""), @ApiImplicitParam(type = "form", required = true, dataType = "int", name = "type", value = "1退款单号 2订单号 3大麦单号", example = ""),
}) })
@PostMapping("search/code") @PostMapping("search/code")
public ResponseDto<Object> loginSmsSwitch(@NotNull(message = "订单号不能为空") @RequestParam String code, public ResponseDto<Object> loginSmsSwitch(@NotNull(message = "订单号不能为空") @RequestParam String code,
......
...@@ -15,6 +15,15 @@ public class OrderExportVo implements Serializable, Cloneable{ ...@@ -15,6 +15,15 @@ public class OrderExportVo implements Serializable, Cloneable{
@Excel(name = "姓名", cellType = Excel.ColumnType.STRING) @Excel(name = "姓名", cellType = Excel.ColumnType.STRING)
private String userName; private String userName;
@Excel(name = "票种名称", cellType = Excel.ColumnType.STRING)
private String title;
@Excel(name = "票种适用时间", cellType = Excel.ColumnType.STRING)
private String useTime;
@Excel(name = "票种适用开始时间", cellType = Excel.ColumnType.STRING)
private String useStart;
@Excel(name = "票种适用结束时间", cellType = Excel.ColumnType.STRING)
private String useEnd;
private static final OrderExportVo obj = new OrderExportVo(); private static final OrderExportVo obj = new OrderExportVo();
public static OrderExportVo getNew() { public static OrderExportVo getNew() {
...@@ -30,6 +39,10 @@ public class OrderExportVo implements Serializable, Cloneable{ ...@@ -30,6 +39,10 @@ public class OrderExportVo implements Serializable, Cloneable{
this.setPerformanceTitle(source.getPerformanceTitle()); this.setPerformanceTitle(source.getPerformanceTitle());
this.setUserMobile(source.getUserMobile()); this.setUserMobile(source.getUserMobile());
this.setUserName(source.getUserName()); this.setUserName(source.getUserName());
this.setTitle(source.getTitle());
this.setUseTime(source.getUseTime());
this.setUseStart(source.getUseStart());
this.setUseEnd(source.getUseEnd());
return this; return this;
} }
} }
...@@ -142,8 +142,10 @@ public class ImportServiceImpl implements IImportService { ...@@ -142,8 +142,10 @@ public class ImportServiceImpl implements IImportService {
// 获取限购 实名 // 获取限购 实名
int ticketLimit = ticketData.getLimitCount();//普通票种限购 int ticketLimit = ticketData.getLimitCount();//普通票种限购
int ticketMemberLimit = ticketData.getLimitCountMember();//会员票种限购 int ticketMemberLimit = ticketData.getLimitCountMember();//会员票种限购
int ticketIdCount = ticketData.getIdCount();//实名票种限购
int performanceLimit = performanceData.getLimitCount();//普通演出限购 int performanceLimit = performanceData.getLimitCount();//普通演出限购
int performanceMemberLimit = performanceData.getLimitCountMember();//会员演出限购 int performanceMemberLimit = 1;//会员演出限购
int performanceIdCount = performanceData.getIdCount();//实名演出限购
int isTrueName = ticketData.getIsTrueName();//是否演出实名 int isTrueName = ticketData.getIsTrueName();//是否演出实名
Integer isStudent = ticketData.getIsStudent(); Integer isStudent = ticketData.getIsStudent();
String ticketType = ""; String ticketType = "";
...@@ -184,7 +186,7 @@ public class ImportServiceImpl implements IImportService { ...@@ -184,7 +186,7 @@ public class ImportServiceImpl implements IImportService {
//限购判断 如果实名 则身份证维度限购 如果不实名则数量限购 //限购判断 如果实名 则身份证维度限购 如果不实名则数量限购
if (isTrueName == 1) { if (isTrueName == 1) {
String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, enterIdCode, performancesId, ticketData.getTicketsId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, 1, 1, 0, isTrueName); String res1 = orderUtils.judgeOrderLimit(uid, enterIdCode, performancesId, ticketData.getTicketsId(), performanceLimit, performanceMemberLimit, performanceIdCount, ticketLimit, ticketMemberLimit, ticketIdCount, 0, isTrueName);
if (!res1.equals("")) { if (!res1.equals("")) {
orderOutLineVo.setReason(res1); orderOutLineVo.setReason(res1);
vos.add(orderOutLineVo); vos.add(orderOutLineVo);
...@@ -192,7 +194,7 @@ public class ImportServiceImpl implements IImportService { ...@@ -192,7 +194,7 @@ public class ImportServiceImpl implements IImportService {
continue; continue;
} }
} else { } else {
String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, "", performancesId, ticketData.getTicketsId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, number, number, 0, isTrueName); String res1 = orderUtils.judgeOrderLimit(uid, "", performancesId, ticketData.getTicketsId(), performanceLimit, performanceMemberLimit, performanceIdCount, ticketLimit, ticketMemberLimit, ticketIdCount, 0, isTrueName);
if (!res1.equals("")) { if (!res1.equals("")) {
orderOutLineVo.setReason(res1); orderOutLineVo.setReason(res1);
vos.add(orderOutLineVo); vos.add(orderOutLineVo);
......
...@@ -338,7 +338,7 @@ public class KylinDamaiServiceImpl extends ServiceImpl<KylinRoadShowsMapper, Kyl ...@@ -338,7 +338,7 @@ public class KylinDamaiServiceImpl extends ServiceImpl<KylinRoadShowsMapper, Kyl
} }
public static void main(String[] args) { public static void main(String[] args) {
Long a=IDGenerator.getDamaiCode("625614651458519045936293"); Long a=IDGenerator.getDamaiCode("1360935572095672321307852");
System.out.println(a); System.out.println(a);
} }
......
...@@ -13,6 +13,7 @@ import com.liquidnet.client.admin.common.utils.DateUtils; ...@@ -13,6 +13,7 @@ import com.liquidnet.client.admin.common.utils.DateUtils;
import com.liquidnet.client.admin.common.utils.ShiroUtils; import com.liquidnet.client.admin.common.utils.ShiroUtils;
import com.liquidnet.commons.lang.util.BeanUtil; import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ErrorMapping; import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst; import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
...@@ -33,6 +34,7 @@ import com.liquidnet.service.kylin.service.IKylinOrderRefundsService; ...@@ -33,6 +34,7 @@ import com.liquidnet.service.kylin.service.IKylinOrderRefundsService;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
import com.mongodb.client.result.UpdateResult; import com.mongodb.client.result.UpdateResult;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
...@@ -558,6 +560,14 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -558,6 +560,14 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
} else { } else {
orderCode = data.getOrderCode(); orderCode = data.getOrderCode();
} }
} else if (type == 3) {
KylinOrderTickets data = kylinOrderTicketsMapper.selectOne(new UpdateWrapper<KylinOrderTickets>().like("order_code", code));
if (data == null) {
return null;
} else {
String orderId = data.getOrderTicketsId();
orderCode = StringUtils.left(orderId, 5).concat(StringUtils.right(orderId, 8));
}
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -271,43 +271,36 @@ public class DataUtils { ...@@ -271,43 +271,36 @@ public class DataUtils {
* @param buyCount 购买数量 大于 0 增加 小于 0 减少 对应 支付 退款表 * @param buyCount 购买数量 大于 0 增加 小于 0 减少 对应 支付 退款表
*/ */
public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) { public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) {
String redisKey; String redisKeyUid;
String redisKeyIdCard;
String performanceIdKeyIdCard="";
String ticketIdKeyIdCard="";
int isTrueName = getPerformanceIsTrueName(performanceId); int isTrueName = getPerformanceIsTrueName(performanceId);
// String useTime = "";
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>();
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
// KylinTicketTimesVo timeItem = vo.getTicketTimeList().get(x);
// ArrayList<String> ticketList = new ArrayList<>();
// for (int y = 0; y < timeItem.getTicketList().size(); y++) {
// KylinTicketVo ticketItem = timeItem.getTicketList().get(y);
// if (ticketItem.getType() == 1) {
// ticketList.add(ticketItem.getTicketsId());
// }
// if (ticketItem.getTicketsId().equals(ticketId)) {
// useTime = ticketItem.getUseStart();
// }
// }
// allTicketId.put(timeItem.getUseStart(), ticketList);
// }
if (0 == isTrueName) {
redisKey = KylinRedisConst.USERID_BUY_INFO + userId;
} else {
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard;
}
String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId; redisKeyUid = KylinRedisConst.USERID_BUY_INFO + userId;
String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId; redisKeyIdCard = KylinRedisConst.IDCARD_BUY_INFO + idCard;
// String ticketUseTimeKey = ticketIdKey + ":" + KylinRedisConst.USE_TIME; String performanceIdKeyUid = redisKeyUid + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
// redisDataSourceUtil.getRedisKylinUtil().set(ticketUseTimeKey, useTime); String ticketIdKeyUid = redisKeyUid + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
if (isTrueName != 0) {
performanceIdKeyIdCard = redisKeyIdCard + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
ticketIdKeyIdCard = redisKeyIdCard + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
}
if (buyCount > 0) { if (buyCount > 0) {
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKey, buyCount); redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyUid, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKey, buyCount); redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKeyUid, buyCount);
if (isTrueName != 0) {
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyIdCard, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKeyIdCard, buyCount);
}
} else { } else {
redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKey, Math.abs(buyCount)); if (isTrueName != 0) {
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKey, Math.abs(buyCount)); redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKeyIdCard, Math.abs(buyCount));
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKeyIdCard, Math.abs(buyCount));
}
redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKeyUid, Math.abs(buyCount));
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKeyUid, Math.abs(buyCount));
} }
} }
......
...@@ -62,7 +62,7 @@ public class MongoVoUtils { ...@@ -62,7 +62,7 @@ public class MongoVoUtils {
KylinFields fields = new KylinFields(); KylinFields fields = new KylinFields();
SlimeFieldsVo fieldsVo = dataUtils.getFieldsVoByFieldId(p3.getFieldId()); SlimeFieldsVo fieldsVo = dataUtils.getFieldsVoByFieldId(p3.getFieldId());
String cityName =fieldsVo.getCityName(); String cityName =fieldsVo.getCityName();
fields.setCityId(null); fields.setCityId(Integer.parseInt(fieldsVo.getCityId()));
fields.setLatitude(fieldsVo.getLatitude()); fields.setLatitude(fieldsVo.getLatitude());
fields.setLongitude(fieldsVo.getLongitude()); fields.setLongitude(fieldsVo.getLongitude());
fields.setCityName(cityName); fields.setCityName(cityName);
......
...@@ -18,93 +18,101 @@ public class OrderUtils { ...@@ -18,93 +18,101 @@ public class OrderUtils {
private DataUtils dataUtils; private DataUtils dataUtils;
public String judgeOrderLimit( public String judgeOrderLimit(
int type,
String userId, String userId,
String idCard, String idCard,
String performanceId, String performanceId,
String ticketId, String ticketId,
int performanceLimitCount, int performanceLimitCount,
int performanceMemberLimitCount, int performanceMemberLimitCount,
int performanceLimitIdCard,
int ticketLimitCount, int ticketLimitCount,
int ticketMemberLimitCount, int ticketMemberLimitCount,
int performanceBuyCount, int ticketLimitIdCard,
int ticketBuyCount,
int memberType, int memberType,
int isTrueName int isTrueName
) { ) {
Integer[] integers; Integer[] integers = orderLimit(userId, idCard, performanceId, ticketId, isTrueName);
if (101 == type) { return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, performanceLimitIdCard,
integers = festivalOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName); ticketLimitCount, ticketMemberLimitCount,ticketLimitIdCard,
} else { memberType, integers[0], integers[1], integers[2], integers[3], isTrueName);
integers = roadShowOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName);
}
return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, ticketLimitCount, ticketMemberLimitCount, memberType, integers[0], integers[1], isTrueName);
} }
public Integer[] roadShowOrderLimit( public Integer[] orderLimit(
String userId, String userId,
String idCard, String idCard,
String performanceId, String performanceId,
String ticketId, String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName int isTrueName
) { ) {
if (1 == isTrueName) {//实名 int performanceBuyCountUid = 0;
performanceBuyCount += dataUtils.getIdCardPBuyCount(idCard, performanceId); int ticketBuyCountUid = 0;
ticketBuyCount += dataUtils.getIdCardTBuyCount(idCard, ticketId); int performanceBuyCountIdCard = 0;
} else {//非实名 int ticketBuyCountIdCard = 0;
performanceBuyCount += dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount += dataUtils.getUserTBuyCount(userId, ticketId);
}
Integer[] array = new Integer[2];
array[0] = performanceBuyCount;
array[1] = ticketBuyCount;
return array;
}
public Integer[] festivalOrderLimit(
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName
) {
if (1 == isTrueName) {//实名 if (1 == isTrueName) {//实名
performanceBuyCount += dataUtils.getIdCardPBuyCount(idCard, performanceId); performanceBuyCountIdCard = dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCount += dataUtils.getIdCardTBuyCount(idCard, ticketId); ticketBuyCountIdCard = dataUtils.getIdCardTBuyCount(idCard, ticketId);
performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
} else {//非实名 } else {//非实名
performanceBuyCount += dataUtils.getUserPBuyCount(userId, performanceId); performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount += dataUtils.getUserTBuyCount(userId, ticketId); ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
} }
Integer[] array = new Integer[2]; Integer[] array = new Integer[4];
array[0] = performanceBuyCount; array[0] = performanceBuyCountUid;
array[1] = ticketBuyCount; array[1] = ticketBuyCountUid;
array[2] = performanceBuyCountIdCard;
array[3] = ticketBuyCountIdCard;
return array; return array;
} }
public String judgeMemberType(int performanceLimitCount, int performanceMemberLimitCount, int ticketLimitCount, int ticketMemberLimitCount, int memberType, int performanceBuyCount, int ticketBuyCount, int isTrueName) { public String judgeMemberType(int performanceLimitCount, int performanceMemberLimitCount, int performanceLimitIdCard,
int ticketLimitCount, int ticketMemberLimitCount, int ticketLimitIdCard, int memberType,
int performanceBuyCountUid, int ticketBuyCountUid, int performanceBuyCountIdCard, int ticketBuyCountIdCard, int isTrueName) {
if (memberType == 1 || memberType == 2) { if (memberType == 1 || memberType == 2) {
if (performanceBuyCount > performanceMemberLimitCount && performanceMemberLimitCount != 0) { if(isTrueName==1){
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量 if (performanceBuyCountIdCard > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
} return "实名制演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
if (ticketBuyCount > ticketMemberLimitCount && ticketMemberLimitCount != 0) { }
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量 if (ticketBuyCountIdCard > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "实名制票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
}else{
if (performanceBuyCountUid > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return "本场演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountUid > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "该票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
} }
} else {//非会员区间 } else {//非会员区间
if (performanceBuyCount > performanceLimitCount && performanceLimitCount != 0) { if(isTrueName==1){
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量 if (performanceBuyCountUid > performanceLimitCount && performanceLimitCount != 0) {
} return "本场演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量
if (ticketBuyCount > ticketLimitCount && ticketLimitCount != 0) { }
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketLimitCount + "张,已超出";//超过票维度购买量 if (ticketBuyCountUid > ticketLimitCount && ticketLimitCount != 0) {
return "该票种限购" + ticketLimitCount + "张,已超出";//超过演出维度购买量
}
if (performanceBuyCountIdCard > performanceLimitIdCard && performanceLimitIdCard != 0) {
return "实名制演出限购" + performanceLimitIdCard + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountIdCard > ticketLimitIdCard && ticketLimitIdCard != 0) {
return "实名制票种限购" + ticketLimitIdCard + "张,已超出";//超过演出维度购买量
}
}else{
if (performanceBuyCountUid > performanceLimitCount && performanceLimitCount != 0) {
return "本场演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountUid > ticketLimitCount && ticketLimitCount != 0) {
return "该票种限购" + ticketLimitCount + "张,已超出";//超过演出维度购买量
}
} }
} }
return ""; return "";
} }
/** /**
* @param userId 用户id * @param userId 用户id
* @param type 1新增 2修改 * @param type 1新增 2修改
......
...@@ -467,6 +467,9 @@ public class PerformanceVoUtils { ...@@ -467,6 +467,9 @@ public class PerformanceVoUtils {
ticketsMapper.insert(tickets); ticketsMapper.insert(tickets);
ticketStatus.setStatus(9); ticketStatus.setStatus(9);
ticketStatus.setIsTrueName(performanceStatus.getIsTrueName()); ticketStatus.setIsTrueName(performanceStatus.getIsTrueName());
if(ticketItem.getExpressType()==null){
ticketStatus.setExpressType(0);
}
ticketStatusMapper.insert(ticketStatus); ticketStatusMapper.insert(ticketStatus);
ticketRelationsMapper.insert(ticketRelations); ticketRelationsMapper.insert(ticketRelations);
...@@ -481,6 +484,7 @@ public class PerformanceVoUtils { ...@@ -481,6 +484,7 @@ public class PerformanceVoUtils {
} else { } else {
//不改动数据 价格 限购 购票时间 //不改动数据 价格 限购 购票时间
ticketStatus.setLimitCount(null); ticketStatus.setLimitCount(null);
ticketStatus.setIdCount(null);
ticketStatus.setTotalGeneral(null); ticketStatus.setTotalGeneral(null);
ticketStatus.setTotalExchange(null); ticketStatus.setTotalExchange(null);
tickets.setTimeStart(null); tickets.setTimeStart(null);
......
...@@ -117,6 +117,16 @@ public abstract class DateUtil { ...@@ -117,6 +117,16 @@ public abstract class DateUtil {
return new Date(c.getTimeInMillis()); return new Date(c.getTimeInMillis());
} }
/**
* 计算日期,增加天数
*/
public static String addDay(String date, int days) {
Calendar c = Calendar.getInstance();
c.setTime(parse(date, "yyyy-MM-dd HH:mm:ss"));
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + days);
return format(new Date(c.getTimeInMillis()), Formatter.yyyyMMddHHmmss);
}
/** /**
* 计算日期,增加小时 * 计算日期,增加小时
*/ */
...@@ -315,6 +325,18 @@ public abstract class DateUtil { ...@@ -315,6 +325,18 @@ public abstract class DateUtil {
return asLocalDate(date2).toEpochDay() - asLocalDate(date1).toEpochDay(); return asLocalDate(date2).toEpochDay() - asLocalDate(date1).toEpochDay();
} }
/**
* 间隔天数
*
* @param date1 开始日期
* @param date2 结束日期
*/
public static long intervalDays(String date1, String date2) {
Date date1D = parse(date1, "yyyy-MM-dd HH:mm:ss");
Date date2D = parse(date2, "yyyy-MM-dd HH:mm:ss");
return asLocalDate(date2D).toEpochDay() - asLocalDate(date1D).toEpochDay();
}
/** /**
* 间隔月 * 间隔月
* *
...@@ -509,25 +531,28 @@ public abstract class DateUtil { ...@@ -509,25 +531,28 @@ public abstract class DateUtil {
/** /**
* 秒级时间戳转 LocalDateTime * 秒级时间戳转 LocalDateTime
*
* @param epochMilli 秒级时间戳 * @param epochMilli 秒级时间戳
* @return LocalDateTime * @return LocalDateTime
*/ */
public static LocalDateTime ofEpochMilli(long epochMilli){ public static LocalDateTime ofEpochMilli(long epochMilli) {
// return LocalDateTime.ofInstant(Instant.ofEpochMilli(epochMilli), ZoneOffset.of("+8")); // return LocalDateTime.ofInstant(Instant.ofEpochMilli(epochMilli), ZoneOffset.of("+8"));
return LocalDateTime.ofEpochSecond(epochMilli,0, ZoneOffset.ofHours(8)); return LocalDateTime.ofEpochSecond(epochMilli, 0, ZoneOffset.ofHours(8));
} }
/** /**
* 获取10位时间戳,精确到秒 * 获取10位时间戳,精确到秒
*
* @return * @return
*/ */
public static Long getNowSeconds(){ public static Long getNowSeconds() {
//获取秒数 //获取秒数
Long second = LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")); Long second = LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8"));
//获取毫秒数 //获取毫秒数
// Long milliSecond = LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli(); // Long milliSecond = LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
return second; return second;
} }
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(DateUtil.getNowTime()); System.out.println(DateUtil.getNowTime());
//获取秒数 //获取秒数
...@@ -535,7 +560,7 @@ public abstract class DateUtil { ...@@ -535,7 +560,7 @@ public abstract class DateUtil {
//获取毫秒数 //获取毫秒数
Long milliSecond = LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli(); Long milliSecond = LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
System.out.println("second==="+second); System.out.println("second===" + second);
System.out.println("milliSecond==="+milliSecond); System.out.println("milliSecond===" + milliSecond);
} }
} }
...@@ -83,7 +83,7 @@ public class GoblinMix implements Serializable { ...@@ -83,7 +83,7 @@ public class GoblinMix implements Serializable {
private String coverPic; private String coverPic;
/** /**
* 商品视频地址/数字昌平视频地址 * 展示类型为1[详情图片地址]展示类型为2[商品视频地址/数字藏品视频地址]
*/ */
private String video; private String video;
......
...@@ -10,6 +10,16 @@ public class OrderExportDao { ...@@ -10,6 +10,16 @@ public class OrderExportDao {
private String userMobile; private String userMobile;
//名称 //名称
private String userName; private String userName;
//票种名称
private String title;
//适用时间
private String useTime;
//适用开始时间
private String useStart;
//适用结束时间
private String useEnd;
//订单号 //订单号
private String orderCode; private String orderCode;
//商户订单号 //商户订单号
......
...@@ -79,6 +79,11 @@ public class KylinPerformanceStatus implements Serializable ,Cloneable{ ...@@ -79,6 +79,11 @@ public class KylinPerformanceStatus implements Serializable ,Cloneable{
*/ */
private Integer limitCount; private Integer limitCount;
/**
* 实名限购张数 0无限 (开启实名 则实名限购 未开始为账号限购)
*/
private Integer idCount;
/** /**
* 会员限购张数 0无限 (开启实名 则实名限购 未开始为账号限购) * 会员限购张数 0无限 (开启实名 则实名限购 未开始为账号限购)
*/ */
...@@ -179,7 +184,7 @@ public class KylinPerformanceStatus implements Serializable ,Cloneable{ ...@@ -179,7 +184,7 @@ public class KylinPerformanceStatus implements Serializable ,Cloneable{
vo.getPerformanceStatusId(),vo.getPerformanceId(), vo.getPerformanceStatusId(),vo.getPerformanceId(),
vo.getIsShow(),vo.getStatus(),vo.getStatusSell(), vo.getIsShow(),vo.getStatus(),vo.getStatusSell(),
vo.getIsDistribution(),vo.getSyncAgent(),0, vo.getIsDistribution(),vo.getSyncAgent(),0,
vo.getAuditStatus(),vo.getIsTrueName(),vo.getLimitCount(), vo.getAuditStatus(),vo.getIsTrueName(),vo.getLimitCount(),vo.getIdCount(),
vo.getLimitCountMember(),vo.getFieldAuditStatus(),vo.getCreatedAt(),vo.getUpdatedAt() vo.getLimitCountMember(),vo.getFieldAuditStatus(),vo.getCreatedAt(),vo.getUpdatedAt()
}; };
} }
......
...@@ -119,6 +119,11 @@ public class KylinTicketStatus implements Serializable ,Cloneable { ...@@ -119,6 +119,11 @@ public class KylinTicketStatus implements Serializable ,Cloneable {
*/ */
private Integer limitCount; private Integer limitCount;
/**
* 实名限购张数 0无限 (开启实名 则实名限购 未开始为账号限购)
*/
private Integer idCount;
/** /**
* 会员限购张数 0无限 (开启实名 则实名限购 未开始为账号限购) * 会员限购张数 0无限 (开启实名 则实名限购 未开始为账号限购)
*/ */
...@@ -170,7 +175,7 @@ public class KylinTicketStatus implements Serializable ,Cloneable { ...@@ -170,7 +175,7 @@ public class KylinTicketStatus implements Serializable ,Cloneable {
vo.getCounts(),vo.getStatusExchange(),vo.getIsShowCode(), vo.getCounts(),vo.getStatusExchange(),vo.getIsShowCode(),
vo.getQrCodeShowTime(),vo.getIsLackRegister(),vo.getTotalGeneral(), vo.getQrCodeShowTime(),vo.getIsLackRegister(),vo.getTotalGeneral(),
vo.getTotalExchange(),vo.getSurplusGeneral(),vo.getSurplusExchange(), vo.getTotalExchange(),vo.getSurplusGeneral(),vo.getSurplusExchange(),
vo.getExpressType(),vo.getIsTransfer(),vo.getIsTrueName(),vo.getLimitCount(), vo.getExpressType(),vo.getIsTransfer(),vo.getIsTrueName(),vo.getLimitCount(),vo.getIdCount(),
vo.getMemberLimitCount(),vo.getIsExclusive(),vo.getIsMember(), vo.getMemberLimitCount(),vo.getIsExclusive(),vo.getIsMember(),
0,0,vo.getCreatedAt(),vo.getUpdatedAt() 0,0,vo.getCreatedAt(),vo.getUpdatedAt()
......
...@@ -54,6 +54,11 @@ ...@@ -54,6 +54,11 @@
<result column="user_mobile" property="userMobile"/> <result column="user_mobile" property="userMobile"/>
<result column="user_name" property="userName"/> <result column="user_name" property="userName"/>
<result column="title" property="title"/>
<result column="use_time" property="useTime"/>
<result column="use_start" property="useStart"/>
<result column="use_end" property="useEnd"/>
<result column="order_code" property="orderCode"/> <result column="order_code" property="orderCode"/>
<result column="code" property="code"/> <result column="code" property="code"/>
<result column="pay_code" property="payCode"/> <result column="pay_code" property="payCode"/>
...@@ -626,22 +631,24 @@ ...@@ -626,22 +631,24 @@
</select> </select>
<select id="exportOrderByPerformanceIdAll" resultMap="OrderExportDaoResult"> <select id="exportOrderByPerformanceIdAll" resultMap="OrderExportDaoResult">
SELECT performance_title,user_mobile,user_name SELECT performance_title,user_mobile,user_name,title,CONCAT(use_start,use_end) as 'use_time',use_start,use_end
FROM kylin_order_tickets kot FROM kylin_order_tickets kot
INNER JOIN kylin_order_ticket_relations as kotr on kotr.order_id = kot.order_tickets_id INNER JOIN kylin_order_ticket_relations as kotr on kotr.order_id = kot.order_tickets_id
INNER JOIN kylin_order_ticket_status as kots on kots.order_id = kot.order_tickets_id INNER JOIN kylin_order_ticket_status as kots on kots.order_id = kot.order_tickets_id
WHERE performance_id = #{performancesId} INNER JOIN kylin_tickets as kt on kt.tickets_id = kotr.ticket_id
GROUP BY user_mobile; WHERE performance_id = #{performancesId}
GROUP BY user_mobile,tickets_id;
</select> </select>
<select id="exportOrderByPerformanceIdPay" resultMap="OrderExportDaoResult"> <select id="exportOrderByPerformanceIdPay" resultMap="OrderExportDaoResult">
SELECT performance_title,user_mobile,user_name SELECT performance_title,user_mobile,user_name,title,CONCAT(use_start,use_end) as 'use_time',use_start,use_end
FROM kylin_order_tickets kot FROM kylin_order_tickets kot
INNER JOIN kylin_order_ticket_relations as kotr on kotr.order_id = kot.order_tickets_id INNER JOIN kylin_order_ticket_relations as kotr on kotr.order_id = kot.order_tickets_id
INNER JOIN kylin_order_ticket_status as kots on kots.order_id = kot.order_tickets_id INNER JOIN kylin_order_ticket_status as kots on kots.order_id = kot.order_tickets_id
INNER JOIN kylin_tickets as kt on kt.tickets_id = kotr.ticket_id
WHERE performance_id = #{performancesId} WHERE performance_id = #{performancesId}
AND status IN (1, 3) AND status IN (1, 3)
GROUP BY user_mobile; GROUP BY user_mobile,tickets_id;
</select> </select>
<select id="getPerformanceSimpleByTicketId" resultType="com.liquidnet.service.kylin.dao.PerformanceSimpleAllDao"> <select id="getPerformanceSimpleByTicketId" resultType="com.liquidnet.service.kylin.dao.PerformanceSimpleAllDao">
<!-- select kp.performances_id as performancesId,--> <!-- select kp.performances_id as performancesId,-->
......
package com.liquidnet.service.consumer.kylin.receiver; //package com.liquidnet.service.consumer.kylin.receiver;
//
import com.liquidnet.common.cache.redis.util.RedisUtil; //import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CollectionUtil; //import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.JsonUtils; //import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.OrderCloseMapping; //import com.liquidnet.service.base.OrderCloseMapping;
import com.liquidnet.service.consumer.kylin.utils.KylinUtils; //import com.liquidnet.service.consumer.kylin.utils.KylinUtils;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketEntitiesVo; //import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketEntitiesVo;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketVo; //import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketVo;
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.data.redis.connection.stream.MapRecord; //import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.connection.stream.StreamRecords; //import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate; //import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.stream.StreamListener; //import org.springframework.data.redis.stream.StreamListener;
//
import java.util.HashMap; //import java.util.HashMap;
//
@Slf4j //@Slf4j
public abstract class AbstractSqlOptOrderCloseRedisReceiver implements StreamListener<String, MapRecord<String, String, String>> { //public abstract class AbstractSqlOptOrderCloseRedisReceiver implements StreamListener<String, MapRecord<String, String, String>> {
@Autowired // @Autowired
StringRedisTemplate stringRedisTemplate; // StringRedisTemplate stringRedisTemplate;
@Autowired // @Autowired
private RedisUtil redisUtil; // private RedisUtil redisUtil;
@Autowired // @Autowired
private KylinUtils kylinUtils; // private KylinUtils kylinUtils;
//
@Override // @Override
public void onMessage(MapRecord<String, String, String> message) { // public void onMessage(MapRecord<String, String, String> message) {
String redisStreamKey = this.getRedisStreamKey(); // String redisStreamKey = this.getRedisStreamKey();
log.debug("CONSUMER MSG[streamKey:{},messageId:{},stream:{},body:{}]", redisStreamKey, message.getId(), message.getStream(), message.getValue()); // log.debug("CONSUMER MSG[streamKey:{},messageId:{},stream:{},body:{}]", redisStreamKey, message.getId(), message.getStream(), message.getValue());
boolean result = this.consumerSqlOperationOrderCloseHandler(message.getValue().get("message")); // boolean result = this.consumerSqlOperationOrderCloseHandler(message.getValue().get("message"));
log.info("CONSUMER MSG RESULT:{} ==> [{}]MESSAGE_ID:{}", result, redisStreamKey, message.getId()); // log.info("CONSUMER MSG RESULT:{} ==> [{}]MESSAGE_ID:{}", result, redisStreamKey, message.getId());
//
try { // try {
stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message); // stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message);
} catch (Exception e) { // } catch (Exception e) {
log.error("#CONSUMER MSG EX_ACK ==> [{}]RESULT:{},MESSAGE:{}", redisStreamKey, result, message.getValue(), e); // log.error("#CONSUMER MSG EX_ACK ==> [{}]RESULT:{},MESSAGE:{}", redisStreamKey, result, message.getValue(), e);
} // }
try { // try {
stringRedisTemplate.opsForStream().delete(redisStreamKey, message.getId()); // stringRedisTemplate.opsForStream().delete(redisStreamKey, message.getId());
} catch (Exception e) { // } catch (Exception e) {
log.error("#CONSUMER MSG EX_DEL ==> [{}]RESULT:{},MESSAGE:{}", redisStreamKey, result, message.getValue(), e); // log.error("#CONSUMER MSG EX_DEL ==> [{}]RESULT:{},MESSAGE:{}", redisStreamKey, result, message.getValue(), e);
} // }
} // }
//
private boolean consumerSqlOperationOrderCloseHandler(String msg) { // private boolean consumerSqlOperationOrderCloseHandler(String msg) {
boolean aBoolean = false; // boolean aBoolean = false;
try { // try {
OrderCloseMapping.orderCloseMessage mqMessage = JsonUtils.fromJson(msg, OrderCloseMapping.orderCloseMessage.class); // OrderCloseMapping.orderCloseMessage mqMessage = JsonUtils.fromJson(msg, OrderCloseMapping.orderCloseMessage.class);
//
for (int x = 0; x < mqMessage.getOrderTicketIds().size(); x++) { // for (int x = 0; x < mqMessage.getOrderTicketIds().size(); x++) {
String t = mqMessage.getOrderTicketIds().get(x); // String t = mqMessage.getOrderTicketIds().get(x);
String orderTicketId = t.split(",")[0]; // String orderTicketId = t.split(",")[0];
String uid = t.split(",")[1]; // String uid = t.split(",")[1];
KylinOrderTicketVo vo = kylinUtils.getOrderTicketVo(orderTicketId); // KylinOrderTicketVo vo = kylinUtils.getOrderTicketVo(orderTicketId);
vo.setStatus(2); // vo.setStatus(2);
redisUtil.set("kylin:order:id:" + orderTicketId, vo); // redisUtil.set("kylin:order:id:" + orderTicketId, vo);
//
kylinUtils.resetOrderListVo(uid, 2, orderTicketId, vo); // kylinUtils.resetOrderListVo(uid, 2, orderTicketId, vo);
// redis 限购 // // redis 限购
for (int i = 0; i < vo.getEntitiesVoList().size(); i++) { // for (int i = 0; i < vo.getEntitiesVoList().size(); i++) {
KylinOrderTicketEntitiesVo items = vo.getEntitiesVoList().get(i); // KylinOrderTicketEntitiesVo items = vo.getEntitiesVoList().get(i);
kylinUtils.changeBuyInfo(items.getUserId(), items.getEnterIdCode(), items.getPerformanceId(), items.getTicketId(), -1); // kylinUtils.changeBuyInfo(items.getUserId(), items.getEnterIdCode(), items.getPerformanceId(), items.getTicketId(), -1);
} // }
} // }
//
aBoolean = true; // aBoolean = true;
} catch (Exception e) { // } catch (Exception e) {
log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), msg, e); // log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), msg, e);
} finally { // } finally {
if (!aBoolean) { // if (!aBoolean) {
HashMap<String, String> map = CollectionUtil.mapStringString(); // HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", msg); // map.put("message", msg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(this.getRedisStreamKey())); // stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(this.getRedisStreamKey()));
} // }
} // }
return aBoolean; // return aBoolean;
} // }
//
protected abstract String getRedisStreamKey(); // protected abstract String getRedisStreamKey();
//
protected abstract String getRedisStreamGroup(); // protected abstract String getRedisStreamGroup();
} //}
package com.liquidnet.service.consumer.kylin.receiver; //package com.liquidnet.service.consumer.kylin.receiver;
//
import com.liquidnet.service.base.constant.MQConst; //import com.liquidnet.service.base.constant.MQConst;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
@Component //@Component
public class ConsumerKylinSqlOptOrderCloseRedisReceiver extends AbstractSqlOptOrderCloseRedisReceiver { //public class ConsumerKylinSqlOptOrderCloseRedisReceiver extends AbstractSqlOptOrderCloseRedisReceiver {
@Override // @Override
protected String getRedisStreamKey() { // protected String getRedisStreamKey() {
return MQConst.KylinQueue.SQL_ORDER_CLOSE.getKey(); // return MQConst.KylinQueue.SQL_ORDER_CLOSE.getKey();
} // }
//
@Override // @Override
protected String getRedisStreamGroup() { // protected String getRedisStreamGroup() {
return MQConst.KylinQueue.SQL_ORDER_CLOSE.getGroup(); // return MQConst.KylinQueue.SQL_ORDER_CLOSE.getGroup();
} // }
} //}
...@@ -83,45 +83,26 @@ public class KylinUtils { ...@@ -83,45 +83,26 @@ public class KylinUtils {
} }
} }
public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) { // public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) {
String redisKey; // String redisKey;
int isTrueName = getPerformanceIsTrueName(performanceId); // int isTrueName = getPerformanceIsTrueName(performanceId);
// String useTime = ""; // if (0 == isTrueName) {
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>(); // redisKey = KylinRedisConst.USERID_BUY_INFO + userId;
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) { // } else {
// KylinTicketTimesVo timeItem = vo.getTicketTimeList().get(x); // redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard;
// ArrayList<String> ticketList = new ArrayList<>();
// for (int y = 0; y < timeItem.getTicketList().size(); y++) {
// KylinTicketVo ticketItem = timeItem.getTicketList().get(y);
// if (ticketItem.getType() == 1) {
// ticketList.add(ticketItem.getTicketsId());
// }
// if (ticketItem.getTicketsId().equals(ticketId)) {
// useTime = ticketItem.getUseStart();
// }
// }
// allTicketId.put(timeItem.getUseStart(), ticketList);
// } // }
//
if (0 == isTrueName) { // String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
redisKey = KylinRedisConst.USERID_BUY_INFO + userId; // String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
} else { //
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard; // if (buyCount > 0) {
} // redisUtil.incr(ticketIdKey, buyCount);
// redisUtil.incr(performanceIdKey, buyCount);
String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId; // } else {
String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId; // redisUtil.decr(ticketIdKey, Math.abs(buyCount));
// String ticketUseTimeKey = ticketIdKey + ":" + KylinRedisConst.USE_TIME; // redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// redisUtil.set(ticketUseTimeKey, useTime); // }
// }
if (buyCount > 0) {
redisUtil.incr(ticketIdKey, buyCount);
redisUtil.incr(performanceIdKey, buyCount);
} else {
redisUtil.decr(ticketIdKey, Math.abs(buyCount));
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
}
}
/** /**
* 根据演出id 获取 演出vo 详情 * 根据演出id 获取 演出vo 详情
......
...@@ -131,21 +131,36 @@ public class KylinOrderUtils { ...@@ -131,21 +131,36 @@ public class KylinOrderUtils {
* @param buyCount * @param buyCount
*/ */
public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) { public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) {
String redisKey; String redisKeyUid;
String redisKeyIdCard;
String performanceIdKeyIdCard="";
String ticketIdKeyIdCard="";
int isTrueName = getPerformanceIsTrueName(performanceId); int isTrueName = getPerformanceIsTrueName(performanceId);
if (0 == isTrueName) {
redisKey = KylinRedisConst.USERID_BUY_INFO + userId; redisKeyUid = KylinRedisConst.USERID_BUY_INFO + userId;
} else { redisKeyIdCard = KylinRedisConst.IDCARD_BUY_INFO + idCard;
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard; String performanceIdKeyUid = redisKeyUid + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
String ticketIdKeyUid = redisKeyUid + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
if (isTrueName != 0) {
performanceIdKeyIdCard = redisKeyIdCard + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
ticketIdKeyIdCard = redisKeyIdCard + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
} }
String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
if (buyCount > 0) { if (buyCount > 0) {
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKey, buyCount); redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyUid, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKey, buyCount); redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKeyUid, buyCount);
if (isTrueName != 0) {
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyIdCard, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKeyIdCard, buyCount);
}
} else { } else {
redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKey, Math.abs(buyCount)); if (isTrueName != 0) {
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKey, Math.abs(buyCount)); redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKeyIdCard, Math.abs(buyCount));
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKeyIdCard, Math.abs(buyCount));
}
redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKeyUid, Math.abs(buyCount));
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKeyUid, Math.abs(buyCount));
} }
} }
......
...@@ -83,46 +83,6 @@ public class KylinUtils { ...@@ -83,46 +83,6 @@ public class KylinUtils {
} }
} }
public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) {
String redisKey;
int isTrueName = getPerformanceIsTrueName(performanceId);
// String useTime = "";
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>();
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
// KylinTicketTimesVo timeItem = vo.getTicketTimeList().get(x);
// ArrayList<String> ticketList = new ArrayList<>();
// for (int y = 0; y < timeItem.getTicketList().size(); y++) {
// KylinTicketVo ticketItem = timeItem.getTicketList().get(y);
// if (ticketItem.getType() == 1) {
// ticketList.add(ticketItem.getTicketsId());
// }
// if (ticketItem.getTicketsId().equals(ticketId)) {
// useTime = ticketItem.getUseStart();
// }
// }
// allTicketId.put(timeItem.getUseStart(), ticketList);
// }
if (0 == isTrueName) {
redisKey = KylinRedisConst.USERID_BUY_INFO + userId;
} else {
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard;
}
String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
// String ticketUseTimeKey = ticketIdKey + ":" + KylinRedisConst.USE_TIME;
// redisUtil.set(ticketUseTimeKey, useTime);
if (buyCount > 0) {
redisUtil.incr(ticketIdKey, buyCount);
redisUtil.incr(performanceIdKey, buyCount);
} else {
redisUtil.decr(ticketIdKey, Math.abs(buyCount));
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
}
}
/** /**
* 根据演出id 获取 演出vo 详情 * 根据演出id 获取 演出vo 详情
* *
......
...@@ -17,7 +17,7 @@ CREATE TABLE `goblin_mix` ...@@ -17,7 +17,7 @@ CREATE TABLE `goblin_mix`
`intro` varchar(512) DEFAULT NULL COMMENT '商品简介/购买须知', `intro` varchar(512) DEFAULT NULL COMMENT '商品简介/购买须知',
`watch_type` char(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '展示文件类型[1-图片|2-视频|3-模型]', `watch_type` char(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '展示文件类型[1-图片|2-视频|3-模型]',
`cover_pic` varchar(256) DEFAULT NULL COMMENT '封面图片地址', `cover_pic` varchar(256) DEFAULT NULL COMMENT '封面图片地址',
`video` varchar(256) DEFAULT NULL COMMENT '商品视频地址/数字昌平视频地址', `video` varchar(256) DEFAULT NULL COMMENT '展示类型为1[详情图片地址]展示类型为2[商品视频地址/数字藏品视频地址]',
`detail_url` varchar(256) DEFAULT NULL COMMENT '数字藏品图片地址', `detail_url` varchar(256) DEFAULT NULL COMMENT '数字藏品图片地址',
`details` text COMMENT '商品详情/藏品详情', `details` text COMMENT '商品详情/藏品详情',
......
package com.liquidnet.service.goblin.controller; package com.liquidnet.service.goblin.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.vo.HelpValueVo; import com.liquidnet.service.goblin.dto.manage.vo.HelpValueVo;
import com.liquidnet.service.goblin.service.IGoblinGoodsAnticipateService; import com.liquidnet.service.goblin.service.IGoblinGoodsAnticipateService;
...@@ -98,4 +99,25 @@ public class GoblinGoodsAnticipateController { ...@@ -98,4 +99,25 @@ public class GoblinGoodsAnticipateController {
return goblinGoodsAnticipateService.getTurnOnHelp(skuId); return goblinGoodsAnticipateService.getTurnOnHelp(skuId);
} }
@ApiOperationSupport(order = 6)
@ApiOperation(value = "混合购【用户预约MIX混合购】")
@GetMapping("reserveByMix")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mixId", value = "混合售id"),
})
public ResponseDto<Boolean> reserveByMix(@RequestParam(value = "mixId", required = true) String mixId) {
return goblinGoodsAnticipateService.reserveByMix(mixId);
}
@ApiOperationSupport(order = 7)
@ApiOperation(value = "混合购【根据mixId查询用户是否预约该混合购】")
@GetMapping("reserveMixByUid")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mixId", value = "混合售id"),
})
public ResponseDto<Boolean> reserveMixByUid(@RequestParam(value = "mixId", required = true) String mixId) {
return goblinGoodsAnticipateService.reserveMixByUid(mixId);
}
} }
...@@ -5,6 +5,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport; ...@@ -5,6 +5,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.commons.lang.util.CurrentUtil; import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.manage.IGoblinGoodsAnticipateMgService;
import com.liquidnet.service.goblin.service.manage.IGoblinMixAppService; import com.liquidnet.service.goblin.service.manage.IGoblinMixAppService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -29,6 +30,7 @@ public class GoblinMixAppController { ...@@ -29,6 +30,7 @@ public class GoblinMixAppController {
@Autowired @Autowired
IGoblinMixAppService goblinMixAppService; IGoblinMixAppService goblinMixAppService;
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "列表") @ApiOperation(value = "列表")
@ApiImplicitParams({ @ApiImplicitParams({
...@@ -78,4 +80,5 @@ public class GoblinMixAppController { ...@@ -78,4 +80,5 @@ public class GoblinMixAppController {
public ResponseDto<Boolean> mixCanBy(@RequestParam(value = "mixId", required = true) String mixId) { public ResponseDto<Boolean> mixCanBy(@RequestParam(value = "mixId", required = true) String mixId) {
return goblinMixAppService.canBy(mixId, CurrentUtil.getCurrentUid()); return goblinMixAppService.canBy(mixId, CurrentUtil.getCurrentUid());
} }
} }
...@@ -2,6 +2,7 @@ package com.liquidnet.service.goblin.service.impl; ...@@ -2,6 +2,7 @@ package com.liquidnet.service.goblin.service.impl;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.CurrentUtil; import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.adam.dto.vo.AdamUserInfoVo; import com.liquidnet.service.adam.dto.vo.AdamUserInfoVo;
import com.liquidnet.service.base.ErrorMapping; import com.liquidnet.service.base.ErrorMapping;
...@@ -20,12 +21,16 @@ import lombok.extern.slf4j.Slf4j; ...@@ -20,12 +21,16 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.unit.DataUnit;
import java.time.Duration; import java.time.Duration;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
/** /**
* <p> * <p>
* 预约表 服务实现类 * 预约表 服务实现类
...@@ -84,16 +89,16 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -84,16 +89,16 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
return ResponseDto.failure("预约失败!"); return ResponseDto.failure("预约失败!");
} }
} else { } else {
log.debug("skuId:{},需要助力人数:{},uid:{},该用户未开启分享助力!",skuId,anticipateValueVo.getPeopleType(),uid); log.debug("skuId:{},需要助力人数:{},uid:{},该用户未开启分享助力!", skuId, anticipateValueVo.getPeopleType(), uid);
return ResponseDto.failure("预约失败!"); return ResponseDto.failure("预约失败!");
} }
} }
uidAboutBySkuId(skuId, uid,null); uidAboutBySkuId(skuId, uid, null);
} }
return ResponseDto.success(); return ResponseDto.success();
} }
private void uidAboutBySkuId(String skuId, String uid,String avatar) { private void uidAboutBySkuId(String skuId, String uid, String avatar) {
GoblinGoodAnticipateUserVo user = new GoblinGoodAnticipateUserVo(); GoblinGoodAnticipateUserVo user = new GoblinGoodAnticipateUserVo();
user.setUid(uid); user.setUid(uid);
user.setSkuId(skuId); user.setSkuId(skuId);
...@@ -119,7 +124,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -119,7 +124,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
List<String> userAvatar = goblinRedisUtils.getUserAvatar(skuId); List<String> userAvatar = goblinRedisUtils.getUserAvatar(skuId);
if (userAvatar != null && userAvatar.size() <= 2) { if (userAvatar != null && userAvatar.size() <= 2) {
//获取预约人头像 //获取预约人头像
if (avatar==null){ if (avatar == null) {
avatar = goblinAnticipateUtils.getUserInfo().getAvatar(); avatar = goblinAnticipateUtils.getUserInfo().getAvatar();
} }
goblinRedisUtils.setUserAvatar(skuId, avatar); goblinRedisUtils.setUserAvatar(skuId, avatar);
...@@ -149,8 +154,8 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -149,8 +154,8 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//可以创建分享 //可以创建分享
//查询redis关联记录 //查询redis关联记录
String sid = goblinRedisUtils.getShare(skuId, uid); String sid = goblinRedisUtils.getShare(skuId, uid);
if (sid!=null) { if (sid != null) {
return ResponseDto.failure("0","已开启助力",sid); return ResponseDto.failure("0", "已开启助力", sid);
} else { } else {
//查询sku需要助力人数 //查询sku需要助力人数
//Integer skuIdPeople = goblinRedisUtils.getSharePeopleBySkuId(skuId); //Integer skuIdPeople = goblinRedisUtils.getSharePeopleBySkuId(skuId);
...@@ -177,7 +182,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -177,7 +182,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//redis缓存 //redis缓存
Duration between = Duration.between(valueBySkuId.getAboutStartDate(), valueBySkuId.getAboutEndDate()); Duration between = Duration.between(valueBySkuId.getAboutStartDate(), valueBySkuId.getAboutEndDate());
goblinRedisUtils.setShare(skuId, uid, sid,between.toDays()); goblinRedisUtils.setShare(skuId, uid, sid, between.toDays());
//redis存储用户分享 //redis存储用户分享
goblinRedisUtils.setShareVo(goblinGoodsAnticipateShareVo); goblinRedisUtils.setShareVo(goblinGoodsAnticipateShareVo);
...@@ -213,7 +218,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -213,7 +218,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//获取uid //获取uid
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
if (shareVo.getUid().equals(uid)){ if (shareVo.getUid().equals(uid)) {
return ResponseDto.failure(ErrorMapping.get(150003)); return ResponseDto.failure(ErrorMapping.get(150003));
} }
//查询mongodb 是否助力过该分享 //查询mongodb 是否助力过该分享
...@@ -235,10 +240,10 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -235,10 +240,10 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
if (helpUserAvatar.size() <= 6) { if (helpUserAvatar.size() <= 6) {
//获取用户头像保存 //获取用户头像保存
AdamUserInfoVo userInfo = goblinAnticipateUtils.getUserInfo(); AdamUserInfoVo userInfo = goblinAnticipateUtils.getUserInfo();
if (userInfo!=null){ if (userInfo != null) {
//新增助力头像 //新增助力头像
goblinRedisUtils.setHelpUserAvatar(sid, userInfo.getAvatar()); goblinRedisUtils.setHelpUserAvatar(sid, userInfo.getAvatar());
}else { } else {
return ResponseDto.failure(ErrorMapping.get(150008)); return ResponseDto.failure(ErrorMapping.get(150008));
} }
} }
...@@ -260,13 +265,13 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -260,13 +265,13 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
sendRedis("goblin_goods_anticipate_help", sqlValue); sendRedis("goblin_goods_anticipate_help", sqlValue);
//判断主力人数是否达标,达标则自动预约 //判断主力人数是否达标,达标则自动预约
if (shareVo.getPeopleType().equals(goblinRedisUtils.getHelpSidAddHelp(sid))){ if (shareVo.getPeopleType().equals(goblinRedisUtils.getHelpSidAddHelp(sid))) {
//主力人数达到可预约条件 //主力人数达到可预约条件
uidAboutBySkuId(shareVo.getSkuId(),shareVo.getUid(),shareVo.getAvatar()); uidAboutBySkuId(shareVo.getSkuId(), shareVo.getUid(), shareVo.getAvatar());
} }
return ResponseDto.success(); return ResponseDto.success();
}else { } else {
log.debug("help() false ------> sid:{}",sid); log.debug("help() false ------> sid:{}", sid);
return ResponseDto.failure(ErrorMapping.get(150004)); return ResponseDto.failure(ErrorMapping.get(150004));
} }
} }
...@@ -293,7 +298,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -293,7 +298,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
public ResponseDto<Boolean> helpSid(String sid) { public ResponseDto<Boolean> helpSid(String sid) {
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
Integer help = goblinRedisUtils.getHelpByUidAndSid(uid, sid); Integer help = goblinRedisUtils.getHelpByUidAndSid(uid, sid);
if (help == null){ if (help == null) {
return ResponseDto.success(false); return ResponseDto.success(false);
} }
return ResponseDto.success(true); return ResponseDto.success(true);
...@@ -308,4 +313,47 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -308,4 +313,47 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
sqlStr); sqlStr);
} }
@Override
public ResponseDto<Boolean> reserveByMix(String mixId) {
//获取udi
String uid = CurrentUtil.getCurrentUid();
String nowTime = DateUtil.getNowTime();
//redis查询用户预约组合购记录
if (goblinRedisUtils.getReserveMixByUid(uid, mixId) == null) {
//该混合狗能否被预约
GoblinMixDetailsVo mixDetails = goblinRedisUtils.getMixDetails(mixId);
//组合购开启预约且当前时间大于预约购开始时间或者上架时间才可预约
if (mixDetails.getReserve() != 0 && DateUtil.compareStrDay(nowTime, mixDetails.getTimeStart()) <= 0) {
String mid = IDGenerator.nextTimeId2();
GoblinMixReserveVo goblinMixReserveVo = GoblinMixReserveVo.getNew();
goblinMixReserveVo.setMid(mid);
goblinMixReserveVo.setMixId(mixId);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DateUtil.DATE_FULL_STR);
goblinMixReserveVo.setCreatedDate(LocalDateTime.parse(nowTime,formatter));
goblinMixReserveVo.setUid(uid);
String mobile = StringUtils.defaultString(((String) CurrentUtil.getTokenClaims().get(CurrentUtil.TOKEN_MOBILE)), "");
goblinMixReserveVo.setPhone(mobile);
//redis保存用户预约组合购记录
goblinRedisUtils.setReserveMixByUid(goblinMixReserveVo);
//发送redis消息修改mysql记录用户预约
LinkedList<Object[]> sqlValue = CollectionUtil.linkedListObjectArr();
sqlValue.add(new Object[]{
mid,
uid,
mobile,
mixId
});
sendRedis("goblin_goods_anticipate_mix", sqlValue);
}
}
return ResponseDto.success(true);
}
@Override
public ResponseDto<Boolean> reserveMixByUid(String mixId) {
//获取udi
String uid = CurrentUtil.getCurrentUid();
return ResponseDto.success(goblinRedisUtils.getReserveMixByUid(uid, mixId) != null);
}
} }
package com.liquidnet.service.goblin.service.impl; package com.liquidnet.service.goblin.service.impl;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.CurrentUtil; import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.param.GoblinMixDetailsItemParam;
import com.liquidnet.service.goblin.param.GoblinMixDetailsParam;
import com.liquidnet.service.goblin.param.GoblinMixUpdateParam;
import com.liquidnet.service.goblin.service.manage.IGoblinMixAppService; import com.liquidnet.service.goblin.service.manage.IGoblinMixAppService;
import com.liquidnet.service.goblin.service.manage.IGoblinMixService;
import com.liquidnet.service.goblin.util.*; import com.liquidnet.service.goblin.util.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -21,12 +12,9 @@ import org.springframework.beans.BeanUtils; ...@@ -21,12 +12,9 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS; import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
...@@ -59,16 +47,17 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService { ...@@ -59,16 +47,17 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService {
} else { } else {
return ResponseDto.failure(); return ResponseDto.failure();
} }
String nowTime = DateUtil.getNowTime();
for (String mixId : startList) { for (String mixId : startList) {
GoblinMixDetailsVo vo = redisUtils.getMixDetails(mixId); GoblinMixDetailsVo vo = redisUtils.getMixDetails(mixId);
GoblinMixAppListVo itemVo = GoblinMixAppListVo.getNew().copy(vo); GoblinMixAppListVo itemVo = GoblinMixAppListVo.getNew().copy(vo, nowTime);
itemVo.setStatus(6); itemVo.setStatus(6);
voList.add(itemVo); voList.add(itemVo);
} }
for (String mixId : stockList) { for (String mixId : stockList) {
GoblinMixDetailsVo vo = redisUtils.getMixDetails(mixId); GoblinMixDetailsVo vo = redisUtils.getMixDetails(mixId);
GoblinMixAppListVo itemVo = GoblinMixAppListVo.getNew().copy(vo); GoblinMixAppListVo itemVo = GoblinMixAppListVo.getNew().copy(vo, nowTime);
itemVo.setStatus(8); itemVo.setStatus(8);
voList.add(itemVo); voList.add(itemVo);
} }
...@@ -79,11 +68,17 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService { ...@@ -79,11 +68,17 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService {
@Override @Override
public ResponseDto<GoblinMixAppDetailsVo> mixDetails(String mixId) { public ResponseDto<GoblinMixAppDetailsVo> mixDetails(String mixId) {
GoblinMixDetailsVo baseVo = redisUtils.getMixDetails(mixId); GoblinMixDetailsVo baseVo = redisUtils.getMixDetails(mixId);
if(baseVo==null){ if (baseVo == null) {
return ResponseDto.failure("参数异常"); return ResponseDto.failure("参数异常");
} }
GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVo(baseVo.getStoreId()); GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVo(baseVo.getStoreId());
GoblinMixAppDetailsVo vo = GoblinMixAppDetailsVo.getNew().copy(baseVo, storeInfoVo.getStoreName()); GoblinMixAppDetailsVo vo = GoblinMixAppDetailsVo.getNew().copy(baseVo, storeInfoVo.getStoreName());
//获取用户预约情况
//获取udi
String uid = CurrentUtil.getCurrentUid();
if (vo.getReserve() == 1 && uid != null && redisUtils.getReserveMixByUid(uid, mixId) != null) {
vo.setUserReserve(1);
}
int stock = 0; int stock = 0;
for (GoblinMixDetailsItemVo item : vo.getItem()) { for (GoblinMixDetailsItemVo item : vo.getItem()) {
GoblinGoodsSkuInfoVo skuInfoVo = redisUtils.getGoodsSkuInfoVo(item.getSkuId()); GoblinGoodsSkuInfoVo skuInfoVo = redisUtils.getGoodsSkuInfoVo(item.getSkuId());
......
...@@ -72,7 +72,7 @@ public class GoblinJobServiceImpl { ...@@ -72,7 +72,7 @@ public class GoblinJobServiceImpl {
LocalDateTime nt = LocalDateTime.now(); LocalDateTime nt = LocalDateTime.now();
//筛选 活动中 和 活动中且售罄的 //筛选 活动中 和 活动中且售罄的
for (GoblinMixDetailsVo item : nftDetailsList) { for (GoblinMixDetailsVo item : nftDetailsList) {
LocalDateTime st = LocalDateTime.parse(item.getTimeStart(), DTF_YMD_HMS); LocalDateTime st = LocalDateTime.parse(item.getTimeStartOrShelvesTime(item), DTF_YMD_HMS);
LocalDateTime et = LocalDateTime.parse(item.getTimeEnd(), DTF_YMD_HMS); LocalDateTime et = LocalDateTime.parse(item.getTimeEnd(), DTF_YMD_HMS);
if (nt.isAfter(st) && nt.isBefore(et)) {//活动中 if (nt.isAfter(st) && nt.isBefore(et)) {//活动中
int stock = 0; int stock = 0;
...@@ -98,7 +98,8 @@ public class GoblinJobServiceImpl { ...@@ -98,7 +98,8 @@ public class GoblinJobServiceImpl {
} }
for (GoblinMixDetailsVo item : skuDetailsList) { for (GoblinMixDetailsVo item : skuDetailsList) {
LocalDateTime st = LocalDateTime.parse(item.getTimeStart(), DTF_YMD_HMS); //修改开始时间获取 开始时间/上架时间
LocalDateTime st = LocalDateTime.parse(item.getTimeStartOrShelvesTime(item), DTF_YMD_HMS);
LocalDateTime et = LocalDateTime.parse(item.getTimeEnd(), DTF_YMD_HMS); LocalDateTime et = LocalDateTime.parse(item.getTimeEnd(), DTF_YMD_HMS);
if (nt.isAfter(st) && nt.isBefore(et)) {//活动中 if (nt.isAfter(st) && nt.isBefore(et)) {//活动中
int stock = 0; int stock = 0;
......
...@@ -14,6 +14,8 @@ import com.liquidnet.service.goblin.dto.manage.GoblinGoodsAnticipateValueParam; ...@@ -14,6 +14,8 @@ import com.liquidnet.service.goblin.dto.manage.GoblinGoodsAnticipateValueParam;
import com.liquidnet.service.goblin.dto.manage.vo.AnticipateValueVo; import com.liquidnet.service.goblin.dto.manage.vo.AnticipateValueVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo; import com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsAnticipateVo; import com.liquidnet.service.goblin.dto.vo.GoblinGoodsAnticipateVo;
import com.liquidnet.service.goblin.dto.vo.GoblinMixDetailsVo;
import com.liquidnet.service.goblin.dto.vo.GoblinMixReserveVo;
import com.liquidnet.service.goblin.service.manage.IGoblinGoodsAnticipateMgService; import com.liquidnet.service.goblin.service.manage.IGoblinGoodsAnticipateMgService;
import com.liquidnet.service.goblin.util.GoblinAnticipateUtils; import com.liquidnet.service.goblin.util.GoblinAnticipateUtils;
import com.liquidnet.service.goblin.util.GoblinMongoUtils; import com.liquidnet.service.goblin.util.GoblinMongoUtils;
...@@ -30,6 +32,8 @@ import java.util.HashMap; ...@@ -30,6 +32,8 @@ import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
/** /**
* <p> * <p>
* 预约表 服务实现类 * 预约表 服务实现类
......
...@@ -4,18 +4,18 @@ import com.alibaba.fastjson.JSON; ...@@ -4,18 +4,18 @@ import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.CurrentUtil; import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.param.GoblinMixDetailsItemParam; import com.liquidnet.service.goblin.param.GoblinMixDetailsItemParam;
import com.liquidnet.service.goblin.param.GoblinMixDetailsParam; import com.liquidnet.service.goblin.param.GoblinMixDetailsParam;
import com.liquidnet.service.goblin.param.GoblinMixUpdateParam; import com.liquidnet.service.goblin.param.GoblinMixUpdateParam;
import com.liquidnet.service.goblin.service.IGoblinGoodsAnticipateService;
import com.liquidnet.service.goblin.service.manage.IGoblinMixService; import com.liquidnet.service.goblin.service.manage.IGoblinMixService;
import com.liquidnet.service.goblin.util.*; import com.liquidnet.service.goblin.util.*;
import io.github.classgraph.json.JSONUtils;
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.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -141,6 +141,10 @@ public class GoblinMixServiceImpl implements IGoblinMixService { ...@@ -141,6 +141,10 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
item.setSkuSurplusStock(redisUtils.getSkuStock(null, item.getSkuId())); item.setSkuSurplusStock(redisUtils.getSkuStock(null, item.getSkuId()));
} }
} }
//旧数据支持
//上架时间
vo.setShelvesTime(vo.getShelvesTime() != null && !"".equals(vo.getShelvesTime()) ? vo.getShelvesTime() : vo.getTimeStart());
return ResponseDto.success(vo); return ResponseDto.success(vo);
} }
...@@ -150,6 +154,10 @@ public class GoblinMixServiceImpl implements IGoblinMixService { ...@@ -150,6 +154,10 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
List<GoblinMixDetailsItemVo> itemList = ObjectUtil.goblinMixDetailsItemVo(); List<GoblinMixDetailsItemVo> itemList = ObjectUtil.goblinMixDetailsItemVo();
List<GoblinMixDetailsItemParam> itemParams = param.getItem(); List<GoblinMixDetailsItemParam> itemParams = param.getItem();
//开启预约 判断上架时间必须大于开始时间
if (DateUtil.compareStrDay(param.getShelvesTime(), param.getTimeStart()) > 0) {
return ResponseDto.failure("售卖时间不能超过上架时间!");
}
//判断活动名称 //判断活动名称
int count = (int) mongoUtils.getMixNameCount(param.getName()); int count = (int) mongoUtils.getMixNameCount(param.getName());
...@@ -195,7 +203,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService { ...@@ -195,7 +203,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
mixId, uid, vo.getName(), vo.getTimeStart(), vo.getTimeEnd(), 6, vo.getShowPosition(), mixId, uid, vo.getName(), vo.getTimeStart(), vo.getTimeEnd(), 6, vo.getShowPosition(),
vo.getSellName(), vo.getExpressPrice(), vo.getIntro(), vo.getWatchType(), vo.getCoverPic(), vo.getSellName(), vo.getExpressPrice(), vo.getIntro(), vo.getWatchType(), vo.getCoverPic(),
vo.getVideo(), vo.getDetailUrl(), vo.getDetails(), vo.getStock(), vo.getStockLock(), vo.getVideo(), vo.getDetailUrl(), vo.getDetails(), vo.getStock(), vo.getStockLock(),
vo.getIsLock(), vo.getLimit(), vo.getWhiteType(), vo.getWhiteUrl(), vo.getPayType(), vo.getStoreId(), LocalDateTime.now() vo.getIsLock(), vo.getLimit(), vo.getWhiteType(), vo.getWhiteUrl(), vo.getPayType(), vo.getStoreId(), LocalDateTime.now(), vo.getShelvesTime(), vo.getReserve()
}); });
//设置redis //设置redis
redisUtils.setMixDetails(mixId, vo); redisUtils.setMixDetails(mixId, vo);
...@@ -215,6 +223,11 @@ public class GoblinMixServiceImpl implements IGoblinMixService { ...@@ -215,6 +223,11 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
GoblinMixDetailsVo vo = redisUtils.getMixDetails(param.getMixId()); GoblinMixDetailsVo vo = redisUtils.getMixDetails(param.getMixId());
String oldWhiteUrl = vo.getWhiteUrl(); String oldWhiteUrl = vo.getWhiteUrl();
//开启预约 判断上架时间必须大于开始时间
if (DateUtil.compareStrDay(param.getShelvesTime(), vo.getTimeStart()) > 0) {
return ResponseDto.failure("售卖时间不能超过上架时间!");
}
if (!vo.getUserId().equals(uid)) { if (!vo.getUserId().equals(uid)) {
return ResponseDto.failure("身份异常"); return ResponseDto.failure("身份异常");
} }
...@@ -235,6 +248,8 @@ public class GoblinMixServiceImpl implements IGoblinMixService { ...@@ -235,6 +248,8 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
vo.setWhiteType(param.getWhiteType()); vo.setWhiteType(param.getWhiteType());
vo.setWhiteUrl(param.getWhiteUrl()); vo.setWhiteUrl(param.getWhiteUrl());
vo.setXlsName(param.getXlsName()); vo.setXlsName(param.getXlsName());
vo.setShelvesTime(param.getShelvesTime());
vo.setReserve(param.getReserve());
//redis //redis
redisUtils.setMixDetails(param.getMixId(), vo); redisUtils.setMixDetails(param.getMixId(), vo);
redisList(vo.getShowPosition(), vo.getMixId(), vo.getStatus()); redisList(vo.getShowPosition(), vo.getMixId(), vo.getStatus());
...@@ -245,7 +260,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService { ...@@ -245,7 +260,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
mongoUtils.changeGoblinMixDetailsVo(vo); mongoUtils.changeGoblinMixDetailsVo(vo);
//sql入库 //sql入库
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_STORE_MARKET.getKey(), queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_STORE_MARKET.getKey(),
SqlMapping.get("goblin_mix_update", vo.getShowPosition(), vo.getLimit(), vo.getWhiteType(), vo.getWhiteUrl(), LocalDateTime.now(), param.getMixId())); SqlMapping.get("goblin_mix_update", vo.getShowPosition(), vo.getLimit(), vo.getWhiteType(), vo.getWhiteUrl(), LocalDateTime.now(), vo.getShelvesTime(), vo.getReserve(), param.getMixId()));
return ResponseDto.success(); return ResponseDto.success();
} }
......
...@@ -2597,6 +2597,24 @@ public class GoblinRedisUtils { ...@@ -2597,6 +2597,24 @@ public class GoblinRedisUtils {
mixIds.add(mixId); mixIds.add(mixId);
setGoblinMixSkuStartList(mixIds); setGoblinMixSkuStartList(mixIds);
} }
//保存用户预约
public void setReserveMixByUid(GoblinMixReserveVo goblinMixReserveVo) {
String rdk = GoblinRedisConst.GOBLIN_MIX_RESERVE_UID.concat(goblinMixReserveVo.getMixId()).concat(":").concat(goblinMixReserveVo.getUid());
redisUtil.set(rdk,goblinMixReserveVo);
}
//根据用户uid和混合mixId查询用户预约
public GoblinMixReserveVo getReserveMixByUid(String uid, String mixId) {
Object obj = redisUtil.get(GoblinRedisConst.GOBLIN_MIX_RESERVE_UID.concat(mixId).concat(":").concat(uid));
if (obj == null) {
return null;
} else {
return (GoblinMixReserveVo) obj;
}
}
/* ---------------------------------------- ---------------------------------------- */ /* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */ /* ---------------------------------------- ---------------------------------------- */
} }
...@@ -142,6 +142,7 @@ goblin_goods_anticipate_help=INSERT INTO goblin_goods_anticipate_help(sid,help_u ...@@ -142,6 +142,7 @@ goblin_goods_anticipate_help=INSERT INTO goblin_goods_anticipate_help(sid,help_u
goblin_goods_anticipate_share=INSERT INTO goblin_goods_anticipate_share(sid,uid,sku_id,created_date) VALUES(?,?,?,?) goblin_goods_anticipate_share=INSERT INTO goblin_goods_anticipate_share(sid,uid,sku_id,created_date) VALUES(?,?,?,?)
goblin_goods_anticipate_user_update=UPDATE goblin_goods_anticipate_user SET state = 1 WHERE uid = ? AND sku_id = ? goblin_goods_anticipate_user_update=UPDATE goblin_goods_anticipate_user SET state = 1 WHERE uid = ? AND sku_id = ?
goblin_goods_anticipate_user_update_sku=UPDATE goblin_goods_anticipate_user SET state = 1 WHERE sku_id = ? goblin_goods_anticipate_user_update_sku=UPDATE goblin_goods_anticipate_user SET state = 1 WHERE sku_id = ?
goblin_goods_anticipate_mix=INSERT INTO goblin_goods_anticipate_mix ( mid, uid, phone, mix_id, state, created_date ) VALUES(?,?,?,?,0,NOW())
#---- \u4E1A\u52A1\u8D26\u53F7\u8BB0\u5F55 #---- \u4E1A\u52A1\u8D26\u53F7\u8BB0\u5F55
adam_user_busi_acct.add=INSERT INTO adam_user_busi_acct (`uid`, busi, uuid, `work`, ppwd, `state`, created_at) VALUES (?,?,?,?,?,?,?) adam_user_busi_acct.add=INSERT INTO adam_user_busi_acct (`uid`, busi, uuid, `work`, ppwd, `state`, created_at) VALUES (?,?,?,?,?,?,?)
#---- \u9ED1\u767D\u540D\u5355 ---- #---- \u9ED1\u767D\u540D\u5355 ----
...@@ -149,8 +150,8 @@ goblin_list_insert=INSERT INTO goblin_list (`list_id`,`uid`,`name`,`white_type`, ...@@ -149,8 +150,8 @@ goblin_list_insert=INSERT INTO goblin_list (`list_id`,`uid`,`name`,`white_type`,
goblin_list_detail_insert=INSERT INTO goblin_list_details (`list_id`,`spu_id`,`sku_id`,`created_at`,`sku_stock`,`price_v`,`product_id`,`price`) VALUES (?,?,?,?,?,?,?,?) goblin_list_detail_insert=INSERT INTO goblin_list_details (`list_id`,`spu_id`,`sku_id`,`created_at`,`sku_stock`,`price_v`,`product_id`,`price`) VALUES (?,?,?,?,?,?,?,?)
goblin_list_update=UPDATE goblin_list SET white_url = ? ,white_type = ? , black_url = ? , updated_at = ? WHERE list_id = ? goblin_list_update=UPDATE goblin_list SET white_url = ? ,white_type = ? , black_url = ? , updated_at = ? WHERE list_id = ?
goblin_list_remove=UPDATE goblin_list set del_tag = 1 , updated_at = ? WHERE list_id = ? goblin_list_remove=UPDATE goblin_list set del_tag = 1 , updated_at = ? WHERE list_id = ?
#---- 混合售卖 ---- #---- \u6DF7\u5408\u552E\u5356 ----
goblin_mix_insert=INSERT INTO goblin_mix (`mix_id`,`uid`,`name`,`time_start`,`time_end`,`status`,`show_position`,`sell_name`,`express_price`,`intro`,`watch_type`,`cover_pic`,`video`,`detail_url`,`details`,`stock`,`stock_lock`,`is_lock`,`limit`,`white_type`,`white_url`,`pay_type`,`store_id`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) goblin_mix_insert=INSERT INTO goblin_mix (`mix_id`,`uid`,`name`,`time_start`,`time_end`,`status`,`show_position`,`sell_name`,`express_price`,`intro`,`watch_type`,`cover_pic`,`video`,`detail_url`,`details`,`stock`,`stock_lock`,`is_lock`,`limit`,`white_type`,`white_url`,`pay_type`,`store_id`,`created_at`,`shelves_time`,`reserve`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_mix_details_insert=INSERT INTO goblin_mix_details (`mix_id`,`position`,`spu_id`,`sku_id`,`price`,`price_v`,`product_id`,`count`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?) goblin_mix_details_insert=INSERT INTO goblin_mix_details (`mix_id`,`position`,`spu_id`,`sku_id`,`price`,`price_v`,`product_id`,`count`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?)
goblin_mix_status_update=UPDATE goblin_mix SET status = ? , updated_at = ? WHERE mix_id = ? goblin_mix_status_update=UPDATE goblin_mix SET status = ? , updated_at = ? WHERE mix_id = ?
goblin_mix_update=UPDATE goblin_mix SET show_position = ? , `limit`=?,white_type=?,white_url=? , updated_at = ? WHERE mix_id = ? goblin_mix_update=UPDATE goblin_mix SET show_position = ? , `limit`=?,white_type=?,white_url=? , updated_at = ?,shelves_time = ?,reserve = ? WHERE mix_id = ?
\ No newline at end of file \ No newline at end of file
...@@ -652,8 +652,10 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -652,8 +652,10 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
// 获取限购 实名 // 获取限购 实名
int ticketLimit = ticketData.getLimitCount();//普通票种限购 int ticketLimit = ticketData.getLimitCount();//普通票种限购
int ticketMemberLimit = ticketData.getLimitCountMember();//会员票种限购 int ticketMemberLimit = ticketData.getLimitCountMember();//会员票种限购
int ticketIdCount = ticketData.getIdCount();//实名票种限购
int performanceLimit = performanceData.getLimitCount();//普通演出限购 int performanceLimit = performanceData.getLimitCount();//普通演出限购
int performanceMemberLimit = performanceData.getLimitCountMember();//会员演出限购 int performanceMemberLimit = 1;//会员演出限购
int performanceIdCount = performanceData.getIdCount();//实名演出限购
int isTrueName = ticketData.getIsTrueName();//是否演出实名 int isTrueName = ticketData.getIsTrueName();//是否演出实名
//实名判断 //实名判断
...@@ -688,14 +690,20 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -688,14 +690,20 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
//限购判断 如果实名 则身份证维度限购 如果不实名则数量限购 //限购判断 如果实名 则身份证维度限购 如果不实名则数量限购
if (entersVoList.size() > 0) { if (entersVoList.size() > 0) {
for (int i = 0; i < entersVoList.size(); i++) { for (int i = 0; i < entersVoList.size(); i++) {
String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, entersVoList.get(i).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, 1, 1, 0, isTrueName); dataUtils.changeBuyInfo(uid, entersVoList.get(i).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), 1);
String res1 = orderUtils.judgeOrderLimit(uid, entersVoList.get(i).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), performanceLimit, performanceMemberLimit, performanceIdCount, ticketLimit, ticketMemberLimit, ticketIdCount, 0, isTrueName);
if (!res1.equals("")) { if (!res1.equals("")) {
for (int x = 0; x <= i; x++) {
dataUtils.changeBuyInfo(uid, entersVoList.get(x).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), -1);
}
return ResponseDto.failure(res1);//乱七八糟异常 return ResponseDto.failure(res1);//乱七八糟异常
} }
} }
} else { } else {
String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, orderTicketVo.getNumber(), orderTicketVo.getNumber(), 0, isTrueName); dataUtils.changeBuyInfo(uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), orderTicketVo.getNumber());
String res1 = orderUtils.judgeOrderLimit(uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), performanceLimit, performanceMemberLimit, performanceIdCount, ticketLimit, ticketMemberLimit, ticketIdCount, 0, isTrueName);
if (!res1.equals("")) { if (!res1.equals("")) {
dataUtils.changeBuyInfo(uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), -orderTicketVo.getNumber());
return ResponseDto.failure(res1);//乱七八糟异常 return ResponseDto.failure(res1);//乱七八糟异常
} }
} }
...@@ -831,7 +839,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -831,7 +839,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
orderTicketEntitiesVo.setUpdatedAt(null); orderTicketEntitiesVo.setUpdatedAt(null);
orderTicketEntitiesVo.setChangeDate(orderTicketEntities.getCreatedAt()); orderTicketEntitiesVo.setChangeDate(orderTicketEntities.getCreatedAt());
mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName()); mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName());
dataUtils.changeBuyInfo(orderTicketEntitiesVo.getUserId(), orderTicketEntitiesVo.getEnterIdCode(), orderTicketEntitiesVo.getPerformanceId(), orderTicketEntitiesVo.getTicketId(), 1); // dataUtils.changeBuyInfo(orderTicketEntitiesVo.getUserId(), orderTicketEntitiesVo.getEnterIdCode(), orderTicketEntitiesVo.getPerformanceId(), orderTicketEntitiesVo.getTicketId(), 1);
} }
orderTickets.setPayType(orderTicketVo.getPayType()); orderTickets.setPayType(orderTicketVo.getPayType());
......
...@@ -975,25 +975,36 @@ public class DataUtils { ...@@ -975,25 +975,36 @@ public class DataUtils {
} }
public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) { public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) {
String redisKey; String redisKeyUid;
String redisKeyIdCard;
String performanceIdKeyIdCard="";
String ticketIdKeyIdCard="";
int isTrueName = getPerformanceIsTrueName(performanceId); int isTrueName = getPerformanceIsTrueName(performanceId);
if (0 == isTrueName) { redisKeyUid = KylinRedisConst.USERID_BUY_INFO + userId;
redisKey = KylinRedisConst.USERID_BUY_INFO + userId; redisKeyIdCard = KylinRedisConst.IDCARD_BUY_INFO + idCard;
} else { String performanceIdKeyUid = redisKeyUid + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard; String ticketIdKeyUid = redisKeyUid + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
if (isTrueName != 0) {
performanceIdKeyIdCard = redisKeyIdCard + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
ticketIdKeyIdCard = redisKeyIdCard + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
} }
String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
if (buyCount > 0) { if (buyCount > 0) {
redisUtil.incr(ticketIdKey, buyCount); redisUtil.incr(ticketIdKeyUid, buyCount);
redisUtil.incr(performanceIdKey, buyCount); redisUtil.incr(performanceIdKeyUid, buyCount);
if (isTrueName != 0) {
redisUtil.incr(ticketIdKeyIdCard, buyCount);
redisUtil.incr(performanceIdKeyIdCard, buyCount);
}
} else { } else {
redisUtil.decr(ticketIdKey, Math.abs(buyCount)); if (isTrueName != 0) {
redisUtil.decr(performanceIdKey, Math.abs(buyCount)); redisUtil.decr(ticketIdKeyIdCard, Math.abs(buyCount));
redisUtil.decr(performanceIdKeyIdCard, Math.abs(buyCount));
}
redisUtil.decr(ticketIdKeyUid, Math.abs(buyCount));
redisUtil.decr(performanceIdKeyUid, Math.abs(buyCount));
} }
} }
......
...@@ -31,93 +31,102 @@ public class OrderUtils { ...@@ -31,93 +31,102 @@ public class OrderUtils {
public String judgeOrderLimit( public String judgeOrderLimit(
int type,
String userId, String userId,
String idCard, String idCard,
String performanceId, String performanceId,
String ticketId, String ticketId,
int performanceLimitCount, int performanceLimitCount,
int performanceMemberLimitCount, int performanceMemberLimitCount,
int performanceLimitIdCard,
int ticketLimitCount, int ticketLimitCount,
int ticketMemberLimitCount, int ticketMemberLimitCount,
int performanceBuyCount, int ticketLimitIdCard,
int ticketBuyCount,
int memberType, int memberType,
int isTrueName int isTrueName
) { ) {
Integer[] integers; Integer[] integers = orderLimit(userId, idCard, performanceId, ticketId, isTrueName);
if (101 == type) { return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, performanceLimitIdCard,
integers = festivalOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName); ticketLimitCount, ticketMemberLimitCount, ticketLimitIdCard,
} else { memberType, integers[0], integers[1], integers[2], integers[3], isTrueName);
integers = roadShowOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName);
}
return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, ticketLimitCount, ticketMemberLimitCount, memberType, integers[0], integers[1], isTrueName);
} }
public Integer[] roadShowOrderLimit( public Integer[] orderLimit(
String userId, String userId,
String idCard, String idCard,
String performanceId, String performanceId,
String ticketId, String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName int isTrueName
) { ) {
if (1 == isTrueName) {//实名 int performanceBuyCountUid = 0;
performanceBuyCount += dataUtils.getIdCardPBuyCount(idCard, performanceId); int ticketBuyCountUid = 0;
ticketBuyCount += dataUtils.getIdCardTBuyCount(idCard, ticketId); int performanceBuyCountIdCard = 0;
} else {//非实名 int ticketBuyCountIdCard = 0;
performanceBuyCount += dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount += dataUtils.getUserTBuyCount(userId, ticketId);
}
Integer[] array = new Integer[2];
array[0] = performanceBuyCount;
array[1] = ticketBuyCount;
return array;
}
public Integer[] festivalOrderLimit(
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName
) {
if (1 == isTrueName) {//实名 if (1 == isTrueName) {//实名
performanceBuyCount += dataUtils.getIdCardPBuyCount(idCard, performanceId); performanceBuyCountIdCard = dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCount += dataUtils.getIdCardTBuyCount(idCard, ticketId); ticketBuyCountIdCard = dataUtils.getIdCardTBuyCount(idCard, ticketId);
performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
} else {//非实名 } else {//非实名
performanceBuyCount += dataUtils.getUserPBuyCount(userId, performanceId); performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount += dataUtils.getUserTBuyCount(userId, ticketId); ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
} }
Integer[] array = new Integer[2]; Integer[] array = new Integer[4];
array[0] = performanceBuyCount; array[0] = performanceBuyCountUid;
array[1] = ticketBuyCount; array[1] = ticketBuyCountUid;
array[2] = performanceBuyCountIdCard;
array[3] = ticketBuyCountIdCard;
return array; return array;
} }
public String judgeMemberType(int performanceLimitCount, int performanceMemberLimitCount, int ticketLimitCount, int ticketMemberLimitCount, int memberType, int performanceBuyCount, int ticketBuyCount, int isTrueName) { public String judgeMemberType(int performanceLimitCount, int performanceMemberLimitCount, int performanceLimitIdCard,
int ticketLimitCount, int ticketMemberLimitCount, int ticketLimitIdCard, int memberType,
int performanceBuyCountUid, int ticketBuyCountUid, int performanceBuyCountIdCard, int ticketBuyCountIdCard, int isTrueName) {
if (memberType == 1 || memberType == 2) { if (memberType == 1 || memberType == 2) {
if (performanceBuyCount > performanceMemberLimitCount && performanceMemberLimitCount != 0) { if (isTrueName == 1) {
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量 if (performanceBuyCountIdCard > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
} return "实名制演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
if (ticketBuyCount > ticketMemberLimitCount && ticketMemberLimitCount != 0) { }
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量 if (ticketBuyCountIdCard > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "实名制票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
} else {
if (performanceBuyCountUid > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return "本场演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountUid > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "该票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
} }
} else {//非会员区间 } else {//非会员区间
if (performanceBuyCount > performanceLimitCount && performanceLimitCount != 0) { if (isTrueName == 1) {
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量 if (performanceBuyCountUid > performanceLimitCount && performanceLimitCount != 0) {
} return "本场演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量
if (ticketBuyCount > ticketLimitCount && ticketLimitCount != 0) { }
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketLimitCount + "张,已超出";//超过票维度购买量 if (ticketBuyCountUid > ticketLimitCount && ticketLimitCount != 0) {
return "该票种限购" + ticketLimitCount + "张,已超出";//超过演出维度购买量
}
if (performanceBuyCountIdCard > performanceLimitIdCard && performanceLimitIdCard != 0) {
return "实名制演出限购" + performanceLimitIdCard + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountIdCard > ticketLimitIdCard && ticketLimitIdCard != 0) {
return "实名制票种限购" + ticketLimitIdCard + "张,已超出";//超过演出维度购买量
}
} else {
if (performanceBuyCountUid > performanceLimitCount && performanceLimitCount != 0) {
return "本场演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountUid > ticketLimitCount && ticketLimitCount != 0) {
return "该票种限购" + ticketLimitCount + "张,已超出";//超过演出维度购买量
}
} }
} }
return ""; return "";
} }
/** /**
* @param userId 用户id * @param userId 用户id
* @param type 1新增 2修改 * @param type 1新增 2修改
...@@ -184,7 +193,7 @@ public class OrderUtils { ...@@ -184,7 +193,7 @@ public class OrderUtils {
public List<AdamEntersVo> getEnters(String entersIds, String uid) { public List<AdamEntersVo> getEnters(String entersIds, String uid) {
MultiValueMap<String, String> headers = CollectionUtil.linkedMultiValueMapStringString(); MultiValueMap<String, String> headers = CollectionUtil.linkedMultiValueMapStringString();
headers.add("Accept", "application/json;charset=UTF-8"); headers.add("Accept", "application/json;charset=UTF-8");
String returnVo = HttpUtil.get( adamUrl+ "/adam/rsc/inquire/enters?entersIds=" + entersIds + "&uid=" + uid, null, headers); String returnVo = HttpUtil.get(adamUrl + "/adam/rsc/inquire/enters?entersIds=" + entersIds + "&uid=" + uid, null, headers);
ResponseDto<List<AdamEntersVo>> ResponseVo = JsonUtils.fromJson(returnVo, new TypeReference<ResponseDto<List<AdamEntersVo>>>() { ResponseDto<List<AdamEntersVo>> ResponseVo = JsonUtils.fromJson(returnVo, new TypeReference<ResponseDto<List<AdamEntersVo>>>() {
}); });
return ResponseVo.getData(); return ResponseVo.getData();
......
...@@ -98,6 +98,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -98,6 +98,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
public ResponseDto<PayInnerResultVo> checkCanOrder(PayOrderParam payOrderParam) { public ResponseDto<PayInnerResultVo> checkCanOrder(PayOrderParam payOrderParam) {
boolean isDownGeneral = false; boolean isDownGeneral = false;
boolean isPay = true; boolean isPay = true;
boolean useAdvance = false;
String performanceId = "";
List<AdamEntersVo> entersVoList = ObjectUtil.cloneArrayListObject(); List<AdamEntersVo> entersVoList = ObjectUtil.cloneArrayListObject();
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
HashMap<String, Object> advanceMap = null; HashMap<String, Object> advanceMap = null;
...@@ -128,7 +130,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -128,7 +130,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
break; break;
} }
} }
performanceId = performanceData.getPerformancesId();
if (ticketTimesData == null || ticketData == null) { if (ticketTimesData == null || ticketData == null) {
return ResponseDto.failure(ErrorMapping.get("20004"));//参数错误 return ResponseDto.failure(ErrorMapping.get("20004"));//参数错误
} }
...@@ -204,9 +206,14 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -204,9 +206,14 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
} }
int memberType; //会员状态 不需要判断会员 1判断会员逻辑 2会员专属 int memberType; //会员状态 不需要判断会员 1判断会员逻辑 2会员专属
if (DateUtil.compareStrDay(DateUtil.getNowTime(), memberTimeStart) == 1 && DateUtil.compareStrDay(DateUtil.getNowTime(), timeStart) == -1){//优先时间 if (DateUtil.compareStrDay(DateUtil.getNowTime(), memberTimeStart) == 1 && DateUtil.compareStrDay(DateUtil.getNowTime(), timeStart) == -1) {//优先时间
if(payOrderParam.getNumber()>2){ if (payOrderParam.getNumber() > ticketData.getCounts()) {
return ResponseDto.failure("非法下单"); return ResponseDto.failure("优先购时段内,本场演出限购"+ticketData.getCounts()+"张");
}
int advanceCount = dataUtils.incrUseMemberCount(uid, performanceData.getPerformancesId());
if (advanceCount > 1) {//todo
dataUtils.decrUseMemberCount(uid, performanceData.getPerformancesId());
return ResponseDto.failure("本场演出限用1张优先券,已超出");
} }
} }
if (ticketData.getIsExclusive() == 1) { if (ticketData.getIsExclusive() == 1) {
...@@ -230,9 +237,10 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -230,9 +237,10 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
// 获取限购 实名 // 获取限购 实名
int ticketLimit = ticketData.getLimitCount();//普通票种限购 int ticketLimit = ticketData.getLimitCount();//普通票种限购
int ticketMemberLimit = ticketData.getLimitCountMember();//会员票种限购 int ticketMemberLimit = ticketData.getLimitCountMember();//会员票种限购
int ticketIdCount = ticketData.getIdCount();//实名票种限购
int performanceLimit = performanceData.getLimitCount();//普通演出限购 int performanceLimit = performanceData.getLimitCount();//普通演出限购
// int performanceMemberLimit = performanceData.getLimitCountMember();//会员演出限购
int performanceMemberLimit = 1;//会员演出限购 int performanceMemberLimit = 1;//会员演出限购
int performanceIdCount = performanceData.getIdCount();//实名演出限购
int isTrueName = ticketData.getIsTrueName();//是否演出实名 int isTrueName = ticketData.getIsTrueName();//是否演出实名
if (!canBuyStatus.contains(performanceData.getAppStatus())) { if (!canBuyStatus.contains(performanceData.getAppStatus())) {
...@@ -266,6 +274,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -266,6 +274,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid); orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid);
return ResponseDto.failure("优先券该演出不可用"); return ResponseDto.failure("优先券该演出不可用");
} }
int couponCount = dataUtils.incrUseCouponCount(uid, performanceData.getPerformancesId());
useAdvance = true;
if (couponCount > 1) {//todo
useAdvance = false;
dataUtils.decrUseCouponCount(uid, performanceData.getPerformancesId());
return ResponseDto.failure("本场演出限用1张优先券,已超出");
}
} }
} }
} }
...@@ -345,7 +360,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -345,7 +360,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if (entersVoList.size() > 0) { if (entersVoList.size() > 0) {
for (int i = 0; i < entersVoList.size(); i++) { for (int i = 0; i < entersVoList.size(); i++) {
dataUtils.changeBuyInfo(uid, entersVoList.get(i).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), 1); dataUtils.changeBuyInfo(uid, entersVoList.get(i).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), 1);
String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, entersVoList.get(i).getIdCard(), payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, 1, 1, memberType, isTrueName); String res1 = orderUtils.judgeOrderLimit(uid, entersVoList.get(i).getIdCard(), payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), performanceLimit, performanceMemberLimit, performanceIdCount, ticketLimit, ticketMemberLimit, ticketIdCount, memberType, isTrueName);
if (!res1.equals("")) { if (!res1.equals("")) {
for (int x = 0; x <= i; x++) { for (int x = 0; x <= i; x++) {
dataUtils.changeBuyInfo(uid, entersVoList.get(x).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), -1); dataUtils.changeBuyInfo(uid, entersVoList.get(x).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), -1);
...@@ -357,7 +372,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -357,7 +372,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
} }
} else { } else {
dataUtils.changeBuyInfo(uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), payOrderParam.getNumber()); dataUtils.changeBuyInfo(uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), payOrderParam.getNumber());
String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, "", payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, payOrderParam.getNumber(), payOrderParam.getNumber(), memberType, isTrueName); String res1 = orderUtils.judgeOrderLimit(uid, "", payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), performanceLimit, performanceMemberLimit, performanceIdCount, ticketLimit, ticketMemberLimit, ticketIdCount, memberType, isTrueName);
if (!res1.equals("")) { if (!res1.equals("")) {
dataUtils.changeBuyInfo(uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), -payOrderParam.getNumber()); dataUtils.changeBuyInfo(uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), -payOrderParam.getNumber());
orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), payOrderParam.getNumber()); orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), payOrderParam.getNumber());
...@@ -376,6 +391,9 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -376,6 +391,9 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), payOrderParam.getNumber()); orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), payOrderParam.getNumber());
log.error("回滚库存"); log.error("回滚库存");
orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid); orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid);
if (useAdvance) {
dataUtils.decrUseCouponCount(uid, performanceId);
}
for (AdamEntersVo enters : entersVoList) { for (AdamEntersVo enters : entersVoList) {
dataUtils.changeBuyInfo(uid, enters.getIdCard(), payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), -1); dataUtils.changeBuyInfo(uid, enters.getIdCard(), payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), -1);
} }
......
...@@ -123,44 +123,38 @@ public class DataUtils { ...@@ -123,44 +123,38 @@ public class DataUtils {
* @param buyCount 购买数量 大于 0 增加 小于 0 减少 对应 支付 退款表 * @param buyCount 购买数量 大于 0 增加 小于 0 减少 对应 支付 退款表
*/ */
public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) { public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) {
String redisKey; String redisKeyUid;
String redisKeyIdCard;
String performanceIdKeyIdCard="";
String ticketIdKeyIdCard="";
int isTrueName = getPerformanceIsTrueName(performanceId); int isTrueName = getPerformanceIsTrueName(performanceId);
// String useTime = "";
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>();
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
// KylinTicketTimesVo timeItem = vo.getTicketTimeList().get(x);
// ArrayList<String> ticketList = ObjectUtil.cloneArrayListString();
// for (int y = 0; y < timeItem.getTicketList().size(); y++) {
// KylinTicketVo ticketItem = timeItem.getTicketList().get(y);
// if (ticketItem.getType() == 1) {
// ticketList.add(ticketItem.getTicketsId());
// }
// if (ticketItem.getTicketsId().equals(ticketId)) {
// useTime = ticketItem.getUseStart();
// }
// }
// allTicketId.put(timeItem.getUseStart(), ticketList);
// }
if (0 == isTrueName) { redisKeyUid = KylinRedisConst.USERID_BUY_INFO + userId;
redisKey = KylinRedisConst.USERID_BUY_INFO + userId; redisKeyIdCard = KylinRedisConst.IDCARD_BUY_INFO + idCard;
} else { String performanceIdKeyUid = redisKeyUid + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard; String ticketIdKeyUid = redisKeyUid + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
if (isTrueName != 0) {
performanceIdKeyIdCard = redisKeyIdCard + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
ticketIdKeyIdCard = redisKeyIdCard + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
} }
String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
// String ticketUseTimeKey = ticketIdKey + ":" + KylinRedisConst.USE_TIME;
// redisUtil.set(ticketUseTimeKey, useTime);
if (buyCount > 0) { if (buyCount > 0) {
redisUtil.incr(ticketIdKey, buyCount); redisUtil.incr(ticketIdKeyUid, buyCount);
redisUtil.incr(performanceIdKey, buyCount); redisUtil.incr(performanceIdKeyUid, buyCount);
if (isTrueName != 0) {
redisUtil.incr(ticketIdKeyIdCard, buyCount);
redisUtil.incr(performanceIdKeyIdCard, buyCount);
}
} else { } else {
redisUtil.decr(ticketIdKey, Math.abs(buyCount)); if (isTrueName != 0) {
redisUtil.decr(performanceIdKey, Math.abs(buyCount)); redisUtil.decr(ticketIdKeyIdCard, Math.abs(buyCount));
redisUtil.decr(performanceIdKeyIdCard, Math.abs(buyCount));
}
redisUtil.decr(ticketIdKeyUid, Math.abs(buyCount));
redisUtil.decr(performanceIdKeyUid, Math.abs(buyCount));
} }
} }
...@@ -293,16 +287,16 @@ public class DataUtils { ...@@ -293,16 +287,16 @@ public class DataUtils {
String redisKey = KylinRedisConst.ADAM_IS_MEMBER String redisKey = KylinRedisConst.ADAM_IS_MEMBER
.concat(uid); .concat(uid);
Object obj = redisUtil.get(redisKey); Object obj = redisUtil.get(redisKey);
if(obj==null){ if (obj == null) {
return null; return null;
}else{ } else {
return (Integer) obj; return (Integer) obj;
} }
} }
// 获取快递价格 // 获取快递价格
public BigDecimal getExpressPrice(String adCode, String productCode){ public BigDecimal getExpressPrice(String adCode, String productCode) {
BigDecimal price ; BigDecimal price;
Object obj = redisUtil.get(KylinRedisConst.RETURN_ADDRESS_CODE + adCode + KylinRedisConst.EXPRESS_TYPE + productCode); Object obj = redisUtil.get(KylinRedisConst.RETURN_ADDRESS_CODE + adCode + KylinRedisConst.EXPRESS_TYPE + productCode);
if (obj != null) { if (obj != null) {
KylinFreightChargeDao k = (KylinFreightChargeDao) obj; KylinFreightChargeDao k = (KylinFreightChargeDao) obj;
...@@ -321,9 +315,9 @@ public class DataUtils { ...@@ -321,9 +315,9 @@ public class DataUtils {
public String getTicketPayTxt(String ticketId) { public String getTicketPayTxt(String ticketId) {
String rdsKey = KylinRedisConst.TICKET_PAY_TXT.concat(ticketId); String rdsKey = KylinRedisConst.TICKET_PAY_TXT.concat(ticketId);
Object obj = redisUtil.get(rdsKey); Object obj = redisUtil.get(rdsKey);
if(obj==null){ if (obj == null) {
return ""; return "";
}else{ } else {
return (String) obj; return (String) obj;
} }
} }
...@@ -338,4 +332,44 @@ public class DataUtils { ...@@ -338,4 +332,44 @@ public class DataUtils {
return (List<String>) obj; return (List<String>) obj;
} }
} }
public int incrUseCouponCount(String uid, String performanceId) {
String rdk = KylinRedisConst.COUPON_COUNT.concat(uid).concat(":").concat(performanceId);
return (int) redisUtil.incr(rdk, 1);
}
public int decrUseCouponCount(String uid, String performanceId) {
String rdk = KylinRedisConst.COUPON_COUNT.concat(uid).concat(":").concat(performanceId);
return (int) redisUtil.decr(rdk, 1);
}
public int incrUseMemberCount(String uid, String performanceId) {
String rdk = KylinRedisConst.MEMBER_COUNT.concat(uid).concat(":").concat(performanceId);
return (int) redisUtil.incr(rdk, 1);
}
public int decrUseMemberCount(String uid, String performanceId) {
String rdk = KylinRedisConst.MEMBER_COUNT.concat(uid).concat(":").concat(performanceId);
return (int) redisUtil.decr(rdk, 1);
}
// public int getUseCouponCount(String uid,String performanceId){
// String rdk = KylinRedisConst.COUPON_COUNT.concat(uid).concat(":").concat(performanceId);
// Object obj = redisUtil.get(rdk);
// if(obj==null){
// return 0;
// }else{
// return (int) obj;
// }
// }
public int getUseCouponCount(String uid, String performanceId) {
String rdk = KylinRedisConst.COUPON_COUNT.concat(uid).concat(":").concat(performanceId);
Object obj = redisUtil.get(rdk);
if (obj == null) {
return 0;
} else {
return (int) obj;
}
}
} }
...@@ -44,98 +44,98 @@ public class OrderUtils { ...@@ -44,98 +44,98 @@ public class OrderUtils {
private String candyUrl; private String candyUrl;
@Value("${liquidnet.service.smile.url}") @Value("${liquidnet.service.smile.url}")
private String smile; private String smile;
@Value("${liquidnet.service.stone.url}")
private String stoneUrl;
public String judgeOrderLimit( public String judgeOrderLimit(
int type,
String userId, String userId,
String idCard, String idCard,
String performanceId, String performanceId,
String ticketId, String ticketId,
int performanceLimitCount, int performanceLimitCount,
int performanceMemberLimitCount, int performanceMemberLimitCount,
int performanceLimitIdCard,
int ticketLimitCount, int ticketLimitCount,
int ticketMemberLimitCount, int ticketMemberLimitCount,
int performanceBuyCount, int ticketLimitIdCard,
int ticketBuyCount,
int memberType, int memberType,
int isTrueName int isTrueName
) { ) {
Integer[] integers; Integer[] integers = orderLimit(userId, idCard, performanceId, ticketId, isTrueName);
if (101 == type) { return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, performanceLimitIdCard,
integers = festivalOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName); ticketLimitCount, ticketMemberLimitCount,ticketLimitIdCard,
} else { memberType, integers[0], integers[1], integers[2], integers[3], isTrueName);
integers = roadShowOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName);
}
log.debug("演出购买数量=" + integers[0]);
log.debug("票种购买数量=" + integers[1]);
return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, ticketLimitCount, ticketMemberLimitCount, memberType, integers[0], integers[1], isTrueName);
} }
public Integer[] roadShowOrderLimit( public Integer[] orderLimit(
String userId, String userId,
String idCard, String idCard,
String performanceId, String performanceId,
String ticketId, String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName int isTrueName
) { ) {
if (1 == isTrueName) {//实名 int performanceBuyCountUid = 0;
performanceBuyCount = dataUtils.getIdCardPBuyCount(idCard, performanceId); int ticketBuyCountUid = 0;
ticketBuyCount = dataUtils.getIdCardTBuyCount(idCard, ticketId); int performanceBuyCountIdCard = 0;
} else {//非实名 int ticketBuyCountIdCard = 0;
performanceBuyCount = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount = dataUtils.getUserTBuyCount(userId, ticketId);
}
Integer[] array = ObjectUtil.cloneInteger2Array();
array[0] = performanceBuyCount;
array[1] = ticketBuyCount;
return array;
}
public Integer[] festivalOrderLimit(
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName
) {
if (1 == isTrueName) {//实名 if (1 == isTrueName) {//实名
performanceBuyCount = dataUtils.getIdCardPBuyCount(idCard, performanceId); performanceBuyCountIdCard = dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCount = dataUtils.getIdCardTBuyCount(idCard, ticketId); ticketBuyCountIdCard = dataUtils.getIdCardTBuyCount(idCard, ticketId);
performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
} else {//非实名 } else {//非实名
performanceBuyCount = dataUtils.getUserPBuyCount(userId, performanceId); performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount = dataUtils.getUserTBuyCount(userId, ticketId); ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
} }
Integer[] array = ObjectUtil.cloneInteger2Array(); Integer[] array = new Integer[4];
array[0] = performanceBuyCount; array[0] = performanceBuyCountUid;
array[1] = ticketBuyCount; array[1] = ticketBuyCountUid;
array[2] = performanceBuyCountIdCard;
array[3] = ticketBuyCountIdCard;
return array; return array;
} }
public String judgeMemberType(int performanceLimitCount, int performanceMemberLimitCount, int ticketLimitCount, int ticketMemberLimitCount, int memberType, int performanceBuyCount, int ticketBuyCount, int isTrueName) { public String judgeMemberType(int performanceLimitCount, int performanceMemberLimitCount, int performanceLimitIdCard,
log.debug("会员限购演出=" + performanceMemberLimitCount); int ticketLimitCount, int ticketMemberLimitCount, int ticketLimitIdCard, int memberType,
log.debug("限购演出=" + performanceLimitCount); int performanceBuyCountUid, int ticketBuyCountUid, int performanceBuyCountIdCard, int ticketBuyCountIdCard, int isTrueName) {
log.debug("会员限购票种=" + ticketMemberLimitCount);
log.debug("限购票种=" + ticketLimitCount);
if (memberType == 1 || memberType == 2) { if (memberType == 1 || memberType == 2) {
if (performanceBuyCount > performanceMemberLimitCount && performanceMemberLimitCount != 0) { if(isTrueName==1){
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量 if (performanceBuyCountIdCard > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
} return "实名制演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
if (ticketBuyCount > ticketMemberLimitCount && ticketMemberLimitCount != 0) { }
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量 if (ticketBuyCountIdCard > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "实名制票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
}else{
if (performanceBuyCountUid > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return "本场演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountUid > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "该票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
} }
} else {//非会员区间 } else {//非会员区间
if (performanceBuyCount > performanceLimitCount && performanceLimitCount != 0) { if(isTrueName==1){
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量 if (performanceBuyCountIdCard > performanceLimitIdCard && performanceLimitIdCard != 0) {
} return "实名制演出限购" + performanceLimitIdCard + "张,已超出";//超过演出维度购买量
if (ticketBuyCount > ticketLimitCount && ticketLimitCount != 0) { }
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketLimitCount + "张,已超出";//超过票维度购买量 if (ticketBuyCountIdCard > ticketLimitIdCard && ticketLimitIdCard != 0) {
return "实名制票种限购" + ticketLimitIdCard + "张,已超出";//超过演出维度购买量
}
if (performanceBuyCountUid > performanceLimitCount && performanceLimitCount != 0) {
return "本场演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountUid > ticketLimitCount && ticketLimitCount != 0) {
return "该票种限购" + ticketLimitCount + "张,已超出";//超过演出维度购买量
}
}else{
if (performanceBuyCountUid > performanceLimitCount && performanceLimitCount != 0) {
return "本场演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountUid > ticketLimitCount && ticketLimitCount != 0) {
return "该票种限购" + ticketLimitCount + "张,已超出";//超过演出维度购买量
}
} }
} }
return ""; return "";
......
...@@ -136,6 +136,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -136,6 +136,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
BeanUtils.copyProperties(step1Param, performancePartnerVo); BeanUtils.copyProperties(step1Param, performancePartnerVo);
performancePartnerVo.setIsTrueName(0); performancePartnerVo.setIsTrueName(0);
performancePartnerVo.setLimitCount(0); performancePartnerVo.setLimitCount(0);
performancePartnerVo.setIdCount(0);
performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(0); performancePartnerVo.setIsSubmit(0);
performancePartnerVo.setStatus(0); performancePartnerVo.setStatus(0);
...@@ -183,6 +184,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -183,6 +184,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
if (data != null) { // 有修改记录 if (data != null) { // 有修改记录
performancePartnerVo.setIsTrueName(data.getIsTrueName()); performancePartnerVo.setIsTrueName(data.getIsTrueName());
performancePartnerVo.setLimitCount(data.getLimitCount()); performancePartnerVo.setLimitCount(data.getLimitCount());
performancePartnerVo.setIdCount(data.getIdCount());
performancePartnerVo.setStatusSell(data.getStatusSell()); performancePartnerVo.setStatusSell(data.getStatusSell());
performancePartnerVo.setRoadShowId(data.getRoadShowId()); performancePartnerVo.setRoadShowId(data.getRoadShowId());
performancePartnerVo.setProjectId(data.getProjectId()); performancePartnerVo.setProjectId(data.getProjectId());
...@@ -196,6 +198,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -196,6 +198,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
KylinPerformanceRelations relationsData = performanceRelationsMapper.selectOne(Wrappers.lambdaQuery(KylinPerformanceRelations.class).eq(KylinPerformanceRelations::getPerformanceId, performanceId)); KylinPerformanceRelations relationsData = performanceRelationsMapper.selectOne(Wrappers.lambdaQuery(KylinPerformanceRelations.class).eq(KylinPerformanceRelations::getPerformanceId, performanceId));
performancePartnerVo.setIsTrueName(statusData.getIsTrueName()); performancePartnerVo.setIsTrueName(statusData.getIsTrueName());
performancePartnerVo.setLimitCount(statusData.getLimitCount()); performancePartnerVo.setLimitCount(statusData.getLimitCount());
performancePartnerVo.setIdCount(statusData.getStatus());
performancePartnerVo.setStatusSell(statusData.getStatusSell()); performancePartnerVo.setStatusSell(statusData.getStatusSell());
performancePartnerVo.setRoadShowId(relationsData.getRoadShowId()); performancePartnerVo.setRoadShowId(relationsData.getRoadShowId());
performancePartnerVo.setProjectId(relationsData.getProjectId()); performancePartnerVo.setProjectId(relationsData.getProjectId());
...@@ -387,6 +390,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -387,6 +390,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
performanceStatus.setAuditStatus((int) map.get("auditStatus")); performanceStatus.setAuditStatus((int) map.get("auditStatus"));
performanceStatus.setIsTrueName(step2Param.getIsTrueName()); performanceStatus.setIsTrueName(step2Param.getIsTrueName());
performanceStatus.setLimitCount(step2Param.getLimitCount()); performanceStatus.setLimitCount(step2Param.getLimitCount());
performanceStatus.setIdCount(step2Param.getIdCount());
performanceStatusMapper.update(performanceStatus, Wrappers.lambdaQuery(KylinPerformanceStatus.class).eq(KylinPerformanceStatus::getPerformanceId, performanceId)); performanceStatusMapper.update(performanceStatus, Wrappers.lambdaQuery(KylinPerformanceStatus.class).eq(KylinPerformanceStatus::getPerformanceId, performanceId));
dataUtils.setPerformanceIsTrueName(performanceId, step2Param.getIsTrueName()); dataUtils.setPerformanceIsTrueName(performanceId, step2Param.getIsTrueName());
...@@ -412,6 +416,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -412,6 +416,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
inventory.setTotalGeneral(ticketItem.getTotalGeneral()); inventory.setTotalGeneral(ticketItem.getTotalGeneral());
inventory.setIsTrueName(kylinPerformanceMisVo.getIsTrueName()); inventory.setIsTrueName(kylinPerformanceMisVo.getIsTrueName());
inventory.setLimitCount(ticketItem.getLimitCount()); inventory.setLimitCount(ticketItem.getLimitCount());
inventory.setLimitCount(ticketItem.getIdCount());
inventory.setIsLackRegister(ticketItem.getIsLackRegister()); inventory.setIsLackRegister(ticketItem.getIsLackRegister());
inventory.setIsExpress(ticketItem.getIsExpress()); inventory.setIsExpress(ticketItem.getIsExpress());
inventory.setIsElectronic(ticketItem.getIsElectronic()); inventory.setIsElectronic(ticketItem.getIsElectronic());
......
...@@ -155,13 +155,13 @@ public class DataUtils { ...@@ -155,13 +155,13 @@ public class DataUtils {
public List<KylinOrderListVo> getOrderList(String userId) { public List<KylinOrderListVo> getOrderList(String userId) {
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.ORDER_LIST + userId); Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.ORDER_LIST + userId);
if (obj!=null) { if (obj != null) {
return (List<KylinOrderListVo>)obj; return (List<KylinOrderListVo>) obj;
} else { } else {
List<KylinOrderListVo> voList = mongoTemplate.find(Query.query(Criteria.where("userId").is(userId)) List<KylinOrderListVo> voList = mongoTemplate.find(Query.query(Criteria.where("userId").is(userId))
.with(Sort.by(Sort.Direction.DESC, "createdAt")).limit(40), .with(Sort.by(Sort.Direction.DESC, "createdAt")).limit(40),
KylinOrderListVo.class, KylinOrderTicketVo.class.getSimpleName()); KylinOrderListVo.class, KylinOrderTicketVo.class.getSimpleName());
for (KylinOrderListVo item : voList){ for (KylinOrderListVo item : voList) {
item.setStatus(item.getStatus()); item.setStatus(item.getStatus());
} }
redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.ORDER_LIST + userId, voList); redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.ORDER_LIST + userId, voList);
...@@ -175,8 +175,8 @@ public class DataUtils { ...@@ -175,8 +175,8 @@ public class DataUtils {
* @param performanceId * @param performanceId
* @param isTrueName * @param isTrueName
*/ */
public void setPerformanceIsTrueName(String performanceId,int isTrueName) { public void setPerformanceIsTrueName(String performanceId, int isTrueName) {
redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.PERFORMANCES_TRUE_NAME + performanceId,isTrueName); redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.PERFORMANCES_TRUE_NAME + performanceId, isTrueName);
} }
/** /**
...@@ -187,8 +187,8 @@ public class DataUtils { ...@@ -187,8 +187,8 @@ public class DataUtils {
*/ */
public KylinOrderTicketVo getOrderTicketVo(String orderId) { public KylinOrderTicketVo getOrderTicketVo(String orderId) {
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.ORDER + orderId); Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.ORDER + orderId);
if (obj!=null) { if (obj != null) {
return (KylinOrderTicketVo)obj; return (KylinOrderTicketVo) obj;
} else { } else {
KylinOrderTicketVo ticketData = mongoTemplate.findOne(Query.query(Criteria.where("orderTicketsId").is(orderId)), KylinOrderTicketVo.class, KylinOrderTicketVo.class.getSimpleName()); KylinOrderTicketVo ticketData = mongoTemplate.findOne(Query.query(Criteria.where("orderTicketsId").is(orderId)), KylinOrderTicketVo.class, KylinOrderTicketVo.class.getSimpleName());
List<KylinOrderTicketEntitiesVo> kylinOrderTicketEntitiesVoList = mongoTemplate.find(Query.query(Criteria.where("orderId").is(orderId)), KylinOrderTicketEntitiesVo.class, KylinOrderTicketEntitiesVo.class.getSimpleName()); List<KylinOrderTicketEntitiesVo> kylinOrderTicketEntitiesVoList = mongoTemplate.find(Query.query(Criteria.where("orderId").is(orderId)), KylinOrderTicketEntitiesVo.class, KylinOrderTicketEntitiesVo.class.getSimpleName());
...@@ -228,7 +228,6 @@ public class DataUtils { ...@@ -228,7 +228,6 @@ public class DataUtils {
} }
public void updatePerformanceMongo(String performanceIds, KylinPerformanceVo paramVo) { public void updatePerformanceMongo(String performanceIds, KylinPerformanceVo paramVo) {
//查询 mysql 数据 //查询 mysql 数据
KylinPerformanceVo vo; KylinPerformanceVo vo;
...@@ -273,31 +272,40 @@ public class DataUtils { ...@@ -273,31 +272,40 @@ public class DataUtils {
* @param buyCount 购买数量 大于 0 增加 小于 0 减少 对应 支付 退款表 * @param buyCount 购买数量 大于 0 增加 小于 0 减少 对应 支付 退款表
*/ */
public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) { public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) {
String redisKey; String redisKeyUid;
String redisKeyIdCard;
String performanceIdKeyIdCard="";
String ticketIdKeyIdCard="";
int isTrueName = getPerformanceIsTrueName(performanceId); int isTrueName = getPerformanceIsTrueName(performanceId);
if (0 == isTrueName) { redisKeyUid = KylinRedisConst.USERID_BUY_INFO + userId;
redisKey = KylinRedisConst.USERID_BUY_INFO + userId; redisKeyIdCard = KylinRedisConst.IDCARD_BUY_INFO + idCard;
} else { String performanceIdKeyUid = redisKeyUid + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard; String ticketIdKeyUid = redisKeyUid + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
if (isTrueName != 0) {
performanceIdKeyIdCard = redisKeyIdCard + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
ticketIdKeyIdCard = redisKeyIdCard + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
} }
String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
if (buyCount > 0) { if (buyCount > 0) {
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKey, buyCount); redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyUid, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKey, buyCount); redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKeyUid, buyCount);
}else{ if (isTrueName != 0) {
redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKey, Math.abs(buyCount)); redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyIdCard, buyCount);
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKey, Math.abs(buyCount)); redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKeyIdCard, buyCount);
}
} else {
if (isTrueName != 0) {
redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKeyIdCard, Math.abs(buyCount));
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKeyIdCard, Math.abs(buyCount));
}
redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKeyUid, Math.abs(buyCount));
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKeyUid, Math.abs(buyCount));
} }
} }
// 获取 用户维度 演出购买数量 // 获取 用户维度 演出购买数量
public int getUserPBuyCount(String userId, String performanceId) { public int getUserPBuyCount(String userId, String performanceId) {
try { try {
...@@ -351,8 +359,8 @@ public class DataUtils { ...@@ -351,8 +359,8 @@ public class DataUtils {
*/ */
public KylinPerformanceVo getPerformanceVo(String performanceId) { public KylinPerformanceVo getPerformanceVo(String performanceId) {
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.PERFORMANCES + performanceId); Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.PERFORMANCES + performanceId);
if (obj!=null) { if (obj != null) {
return (KylinPerformanceVo)obj; return (KylinPerformanceVo) obj;
} else { } else {
KylinPerformanceVo performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performanceId)), KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName()); KylinPerformanceVo performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performanceId)), KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.PERFORMANCES + performanceId, performanceData); redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.PERFORMANCES + performanceId, performanceData);
...@@ -367,26 +375,27 @@ public class DataUtils { ...@@ -367,26 +375,27 @@ public class DataUtils {
*/ */
public int getPerformanceIsTrueName(String performanceId) { public int getPerformanceIsTrueName(String performanceId) {
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.PERFORMANCES_TRUE_NAME + performanceId); Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.PERFORMANCES_TRUE_NAME + performanceId);
if (obj!=null) { if (obj != null) {
return (int)obj; return (int) obj;
}else{ } else {
int isTrueName = getPerformanceVo(performanceId).getIsTrueName(); int isTrueName = getPerformanceVo(performanceId).getIsTrueName();
redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.PERFORMANCES_TRUE_NAME + performanceId,isTrueName); redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.PERFORMANCES_TRUE_NAME + performanceId, isTrueName);
return isTrueName; return isTrueName;
} }
} }
public void delOrderRefundVo(String orderRefundsId){ public void delOrderRefundVo(String orderRefundsId) {
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.ORDER_REFUND + orderRefundsId); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.ORDER_REFUND + orderRefundsId);
} }
public void delOrderRefundVoByOrderId(String orderId){ public void delOrderRefundVoByOrderId(String orderId) {
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.ORDER_REFUND_BY_ORDER_ID + orderId); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.ORDER_REFUND_BY_ORDER_ID + orderId);
} }
/** /**
* 演出订单快递信息 * 演出订单快递信息
*
* @param orderId * @param orderId
* @param kylinOrderExpressVo * @param kylinOrderExpressVo
*/ */
...@@ -409,7 +418,7 @@ public class DataUtils { ...@@ -409,7 +418,7 @@ public class DataUtils {
} }
// 获取订单券的使用情况 // 获取订单券的使用情况
public ArrayList<KylinOrderCoupons> getOrderCoupon(String orderId){ public ArrayList<KylinOrderCoupons> getOrderCoupon(String orderId) {
String redisKey = KylinRedisConst.ORDER_COUPON.concat(orderId); String redisKey = KylinRedisConst.ORDER_COUPON.concat(orderId);
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(redisKey); Object obj = redisDataSourceUtil.getRedisKylinUtil().get(redisKey);
if (obj == null) { if (obj == null) {
......
...@@ -272,3 +272,9 @@ create table kylin_ticket_express_module ...@@ -272,3 +272,9 @@ create table kylin_ticket_express_module
updated_at datetime , updated_at datetime ,
comment text comment text
) engine = InnoDB comment '票种快递模板关联表'; ) engine = InnoDB comment '票种快递模板关联表';
ALTER TABLE kylin_performance_status
ADD id_count int DEFAULT NULL COMMENT '实名限购数';
ALTER TABLE kylin_ticket_status
ADD id_count int DEFAULT NULL COMMENT '实名限购数';
\ No newline at end of file
...@@ -44,6 +44,14 @@ public class KylinBuyNoticeParnterController { ...@@ -44,6 +44,14 @@ public class KylinBuyNoticeParnterController {
@Autowired @Autowired
RedisSlimeUtils redisSlimeUtils; RedisSlimeUtils redisSlimeUtils;
@GetMapping(value = "test")
@ApiOperation(value = "测试", position = 1)
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<Boolean> ce(@RequestParam("performanceId") String performanceId) {
performanceUtils.getNewTicketData(performanceId);
return ResponseDto.success();
}
@GetMapping(value = "buyNotice") @GetMapping(value = "buyNotice")
@ApiOperation(value = "购票须知列表", position = 1) @ApiOperation(value = "购票须知列表", position = 1)
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
......
...@@ -107,6 +107,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -107,6 +107,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
BeanUtils.copyProperties(step1Param, performancePartnerVo); BeanUtils.copyProperties(step1Param, performancePartnerVo);
performancePartnerVo.setIsTrueName(0); performancePartnerVo.setIsTrueName(0);
performancePartnerVo.setLimitCount(0); performancePartnerVo.setLimitCount(0);
performancePartnerVo.setIdCount(0);
performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(0); performancePartnerVo.setIsSubmit(0);
performancePartnerVo.setStatus(0); performancePartnerVo.setStatus(0);
...@@ -157,6 +158,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -157,6 +158,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
if (data != null) { // 有修改记录 if (data != null) { // 有修改记录
performancePartnerVo.setIsTrueName(data.getIsTrueName()); performancePartnerVo.setIsTrueName(data.getIsTrueName());
performancePartnerVo.setLimitCount(data.getLimitCount()); performancePartnerVo.setLimitCount(data.getLimitCount());
performancePartnerVo.setIdCount(data.getIdCount());
performancePartnerVo.setStatusSell(data.getStatusSell()); performancePartnerVo.setStatusSell(data.getStatusSell());
performancePartnerVo.setRoadShowId(data.getRoadShowId()); performancePartnerVo.setRoadShowId(data.getRoadShowId());
performancePartnerVo.setProjectId(data.getProjectId()); performancePartnerVo.setProjectId(data.getProjectId());
...@@ -165,6 +167,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -165,6 +167,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
KylinPerformanceVo vo = redisSlimeUtils.getPerformanceVo(performanceId); KylinPerformanceVo vo = redisSlimeUtils.getPerformanceVo(performanceId);
performancePartnerVo.setIsTrueName(vo.getIsTrueName()); performancePartnerVo.setIsTrueName(vo.getIsTrueName());
performancePartnerVo.setLimitCount(vo.getLimitCount()); performancePartnerVo.setLimitCount(vo.getLimitCount());
performancePartnerVo.setIdCount(vo.getIdCount());
performancePartnerVo.setStatusSell(vo.getStatusSell()); performancePartnerVo.setStatusSell(vo.getStatusSell());
performancePartnerVo.setRoadShowId(vo.getRoadShowId()); performancePartnerVo.setRoadShowId(vo.getRoadShowId());
performancePartnerVo.setProjectId(vo.getProjectId()); performancePartnerVo.setProjectId(vo.getProjectId());
...@@ -246,6 +249,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -246,6 +249,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
performancePartnerVo.setPerformancesId(performanceId); performancePartnerVo.setPerformancesId(performanceId);
performancePartnerVo.setIsTrueName(step2Param.getIsTrueName()); performancePartnerVo.setIsTrueName(step2Param.getIsTrueName());
performancePartnerVo.setLimitCount(step2Param.getLimitCount()); performancePartnerVo.setLimitCount(step2Param.getLimitCount());
performancePartnerVo.setIdCount(step2Param.getIdCount());
performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(step2Param.getIsSubmit()); performancePartnerVo.setIsSubmit(step2Param.getIsSubmit());
// performancePartnerVo.setStatusSell(1); // performancePartnerVo.setStatusSell(1);
...@@ -341,6 +345,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -341,6 +345,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
performancePartnerVo.setPerformancesId(performanceId); performancePartnerVo.setPerformancesId(performanceId);
performancePartnerVo.setIsTrueName(step2Param.getIsTrueName()); performancePartnerVo.setIsTrueName(step2Param.getIsTrueName());
performancePartnerVo.setLimitCount(step2Param.getLimitCount()); performancePartnerVo.setLimitCount(step2Param.getLimitCount());
performancePartnerVo.setIdCount(step2Param.getIdCount());
performancePartnerVo.setCreatedAt(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); performancePartnerVo.setCreatedAt(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setUpdatedAt(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); performancePartnerVo.setUpdatedAt(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(step2Param.getIsSubmit()); performancePartnerVo.setIsSubmit(step2Param.getIsSubmit());
...@@ -385,7 +390,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -385,7 +390,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
now, kylinPerformanceMisVo.getNoticeImage(), performanceId, now, now now, kylinPerformanceMisVo.getNoticeImage(), performanceId, now, now
}); });
sqlsDataB.add(new Object[]{ sqlsDataB.add(new Object[]{
performancePartnerVo.getFieldAuditStatus(), performancePartnerVo.getAuditStatus(), step2Param.getIsTrueName(), step2Param.getLimitCount(), performanceId, now, now performancePartnerVo.getFieldAuditStatus(), performancePartnerVo.getAuditStatus(), step2Param.getIsTrueName(), step2Param.getLimitCount(),step2Param.getIdCount(), performanceId, now, now
}); });
redisSlimeUtils.setPerformanceIsTrueName(performanceId, step2Param.getIsTrueName()); redisSlimeUtils.setPerformanceIsTrueName(performanceId, step2Param.getIsTrueName());
...@@ -425,6 +430,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -425,6 +430,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
ticketData.setTotalGeneral(ticketItem.getTotalGeneral()); ticketData.setTotalGeneral(ticketItem.getTotalGeneral());
ticketData.setIsTrueName(kylinPerformanceMisVo.getIsTrueName()); ticketData.setIsTrueName(kylinPerformanceMisVo.getIsTrueName());
ticketData.setLimitCount(ticketItem.getLimitCount()); ticketData.setLimitCount(ticketItem.getLimitCount());
ticketData.setIdCount(ticketItem.getIdCount());
ticketData.setIsLackRegister(ticketItem.getIsLackRegister()); ticketData.setIsLackRegister(ticketItem.getIsLackRegister());
ticketData.setIsExpress(ticketItem.getIsExpress()); ticketData.setIsExpress(ticketItem.getIsExpress());
ticketData.setIsElectronic(ticketItem.getIsElectronic()); ticketData.setIsElectronic(ticketItem.getIsElectronic());
...@@ -442,7 +448,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -442,7 +448,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
//修改 mysql 购票限购、库存 //修改 mysql 购票限购、库存
sqlsDataD.add(new Object[]{ sqlsDataD.add(new Object[]{
ticketItem.getTotalExchange(), ticketItem.getTotalGeneral(), kylinPerformanceMisVo.getIsTrueName(), ticketItem.getTotalExchange(), ticketItem.getTotalGeneral(), kylinPerformanceMisVo.getIsTrueName(),
ticketItem.getLimitCount(), ticketItem.getIsLackRegister(), ticketItem.getIsExpress(), ticketItem.getLimitCount(),ticketItem.getIdCount(), ticketItem.getIsLackRegister(), ticketItem.getIsExpress(),
ticketItem.getIsElectronic(), ticketItem.getCounts(), ticketItem.getIsShowCode(), ticketItem.getIsElectronic(), ticketItem.getCounts(), ticketItem.getIsShowCode(),
DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketItem.getQrCodeShowTime()), ticketItem.getTicketsId(), now, now DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketItem.getQrCodeShowTime()), ticketItem.getTicketsId(), now, now
}); });
...@@ -471,6 +477,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -471,6 +477,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
vo.setAuditStatus(performancePartnerVo.getAuditStatus()); vo.setAuditStatus(performancePartnerVo.getAuditStatus());
vo.setIsTrueName(step2Param.getIsTrueName()); vo.setIsTrueName(step2Param.getIsTrueName());
vo.setLimitCount(step2Param.getLimitCount()); vo.setLimitCount(step2Param.getLimitCount());
vo.setIdCount(step2Param.getIdCount());
mongoSlimeUtils.updateKylinPerformanceVoById(vo); mongoSlimeUtils.updateKylinPerformanceVoById(vo);
redisSlimeUtils.delPerformanceVo(performanceId); redisSlimeUtils.delPerformanceVo(performanceId);
......
package com.liquidnet.service.slime.util; package com.liquidnet.service.slime.util;
import com.alibaba.fastjson.JSON;
import com.liquidnet.commons.lang.util.*; import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
...@@ -401,7 +402,7 @@ public class PerformanceUtils { ...@@ -401,7 +402,7 @@ public class PerformanceUtils {
//快递相关 //快递相关
KylinTicketExpressModuleVo moduleVo = redisSlimeUtils.getTEMMerchantVo(tickets.getTicketsId()); KylinTicketExpressModuleVo moduleVo = redisSlimeUtils.getTEMMerchantVo(tickets.getTicketsId());
if (moduleVo != null && moduleVo.getProduceCodeList()!=null) { if (moduleVo != null && moduleVo.getProduceCodeList() != null) {
redisSlimeUtils.setTEMMerchantVo(tickets.getTicketsId(), moduleVo); redisSlimeUtils.setTEMMerchantVo(tickets.getTicketsId(), moduleVo);
del9.add(new Object[]{tickets.getTicketsId(), updatedAt}); del9.add(new Object[]{tickets.getTicketsId(), updatedAt});
for (ExpressModuleVo mVo : moduleVo.getProduceCodeList()) for (ExpressModuleVo mVo : moduleVo.getProduceCodeList())
...@@ -736,4 +737,67 @@ public class PerformanceUtils { ...@@ -736,4 +737,67 @@ public class PerformanceUtils {
return null; return null;
} }
} }
/**
* 根据场次时间进行拆分组
*
* @param performanceId
*/
public void getNewTicketData(String performanceId) {
KylinPerformanceVo vo = redisSlimeUtils.getPerformanceVo(performanceId);
List<KylinTicketTimesVo> timeList = vo.getTicketTimeList();
List<KylinTicketTimesVo> timeListVo = new ArrayList<>();
HashMap<String, List<KylinTicketVo>> mapData = new HashMap<>();
//根据场次拆出时间组
List<String> useTimeList = CollectionUtil.linkedListString();
for (KylinTicketTimesVo timesVo : timeList) {
String st = timesVo.getUseStart();
String et = timesVo.getUseEnd();
long day = DateUtil.intervalDays(st, et);
for (int i = 0; i <= day; i++) {
String useDay = DateUtil.addDay(st, i);
if (!useTimeList.contains(useDay)) {
useTimeList.add(useDay);
}
}
}
Collections.sort(useTimeList);
//新场次
for (String name : useTimeList) {
KylinTicketTimesVo timesVo = KylinTicketTimesVo.getNew();
timesVo.setPerformanceId(performanceId);
timesVo.setTitle(name);
timesVo.setUseStart(name);
timesVo.setUseEnd(name);
timeListVo.add(timesVo);
mapData.put(name, new ArrayList<>());
}
//完善新场次数据
for (KylinTicketTimesVo timesVo : timeList) {
for (KylinTicketVo ticketVo : timesVo.getTicketList()) {
String st = ticketVo.getUseStart();
String et = ticketVo.getUseEnd();
long day = DateUtil.intervalDays(st, et);
for (int i = 0; i <= day; i++) {
String useDay = DateUtil.addDay(st, i);
List<KylinTicketVo> t1 = mapData.get(useDay);
t1.add(ticketVo);
mapData.put(useDay, t1);
}
}
}
for (String key : mapData.keySet()) {
for (KylinTicketTimesVo v1 : timeListVo) {
if (v1.getTitle().equals(key)) {
List<KylinTicketVo> v2 = mapData.get(key);
v1.setTicketList(v2);
}
}
}
log.info("新数据:" + JsonUtils.toJson(timeListVo));
}
} }
...@@ -42,9 +42,9 @@ kylin_performances_reject_txt.fieldsStatus = UPDATE kylin_performances SET rejec ...@@ -42,9 +42,9 @@ kylin_performances_reject_txt.fieldsStatus = UPDATE kylin_performances SET rejec
# ---- 演出第二步骤操作 ---- # ---- 演出第二步骤操作 ----
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.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 = ? WHERE performance_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) 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)
kylin_ticket_status.updateStep2=UPDATE kylin_ticket_status SET total_exchange = ? , total_general = ? , is_true_name = ? , limit_count = ? , is_lack_register = ? , is_express = ? , is_electronic = ? ,counts = ? , is_show_code = ? ,qr_code_show_time = ? WHERE ticket_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) kylin_ticket_status.updateStep2=UPDATE kylin_ticket_status SET total_exchange = ? , total_general = ? , is_true_name = ? , limit_count = ? ,id_count =? , is_lack_register = ? , is_express = ? , is_electronic = ? ,counts = ? , is_show_code = ? ,qr_code_show_time = ? WHERE ticket_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
# ---- VoStatus ---- # ---- VoStatus ----
kylin_ticket_status.VoStatus=UPDATE kylin_ticket_status SET status = ?, surplus_general = ? WHERE ticket_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) kylin_ticket_status.VoStatus=UPDATE kylin_ticket_status SET status = ?, surplus_general = ? WHERE ticket_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
kylin_performance_status.VoStatus=UPDATE kylin_performance_status SET status = ? WHERE performance_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) kylin_performance_status.VoStatus=UPDATE kylin_performance_status SET status = ? WHERE performance_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
...@@ -54,7 +54,7 @@ kylin_performance_status.del=DELETE FROM kylin_performance_status WHERE performa ...@@ -54,7 +54,7 @@ kylin_performance_status.del=DELETE FROM kylin_performance_status WHERE performa
kylin_performance_relations.del=DELETE FROM kylin_performance_relations WHERE performance_id = ? kylin_performance_relations.del=DELETE FROM kylin_performance_relations WHERE performance_id = ?
#province_id,province_name,district_id,district_name #province_id,province_name,district_id,district_name
kylin_performances.insert=INSERT INTO kylin_performances (performances_id,title,type,img_poster,city_id,city_name,approval_url,notice,sponsor_id,sponsor_type,sponsor,contacts,mobile,describes,details,notice_image,time_start,time_end,sort,comment,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_performances.insert=INSERT INTO kylin_performances (performances_id,title,type,img_poster,city_id,city_name,approval_url,notice,sponsor_id,sponsor_type,sponsor,contacts,mobile,describes,details,notice_image,time_start,time_end,sort,comment,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_performance_status.insert=INSERT INTO kylin_performance_status (performance_status_id,performance_id,is_show,status,status_sell,is_distribution,sync_agent,sync_damai,audit_status,is_true_name,limit_count,limit_count_member,field_audit_status,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_performance_status.insert=INSERT INTO kylin_performance_status (performance_status_id,performance_id,is_show,status,status_sell,is_distribution,sync_agent,sync_damai,audit_status,is_true_name,limit_count,id_count,limit_count_member,field_audit_status,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_performance_relations.insert=INSERT INTO kylin_performance_relations (performance_relations_id,performance_id,copy_id,merchant_id,field_id,road_show_id,project_id,video_id,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?,?) kylin_performance_relations.insert=INSERT INTO kylin_performance_relations (performance_relations_id,performance_id,copy_id,merchant_id,field_id,road_show_id,project_id,video_id,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?,?)
kylin_ticket_times.del=DELETE FROM kylin_ticket_times WHERE ticket_times_id = ? kylin_ticket_times.del=DELETE FROM kylin_ticket_times WHERE ticket_times_id = ?
...@@ -68,7 +68,7 @@ kylin_ticket_status.del=DELETE FROM kylin_ticket_status WHERE ticket_id = ? ...@@ -68,7 +68,7 @@ kylin_ticket_status.del=DELETE FROM kylin_ticket_status WHERE ticket_id = ?
kylin_ticket_relations.del=DELETE FROM kylin_ticket_relations WHERE ticket_id = ? kylin_ticket_relations.del=DELETE FROM kylin_ticket_relations WHERE ticket_id = ?
kylin_tickets.insert=INSERT INTO kylin_tickets (tickets_id,title,type,price,price_express,price_discount_member,price_discount,describes,describe_express,describe_electronic,advance_minute_member,time_start,time_end,time_end_express,use_start,use_end,pay_countdown_minute,sale_remind_minute,comment,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_tickets.insert=INSERT INTO kylin_tickets (tickets_id,title,type,price,price_express,price_discount_member,price_discount,describes,describe_express,describe_electronic,advance_minute_member,time_start,time_end,time_end_express,use_start,use_end,pay_countdown_minute,sale_remind_minute,comment,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_ticket_status.insert=INSERT INTO kylin_ticket_status (ticket_status_id,ticket_id,is_student,is_electronic,is_express,status,counts,status_exchange,is_show_code,qr_code_show_time,is_lack_register,total_general,total_exchange,surplus_general,surplus_exchange,express_type,is_transfer,is_true_name,limit_count,member_limit_count,is_exclusive,is_member,is_agent,sync_damai,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_ticket_status.insert=INSERT INTO kylin_ticket_status (ticket_status_id,ticket_id,is_student,is_electronic,is_express,status,counts,status_exchange,is_show_code,qr_code_show_time,is_lack_register,total_general,total_exchange,surplus_general,surplus_exchange,express_type,is_transfer,is_true_name,limit_count,id_count,member_limit_count,is_exclusive,is_member,is_agent,sync_damai,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_ticket_relations.insert=INSERT INTO kylin_ticket_relations (ticket_relations_id,ticket_id,times_id,created_at,updated_at) VALUES (?,?,?,?,?) kylin_ticket_relations.insert=INSERT INTO kylin_ticket_relations (ticket_relations_id,ticket_id,times_id,created_at,updated_at) VALUES (?,?,?,?,?)
kylin_ticket_express_module.del=DELETE FROM kylin_ticket_express_module WHERE ticket_id = ? and created_at < ? kylin_ticket_express_module.del=DELETE FROM kylin_ticket_express_module WHERE ticket_id = ? and created_at < ?
......
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