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

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

修改bug

parent 385f27e6
......@@ -2,16 +2,12 @@ package com.liquidnet.service.kylin.constant;
public class KylinRedisConst {
public static final String FIELDS = "kylin:fields:id";
public static final String PERFORMANCES = "kylin:performances:info";
public static final String PERFORMANCES_RECOMMEND = "kylin:performances:recommend";
public static final String PERFORMANCES_INVENTORY = "kylin:performances_inventory:ticket:";
public static final String SURPLUS_GENERAL = "surplusGeneral";
public static final String SURPLUS_EXCHANGE = "surplusExchange";
public static final String TICKET = "kylin:ticket:id";
public static final String TIMES = "kylin:times:id";
public static final String BANNERS = "kylin:banners";
}
......@@ -56,8 +56,8 @@ public class PerformanceVo {
// @ApiModelProperty(value = "演出详情")
// private String details;
// OSS
// @ApiModelProperty(value = "购票须知")
// private String noticeImage;
@ApiModelProperty(value = "购票须知")
private String noticeImage;
@ApiModelProperty(value = "推荐顺序 0为不推荐")
private Integer isRecommend;
......
......@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.dto.vo.partner;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
......@@ -117,6 +118,9 @@ public class PerformanceMisVo {
@ApiModelProperty(value = "搭售id")
private String projectId;
@ApiModelProperty(value = "购票须知 Id 数组")
private List<String> noticeIds;
//场次数据
@ApiModelProperty(value = "场次数据")
private List<TicketTimesTicketCreatePartnerVo> ticketTimes;
......
......@@ -226,9 +226,9 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
if (step2Param.getPerformancesId().isEmpty()) {
} else { // 获取 create 数据 status = 0 或 无数据 创建
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", step2Param.getPerformancesId()));
if (performanceStatus == null || performanceStatus.getStatus() == 0) {
if (performanceStatus == null || performanceStatus.getStatus() == 0 || performanceStatus.getStatus() == 4) {
result = createStep2(step2Param);
log.info(" PERFORMANCE 演出第二步 创建");
log.info(" PERFORMANCE 演出第二步 创建(拒绝/撤回/第一次)");
} else if (performanceStatus.getStatus() == 1 || performanceStatus.getStatus() == 3 || performanceStatus.getStatus() == 6 || performanceStatus.getStatus() == 7) {// 修改
result = updateStep2(step2Param);
log.info(" PERFORMANCE 演出第二步 修改");
......
......@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.service.impl.partner;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.common.exception.entity.Error;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ErrorMapping;
......@@ -67,7 +68,9 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
if (null == performanceStatus) {
ticketTimesPartnerVo = createTimes(createTicketTimesParam);
log.info(" PERFORMANCE 场次 创建");
} else if (performanceStatus.getStatus() >= 3 && performanceStatus.getStatus() != 4) {//未被拒绝 且 通过审核的演出
} else if(performanceStatus.getAuditStatus()==0){
return ResponseDto.failure(ErrorMapping.get(20101));
}else if (performanceStatus.getStatus() >= 3 && performanceStatus.getStatus() != 4) {//未被拒绝 且 通过审核的演出
ticketTimesPartnerVo = addNewTimes(createTicketTimesParam);
log.info(" PERFORMANCE 场次 新增");
} else {
......@@ -125,10 +128,15 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
LocalDateTime createdAt = LocalDateTime.now();
// 标题
String title = "";
String useStart = createTicketTimesParam.getUseStart().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
String useEnd = createTicketTimesParam.getUseEnd().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
if (createTicketTimesParam.getType() == 1) {
title = createTicketTimesParam.getUseStart().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
if(!useStart.split(" ")[0].equals(useEnd.split(" ")[0])){
return ResponseDto.failure(ErrorMapping.get(20118));
}
title = useStart;
} else {
title = createTicketTimesParam.getUseStart().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")) + "-" + createTicketTimesParam.getUseEnd().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
title = useStart + "-" + useEnd;
}
// mongo 操作
......@@ -164,6 +172,10 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
if (ticketTimeRelation != null) {
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(
new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", ticketTimeRelation.getPerformanceId()));
if(performanceStatus.getAuditStatus()==0){
return ResponseDto.failure(ErrorMapping.get(20101));
}
if (performanceStatus.getStatus() == 0 || performanceStatus.getStatus() == 4) {//未提审||被拒绝
HashMap<String, Object> map = new HashMap<>();
map.put("updatedAt", updatedAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
......
......@@ -8,6 +8,7 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo;
import com.liquidnet.service.kylin.dto.param.TicketCreateParam;
import com.liquidnet.service.kylin.dto.vo.TicketVo;
import com.liquidnet.service.kylin.dto.vo.ignore.TicketIgnoreVo;
......@@ -180,7 +181,16 @@ public class KylinTicketsPartnerServiceImpl extends ServiceImpl<KylinTicketsMapp
@Override
public ResponseDto<TicketPartnerVo> updateTicket(TicketCreateParam ticketCreateParam) {
log.info("票 修改");
try {
KylinTicketTimeRelation ticketTimeRelation = ticketTimeRelationMapper.selectOne(
new UpdateWrapper<KylinTicketTimeRelation>().eq("times_id", ticketCreateParam.getTimesId()));
PerformancePartnerVo data = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(ticketTimeRelation.getPerformanceId())),
PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName());
if (data == null || data.getAuditStatus() == null || data.getAuditStatus() == 0) {
return ResponseDto.failure(ErrorMapping.get("20112"));
}
String ticketId = ticketCreateParam.getTicketsId();
LocalDateTime updatedAt = LocalDateTime.now();
// mongo 操作
......@@ -215,6 +225,7 @@ public class KylinTicketsPartnerServiceImpl extends ServiceImpl<KylinTicketsMapp
@Override
public ResponseDto<String> deleteTicket(String ticketsId) {
log.info("票 删除");
try {
LocalDateTime updatedAt = LocalDateTime.now();
......@@ -228,6 +239,12 @@ public class KylinTicketsPartnerServiceImpl extends ServiceImpl<KylinTicketsMapp
KylinTicketTimeRelation ticketTimeRelation = ticketTimeRelationMapper.selectOne(
new UpdateWrapper<KylinTicketTimeRelation>().eq("times_id", ticketRelations.getTimesId()));
PerformancePartnerVo data = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(ticketTimeRelation.getPerformanceId())),
PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName());
if (data == null || data.getAuditStatus() == null || data.getAuditStatus() == 0) {
return ResponseDto.failure(ErrorMapping.get("20106"));
}
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(
new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", ticketTimeRelation.getPerformanceId()));
......
......@@ -283,6 +283,9 @@ public class PerformanceVoTask {
*/
public void createPerformanceMySql(String performancesId, HashMap<String, Object> map, PerformanceMisVo performanceMisVo, LocalDateTime updatedAt) {
try {
// 判断演出是否存在 存在删除
//创建演出
KylinPerformances performances = new KylinPerformances();
BeanUtils.copyProperties(performanceMisVo, performances);
......@@ -309,8 +312,11 @@ public class PerformanceVoTask {
performanceRelations.setCreatedAt(performances.getCreatedAt());
performanceRelations.setUpdatedAt(updatedAt);
performancesMapper.delete(new UpdateWrapper<KylinPerformances>().eq("performances_id",performances.getPerformancesId()));
performancesMapper.insert(performances);
performanceStatusMapper.delete(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id",performanceStatus.getPerformanceId()));
performanceStatusMapper.insert(performanceStatus);
performanceRelationsMapper.delete(new UpdateWrapper<KylinPerformanceRelations>().eq("performance_id",performanceRelations.getPerformanceId()));
performanceRelationsMapper.insert(performanceRelations);
......@@ -334,7 +340,9 @@ public class PerformanceVoTask {
ticketTimeRelation.setCreatedAt(ticketTimes.getCreatedAt());
ticketTimeRelation.setUpdatedAt(updatedAt);
ticketTimesMapper.delete(new UpdateWrapper<KylinTicketTimes>().eq("ticket_times_id",ticketTimes.getTicketTimesId()));
ticketTimesMapper.insert(ticketTimes);
ticketTimeRelationMapper.delete(new UpdateWrapper<KylinTicketTimeRelation>().eq("ticket_time_relation_id",ticketTimeRelation.getTimesId()));
ticketTimeRelationMapper.insert(ticketTimeRelation);
//修改票
......@@ -389,8 +397,11 @@ public class PerformanceVoTask {
ticketRelations.setCreatedAt(tickets.getCreatedAt());
ticketRelations.setUpdatedAt(updatedAt);
ticketsMapper.delete(new UpdateWrapper<KylinTickets>().eq("tickets_id",tickets.getTicketsId()));
ticketsMapper.insert(tickets);
ticketStatusMapper.delete(new UpdateWrapper<KylinTicketStatus>().eq("ticket_id",ticketStatus.getTicketId()));
ticketStatusMapper.insert(ticketStatus);
ticketRelationsMapper.delete(new UpdateWrapper<KylinTicketRelations>().eq("ticket_id",ticketRelations.getTicketId()));
ticketRelationsMapper.insert(ticketRelations);
}
}
......@@ -425,6 +436,8 @@ public class PerformanceVoTask {
performanceStatus.setPerformanceId(performances.getPerformancesId());
performanceStatus.setPerformanceStatusId(IDGenerator.nextSnowId().toString());
performanceStatus.setCreatedAt(null);
performanceStatus.setStatus(null);
performanceStatus.setStatusSell(null);
performanceStatus.setAuditStatus(auditStatus);
performanceStatus.setUpdatedAt(updatedAt);
......
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