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

Commit c6bc8916 authored by GaoHu's avatar GaoHu

exit price() getShowList()

parent 1abbb8b9
......@@ -91,6 +91,9 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
@Autowired
KylinPerformanceStatusMapper kylinPerformanceStatusMapper;
@Autowired
private KylinOrderTicketsMapper orderTicketsMapper;
@Override
public TableDataInfo listShow(SmileShowParam smileShowParam) {
PageInfo<KylinPerformances> pageInfo;
......@@ -174,10 +177,10 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
if (smilePriceParam.getStatus().equals(status)) {
return AjaxResult.warn("不可重复打款");
}
//查询该用户的佣金
SmileSellDataVO smileSellDataVO = smileRedisUtils.getSellDataVO(smilePriceParam.getUid(), smilePriceParam.getPerformancesId());
smilePrice.setPrice(smileSellDataVO.getTotalCommission());
if (smilePriceParam.getStatus().equals(0)){
if (smilePriceParam.getStatus().equals(0)) {
//计算该用户的佣金
Map userPerformance = orderTicketsMapper.getUserPerformanceByUidAndProId(smilePriceParam.getUid(),smilePriceParam.getPerformancesId());
smilePrice.setPrice(userPerformance.get("commiss")==null?new BigDecimal(0):new BigDecimal(userPerformance.get("commiss").toString()));
smilePrice.setCreatedDate(LocalDateTime.now());
smilePriceMapper.insert(smilePrice);
smileRedisUtils.setPriceByUid(smilePriceParam.getPerformancesId(), smilePriceParam.getUid());
......@@ -336,14 +339,14 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
public AjaxResult allPrice(SmilePriceParam smilePriceParam) {
Integer showPriceId = smileRedisUtils.getShowPriceId(smilePriceParam.getPerformancesId());
//判断打款标识
if (smilePriceParam.getStatus().equals(showPriceId)){
if (smilePriceParam.getStatus().equals(showPriceId)) {
return AjaxResult.warn("不可重复提交");
}
if (smilePriceParam.getStatus().equals(0)){
if (smilePriceParam.getStatus().equals(0)) {
//打款
smileRedisUtils.setShowPriceId(smilePriceParam.getPerformancesId());
//
}else {
} else {
//未打款
smileRedisUtils.delShowPriceId(smilePriceParam.getPerformancesId());
}
......@@ -352,6 +355,8 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
private UserData getUserData(String performancesId, SmileUser smileUser) {
UserData userData = new UserData();
//个人用户的演出数据详情
//获取 该人 该演出 的所有订单
SmileSellDataVO smileSellDataVO = smileRedisUtils.getSellDataVO(smileUser.getUid(), performancesId);
BeanUtils.copyProperties(smileSellDataVO, userData);
userData.setUid(smileUser.getUid());
......
......@@ -2,9 +2,9 @@ package com.liquidnet.client.admin.zhengzai.smile.utils;
import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil;
import com.liquidnet.service.goblin.constant.SmileRedisConst;
import com.liquidnet.service.goblin.dto.vo.SmileSellDataVO;
import com.liquidnet.service.goblin.dto.vo.SmileAgentVo;
import com.liquidnet.service.goblin.dto.vo.SmileSchoolVo;
import com.liquidnet.service.goblin.dto.vo.SmileSellDataVO;
import com.liquidnet.service.goblin.dto.vo.SmileUserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......
......@@ -52,6 +52,8 @@ public interface KylinOrderTicketsMapper extends BaseMapper<KylinOrderTickets> {
List<Map> getUserSellDetail(@Param("agentId")String agentId,@Param("ticketId")String ticketId);
List<Map> getUserPerformance(@Param("agentId")String userId);
Map getUserPerformanceByUidAndProId(@Param("agentId")String userId,@Param("performanceId")String performanceId);
List<KylinOrderTicketAndAgentVo> selectListByPerformanceId(@Param("performancesId") String performancesId,@Param("ticketId")String ticketId);
List<String> getAgentIdListByPerId(@Param("performancesId") String performancesId);
......
......@@ -94,6 +94,26 @@
where r.agent_id_master=#{agentId} and s.pay_status='1' GROUP BY r.performance_id
) as c GROUP BY c.performanceId
</select>
<select id="getUserPerformanceByUidAndProId" parameterType="String" resultType="java.util.Map">
SELECT c.title as 'title' ,c.performanceId as 'performanceId', SUM(commiss) as 'commiss',c.timeEnd as 'timeEnd' FROM(
select o.performance_title as 'title',r.performance_id as 'performanceId' ,SUM(r.agent_distributions * (o.price_actual-o.price_refund)) as 'commiss',kp.time_end as 'timeEnd'
from (select * from kylin_order_tickets where created_at>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)) as o
LEFT JOIN kylin_order_ticket_status as s on o.order_tickets_id=s.order_id
LEFT JOIN kylin_order_ticket_relations as r ON o.order_tickets_id=r.order_id
LEFT JOIN kylin_performances as kp ON r.performance_id= kp.performances_id
where r.agent_id=#{agentId} and s.pay_status='1' GROUP BY r.performance_id
UNION ALL
select o.performance_title as 'title',r.performance_id as 'performanceId' ,SUM(r.agent_distributions_master * (o.price_actual-o.price_refund)) as 'commiss',kp.time_end as 'timeEnd'
from (select * from kylin_order_tickets where created_at>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)) as o
LEFT JOIN kylin_order_ticket_status as s on o.order_tickets_id=s.order_id
LEFT JOIN kylin_order_ticket_relations as r ON o.order_tickets_id=r.order_id
LEFT JOIN kylin_performances as kp ON r.performance_id= kp.performances_id
where r.agent_id_master=#{agentId} and s.pay_status='1' GROUP BY r.performance_id
) as c WHERE c.performanceId = #{performanceId}
</select>
<select id="getUserOrder" parameterType="String" resultType="java.util.Map">
select p.title as 'title',p.performances_id as 'yanchuId' from kylin_performances p
LEFT JOIN kylin_performance_status s ON p.performances_id=s.performance_id where
......@@ -504,7 +524,7 @@
<if test="performancesId!=''">
AND kk.performance_id = #{performancesId}
</if>
<if test="ticketId!=''">
<if test="ticketId!=null">
AND kk.ticket_id = #{ticketId}
</if>
</where>
......
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