记得上下班打卡 | 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 {
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:");//无用
......
package com.liquidnet.service.goblin.dto.vo;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.goblin.param.GoblinMixDetailsParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -27,7 +26,7 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
private String intro;
@ApiModelProperty(position = 10, value = "封面图片地址")
private String coverPic;
@ApiModelProperty(position = 11, value = "商品视频地址/数字昌平视频地址")
@ApiModelProperty(position = 11, value = "展示类型为1[详情图片地址]展示类型为2[商品视频地址/数字藏品视频地址]")
private String video;
@ApiModelProperty(position = 12, value = "商品详情/藏品详情")
private String details;
......@@ -51,6 +50,14 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
private BigDecimal sellPrice;
@ApiModelProperty(position = 23, value = "原价")
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();
......@@ -82,6 +89,9 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
this.setStoreName(storeName);
this.setPrice(source.getPrice());
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;
}
}
......@@ -33,6 +33,12 @@ public class GoblinMixAppListVo implements Serializable, Cloneable {
private BigDecimal price;
@ApiModelProperty(position = 9, value = "活动创建时间")
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();
......@@ -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;
this.setMixId(source.getMixId());
this.setName(source.getName());
......@@ -55,6 +61,9 @@ public class GoblinMixAppListVo implements Serializable, Cloneable {
this.setSellPrice(source.getSellPrice());
this.setPrice(source.getPrice());
this.setCreatedAt(source.getCreatedAt());
this.setShelvesTime(source.getShelvesTime());
this.setNowTime(nowTime);
this.setReserve(source.getReserve());
return this;
}
}
......@@ -34,7 +34,7 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
private String intro;
@ApiModelProperty(position = 10, value = "封面图片地址")
private String coverPic;
@ApiModelProperty(position = 11, value = "商品视频地址/数字昌平视频地址")
@ApiModelProperty(position = 11, value = "展示类型为1[详情图片地址]展示类型为2[商品视频地址/数字藏品视频地址]")
private String video;
@ApiModelProperty(position = 12, value = "商品详情/藏品详情")
private String details;
......@@ -70,6 +70,10 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
private String xlsName;
@ApiModelProperty(position = 26, value = "店铺id")
private String storeId;
@ApiModelProperty(position = 22, value = "上架时间")
private String shelvesTime;
@ApiModelProperty(value = "预约开启标识")
private int reserve;
private static final GoblinMixDetailsVo obj = new GoblinMixDetailsVo();
......@@ -111,6 +115,16 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
this.setPayType(source.getPayType());
this.setXlsName(source.getXlsName());
this.setStoreId(source.getStoreId());
this.setShelvesTime(source.getShelvesTime());
this.setReserve(source.getReserve());
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 {
private String intro;
@ApiModelProperty(position = 10, value = "封面图片地址")
private String coverPic;
@ApiModelProperty(position = 11, value = "商品视频地址/数字昌平视频地址")
@ApiModelProperty(position = 11, value = "展示类型为1[详情图片地址]展示类型为2[商品视频地址/数字藏品视频地址]")
private String video;
@ApiModelProperty(position = 12, value = "商品详情/藏品详情")
private String details;
......@@ -53,7 +53,10 @@ public class GoblinMixDetailsParam implements Serializable, Cloneable {
private String xlsName;
@ApiModelProperty(position = 21, value = "店铺id")
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();
......
......@@ -22,6 +22,10 @@ public class GoblinMixUpdateParam implements Serializable, Cloneable {
private String whiteUrl;
@ApiModelProperty(position = 20, value = "xls名称")
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();
......
......@@ -57,4 +57,18 @@ public interface IGoblinGoodsAnticipateService {
ResponseDto<String> getTurnOnHelp(String skuId);
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 {
* @return 预约关联sku和spu表
*/
AnticipateValueVo getAnticipateValueBySkuId(String skuId,int hasHead);
}
......@@ -94,12 +94,16 @@ public class KylinRedisConst {
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_USER = "kylin:active:ar:user:";//互动券 绑定的用户
public static final String ACTIVE_TICKET_AR_TICKET = "kylin:active:ar:ticket:";//互动券
public static final String ACTIVE_TICKET_AR_USER = "kylin:active:ar:user:";//互动券 绑定的用户
/**
* 巡演券
* 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 {
@ApiModelProperty(value = "限购数量 0为不限购", example = "0")
private Integer limitCount;
@ApiModelProperty(value = "实名数量 0为不限购", example = "0")
private Integer idCount;
@ApiModelProperty(value = "是否提交 1提交 0不提交(不验证参数)", example = "0")
private Integer isSubmit;
......@@ -121,6 +124,10 @@ public class PerformancePartnerVo implements Serializable, Cloneable {
@ApiModelProperty(value = "是否保存", example = "")
private Integer isCreateSave;
public Integer getIdCount() {
return idCount==null?limitCount:idCount;
}
private static final PerformancePartnerVo obj = new PerformancePartnerVo();
public static PerformancePartnerVo getNew() {
......@@ -151,6 +158,7 @@ public class PerformancePartnerVo implements Serializable, Cloneable {
this.setNoticeImage(performances.getNoticeImage());
this.setIsTrueName(performanceStatus.getIsTrueName());
this.setLimitCount(performanceStatus.getLimitCount());
this.setIdCount(performanceStatus.getIdCount());
this.setStatus(performanceStatus.getStatus());
this.setMerchantId(kylinPerformanceRelations.getMerchantId());
this.setDescribes(performances.getDescribes());
......
......@@ -23,6 +23,10 @@ public class PerformanceStep2Param implements Serializable,Cloneable {
@NotNull(message = "不能为空")
private Integer limitCount;
@ApiModelProperty(value = "实名限购 0为不限购", example = "0")
@NotNull(message = "不能为空")
private Integer idCount;
@ApiModelProperty(value = "是否提交 1提交 0不提交(不验证参数)", example = "0")
@NotNull(message = "不能为空")
private Integer isSubmit;
......
......@@ -75,6 +75,10 @@ public class TicketCreateParam implements Serializable {
@NotNull(message = "限购数量不能为空")
private Integer limitCount;
@ApiModelProperty(value = "实名数量", example = "0")
@NotNull(message = "限购数量不能为空")
private Integer idCount;
@ApiModelProperty(value = "票种开售时间", example = "2020-12-01T12:00:00")
@NotNull(message = "票种开售时间不能为空")
private LocalDateTime timeStart;
......
......@@ -7,12 +7,13 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.format.DateTimeFormatter;
import java.util.List;
@Data
@ApiModel
public class KylinTicketTimesVo {
public class KylinTicketTimesVo implements Serializable,Cloneable{
private Integer mid;
@ApiModelProperty(value = "主键")
......@@ -32,6 +33,15 @@ public class KylinTicketTimesVo {
@ApiModelProperty(value = "票种")
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) {
this.mid = ticketTimes.getMid();
this.ticketTimesId = ticketTimes.getTicketTimesId();
......
......@@ -18,7 +18,7 @@ import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
@Data
@ApiModel
public class KylinTicketVo implements Serializable,Cloneable{
public class KylinTicketVo implements Serializable, Cloneable {
private Integer mid;
@ApiModelProperty(value = "主键")
......@@ -79,6 +79,8 @@ public class KylinTicketVo implements Serializable,Cloneable{
private Integer isTrueName;
@ApiModelProperty(value = "限购张数")
private Integer limitCount;
@ApiModelProperty(value = "实名限购张数")
private Integer idCount;
@ApiModelProperty(value = "会员限购张数")
private Integer limitCountMember;
@ApiModelProperty(value = "是否会员专属 0 1")
......@@ -100,6 +102,10 @@ public class KylinTicketVo implements Serializable,Cloneable{
@ApiModelProperty(value = "总兑换库存")
private Integer totalExchange;
public Integer getIdCount() {
return idCount == null ? limitCount : idCount;
}
public void setTicket(KylinTickets ticket) {
this.mid = ticket.getMid();
this.ticketsId = ticket.getTicketsId();
......@@ -140,6 +146,7 @@ public class KylinTicketVo implements Serializable,Cloneable{
this.isStudent = ticketStatus.getIsStudent();
this.limitCountMember = ticketStatus.getMemberLimitCount();
this.limitCount = ticketStatus.getLimitCount();
this.idCount = ticketStatus.getIdCount();
this.counts = ticketStatus.getCounts();
this.sysDamai = ticketStatus.getSyncDamai();
this.isShowCode = ticketStatus.getIsShowCode();
......@@ -162,7 +169,7 @@ public class KylinTicketVo implements Serializable,Cloneable{
this.timeStart = ticket.getTimeStart();
this.timeEnd = ticket.getTimeEnd();
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) {
this.timeEndExpress = ticket.getTimeEndExpress();
} else {
......@@ -187,6 +194,7 @@ public class KylinTicketVo implements Serializable,Cloneable{
this.isStudent = ticketStatus.getIsStudent();
this.limitCountMember = 1;
this.limitCount = ticketStatus.getLimitCount();
this.idCount = ticketStatus.getIdCount();
this.counts = ticketStatus.getCounts();
this.sysDamai = 0;
this.isShowCode = ticketStatus.getIsShowCode();
......@@ -196,6 +204,7 @@ public class KylinTicketVo implements Serializable,Cloneable{
}
private static final KylinTicketVo obj = new KylinTicketVo();
public static KylinTicketVo getNew() {
try {
return (KylinTicketVo) obj.clone();
......
......@@ -85,6 +85,8 @@ public class KylinPerformanceVo implements Serializable, Cloneable{
private Integer isTrueName;
@ApiModelProperty(value = "限购张数")
private Integer limitCount;
@ApiModelProperty(value = "实名数量 0为不限购")
private Integer idCount;
@ApiModelProperty(value = "会员限购张数")
private Integer limitCountMember;
@ApiModelProperty(value = "是否专属")
......@@ -130,6 +132,10 @@ public class KylinPerformanceVo implements Serializable, Cloneable{
@ApiModelProperty(value = "场地审核状态 [0-审核完成|1-待审核|2-已拒绝]", hidden = true)
private Integer fieldAuditStatus;
public Integer getIdCount() {
return idCount==null?limitCount:idCount;
}
private static final KylinPerformanceVo obj = new KylinPerformanceVo();
public static KylinPerformanceVo getNew() {
......@@ -209,6 +215,7 @@ public class KylinPerformanceVo implements Serializable, Cloneable{
this.isRecommend = performanceStatus.getIsRecommend();
this.isTrueName = performanceStatus.getIsTrueName();
this.limitCount = performanceStatus.getLimitCount();
this.idCount = performanceStatus.getIdCount();
this.limitCountMember = performanceStatus.getLimitCountMember();
this.sysDamai = performanceStatus.getSyncDamai();
this.isShow = performanceStatus.getIsShow();
......@@ -233,6 +240,7 @@ public class KylinPerformanceVo implements Serializable, Cloneable{
this.isRecommend = 0;
this.isTrueName = performanceStatus.getIsTrueName();
this.limitCount = performanceStatus.getLimitCount();
this.idCount = performanceStatus.getIdCount();
this.limitCountMember = 1;
this.sysDamai = 0;
this.isShow = performanceStatus.getIsShow();
......
......@@ -88,6 +88,9 @@ public class KylinPerformanceMisVo implements Cloneable{
@ApiModelProperty(value = "限购数量")
private Integer limitCount;
@ApiModelProperty(value = "实名限购数量")
private Integer idCount;
@ApiModelProperty(value = "限购数量")
private String createdAt;
......
......@@ -48,6 +48,9 @@ public class KylinTicketPartnerVo implements Serializable,Cloneable {
@ApiModelProperty(value = "限购数量", example = "0")
private Integer limitCount;
@ApiModelProperty(value = "限购数量", example = "0")
private Integer idCount;
@ApiModelProperty(value = "次数", example = "0")
private Integer counts;
......@@ -122,6 +125,10 @@ public class KylinTicketPartnerVo implements Serializable,Cloneable {
this.setSurplusGeneral(this.getTotalGeneral());
}
public Integer getIdCount() {
return idCount==null?limitCount:idCount;
}
private static final KylinTicketPartnerVo obj = new KylinTicketPartnerVo();
public static KylinTicketPartnerVo getNew() {
try {
......@@ -143,6 +150,7 @@ public class KylinTicketPartnerVo implements Serializable,Cloneable {
this.totalGeneral = ts.getTotalGeneral();
this.totalExchange = ts.getTotalExchange();
this.limitCount = ts.getLimitCount();
this.idCount = ts.getIdCount();
this.counts = ts.getCounts();
this.timeStart = DateUtil.Formatter.yyyyMMddHHmmss.format(t.getTimeStart());
this.timeEnd = DateUtil.Formatter.yyyyMMddHHmmss.format(t.getTimeEnd());
......
......@@ -264,7 +264,7 @@ public class KylinOrderRefundAdminController extends BaseController {
@ResponseBody
@ApiImplicitParams({
@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,
@NotNull(message = "类型不能为空") @RequestParam int type) {
......
......@@ -30,7 +30,7 @@ public class OrderSwitchAdminController {
@ApiOperation(value = "根据截取订单号获取全量订单号")
@ApiImplicitParams({
@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")
public ResponseDto<Object> loginSmsSwitch(@NotNull(message = "订单号不能为空") @RequestParam String code,
......
......@@ -15,6 +15,15 @@ public class OrderExportVo implements Serializable, Cloneable{
@Excel(name = "姓名", cellType = Excel.ColumnType.STRING)
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();
public static OrderExportVo getNew() {
......@@ -30,6 +39,10 @@ public class OrderExportVo implements Serializable, Cloneable{
this.setPerformanceTitle(source.getPerformanceTitle());
this.setUserMobile(source.getUserMobile());
this.setUserName(source.getUserName());
this.setTitle(source.getTitle());
this.setUseTime(source.getUseTime());
this.setUseStart(source.getUseStart());
this.setUseEnd(source.getUseEnd());
return this;
}
}
......@@ -142,8 +142,10 @@ public class ImportServiceImpl implements IImportService {
// 获取限购 实名
int ticketLimit = ticketData.getLimitCount();//普通票种限购
int ticketMemberLimit = ticketData.getLimitCountMember();//会员票种限购
int ticketIdCount = ticketData.getIdCount();//实名票种限购
int performanceLimit = performanceData.getLimitCount();//普通演出限购
int performanceMemberLimit = performanceData.getLimitCountMember();//会员演出限购
int performanceMemberLimit = 1;//会员演出限购
int performanceIdCount = performanceData.getIdCount();//实名演出限购
int isTrueName = ticketData.getIsTrueName();//是否演出实名
Integer isStudent = ticketData.getIsStudent();
String ticketType = "";
......@@ -184,7 +186,7 @@ public class ImportServiceImpl implements IImportService {
//限购判断 如果实名 则身份证维度限购 如果不实名则数量限购
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("")) {
orderOutLineVo.setReason(res1);
vos.add(orderOutLineVo);
......@@ -192,7 +194,7 @@ public class ImportServiceImpl implements IImportService {
continue;
}
} 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("")) {
orderOutLineVo.setReason(res1);
vos.add(orderOutLineVo);
......
......@@ -338,7 +338,7 @@ public class KylinDamaiServiceImpl extends ServiceImpl<KylinRoadShowsMapper, Kyl
}
public static void main(String[] args) {
Long a=IDGenerator.getDamaiCode("625614651458519045936293");
Long a=IDGenerator.getDamaiCode("1360935572095672321307852");
System.out.println(a);
}
......
......@@ -13,6 +13,7 @@ import com.liquidnet.client.admin.common.utils.DateUtils;
import com.liquidnet.client.admin.common.utils.ShiroUtils;
import com.liquidnet.commons.lang.util.BeanUtil;
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.ResponseDto;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
......@@ -33,6 +34,7 @@ import com.liquidnet.service.kylin.service.IKylinOrderRefundsService;
import com.mongodb.BasicDBObject;
import com.mongodb.client.result.UpdateResult;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
......@@ -558,6 +560,14 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
} else {
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) {
......
......@@ -271,43 +271,36 @@ public class DataUtils {
* @param buyCount 购买数量 大于 0 增加 小于 0 减少 对应 支付 退款表
*/
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);
// 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;
// redisDataSourceUtil.getRedisKylinUtil().set(ticketUseTimeKey, useTime);
redisKeyUid = KylinRedisConst.USERID_BUY_INFO + userId;
redisKeyIdCard = 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;
}
if (buyCount > 0) {
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKey, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKey, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyUid, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKeyUid, buyCount);
if (isTrueName != 0) {
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyIdCard, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKeyIdCard, buyCount);
}
} else {
redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKey, Math.abs(buyCount));
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKey, Math.abs(buyCount));
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));
}
}
......
......@@ -62,7 +62,7 @@ public class MongoVoUtils {
KylinFields fields = new KylinFields();
SlimeFieldsVo fieldsVo = dataUtils.getFieldsVoByFieldId(p3.getFieldId());
String cityName =fieldsVo.getCityName();
fields.setCityId(null);
fields.setCityId(Integer.parseInt(fieldsVo.getCityId()));
fields.setLatitude(fieldsVo.getLatitude());
fields.setLongitude(fieldsVo.getLongitude());
fields.setCityName(cityName);
......
......@@ -18,93 +18,101 @@ public class OrderUtils {
private DataUtils dataUtils;
public String judgeOrderLimit(
int type,
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceLimitCount,
int performanceMemberLimitCount,
int performanceLimitIdCard,
int ticketLimitCount,
int ticketMemberLimitCount,
int performanceBuyCount,
int ticketBuyCount,
int ticketLimitIdCard,
int memberType,
int isTrueName
) {
Integer[] integers;
if (101 == type) {
integers = festivalOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName);
} else {
integers = roadShowOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName);
}
return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, ticketLimitCount, ticketMemberLimitCount, memberType, integers[0], integers[1], isTrueName);
Integer[] integers = orderLimit(userId, idCard, performanceId, ticketId, isTrueName);
return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, performanceLimitIdCard,
ticketLimitCount, ticketMemberLimitCount,ticketLimitIdCard,
memberType, integers[0], integers[1], integers[2], integers[3], isTrueName);
}
public Integer[] roadShowOrderLimit(
public Integer[] orderLimit(
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName
) {
if (1 == isTrueName) {//实名
performanceBuyCount += dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCount += dataUtils.getIdCardTBuyCount(idCard, ticketId);
} else {//非实名
performanceBuyCount += dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount += dataUtils.getUserTBuyCount(userId, ticketId);
}
Integer[] array = new Integer[2];
array[0] = performanceBuyCount;
array[1] = ticketBuyCount;
return array;
}
int performanceBuyCountUid = 0;
int ticketBuyCountUid = 0;
int performanceBuyCountIdCard = 0;
int ticketBuyCountIdCard = 0;
public Integer[] festivalOrderLimit(
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName
) {
if (1 == isTrueName) {//实名
performanceBuyCount += dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCount += dataUtils.getIdCardTBuyCount(idCard, ticketId);
performanceBuyCountIdCard = dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCountIdCard = dataUtils.getIdCardTBuyCount(idCard, ticketId);
performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
} else {//非实名
performanceBuyCount += dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount += dataUtils.getUserTBuyCount(userId, ticketId);
performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
}
Integer[] array = new Integer[2];
array[0] = performanceBuyCount;
array[1] = ticketBuyCount;
Integer[] array = new Integer[4];
array[0] = performanceBuyCountUid;
array[1] = ticketBuyCountUid;
array[2] = performanceBuyCountIdCard;
array[3] = ticketBuyCountIdCard;
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 (performanceBuyCount > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCount > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
if(isTrueName==1){
if (performanceBuyCountIdCard > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return "实名制演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountIdCard > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "实名制票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
}else{
if (performanceBuyCountUid > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return "本场演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountUid > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "该票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
}
} else {//非会员区间
if (performanceBuyCount > performanceLimitCount && performanceLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCount > ticketLimitCount && ticketLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketLimitCount + "张,已超出";//超过票维度购买量
if(isTrueName==1){
if (performanceBuyCountUid > performanceLimitCount && performanceLimitCount != 0) {
return "本场演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量
}
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 "";
}
/**
* @param userId 用户id
* @param type 1新增 2修改
......
......@@ -467,6 +467,9 @@ public class PerformanceVoUtils {
ticketsMapper.insert(tickets);
ticketStatus.setStatus(9);
ticketStatus.setIsTrueName(performanceStatus.getIsTrueName());
if(ticketItem.getExpressType()==null){
ticketStatus.setExpressType(0);
}
ticketStatusMapper.insert(ticketStatus);
ticketRelationsMapper.insert(ticketRelations);
......@@ -481,6 +484,7 @@ public class PerformanceVoUtils {
} else {
//不改动数据 价格 限购 购票时间
ticketStatus.setLimitCount(null);
ticketStatus.setIdCount(null);
ticketStatus.setTotalGeneral(null);
ticketStatus.setTotalExchange(null);
tickets.setTimeStart(null);
......
......@@ -117,6 +117,16 @@ public abstract class DateUtil {
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 {
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 {
/**
* 秒级时间戳转 LocalDateTime
*
* @param epochMilli 秒级时间戳
* @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.ofEpochSecond(epochMilli,0, ZoneOffset.ofHours(8));
return LocalDateTime.ofEpochSecond(epochMilli, 0, ZoneOffset.ofHours(8));
}
/**
* 获取10位时间戳,精确到秒
*
* @return
*/
public static Long getNowSeconds(){
public static Long getNowSeconds() {
//获取秒数
Long second = LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8"));
//获取毫秒数
// Long milliSecond = LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
return second;
}
public static void main(String[] args) {
System.out.println(DateUtil.getNowTime());
//获取秒数
......@@ -535,7 +560,7 @@ public abstract class DateUtil {
//获取毫秒数
Long milliSecond = LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
System.out.println("second==="+second);
System.out.println("milliSecond==="+milliSecond);
System.out.println("second===" + second);
System.out.println("milliSecond===" + milliSecond);
}
}
......@@ -83,7 +83,7 @@ public class GoblinMix implements Serializable {
private String coverPic;
/**
* 商品视频地址/数字昌平视频地址
* 展示类型为1[详情图片地址]展示类型为2[商品视频地址/数字藏品视频地址]
*/
private String video;
......
......@@ -10,6 +10,16 @@ public class OrderExportDao {
private String userMobile;
//名称
private String userName;
//票种名称
private String title;
//适用时间
private String useTime;
//适用开始时间
private String useStart;
//适用结束时间
private String useEnd;
//订单号
private String orderCode;
//商户订单号
......
......@@ -79,6 +79,11 @@ public class KylinPerformanceStatus implements Serializable ,Cloneable{
*/
private Integer limitCount;
/**
* 实名限购张数 0无限 (开启实名 则实名限购 未开始为账号限购)
*/
private Integer idCount;
/**
* 会员限购张数 0无限 (开启实名 则实名限购 未开始为账号限购)
*/
......@@ -179,7 +184,7 @@ public class KylinPerformanceStatus implements Serializable ,Cloneable{
vo.getPerformanceStatusId(),vo.getPerformanceId(),
vo.getIsShow(),vo.getStatus(),vo.getStatusSell(),
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()
};
}
......
......@@ -119,6 +119,11 @@ public class KylinTicketStatus implements Serializable ,Cloneable {
*/
private Integer limitCount;
/**
* 实名限购张数 0无限 (开启实名 则实名限购 未开始为账号限购)
*/
private Integer idCount;
/**
* 会员限购张数 0无限 (开启实名 则实名限购 未开始为账号限购)
*/
......@@ -170,7 +175,7 @@ public class KylinTicketStatus implements Serializable ,Cloneable {
vo.getCounts(),vo.getStatusExchange(),vo.getIsShowCode(),
vo.getQrCodeShowTime(),vo.getIsLackRegister(),vo.getTotalGeneral(),
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(),
0,0,vo.getCreatedAt(),vo.getUpdatedAt()
......
......@@ -54,6 +54,11 @@
<result column="user_mobile" property="userMobile"/>
<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="code" property="code"/>
<result column="pay_code" property="payCode"/>
......@@ -626,22 +631,24 @@
</select>
<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
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
WHERE performance_id = #{performancesId}
GROUP BY user_mobile;
INNER JOIN kylin_tickets as kt on kt.tickets_id = kotr.ticket_id
WHERE performance_id = #{performancesId}
GROUP BY user_mobile,tickets_id;
</select>
<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
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_tickets as kt on kt.tickets_id = kotr.ticket_id
WHERE performance_id = #{performancesId}
AND status IN (1, 3)
GROUP BY user_mobile;
GROUP BY user_mobile,tickets_id;
</select>
<select id="getPerformanceSimpleByTicketId" resultType="com.liquidnet.service.kylin.dao.PerformanceSimpleAllDao">
<!-- select kp.performances_id as performancesId,-->
......
package com.liquidnet.service.consumer.kylin.receiver;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.OrderCloseMapping;
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.KylinOrderTicketVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.stream.StreamListener;
import java.util.HashMap;
@Slf4j
public abstract class AbstractSqlOptOrderCloseRedisReceiver implements StreamListener<String, MapRecord<String, String, String>> {
@Autowired
StringRedisTemplate stringRedisTemplate;
@Autowired
private RedisUtil redisUtil;
@Autowired
private KylinUtils kylinUtils;
@Override
public void onMessage(MapRecord<String, String, String> message) {
String redisStreamKey = this.getRedisStreamKey();
log.debug("CONSUMER MSG[streamKey:{},messageId:{},stream:{},body:{}]", redisStreamKey, message.getId(), message.getStream(), message.getValue());
boolean result = this.consumerSqlOperationOrderCloseHandler(message.getValue().get("message"));
log.info("CONSUMER MSG RESULT:{} ==> [{}]MESSAGE_ID:{}", result, redisStreamKey, message.getId());
try {
stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message);
} catch (Exception e) {
log.error("#CONSUMER MSG EX_ACK ==> [{}]RESULT:{},MESSAGE:{}", redisStreamKey, result, message.getValue(), e);
}
try {
stringRedisTemplate.opsForStream().delete(redisStreamKey, message.getId());
} catch (Exception e) {
log.error("#CONSUMER MSG EX_DEL ==> [{}]RESULT:{},MESSAGE:{}", redisStreamKey, result, message.getValue(), e);
}
}
private boolean consumerSqlOperationOrderCloseHandler(String msg) {
boolean aBoolean = false;
try {
OrderCloseMapping.orderCloseMessage mqMessage = JsonUtils.fromJson(msg, OrderCloseMapping.orderCloseMessage.class);
for (int x = 0; x < mqMessage.getOrderTicketIds().size(); x++) {
String t = mqMessage.getOrderTicketIds().get(x);
String orderTicketId = t.split(",")[0];
String uid = t.split(",")[1];
KylinOrderTicketVo vo = kylinUtils.getOrderTicketVo(orderTicketId);
vo.setStatus(2);
redisUtil.set("kylin:order:id:" + orderTicketId, vo);
kylinUtils.resetOrderListVo(uid, 2, orderTicketId, vo);
// redis 限购
for (int i = 0; i < vo.getEntitiesVoList().size(); i++) {
KylinOrderTicketEntitiesVo items = vo.getEntitiesVoList().get(i);
kylinUtils.changeBuyInfo(items.getUserId(), items.getEnterIdCode(), items.getPerformanceId(), items.getTicketId(), -1);
}
}
aBoolean = true;
} catch (Exception e) {
log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), msg, e);
} finally {
if (!aBoolean) {
HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", msg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(this.getRedisStreamKey()));
}
}
return aBoolean;
}
protected abstract String getRedisStreamKey();
protected abstract String getRedisStreamGroup();
}
//package com.liquidnet.service.consumer.kylin.receiver;
//
//import com.liquidnet.common.cache.redis.util.RedisUtil;
//import com.liquidnet.commons.lang.util.CollectionUtil;
//import com.liquidnet.commons.lang.util.JsonUtils;
//import com.liquidnet.service.base.OrderCloseMapping;
//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.KylinOrderTicketVo;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.redis.connection.stream.MapRecord;
//import org.springframework.data.redis.connection.stream.StreamRecords;
//import org.springframework.data.redis.core.StringRedisTemplate;
//import org.springframework.data.redis.stream.StreamListener;
//
//import java.util.HashMap;
//
//@Slf4j
//public abstract class AbstractSqlOptOrderCloseRedisReceiver implements StreamListener<String, MapRecord<String, String, String>> {
// @Autowired
// StringRedisTemplate stringRedisTemplate;
// @Autowired
// private RedisUtil redisUtil;
// @Autowired
// private KylinUtils kylinUtils;
//
// @Override
// public void onMessage(MapRecord<String, String, String> message) {
// String redisStreamKey = this.getRedisStreamKey();
// log.debug("CONSUMER MSG[streamKey:{},messageId:{},stream:{},body:{}]", redisStreamKey, message.getId(), message.getStream(), message.getValue());
// boolean result = this.consumerSqlOperationOrderCloseHandler(message.getValue().get("message"));
// log.info("CONSUMER MSG RESULT:{} ==> [{}]MESSAGE_ID:{}", result, redisStreamKey, message.getId());
//
// try {
// stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message);
// } catch (Exception e) {
// log.error("#CONSUMER MSG EX_ACK ==> [{}]RESULT:{},MESSAGE:{}", redisStreamKey, result, message.getValue(), e);
// }
// try {
// stringRedisTemplate.opsForStream().delete(redisStreamKey, message.getId());
// } catch (Exception e) {
// log.error("#CONSUMER MSG EX_DEL ==> [{}]RESULT:{},MESSAGE:{}", redisStreamKey, result, message.getValue(), e);
// }
// }
//
// private boolean consumerSqlOperationOrderCloseHandler(String msg) {
// boolean aBoolean = false;
// try {
// OrderCloseMapping.orderCloseMessage mqMessage = JsonUtils.fromJson(msg, OrderCloseMapping.orderCloseMessage.class);
//
// for (int x = 0; x < mqMessage.getOrderTicketIds().size(); x++) {
// String t = mqMessage.getOrderTicketIds().get(x);
// String orderTicketId = t.split(",")[0];
// String uid = t.split(",")[1];
// KylinOrderTicketVo vo = kylinUtils.getOrderTicketVo(orderTicketId);
// vo.setStatus(2);
// redisUtil.set("kylin:order:id:" + orderTicketId, vo);
//
// kylinUtils.resetOrderListVo(uid, 2, orderTicketId, vo);
// // redis 限购
// for (int i = 0; i < vo.getEntitiesVoList().size(); i++) {
// KylinOrderTicketEntitiesVo items = vo.getEntitiesVoList().get(i);
// kylinUtils.changeBuyInfo(items.getUserId(), items.getEnterIdCode(), items.getPerformanceId(), items.getTicketId(), -1);
// }
// }
//
// aBoolean = true;
// } catch (Exception e) {
// log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), msg, e);
// } finally {
// if (!aBoolean) {
// HashMap<String, String> map = CollectionUtil.mapStringString();
// map.put("message", msg);
// stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(this.getRedisStreamKey()));
// }
// }
// return aBoolean;
// }
//
// protected abstract String getRedisStreamKey();
//
// protected abstract String getRedisStreamGroup();
//}
package com.liquidnet.service.consumer.kylin.receiver;
import com.liquidnet.service.base.constant.MQConst;
import org.springframework.stereotype.Component;
@Component
public class ConsumerKylinSqlOptOrderCloseRedisReceiver extends AbstractSqlOptOrderCloseRedisReceiver {
@Override
protected String getRedisStreamKey() {
return MQConst.KylinQueue.SQL_ORDER_CLOSE.getKey();
}
@Override
protected String getRedisStreamGroup() {
return MQConst.KylinQueue.SQL_ORDER_CLOSE.getGroup();
}
}
//package com.liquidnet.service.consumer.kylin.receiver;
//
//import com.liquidnet.service.base.constant.MQConst;
//import org.springframework.stereotype.Component;
//
//@Component
//public class ConsumerKylinSqlOptOrderCloseRedisReceiver extends AbstractSqlOptOrderCloseRedisReceiver {
// @Override
// protected String getRedisStreamKey() {
// return MQConst.KylinQueue.SQL_ORDER_CLOSE.getKey();
// }
//
// @Override
// protected String getRedisStreamGroup() {
// return MQConst.KylinQueue.SQL_ORDER_CLOSE.getGroup();
// }
//}
......@@ -83,45 +83,26 @@ 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);
// public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) {
// String redisKey;
// int isTrueName = getPerformanceIsTrueName(performanceId);
// if (0 == isTrueName) {
// redisKey = KylinRedisConst.USERID_BUY_INFO + userId;
// } else {
// redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard;
// }
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));
}
}
//
// String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
// String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
//
// 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 详情
......
......@@ -131,21 +131,36 @@ public class KylinOrderUtils {
* @param 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);
if (0 == isTrueName) {
redisKey = KylinRedisConst.USERID_BUY_INFO + userId;
} else {
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard;
redisKeyUid = KylinRedisConst.USERID_BUY_INFO + userId;
redisKeyIdCard = 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) {
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKey, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKey, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyUid, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKeyUid, buyCount);
if (isTrueName != 0) {
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyIdCard, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKeyIdCard, buyCount);
}
} else {
redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKey, Math.abs(buyCount));
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKey, Math.abs(buyCount));
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));
}
}
......
......@@ -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 详情
*
......
......@@ -17,7 +17,7 @@ CREATE TABLE `goblin_mix`
`intro` varchar(512) DEFAULT NULL COMMENT '商品简介/购买须知',
`watch_type` char(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '展示文件类型[1-图片|2-视频|3-模型]',
`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 '数字藏品图片地址',
`details` text COMMENT '商品详情/藏品详情',
......
package com.liquidnet.service.goblin.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.vo.HelpValueVo;
import com.liquidnet.service.goblin.service.IGoblinGoodsAnticipateService;
......@@ -98,4 +99,25 @@ public class GoblinGoodsAnticipateController {
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;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.manage.IGoblinGoodsAnticipateMgService;
import com.liquidnet.service.goblin.service.manage.IGoblinMixAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -29,6 +30,7 @@ public class GoblinMixAppController {
@Autowired
IGoblinMixAppService goblinMixAppService;
@ApiOperationSupport(order = 1)
@ApiOperation(value = "列表")
@ApiImplicitParams({
......@@ -78,4 +80,5 @@ public class GoblinMixAppController {
public ResponseDto<Boolean> mixCanBy(@RequestParam(value = "mixId", required = true) String mixId) {
return goblinMixAppService.canBy(mixId, CurrentUtil.getCurrentUid());
}
}
......@@ -2,6 +2,7 @@ package com.liquidnet.service.goblin.service.impl;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.adam.dto.vo.AdamUserInfoVo;
import com.liquidnet.service.base.ErrorMapping;
......@@ -20,12 +21,16 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.unit.DataUnit;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedList;
import java.util.List;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
/**
* <p>
* 预约表 服务实现类
......@@ -84,16 +89,16 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
return ResponseDto.failure("预约失败!");
}
} else {
log.debug("skuId:{},需要助力人数:{},uid:{},该用户未开启分享助力!",skuId,anticipateValueVo.getPeopleType(),uid);
log.debug("skuId:{},需要助力人数:{},uid:{},该用户未开启分享助力!", skuId, anticipateValueVo.getPeopleType(), uid);
return ResponseDto.failure("预约失败!");
}
}
uidAboutBySkuId(skuId, uid,null);
uidAboutBySkuId(skuId, uid, null);
}
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();
user.setUid(uid);
user.setSkuId(skuId);
......@@ -119,7 +124,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
List<String> userAvatar = goblinRedisUtils.getUserAvatar(skuId);
if (userAvatar != null && userAvatar.size() <= 2) {
//获取预约人头像
if (avatar==null){
if (avatar == null) {
avatar = goblinAnticipateUtils.getUserInfo().getAvatar();
}
goblinRedisUtils.setUserAvatar(skuId, avatar);
......@@ -149,8 +154,8 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//可以创建分享
//查询redis关联记录
String sid = goblinRedisUtils.getShare(skuId, uid);
if (sid!=null) {
return ResponseDto.failure("0","已开启助力",sid);
if (sid != null) {
return ResponseDto.failure("0", "已开启助力", sid);
} else {
//查询sku需要助力人数
//Integer skuIdPeople = goblinRedisUtils.getSharePeopleBySkuId(skuId);
......@@ -177,7 +182,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//redis缓存
Duration between = Duration.between(valueBySkuId.getAboutStartDate(), valueBySkuId.getAboutEndDate());
goblinRedisUtils.setShare(skuId, uid, sid,between.toDays());
goblinRedisUtils.setShare(skuId, uid, sid, between.toDays());
//redis存储用户分享
goblinRedisUtils.setShareVo(goblinGoodsAnticipateShareVo);
......@@ -213,7 +218,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//获取uid
String uid = CurrentUtil.getCurrentUid();
if (shareVo.getUid().equals(uid)){
if (shareVo.getUid().equals(uid)) {
return ResponseDto.failure(ErrorMapping.get(150003));
}
//查询mongodb 是否助力过该分享
......@@ -235,10 +240,10 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
if (helpUserAvatar.size() <= 6) {
//获取用户头像保存
AdamUserInfoVo userInfo = goblinAnticipateUtils.getUserInfo();
if (userInfo!=null){
if (userInfo != null) {
//新增助力头像
goblinRedisUtils.setHelpUserAvatar(sid, userInfo.getAvatar());
}else {
} else {
return ResponseDto.failure(ErrorMapping.get(150008));
}
}
......@@ -260,13 +265,13 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
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();
}else {
log.debug("help() false ------> sid:{}",sid);
} else {
log.debug("help() false ------> sid:{}", sid);
return ResponseDto.failure(ErrorMapping.get(150004));
}
}
......@@ -293,7 +298,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
public ResponseDto<Boolean> helpSid(String sid) {
String uid = CurrentUtil.getCurrentUid();
Integer help = goblinRedisUtils.getHelpByUidAndSid(uid, sid);
if (help == null){
if (help == null) {
return ResponseDto.success(false);
}
return ResponseDto.success(true);
......@@ -308,4 +313,47 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
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;
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.IDGenerator;
import com.liquidnet.commons.lang.util.DateUtil;
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.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.IGoblinMixService;
import com.liquidnet.service.goblin.util.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
......@@ -21,12 +12,9 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
......@@ -59,16 +47,17 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService {
} else {
return ResponseDto.failure();
}
String nowTime = DateUtil.getNowTime();
for (String mixId : startList) {
GoblinMixDetailsVo vo = redisUtils.getMixDetails(mixId);
GoblinMixAppListVo itemVo = GoblinMixAppListVo.getNew().copy(vo);
GoblinMixAppListVo itemVo = GoblinMixAppListVo.getNew().copy(vo, nowTime);
itemVo.setStatus(6);
voList.add(itemVo);
}
for (String mixId : stockList) {
GoblinMixDetailsVo vo = redisUtils.getMixDetails(mixId);
GoblinMixAppListVo itemVo = GoblinMixAppListVo.getNew().copy(vo);
GoblinMixAppListVo itemVo = GoblinMixAppListVo.getNew().copy(vo, nowTime);
itemVo.setStatus(8);
voList.add(itemVo);
}
......@@ -79,11 +68,17 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService {
@Override
public ResponseDto<GoblinMixAppDetailsVo> mixDetails(String mixId) {
GoblinMixDetailsVo baseVo = redisUtils.getMixDetails(mixId);
if(baseVo==null){
if (baseVo == null) {
return ResponseDto.failure("参数异常");
}
GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVo(baseVo.getStoreId());
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;
for (GoblinMixDetailsItemVo item : vo.getItem()) {
GoblinGoodsSkuInfoVo skuInfoVo = redisUtils.getGoodsSkuInfoVo(item.getSkuId());
......
......@@ -72,7 +72,7 @@ public class GoblinJobServiceImpl {
LocalDateTime nt = LocalDateTime.now();
//筛选 活动中 和 活动中且售罄的
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);
if (nt.isAfter(st) && nt.isBefore(et)) {//活动中
int stock = 0;
......@@ -98,7 +98,8 @@ public class GoblinJobServiceImpl {
}
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);
if (nt.isAfter(st) && nt.isBefore(et)) {//活动中
int stock = 0;
......
......@@ -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.GoblinGoodsAnticipateValueVo;
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.util.GoblinAnticipateUtils;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
......@@ -30,6 +32,8 @@ import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
/**
* <p>
* 预约表 服务实现类
......
......@@ -4,18 +4,18 @@ 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.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping;
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.param.GoblinMixDetailsItemParam;
import com.liquidnet.service.goblin.param.GoblinMixDetailsParam;
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.util.*;
import io.github.classgraph.json.JSONUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -141,6 +141,10 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
item.setSkuSurplusStock(redisUtils.getSkuStock(null, item.getSkuId()));
}
}
//旧数据支持
//上架时间
vo.setShelvesTime(vo.getShelvesTime() != null && !"".equals(vo.getShelvesTime()) ? vo.getShelvesTime() : vo.getTimeStart());
return ResponseDto.success(vo);
}
......@@ -150,6 +154,10 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
String uid = CurrentUtil.getCurrentUid();
List<GoblinMixDetailsItemVo> itemList = ObjectUtil.goblinMixDetailsItemVo();
List<GoblinMixDetailsItemParam> itemParams = param.getItem();
//开启预约 判断上架时间必须大于开始时间
if (DateUtil.compareStrDay(param.getShelvesTime(), param.getTimeStart()) > 0) {
return ResponseDto.failure("售卖时间不能超过上架时间!");
}
//判断活动名称
int count = (int) mongoUtils.getMixNameCount(param.getName());
......@@ -195,7 +203,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
mixId, uid, vo.getName(), vo.getTimeStart(), vo.getTimeEnd(), 6, vo.getShowPosition(),
vo.getSellName(), vo.getExpressPrice(), vo.getIntro(), vo.getWatchType(), vo.getCoverPic(),
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
redisUtils.setMixDetails(mixId, vo);
......@@ -215,6 +223,11 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
String uid = CurrentUtil.getCurrentUid();
GoblinMixDetailsVo vo = redisUtils.getMixDetails(param.getMixId());
String oldWhiteUrl = vo.getWhiteUrl();
//开启预约 判断上架时间必须大于开始时间
if (DateUtil.compareStrDay(param.getShelvesTime(), vo.getTimeStart()) > 0) {
return ResponseDto.failure("售卖时间不能超过上架时间!");
}
if (!vo.getUserId().equals(uid)) {
return ResponseDto.failure("身份异常");
}
......@@ -235,6 +248,8 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
vo.setWhiteType(param.getWhiteType());
vo.setWhiteUrl(param.getWhiteUrl());
vo.setXlsName(param.getXlsName());
vo.setShelvesTime(param.getShelvesTime());
vo.setReserve(param.getReserve());
//redis
redisUtils.setMixDetails(param.getMixId(), vo);
redisList(vo.getShowPosition(), vo.getMixId(), vo.getStatus());
......@@ -245,7 +260,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
mongoUtils.changeGoblinMixDetailsVo(vo);
//sql入库
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();
}
......
......@@ -2597,6 +2597,24 @@ public class GoblinRedisUtils {
mixIds.add(mixId);
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
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_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
adam_user_busi_acct.add=INSERT INTO adam_user_busi_acct (`uid`, busi, uuid, `work`, ppwd, `state`, created_at) VALUES (?,?,?,?,?,?,?)
#---- \u9ED1\u767D\u540D\u5355 ----
......@@ -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_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_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 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
#---- \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`,`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_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 = ?
\ No newline at end of file
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
......@@ -652,8 +652,10 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
// 获取限购 实名
int ticketLimit = ticketData.getLimitCount();//普通票种限购
int ticketMemberLimit = ticketData.getLimitCountMember();//会员票种限购
int ticketIdCount = ticketData.getIdCount();//实名票种限购
int performanceLimit = performanceData.getLimitCount();//普通演出限购
int performanceMemberLimit = performanceData.getLimitCountMember();//会员演出限购
int performanceMemberLimit = 1;//会员演出限购
int performanceIdCount = performanceData.getIdCount();//实名演出限购
int isTrueName = ticketData.getIsTrueName();//是否演出实名
//实名判断
......@@ -688,14 +690,20 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
//限购判断 如果实名 则身份证维度限购 如果不实名则数量限购
if (entersVoList.size() > 0) {
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("")) {
for (int x = 0; x <= i; x++) {
dataUtils.changeBuyInfo(uid, entersVoList.get(x).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), -1);
}
return ResponseDto.failure(res1);//乱七八糟异常
}
}
} 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("")) {
dataUtils.changeBuyInfo(uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), -orderTicketVo.getNumber());
return ResponseDto.failure(res1);//乱七八糟异常
}
}
......@@ -831,7 +839,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
orderTicketEntitiesVo.setUpdatedAt(null);
orderTicketEntitiesVo.setChangeDate(orderTicketEntities.getCreatedAt());
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());
......
......@@ -975,25 +975,36 @@ public class DataUtils {
}
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);
if (0 == isTrueName) {
redisKey = KylinRedisConst.USERID_BUY_INFO + userId;
} else {
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard;
redisKeyUid = KylinRedisConst.USERID_BUY_INFO + userId;
redisKeyIdCard = 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) {
redisUtil.incr(ticketIdKey, buyCount);
redisUtil.incr(performanceIdKey, buyCount);
redisUtil.incr(ticketIdKeyUid, buyCount);
redisUtil.incr(performanceIdKeyUid, buyCount);
if (isTrueName != 0) {
redisUtil.incr(ticketIdKeyIdCard, buyCount);
redisUtil.incr(performanceIdKeyIdCard, buyCount);
}
} else {
redisUtil.decr(ticketIdKey, Math.abs(buyCount));
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
if (isTrueName != 0) {
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 {
public String judgeOrderLimit(
int type,
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceLimitCount,
int performanceMemberLimitCount,
int performanceLimitIdCard,
int ticketLimitCount,
int ticketMemberLimitCount,
int performanceBuyCount,
int ticketBuyCount,
int ticketLimitIdCard,
int memberType,
int isTrueName
) {
Integer[] integers;
if (101 == type) {
integers = festivalOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName);
} else {
integers = roadShowOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName);
}
return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, ticketLimitCount, ticketMemberLimitCount, memberType, integers[0], integers[1], isTrueName);
Integer[] integers = orderLimit(userId, idCard, performanceId, ticketId, isTrueName);
return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, performanceLimitIdCard,
ticketLimitCount, ticketMemberLimitCount, ticketLimitIdCard,
memberType, integers[0], integers[1], integers[2], integers[3], isTrueName);
}
public Integer[] roadShowOrderLimit(
public Integer[] orderLimit(
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName
) {
if (1 == isTrueName) {//实名
performanceBuyCount += dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCount += dataUtils.getIdCardTBuyCount(idCard, ticketId);
} else {//非实名
performanceBuyCount += dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount += dataUtils.getUserTBuyCount(userId, ticketId);
}
Integer[] array = new Integer[2];
array[0] = performanceBuyCount;
array[1] = ticketBuyCount;
return array;
}
int performanceBuyCountUid = 0;
int ticketBuyCountUid = 0;
int performanceBuyCountIdCard = 0;
int ticketBuyCountIdCard = 0;
public Integer[] festivalOrderLimit(
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName
) {
if (1 == isTrueName) {//实名
performanceBuyCount += dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCount += dataUtils.getIdCardTBuyCount(idCard, ticketId);
performanceBuyCountIdCard = dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCountIdCard = dataUtils.getIdCardTBuyCount(idCard, ticketId);
performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
} else {//非实名
performanceBuyCount += dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount += dataUtils.getUserTBuyCount(userId, ticketId);
performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
}
Integer[] array = new Integer[2];
array[0] = performanceBuyCount;
array[1] = ticketBuyCount;
Integer[] array = new Integer[4];
array[0] = performanceBuyCountUid;
array[1] = ticketBuyCountUid;
array[2] = performanceBuyCountIdCard;
array[3] = ticketBuyCountIdCard;
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 (performanceBuyCount > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCount > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
if (isTrueName == 1) {
if (performanceBuyCountIdCard > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return "实名制演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountIdCard > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "实名制票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
} else {
if (performanceBuyCountUid > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return "本场演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountUid > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "该票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
}
} else {//非会员区间
if (performanceBuyCount > performanceLimitCount && performanceLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCount > ticketLimitCount && ticketLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketLimitCount + "张,已超出";//超过票维度购买量
if (isTrueName == 1) {
if (performanceBuyCountUid > performanceLimitCount && performanceLimitCount != 0) {
return "本场演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量
}
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 "";
}
/**
* @param userId 用户id
* @param type 1新增 2修改
......@@ -184,7 +193,7 @@ public class OrderUtils {
public List<AdamEntersVo> getEnters(String entersIds, String uid) {
MultiValueMap<String, String> headers = CollectionUtil.linkedMultiValueMapStringString();
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>>>() {
});
return ResponseVo.getData();
......
......@@ -98,6 +98,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
public ResponseDto<PayInnerResultVo> checkCanOrder(PayOrderParam payOrderParam) {
boolean isDownGeneral = false;
boolean isPay = true;
boolean useAdvance = false;
String performanceId = "";
List<AdamEntersVo> entersVoList = ObjectUtil.cloneArrayListObject();
String uid = CurrentUtil.getCurrentUid();
HashMap<String, Object> advanceMap = null;
......@@ -128,7 +130,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
break;
}
}
performanceId = performanceData.getPerformancesId();
if (ticketTimesData == null || ticketData == null) {
return ResponseDto.failure(ErrorMapping.get("20004"));//参数错误
}
......@@ -204,9 +206,14 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
int memberType; //会员状态 不需要判断会员 1判断会员逻辑 2会员专属
if (DateUtil.compareStrDay(DateUtil.getNowTime(), memberTimeStart) == 1 && DateUtil.compareStrDay(DateUtil.getNowTime(), timeStart) == -1){//优先时间
if(payOrderParam.getNumber()>2){
return ResponseDto.failure("非法下单");
if (DateUtil.compareStrDay(DateUtil.getNowTime(), memberTimeStart) == 1 && DateUtil.compareStrDay(DateUtil.getNowTime(), timeStart) == -1) {//优先时间
if (payOrderParam.getNumber() > ticketData.getCounts()) {
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) {
......@@ -230,9 +237,10 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
// 获取限购 实名
int ticketLimit = ticketData.getLimitCount();//普通票种限购
int ticketMemberLimit = ticketData.getLimitCountMember();//会员票种限购
int ticketIdCount = ticketData.getIdCount();//实名票种限购
int performanceLimit = performanceData.getLimitCount();//普通演出限购
// int performanceMemberLimit = performanceData.getLimitCountMember();//会员演出限购
int performanceMemberLimit = 1;//会员演出限购
int performanceIdCount = performanceData.getIdCount();//实名演出限购
int isTrueName = ticketData.getIsTrueName();//是否演出实名
if (!canBuyStatus.contains(performanceData.getAppStatus())) {
......@@ -266,6 +274,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid);
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
if (entersVoList.size() > 0) {
for (int i = 0; i < entersVoList.size(); i++) {
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("")) {
for (int x = 0; x <= i; x++) {
dataUtils.changeBuyInfo(uid, entersVoList.get(x).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), -1);
......@@ -357,7 +372,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
} else {
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("")) {
dataUtils.changeBuyInfo(uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), -payOrderParam.getNumber());
orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), payOrderParam.getNumber());
......@@ -376,6 +391,9 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), payOrderParam.getNumber());
log.error("回滚库存");
orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid);
if (useAdvance) {
dataUtils.decrUseCouponCount(uid, performanceId);
}
for (AdamEntersVo enters : entersVoList) {
dataUtils.changeBuyInfo(uid, enters.getIdCard(), payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), -1);
}
......
......@@ -123,44 +123,38 @@ public class DataUtils {
* @param buyCount 购买数量 大于 0 增加 小于 0 减少 对应 支付 退款表
*/
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);
// 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) {
redisKey = KylinRedisConst.USERID_BUY_INFO + userId;
} else {
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard;
redisKeyUid = KylinRedisConst.USERID_BUY_INFO + userId;
redisKeyIdCard = 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;
// String ticketUseTimeKey = ticketIdKey + ":" + KylinRedisConst.USE_TIME;
// redisUtil.set(ticketUseTimeKey, useTime);
if (buyCount > 0) {
redisUtil.incr(ticketIdKey, buyCount);
redisUtil.incr(performanceIdKey, buyCount);
redisUtil.incr(ticketIdKeyUid, buyCount);
redisUtil.incr(performanceIdKeyUid, buyCount);
if (isTrueName != 0) {
redisUtil.incr(ticketIdKeyIdCard, buyCount);
redisUtil.incr(performanceIdKeyIdCard, buyCount);
}
} else {
redisUtil.decr(ticketIdKey, Math.abs(buyCount));
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
if (isTrueName != 0) {
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 {
String redisKey = KylinRedisConst.ADAM_IS_MEMBER
.concat(uid);
Object obj = redisUtil.get(redisKey);
if(obj==null){
if (obj == null) {
return null;
}else{
} else {
return (Integer) obj;
}
}
// 获取快递价格
public BigDecimal getExpressPrice(String adCode, String productCode){
BigDecimal price ;
public BigDecimal getExpressPrice(String adCode, String productCode) {
BigDecimal price;
Object obj = redisUtil.get(KylinRedisConst.RETURN_ADDRESS_CODE + adCode + KylinRedisConst.EXPRESS_TYPE + productCode);
if (obj != null) {
KylinFreightChargeDao k = (KylinFreightChargeDao) obj;
......@@ -321,9 +315,9 @@ public class DataUtils {
public String getTicketPayTxt(String ticketId) {
String rdsKey = KylinRedisConst.TICKET_PAY_TXT.concat(ticketId);
Object obj = redisUtil.get(rdsKey);
if(obj==null){
if (obj == null) {
return "";
}else{
} else {
return (String) obj;
}
}
......@@ -338,4 +332,44 @@ public class DataUtils {
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 {
private String candyUrl;
@Value("${liquidnet.service.smile.url}")
private String smile;
@Value("${liquidnet.service.stone.url}")
private String stoneUrl;
public String judgeOrderLimit(
int type,
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceLimitCount,
int performanceMemberLimitCount,
int performanceLimitIdCard,
int ticketLimitCount,
int ticketMemberLimitCount,
int performanceBuyCount,
int ticketBuyCount,
int ticketLimitIdCard,
int memberType,
int isTrueName
) {
Integer[] integers;
if (101 == type) {
integers = festivalOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName);
} else {
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);
Integer[] integers = orderLimit(userId, idCard, performanceId, ticketId, isTrueName);
return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, performanceLimitIdCard,
ticketLimitCount, ticketMemberLimitCount,ticketLimitIdCard,
memberType, integers[0], integers[1], integers[2], integers[3], isTrueName);
}
public Integer[] roadShowOrderLimit(
public Integer[] orderLimit(
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName
) {
if (1 == isTrueName) {//实名
performanceBuyCount = dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCount = dataUtils.getIdCardTBuyCount(idCard, ticketId);
} else {//非实名
performanceBuyCount = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount = dataUtils.getUserTBuyCount(userId, ticketId);
}
Integer[] array = ObjectUtil.cloneInteger2Array();
array[0] = performanceBuyCount;
array[1] = ticketBuyCount;
return array;
}
int performanceBuyCountUid = 0;
int ticketBuyCountUid = 0;
int performanceBuyCountIdCard = 0;
int ticketBuyCountIdCard = 0;
public Integer[] festivalOrderLimit(
String userId,
String idCard,
String performanceId,
String ticketId,
int performanceBuyCount,
int ticketBuyCount,
int isTrueName
) {
if (1 == isTrueName) {//实名
performanceBuyCount = dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCount = dataUtils.getIdCardTBuyCount(idCard, ticketId);
performanceBuyCountIdCard = dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCountIdCard = dataUtils.getIdCardTBuyCount(idCard, ticketId);
performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
} else {//非实名
performanceBuyCount = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount = dataUtils.getUserTBuyCount(userId, ticketId);
performanceBuyCountUid = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCountUid = dataUtils.getUserTBuyCount(userId, ticketId);
}
Integer[] array = ObjectUtil.cloneInteger2Array();
array[0] = performanceBuyCount;
array[1] = ticketBuyCount;
Integer[] array = new Integer[4];
array[0] = performanceBuyCountUid;
array[1] = ticketBuyCountUid;
array[2] = performanceBuyCountIdCard;
array[3] = ticketBuyCountIdCard;
return array;
}
public String judgeMemberType(int performanceLimitCount, int performanceMemberLimitCount, int ticketLimitCount, int ticketMemberLimitCount, int memberType, int performanceBuyCount, int ticketBuyCount, int isTrueName) {
log.debug("会员限购演出=" + performanceMemberLimitCount);
log.debug("限购演出=" + performanceLimitCount);
log.debug("会员限购票种=" + ticketMemberLimitCount);
log.debug("限购票种=" + ticketLimitCount);
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 (performanceBuyCount > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCount > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
if(isTrueName==1){
if (performanceBuyCountIdCard > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return "实名制演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountIdCard > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "实名制票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
}else{
if (performanceBuyCountUid > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return "本场演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCountUid > ticketMemberLimitCount && ticketMemberLimitCount != 0) {
return "该票种限购" + ticketMemberLimitCount + "张,已超出";//超过票维度购买量
}
}
} else {//非会员区间
if (performanceBuyCount > performanceLimitCount && performanceLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceLimitCount + "张,已超出";//超过演出维度购买量
}
if (ticketBuyCount > ticketLimitCount && ticketLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "该") + "票种限购" + ticketLimitCount + "张,已超出";//超过票维度购买量
if(isTrueName==1){
if (performanceBuyCountIdCard > performanceLimitIdCard && performanceLimitIdCard != 0) {
return "实名制演出限购" + performanceLimitIdCard + "张,已超出";//超过演出维度购买量
}
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 "";
......
......@@ -136,6 +136,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
BeanUtils.copyProperties(step1Param, performancePartnerVo);
performancePartnerVo.setIsTrueName(0);
performancePartnerVo.setLimitCount(0);
performancePartnerVo.setIdCount(0);
performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(0);
performancePartnerVo.setStatus(0);
......@@ -183,6 +184,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
if (data != null) { // 有修改记录
performancePartnerVo.setIsTrueName(data.getIsTrueName());
performancePartnerVo.setLimitCount(data.getLimitCount());
performancePartnerVo.setIdCount(data.getIdCount());
performancePartnerVo.setStatusSell(data.getStatusSell());
performancePartnerVo.setRoadShowId(data.getRoadShowId());
performancePartnerVo.setProjectId(data.getProjectId());
......@@ -196,6 +198,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
KylinPerformanceRelations relationsData = performanceRelationsMapper.selectOne(Wrappers.lambdaQuery(KylinPerformanceRelations.class).eq(KylinPerformanceRelations::getPerformanceId, performanceId));
performancePartnerVo.setIsTrueName(statusData.getIsTrueName());
performancePartnerVo.setLimitCount(statusData.getLimitCount());
performancePartnerVo.setIdCount(statusData.getStatus());
performancePartnerVo.setStatusSell(statusData.getStatusSell());
performancePartnerVo.setRoadShowId(relationsData.getRoadShowId());
performancePartnerVo.setProjectId(relationsData.getProjectId());
......@@ -387,6 +390,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
performanceStatus.setAuditStatus((int) map.get("auditStatus"));
performanceStatus.setIsTrueName(step2Param.getIsTrueName());
performanceStatus.setLimitCount(step2Param.getLimitCount());
performanceStatus.setIdCount(step2Param.getIdCount());
performanceStatusMapper.update(performanceStatus, Wrappers.lambdaQuery(KylinPerformanceStatus.class).eq(KylinPerformanceStatus::getPerformanceId, performanceId));
dataUtils.setPerformanceIsTrueName(performanceId, step2Param.getIsTrueName());
......@@ -412,6 +416,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
inventory.setTotalGeneral(ticketItem.getTotalGeneral());
inventory.setIsTrueName(kylinPerformanceMisVo.getIsTrueName());
inventory.setLimitCount(ticketItem.getLimitCount());
inventory.setLimitCount(ticketItem.getIdCount());
inventory.setIsLackRegister(ticketItem.getIsLackRegister());
inventory.setIsExpress(ticketItem.getIsExpress());
inventory.setIsElectronic(ticketItem.getIsElectronic());
......
......@@ -155,13 +155,13 @@ public class DataUtils {
public List<KylinOrderListVo> getOrderList(String userId) {
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.ORDER_LIST + userId);
if (obj!=null) {
return (List<KylinOrderListVo>)obj;
if (obj != null) {
return (List<KylinOrderListVo>) obj;
} else {
List<KylinOrderListVo> voList = mongoTemplate.find(Query.query(Criteria.where("userId").is(userId))
.with(Sort.by(Sort.Direction.DESC, "createdAt")).limit(40),
KylinOrderListVo.class, KylinOrderTicketVo.class.getSimpleName());
for (KylinOrderListVo item : voList){
for (KylinOrderListVo item : voList) {
item.setStatus(item.getStatus());
}
redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.ORDER_LIST + userId, voList);
......@@ -175,8 +175,8 @@ public class DataUtils {
* @param performanceId
* @param isTrueName
*/
public void setPerformanceIsTrueName(String performanceId,int isTrueName) {
redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.PERFORMANCES_TRUE_NAME + performanceId,isTrueName);
public void setPerformanceIsTrueName(String performanceId, int isTrueName) {
redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.PERFORMANCES_TRUE_NAME + performanceId, isTrueName);
}
/**
......@@ -187,8 +187,8 @@ public class DataUtils {
*/
public KylinOrderTicketVo getOrderTicketVo(String orderId) {
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.ORDER + orderId);
if (obj!=null) {
return (KylinOrderTicketVo)obj;
if (obj != null) {
return (KylinOrderTicketVo) obj;
} else {
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());
......@@ -228,7 +228,6 @@ public class DataUtils {
}
public void updatePerformanceMongo(String performanceIds, KylinPerformanceVo paramVo) {
//查询 mysql 数据
KylinPerformanceVo vo;
......@@ -273,31 +272,40 @@ public class DataUtils {
* @param buyCount 购买数量 大于 0 增加 小于 0 减少 对应 支付 退款表
*/
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);
if (0 == isTrueName) {
redisKey = KylinRedisConst.USERID_BUY_INFO + userId;
} else {
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard;
redisKeyUid = KylinRedisConst.USERID_BUY_INFO + userId;
redisKeyIdCard = 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) {
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKey, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKey, buyCount);
}else{
redisDataSourceUtil.getRedisKylinUtil().decr(ticketIdKey, Math.abs(buyCount));
redisDataSourceUtil.getRedisKylinUtil().decr(performanceIdKey, Math.abs(buyCount));
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyUid, buyCount);
redisDataSourceUtil.getRedisKylinUtil().incr(performanceIdKeyUid, buyCount);
if (isTrueName != 0) {
redisDataSourceUtil.getRedisKylinUtil().incr(ticketIdKeyIdCard, 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) {
try {
......@@ -351,8 +359,8 @@ public class DataUtils {
*/
public KylinPerformanceVo getPerformanceVo(String performanceId) {
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.PERFORMANCES + performanceId);
if (obj!=null) {
return (KylinPerformanceVo)obj;
if (obj != null) {
return (KylinPerformanceVo) obj;
} else {
KylinPerformanceVo performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performanceId)), KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.PERFORMANCES + performanceId, performanceData);
......@@ -367,26 +375,27 @@ public class DataUtils {
*/
public int getPerformanceIsTrueName(String performanceId) {
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.PERFORMANCES_TRUE_NAME + performanceId);
if (obj!=null) {
return (int)obj;
}else{
if (obj != null) {
return (int) obj;
} else {
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;
}
}
public void delOrderRefundVo(String orderRefundsId){
public void delOrderRefundVo(String 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);
}
/**
* 演出订单快递信息
*
* @param orderId
* @param kylinOrderExpressVo
*/
......@@ -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);
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(redisKey);
if (obj == null) {
......
......@@ -272,3 +272,9 @@ create table kylin_ticket_express_module
updated_at datetime ,
comment text
) 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 {
@Autowired
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")
@ApiOperation(value = "购票须知列表", position = 1)
@ApiResponse(code = 200, message = "接口返回对象参数")
......
......@@ -107,6 +107,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
BeanUtils.copyProperties(step1Param, performancePartnerVo);
performancePartnerVo.setIsTrueName(0);
performancePartnerVo.setLimitCount(0);
performancePartnerVo.setIdCount(0);
performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(0);
performancePartnerVo.setStatus(0);
......@@ -157,6 +158,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
if (data != null) { // 有修改记录
performancePartnerVo.setIsTrueName(data.getIsTrueName());
performancePartnerVo.setLimitCount(data.getLimitCount());
performancePartnerVo.setIdCount(data.getIdCount());
performancePartnerVo.setStatusSell(data.getStatusSell());
performancePartnerVo.setRoadShowId(data.getRoadShowId());
performancePartnerVo.setProjectId(data.getProjectId());
......@@ -165,6 +167,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
KylinPerformanceVo vo = redisSlimeUtils.getPerformanceVo(performanceId);
performancePartnerVo.setIsTrueName(vo.getIsTrueName());
performancePartnerVo.setLimitCount(vo.getLimitCount());
performancePartnerVo.setIdCount(vo.getIdCount());
performancePartnerVo.setStatusSell(vo.getStatusSell());
performancePartnerVo.setRoadShowId(vo.getRoadShowId());
performancePartnerVo.setProjectId(vo.getProjectId());
......@@ -246,6 +249,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
performancePartnerVo.setPerformancesId(performanceId);
performancePartnerVo.setIsTrueName(step2Param.getIsTrueName());
performancePartnerVo.setLimitCount(step2Param.getLimitCount());
performancePartnerVo.setIdCount(step2Param.getIdCount());
performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(step2Param.getIsSubmit());
// performancePartnerVo.setStatusSell(1);
......@@ -341,6 +345,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
performancePartnerVo.setPerformancesId(performanceId);
performancePartnerVo.setIsTrueName(step2Param.getIsTrueName());
performancePartnerVo.setLimitCount(step2Param.getLimitCount());
performancePartnerVo.setIdCount(step2Param.getIdCount());
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.setIsSubmit(step2Param.getIsSubmit());
......@@ -385,7 +390,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
now, kylinPerformanceMisVo.getNoticeImage(), performanceId, now, now
});
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());
......@@ -425,6 +430,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
ticketData.setTotalGeneral(ticketItem.getTotalGeneral());
ticketData.setIsTrueName(kylinPerformanceMisVo.getIsTrueName());
ticketData.setLimitCount(ticketItem.getLimitCount());
ticketData.setIdCount(ticketItem.getIdCount());
ticketData.setIsLackRegister(ticketItem.getIsLackRegister());
ticketData.setIsExpress(ticketItem.getIsExpress());
ticketData.setIsElectronic(ticketItem.getIsElectronic());
......@@ -442,7 +448,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
//修改 mysql 购票限购、库存
sqlsDataD.add(new Object[]{
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(),
DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketItem.getQrCodeShowTime()), ticketItem.getTicketsId(), now, now
});
......@@ -471,6 +477,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
vo.setAuditStatus(performancePartnerVo.getAuditStatus());
vo.setIsTrueName(step2Param.getIsTrueName());
vo.setLimitCount(step2Param.getLimitCount());
vo.setIdCount(step2Param.getIdCount());
mongoSlimeUtils.updateKylinPerformanceVoById(vo);
redisSlimeUtils.delPerformanceVo(performanceId);
......
package com.liquidnet.service.slime.util;
import com.alibaba.fastjson.JSON;
import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
......@@ -401,7 +402,7 @@ public class PerformanceUtils {
//快递相关
KylinTicketExpressModuleVo moduleVo = redisSlimeUtils.getTEMMerchantVo(tickets.getTicketsId());
if (moduleVo != null && moduleVo.getProduceCodeList()!=null) {
if (moduleVo != null && moduleVo.getProduceCodeList() != null) {
redisSlimeUtils.setTEMMerchantVo(tickets.getTicketsId(), moduleVo);
del9.add(new Object[]{tickets.getTicketsId(), updatedAt});
for (ExpressModuleVo mVo : moduleVo.getProduceCodeList())
......@@ -736,4 +737,67 @@ public class PerformanceUtils {
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
# ---- 演出第二步骤操作 ----
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_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 ----
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)
......@@ -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 = ?
#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_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_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 = ?
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_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_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