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

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

提交修改

parent 853161fc
package com.liquidnet.service.kylin.dto.vo;
import com.liquidnet.service.kylin.entity.KylinFields;
import com.liquidnet.service.kylin.entity.KylinPerformanceRelations;
import com.liquidnet.service.kylin.entity.KylinPerformanceStatus;
import com.liquidnet.service.kylin.entity.KylinPerformances;
......@@ -35,18 +36,22 @@ public class PerformanceVo {
@ApiModelProperty(value = "开售时间")
private String sellTime;
@ApiModelProperty(value = "城市id")
private String cityId;
private Integer cityId;
@ApiModelProperty(value = "城市名称")
private String cityName;
@ApiModelProperty(value = "场地id")
private String fieldId;
@ApiModelProperty(value = "场地名称")
private String fieldName;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
@ApiModelProperty(value = "搭售id")
private String projectId;
@ApiModelProperty(value = "巡演id")
private String roadShowId;
//@ApiModelProperty(value = "巡演相关")
// private String roadShowId;
// OSS
// @ApiModelProperty(value = "演出详情")
// private String details;
......@@ -102,6 +107,14 @@ public class PerformanceVo {
this.message = "";
}
public void setFieldsData(KylinFields fields,String cityName){
this.longitude = fields.getLongitude();
this.latitude = fields.getLatitude();
this.cityName = cityName;
this.fieldName = fields.getName();
this.cityId = fields.getCityId();
}
public void setPerformanceStatus(KylinPerformanceStatus performanceStatus) {
this.statusSell = performanceStatus.getStatusSell();
this.isRecommend = performanceStatus.getIsRecommend();
......@@ -113,8 +126,6 @@ public class PerformanceVo {
//TODO 巡演 搭售 场地
public void setPerformanceRelations(KylinPerformanceRelations performanceRelations) {
this.fieldId = performanceRelations.getFieldId();
this.fieldName = "";
this.cityId = "";
this.projectId = performanceRelations.getProjectId();
this.roadShowId = performanceRelations.getRoadShowId();
}
......
......@@ -526,6 +526,15 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
performanceVoData.setPerformanceRelations(performanceRelationsData);
performanceVoData.setPerformanceStatus(performanceStatusData);
String cityName=(String) redisUtil.hget(KylinRedisConst.FIELDS+":"+performanceVoData.getFieldId(),"city_name");
KylinFields fields = new KylinFields();
fields.setCityId(null);
fields.setLatitude((String) redisUtil.hget(KylinRedisConst.FIELDS+":"+performanceVoData.getFieldId(),"latitude"));
fields.setLongitude((String) redisUtil.hget(KylinRedisConst.FIELDS+":"+performanceVoData.getFieldId(),"longitude"));
fields.setCityName((String) redisUtil.hget(KylinRedisConst.FIELDS+":"+performanceVoData.getFieldId(),"city_name"));
fields.setName((String) redisUtil.hget(KylinRedisConst.FIELDS+":"+performanceVoData.getFieldId(),"name"));
performanceVoData.setFieldsData(fields,cityName);
//场次
List<KylinTicketTimeRelation> ticketTimeRelation = ticketTimeRelationMapper.selectList(
new UpdateWrapper<KylinTicketTimeRelation>().eq("performance_id", performancesId)
......@@ -633,7 +642,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
}
performanceVoData.setTimePriceVipAndLack(isLackRegister, isMember, isExclusive, price, stopSellTime, sellTime, isAdvance, isDiscount);
performanceVoData.setPerformanceRelations(performanceRelationsData);
boolean performanceExists =
mongoTemplate.exists(Query.query(Criteria.where("performancesId").is(performanceVoData.getPerformancesId())), PerformanceVo.class, PerformanceVo.class.getSimpleName());
if (!performanceExists) {
......
......@@ -64,14 +64,14 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
TicketTimesPartnerVo ticketTimesPartnerVo = null;
//获取演出状态
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(
new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id",createTicketTimesParam.getPerformancesId()));
if(null == performanceStatus){
new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", createTicketTimesParam.getPerformancesId()));
if (null == performanceStatus) {
ticketTimesPartnerVo = createTimes(createTicketTimesParam);
log.info(" PERFORMANCE 场次 创建");
}else if(performanceStatus.getStatus()>=3 && performanceStatus.getStatus()!=4){//未被拒绝 且 通过审核的演出
} else if (performanceStatus.getStatus() >= 3 && performanceStatus.getStatus() != 4) {//未被拒绝 且 通过审核的演出
ticketTimesPartnerVo = addNewTimes(createTicketTimesParam);
log.info(" PERFORMANCE 场次 新增");
}else {
} else {
ticketTimesPartnerVo = createTimes(createTicketTimesParam);
log.info(" PERFORMANCE 场次 创建");
}
......@@ -145,24 +145,28 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
try {
LocalDateTime updatedAt = LocalDateTime.now();
KylinTicketTimeRelation ticketTimeRelation = ticketTimeRelationMapper.selectOne(
new UpdateWrapper<KylinTicketTimeRelation>().eq("times_id",ticketTimesId));
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(
new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id",ticketTimeRelation.getPerformanceId()));
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")));
map.put("status", 0);
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
Document doc = mongoTemplate.getCollection(TicketTimesPartnerVo.class.getSimpleName()).findOneAndUpdate(
Query.query(Criteria.where("ticketTimesId").is(ticketTimesId)).getQueryObject(),
object,
new FindOneAndUpdateOptions().returnDocument(ReturnDocument.AFTER)
);
new UpdateWrapper<KylinTicketTimeRelation>().eq("times_id", ticketTimesId));
if (ticketTimeRelation != null) {
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(
new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", ticketTimeRelation.getPerformanceId()));
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")));
map.put("status", 0);
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
Document doc = mongoTemplate.getCollection(TicketTimesPartnerVo.class.getSimpleName()).findOneAndUpdate(
Query.query(Criteria.where("ticketTimesId").is(ticketTimesId)).getQueryObject(),
object,
new FindOneAndUpdateOptions().returnDocument(ReturnDocument.AFTER)
);
return true;
} else {
return false;
}
} else {
mongoTemplate.remove(Query.query(Criteria.where("ticketTimesId").is(ticketTimesId)), TicketTimesPartnerVo.class, TicketTimesPartnerVo.class.getSimpleName());
return true;
}else{
return false;
}
} catch (Exception e) {
return false;
......
......@@ -216,6 +216,10 @@ public class KylinTicketsPartnerServiceImpl extends ServiceImpl<KylinTicketsMapp
KylinTicketRelations ticketRelations = ticketRelationsMapper.selectOne(
new UpdateWrapper<KylinTicketRelations>().eq("ticket_id", ticketsId));
if (ticketRelations == null) {
mongoTemplate.remove(Query.query(Criteria.where("ticketsId").is(ticketsId)), TicketPartnerVo.class, TicketPartnerVo.class.getSimpleName());
return true;
}
KylinTicketTimeRelation ticketTimeRelation = ticketTimeRelationMapper.selectOne(
new UpdateWrapper<KylinTicketTimeRelation>().eq("times_id", ticketRelations.getTimesId()));
......
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