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