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

Commit 96eb77e3 authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/dev' into dev

parents 0b9de53d 4d3d1fdb
......@@ -30,6 +30,9 @@ public class PerformanceStep2Param implements Serializable {
@ApiModelProperty(hidden = true)
private Integer auditStatus;
@ApiModelProperty(hidden = true)
private Integer status;
@ApiModelProperty(value = "场次数据",hidden = true)
private List<TicketTimesTicketCreatePartnerVo> ticketTimes;
}
package com.liquidnet.service.kylin.dto.vo.returns;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -39,6 +39,8 @@ public class KylinStationPerformanceVo implements Serializable, Cloneable {
private Integer checkedNum;
@ApiModelProperty(position = 23, value = "余量[9]")
private Integer remainderNum;
@ApiModelProperty(position = 30, value = "#过程数据,前端无需关注")
private List<KylinTicketTimesVo> ticketTimeList;
private static final KylinStationPerformanceVo obj = new KylinStationPerformanceVo();
......@@ -49,14 +51,4 @@ public class KylinStationPerformanceVo implements Serializable, Cloneable {
return new KylinStationPerformanceVo();
}
}
public KylinStationPerformanceVo copy(KylinPerformanceVo source) {
if (null == source) return this;
this.performancesId = source.getPerformancesId();
this.type = source.getType();
this.title = source.getTitle();
this.timeStart = source.getTimeStart();
this.timeEnd = source.getTimeEnd();
return this;
}
}
package com.liquidnet.commons.lang.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ClientUpdateAnnotation {
String version() default "100000000";
String source() default "ALL";
String path() default "NONE";
}
......@@ -28,7 +28,7 @@ logging:
console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level:
root: ${liquidnet.logfile.level}
root: info
#以下是为指定包设置日志级别
com.liquidnet: ${liquidnet.logfile.level}
# -----------------------------------------------------------
......
......@@ -14,7 +14,7 @@ liquidnet:
pattern-file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level: info
level: debug
rabbitmq:
connection-timeout: 5000
mysql:
......
......@@ -28,7 +28,7 @@ logging:
console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level:
root: ${liquidnet.logfile.level}
root: info
#以下是为指定包设置日志级别
com:
liquidnet: ${liquidnet.logfile.level}
......
......@@ -175,7 +175,7 @@
) AS 'total_sale_price' ,
otr.performance_id AS 'performance_id' FROM kylin_order_tickets AS ot LEFT JOIN kylin_order_ticket_status AS ots
ON ots.order_id = ot.order_tickets_id LEFT JOIN kylin_order_ticket_relations AS otr ON otr.order_id =
ot.order_tickets_id WHERE ots.`status` = 1 AND coupon_type = 'no' GROUP BY otr.performance_id
ot.order_tickets_id WHERE (ots.`status` = 1 or ots.`status` = 0 or ots.`status` = 3) AND coupon_type = 'no' GROUP BY otr.performance_id
) AS ot ON ot.performance_id = p.performances_id
<where>
<if test="title!=''">
......@@ -198,7 +198,9 @@
<if test="status=='0'">
AND ps.STATUS = #{status}
</if>
<if test="merchantId!='1'">
AND pr.merchant_id = #{merchantId}
</if>
</where>
ORDER BY ${orderItem} ${orderSc}
</select>
......@@ -262,7 +264,7 @@
LEFT JOIN kylin_order_ticket_status AS ots ON ots.order_id = ot.order_tickets_id
LEFT JOIN kylin_order_ticket_relations AS otr ON otr.order_id = ot.order_tickets_id
WHERE
ots.`status` = 1 and coupon_type ='no'
(ots.`status` = 1 or ots.`status` = 0 or ots.`status` = 3) and coupon_type ='no'
GROUP BY otr.performance_id
) AS ot ON ot.performance_id = p.performances_id
<where>
......@@ -385,70 +387,71 @@
<!-- 演出订单统计-->
<select id="getPerformanceOrderStatisticalList" parameterType="java.lang.String"
resultMap="performanceOrderStatisticalDaoResult">
SELECT
kp.performances_id ,
SELECT kp.performances_id,
kt.tickets_id,
kt.title,
kt.price,
kt.type,
kt.use_start,
IFNULL(kts.total_general , 0) AS 'total_general' ,
IFNULL(ot.total_sale_general , 0) AS 'sale_general' ,
IFNULL((kts.total_general - IFNULL(ot.total_sale_general,0)),0) AS 'surplus_general',
IFNULL(ot.total_sale_price , 0) AS 'total_sale_price' ,
IFNULL(kts.total_exchange , 0) AS 'total_exchange',
IFNULL(ot.total_refund_general , 0) AS 'total_refund_general',
IFNULL(ot.total_refund_price , 0) AS 'total_refund_price',
IFNULL(ot.total_member_number , 0) AS 'total_member_number',
IFNULL(otp.total_paying_number , 1) AS 'total_paying_number',
IFNULL(ut.total_buy_users , 0) AS 'total_buy_users'
FROM
(select t.performances_id,ktr.ticket_id from kylin_performances t inner join kylin_ticket_time_relation kttr
IFNULL(kts.total_general, 0) AS 'total_general',
IFNULL(ot.total_sale_general, 0) AS 'sale_general',
IFNULL((kts.total_general - IFNULL(ot.total_sale_general,0) - IFNULL(otp.total_paying_number , 0)),0) AS 'surplus_general', AS 'surplus_general',
IFNULL(ot.total_sale_price, 0) AS 'total_sale_price',
IFNULL(kts.total_exchange, 0) AS 'total_exchange',
IFNULL(ot.total_refund_general, 0) AS 'total_refund_general',
IFNULL(ot.total_refund_price, 0) AS 'total_refund_price',
IFNULL(ot.total_member_number, 0) AS 'total_member_number',
IFNULL(otp.total_paying_number, 0) AS 'total_paying_number',
IFNULL(ut.total_buy_users, 0) AS 'total_buy_users'
FROM (select t.performances_id, ktr.ticket_id
from kylin_performances t
inner join kylin_ticket_time_relation kttr
on t.performances_id = kttr.performance_id
inner join kylin_ticket_relations ktr on kttr.times_id = ktr.times_id
where t.performances_id = ${performancesId}) AS kp
left JOIN(
SELECT
kotr.performance_id AS 'performance_id',
SELECT kotr.performance_id AS 'performance_id',
kotr.ticket_id,
(sum(kot.number)- sum(kot.refund_number)) AS 'total_sale_general' ,
(sum(kot.number) - sum(kot.refund_number)) AS 'total_sale_general',
(sum(kot.price_actual) - sum(kot.price_refund)) AS 'total_sale_price',
sum(kot.refund_number) as 'total_refund_general',
sum(kot.price_refund) as 'total_refund_price',
sum(case when kotr.is_member = 1 then kot.number else 0 end) total_member_number
FROM
kylin_order_ticket_relations kotr
FROM kylin_order_ticket_relations kotr
inner join kylin_order_tickets AS kot 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 1>0 and kotr.performance_id = ${performancesId}
and kots.`status` in(1,3,4) and kot.coupon_type ='no'
group by kotr.performance_id,kotr.ticket_id
WHERE 1 > 0
and kotr.performance_id = ${performancesId}
and kots.`status` in (1, 3, 4)
and kot.coupon_type = 'no'
group by kotr.performance_id, kotr.ticket_id
) AS ot ON (ot.performance_id = kp.performances_id and ot.ticket_id = kp.ticket_id)
left JOIN(
SELECT
kotr.performance_id,kotr.ticket_id,
sum(ifnull(kot.number,0)) total_paying_number
FROM
kylin_order_ticket_relations kotr
SELECT kotr.performance_id,
kotr.ticket_id,
sum(ifnull(kot.number, 0)) total_paying_number
FROM kylin_order_ticket_relations kotr
inner join kylin_order_tickets AS kot 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 1>0 and kotr.performance_id = ${performancesId}
and kots.`status` = 0 and kot.coupon_type ='no'
group by kotr.performance_id,kotr.ticket_id
WHERE 1 > 0
and kotr.performance_id = ${performancesId}
and kots.`status` = 0
and kot.coupon_type = 'no'
group by kotr.performance_id, kotr.ticket_id
) AS otp ON (otp.performance_id = kp.performances_id and otp.ticket_id = kp.ticket_id)
left join kylin_tickets kt on kt.tickets_id = kp.ticket_id
left join kylin_ticket_status kts on kts.ticket_id = kp.ticket_id
inner JOIN(
select t.performance_id,count(t.user_id) as 'total_buy_users' from(
SELECT
kotr.performance_id,
select t.performance_id, count(t.user_id) as 'total_buy_users'
from (
SELECT kotr.performance_id,
kot.user_id
FROM
kylin_order_ticket_relations kotr
FROM kylin_order_ticket_relations kotr
inner join kylin_order_tickets AS kot 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 kotr.performance_id = ${performancesId} and (kots.`status` = 0 OR kots.`status` = 1)
group by kotr.performance_id,kot.user_id
WHERE kotr.performance_id = ${performancesId}
and (kots.`status` = 0 OR kots.`status` = 1)
group by kotr.performance_id, kot.user_id
) t
) AS ut ON ut.performance_id = kp.performances_id
</select>
......
......@@ -20,6 +20,7 @@ public class KylinUtils {
@Autowired
private RedisUtil redisUtil;
/**
* @param userId 用户id
* @param type 1新增 2修改
......@@ -31,13 +32,13 @@ public class KylinUtils {
KylinOrderListVo voItem = new KylinOrderListVo();
KylinOrderTicketVo data;
if (dataSingle == null) {
data = (KylinOrderTicketVo)redisUtil.get(KylinRedisConst.ORDER + orderId);
data = (KylinOrderTicketVo) redisUtil.get(KylinRedisConst.ORDER + orderId);
} else {
data = dataSingle;
}
BeanUtils.copyProperties(data, voItem);
List<KylinOrderListVo> redisData = (List<KylinOrderListVo>) redisUtil.get(KylinRedisConst.ORDER_LIST + userId);
if(type == 1) {
if (type == 1) {
redisVo.add(voItem);
if (redisData.size() > 0) {
if (redisData.get(0).getOrderTicketsId().equals(orderId)) {
......@@ -63,7 +64,7 @@ public class KylinUtils {
if (redisVo.size() == 0) {
vo.add(voItem);
}
redisUtil.set(KylinRedisConst.ORDER_LIST + userId,vo);
redisUtil.set(KylinRedisConst.ORDER_LIST + userId, vo);
return true;
case 2:
for (int i = 0; i < redisVo.size(); i++) {
......@@ -76,7 +77,7 @@ public class KylinUtils {
vo.add(redisVo.get(i));
}
}
redisUtil.set(KylinRedisConst.ORDER_LIST + userId,vo);
redisUtil.set(KylinRedisConst.ORDER_LIST + userId, vo);
return true;
default:
return false;
......@@ -116,56 +117,65 @@ public class KylinUtils {
String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
String ticketUseTimeKey = ticketIdKey + ":" + KylinRedisConst.USE_TIME;
redisUtil.set(ticketUseTimeKey, useTime);
if (buyCount > 0) {
redisUtil.incr(ticketIdKey, buyCount);
if (1 == ticketType) {
int count = 0;
for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
String item = allTicketId.get(useTime).get(i);
if (allTicketId.get(useTime).size() == 1) {
redisUtil.incr(performanceIdKey, buyCount);
break;
}
if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
}
if (i == 0) {
count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
} else {
if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.incr(performanceIdKey, buyCount);
break;
}
}
}
} else {
redisUtil.incr(performanceIdKey, buyCount);
}
} else {
redisUtil.decr(ticketIdKey, Math.abs(buyCount));
if (1 == ticketType) {
int count = 0;
for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
String item = allTicketId.get(useTime).get(i);
if (allTicketId.get(useTime).size() == 1) {
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
break;
}
if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
}
if (i == 0) {
count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
} else {
if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
break;
}
}
}
} else {
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
}
}
// if (buyCount > 0) {
// redisUtil.incr(ticketIdKey, buyCount);
// if (1 == ticketType) {
// int count = 0;
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// if (allTicketId.get(useTime).size() == 1) {
// redisUtil.incr(performanceIdKey, buyCount);
// break;
// }
// if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// if (i == 0) {
// count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
// } else {
// if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.incr(performanceIdKey, buyCount);
// break;
// }
// }
// }
// } else {
// redisUtil.incr(performanceIdKey, buyCount);
// }
// } else {
// redisUtil.decr(ticketIdKey, Math.abs(buyCount));
// if (1 == ticketType) {
// int count = 0;
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// if (allTicketId.get(useTime).size() == 1) {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// break;
// }
// if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// if (i == 0) {
// count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
// } else {
// if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// break;
// }
// }
// }
// } else {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// }
// }
}
}
......@@ -55,7 +55,7 @@ public class KylinOrderTicketsController {
public ResponseDto<PayResultVo> payAgain(@RequestBody @Valid PayAgainParam payAgainParam) {
PayResultVo vo = orderTicketsService.payAgain(payAgainParam).getData();
if (null == vo) {
return ResponseDto.failure(ErrorMapping.get("20003"));
return ResponseDto.failure("订单已失效");
} else {
return ResponseDto.success(vo);
}
......
......@@ -921,7 +921,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
DateUtil.parse(item.getOverdueAt(), "yyyy-MM-dd HH:mm:ss"),
DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd HH:mm:ss")
));
if(item.getRestTime()<=0L){
if (item.getRestTime() <= 0L) {
item.setRestTime(0L);
}
} catch (Exception e) {
......@@ -951,6 +951,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
@Override
public OrderDetailsVo orderDetails(String orderId) {
log.error("调用订单详情");
OrderDetailsVo vo = new OrderDetailsVo();
try {
String uid = CurrentUtil.getCurrentUid();
......@@ -1013,7 +1014,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
DateUtil.parse(orderTicketVo.getOverdueAt(), "yyyy-MM-dd HH:mm:ss"),
DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd HH:mm:ss")
));
if(vo.getRestTime()<=0L){
if (vo.getRestTime() <= 0L) {
vo.setRestTime(0L);
}
} else {
......@@ -1032,7 +1033,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
vo.setOrderTicketVo(orderTicketVo);
vo.setEnterDescribe(dataUtils.getEnterInfo("1"));
}
log.info(UserPathDto.setData("订单列表", orderId, vo));
log.info(UserPathDto.setData("订单详情", orderId, vo));
return vo;
} catch (Exception e) {
e.printStackTrace();
......@@ -1190,12 +1191,22 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
public ResponseDto<Integer> orderUnPayCount() {
String uid = CurrentUtil.getCurrentUid();
List<KylinOrderListVo> voList = dataUtils.getOrderList(uid);
Integer unPayCount = 0;
int unPayCount = 0;
for (KylinOrderListVo item : voList) {
if (item.getStatus() == 0) {
if (item.getStatus().equals(KylinTableStatusConst.ORDER_STATUS0)) {
item.setRestTime(DateUtil.intervalSeconds(
DateUtil.parse(item.getOverdueAt(), "yyyy-MM-dd HH:mm:ss"),
DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd HH:mm:ss")
));
if (item.getRestTime() <= 0L) {
item.setRestTime(0L);
} else {
unPayCount += 1;
}
} else {
item.setRestTime(0L);
}
}
return ResponseDto.success(unPayCount);
}
......
......@@ -211,9 +211,13 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
PerformancePartnerVo data = mongoTemplate.findOne(
Query.query(Criteria.where("performancesId").is(performancesId)), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName()
);
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
if (data == null) {
return ResponseDto.failure(ErrorMapping.get(20104));
}
if(null!=performanceStatus) {
data.setStatus(performanceStatus.getStatus());
}
return ResponseDto.success(data);
}
......@@ -229,7 +233,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
} else if (performanceStatus.getStatus() == 1 || performanceStatus.getStatus() == 3 || performanceStatus.getStatus() == 6 || performanceStatus.getStatus() == 7 || performanceStatus.getStatus() == 8 || performanceStatus.getStatus() == 9 ) {// 修改
result = updateStep2(step2Param);
}else if(performanceStatus.getStatus() == 10){
result = ResponseDto.success("演出已结束不可修改");
result = ResponseDto.failure("演出已结束不可修改");
}
}
return result;
......@@ -406,6 +410,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
ticketSellTime.setTimeEnd(DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketItem.getTimeEnd()));
ticketSellTime.setTimeStart(DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketItem.getTimeStart()));
ticketSellTime.setAdvanceMinuteMember(null);
ticketSellTime.setPayCountdownMinute(kylinPerformanceMisVo.getPayCountdownMinute());
//修改 价格
ticketSellTime.setPrice(ticketItem.getPrice());
ticketSellTime.setPriceDiscountMember(null);
......@@ -454,6 +459,13 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
PerformanceStep2Param performanceStep2Param = new PerformanceStep2Param();
BeanUtils.copyProperties(data, performanceStep2Param);
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
if(null!=performanceStatus) {
performanceStep2Param.setStatus(performanceStatus.getStatus());
}else{
performanceStep2Param.setStatus(-1);
}
performanceStep2Param.setTicketTimes(ticketTimesTicketCreatePartnerVoList);
return ResponseDto.success(performanceStep2Param);
}
......@@ -514,7 +526,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
KylinPerformanceStatus performanceStatusData = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
if (performanceStatusData.getStatus() >= 3 && performanceStatusData.getStatus() != 4 && performanceStatusData.getStatus() != 7) {//未提审||被拒绝
if (performanceStatusData.getStatus() >= 3 && performanceStatusData.getStatus() != 4 && performanceStatusData.getStatus() != 7 && performanceStatusData.getStatus() != 10) {//未提审||被拒绝
LocalDateTime updatedAt = LocalDateTime.now();
KylinPerformanceStatus performanceStatus = new KylinPerformanceStatus();
performanceStatus.setStatus(7);
......
......@@ -309,77 +309,29 @@ public class DataUtils {
allTicketId.put(timeItem.getUseStart(), ticketList);
}
System.out.println(" PERFORMANCE_ID = "+performanceId);
if (0 == isTrueName) {
redisKey = KylinRedisConst.USERID_BUY_INFO + userId;
} else {
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard;
}
System.out.println(" REDIS KEY= "+redisKey);
String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
String ticketUseTimeKey = ticketIdKey + ":" + KylinRedisConst.USE_TIME;
System.out.println("PERFORMANCEID REDIS KEY = "+performanceIdKey);
System.out.println("TICKETID REDIS KEY = "+ticketIdKey);
redisUtil.set(ticketUseTimeKey, useTime);
if (buyCount > 0) {
redisUtil.incr(ticketIdKey, buyCount);
if (1 == ticketType) {
int count = 0;
for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
String item = allTicketId.get(useTime).get(i);
if (allTicketId.get(useTime).size() == 1) {
redisUtil.incr(performanceIdKey, buyCount);
break;
}
if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
}
if (i == 0) {
count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
} else {
if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.incr(performanceIdKey, buyCount);
break;
}
}
}
} else {
System.out.println("BUY_COUNT = "+buyCount);
redisUtil.incr(performanceIdKey, buyCount);
}
} else {
redisUtil.decr(ticketIdKey, Math.abs(buyCount));
if (1 == ticketType) {
int count = 0;
for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
String item = allTicketId.get(useTime).get(i);
if (allTicketId.get(useTime).size() == 1) {
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
break;
}
if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
}
if (i == 0) {
count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
} else {
if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
break;
}
}
}
} else {
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
}
}else{
redisUtil.decr(ticketIdKey, buyCount);
redisUtil.decr(performanceIdKey, buyCount);
}
}
// 获取 用户维度 演出购买数量
public int getUserPBuyCount(String userId, String performanceId) {
try {
......@@ -387,6 +339,61 @@ public class DataUtils {
} catch (Exception e) {
return 0;
}
// if (buyCount > 0) {
// redisUtil.incr(ticketIdKey, buyCount);
// if (1 == ticketType) {
// int count = 0;
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// if (allTicketId.get(useTime).size() == 1) {
// redisUtil.incr(performanceIdKey, buyCount);
// break;
// }
// if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// if (i == 0) {
// count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
// } else {
// if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.incr(performanceIdKey, buyCount);
// break;
// }
// }
// }
// } else {
// System.out.println("BUY_COUNT = "+buyCount);
// redisUtil.incr(performanceIdKey, buyCount);
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// }
// } else {
// redisUtil.decr(ticketIdKey, Math.abs(buyCount));
// if (1 == ticketType) {
// int count = 0;
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// if (allTicketId.get(useTime).size() == 1) {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// break;
// }
// if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// if (i == 0) {
// count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
// } else {
// if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// break;
// }
// }
// }
// } else {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// }
}
// 获取 用户维度 票种购买数量
......
......@@ -19,7 +19,7 @@
20013=已超过快递票截止时间
20014=快递票未填写收货地址
20015=入场人数量错误
20016=该票种已售罄
20016=库存不足
20017=年龄不符合
20018=下单失败
......
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