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

Commit 04c95d04 authored by GaoHu's avatar GaoHu

bug:关闭代理,新增删除演出id校验

parent cb73e80b
......@@ -15,6 +15,7 @@ import com.liquidnet.client.admin.zhengzai.slime.service.ISlimeAuthorizationReco
import com.liquidnet.client.admin.zhengzai.smile.utils.SmileRedisUtils;
import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.goblin.dto.vo.SmileAgentVo;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dao.*;
import com.liquidnet.service.kylin.dto.param.*;
......@@ -598,7 +599,6 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
ticketStatus.setIsAgent(status);
ticketStatusMapper.update(ticketStatus, new UpdateWrapper<KylinTicketStatus>().eq("ticket_id", ticketId));
performanceVoUtils.performanceVoStatus(performancesId);
List<KylinPerformances> kylinPerformances = kylinPerformancesMapper.selectPerIdByAgent();
//存入票提默认 总代 普代都为0 默认0.000
SmileAgent smileAgent = new SmileAgent();
smileAgent.setPerformanceId(performancesId);
......@@ -617,25 +617,43 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
smileAgentMapper.update(smileAgent,queryWrapper);
//删除票提redis
smileRedisUtils.delAgent(performancesId,ticketId);
//查询是否还有设置过开启的票种
agentCarryGtZeroByPerId(performancesId);
}
//查询所有演出id
// List<String> showIds = smileRedisUtils.getShowIds();
// showIds.add(performancesId);
// smileRedisUtils.setShowIds(showIds);
/* List<String> collect = kylinPerformances.stream().map(KylinPerformances::getPerformancesId).collect(Collectors.toList());
String perId = StringUtils.join(collect,",");
if (!"".equals(perId)){
smileRedisUtils.setShowIds(perId);
}*/
return true;
} catch (Exception e) {
return false;
}
}
//校验该演出是否有其他票提设置 用于删除redis中演出id List
private void agentCarryGtZeroByPerId(String performancesId) {
List<SmileAgent> agents = smileAgentMapper.selectAgentCarryGtZeroByPerId(performancesId);
if (agents.size()>0){
//是否设置过票提
boolean tag = true;
for (SmileAgent agent : agents) {
SmileAgentVo agent1 = smileRedisUtils.getAgent(agent.getPerformanceId(), agent.getTicketId());
if (agent1!=null){
tag = false;
break;
}
}
if (tag) {
//redis中删除演出id
log.debug("查询没有设置过perId:{},删除演出列表id", performancesId);
List<String> showIds = smileRedisUtils.getShowIds();
showIds.remove(performancesId);
smileRedisUtils.setShowIds(showIds);
}
}else {
//删除演出ids
List<String> showIds = smileRedisUtils.getShowIds();
showIds.remove(performancesId);
smileRedisUtils.setShowIds(showIds);
}
}
@Override
public boolean changeTicketPayTxt(String performancesId, String ticketId, String payTxt) {
dataUtils.setTicketPayTxt(ticketId, payTxt);
......
......@@ -717,6 +717,7 @@ GROUP BY user_mobile;
left join kylin_ticket_relations as ktr on ktr.times_id = kttr.times_id
inner join kylin_ticket_status as kts on kts.ticket_id = ktr.ticket_id
where kts.is_agent = 1
AND kp.performances_id IN ( SELECT sa.performance_id FROM smile_agent sa WHERE sa.del_tag = 0 GROUP BY sa.performance_id )
group by kp.performances_id
order by kp.comment desc, kp.time_start asc
</select>
......
......@@ -29,4 +29,6 @@ public interface SmileAgentMapper extends BaseMapper<SmileAgent> {
Map getUserOrgByPerIdAndUidAndAgentMaster(@Param("performancesId") String performancesId,@Param("uid") String uid,@Param("ticketId") String ticketId);
List<SmileAgentDao> selectAgentList(@Param("performancesId") String performancesId);
List<SmileAgent> selectAgentCarryGtZeroByPerId(@Param("performancesId")String performancesId);
}
......@@ -108,4 +108,13 @@
AND sa.del_tag = 0
</select>
<select id="selectAgentCarryGtZeroByPerId" resultType="com.liquidnet.service.smile.entity.SmileAgent">
SELECT id,
performance_id,
ticket_id
FROM smile_agent
WHERE performance_id = #{performancesId}
AND del_tag = 0
</select>
</mapper>
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