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

Commit c345b011 authored by Tice's avatar Tice

Merge branch 'dev_merchant_tice' into dev_merchant

parents 66ef617c f6c682c0
...@@ -26,58 +26,60 @@ public class MerchantFieldAppliesVo implements java.io.Serializable, Cloneable { ...@@ -26,58 +26,60 @@ public class MerchantFieldAppliesVo implements java.io.Serializable, Cloneable {
@ApiModelProperty(position = 14, value = "用户ID") @ApiModelProperty(position = 14, value = "用户ID")
private String uid; private String uid;
@ApiModelProperty(position = 15, value = "场地ID") @ApiModelProperty(position = 15, value = "场地ID,认领时或通过后存在")
private String fieldId; private String fieldId;
@ApiModelProperty(position = 16, value = "场地,认领时或通过后存在")
private MerchantFieldsVo fieldVo;
@ApiModelProperty(position = 16, value = "场地名称[30]") @ApiModelProperty(position = 17, value = "场地名称[30]")
private String name; private String name;
@ApiModelProperty(position = 17, value = "logo图") @ApiModelProperty(position = 18, value = "logo图")
private String logo; private String logo;
@ApiModelProperty(position = 18, value = "背景图") @ApiModelProperty(position = 19, value = "背景图")
private String background; private String background;
@ApiModelProperty(position = 19, value = "介绍[1000]") @ApiModelProperty(position = 20, value = "介绍[1000]")
private String description; private String description;
@ApiModelProperty(position = 20, value = "建立日期[YYYY-MM-DD]") @ApiModelProperty(position = 21, value = "建立日期[YYYY-MM-DD]")
private String builtDate; private String builtDate;
@ApiModelProperty(position = 21, value = "省id") @ApiModelProperty(position = 22, value = "省id")
private String provinceId; private String provinceId;
@ApiModelProperty(position = 22, value = "省名称") @ApiModelProperty(position = 23, value = "省名称")
private String provinceName; private String provinceName;
@ApiModelProperty(position = 23, value = "城市id") @ApiModelProperty(position = 24, value = "城市id")
private String cityId; private String cityId;
@ApiModelProperty(position = 24, value = "城市名称") @ApiModelProperty(position = 25, value = "城市名称")
private String cityName; private String cityName;
@ApiModelProperty(position = 25, value = "县id") @ApiModelProperty(position = 26, value = "县id")
private String districtId; private String districtId;
@ApiModelProperty(position = 26, value = "县名称") @ApiModelProperty(position = 27, value = "县名称")
private String districtName; private String districtName;
@ApiModelProperty(position = 27, value = "详细地址[100]") @ApiModelProperty(position = 28, value = "详细地址[100]")
private String address; private String address;
@ApiModelProperty(position = 28, value = "经度") @ApiModelProperty(position = 29, value = "经度")
private String longitude; private String longitude;
@ApiModelProperty(position = 29, value = "纬度") @ApiModelProperty(position = 30, value = "纬度")
private String latitude; private String latitude;
@ApiModelProperty(position = 30, value = "联系人姓名") @ApiModelProperty(position = 31, value = "联系人姓名")
private String contactName; private String contactName;
@ApiModelProperty(position = 31, value = "联系人邮箱") @ApiModelProperty(position = 32, value = "联系人邮箱")
private String contactEmail; private String contactEmail;
@ApiModelProperty(position = 32, value = "企业名称") @ApiModelProperty(position = 33, value = "企业名称")
private String companyName; private String companyName;
@ApiModelProperty(position = 33, value = "营业执照编号") @ApiModelProperty(position = 34, value = "营业执照编号")
private String licenseCode; private String licenseCode;
@ApiModelProperty(position = 34, value = "营业执照图片") @ApiModelProperty(position = 35, value = "营业执照图片")
private String licenseImg; private String licenseImg;
@ApiModelProperty(position = 35, value = "法人姓名") @ApiModelProperty(position = 36, value = "法人姓名")
private String legalName; private String legalName;
@ApiModelProperty(position = 36, value = "法人身份证号码") @ApiModelProperty(position = 37, value = "法人身份证号码")
private String legalIdentity; private String legalIdentity;
@ApiModelProperty(position = 37, value = "法人身份证正面照") @ApiModelProperty(position = 38, value = "法人身份证正面照")
private String legalIdentityObverse; private String legalIdentityObverse;
@ApiModelProperty(position = 38, value = "法人身份证反面照") @ApiModelProperty(position = 39, value = "法人身份证反面照")
private String legalIdentityReverse; private String legalIdentityReverse;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
......
...@@ -25,40 +25,45 @@ public class MerchantSponsorAppliesVo implements java.io.Serializable, Cloneable ...@@ -25,40 +25,45 @@ public class MerchantSponsorAppliesVo implements java.io.Serializable, Cloneable
@ApiModelProperty(position = 14, value = "用户ID") @ApiModelProperty(position = 14, value = "用户ID")
private String uid; private String uid;
@ApiModelProperty(position = 15, value = "主办ID") @ApiModelProperty(position = 15, value = "主办ID,通过后存在")
private String sponsorId;
@ApiModelProperty(position = 16, value = "主办,通过后存在")
private MerchantSponsorsVo sponsorVo;
@ApiModelProperty(position = 17, value = "主办ID")
private String name; private String name;
@ApiModelProperty(position = 16, value = "logo图片地址") @ApiModelProperty(position = 18, value = "logo图片地址")
private String logo; private String logo;
@ApiModelProperty(position = 17, value = "背景图片地址") @ApiModelProperty(position = 19, value = "背景图片地址")
private String background; private String background;
@ApiModelProperty(position = 18, value = "介绍") @ApiModelProperty(position = 20, value = "介绍")
private String description; private String description;
@ApiModelProperty(position = 19, value = "联系人姓名") @ApiModelProperty(position = 21, value = "联系人姓名")
private String contactName; private String contactName;
@ApiModelProperty(position = 20, value = "联系人身份证号码") @ApiModelProperty(position = 22, value = "联系人身份证号码")
private String contactIdentity; private String contactIdentity;
@ApiModelProperty(position = 21, value = "联系人身份证正面照") @ApiModelProperty(position = 23, value = "联系人身份证正面照")
private String contactIdentityObverse; private String contactIdentityObverse;
@ApiModelProperty(position = 22, value = "联系人身份证反面照") @ApiModelProperty(position = 24, value = "联系人身份证反面照")
private String contactIdentityReverse; private String contactIdentityReverse;
@ApiModelProperty(position = 23, value = "联系人邮箱") @ApiModelProperty(position = 25, value = "联系人邮箱")
private String contactEmail; private String contactEmail;
@ApiModelProperty(position = 24, value = "企业名称") @ApiModelProperty(position = 26, value = "企业名称")
private String companyName; private String companyName;
@ApiModelProperty(position = 25, value = "营业执照编号") @ApiModelProperty(position = 27, value = "营业执照编号")
private String licenseCode; private String licenseCode;
@ApiModelProperty(position = 26, value = "营业执照图片地址") @ApiModelProperty(position = 28, value = "营业执照图片地址")
private String licenseImg; private String licenseImg;
@ApiModelProperty(position = 27, value = "法人姓名") @ApiModelProperty(position = 29, value = "法人姓名")
private String legalName; private String legalName;
@ApiModelProperty(position = 28, value = "法人身份证号码") @ApiModelProperty(position = 30, value = "法人身份证号码")
private String legalIdentity; private String legalIdentity;
@ApiModelProperty(position = 29, value = "法人身份证正面照") @ApiModelProperty(position = 31, value = "法人身份证正面照")
private String legalIdentityObverse; private String legalIdentityObverse;
@ApiModelProperty(position = 30, value = "法人身份证反面照") @ApiModelProperty(position = 32, value = "法人身份证反面照")
private String legalIdentityReverse; private String legalIdentityReverse;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
......
...@@ -2,7 +2,6 @@ package com.liquidnet.service.merchant.dto.vo; ...@@ -2,7 +2,6 @@ package com.liquidnet.service.merchant.dto.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.merchant.entity.MerchantSponsorApplies;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
......
...@@ -2,6 +2,7 @@ package com.liquidnet.service.merchant.service; ...@@ -2,6 +2,7 @@ package com.liquidnet.service.merchant.service;
import com.liquidnet.service.base.PagedResult; import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.merchant.dto.param.MerchantFieldApplyParam; import com.liquidnet.service.merchant.dto.param.MerchantFieldApplyParam;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldAppliesVo;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldCheckersVo; import com.liquidnet.service.merchant.dto.vo.MerchantFieldCheckersVo;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsVo; import com.liquidnet.service.merchant.dto.vo.MerchantFieldsVo;
...@@ -15,6 +16,8 @@ public interface IMerchantFieldsService { ...@@ -15,6 +16,8 @@ public interface IMerchantFieldsService {
void applyDel(String uid, String fieldApplyId); void applyDel(String uid, String fieldApplyId);
MerchantFieldAppliesVo applyInfo(String uid, String fieldApplyId);
void editIsCheck(String uid, String fieldId, int isCheck); void editIsCheck(String uid, String fieldId, int isCheck);
......
package com.liquidnet.service.merchant.service; package com.liquidnet.service.merchant.service;
import com.liquidnet.service.merchant.dto.param.MerchantSponsorApplyParam; import com.liquidnet.service.merchant.dto.param.MerchantSponsorApplyParam;
import com.liquidnet.service.merchant.dto.vo.MerchantSponsorAppliesVo;
public interface IMerchantSponsorsService { public interface IMerchantSponsorsService {
String apply(String uid, MerchantSponsorApplyParam parameter); String apply(String uid, MerchantSponsorApplyParam parameter);
void applyDel(String uid, String sponsorApplyId); void applyDel(String uid, String sponsorApplyId);
MerchantSponsorAppliesVo applyInfo(String uid, String sponsorApplyId);
} }
package com.liquidnet.client.admin.web.controller.zhengzai.merchant;
import com.liquidnet.client.admin.common.core.controller.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("merchant/field/applies")
public class MerchantFieldAppliesController extends BaseController {
private String prefix = "zhengzai/adam/user";
}
...@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.CurrentUtil; ...@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.base.PagedResult; import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.merchant.dto.param.MerchantFieldApplyParam; import com.liquidnet.service.merchant.dto.param.MerchantFieldApplyParam;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldAppliesVo;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldCheckersVo; import com.liquidnet.service.merchant.dto.vo.MerchantFieldCheckersVo;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsVo; import com.liquidnet.service.merchant.dto.vo.MerchantFieldsVo;
import com.liquidnet.service.merchant.service.IMerchantFieldsService; import com.liquidnet.service.merchant.service.IMerchantFieldsService;
...@@ -67,6 +68,15 @@ public class MerchantFieldsController { ...@@ -67,6 +68,15 @@ public class MerchantFieldsController {
return ResponseDto.success(); return ResponseDto.success();
} }
@ApiOperationSupport(order = 13)
@ApiOperation(value = "申请场地详情")
@PostMapping("apply/info")
public ResponseDto<MerchantFieldAppliesVo> applyInfo(@RequestParam(required = true) String fieldApplyId) {
String currentUid = CurrentUtil.getCurrentUid();
return ResponseDto.success(merchantFieldsService.applyInfo(currentUid, fieldApplyId));
}
@ApiOperationSupport(order = 21) @ApiOperationSupport(order = 21)
@ApiOperation(value = "更改场地是否审核演出") @ApiOperation(value = "更改场地是否审核演出")
@PostMapping("editIsCheck") @PostMapping("editIsCheck")
......
...@@ -5,6 +5,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport; ...@@ -5,6 +5,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.commons.lang.util.CurrentUtil; import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.merchant.dto.param.MerchantSponsorApplyParam; import com.liquidnet.service.merchant.dto.param.MerchantSponsorApplyParam;
import com.liquidnet.service.merchant.dto.vo.MerchantSponsorAppliesVo;
import com.liquidnet.service.merchant.service.IMerchantSponsorsService; import com.liquidnet.service.merchant.service.IMerchantSponsorsService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -54,4 +55,12 @@ public class MerchantSponsorsController { ...@@ -54,4 +55,12 @@ public class MerchantSponsorsController {
return ResponseDto.success(); return ResponseDto.success();
} }
@ApiOperationSupport(order = 13)
@ApiOperation(value = "申请主办详情")
@PostMapping("apply/info")
public ResponseDto<MerchantSponsorAppliesVo> applyInfo(@RequestParam(required = true) String sponsorApplyId) {
String currentUid = CurrentUtil.getCurrentUid();
return ResponseDto.success(merchantSponsorsService.applyInfo(currentUid, sponsorApplyId));
}
} }
package com.liquidnet.service.merchant.service; package com.liquidnet.service.merchant.service;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;
@Component
public class MerchantMongoService { public class MerchantMongoService {
@Autowired
private MongoTemplate mongoTemplate;
public MerchantFieldsVo getMerchantFieldsVoByFieldId(String fieldId) {
return mongoTemplate.findOne(Query.query(Criteria.where("fieldId").is(fieldId)), MerchantFieldsVo.class, MerchantFieldsVo.class.getSimpleName());
}
} }
...@@ -21,19 +21,29 @@ public class MerchantRdmService { ...@@ -21,19 +21,29 @@ public class MerchantRdmService {
@Autowired @Autowired
RedisUtil redisUtil; RedisUtil redisUtil;
@Autowired
private MerchantMongoService merchantMongoService;
// 获取场地详情
public MerchantFieldsVo getFieldsVoByFieldId(String fieldId) { public MerchantFieldsVo getFieldsVoByFieldId(String fieldId) {
String key = MerchantRedisConst.INFO_FIELD.concat(fieldId); String key = MerchantRedisConst.INFO_FIELD.concat(fieldId);
long s = System.currentTimeMillis(); long s = System.currentTimeMillis();
MerchantFieldsVo vo = (MerchantFieldsVo) redisUtil.get(key); MerchantFieldsVo vo = (MerchantFieldsVo) redisUtil.get(key);
log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s); log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s);
if (null == vo) {
vo = merchantMongoService.getMerchantFieldsVoByFieldId(fieldId);
this.setFieldsVoByFieldId(fieldId, vo);
}
return vo; return vo;
} }
// 更新场地详情
public boolean setFieldsVoByFieldId(String fieldId, MerchantFieldsVo vo) { public boolean setFieldsVoByFieldId(String fieldId, MerchantFieldsVo vo) {
return redisUtil.set(MerchantRedisConst.INFO_FIELD.concat(fieldId), vo); return redisUtil.set(MerchantRedisConst.INFO_FIELD.concat(fieldId), vo);
} }
// 我的场地申请列表
public List<MerchantFieldAppliesVo> getFieldAppliesVosByUid(String uid) { public List<MerchantFieldAppliesVo> getFieldAppliesVosByUid(String uid) {
String key = MerchantRedisConst.INFO_FIELD_APPLIES.concat(uid); String key = MerchantRedisConst.INFO_FIELD_APPLIES.concat(uid);
long s = System.currentTimeMillis(); long s = System.currentTimeMillis();
...@@ -42,6 +52,7 @@ public class MerchantRdmService { ...@@ -42,6 +52,7 @@ public class MerchantRdmService {
return vos; return vos;
} }
// 新增场地申请
public boolean addFieldAppliesVoByUid(String uid, List<MerchantFieldAppliesVo> vos, MerchantFieldAppliesVo vo) { public boolean addFieldAppliesVoByUid(String uid, List<MerchantFieldAppliesVo> vos, MerchantFieldAppliesVo vo) {
if (null == vos) { if (null == vos) {
vos = ObjectUtil.getMerchantFieldAppliesVoArrayList(); vos = ObjectUtil.getMerchantFieldAppliesVoArrayList();
...@@ -50,6 +61,7 @@ public class MerchantRdmService { ...@@ -50,6 +61,7 @@ public class MerchantRdmService {
return redisUtil.set(MerchantRedisConst.INFO_FIELD_APPLIES.concat(uid), vos); return redisUtil.set(MerchantRedisConst.INFO_FIELD_APPLIES.concat(uid), vos);
} }
// 删除场地申请
public boolean delFieldAppliesVoByUid(String uid, List<MerchantFieldAppliesVo> vos, MerchantFieldAppliesVo vo) { public boolean delFieldAppliesVoByUid(String uid, List<MerchantFieldAppliesVo> vos, MerchantFieldAppliesVo vo) {
if (CollectionUtils.isEmpty(vos)) { if (CollectionUtils.isEmpty(vos)) {
return true; return true;
...@@ -59,6 +71,7 @@ public class MerchantRdmService { ...@@ -59,6 +71,7 @@ public class MerchantRdmService {
} }
// 场地默认验票员列表
public List<MerchantFieldCheckersVo> getFieldCheckersVosByFieldId(String fieldId) { public List<MerchantFieldCheckersVo> getFieldCheckersVosByFieldId(String fieldId) {
String key = MerchantRedisConst.INFO_FIELD_CHECKERS.concat(fieldId); String key = MerchantRedisConst.INFO_FIELD_CHECKERS.concat(fieldId);
long s = System.currentTimeMillis(); long s = System.currentTimeMillis();
...@@ -67,6 +80,7 @@ public class MerchantRdmService { ...@@ -67,6 +80,7 @@ public class MerchantRdmService {
return vos; return vos;
} }
// 新增场地默认验票员
public boolean addFieldCheckersVoByFieldId(String fieldId, List<MerchantFieldCheckersVo> vos, MerchantFieldCheckersVo vo) { public boolean addFieldCheckersVoByFieldId(String fieldId, List<MerchantFieldCheckersVo> vos, MerchantFieldCheckersVo vo) {
if (null == vos) { if (null == vos) {
vos = ObjectUtil.getMerchantFieldCheckersVoArrayList(); vos = ObjectUtil.getMerchantFieldCheckersVoArrayList();
...@@ -75,6 +89,7 @@ public class MerchantRdmService { ...@@ -75,6 +89,7 @@ public class MerchantRdmService {
return redisUtil.set(MerchantRedisConst.INFO_FIELD_CHECKERS.concat(fieldId), vos); return redisUtil.set(MerchantRedisConst.INFO_FIELD_CHECKERS.concat(fieldId), vos);
} }
// 删除场地默认验票员
public boolean delFieldCheckersVoByFieldId(String fieldId, List<MerchantFieldCheckersVo> vos, MerchantFieldCheckersVo vo) { public boolean delFieldCheckersVoByFieldId(String fieldId, List<MerchantFieldCheckersVo> vos, MerchantFieldCheckersVo vo) {
if (CollectionUtils.isEmpty(vos)) { if (CollectionUtils.isEmpty(vos)) {
return true; return true;
...@@ -84,6 +99,7 @@ public class MerchantRdmService { ...@@ -84,6 +99,7 @@ public class MerchantRdmService {
} }
// 我的主办申请列表
public List<MerchantSponsorAppliesVo> getSponsorAppliesVosByUid(String uid) { public List<MerchantSponsorAppliesVo> getSponsorAppliesVosByUid(String uid) {
String key = MerchantRedisConst.INFO_SPONSOR_APPLIES.concat(uid); String key = MerchantRedisConst.INFO_SPONSOR_APPLIES.concat(uid);
long s = System.currentTimeMillis(); long s = System.currentTimeMillis();
...@@ -92,6 +108,7 @@ public class MerchantRdmService { ...@@ -92,6 +108,7 @@ public class MerchantRdmService {
return vos; return vos;
} }
// 新增主办申请
public boolean addSponsorAppliesVoByUid(String uid, List<MerchantSponsorAppliesVo> vos, MerchantSponsorAppliesVo vo) { public boolean addSponsorAppliesVoByUid(String uid, List<MerchantSponsorAppliesVo> vos, MerchantSponsorAppliesVo vo) {
if (null == vos) { if (null == vos) {
vos = ObjectUtil.getMerchantSponsorAppliesVoArrayList(); vos = ObjectUtil.getMerchantSponsorAppliesVoArrayList();
...@@ -100,6 +117,7 @@ public class MerchantRdmService { ...@@ -100,6 +117,7 @@ public class MerchantRdmService {
return redisUtil.set(MerchantRedisConst.INFO_SPONSOR_APPLIES.concat(uid), vos); return redisUtil.set(MerchantRedisConst.INFO_SPONSOR_APPLIES.concat(uid), vos);
} }
// 删除主办申请
public boolean delSponsorAppliesVoByUid(String uid, List<MerchantSponsorAppliesVo> vos, MerchantSponsorAppliesVo vo) { public boolean delSponsorAppliesVoByUid(String uid, List<MerchantSponsorAppliesVo> vos, MerchantSponsorAppliesVo vo) {
if (CollectionUtils.isEmpty(vos)) { if (CollectionUtils.isEmpty(vos)) {
return true; return true;
......
...@@ -117,6 +117,13 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -117,6 +117,13 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
// 场地 redis // 场地 redis
merchantRdmService.setFieldsVoByFieldId(fieldsVo.getFieldId(), fieldsVo); merchantRdmService.setFieldsVoByFieldId(fieldsVo.getFieldId(), fieldsVo);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s); log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
// 场地 mongo
s = System.currentTimeMillis();
Query query = Query.query(Criteria.where("fieldId").is(fieldsVo.getFieldId()));
Update update = Update.update("claimStatus", fieldsVo.getClaimStatus()).set("updateAt", fieldsVo.getUpdatedAt());
mongoTemplate.updateFirst(query, update, MerchantFieldsVo.class, MerchantFieldsVo.class.getSimpleName());
log.debug("#MONGO耗时:{}ms", System.currentTimeMillis() - s);
} }
// 申请场地 vo // 申请场地 vo
...@@ -231,6 +238,26 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -231,6 +238,26 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s); log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s);
} }
@Override
public MerchantFieldAppliesVo applyInfo(String uid, String fieldApplyId) {
// 查找场地申请,是否存在
List<MerchantFieldAppliesVo> fieldAppliesVos = merchantRdmService.getFieldAppliesVosByUid(uid);
if (CollectionUtils.isEmpty(fieldAppliesVos)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13104");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
int idx = IntStream.range(0, fieldAppliesVos.size())
.filter(i -> fieldAppliesVos.get(i).getFieldApplyId().equals(fieldApplyId))
.findFirst()
.orElse(-1);
if (idx < 0) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13104");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
return fieldAppliesVos.get(idx);
}
@Override @Override
public void editIsCheck(String uid, String fieldId, int isCheck) { public void editIsCheck(String uid, String fieldId, int isCheck) {
// 当前用户是否管理该场地 // 当前用户是否管理该场地
...@@ -247,9 +274,11 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -247,9 +274,11 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s); log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
// 场地 mongo // 场地 mongo
s = System.currentTimeMillis();
Query query = Query.query(Criteria.where("fieldId").is(fieldsVo.getFieldId())); Query query = Query.query(Criteria.where("fieldId").is(fieldsVo.getFieldId()));
Update update = Update.update("isCheck", fieldsVo.getIsCheck()).set("updateAt", fieldsVo.getUpdatedAt()); Update update = Update.update("isCheck", fieldsVo.getIsCheck()).set("updateAt", fieldsVo.getUpdatedAt());
mongoTemplate.updateFirst(query, update, MerchantFieldsVo.class, MerchantFieldsVo.class.getSimpleName()); mongoTemplate.updateFirst(query, update, MerchantFieldsVo.class, MerchantFieldsVo.class.getSimpleName());
log.debug("#MONGO耗时:{}ms", System.currentTimeMillis() - s);
// 场地 sql // 场地 sql
LinkedList<String> toMqSqls = CollectionUtil.linkedListString(); LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
......
...@@ -171,4 +171,24 @@ public class MerchantSponsorsServiceImpl implements IMerchantSponsorsService { ...@@ -171,4 +171,24 @@ public class MerchantSponsorsServiceImpl implements IMerchantSponsorsService {
); );
log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s); log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s);
} }
@Override
public MerchantSponsorAppliesVo applyInfo(String uid, String sponsorApplyId) {
// 查找场地申请,是否存在
List<MerchantSponsorAppliesVo> sponsorAppliesVos = merchantRdmService.getSponsorAppliesVosByUid(uid);
if (CollectionUtils.isEmpty(sponsorAppliesVos)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13203");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
int idx = IntStream.range(0, sponsorAppliesVos.size())
.filter(i -> sponsorAppliesVos.get(i).getSponsorApplyId().equals(sponsorApplyId))
.findFirst()
.orElse(-1);
if (idx < 0) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13203");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
return sponsorAppliesVos.get(idx);
}
} }
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