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

Commit 85798d57 authored by 胡佳晨's avatar 胡佳晨

修改撤回 和修改第一步

parent 0f5b1e3f
......@@ -11,13 +11,14 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@ApiModel
@Data
public class KylinPerformanceVo {
public class KylinPerformanceVo implements Serializable, Cloneable{
private Integer mid;
@ApiModelProperty(value = "主键")
......@@ -128,6 +129,16 @@ public class KylinPerformanceVo {
@ApiModelProperty(value = "场地审核状态 [0-审核完成|1-待审核|2-已拒绝]", hidden = true)
private Integer fieldAuditStatus;
private static final KylinPerformanceVo obj = new KylinPerformanceVo();
public static KylinPerformanceVo getNew() {
try {
return (KylinPerformanceVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinPerformanceVo();
}
}
public void setPerformance(KylinPerformances performance) {
this.mid = performance.getMid();
this.performancesId = performance.getPerformancesId();
......
......@@ -86,11 +86,6 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
result = createStep1(step1Param);
log.info(UserPathDto.setPartnerData(step1Param.getMerchantId(), "createStep1", step1Param, result));
} else {// 修改
if (!mongoMerchantUtils.judgeIsPermission(step1Param.getPerformancesId(), step1Param.getMerchantId(), new String[]{
MerchantAuthorizationConst.PerformancePermission.EDIT.getId(),
})) {
return "无权限";
}
result = updateStep1(step1Param);
log.info(UserPathDto.setPartnerData(step1Param.getMerchantId(), "updateStep1", step1Param, result));
}
......@@ -139,6 +134,14 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
if (data == null || data.getAuditStatus() == null || data.getAuditStatus() == 0) {
return "不可修改";
}
if (!mongoMerchantUtils.judgeIsPermission(step1Param.getPerformancesId(), step1Param.getMerchantId(), new String[]{
MerchantAuthorizationConst.PerformancePermission.EDIT.getId(),
})) {
if (!data.getMerchantId().equals(step1Param.getMerchantId())) {
return "无权限";
}
}
step1Param.setPerformancesId(performanceId);
PerformancePartnerVo performancePartnerVo = PerformancePartnerVo.getNew();
BeanUtils.copyProperties(step1Param, performancePartnerVo);
......@@ -249,7 +252,11 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
return ResponseDto.failure(ErrorMapping.get(20114));
} else {
if (fieldsVo.getClaimStatus() == 1) {
performancePartnerVo.setFieldAuditStatus(fieldsVo.getIsCheck());
if (fieldsVo.getUid().equals(step2Param.getMerchantId())) {
performancePartnerVo.setFieldAuditStatus(0);
} else {
performancePartnerVo.setFieldAuditStatus(fieldsVo.getIsCheck());
}
} else {
performancePartnerVo.setFieldAuditStatus(0);
}
......@@ -333,16 +340,16 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
performancePartnerVo.setUpdatedAt(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(step2Param.getIsSubmit());
KylinPerformanceMisVo kylinPerformanceMisVo = performanceUtils.getPerformanceMisVo(performanceId);
MerchantFieldsVo fieldsVo = redisMerchantUtils.getFieldVo(kylinPerformanceMisVo.getFieldId());
if (fieldsVo == null) {
return ResponseDto.failure(ErrorMapping.get(20114));
} else {
if (fieldsVo.getClaimStatus() == 1) {
performancePartnerVo.setFieldAuditStatus(fieldsVo.getIsCheck());
} else {
performancePartnerVo.setFieldAuditStatus(0);
}
}
// MerchantFieldsVo fieldsVo = redisMerchantUtils.getFieldVo(kylinPerformanceMisVo.getFieldId());
// if (fieldsVo == null) {
// return ResponseDto.failure(ErrorMapping.get(20114));
// } else {
// if (fieldsVo.getClaimStatus() == 1) {
// performancePartnerVo.setFieldAuditStatus(fieldsVo.getIsCheck());
// } else {
// performancePartnerVo.setFieldAuditStatus(0);
// }
// }
// 获取第一步数据
if (step2Param.getIsSubmit() == 1) { // 提交
......@@ -780,9 +787,12 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
}
if (vo != null && vo.getAuditStatus() == 0) {
PerformancePartnerVo performancePartnerVo = PerformancePartnerVo.getNew();
KylinPerformanceVo performanceVo = KylinPerformanceVo.getNew();
performancePartnerVo.setPerformancesId(performancesId);
performanceVo.setPerformancesId(performancePartnerVo.getPerformancesId());
if (vo.getAppStatus() >= 3) {//通过审核
performancePartnerVo.setAuditStatus(1);
performanceVo.setAuditStatus(performancePartnerVo.getAuditStatus());
queueUtil.sendMsgByRedis(MQConst.MerchantQueue.SQL_MERCHANT_PERFORMANCE_UPDATE.getKey(),
SqlMapping.get("kylin_performances_status.withdraw",
1, performancesId, now, now
......@@ -790,18 +800,22 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
} else if (vo.getAppStatus() == 4 || vo.getAppStatus() == 1) {//未通过审核
performancePartnerVo.setAuditStatus(-1);
performancePartnerVo.setStatus(0);
performanceVo.setAuditStatus(performancePartnerVo.getAuditStatus());
performanceVo.setAppStatus(performancePartnerVo.getAuditStatus());
queueUtil.sendMsgByRedis(MQConst.MerchantQueue.SQL_MERCHANT_PERFORMANCE_UPDATE.getKey(),
SqlMapping.get("kylin_performances_status.withdraw2",
-1, 0, performancesId, now, now
));
} else {
performancePartnerVo.setAuditStatus(2);
performanceVo.setAuditStatus(performancePartnerVo.getAuditStatus());
queueUtil.sendMsgByRedis(MQConst.MerchantQueue.SQL_MERCHANT_PERFORMANCE_UPDATE.getKey(),
SqlMapping.get("kylin_performances_status.withdraw",
2, performancesId, now, now
));
}
mongoMerchantUtils.updatePerformancePartnerVoById(performancePartnerVo);
mongoMerchantUtils.updateKylinPerformanceVoById(performanceVo);
log.info(UserPathDto.setPartnerData("0", "withdraw", "performancesId=" + performancesId, "撤回成功"));
return ResponseDto.success("撤回成功");
} else {
......
......@@ -145,6 +145,15 @@ public class MongoMerchantUtils {
);
}
public void updateKylinPerformanceVoById(KylinPerformanceVo data) {
Query query = Query.query(Criteria.where("performancesId").is(data.getPerformancesId()));
BasicDBObject objectTicketVo = ObjectUtil.cloneBasicDBObject().append("$set", mongoConverter.convertToMongoType(data));
mongoTemplate.getCollection(KylinPerformanceVo.class.getSimpleName()).updateOne(
query.getQueryObject(),
objectTicketVo
);
}
public void updateSubmitTicketVoById(KylinTicketPartnerVo data) {
Query query = Query.query(Criteria.where("ticketsId").is(data.getTicketsId()).and("status").in(3, 6, 8, 9, 10));
BasicDBObject objectTicketVo = ObjectUtil.cloneBasicDBObject().append("$set", mongoConverter.convertToMongoType(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