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

Commit 64c15b66 authored by 胡佳晨's avatar 胡佳晨

提交修改

parent 0eee0259
...@@ -18,6 +18,7 @@ public class PerformanceStep1Param implements Serializable { ...@@ -18,6 +18,7 @@ public class PerformanceStep1Param implements Serializable {
private String imgPoster; private String imgPoster;
@ApiModelProperty(value = "第三方id", example = "0") @ApiModelProperty(value = "第三方id", example = "0")
@NotNull(message = "不能为空")
private String merchantId; private String merchantId;
@ApiModelProperty(value = "演出名称", example = "测试演出") @ApiModelProperty(value = "演出名称", example = "测试演出")
......
...@@ -96,10 +96,11 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma ...@@ -96,10 +96,11 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
@Override @Override
public PerformanceMisVo performanceDetails(String performancesId) { public PerformanceMisVo performanceDetails(String performancesId) {
log.info(" PERFORMANCE mis演出详情"); log.info(" PERFORMANCE mis演出详情");
PerformanceMisVo createMisVo = mongoTemplate.findOne( // PerformanceMisVo createMisVo = mongoTemplate.findOne(
Query.query(Criteria.where("performancesId").is(performancesId)), // Query.query(Criteria.where("performancesId").is(performancesId)),
PerformanceMisVo.class, // PerformanceMisVo.class,
PerformanceMisVo.class.getSimpleName()); // PerformanceMisVo.class.getSimpleName());
PerformanceMisVo createMisVo = performanceVoTask.getPerformanceMisVo(performancesId);
return createMisVo; return createMisVo;
} }
...@@ -118,12 +119,12 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma ...@@ -118,12 +119,12 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
map.put("status", status); map.put("status", status);
map.put("auditStatus", auditStatus); map.put("auditStatus", auditStatus);
map.put("updatedAt", updatedAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); map.put("updatedAt", updatedAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
BasicDBObject objectPerformanceVo = new BasicDBObject("$set", mongoConverter.convertToMongoType(map)); // BasicDBObject objectPerformanceVo = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
Document doc = mongoTemplate.getCollection(PerformanceMisVo.class.getSimpleName()).findOneAndUpdate( // Document doc = mongoTemplate.getCollection(PerformanceMisVo.class.getSimpleName()).findOneAndUpdate(
Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(), // Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
objectPerformanceVo, // objectPerformanceVo,
new FindOneAndUpdateOptions().returnDocument(ReturnDocument.AFTER) // new FindOneAndUpdateOptions().returnDocument(ReturnDocument.AFTER)
); // );
KylinPerformanceStatus sqlStatus = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId)); KylinPerformanceStatus sqlStatus = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
if (sqlStatus.getStatus() == 1) { if (sqlStatus.getStatus() == 1) {
...@@ -161,7 +162,7 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma ...@@ -161,7 +162,7 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
HashMap<String, Object> mapSql = new HashMap<>(); HashMap<String, Object> mapSql = new HashMap<>();
mapSql.put("status", 9); mapSql.put("status", 9);
mapSql.put("updatedAt", updatedAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); mapSql.put("updatedAt", updatedAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performanceVoTask.updatePerformanceMySql(performancesId, mapSql, JsonUtils.fromJson(doc.toJson(), PerformanceMisVo.class), updatedAt); performanceVoTask.updatePerformanceMySql(performancesId, mapSql, performanceVoTask.getPerformanceMisVo(performancesId), updatedAt);
if (sqlStatus.getStatus() == 6) {//若 演出上 则 线判断状态 if (sqlStatus.getStatus() == 6) {//若 演出上 则 线判断状态
performanceVoTask.performanceVoStatus(performancesId); performanceVoTask.performanceVoStatus(performancesId);
} }
...@@ -179,10 +180,10 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma ...@@ -179,10 +180,10 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(), Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
object object
); );
mongoTemplate.getCollection(PerformanceMisVo.class.getSimpleName()).updateOne( // mongoTemplate.getCollection(PerformanceMisVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(), // Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
object // object
); // );
} else { } else {
return false; return false;
} }
......
...@@ -33,6 +33,7 @@ import org.springframework.data.mongodb.core.MongoTemplate; ...@@ -33,6 +33,7 @@ import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.convert.MongoConverter; import org.springframework.data.mongodb.core.convert.MongoConverter;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -64,6 +65,9 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -64,6 +65,9 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
@Autowired @Autowired
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Autowired
private RedisTemplate redisTemplate;
@Autowired @Autowired
private PerformanceVoTask performanceVoTask; private PerformanceVoTask performanceVoTask;
...@@ -136,12 +140,16 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -136,12 +140,16 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
performanceParam.setStatusSell(1); performanceParam.setStatusSell(1);
performanceParam.setRoadShowId("0"); performanceParam.setRoadShowId("0");
performanceParam.setProjectId("0"); performanceParam.setProjectId("0");
performanceParam.setFieldName((String)redisUtil.hget(KylinRedisConst.FIELDS + ":" + performanceParam.getFieldId(), "name"));
mongoTemplate.insert( mongoTemplate.insert(
performanceParam, PerformanceParam.class.getSimpleName() performanceParam, PerformanceParam.class.getSimpleName()
); );
return performanceId; return performanceId;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
return ""; return "";
} }
} }
...@@ -289,7 +297,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -289,7 +297,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
if (ticketTimesPartnerVoList.size() <= 0) { if (ticketTimesPartnerVoList.size() <= 0) {
return false; return false;
} else { } else {
PerformanceMisVo performanceMisVo = performanceVoTask.createPerformanceCreateParam(performanceId); PerformanceMisVo performanceMisVo = performanceVoTask.getPerformanceMisVo(performanceId);
HashMap<String, Object> mapSql = new HashMap<>(); HashMap<String, Object> mapSql = new HashMap<>();
mapSql.put("isCreateSave", 0); mapSql.put("isCreateSave", 0);
...@@ -356,7 +364,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -356,7 +364,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
if (ticketTimesPartnerVoList.size() <= 0) { if (ticketTimesPartnerVoList.size() <= 0) {
return false; return false;
} else { } else {
PerformanceMisVo performanceMisVo = performanceVoTask.setPerformanceUpdateParam(performanceId); PerformanceMisVo performanceMisVo = performanceVoTask.getPerformanceMisVo(performanceId);
HashMap<String, Object> mapSql = new HashMap<>(); HashMap<String, Object> mapSql = new HashMap<>();
mapSql.put("rejectTxt", ""); mapSql.put("rejectTxt", "");
...@@ -633,14 +641,14 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -633,14 +641,14 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
performanceVoData, PerformanceVo.class.getSimpleName() performanceVoData, PerformanceVo.class.getSimpleName()
); );
} }
//修改 提审vo // //修改 提审vo
Map<String, Object> map = new HashMap<>(); // Map<String, Object> map = new HashMap<>();
map.put("status", 3); // map.put("status", 3);
BasicDBObject objectPerformance = new BasicDBObject("$set", mongoConverter.convertToMongoType(map)); // BasicDBObject objectPerformance = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
mongoTemplate.getCollection(PerformanceMisVo.class.getSimpleName()).updateOne( // mongoTemplate.getCollection(PerformanceMisVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(), // Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
objectPerformance // objectPerformance
); // );
//判断状态 //判断状态
performanceVoTask.performanceVoStatus(performancesId); performanceVoTask.performanceVoStatus(performancesId);
return true; return true;
......
...@@ -217,19 +217,13 @@ public class PerformanceVoTask { ...@@ -217,19 +217,13 @@ public class PerformanceVoTask {
} }
/**
* 根据票 判断 演出会员相关状态
* @param performanceId
*/
public void performanceVoMember(String performanceId){}
/** /**
* 生成 PerformanceCreatePartnerVo(用于审核第一次提交数据) * 生成 PerformanceCreatePartnerVo(用于审核第一次提交数据)
* *
* @param performancesId * @param performancesId
* @return * @return
*/ */
public PerformanceMisVo createPerformanceCreateParam(String performancesId) { public PerformanceMisVo getPerformanceMisVo(String performancesId) {
PerformanceParam performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName()); PerformanceParam performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName());
List<TicketTimesPartnerVo> ticketTimesPartnerVos = ticketTimesPartnerService.getTimesMongoList(performancesId); List<TicketTimesPartnerVo> ticketTimesPartnerVos = ticketTimesPartnerService.getTimesMongoList(performancesId);
List<TicketTimesTicketCreatePartnerVo> ticketTimesTicketCreatePartnerVoList = new ArrayList<TicketTimesTicketCreatePartnerVo>(); List<TicketTimesTicketCreatePartnerVo> ticketTimesTicketCreatePartnerVoList = new ArrayList<TicketTimesTicketCreatePartnerVo>();
...@@ -266,77 +260,77 @@ public class PerformanceVoTask { ...@@ -266,77 +260,77 @@ public class PerformanceVoTask {
performanceMisVo.setSyncAgent(0); performanceMisVo.setSyncAgent(0);
performanceMisVo.setAuditStatus(0); performanceMisVo.setAuditStatus(0);
boolean exists = mongoTemplate.exists(Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceMisVo.class, PerformanceMisVo.class.getSimpleName()); // boolean exists = mongoTemplate.exists(Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceMisVo.class, PerformanceMisVo.class.getSimpleName());
//
if (!exists) { // if (!exists) {
PerformanceMisVo data = mongoTemplate.insert( // PerformanceMisVo data = mongoTemplate.insert(
performanceMisVo, PerformanceMisVo.class.getSimpleName() // performanceMisVo, PerformanceMisVo.class.getSimpleName()
); // );
} // }
return performanceMisVo; return performanceMisVo;
} }
/** // /**
* 生成 PerformanceUpdatePartnerVo(用于修改审核提交数据) // * 生成 PerformanceUpdatePartnerVo(用于修改审核提交数据)
* // *
* @param performancesId // * @param performancesId
* @return // * @return
*/ // */
public PerformanceMisVo setPerformanceUpdateParam(String performancesId) { // public PerformanceMisVo setPerformanceUpdateParam(String performancesId) {
PerformanceParam performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName()); // PerformanceParam performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName());
List<TicketTimesPartnerVo> ticketTimesPartnerVos = ticketTimesPartnerService.getTimesMongoList(performancesId); // List<TicketTimesPartnerVo> ticketTimesPartnerVos = ticketTimesPartnerService.getTimesMongoList(performancesId);
List<TicketTimesTicketCreatePartnerVo> ticketTimesTicketCreatePartnerVoList = new ArrayList<TicketTimesTicketCreatePartnerVo>(); // List<TicketTimesTicketCreatePartnerVo> ticketTimesTicketCreatePartnerVoList = new ArrayList<TicketTimesTicketCreatePartnerVo>();
//
ArrayList<BigDecimal> floatList = new ArrayList<>(); // ArrayList<BigDecimal> floatList = new ArrayList<>();
ArrayList<String> StringList = new ArrayList<>(); // ArrayList<String> StringList = new ArrayList<>();
//
for (TicketTimesPartnerVo ticketTimes : ticketTimesPartnerVos) { // for (TicketTimesPartnerVo ticketTimes : ticketTimesPartnerVos) {
TicketTimesTicketCreatePartnerVo ticketTimesTicketCreatePartnerVo = new TicketTimesTicketCreatePartnerVo(); // TicketTimesTicketCreatePartnerVo ticketTimesTicketCreatePartnerVo = new TicketTimesTicketCreatePartnerVo();
BeanUtils.copyProperties(ticketTimes, ticketTimesTicketCreatePartnerVo); // BeanUtils.copyProperties(ticketTimes, ticketTimesTicketCreatePartnerVo);
List<TicketPartnerVo> ticketPartnerVos = ticketsPartnerService.getTicketMongoList(ticketTimes.getTicketTimesId()); // List<TicketPartnerVo> ticketPartnerVos = ticketsPartnerService.getTicketMongoList(ticketTimes.getTicketTimesId());
ticketTimesTicketCreatePartnerVo.setTicket(ticketPartnerVos); // ticketTimesTicketCreatePartnerVo.setTicket(ticketPartnerVos);
ticketTimesTicketCreatePartnerVoList.add(ticketTimesTicketCreatePartnerVo); // ticketTimesTicketCreatePartnerVoList.add(ticketTimesTicketCreatePartnerVo);
for (TicketPartnerVo ticketPartnerVoItem : ticketPartnerVos) { // for (TicketPartnerVo ticketPartnerVoItem : ticketPartnerVos) {
floatList.add(ticketPartnerVoItem.getPrice()); // floatList.add(ticketPartnerVoItem.getPrice());
StringList.add(ticketPartnerVoItem.getTimeEnd()); // StringList.add(ticketPartnerVoItem.getTimeEnd());
} // }
} // }
PerformanceMisVo performanceMisVo = new PerformanceMisVo(); // PerformanceMisVo performanceMisVo = new PerformanceMisVo();
BeanUtils.copyProperties(performanceData, performanceMisVo); // BeanUtils.copyProperties(performanceData, performanceMisVo);
//
floatList.sort(Comparator.reverseOrder()); // floatList.sort(Comparator.reverseOrder());
StringList.sort(Comparator.naturalOrder()); // StringList.sort(Comparator.naturalOrder());
//
performanceMisVo.setPrice(floatList.get(0) + "起"); // performanceMisVo.setPrice(floatList.get(0) + "起");
performanceMisVo.setStopSellTime(StringList.get(0)); // performanceMisVo.setStopSellTime(StringList.get(0));
performanceMisVo.setTicketTimes(ticketTimesTicketCreatePartnerVoList); // performanceMisVo.setTicketTimes(ticketTimesTicketCreatePartnerVoList);
performanceMisVo.setStatus(1); // performanceMisVo.setStatus(1);
performanceMisVo.setRejectTxt(""); // performanceMisVo.setRejectTxt("");
performanceMisVo.setAuditStatus(0); // performanceMisVo.setAuditStatus(0);
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId)); // KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
performanceMisVo.setStatusSell(performanceStatus.getStatusSell()); // performanceMisVo.setStatusSell(performanceStatus.getStatusSell());
performanceMisVo.setIsShow(performanceStatus.getIsShow()); // performanceMisVo.setIsShow(performanceStatus.getIsShow());
performanceMisVo.setIsDistribution(performanceStatus.getIsDistribution()); // performanceMisVo.setIsDistribution(performanceStatus.getIsDistribution());
performanceMisVo.setSyncAgent(performanceStatus.getSyncAgent()); // performanceMisVo.setSyncAgent(performanceStatus.getSyncAgent());
//
//
boolean exists = mongoTemplate.exists(Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceMisVo.class, PerformanceMisVo.class.getSimpleName()); //// boolean exists = mongoTemplate.exists(Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceMisVo.class, PerformanceMisVo.class.getSimpleName());
////
if (!exists) { //// if (!exists) {
mongoTemplate.insert( //// mongoTemplate.insert(
performanceMisVo, PerformanceMisVo.class.getSimpleName() //// performanceMisVo, PerformanceMisVo.class.getSimpleName()
); //// );
} else { //// } else {
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(performanceMisVo)); //// BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(performanceMisVo));
mongoTemplate.getCollection(PerformanceMisVo.class.getSimpleName()).updateOne( //// mongoTemplate.getCollection(PerformanceMisVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(), //// Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
object //// object
); //// );
} //// }
//
return performanceMisVo; // return performanceMisVo;
} // }
/** /**
* 插入数据库 * 插入数据库
...@@ -425,7 +419,9 @@ public class PerformanceVoTask { ...@@ -425,7 +419,9 @@ public class PerformanceVoTask {
tickets.setPriceDiscount(new BigDecimal("0.00")); tickets.setPriceDiscount(new BigDecimal("0.00"));
tickets.setTimeStart(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketItem.getTimeStart()))); tickets.setTimeStart(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketItem.getTimeStart())));
tickets.setTimeEnd(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketItem.getTimeEnd()))); tickets.setTimeEnd(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketItem.getTimeEnd())));
if(ticketItem.getIsExpress()==1) {
tickets.setTimeEndExpress(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketItem.getTimeEndExpress()))); tickets.setTimeEndExpress(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketItem.getTimeEndExpress())));
}
tickets.setUseStart(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketTimeItem.getUseStart()))); tickets.setUseStart(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketTimeItem.getUseStart())));
tickets.setUseEnd(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketTimeItem.getUseEnd()))); tickets.setUseEnd(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketTimeItem.getUseEnd())));
tickets.setSaleRemindMinute(60); tickets.setSaleRemindMinute(60);
...@@ -440,7 +436,9 @@ public class PerformanceVoTask { ...@@ -440,7 +436,9 @@ public class PerformanceVoTask {
ticketStatus.setIsTrueName(performanceStatus.getIsTrueName()); ticketStatus.setIsTrueName(performanceStatus.getIsTrueName());
ticketStatus.setMemberLimitCount(1); ticketStatus.setMemberLimitCount(1);
ticketStatus.setStatusExchange(7); ticketStatus.setStatusExchange(7);
if(ticketItem.getIsShowCode() == 1){
ticketStatus.setQrCodeShowTime(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketItem.getQrCodeShowTime()))); ticketStatus.setQrCodeShowTime(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketItem.getQrCodeShowTime())));
}
ticketRelations.setCreatedAt(tickets.getCreatedAt()); ticketRelations.setCreatedAt(tickets.getCreatedAt());
ticketRelations.setUpdatedAt(updatedAt); ticketRelations.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