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

Commit 7f32cb4e authored by 胡佳晨's avatar 胡佳晨

修改 partner 的 new

parent 250c3adf
package com.liquidnet.service.kylin.dto.param;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinCheckUserPerformanceVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class CheckPerformanceRelationParam {
public class CheckPerformanceRelationParam implements Cloneable {
@ApiModelProperty(value = "演出id")
@NotNull(message = "演出ID不能为空")
private String performanceId;
@ApiModelProperty(value = "可下载时间")
@NotNull(message = "可下载时间不能为空")
private String canDownTime;
private static final CheckPerformanceRelationParam obj = new CheckPerformanceRelationParam();
public static CheckPerformanceRelationParam getNew() {
try {
return (CheckPerformanceRelationParam) obj.clone();
} catch (CloneNotSupportedException e) {
return new CheckPerformanceRelationParam();
}
}
}
package com.liquidnet.service.kylin.dto.param;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.liquidnet.service.kylin.dto.vo.middle.KylinBuyNoticeVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -8,7 +9,7 @@ import java.io.Serializable;
import java.util.List;
@Data
public class PerformancePartnerVo implements Serializable {
public class PerformancePartnerVo implements Serializable,Cloneable {
@ApiModelProperty(value = "演出id", example = "")
@JsonIgnore
......@@ -112,4 +113,13 @@ public class PerformancePartnerVo implements Serializable {
@ApiModelProperty(value = "是否保存", example = "")
private Integer isCreateSave;
private static final PerformancePartnerVo obj = new PerformancePartnerVo();
public static PerformancePartnerVo getNew() {
try {
return (PerformancePartnerVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new PerformancePartnerVo();
}
}
}
......@@ -9,7 +9,7 @@ import java.io.Serializable;
import java.util.List;
@Data
public class PerformanceStep2Param implements Serializable {
public class PerformanceStep2Param implements Serializable,Cloneable {
@ApiModelProperty(value = "演出id", example = "")
@NotNull(message = "不能为空")
......@@ -35,4 +35,13 @@ public class PerformanceStep2Param implements Serializable {
@ApiModelProperty(value = "场次数据",hidden = true)
private List<TicketTimesTicketCreatePartnerVo> ticketTimes;
private static final PerformanceStep2Param obj = new PerformanceStep2Param();
public static PerformanceStep2Param getNew() {
try {
return (PerformanceStep2Param) obj.clone();
} catch (CloneNotSupportedException e) {
return new PerformanceStep2Param();
}
}
}
package com.liquidnet.service.kylin.dto.vo;
import com.liquidnet.service.kylin.dao.PerformanceOrderStatisticalDao;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -15,7 +16,7 @@ import java.math.BigDecimal;
* @date 2021/6/19 16:44
*/
@Data
public class PerformanceOrderStatisticalVo {
public class PerformanceOrderStatisticalVo implements Cloneable {
private String performancesId;
private String ticketsId;
@ApiModelProperty(value = "票种名称")
......@@ -48,4 +49,13 @@ public class PerformanceOrderStatisticalVo {
private BigDecimal totalPayingNumber = BigDecimal.ZERO;
@ApiModelProperty(value = "购买人数")
private BigDecimal totalBuyUsers = BigDecimal.ZERO;
private static final PerformanceOrderStatisticalVo obj = new PerformanceOrderStatisticalVo();
public static PerformanceOrderStatisticalVo getNew() {
try {
return (PerformanceOrderStatisticalVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new PerformanceOrderStatisticalVo();
}
}
}
package com.liquidnet.service.kylin.dto.vo.middle;
import com.liquidnet.service.kylin.dto.vo.returns.KylinOrderListVo;
import lombok.Data;
@Data
public class KylinBuyNoticeVo {
public class KylinBuyNoticeVo implements Cloneable {
private String buyNoticeId;
......@@ -14,4 +15,13 @@ public class KylinBuyNoticeVo {
private String message;
private Integer sort;
private static final KylinBuyNoticeVo obj = new KylinBuyNoticeVo();
public static KylinBuyNoticeVo getNew() {
try {
return (KylinBuyNoticeVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinBuyNoticeVo();
}
}
}
......@@ -10,10 +10,19 @@ import java.util.List;
@Data
@ApiModel
public class KylinCheckUserPerformanceVo implements Serializable {
public class KylinCheckUserPerformanceVo implements Serializable,Cloneable {
@ApiModelProperty(value = "id")
private String checkUserId;
@ApiModelProperty(value = "演出id数组")
private List<CheckPerformanceRelationParam> relationParams;
private static final KylinCheckUserPerformanceVo obj = new KylinCheckUserPerformanceVo();
public static KylinCheckUserPerformanceVo getNew() {
try {
return (KylinCheckUserPerformanceVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinCheckUserPerformanceVo();
}
}
}
package com.liquidnet.service.kylin.dto.vo.mongo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinBuyNoticeVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -8,7 +9,7 @@ import java.io.Serializable;
@Data
@ApiModel
public class KylinCheckUserVo implements Serializable {
public class KylinCheckUserVo implements Serializable ,Cloneable{
@ApiModelProperty(value = "id")
private String checkUserId;
......@@ -28,4 +29,12 @@ public class KylinCheckUserVo implements Serializable {
@ApiModelProperty(value = "状态")
private String status;
private static final KylinCheckUserVo obj = new KylinCheckUserVo();
public static KylinCheckUserVo getNew() {
try {
return (KylinCheckUserVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinCheckUserVo();
}
}
}
package com.liquidnet.service.kylin.dto.vo.partner;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo;
import com.liquidnet.service.kylin.dto.param.PerformanceStep2Param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class KylinPerformancePartnerListVo {
public class KylinPerformancePartnerListVo implements Cloneable{
//演出数据
@ApiModelProperty(value = "主键id")
......@@ -47,4 +48,13 @@ public class KylinPerformancePartnerListVo {
this.rejectTxt="";
this.createdAt=item.getCreatedAt();
}
private static final KylinPerformancePartnerListVo obj = new KylinPerformancePartnerListVo();
public static KylinPerformancePartnerListVo getNew() {
try {
return (KylinPerformancePartnerListVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinPerformancePartnerListVo();
}
}
}
......@@ -11,7 +11,7 @@ import java.math.BigDecimal;
* 修改场地全部显示数据参数
*/
@Data
public class KylinTicketPartnerVo implements Serializable {
public class KylinTicketPartnerVo implements Serializable,Cloneable {
@ApiModelProperty(value = "主键")
private String ticketsId;
......@@ -116,4 +116,13 @@ public class KylinTicketPartnerVo implements Serializable {
this.setSurplusExchange(this.getTotalExchange());
this.setSurplusGeneral(this.getTotalGeneral());
}
private static final KylinTicketPartnerVo obj = new KylinTicketPartnerVo();
public static KylinTicketPartnerVo getNew() {
try {
return (KylinTicketPartnerVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinTicketPartnerVo();
}
}
}
package com.liquidnet.service.kylin.dto.vo.partner;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinCheckUserVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -8,7 +9,7 @@ import java.io.Serializable;
//返回
@Data
public class KylinTicketTimesPartnerVo implements Serializable {
public class KylinTicketTimesPartnerVo implements Serializable ,Cloneable{
@ApiModelProperty(value = "主键id")
private String ticketTimesId;
......@@ -39,4 +40,13 @@ public class KylinTicketTimesPartnerVo implements Serializable {
@ApiModelProperty(value = "修改时间")
private String updatedAt;
private static final KylinTicketTimesPartnerVo obj = new KylinTicketTimesPartnerVo();
public static KylinTicketTimesPartnerVo getNew() {
try {
return (KylinTicketTimesPartnerVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinTicketTimesPartnerVo();
}
}
}
......@@ -9,7 +9,7 @@ import java.util.List;
//包含 票
@Data
public class TicketTimesTicketCreatePartnerVo implements Serializable {
public class TicketTimesTicketCreatePartnerVo implements Serializable ,Cloneable{
@ApiModelProperty(value = "主键id")
private String ticketTimesId;
......@@ -40,4 +40,13 @@ public class TicketTimesTicketCreatePartnerVo implements Serializable {
//票
@ApiModelProperty(value = "票数据")
private List<KylinTicketPartnerVo> ticket;
private static final TicketTimesTicketCreatePartnerVo obj = new TicketTimesTicketCreatePartnerVo();
public static TicketTimesTicketCreatePartnerVo getNew() {
try {
return (TicketTimesTicketCreatePartnerVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new TicketTimesTicketCreatePartnerVo();
}
}
}
......@@ -15,7 +15,7 @@ import java.time.LocalDateTime;
* @date 2021/6/3 16:39
*/
@Data
public class PerformanceOrderStatisticalDao {
public class PerformanceOrderStatisticalDao implements Cloneable{
private String performancesId;
private String ticketsId;
private String title;
......@@ -33,4 +33,13 @@ public class PerformanceOrderStatisticalDao {
private BigDecimal totalMemberNumber = BigDecimal.ZERO;
private BigDecimal totalPayingNumber = BigDecimal.ZERO;
private BigDecimal totalBuyUsers = BigDecimal.ZERO;
private static final PerformanceOrderStatisticalDao obj = new PerformanceOrderStatisticalDao();
public static PerformanceOrderStatisticalDao getNew() {
try {
return (PerformanceOrderStatisticalDao) obj.clone();
} catch (CloneNotSupportedException e) {
return new PerformanceOrderStatisticalDao();
}
}
}
package com.liquidnet.service.platform.service.impl.partner;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
......@@ -34,11 +35,11 @@ public class KylinBuyNoticePartnerServiceImpl extends ServiceImpl<KylinBuyNotice
PageInfo<KylinBuyNoticeVo> pageInfoTmp = null;
PageHelper.startPage(1, 20);
List<KylinBuyNotice> buyNoticeList = kylinBuyNoticeMapper.selectList(new UpdateWrapper<KylinBuyNotice>().eq("status", 1).orderByDesc("sort").orderByDesc("mid"));
List<KylinBuyNotice> buyNoticeList = kylinBuyNoticeMapper.selectList(Wrappers.lambdaQuery(KylinBuyNotice.class).eq(KylinBuyNotice::getStatus, 1).orderByDesc(KylinBuyNotice::getSort).orderByDesc(KylinBuyNotice::getMid));
List<KylinBuyNoticeVo> kylinBuyNoticeVoList = new ArrayList<>();
for (KylinBuyNotice item : buyNoticeList) {
KylinBuyNoticeVo kylinBuyNoticeVo = new KylinBuyNoticeVo();
KylinBuyNoticeVo kylinBuyNoticeVo = KylinBuyNoticeVo.getNew();
BeanUtils.copyProperties(item, kylinBuyNoticeVo);
kylinBuyNoticeVoList.add(kylinBuyNoticeVo);
}
......
package com.liquidnet.service.platform.service.impl.partner;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
......@@ -14,6 +16,7 @@ import com.liquidnet.service.kylin.entity.KylinCheckUser;
import com.liquidnet.service.kylin.mapper.KylinCheckUserMapper;
import com.liquidnet.service.kylin.service.partner.IKylinCheckUserPartnerService;
import com.liquidnet.service.platform.utils.DataUtils;
import com.liquidnet.service.platform.utils.ObjectUtil;
import com.mongodb.BasicDBObject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -64,18 +67,14 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
@Override
public ResponseDto<String> del(String merchantId, String checkUserId) {
try {
KylinCheckUser checkUser = new KylinCheckUser();
KylinCheckUser checkUser = KylinCheckUser.getNew();
checkUser.setUpdatedAt(LocalDateTime.now());
checkUser.setStatus(0);
checkUserMapper.update(checkUser, new UpdateWrapper<KylinCheckUser>().eq("check_user_id", checkUserId));
checkUserMapper.update(checkUser, Wrappers.lambdaUpdate(KylinCheckUser.class).eq(KylinCheckUser::getCheckUserId, checkUserId));
dataUtils.delCheckUserRedis(checkUserId);
HashMap<String, Object> map = new HashMap<>();
HashMap<String, Object> map = ObjectUtil.cloneHashMapStringAndObject();
map.put("status", 0);
// BasicDBObject obj = new BasicDBObject("$set", mongoConverter.convertToMongoType(map));
// mongoTemplate.getCollection(CheckUserVo.class.getSimpleName()).updateOne(
// Query.query(Criteria.where("checkUserId").is(checkUserId)).getQueryObject(),
// obj
mongoTemplate.remove(Query.query(Criteria.where("checkUserId").is(checkUserId)), KylinCheckUserVo.class, KylinCheckUserVo.class.getSimpleName());
return ResponseDto.success("删除成功");
} catch (Exception e) {
......@@ -86,7 +85,7 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
@Override
public ResponseDto<String> create(String merchantId, String name, String pwd, String mobile) {
try {
KylinCheckUser checkUser = new KylinCheckUser();
KylinCheckUser checkUser = KylinCheckUser.getNew();
checkUser.setName(name);
checkUser.setPwd(DigestUtils.md5DigestAsHex(pwd.getBytes()));
checkUser.setMobile(mobile);
......@@ -96,7 +95,7 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
checkUser.setStatus(1);
checkUserMapper.insert(checkUser);
KylinCheckUserVo kylinCheckUserVo = new KylinCheckUserVo();
KylinCheckUserVo kylinCheckUserVo = KylinCheckUserVo.getNew();
BeanUtils.copyProperties(checkUser, kylinCheckUserVo);
mongoTemplate.insert(kylinCheckUserVo, KylinCheckUserVo.class.getSimpleName());
......@@ -109,15 +108,15 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
@Override
public ResponseDto<String> change(String merchantId, String checkUserId, String name, String pwd, String mobile) {
try {
KylinCheckUser checkUser = new KylinCheckUser();
KylinCheckUser checkUser = KylinCheckUser.getNew();
checkUser.setName(name);
if(null!=pwd) {
if (null != pwd) {
checkUser.setPwd(DigestUtils.md5DigestAsHex(pwd.getBytes()));
}
checkUser.setMobile(mobile);
checkUser.setUpdatedAt(LocalDateTime.now());
checkUserMapper.update(checkUser, new UpdateWrapper<KylinCheckUser>().eq("check_user_id", checkUserId).eq("merchant_id", merchantId));
BasicDBObject obj = new BasicDBObject("$set", mongoConverter.convertToMongoType(checkUser));
checkUserMapper.update(checkUser, Wrappers.lambdaUpdate(KylinCheckUser.class).eq(KylinCheckUser::getCheckUserId, checkUserId).eq(KylinCheckUser::getMerchantId, merchantId));
BasicDBObject obj = ObjectUtil.cloneBasicDBObject().append("$set", mongoConverter.convertToMongoType(checkUser));
mongoTemplate.getCollection(KylinCheckUserVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("checkUserId").is(checkUserId)).getQueryObject(),
obj
......
package com.liquidnet.service.platform.service.impl.partner;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
......@@ -79,7 +80,7 @@ public class KylinCheckUserPerformancesPartnerServiceImpl extends ServiceImpl<Ky
if (null == item.getCanDownTime()) {
return ResponseDto.failure(ErrorMapping.get(20101));
}
KylinCheckUserPerformances checkUserPerformances = new KylinCheckUserPerformances();
KylinCheckUserPerformances checkUserPerformances = KylinCheckUserPerformances.getNew();
checkUserPerformances.setCheckUserId(param.getCheckUserId());
checkUserPerformances.setCanDownTime(DateUtil.Formatter.yyyyMMddHHmmss.parse(item.getCanDownTime()));
checkUserPerformances.setPerformanceId(item.getPerformanceId());
......@@ -90,11 +91,11 @@ public class KylinCheckUserPerformancesPartnerServiceImpl extends ServiceImpl<Ky
}
mongoTemplate.remove(Query.query(Criteria.where("checkUserId").is(param.getCheckUserId())), KylinCheckUserPerformanceVo.class, KylinCheckUserPerformanceVo.class.getSimpleName());
KylinCheckUserPerformanceVo userPerformanceVo = new KylinCheckUserPerformanceVo();
KylinCheckUserPerformanceVo userPerformanceVo = KylinCheckUserPerformanceVo.getNew();
List<CheckPerformanceRelationParam> performanceRelationParamsList = new ArrayList<>();
List<KylinCheckUserPerformances> data = checkUserPerformancesMapper.selectList(new UpdateWrapper<KylinCheckUserPerformances>().eq("check_user_id", param.getCheckUserId()));
List<KylinCheckUserPerformances> data = checkUserPerformancesMapper.selectList(Wrappers.lambdaQuery(KylinCheckUserPerformances.class).eq(KylinCheckUserPerformances::getCheckUserId, param.getCheckUserId()));
for (KylinCheckUserPerformances item : data) {
CheckPerformanceRelationParam performanceRelationParam = new CheckPerformanceRelationParam();
CheckPerformanceRelationParam performanceRelationParam = CheckPerformanceRelationParam.getNew();
performanceRelationParam.setCanDownTime(item.getCanDownTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performanceRelationParam.setPerformanceId(item.getPerformanceId());
performanceRelationParamsList.add(performanceRelationParam);
......@@ -115,15 +116,15 @@ public class KylinCheckUserPerformancesPartnerServiceImpl extends ServiceImpl<Ky
public ResponseDto<String> delPerformance(List<String> performanceIds, String checkUserId) {
try {
for (String performanceId : performanceIds) {
checkUserPerformancesMapper.delete(new UpdateWrapper<KylinCheckUserPerformances>().eq("check_user_id", checkUserId).eq("performance_id", performanceId));
checkUserPerformancesMapper.delete(Wrappers.lambdaUpdate(KylinCheckUserPerformances.class).eq(KylinCheckUserPerformances::getCheckUserId, checkUserId).eq(KylinCheckUserPerformances::getPerformanceId, performanceId));
}
mongoTemplate.remove(Query.query(Criteria.where("checkUserId").is(checkUserId)), KylinCheckUserPerformanceVo.class, KylinCheckUserPerformanceVo.class.getSimpleName());
KylinCheckUserPerformanceVo userPerformanceVo = new KylinCheckUserPerformanceVo();
KylinCheckUserPerformanceVo userPerformanceVo = KylinCheckUserPerformanceVo.getNew();
List<CheckPerformanceRelationParam> performanceRelationParamsList = new ArrayList<>();
List<KylinCheckUserPerformances> data = checkUserPerformancesMapper.selectList(new UpdateWrapper<KylinCheckUserPerformances>().eq("check_user_id", checkUserId));
List<KylinCheckUserPerformances> data = checkUserPerformancesMapper.selectList(Wrappers.lambdaUpdate(KylinCheckUserPerformances.class).eq(KylinCheckUserPerformances::getCheckUserId, checkUserId));
for (KylinCheckUserPerformances item : data) {
CheckPerformanceRelationParam performanceRelationParam = new CheckPerformanceRelationParam();
CheckPerformanceRelationParam performanceRelationParam = CheckPerformanceRelationParam.getNew();
performanceRelationParam.setCanDownTime(item.getCanDownTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performanceRelationParam.setPerformanceId(item.getPerformanceId());
performanceRelationParamsList.add(performanceRelationParam);
......
......@@ -2,6 +2,7 @@ package com.liquidnet.service.platform.service.impl.partner;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils;
......@@ -16,6 +17,7 @@ import com.liquidnet.service.kylin.mapper.KylinPerformanceStatusMapper;
import com.liquidnet.service.kylin.mapper.KylinTicketTimeRelationMapper;
import com.liquidnet.service.kylin.mapper.KylinTicketTimesMapper;
import com.liquidnet.service.kylin.service.partner.IKylinTicketTimesPartnerService;
import com.liquidnet.service.platform.utils.ObjectUtil;
import com.mongodb.BasicDBObject;
import com.mongodb.client.model.FindOneAndUpdateOptions;
import com.mongodb.client.model.ReturnDocument;
......@@ -63,7 +65,7 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
ResponseDto<KylinTicketTimesPartnerVo> ticketTimesPartnerVo = null;
//获取演出状态
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(
new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", createTicketTimesParam.getPerformancesId()));
Wrappers.lambdaQuery(KylinPerformanceStatus.class).eq(KylinPerformanceStatus::getPerformanceId, createTicketTimesParam.getPerformancesId()));
if (null == performanceStatus) {
ticketTimesPartnerVo = createTimes(createTicketTimesParam);
} else if(performanceStatus.getAuditStatus()==0){
......@@ -80,7 +82,7 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
public ResponseDto<KylinTicketTimesPartnerVo> createTimes(CreateTicketTimesParam createTicketTimesParam) {
try {
// 获取 主键id
String ticketTimesId = IDGenerator.nextSnowId().toString();
String ticketTimesId = IDGenerator.nextSnowId();
// 获取 当前时间 -> 创建时间
LocalDateTime createdAt = LocalDateTime.now();
// 标题
......@@ -97,7 +99,7 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
title = useStart + "-" + useEnd;
}
// mongo 操作
KylinTicketTimesPartnerVo kylinTicketTimesPartnerVo = new KylinTicketTimesPartnerVo();
KylinTicketTimesPartnerVo kylinTicketTimesPartnerVo = KylinTicketTimesPartnerVo.getNew();
kylinTicketTimesPartnerVo.setTicketTimesId(ticketTimesId);
kylinTicketTimesPartnerVo.setUseStart(createTicketTimesParam.getUseStart().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
if(createTicketTimesParam.getType() == 2) {
......@@ -141,7 +143,7 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
}
// mongo 操作
KylinTicketTimesPartnerVo kylinTicketTimesPartnerVo = new KylinTicketTimesPartnerVo();
KylinTicketTimesPartnerVo kylinTicketTimesPartnerVo = KylinTicketTimesPartnerVo.getNew();
kylinTicketTimesPartnerVo.setTicketTimesId(ticketTimesId);
kylinTicketTimesPartnerVo.setUseStart(createTicketTimesParam.getUseStart().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
kylinTicketTimesPartnerVo.setUseEnd(createTicketTimesParam.getUseEnd().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
......@@ -169,24 +171,23 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
return ResponseDto.failure(ErrorMapping.get(20106));
}
KylinTicketTimeRelation ticketTimeRelation = ticketTimeRelationMapper.selectOne(
new UpdateWrapper<KylinTicketTimeRelation>().eq("times_id", ticketTimesId));
Wrappers.lambdaQuery(KylinTicketTimeRelation.class).eq(KylinTicketTimeRelation::getTimesId, ticketTimesId));
if (ticketTimeRelation != null) {
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(
new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", ticketTimeRelation.getPerformanceId()));
Wrappers.lambdaQuery(KylinPerformanceStatus.class).eq(KylinPerformanceStatus::getPerformanceId, 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<>();
HashMap<String, Object> map = ObjectUtil.cloneHashMapStringAndObject();
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(KylinTicketTimesPartnerVo.class.getSimpleName()).findOneAndUpdate(
BasicDBObject object = ObjectUtil.cloneBasicDBObject().append("$set", mongoConverter.convertToMongoType(map));
mongoTemplate.getCollection(KylinTicketTimesPartnerVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("ticketTimesId").is(ticketTimesId)).getQueryObject(),
object,
new FindOneAndUpdateOptions().returnDocument(ReturnDocument.AFTER)
object
);
return ResponseDto.success("删除成功");
} else {
......@@ -214,7 +215,7 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
createTicketTimesParam.setTitle(title);
// mongo 操作
KylinTicketTimesPartnerVo kylinTicketTimesPartnerVo = new KylinTicketTimesPartnerVo();
KylinTicketTimesPartnerVo kylinTicketTimesPartnerVo = KylinTicketTimesPartnerVo.getNew();
BeanUtils.copyProperties(createTicketTimesParam, kylinTicketTimesPartnerVo);
kylinTicketTimesPartnerVo.setTicketTimesId(createTicketTimesParam.getTicketTimesId());
kylinTicketTimesPartnerVo.setUpdatedAt(updatedAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
......@@ -222,7 +223,7 @@ public class KylinTicketTimesPartnerServiceImpl extends ServiceImpl<KylinTicketT
kylinTicketTimesPartnerVo.setUseEnd(createTicketTimesParam.getUseEnd().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
kylinTicketTimesPartnerVo.setStatus(null);
BasicDBObject object = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(kylinTicketTimesPartnerVo)));
BasicDBObject object = ObjectUtil.cloneBasicDBObject().append("$set", JSON.parse(JsonUtils.toJson(kylinTicketTimesPartnerVo)));
Document doc = mongoTemplate.getCollection(KylinTicketTimesPartnerVo.class.getSimpleName()).findOneAndUpdate(
Query.query(Criteria.where("ticketTimesId").is(createTicketTimesParam.getTicketTimesId())).getQueryObject(),
object,
......
package com.liquidnet.service.platform.utils;
import com.liquidnet.service.adam.dto.vo.AdamEntersVo;
import com.liquidnet.service.kylin.dto.vo.returns.KylinOrderListVo;
import com.mongodb.BasicDBObject;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: ObjectUtil
* @Package com.liquidnet.service.dragon.utils
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/21 16:00
*/
@Component
public class ObjectUtil {
private static final LinkedList<Object[]> linkedListObj = new LinkedList<Object[]>();
private static final LinkedList<String> linkedListStr = new LinkedList<String>();
private static final HashMap<String, String> hashMapStringAndString = new HashMap<String, String>();
private static final HashMap<String, Object> hashMapStringAndObject = new HashMap<String, Object>();
private static final HashMap<String, Integer> hashMapStringAndInteger = new HashMap();
private static final ArrayList<String> arrayListString = new ArrayList<>();
private static final LinkedMultiValueMap<String, String> linkedMultiValueMapStringAndString = new LinkedMultiValueMap<String, String>();
private static final BasicDBObject basicDBObject = new BasicDBObject();
public static final Object[] objectsArray = new Object[100];
public static final Integer[] integerArray2 = new Integer[2];
public static LinkedList<Object[]> cloneLinkedListObj() {
return (LinkedList<Object[]>) linkedListObj.clone();
}
public static LinkedList<String> cloneLinkedListStr() {
return (LinkedList<String>) linkedListStr.clone();
}
public static HashMap<String, String> cloneHashMapStringAndString() {
return (HashMap<String, String>) hashMapStringAndString.clone();
}
public static HashMap<String, Object> cloneHashMapStringAndObject() {
return (HashMap<String, Object>) hashMapStringAndObject.clone();
}
public static HashMap<String, Integer> cloneHashMapStringAndInteger() {
return (HashMap<String, Integer>) hashMapStringAndInteger.clone();
}
public static ArrayList<String> cloneArrayListString() {
return (ArrayList<String>) arrayListString.clone();
}
public static LinkedMultiValueMap<String, String> cloneLinkedMultiValueMapStringAndString() {
return linkedMultiValueMapStringAndString.clone();
}
public static Object[] cloneObjectsArray() {
return objectsArray.clone();
}
public static Integer[] cloneInteger2Array() {
return integerArray2.clone();
}
public static BasicDBObject cloneBasicDBObject() {
return (BasicDBObject) basicDBObject.clone();
}
}
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