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

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

提交 撤回接口

parent 764c6336
......@@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.List;
@Data
public class PerformanceParam implements Serializable {
public class PerformancePartnerVo implements Serializable {
@ApiModelProperty(value = "演出id", example = "")
@JsonIgnore
......@@ -95,7 +95,7 @@ public class PerformanceParam implements Serializable {
private String rejectTxt;
@ApiModelProperty(value = "审核状态", hidden = true)
private String auditStatus;
private Integer auditStatus;
@ApiModelProperty(value = "审核状态", hidden = true)
private Integer isShow;
......@@ -104,7 +104,7 @@ public class PerformanceParam implements Serializable {
private String projectId;
@ApiModelProperty(value = "购票须知 Id 数组")
private List<Integer> noticeIds;
private List<String> noticeIds;
@ApiModelProperty(value = "", example = "")
private String createdAt;
......
......@@ -83,7 +83,7 @@ public class PerformanceStep1Param implements Serializable {
@ApiModelProperty(value = "购票须知 Id 数组")
@NotNull(message = "不能为空")
private List<Integer> noticeIds;
private List<String> noticeIds;
@ApiModelProperty(value = "演出简介", example = "")
private String describes;
......
package com.liquidnet.service.kylin.dto.vo.partner;
import com.liquidnet.service.kylin.dto.param.PerformanceParam;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -34,7 +34,7 @@ public class PerformancePartnerListVo {
private String createdAt;
@ApiModelProperty(value = "返回数据赋值",hidden = true)
public void setStatus0Data(PerformanceParam item){
public void setStatus0Data(PerformancePartnerVo item){
this.performancesId=item.getPerformancesId();
this.title=item.getTitle();
this.timeStart=item.getTimeStart();
......
package com.liquidnet.service.kylin.dto.vo.partner;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class PerformancePartnerVo implements Serializable {
@ApiModelProperty(value = "演出id", example = "")
@JsonIgnore
private String performancesId;
@ApiModelProperty(value = "封面图", example = "https://img.zhengzai.tv/partner/2019/05/14/5cda2d0520177.png")
private String imgPoster;
@ApiModelProperty(value = "演出名称", example = "测试演出")
private String title;
@ApiModelProperty(value = "演出类型 1音乐节 2演唱会 3小型演出 4展览 6舞台剧", example = "3")
private int type;
@ApiModelProperty(value = "演出开始时间", example = "2021-05-01 12:00:00")
private String timeStart;
@ApiModelProperty(value = "演出结束时间", example = "2021-05-04 12:00:00")
private String timeEnd;
@ApiModelProperty(value = "场地id", example = "1")
private String fieldId;
@ApiModelProperty(value = "场地id", example = "1")
private String fieldName;
@ApiModelProperty(value = "演出公告", example = "这是演出公告")
private String notice;
@ApiModelProperty(value = "主办方id", example = "1")
private String sponsorId;
@ApiModelProperty(value = "主办方类型", example = "1")
private String sponsorType;
@ApiModelProperty(value = "主办方名称", example = "主办方名称")
private String sponsor;
@ApiModelProperty(value = "联系人", example = "联系人")
private String contacts;
@ApiModelProperty(value = "联系方式", example = "手机号")
private String mobile;
@ApiModelProperty(value = "演出详情", example = "<p>演出详情</p>")
private String details;
@ApiModelProperty(value = "演出批文地址", example = "这是一个演出批文地址")
private String approvalUrl;
@ApiModelProperty(value = "待支付时间", example = "5")
private int payCountdownMinute;
@ApiModelProperty(value = "购票须知", example = "[{\"id\":1,\"title\":\"\\u95e8\\u7968\\u4e0d\\u9000\\u4e0d\\u6362\",\"type\":\"image\",\"url\":\"http:\\/\\/img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com\\/partner\\/2019\\/01\\/21\\/5c45722882a13.png\",\"text\":\"\\u95e8\\u7968\\u4e3a\\u6709\\u4ef7\\u8bc1\\u5238\\uff0c\\u5e76\\u975e\\u5546\\u54c1\\uff0c\\u4e00\\u7ecf\\u552e\\u51fa\\u4e0d\\u4e88\\u9000\\u6362\\u3002\\u56e0\\u201c\\u4e0d\\u53ef\\u6297\\u529b\\u201d\\u5bfc\\u81f4\\u7684\\u6f14\\u51fa\\u53d6\\u6d88\\u6216\\u5ef6\\u671f\\u9664\\u5916\\u3002\",\"sort\":1},{\"id\":3,\"title\":\"\\u4ec5\\u8bbe\\u7ad9\\u5e2d\",\"type\":\"image\",\"url\":\"http:\\/\\/img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com\\/partner\\/2019\\/01\\/21\\/5c456e93db0b9.png\",\"text\":\"\\u672c\\u573a\\u6f14\\u51fa\\u4e0d\\u8bbe\\u5ea7\\u4f4d\\uff0c\\u5747\\u4e3a\\u7ad9\\u5e2d\\u89c2\\u6f14\\u3002\",\"sort\":2},{\"id\":4,\"title\":\"\\u7981\\u6b62\\u4e2a\\u4eba\\u7968\\u52a1\\u4e70\\u5356\",\"type\":\"image\",\"url\":\"http:\\/\\/img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com\\/partner\\/2019\\/01\\/21\\/5c456e5c27644.png\",\"text\":\"\\u4e3a\\u9632\\u6b62\\u4e0d\\u6cd5\\u5206\\u5b50\\u5229\\u7528\\u7968\\u52a1\\u8f6c\\u8ba9\\u8bc8\\u9a97\\u94b1\\u6b3e\\uff0c\\u5efa\\u8bae\\u5e7f\\u5927\\u4e50\\u8ff7\\u4e0d\\u8981\\u8fdb\\u884c\\u4e2a\\u4eba\\u95f4\\u7968\\u52a1\\u4e70\\u5356\\uff0c\\u4e0d\\u8981\\u8f7b\\u6613\\u76f8\\u4fe1\\u6765\\u6e90\\u4e0d\\u660e\\u7684\\u8f6c\\u7968\\uff0c\\u4ee5\\u514d\\u81ea\\u8eab\\u5229\\u76ca\\u53d7\\u5230\\u4fb5\\u5bb3\\u3002\",\"sort\":3}]")
private String noticeImage;
@ApiModelProperty(value = "是否实名", example = "0")
private int isTrueName;
@ApiModelProperty(value = "限购数量 0为不限购", example = "0")
private int limitCount;
@ApiModelProperty(value = "是否提交 1提交 0不提交(不验证参数)", example = "0")
private int isSubmit;
@ApiModelProperty(value = "状态:-1删除;0未提交;1审核中;2审核中(自动上线);3审核通过;4审核未通过;6上线;7下架;8活动结束;9活动取消退款中;10活动取消退", example = "0")
private int status;
@ApiModelProperty(value = "第三方id", example = "0")
private String merchantId;
@ApiModelProperty(value = "演出简介", example = "0")
private String describes;
@ApiModelProperty(value = "是否售卖", example = "0")
private int statusSell;
@ApiModelProperty(value = "巡演id", example = "0",hidden = true)
private String roadShowId;
@ApiModelProperty(value = "搭售id", example = "0",hidden = true)
private String projectId;
@ApiModelProperty(value = "", example = "")
private String createdAt;
@ApiModelProperty(value = "是否保存", example = "")
private int isCreateSave;
}
......@@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.kylin.dao.PerformancePartnerListDao;
import com.liquidnet.service.kylin.dto.param.*;
import com.liquidnet.service.kylin.dto.vo.BuyNoticeVo;
import com.liquidnet.service.kylin.dto.vo.partner.PerformancePartnerVo;
import com.liquidnet.service.kylin.entity.KylinPerformances;
/**
......@@ -21,12 +19,15 @@ public interface IKylinPerformancesPartnerService extends IService<KylinPerforma
/**
* 演出第一步
*
* @param step1Param 相关参数
* @return 演出id
*/
String step1(PerformanceStep1Param step1Param);
/**
* 创建演出第一步
*
* @param step1Param 相关参数
* @return 演出id
*/
......@@ -34,6 +35,7 @@ public interface IKylinPerformancesPartnerService extends IService<KylinPerforma
/**
* 修改演出第一步
*
* @param step1Param 相关参数
* @return 演出id
*/
......@@ -41,28 +43,15 @@ public interface IKylinPerformancesPartnerService extends IService<KylinPerforma
/**
* 获取演出第一步数据
*
* @param performancesId 演出id
* @return 演出对象
*/
PerformancePartnerVo getStep1(String performancesId);
// /**
// * 获取创建演出第一步数据
// * @param performancesId
// * @return
// */
// PerformanceParam getCreateStep1(String performancesId);
//
// /**
// * 获取修改演出第一步数据
// * @param performancesId
// * @return
// */
// PerformanceParam getUpdateStep1(String performancesId);
/**
* 演出第二步
*
* @param step2Param 相关参数
* @return boolean
*/
......@@ -70,6 +59,7 @@ public interface IKylinPerformancesPartnerService extends IService<KylinPerforma
/**
* 演出第二步创建
*
* @param step2Param 相关参数
* @return boolean
*/
......@@ -77,6 +67,7 @@ public interface IKylinPerformancesPartnerService extends IService<KylinPerforma
/**
* 演出第二步修改
*
* @param step2Param 相关参数
* @return boolean
*/
......@@ -84,6 +75,7 @@ public interface IKylinPerformancesPartnerService extends IService<KylinPerforma
/**
* 获取演出第二步数据
*
* @param performancesId 演出id
* @return 演出 第二步 数据
*/
......@@ -95,6 +87,7 @@ public interface IKylinPerformancesPartnerService extends IService<KylinPerforma
/**
* 演出上线
*
* @param performancesId 演出id
* @return boolean
*/
......@@ -102,6 +95,7 @@ public interface IKylinPerformancesPartnerService extends IService<KylinPerforma
/**
* 演出下线
*
* @param performancesId 演出id
* @return boolean
*/
......@@ -109,6 +103,7 @@ public interface IKylinPerformancesPartnerService extends IService<KylinPerforma
/**
* 复制演出 (只有巡演类型)
*
* @param performancesId 演出id
* @return 演出id
*/
......@@ -116,8 +111,18 @@ public interface IKylinPerformancesPartnerService extends IService<KylinPerforma
/**
* 演出列表
*
* @param performancePartnerListParam 相关参数
* @return 分页 msql 数据
*/
PageInfo<PerformancePartnerListDao> getList(PerformancePartnerListParam performancePartnerListParam);
/**
* 演出撤回
*
* @param performancesId 演出id
* @return boolean
*/
boolean withdraw(String performancesId);
}
......@@ -4,7 +4,6 @@ import com.github.pagehelper.PageInfo;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dao.PerformancePartnerListDao;
import com.liquidnet.service.kylin.dto.param.*;
import com.liquidnet.service.kylin.dto.vo.partner.PerformancePartnerVo;
import com.liquidnet.service.kylin.service.impl.partner.KylinPerformancesPartnerServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -125,4 +124,16 @@ public class PerformancePartnerController {
return ResponseDto.failure("下架失败");
}
}
@PostMapping(value = "withdraw")
@ApiOperation(value = "演出撤回")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<String> withdraw(@RequestParam("performancesId") String performancesId) {
boolean result = performancesPartnerService.withdraw(performancesId);
if (result) {
return ResponseDto.success("撤回成功");
} else {
return ResponseDto.failure("撤回失败");
}
}
}
......@@ -6,7 +6,6 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dao.*;
import com.liquidnet.service.kylin.dto.param.*;
......@@ -120,7 +119,7 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
map.put("auditStatus", auditStatus);
map.put("updatedAt", updatedAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
BasicDBObject objectPerformanceVo = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
Document doc = mongoTemplate.getCollection(PerformanceParam.class.getSimpleName()).findOneAndUpdate(
Document doc = mongoTemplate.getCollection(PerformancePartnerVo.class.getSimpleName()).findOneAndUpdate(
Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
objectPerformanceVo,
new FindOneAndUpdateOptions().returnDocument(ReturnDocument.AFTER)
......@@ -159,10 +158,11 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
}
} else { //只修改演出相关 场次 票 (不包括 库存 售卖时间 限购)
log.info(" PERFORMANCE 演出审核 修改");
HashMap<String, Object> mapSql = new HashMap<>();
mapSql.put("status", 9);
mapSql.put("updatedAt", updatedAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performanceVoTask.updatePerformanceMySql(performancesId, mapSql, performanceVoTask.getPerformanceMisVo(performancesId), updatedAt);
performanceVoTask.updatePerformanceMySql(performancesId, mapSql, performanceVoTask.getPerformanceMisVo(performancesId), updatedAt,auditStatus);
if (sqlStatus.getStatus() == 6) {//若 演出上 则 线判断状态
performanceVoTask.performanceVoStatus(performancesId);
}
......@@ -176,10 +176,17 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
map.put("status", status);
map.put("updatedAt", updatedAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
mongoTemplate.getCollection(PerformanceParam.class.getSimpleName()).updateOne(
mongoTemplate.getCollection(PerformancePartnerVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
object
);
KylinPerformanceStatus performanceStatus = new KylinPerformanceStatus();
performanceStatus.setAuditStatus(auditStatus);
performanceStatus.setUpdatedAt(updatedAt);
performanceStatusMapper.update(performanceStatus, new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
// mongoTemplate.getCollection(PerformanceMisVo.class.getSimpleName()).updateOne(
// Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
// object
......
......@@ -108,7 +108,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
result = createStep1(step1Param);
log.info(" PERFORMANCE 演出第一步 创建");
} else { // 获取 create 数据 status = 0 或 无数据 创建
PerformanceParam createParam = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(step1Param.getPerformancesId())), PerformanceParam.class, PerformanceParam.class.getSimpleName());
PerformancePartnerVo createParam = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(step1Param.getPerformancesId())), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName());
if (createParam == null) {
result = createStep1(step1Param);
log.info(" PERFORMANCE 演出第一步 创建");
......@@ -129,23 +129,22 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
try {
step1Param.setPerformancesId(performanceId);
PerformanceParam performanceParam = new PerformanceParam();
BeanUtils.copyProperties(step1Param, performanceParam);
performanceParam.setIsTrueName(0);
performanceParam.setLimitCount(0);
performanceParam.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performanceParam.setIsSubmit(0);
performanceParam.setStatus(0);
performanceParam.setStatusSell(1);
performanceParam.setRoadShowId("0");
performanceParam.setProjectId("0");
performanceParam.setIsShow(1);
performanceParam.setFieldName((String)redisUtil.hget(KylinRedisConst.FIELDS + ":" + performanceParam.getFieldId(), "name"));
performanceParam.setNoticeImage(dataUtils.getBuyNoticeJsonString(step1Param.getNoticeIds()));
PerformancePartnerVo performancePartnerVo = new PerformancePartnerVo();
BeanUtils.copyProperties(step1Param, performancePartnerVo);
performancePartnerVo.setIsTrueName(0);
performancePartnerVo.setLimitCount(0);
performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(0);
performancePartnerVo.setStatus(0);
performancePartnerVo.setStatusSell(1);
performancePartnerVo.setRoadShowId("0");
performancePartnerVo.setProjectId("0");
performancePartnerVo.setIsShow(1);
performancePartnerVo.setFieldName((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + performancePartnerVo.getFieldId(), "name"));
performancePartnerVo.setNoticeImage(dataUtils.getBuyNoticeJsonString(step1Param.getNoticeIds()));
mongoTemplate.insert(
performanceParam, PerformanceParam.class.getSimpleName()
performancePartnerVo, PerformancePartnerVo.class.getSimpleName()
);
return performanceId;
......@@ -162,36 +161,36 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
String performanceId = step1Param.getPerformancesId();
try {
step1Param.setPerformancesId(performanceId);
PerformanceParam performanceParam = new PerformanceParam();
BeanUtils.copyProperties(step1Param, performanceParam);
performanceParam.setCreatedAt(timeNow.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performanceParam.setUpdatedAt(timeNow.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performanceParam.setIsSubmit(0);
performanceParam.setStatus(0);
performanceParam.setNoticeImage(dataUtils.getBuyNoticeJsonString(step1Param.getNoticeIds()));
PerformanceParam data = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performanceId)),
PerformanceParam.class, PerformanceParam.class.getSimpleName());
PerformancePartnerVo performancePartnerVo = new PerformancePartnerVo();
BeanUtils.copyProperties(step1Param, performancePartnerVo);
performancePartnerVo.setCreatedAt(timeNow.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setUpdatedAt(timeNow.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(0);
performancePartnerVo.setStatus(0);
performancePartnerVo.setNoticeImage(dataUtils.getBuyNoticeJsonString(step1Param.getNoticeIds()));
PerformancePartnerVo data = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performanceId)),
PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName());
if (data != null) { // 有修改记录
performanceParam.setIsTrueName(data.getIsTrueName());
performanceParam.setLimitCount(data.getLimitCount());
performanceParam.setStatusSell(data.getStatusSell());
performanceParam.setRoadShowId(data.getRoadShowId());
performanceParam.setProjectId(data.getProjectId());
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(performanceParam));
mongoTemplate.getCollection(PerformanceParam.class.getSimpleName()).updateOne(
performancePartnerVo.setIsTrueName(data.getIsTrueName());
performancePartnerVo.setLimitCount(data.getLimitCount());
performancePartnerVo.setStatusSell(data.getStatusSell());
performancePartnerVo.setRoadShowId(data.getRoadShowId());
performancePartnerVo.setProjectId(data.getProjectId());
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(performancePartnerVo));
mongoTemplate.getCollection(PerformancePartnerVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("performancesId").is(performanceId)).getQueryObject(),
object
);
} else { // 无修改记录
KylinPerformanceStatus statusData = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performanceId", performanceId));
KylinPerformanceRelations relationsData = performanceRelationsMapper.selectOne(new UpdateWrapper<KylinPerformanceRelations>().eq("performancesId", performanceId));
performanceParam.setIsTrueName(statusData.getIsTrueName());
performanceParam.setLimitCount(statusData.getLimitCount());
performanceParam.setStatusSell(statusData.getStatusSell());
performanceParam.setRoadShowId(relationsData.getRoadShowId());
performanceParam.setProjectId(relationsData.getProjectId());
performancePartnerVo.setIsTrueName(statusData.getIsTrueName());
performancePartnerVo.setLimitCount(statusData.getLimitCount());
performancePartnerVo.setStatusSell(statusData.getStatusSell());
performancePartnerVo.setRoadShowId(relationsData.getRoadShowId());
performancePartnerVo.setProjectId(relationsData.getProjectId());
mongoTemplate.insert(
performanceParam, PerformanceParam.class.getSimpleName()
performancePartnerVo, PerformancePartnerVo.class.getSimpleName()
);
}
return performanceId;
......@@ -202,42 +201,16 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
@Override
public PerformancePartnerVo getStep1(String performancesId) {
PerformancePartnerVo performancePartnerVo = new PerformancePartnerVo();
// PerformanceParam updateData = getUpdateStep1(performancesId);
PerformanceParam data = mongoTemplate.findOne(
Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName()
PerformancePartnerVo data = mongoTemplate.findOne(
Query.query(Criteria.where("performancesId").is(performancesId)), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName()
);
if (data == null) {
return performancePartnerVo;
return null;
}
BeanUtils.copyProperties(data, performancePartnerVo);
log.info(" PERFORMANCE 演出第一步 获取");
return performancePartnerVo;
return data;
}
// @Override
// public PerformanceParam getCreateStep1(String performancesId) {
// PerformanceParam data = mongoTemplate.findOne(
// Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName()
// );
// if (data == null) {
// return new PerformanceParam();
// }
// return data;
// }
//
// @Override
// public PerformanceParam getUpdateStep1(String performancesId) {
//
// PerformanceParam data = mongoTemplate.findOne(
// Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName()
// );
// if (data == null) {
// return new PerformanceParam();
// }
// return data;
// }
@Override
public boolean step2(PerformanceStep2Param step2Param) {
boolean result = false;
......@@ -265,8 +238,8 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
LocalDateTime createdAt = LocalDateTime.now();
boolean isExistsSubmit = mongoTemplate.exists(Query.query(Criteria.where("performancesId").is(performanceId).and("status").is(1)),
PerformanceParam.class,
PerformanceParam.class.getSimpleName());
PerformancePartnerVo.class,
PerformancePartnerVo.class.getSimpleName());
if (isExistsSubmit) {
return false;
......@@ -284,7 +257,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
if (step2Param.getIsSubmit() == 1) { // 提交
map.put("status", 1);
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
mongoTemplate.getCollection(PerformanceParam.class.getSimpleName()).updateOne(
mongoTemplate.getCollection(PerformancePartnerVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("performancesId").is(performanceId)).getQueryObject(),
object
);
......@@ -315,7 +288,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
map.put("status", 0);
map.put("isCreateSave", 1);
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
mongoTemplate.getCollection(PerformanceParam.class.getSimpleName()).updateMany(
mongoTemplate.getCollection(PerformancePartnerVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("performancesId").is(performanceId)).getQueryObject(),
object
);
......@@ -332,8 +305,8 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
LocalDateTime createdAt = LocalDateTime.now();
boolean isExistsSubmit = mongoTemplate.exists(Query.query(Criteria.where("performancesId").is(performanceId).and("status").is(1)),
PerformanceParam.class,
PerformanceParam.class.getSimpleName());
PerformancePartnerVo.class,
PerformancePartnerVo.class.getSimpleName());
if (isExistsSubmit) {
return false;
......@@ -351,7 +324,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
if (step2Param.getIsSubmit() == 1) { // 提交
map.put("status", 1);
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
mongoTemplate.getCollection(PerformanceParam.class.getSimpleName()).updateOne(
mongoTemplate.getCollection(PerformancePartnerVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("performancesId").is(performanceId)).getQueryObject(),
object
);
......@@ -375,6 +348,9 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
KylinPerformances performances = new KylinPerformances();
performances.setAuditTime(LocalDateTime.now());
performancesMapper.update(performances, new UpdateWrapper<KylinPerformances>().eq("performances_id", performanceId));
KylinPerformanceStatus performanceStatus = new KylinPerformanceStatus();
performanceStatus.setAuditStatus(0);
performanceStatusMapper.update(performanceStatus, new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performanceId));
//提示:票种价格、售票时间、购票限制 直接生效
List<TicketTimesTicketCreatePartnerVo> timeList = performanceMisVo.getTicketTimes();
......@@ -412,7 +388,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
} else { //保存
map.put("status", 0);
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
mongoTemplate.getCollection(PerformanceParam.class.getSimpleName()).updateMany(
mongoTemplate.getCollection(PerformancePartnerVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("performancesId").is(performanceId)).getQueryObject(),
object
);
......@@ -424,8 +400,8 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
@Override
public PerformanceStep2Param getStep2(String performancesId) {
PerformanceStep2Param performanceCreatePartnerVo = null;
PerformanceParam data = mongoTemplate.findOne(
Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName()
PerformancePartnerVo data = mongoTemplate.findOne(
Query.query(Criteria.where("performancesId").is(performancesId)), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName()
);
if (data == null) {
return new PerformanceStep2Param();
......@@ -449,62 +425,6 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
return performanceCreatePartnerVo;
}
// @Override
// public PerformanceStep2Param getCreateStep2(String performancesId) {
// PerformanceParam data = mongoTemplate.findOne(
// Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName()
// );
//
// if (data == null) {
// return new PerformanceStep2Param();
// }
//
// List<TicketTimesPartnerVo> ticketTimesPartnerVos = ticketTimesPartnerService.getTimesMongoList(performancesId);
// List<TicketTimesTicketCreatePartnerVo> ticketTimesTicketCreatePartnerVoList = new ArrayList();
//
// for (TicketTimesPartnerVo ticketTimes : ticketTimesPartnerVos) {
// TicketTimesTicketCreatePartnerVo ticketTimesTicketCreatePartnerVo = new TicketTimesTicketCreatePartnerVo();
// BeanUtils.copyProperties(ticketTimes, ticketTimesTicketCreatePartnerVo);
// List<TicketPartnerVo> ticketPartnerVos = ticketsPartnerService.getTicketMongoList(ticketTimes.getTicketTimesId());
// ticketTimesTicketCreatePartnerVo.setTicket(ticketPartnerVos);
// ticketTimesTicketCreatePartnerVoList.add(ticketTimesTicketCreatePartnerVo);
// }
//
// PerformanceStep2Param performanceStep2Param = new PerformanceStep2Param();
// BeanUtils.copyProperties(data, performanceStep2Param);
// performanceStep2Param.setTicketTimes(ticketTimesTicketCreatePartnerVoList);
//
// return performanceStep2Param;
// }
//
// @Override
// public PerformanceStep2Param getUpdateStep2(String performancesId) {
// PerformanceParam data = mongoTemplate.findOne(
// Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName()
// );
//
// if (data == null) {
// return new PerformanceStep2Param();
// }
//
// List<TicketTimesPartnerVo> ticketTimesPartnerVos = ticketTimesPartnerService.getTimesMongoList(performancesId);
// List<TicketTimesTicketCreatePartnerVo> ticketTimesTicketCreatePartnerVoList = new ArrayList<TicketTimesTicketCreatePartnerVo>();
//
// for (TicketTimesPartnerVo ticketTimes : ticketTimesPartnerVos) {
// TicketTimesTicketCreatePartnerVo ticketTimesTicketCreatePartnerVo = new TicketTimesTicketCreatePartnerVo();
// BeanUtils.copyProperties(ticketTimes, ticketTimesTicketCreatePartnerVo);
// List<TicketPartnerVo> ticketPartnerVos = ticketsPartnerService.getTicketMongoList(ticketTimes.getTicketTimesId());
// ticketTimesTicketCreatePartnerVo.setTicket(ticketPartnerVos);
// ticketTimesTicketCreatePartnerVoList.add(ticketTimesTicketCreatePartnerVo);
// }
//
// PerformanceStep2Param performanceStep2Param = new PerformanceStep2Param();
// BeanUtils.copyProperties(data, performanceStep2Param);
// performanceStep2Param.setTicketTimes(ticketTimesTicketCreatePartnerVoList);
//
// return performanceStep2Param;
// }
@Override
public boolean onLinePerformance(String performancesId) {
try {
......@@ -528,14 +448,14 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
performanceVoData.setPerformanceRelations(performanceRelationsData);
performanceVoData.setPerformanceStatus(performanceStatusData);
String cityName=(String) redisUtil.hget(KylinRedisConst.FIELDS+":"+performanceVoData.getFieldId(),"city_name");
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);
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(
......@@ -651,14 +571,6 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
performanceVoData, PerformanceVo.class.getSimpleName()
);
}
// //修改 提审vo
// Map<String, Object> map = new HashMap<>();
// map.put("status", 3);
// BasicDBObject objectPerformance = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
// mongoTemplate.getCollection(PerformanceMisVo.class.getSimpleName()).updateOne(
// Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
// objectPerformance
// );
//判断状态
performanceVoTask.performanceVoStatus(performancesId);
return true;
......@@ -764,12 +676,12 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
}
Query query = Query.query(criteria);
// 查询总数
long count = mongoTemplate.count(query, PerformanceParam.class, PerformanceParam.class.getSimpleName());
List<PerformanceParam> performanceParam = mongoTemplate.find(query, PerformanceParam.class, PerformanceParam.class.getSimpleName());
long count = mongoTemplate.count(query, PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName());
List<PerformancePartnerVo> performancePartnerVo = mongoTemplate.find(query, PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName());
query.with(pageable);
//处理Vo
List<PerformancePartnerListVo> voList = new ArrayList<>();
for (PerformanceParam item : performanceParam) {
for (PerformancePartnerVo item : performancePartnerVo) {
PerformancePartnerListVo voData = new PerformancePartnerListVo();
voData.setStatus0Data(item);
voList.add(voData);
......@@ -788,4 +700,33 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
}
return pageInfoTmp;
}
@Override
public boolean withdraw(String performancesId) {
//mysql auditStatus
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
if (performanceStatus != null && performanceStatus.getAuditStatus() == 0) {
KylinPerformanceStatus data1 = new KylinPerformanceStatus();
HashMap<String, Object> map = new HashMap<>();
if (performanceStatus.getStatus() >= 3) {//通过审核
data1.setAuditStatus(1);
map.put("auditStatus", 1);
} else if (performanceStatus.getStatus() == 4) {//未通过审核
data1.setAuditStatus(-1);
map.put("auditStatus", -1);
} else {
data1.setAuditStatus(2);
map.put("auditStatus", 2);
}
performanceStatusMapper.update(data1, new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
mongoTemplate.getCollection(PerformancePartnerVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
object
);
return true;
} else {
return false;
}
}
}
......@@ -6,7 +6,7 @@ import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dto.param.PerformanceParam;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo;
import com.liquidnet.service.kylin.dto.vo.PerformanceVo;
import com.liquidnet.service.kylin.dto.vo.TicketTimesVo;
import com.liquidnet.service.kylin.dto.vo.TicketVo;
......@@ -224,7 +224,7 @@ public class PerformanceVoTask {
* @return
*/
public PerformanceMisVo getPerformanceMisVo(String performancesId) {
PerformanceParam performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName());
PerformancePartnerVo performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performancesId)), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName());
List<TicketTimesPartnerVo> ticketTimesPartnerVos = ticketTimesPartnerService.getTimesMongoList(performancesId);
List<TicketTimesTicketCreatePartnerVo> ticketTimesTicketCreatePartnerVoList = new ArrayList<TicketTimesTicketCreatePartnerVo>();
......@@ -273,67 +273,6 @@ public class PerformanceVoTask {
return performanceMisVo;
}
// /**
// * 生成 PerformanceUpdatePartnerVo(用于修改审核提交数据)
// *
// * @param performancesId
// * @return
// */
// public PerformanceMisVo setPerformanceUpdateParam(String performancesId) {
// PerformanceParam performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceParam.class, PerformanceParam.class.getSimpleName());
// List<TicketTimesPartnerVo> ticketTimesPartnerVos = ticketTimesPartnerService.getTimesMongoList(performancesId);
// List<TicketTimesTicketCreatePartnerVo> ticketTimesTicketCreatePartnerVoList = new ArrayList<TicketTimesTicketCreatePartnerVo>();
//
// ArrayList<BigDecimal> floatList = new ArrayList<>();
// ArrayList<String> StringList = new ArrayList<>();
//
// for (TicketTimesPartnerVo ticketTimes : ticketTimesPartnerVos) {
// TicketTimesTicketCreatePartnerVo ticketTimesTicketCreatePartnerVo = new TicketTimesTicketCreatePartnerVo();
// BeanUtils.copyProperties(ticketTimes, ticketTimesTicketCreatePartnerVo);
// List<TicketPartnerVo> ticketPartnerVos = ticketsPartnerService.getTicketMongoList(ticketTimes.getTicketTimesId());
// ticketTimesTicketCreatePartnerVo.setTicket(ticketPartnerVos);
// ticketTimesTicketCreatePartnerVoList.add(ticketTimesTicketCreatePartnerVo);
// for (TicketPartnerVo ticketPartnerVoItem : ticketPartnerVos) {
// floatList.add(ticketPartnerVoItem.getPrice());
// StringList.add(ticketPartnerVoItem.getTimeEnd());
// }
// }
// PerformanceMisVo performanceMisVo = new PerformanceMisVo();
// BeanUtils.copyProperties(performanceData, performanceMisVo);
//
// floatList.sort(Comparator.reverseOrder());
// StringList.sort(Comparator.naturalOrder());
//
// performanceMisVo.setPrice(floatList.get(0) + "起");
// performanceMisVo.setStopSellTime(StringList.get(0));
// performanceMisVo.setTicketTimes(ticketTimesTicketCreatePartnerVoList);
// performanceMisVo.setStatus(1);
// performanceMisVo.setRejectTxt("");
// performanceMisVo.setAuditStatus(0);
// KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
// performanceMisVo.setStatusSell(performanceStatus.getStatusSell());
// performanceMisVo.setIsShow(performanceStatus.getIsShow());
// performanceMisVo.setIsDistribution(performanceStatus.getIsDistribution());
// performanceMisVo.setSyncAgent(performanceStatus.getSyncAgent());
//
//
//// boolean exists = mongoTemplate.exists(Query.query(Criteria.where("performancesId").is(performancesId)), PerformanceMisVo.class, PerformanceMisVo.class.getSimpleName());
////
//// if (!exists) {
//// mongoTemplate.insert(
//// performanceMisVo, PerformanceMisVo.class.getSimpleName()
//// );
//// } else {
//// BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(performanceMisVo));
//// mongoTemplate.getCollection(PerformanceMisVo.class.getSimpleName()).updateOne(
//// Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
//// object
//// );
//// }
//
// return performanceMisVo;
// }
/**
* 插入数据库
*
......@@ -432,7 +371,7 @@ public class PerformanceVoTask {
ticketStatus.setTicketStatusId(IDGenerator.nextSnowId().toString());
ticketStatus.setTicketId(tickets.getTicketsId());
ticketStatus.setCounts(1);
// ticketStatus.setCounts(1);
ticketStatus.setIsMember(1);
ticketStatus.setIsExclusive(0);
ticketStatus.setIsTrueName(performanceStatus.getIsTrueName());
......@@ -468,7 +407,7 @@ public class PerformanceVoTask {
* @param performanceUpdateMisVo
* @param updatedAt
*/
public void updatePerformanceMySql(String performancesId, HashMap<String, Object> map, PerformanceMisVo performanceUpdateMisVo, LocalDateTime updatedAt) {
public void updatePerformanceMySql(String performancesId, HashMap<String, Object> map, PerformanceMisVo performanceUpdateMisVo, LocalDateTime updatedAt,Integer auditStatus) {
try {
//创建演出
KylinPerformances performances = new KylinPerformances();
......@@ -486,7 +425,7 @@ public class PerformanceVoTask {
performanceStatus.setPerformanceId(performances.getPerformancesId());
performanceStatus.setPerformanceStatusId(IDGenerator.nextSnowId().toString());
performanceStatus.setCreatedAt(null);
performanceStatus.setAuditStatus(0);
performanceStatus.setAuditStatus(auditStatus);
performanceStatus.setUpdatedAt(updatedAt);
performanceRelations.setPerformanceId(performances.getPerformancesId());
......@@ -563,7 +502,7 @@ public class PerformanceVoTask {
ticketStatus.setTicketStatusId(IDGenerator.nextSnowId().toString());
ticketStatus.setTicketId(tickets.getTicketsId());
ticketStatus.setCounts(1);
ticketStatus.setCounts(null);
ticketStatus.setIsMember(null);
ticketStatus.setStatusExchange(7);
ticketStatus.setQrCodeShowTime(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketItem.getQrCodeShowTime())));
......
......@@ -15,7 +15,7 @@ public class DataUtils {
@Autowired
private KylinBuyNoticeMapper buyNoticeMapper;
public String getBuyNoticeJsonString(List<Integer> buyNoticeIds){
public String getBuyNoticeJsonString(List<String> buyNoticeIds){
List<KylinBuyNotice> data = buyNoticeMapper.selectList(new UpdateWrapper<KylinBuyNotice>().in("buy_notice_id",buyNoticeIds));
return JsonUtils.toJson(data);
}
......
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