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

Commit f5c04596 authored by 胡佳晨's avatar 胡佳晨

修改 提交审核

parent 3ad6cbb3
......@@ -14,6 +14,8 @@ public class PerformanceAdminListDao {
private Integer status;
private String statusName;
private String auditTime;
private String timeSell;
private String timeStop;
private Integer auditStatus;
private Integer totalGeneral;
private Integer saleGeneral;
......
......@@ -16,6 +16,8 @@ public class PerformancePartnerListDao {
private Integer surplusGeneral;
private Integer status;
private Integer type;
private String timeSell;
private String timeStop;
private Integer auditStatus;
private String rejectTxt;
private String createdAt;
......
......@@ -11,6 +11,8 @@
<result column="sale_general" property="saleGeneral"/>
<result column="total_sale_price" property="totalSalePrice"/>
<result column="surplus_general" property="surplusGeneral"/>
<result column="time_sell" property="timeSell"/>
<result column="time_stop" property="timeStop"/>
<result column="status" property="status"/>
<result column="type" property="type"/>
<result column="sort" property="sort"/>
......@@ -29,6 +31,8 @@
<result column="total_sale_price" property="totalSalePrice"/>
<result column="surplus_general" property="surplusGeneral"/>
<result column="status" property="status"/>
<result column="time_sell" property="timeSell"/>
<result column="time_stop" property="timeStop"/>
<result column="audit_status" property="auditStatus"/>
<result column="reject_txt" property="rejectTxt"/>
<result column="sort" property="sort"/>
......@@ -50,7 +54,6 @@
</resultMap>
<resultMap id="PerformanceRecommendAdminDaoResult"
type="com.liquidnet.service.kylin.dao.PerformanceRecommendAdminDao">
<result column="performances_id" property="performancesId"/>
......@@ -74,7 +77,8 @@
<result column="is_exclusive" property="isExclusive"/>
</resultMap>
<resultMap id="performanceOrderStatisticalDaoResult" type="com.liquidnet.service.kylin.dao.PerformanceOrderStatisticalDao">
<resultMap id="performanceOrderStatisticalDaoResult"
type="com.liquidnet.service.kylin.dao.PerformanceOrderStatisticalDao">
<result column="performances_id" property="performancesId"/>
<result column="tickets_id" property="ticketsId"/>
<result column="title" property="title"/>
......@@ -123,6 +127,8 @@
p.title ,
p.time_start ,
p.time_end ,
t.time_sell ,
t.time_stop ,
IFNULL(t.total_general , 0) AS 'total_general' ,
IFNULL(ot.sale_general , 0) AS 'sale_general' ,
IFNULL(ot.total_sale_price , 0) AS 'total_sale_price' ,
......@@ -133,7 +139,7 @@
0
) AS 'surplus_general' ,
ps.`status` ,
p.type,
p.type ,
ps.audit_status ,
p.reject_txt ,
p.created_at
......@@ -144,26 +150,32 @@
LEFT JOIN(
SELECT
ttr.performance_id ,
ts.ticket_id ,
sum(ts.total_general) AS 'total_general'
sum(ts.total_general) AS 'total_general' ,
MIN(
DATE_SUB(
t.time_start ,
INTERVAL - pay_countdown_minute MINUTE
)
) AS 'time_sell' ,
MAX(t.time_end) AS 'time_stop'
FROM
kylin_ticket_status AS ts
LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id
LEFT JOIN kylin_tickets AS t ON t.tickets_id = ts.ticket_id
LEFT JOIN kylin_ticket_time_relation AS ttr ON tr.times_id = ttr.times_id
GROUP BY ttr.performance_id
GROUP BY
ttr.performance_id
) AS t ON p.performances_id = t.performance_id
LEFT JOIN(
SELECT
(sum(ot.number)- sum(ot.refund_number)) AS 'sale_general' ,
(sum(ot.price_actual) - sum(ot.price_refund)) 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
SELECT(
sum(ot.number) - sum(ot.refund_number)
) AS 'sale_general' ,
(
sum(ot.price_actual) - sum(ot.price_refund)
) 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
) AS ot ON ot.performance_id = p.performances_id
<where>
<if test="title!=''">
......@@ -202,6 +214,8 @@
p.time_start ,
p.time_end ,
ps.sync_damai ,
t.time_sell,
t.time_stop,
IFNULL(t.total_general , 0) AS 'total_general' ,
IFNULL(ot.sale_general , 0) AS 'sale_general' ,
IFNULL(ot.total_sale_price , 0) AS 'total_sale_price' ,
......@@ -222,13 +236,21 @@
LEFT JOIN(
SELECT
ttr.performance_id ,
ts.ticket_id ,
sum(ts.total_general) AS 'total_general'
sum(ts.total_general) AS 'total_general' ,
MIN(
DATE_SUB(
t.time_start ,
INTERVAL - pay_countdown_minute MINUTE
)
) AS 'time_sell' ,
MAX(t.time_end) AS 'time_stop'
FROM
kylin_ticket_status AS ts
LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id
LEFT JOIN kylin_tickets AS t ON t.tickets_id = ts.ticket_id
LEFT JOIN kylin_ticket_time_relation AS ttr ON tr.times_id = ttr.times_id
GROUP BY ttr.performance_id
GROUP BY
ttr.performance_id
) AS t ON p.performances_id = t.performance_id
LEFT JOIN(
SELECT
......@@ -259,9 +281,9 @@
<if test="auditStatus!='-2'">
AND ps.audit_status = #{auditStatus}
</if>
<!-- <if test="auditStatus=='-2'">-->
<!-- AND (ps.audit_status = 0 or ps.audit_status = 1 or ps.audit_status = 2)-->
<!-- </if>-->
<!-- <if test="auditStatus=='-2'">-->
<!-- AND (ps.audit_status = 0 or ps.audit_status = 1 or ps.audit_status = 2)-->
<!-- </if>-->
<if test="stopSellDay!=-2">
AND p.time_end BETWEEN #{stopSellTime} AND NOW()
</if>
......@@ -284,15 +306,15 @@
<!-- Mis 根据状态查询演出列表 -->
<select id="misTitleByStatusList" parameterType="java.lang.String" resultMap="performanceTitleDaoResult">
SELECT performances_id,
title
title
FROM kylin_performances AS p
LEFT JOIN kylin_performance_status AS ps ON ps.performance_id = p.performances_id
LEFT JOIN kylin_performance_relations AS pr ON pr.performance_id = p.performances_id
LEFT JOIN kylin_performance_status AS ps ON ps.performance_id = p.performances_id
LEFT JOIN kylin_performance_relations AS pr ON pr.performance_id = p.performances_id
<where>
ps.status in ${status}
<if test="title!=''">
AND title LIKE concat('%', #{title}, '%')
</if>
ps.status in ${status}
<if test="title!=''">
AND title LIKE concat('%', #{title}, '%')
</if>
</where>
LIMIT 20
</select>
......@@ -311,11 +333,11 @@
<!-- Mis 根据演出id查询推荐数据 -->
<select id="getRecommend" parameterType="java.lang.String" resultMap="performanceRecommendDaoResult">
SELECT performances_id,
title,
ps.is_recommend
title,
ps.is_recommend
FROM kylin_performances AS p
LEFT JOIN kylin_performance_status AS ps ON ps.performance_id = p.performances_id
LEFT JOIN kylin_performance_relations AS pr ON pr.performance_id = p.performances_id
LEFT JOIN kylin_performance_status AS ps ON ps.performance_id = p.performances_id
LEFT JOIN kylin_performance_relations AS pr ON pr.performance_id = p.performances_id
WHERE p.performances_id = #{performancesId}
</select>
<!-- Mis根据演出id查询演出名称 -->
......@@ -361,59 +383,58 @@
</select>
<!-- 演出订单统计-->
<select id="getPerformanceOrderStatisticalList" parameterType="java.lang.String" resultMap="performanceOrderStatisticalDaoResult">
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 - ot.total_sale_general),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(ot.total_paying_number , 0) AS 'total_paying_number',
IFNULL(ut.total_buy_users , 0) AS 'total_buy_users'
FROM
(select t.performances_id from kylin_performances t where t.performances_id = ${performancesId}) AS kp
inner JOIN(
SELECT
kotr.performance_id AS 'performance_id',
kotr.ticket_id,
(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,
sum(case when kots.`status` = 0 then kot.number else 0 end) 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` 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
inner join kylin_tickets kt on kt.tickets_id = ot.ticket_id
inner join kylin_ticket_status kts on kts.ticket_id = kt.tickets_id
inner JOIN(
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
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
) t
) AS ut ON ut.performance_id = kp.performances_id
<select id="getPerformanceOrderStatisticalList" parameterType="java.lang.String"
resultMap="performanceOrderStatisticalDaoResult">
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 - ot.total_sale_general), 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(ot.total_paying_number, 0) AS 'total_paying_number',
IFNULL(ut.total_buy_users, 0) AS 'total_buy_users'
FROM (select t.performances_id from kylin_performances t where t.performances_id = ${performancesId}) AS kp
inner JOIN(
SELECT kotr.performance_id AS 'performance_id',
kotr.ticket_id,
(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,
sum(case when kots.`status` = 0 then kot.number else 0 end) 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` 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
inner join kylin_tickets kt on kt.tickets_id = ot.ticket_id
inner join kylin_ticket_status kts on kts.ticket_id = kt.tickets_id
inner JOIN(
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
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
) t
) AS ut ON ut.performance_id = kp.performances_id
</select>
<select id="getPerformanceSponsorList" resultMap="performanceSponsorDaoResult">
select distinct kp.sponsor_id, kp.sponsor, kp.sponsor_type
......
......@@ -371,7 +371,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
performances.setAuditTime(LocalDateTime.now());
performancesMapper.update(performances, new UpdateWrapper<KylinPerformances>().eq("performances_id", performanceId));
KylinPerformanceStatus performanceStatus = new KylinPerformanceStatus();
performanceStatus.setAuditStatus((int)map.get("auditStatus"));
performanceStatus.setAuditStatus((int) map.get("auditStatus"));
performanceStatusMapper.update(performanceStatus, new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performanceId));
//提示:票种价格、售票时间、购票限制 直接生效
......@@ -483,9 +483,9 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
ticketStatusMapper.update(ticketStatusUpdate
, new UpdateWrapper<KylinTicketStatus>().eq("ticket_id", ticketRelationsItem.getTicketId()).eq("status", 7));
HashMap<String,Object> map = new HashMap<>();
map.put("status",9);
map.put("updatedAt",updatedAt);
HashMap<String, Object> map = new HashMap<>();
map.put("status", 9);
map.put("updatedAt", updatedAt);
mongoTemplate.getCollection(KylinTicketPartnerVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("ticketsId").is(ticketRelationsItem.getTicketId()).and("status").ne(7)).getQueryObject(),
new BasicDBObject("$set", mongoConverter.convertToMongoType(map))
......@@ -596,6 +596,16 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
try {
PageHelper.startPage(performancePartnerListParam.getPage(), performancePartnerListParam.getSize());
List<PerformancePartnerListDao> voList = performancesMapper.partnerPerformanceList(BeanUtil.convertBeanToMap(performancePartnerListParam));
for (int i = 0; i < voList.size(); i++) {
PerformancePartnerListDao vo = voList.get(i);
if(vo.getStatus() >=6 || vo.getStatus()!=7){
if (DateUtil.compareStrDay(vo.getTimeSell(), DateUtil.getNowTime()) > 0) {//未开始
vo.setStatus(9);
} else if (DateUtil.compareStrDay(vo.getTimeStop(), DateUtil.getNowTime()) < 0) {//已结束
vo.setStatus(10);
}
}
}
pageInfoTmp = new PageInfo(voList);
} catch (Exception e) {
e.printStackTrace();
......@@ -651,7 +661,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
List<PerformanceOrderStatisticalDao> dtoList = performancesMapper.getPerformanceOrderStatisticalList(performancesId);
dtoList.forEach(dto -> {
PerformanceOrderStatisticalVo vo = new PerformanceOrderStatisticalVo();
BeanUtil.copy(dto,vo);
BeanUtil.copy(dto, vo);
voList.add(vo);
countBean.setTotalGeneral(countBean.getTotalGeneral().add(dto.getTotalGeneral()));
......@@ -666,7 +676,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
countBean.setTotalBuyUsers(dto.getTotalBuyUsers());
});
PerformanceOrderStatisticalVo vo = new PerformanceOrderStatisticalVo();
BeanUtil.copy(countBean,vo);
BeanUtil.copy(countBean, vo);
voList.add(vo);
return voList;
}
......
......@@ -335,11 +335,17 @@ public class KylinTicketsPartnerServiceImpl extends ServiceImpl<KylinTicketsMapp
}
map.put("updatedAt", updatedAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
UpdateResult updateResult = mongoTemplate.getCollection(KylinTicketPartnerVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("timesId").is(timesId).and("status").nin(-2,7)).getQueryObject(),
mongoTemplate.getCollection(KylinTicketPartnerVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("timesId").is(timesId).and("status").nin(-2, 7)).getQueryObject(),
object
);
return updateResult.getModifiedCount() <= 0;
long count = mongoTemplate.count(
Query.query(Criteria.where("timesId").is(timesId)),
KylinTicketPartnerVo.class,
KylinTicketPartnerVo.class.getSimpleName()
);
return count <= 0;
}
@Override
......
......@@ -39,7 +39,7 @@
20112=不可修改
20113=未创建场次
20114=有场次创建票种
20114=有场次创建票种
20115=提交失败
20116=不可撤回
20117=撤回失败
......
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