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

Commit f30f16e0 authored by Tice's avatar Tice

代码提交

parent b1dd5fc7
package com.liquidnet.service.merchant.dto.vo;
public class MerchantAuthorizationRecordsVo {
}
...@@ -3,6 +3,7 @@ package com.liquidnet.service.merchant.dto.vo; ...@@ -3,6 +3,7 @@ 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.MerchantCompanies;
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;
...@@ -36,4 +37,34 @@ public class MerchantCompaniesVo implements java.io.Serializable, Cloneable { ...@@ -36,4 +37,34 @@ public class MerchantCompaniesVo implements java.io.Serializable, Cloneable {
private LocalDateTime createdAt; private LocalDateTime createdAt;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime updatedAt; private LocalDateTime updatedAt;
private static final MerchantCompaniesVo obj = new MerchantCompaniesVo();
public static MerchantCompaniesVo getNew() {
try {
return (MerchantCompaniesVo) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new MerchantCompaniesVo();
}
public MerchantCompaniesVo copy(MerchantCompanies source) {
if (null == source) return this;
this.setCompanyId(source.getCompanyId());
this.setName(source.getName());
this.setLicenseCode(source.getLicenseCode());
this.setLicenseImg(source.getLicenseImg());
this.setLegalName(source.getLegalName());
this.setLegalIdentity(source.getLegalIdentity());
this.setLegalIdentityObverse(source.getLegalIdentityObverse());
this.setLegalIdentityReverse(source.getLegalIdentityReverse());
this.setCreatedAt(source.getCreatedAt());
this.setUpdatedAt(source.getUpdatedAt());
return this;
}
} }
...@@ -82,6 +82,13 @@ public class MerchantFieldAppliesVo implements java.io.Serializable, Cloneable { ...@@ -82,6 +82,13 @@ public class MerchantFieldAppliesVo implements java.io.Serializable, Cloneable {
@ApiModelProperty(position = 39, value = "法人身份证反面照") @ApiModelProperty(position = 39, value = "法人身份证反面照")
private String legalIdentityReverse; private String legalIdentityReverse;
@ApiModelProperty(position = 40, value = "审核人ID")
private String auditUid;
@ApiModelProperty(position = 41, value = "审核人姓名")
private String auditName;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime auditedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime createdAt; private LocalDateTime createdAt;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
...@@ -140,6 +147,10 @@ public class MerchantFieldAppliesVo implements java.io.Serializable, Cloneable { ...@@ -140,6 +147,10 @@ public class MerchantFieldAppliesVo implements java.io.Serializable, Cloneable {
this.setLegalIdentityObverse(source.getLegalIdentityObverse()); this.setLegalIdentityObverse(source.getLegalIdentityObverse());
this.setLegalIdentityReverse(source.getLegalIdentityReverse()); this.setLegalIdentityReverse(source.getLegalIdentityReverse());
this.setAuditUid(source.getAuditUid());
this.setAuditName(source.getAuditName());
this.setAuditedAt(source.getAuditedAt());
this.setCreatedAt(source.getCreatedAt()); this.setCreatedAt(source.getCreatedAt());
this.setUpdatedAt(source.getUpdatedAt()); this.setUpdatedAt(source.getUpdatedAt());
this.setDeletedAt(source.getDeletedAt()); this.setDeletedAt(source.getDeletedAt());
......
...@@ -64,6 +64,8 @@ public class MerchantFieldsVo implements java.io.Serializable, Cloneable { ...@@ -64,6 +64,8 @@ public class MerchantFieldsVo implements java.io.Serializable, Cloneable {
@ApiModelProperty(position = 32, value = "企业ID") @ApiModelProperty(position = 32, value = "企业ID")
private String companyId; private String companyId;
@ApiModelProperty(position = 33, value = "企业")
private MerchantCompaniesVo companiesVo;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime createdAt; private LocalDateTime createdAt;
......
...@@ -66,6 +66,13 @@ public class MerchantSponsorAppliesVo implements java.io.Serializable, Cloneable ...@@ -66,6 +66,13 @@ public class MerchantSponsorAppliesVo implements java.io.Serializable, Cloneable
@ApiModelProperty(position = 32, value = "法人身份证反面照") @ApiModelProperty(position = 32, value = "法人身份证反面照")
private String legalIdentityReverse; private String legalIdentityReverse;
@ApiModelProperty(position = 33, value = "审核人ID")
private String auditUid;
@ApiModelProperty(position = 34, value = "审核人姓名")
private String auditName;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime auditedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime deletedAt; private LocalDateTime deletedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
...@@ -114,6 +121,10 @@ public class MerchantSponsorAppliesVo implements java.io.Serializable, Cloneable ...@@ -114,6 +121,10 @@ public class MerchantSponsorAppliesVo implements java.io.Serializable, Cloneable
this.setLegalIdentityObverse(source.getLegalIdentityObverse()); this.setLegalIdentityObverse(source.getLegalIdentityObverse());
this.setLegalIdentityReverse(source.getLegalIdentityReverse()); this.setLegalIdentityReverse(source.getLegalIdentityReverse());
this.setAuditUid(source.getAuditUid());
this.setAuditName(source.getAuditName());
this.setAuditedAt(source.getAuditedAt());
this.setCreatedAt(source.getCreatedAt()); this.setCreatedAt(source.getCreatedAt());
this.setUpdatedAt(source.getUpdatedAt()); this.setUpdatedAt(source.getUpdatedAt());
this.setDeletedAt(source.getDeletedAt()); this.setDeletedAt(source.getDeletedAt());
......
...@@ -42,6 +42,8 @@ public class MerchantSponsorsVo implements java.io.Serializable{ ...@@ -42,6 +42,8 @@ public class MerchantSponsorsVo implements java.io.Serializable{
@ApiModelProperty(position = 23, value = "企业ID") @ApiModelProperty(position = 23, value = "企业ID")
private String companyId; private String companyId;
@ApiModelProperty(position = 24, value = "企业")
private MerchantCompaniesVo companiesVo;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime createdAt; private LocalDateTime createdAt;
......
package com.liquidnet.service.merchant.service;
public interface IMerchantAuthorizationRecordsService {
void authorizationInit(String performanceId, String cuid, String fieldId, String sponsorId);
void checkerAdd(String cuid, String performanceId, String uid, boolean statistics);
void checkerDel(String cuid, String performanceId, String uid);
void checkers(String cuid, String performanceId);
}
...@@ -7,7 +7,7 @@ import com.liquidnet.client.admin.common.core.page.TableDataInfo; ...@@ -7,7 +7,7 @@ import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.common.enums.BusinessType; import com.liquidnet.client.admin.common.enums.BusinessType;
import com.liquidnet.client.admin.common.utils.ShiroUtils; import com.liquidnet.client.admin.common.utils.ShiroUtils;
import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantFieldAppliesAdminService; import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantFieldAppliesAdminService;
import com.liquidnet.service.merchant.dto.admin.MerchantFieldApplyListParam; import com.liquidnet.service.merchant.dto.param.admin.MerchantFieldApplyListParam;
import com.liquidnet.service.merchant.entity.MerchantFieldApplies; import com.liquidnet.service.merchant.entity.MerchantFieldApplies;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
......
...@@ -7,7 +7,7 @@ import com.liquidnet.client.admin.common.core.page.TableDataInfo; ...@@ -7,7 +7,7 @@ import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.common.enums.BusinessType; import com.liquidnet.client.admin.common.enums.BusinessType;
import com.liquidnet.client.admin.common.utils.ShiroUtils; import com.liquidnet.client.admin.common.utils.ShiroUtils;
import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantSponsorAppliesAdminService; import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantSponsorAppliesAdminService;
import com.liquidnet.service.merchant.dto.admin.MerchantSponsorApplyListParam; import com.liquidnet.service.merchant.dto.param.admin.MerchantSponsorApplyListParam;
import com.liquidnet.service.merchant.entity.MerchantSponsorApplies; import com.liquidnet.service.merchant.entity.MerchantSponsorApplies;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
......
package com.liquidnet.client.admin.zhengzai.merchant.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.liquidnet.service.merchant.entity.MerchantCompanies;
public interface IMerchantCompaniesAdminService extends IService<MerchantCompanies> {
}
...@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.liquidnet.service.merchant.entity.MerchantFieldApplies; import com.liquidnet.service.merchant.entity.MerchantFieldApplies;
public interface IMerchantFieldAppliesAdminService extends IService<MerchantFieldApplies> { public interface IMerchantFieldAppliesAdminService extends IService<MerchantFieldApplies> {
void applyApprove(String fieldApplyId); void applyApprove(String uid, String fieldApplyId, String auditUid, String auditName);
void applyReject(String fieldApplyId); void applyReject(String uid, String fieldApplyId, String auditUid, String auditName, String reject);
} }
package com.liquidnet.client.admin.zhengzai.merchant.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.liquidnet.service.merchant.entity.MerchantFields;
public interface IMerchantFieldsAdminService extends IService<MerchantFields> {
}
package com.liquidnet.client.admin.zhengzai.merchant.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.liquidnet.service.merchant.entity.MerchantSponsors;
public interface IMerchantSponsorsAdminService extends IService<MerchantSponsors> {
}
package com.liquidnet.client.admin.zhengzai.merchant.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantCompaniesAdminService;
import com.liquidnet.service.merchant.entity.MerchantCompanies;
import com.liquidnet.service.merchant.mapper.MerchantCompaniesMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class MerchantCompaniesAdminServiceImpl extends ServiceImpl<MerchantCompaniesMapper, MerchantCompanies> implements IMerchantCompaniesAdminService {
}
package com.liquidnet.client.admin.zhengzai.merchant.service.impl; package com.liquidnet.client.admin.zhengzai.merchant.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantCompaniesAdminService;
import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantFieldAppliesAdminService; import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantFieldAppliesAdminService;
import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantFieldsAdminService;
import com.liquidnet.client.admin.zhengzai.merchant.utils.MerchantRedisUtil;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.merchant.dto.vo.MerchantCompaniesVo;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldAppliesVo;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsVo;
import com.liquidnet.service.merchant.entity.MerchantCompanies;
import com.liquidnet.service.merchant.entity.MerchantFieldApplies; import com.liquidnet.service.merchant.entity.MerchantFieldApplies;
import com.liquidnet.service.merchant.entity.MerchantFields;
import com.liquidnet.service.merchant.mapper.MerchantFieldAppliesMapper; import com.liquidnet.service.merchant.mapper.MerchantFieldAppliesMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.IntStream;
@Slf4j @Slf4j
@Service @Service
public class MerchantFieldAppliesAdminServiceImpl extends ServiceImpl<MerchantFieldAppliesMapper, MerchantFieldApplies> implements IMerchantFieldAppliesAdminService { public class MerchantFieldAppliesAdminServiceImpl extends ServiceImpl<MerchantFieldAppliesMapper, MerchantFieldApplies> implements IMerchantFieldAppliesAdminService {
@Autowired
MerchantRedisUtil merchantRedisUtil;
@Autowired
IMerchantFieldsAdminService merchantFieldsAdminService;
@Autowired
IMerchantCompaniesAdminService merchantCompaniesAdminService;
@Override @Override
public void applyApprove(String fieldApplyId) { @Transactional
public void applyApprove(String uid, String fieldApplyId, String auditUid, String auditName) {
List<MerchantFieldAppliesVo> fieldAppliesVos = merchantRedisUtil.getFieldAppliesVosByUid(uid);
if (CollectionUtils.isEmpty(fieldAppliesVos)) {
// todo error
}
int idx = IntStream.range(0, fieldAppliesVos.size())
.filter(i -> fieldAppliesVos.get(i).getFieldApplyId().equals(fieldApplyId))
.findFirst()
.orElse(-1);
if (idx < 0) {
// todo error
}
MerchantFieldAppliesVo fieldAppliesVo = fieldAppliesVos.get(idx);
LocalDateTime now = LocalDateTime.now();
if (fieldAppliesVo.getApplyType().equals("claim")) {
// 认领逻辑
MerchantFieldsVo fieldsVo = merchantRedisUtil.getFieldsVoByFieldId(fieldAppliesVo.getFieldId());
if (2 != fieldsVo.getClaimStatus() || !fieldsVo.getUid().equals(uid)) {
// todo error
}
// 场地认领 vo
fieldAppliesVo.setApplyStatus(1);
fieldAppliesVo.setReject("");
fieldAppliesVo.setAuditUid(auditUid);
fieldAppliesVo.setAuditName(auditName);
fieldAppliesVo.setAuditedAt(now);
// 公司 entity
MerchantCompanies companies = new MerchantCompanies();
companies.setCompanyId(IDGenerator.nextSnowId());
companies.setName(fieldAppliesVo.getCompanyName());
companies.setLicenseCode(fieldAppliesVo.getLicenseCode());
companies.setLicenseImg(fieldAppliesVo.getLicenseImg());
companies.setLegalName(fieldAppliesVo.getLegalName());
companies.setLegalIdentity(fieldAppliesVo.getLegalIdentity());
companies.setLegalIdentityObverse(fieldAppliesVo.getLegalIdentityObverse());
companies.setLegalIdentityReverse(fieldAppliesVo.getLegalIdentityReverse());
companies.setCreatedAt(now);
boolean success = merchantCompaniesAdminService.save(companies);
if (!success) {
throw new LiquidnetServiceException();
}
// 场地 entity
// MerchantFields fields = merchantFieldsAdminService.query()
// 公司 vo
MerchantCompaniesVo companiesVo = MerchantCompaniesVo.getNew();
companiesVo.copy(companies);
// 场地 vo
fieldsVo.setIsOnline(1);
fieldsVo.setClaimStatus(1);
fieldsVo.setUid(uid);
fieldsVo.setName(fieldAppliesVo.getName());
fieldsVo.setLogo(fieldAppliesVo.getLogo());
fieldsVo.setBackground(fieldAppliesVo.getBackground());
fieldsVo.setDescription(fieldAppliesVo.getDescription());
fieldsVo.setBuiltDate(fieldAppliesVo.getBuiltDate());
fieldsVo.setProvinceId(fieldAppliesVo.getProvinceId());
fieldsVo.setProvinceName(fieldAppliesVo.getProvinceName());
fieldsVo.setCityId(fieldAppliesVo.getCityId());
fieldsVo.setCityName(fieldAppliesVo.getCityName());
fieldsVo.setDistrictId(fieldAppliesVo.getDistrictId());
fieldsVo.setDistrictName(fieldAppliesVo.getDistrictName());
fieldsVo.setAddress(fieldAppliesVo.getAddress());
fieldsVo.setLongitude(fieldAppliesVo.getLongitude());
fieldsVo.setLatitude(fieldAppliesVo.getLatitude());
fieldsVo.setContactName(fieldAppliesVo.getContactName());
fieldsVo.setContactEmail(fieldAppliesVo.getContactEmail());
fieldsVo.setCompanyId(companiesVo.getCompanyId());
fieldsVo.setCompaniesVo(companiesVo);
fieldsVo.setUpdatedAt(now);
// 场地 mysql
LambdaUpdateWrapper<MerchantFields> fieldsLambdaUpdateWrapper = Wrappers.lambdaUpdate(MerchantFields.class);
fieldsLambdaUpdateWrapper.eq(MerchantFields::getFieldId, fieldAppliesVo.getFieldId());
fieldsLambdaUpdateWrapper.set(MerchantFields::getClaimStatus, fieldsVo.getClaimStatus());
fieldsLambdaUpdateWrapper.set(MerchantFields::getUid, fieldsVo.getUid());
fieldsLambdaUpdateWrapper.set(MerchantFields::getName, fieldsVo.getName());
fieldsLambdaUpdateWrapper.set(MerchantFields::getLogo, fieldsVo.getLogo());
fieldsLambdaUpdateWrapper.set(MerchantFields::getBackground, fieldsVo.getBackground());
fieldsLambdaUpdateWrapper.set(MerchantFields::getDescription, fieldsVo.getDescription());
fieldsLambdaUpdateWrapper.set(MerchantFields::getBuiltDate, fieldsVo.getBuiltDate());
fieldsLambdaUpdateWrapper.set(MerchantFields::getProvinceId, fieldsVo.getProvinceId());
fieldsLambdaUpdateWrapper.set(MerchantFields::getProvinceName, fieldsVo.getProvinceName());
fieldsLambdaUpdateWrapper.set(MerchantFields::getCityId, fieldsVo.getCityId());
fieldsLambdaUpdateWrapper.set(MerchantFields::getCityName, fieldsVo.getCityName());
fieldsLambdaUpdateWrapper.set(MerchantFields::getDistrictId, fieldsVo.getDistrictId());
fieldsLambdaUpdateWrapper.set(MerchantFields::getDistrictName, fieldsVo.getDistrictName());
fieldsLambdaUpdateWrapper.set(MerchantFields::getAddress, fieldsVo.getAddress());
fieldsLambdaUpdateWrapper.set(MerchantFields::getLongitude, fieldsVo.getLongitude());
fieldsLambdaUpdateWrapper.set(MerchantFields::getLatitude, fieldsVo.getLatitude());
fieldsLambdaUpdateWrapper.set(MerchantFields::getContactName, fieldsVo.getContactName());
fieldsLambdaUpdateWrapper.set(MerchantFields::getContactEmail, fieldsVo.getContactEmail());
fieldsLambdaUpdateWrapper.set(MerchantFields::getCompanyId, fieldsVo.getCompanyId());
fieldsLambdaUpdateWrapper.set(MerchantFields::getUpdatedAt, fieldsVo.getUpdatedAt());
success = merchantFieldsAdminService.update(fieldsLambdaUpdateWrapper);
if (!success) {
throw new LiquidnetServiceException();
}
// 场地 sync redis
// 场地 sync mongo
// 场地申请 mysql
// 场地申请 redis
} else {
// 创建逻辑
}
} }
@Override @Override
public void applyReject(String fieldApplyId) { public void applyReject(String uid, String fieldApplyId, String auditUid, String auditName, String reject) {
} }
} }
package com.liquidnet.client.admin.zhengzai.merchant.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantFieldsAdminService;
import com.liquidnet.service.merchant.entity.MerchantFields;
import com.liquidnet.service.merchant.mapper.MerchantFieldsMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class MerchantFieldsAdminServiceImpl extends ServiceImpl<MerchantFieldsMapper, MerchantFields> implements IMerchantFieldsAdminService {
}
package com.liquidnet.client.admin.zhengzai.merchant.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.client.admin.zhengzai.merchant.service.IMerchantSponsorsAdminService;
import com.liquidnet.service.merchant.entity.MerchantSponsors;
import com.liquidnet.service.merchant.mapper.MerchantSponsorsMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class MerchantSponsorsAdminServiceImpl extends ServiceImpl<MerchantSponsorsMapper, MerchantSponsors> implements IMerchantSponsorsAdminService {
}
package com.liquidnet.client.admin.zhengzai.merchant.utils;
import com.liquidnet.service.merchant.dto.vo.MerchantFieldsVo;
import com.liquidnet.service.merchant.dto.vo.MerchantSponsorsVo;
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 MerchantMongoUtil {
@Autowired
private MongoTemplate mongoTemplate;
public MerchantFieldsVo getMerchantFieldsVoByFieldId(String fieldId) {
return mongoTemplate.findOne(Query.query(Criteria.where("fieldId").is(fieldId)), MerchantFieldsVo.class, MerchantFieldsVo.class.getSimpleName());
}
public MerchantSponsorsVo getMerchantSponsorsVoBySponsorId(String sponsorId) {
return mongoTemplate.findOne(Query.query(Criteria.where("sponsorId").is(sponsorId)), MerchantSponsorsVo.class, MerchantSponsorsVo.class.getSimpleName());
}
}
package com.liquidnet.client.admin.zhengzai.merchant.utils;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.merchant.constant.MerchantRedisConst;
import com.liquidnet.service.merchant.dto.vo.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service
public class MerchantRedisUtil {
@Autowired
RedisUtil redisUtil;
@Autowired
MerchantMongoUtil mongoUtil;
// 【场地】获取详情
public MerchantFieldsVo getFieldsVoByFieldId(String fieldId) {
String key = MerchantRedisConst.INFO_FIELD.concat(fieldId);
long s = System.currentTimeMillis();
MerchantFieldsVo vo = (MerchantFieldsVo) redisUtil.get(key);
log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s);
if (null == vo) {
vo = mongoUtil.getMerchantFieldsVoByFieldId(fieldId);
this.setFieldsVoByFieldId(fieldId, vo);
}
return vo;
}
// 【场地】更新详情
public boolean setFieldsVoByFieldId(String fieldId, MerchantFieldsVo vo) {
return redisUtil.set(MerchantRedisConst.INFO_FIELD.concat(fieldId), vo);
}
// 【场地申请】我的列表
public List<MerchantFieldAppliesVo> getFieldAppliesVosByUid(String uid) {
String key = MerchantRedisConst.INFO_FIELD_APPLIES.concat(uid);
long s = System.currentTimeMillis();
List<MerchantFieldAppliesVo> vos = (List<MerchantFieldAppliesVo>) redisUtil.get(key);
log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s);
return vos;
}
// 【场地申请】新增
public boolean addFieldAppliesVoByUid(String uid, List<MerchantFieldAppliesVo> vos, MerchantFieldAppliesVo vo) {
if (null == vos) {
vos = new ArrayList<>();
}
vos.add(vo);
return redisUtil.set(MerchantRedisConst.INFO_FIELD_APPLIES.concat(uid), vos);
}
// 【场地申请】删除
public boolean delFieldAppliesVoByUid(String uid, List<MerchantFieldAppliesVo> vos, MerchantFieldAppliesVo vo) {
if (CollectionUtils.isEmpty(vos)) {
return true;
}
vos.removeIf(r -> r.getFieldApplyId().equals(vo.getFieldApplyId()));
return redisUtil.set(MerchantRedisConst.INFO_FIELD_APPLIES.concat(uid), vos);
}
// 【场地默认验票员】列表
public List<MerchantFieldCheckersVo> getFieldCheckersVosByFieldId(String fieldId) {
String key = MerchantRedisConst.INFO_FIELD_CHECKERS.concat(fieldId);
long s = System.currentTimeMillis();
List<MerchantFieldCheckersVo> vos = (List<MerchantFieldCheckersVo>) redisUtil.get(key);
log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s);
return vos;
}
// 【场地默认验票员】新增
public boolean addFieldCheckersVoByFieldId(String fieldId, List<MerchantFieldCheckersVo> vos, MerchantFieldCheckersVo vo) {
if (null == vos) {
vos = new ArrayList<>();
}
vos.add(vo);
return redisUtil.set(MerchantRedisConst.INFO_FIELD_CHECKERS.concat(fieldId), vos);
}
// 【场地默认验票员】删除
public boolean delFieldCheckersVoByFieldId(String fieldId, List<MerchantFieldCheckersVo> vos, MerchantFieldCheckersVo vo) {
if (CollectionUtils.isEmpty(vos)) {
return true;
}
vos.removeIf(r -> r.getFieldCheckerId().equals(vo.getFieldCheckerId()));
return redisUtil.set(MerchantRedisConst.INFO_FIELD_CHECKERS.concat(fieldId), vos);
}
// 【主办】详情
public MerchantSponsorsVo getSponsorsVoBySponsorId(String sponsorId) {
String key = MerchantRedisConst.INFO_SPONSOR.concat(sponsorId);
long s = System.currentTimeMillis();
MerchantSponsorsVo vo = (MerchantSponsorsVo) redisUtil.get(key);
log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s);
if (null == vo) {
vo = mongoUtil.getMerchantSponsorsVoBySponsorId(sponsorId);
this.setSponsorsVoBySponsorId(sponsorId, vo);
}
return vo;
}
// 【主办】更新详情
public boolean setSponsorsVoBySponsorId(String sponsorId, MerchantSponsorsVo vo) {
return redisUtil.set(MerchantRedisConst.INFO_SPONSOR.concat(sponsorId), vo);
}
// 【主办申请】我的列表
public List<MerchantSponsorAppliesVo> getSponsorAppliesVosByUid(String uid) {
String key = MerchantRedisConst.INFO_SPONSOR_APPLIES.concat(uid);
long s = System.currentTimeMillis();
List<MerchantSponsorAppliesVo> vos = (List<MerchantSponsorAppliesVo>) redisUtil.get(key);
log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s);
return vos;
}
// 【主办申请】新增
public boolean addSponsorAppliesVoByUid(String uid, List<MerchantSponsorAppliesVo> vos, MerchantSponsorAppliesVo vo) {
if (null == vos) {
vos = new ArrayList<>();
}
vos.add(vo);
return redisUtil.set(MerchantRedisConst.INFO_SPONSOR_APPLIES.concat(uid), vos);
}
// 【主办申请】删除
public boolean delSponsorAppliesVoByUid(String uid, List<MerchantSponsorAppliesVo> vos, MerchantSponsorAppliesVo vo) {
if (CollectionUtils.isEmpty(vos)) {
return true;
}
vos.removeIf(r -> r.getSponsorApplyId().equals(vo.getSponsorApplyId()));
return redisUtil.set(MerchantRedisConst.INFO_SPONSOR_APPLIES.concat(uid), vos);
}
}
...@@ -170,6 +170,18 @@ public class MerchantFieldApplies implements Serializable { ...@@ -170,6 +170,18 @@ public class MerchantFieldApplies implements Serializable {
*/ */
private String legalIdentityReverse; private String legalIdentityReverse;
/**
* 审核人ID
*/
private String auditUid;
/**
* 审核人姓名
*/
private String auditName;
private LocalDateTime auditedAt;
private LocalDateTime deletedAt; private LocalDateTime deletedAt;
private LocalDateTime createdAt; private LocalDateTime createdAt;
......
...@@ -129,6 +129,18 @@ public class MerchantSponsorApplies implements Serializable { ...@@ -129,6 +129,18 @@ public class MerchantSponsorApplies implements Serializable {
*/ */
private String legalIdentityReverse; private String legalIdentityReverse;
/**
* 审核人ID
*/
private String auditUid;
/**
* 审核人姓名
*/
private String auditName;
private LocalDateTime auditedAt;
private LocalDateTime deletedAt; private LocalDateTime deletedAt;
private LocalDateTime createdAt; private LocalDateTime createdAt;
......
...@@ -94,6 +94,9 @@ create table merchant_field_applies ...@@ -94,6 +94,9 @@ create table merchant_field_applies
legal_identity varchar(255) default '' not null comment '法人身份证号码', legal_identity varchar(255) default '' not null comment '法人身份证号码',
legal_identity_obverse varchar(255) default '' not null comment '法人身份证正面照', legal_identity_obverse varchar(255) default '' not null comment '法人身份证正面照',
legal_identity_reverse varchar(255) default '' not null comment '法人身份证反面照', legal_identity_reverse varchar(255) default '' not null comment '法人身份证反面照',
audit_uid varchar(64) default '' not null comment '审核人ID',
audit_name varchar(255) default '' not null comment '审核人姓名',
audited_at timestamp null,
deleted_at timestamp null, deleted_at timestamp null,
created_at timestamp null, created_at timestamp null,
updated_at timestamp null updated_at timestamp null
...@@ -157,6 +160,9 @@ create table merchant_sponsor_applies ...@@ -157,6 +160,9 @@ create table merchant_sponsor_applies
legal_identity varchar(255) default '' not null comment '法人身份证号码', legal_identity varchar(255) default '' not null comment '法人身份证号码',
legal_identity_obverse varchar(255) default '' not null comment '法人身份证正面照', legal_identity_obverse varchar(255) default '' not null comment '法人身份证正面照',
legal_identity_reverse varchar(255) default '' not null comment '法人身份证反面照', legal_identity_reverse varchar(255) default '' not null comment '法人身份证反面照',
audit_uid varchar(64) default '' not null comment '审核人ID',
audit_name varchar(255) default '' not null comment '审核人姓名',
audited_at timestamp null,
deleted_at timestamp null, deleted_at timestamp null,
created_at timestamp null, created_at timestamp null,
updated_at timestamp null updated_at timestamp null
......
...@@ -9,6 +9,8 @@ db.createCollection("MerchantSponsorsVo"); ...@@ -9,6 +9,8 @@ db.createCollection("MerchantSponsorsVo");
db.MerchantFieldsVo.createIndex({fieldId:"hashed"}); db.MerchantFieldsVo.createIndex({fieldId:"hashed"});
db.MerchantFieldsVo.createIndex({isOnline:"hashed"}); db.MerchantFieldsVo.createIndex({isOnline:"hashed"});
db.MerchantFieldsVo.createIndex({uid:"hashed"}); db.MerchantFieldsVo.createIndex({uid:"hashed"});
db.MerchantFieldsVo.createIndex({companyId:"hashed"});
db.MerchantSponsorsVo.createIndex({fieldId:"hashed"}); db.MerchantSponsorsVo.createIndex({fieldId:"hashed"});
db.MerchantSponsorsVo.createIndex({isOnline:"hashed"}); db.MerchantSponsorsVo.createIndex({isOnline:"hashed"});
db.MerchantSponsorsVo.createIndex({uid:"hashed"}); db.MerchantSponsorsVo.createIndex({uid:"hashed"});
\ No newline at end of file db.MerchantSponsorsVo.createIndex({companyId:"hashed"});
...@@ -110,8 +110,9 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -110,8 +110,9 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
long s = System.currentTimeMillis(); long s = System.currentTimeMillis();
if (null != fieldsVo) { if (null != fieldsVo) {
// 场地 vo 更改场地状态 // 场地 vo 更改场地状态 及 认领的人
fieldsVo.setClaimStatus(2); fieldsVo.setClaimStatus(2);
fieldsVo.setUid(uid);
fieldsVo.setUpdatedAt(now); fieldsVo.setUpdatedAt(now);
// 场地 redis // 场地 redis
...@@ -121,7 +122,7 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -121,7 +122,7 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
// 场地 mongo // 场地 mongo
s = System.currentTimeMillis(); 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("claimStatus", fieldsVo.getClaimStatus()).set("updateAt", fieldsVo.getUpdatedAt()); Update update = Update.update("claimStatus", fieldsVo.getClaimStatus()).set("uid", fieldsVo.getUid()).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); log.debug("#MONGO耗时:{}ms", System.currentTimeMillis() - s);
} }
...@@ -156,9 +157,9 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -156,9 +157,9 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
if (null != fieldsVo) { if (null != fieldsVo) {
// 场地 sql // 场地 sql
toMqSqls.add(SqlMapping.get("merchant_fields.update_claim_status")); toMqSqls.add(SqlMapping.get("merchant_fields.update_claim_status_and_uid"));
fieldUpdateObjs.add(new Object[]{ fieldUpdateObjs.add(new Object[]{
fieldsVo.getClaimStatus(), fieldsVo.getUpdatedAt(), fieldsVo.getFieldId() fieldsVo.getClaimStatus(), fieldsVo.getUid(), fieldsVo.getUpdatedAt(), fieldsVo.getFieldId()
}); });
} }
// 申请场地 sql // 申请场地 sql
......
# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------
merchant_fields.update_claim_status=UPDATE merchant_fields SET claim_status = ?, updated_at = ? WHERE field_id = ? merchant_fields.update_claim_status_and_uid=UPDATE merchant_fields SET claim_status = ?, updated_at = ? WHERE field_id = ?
merchant_fields.update_is_check=UPDATE merchant_fields SET is_check = ?, updated_at = ? WHERE field_id = ? merchant_fields.update_is_check=UPDATE merchant_fields SET is_check = ?, updated_at = ? WHERE field_id = ?
# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------
merchant_field_applies.insert=INSERT INTO merchant_field_applies (field_apply_id, apply_status, apply_type, reject, uid, field_id, name, logo, background, description, built_date, province_id, province_name, city_id, city_name, district_id, district_name, address, longitude, latitude, contact_name, contact_email, company_name, license_code, license_img, legal_name, legal_identity, legal_identity_obverse, legal_identity_reverse, created_at) VALUE (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) merchant_field_applies.insert=INSERT INTO merchant_field_applies (field_apply_id, apply_status, apply_type, reject, uid, field_id, name, logo, background, description, built_date, province_id, province_name, city_id, city_name, district_id, district_name, address, longitude, latitude, contact_name, contact_email, company_name, license_code, license_img, legal_name, legal_identity, legal_identity_obverse, legal_identity_reverse, created_at) VALUE (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
......
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