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

Commit 117bbd46 authored by Tice's avatar Tice

Merge branch 'dev_merchant_tice' into dev_merchant

parents 579050bc d64fc751
package com.liquidnet.service.merchant.constant; package com.liquidnet.service.merchant.constant;
public class MerchantPermissionConst { public class MerchantAuthorizationConst {
// 某演出通过审核后,分配演出权限,场地方审核演出为'待审核的演出'与'演出'不同 // 某演出通过审核后,分配演出权限,场地方审核演出为'待审核的演出'与'演出'不同
public enum PerformancePermission { public enum PerformancePermission {
READ("1", "查看详情"), READ("1", "查看详情"),
EDIT("2", "编辑提交"), EDIT("2", "编辑提交"),
ONOFF("3", "上下线"), LINE("3", "上下线"),
SALES("4", "销售统计"), SALES("4", "销售统计"),
CHECK("5", "验票"), CHECK("5", "验票"),
ACCREDIT("6", "授权"); ACCREDIT("6", "授权");
...@@ -27,4 +27,33 @@ public class MerchantPermissionConst { ...@@ -27,4 +27,33 @@ public class MerchantPermissionConst {
return name; return name;
} }
} }
public enum PerformanceRole {
CREATOR("CREATOR", "创建者", 4),
SPONSOR("SPONSOR", "主办方", 3),
FIELDER("FIELDER", "场地方", 2),
CHECKER("CHECKER", "验票员", 1);
private final String role;
private final String name;
private final Integer level;
PerformanceRole(String role, String name, Integer level) {
this.role = role;
this.name = name;
this.level = level;
}
public String getRole() {
return role;
}
public String getName() {
return name;
}
public Integer getLevel() {
return level;
}
}
} }
package com.liquidnet.service.merchant.service; 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.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;
...@@ -11,6 +9,7 @@ import java.util.List; ...@@ -11,6 +9,7 @@ import java.util.List;
public interface IMerchantFieldsService { public interface IMerchantFieldsService {
PagedResult<MerchantFieldsVo> search(String name, int page, int size); PagedResult<MerchantFieldsVo> search(String name, int page, int size);
MerchantFieldsVo fieldInfo(String uid, String fieldId);
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.base.PagedResult; import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.merchant.dto.param.MerchantSponsorApplyParam;
import com.liquidnet.service.merchant.dto.vo.MerchantSponsorAppliesVo;
import com.liquidnet.service.merchant.dto.vo.MerchantSponsorsVo; import com.liquidnet.service.merchant.dto.vo.MerchantSponsorsVo;
public interface IMerchantSponsorsService { public interface IMerchantSponsorsService {
PagedResult<MerchantSponsorsVo> search(String name, int page, int size); PagedResult<MerchantSponsorsVo> search(String name, int page, int size);
MerchantSponsorsVo sponsorInfo(String uid, String sponsorId);
} }
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head> <head>
<meta charset="UTF-8"> <th:block th:include="include :: header('场地审核详情')"/>
<title>Title</title> <style>
.field-detail-avatar{
width: 146px;
height: 146px;
}
.field-detail-avatar-certificates{
width: 300px;
height: 200px;
}
.form-btns{
padding-bottom: 20px;
}
.form-dis{
display: none;
}
</style>
</head> </head>
<body> <body class="white-bg">
<form class="form-horizontal m-t" id="signupForm">
<div class="form-group">
<label class="col-sm-2 control-label">zbu名称:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.name}"></div>
<label class="col-sm-2 control-label">场地logo:</label>
<div class="form-control-static">
<img class="field-detail-avatar" th:src="${fieldApplyInfo.logo}" alt="">
</div>
<label class="col-sm-2 control-label">场地背景图:</label>
<div class="form-control-static">
<img class="field-detail-avatar" th:src="${fieldApplyInfo.background}" alt="">
</div>
<label class="col-sm-2 control-label">场地创建时间:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.builtDate}"></div>
<label class="col-sm-2 control-label">地区:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.provinceName + fieldApplyInfo.cityName + fieldApplyInfo.districtName}"></div>
<label class="col-sm-2 control-label">坐标:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.longitude + ',' + fieldApplyInfo.latitude}"></div>
<label class="col-sm-2 control-label">地址详情:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.address}"></div>
<label class="col-sm-2 control-label">介绍:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.description}"></div>
<label class="col-sm-2 control-label">场地负责人姓名:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.contactName}"></div>
<label class="col-sm-2 control-label">联系方式:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.contactEmail}"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">企业名称:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.companyName}"></div>
<label class="col-sm-2 control-label">营业执照编号:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.licenseCode}"></div>
<label class="col-sm-2 control-label">营业执照:</label>
<div class="form-control-static" >
<img class="field-detail-avatar-certificates" th:src="${fieldApplyInfo.licenseImg}" alt="">
</div>
<label class="col-sm-2 control-label">法人代表名称:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.legalName}"></div>
<label class="col-sm-2 control-label">法人代表身份证号:</label>
<div class="form-control-static" th:text="${fieldApplyInfo.legalIdentity}"></div>
<label class="col-sm-2 control-label">法人证件正面照:</label>
<div class="form-control-static">
<img class="field-detail-avatar-certificates" th:src="${fieldApplyInfo.legalIdentityObverse}" alt="">
</div>
<label class="col-sm-2 control-label">法人证件反面照:</label>
<div class="form-control-static">
<img class="field-detail-avatar-certificates" th:src="${fieldApplyInfo.legalIdentityReverse}" alt="">
</div>
</div>
<div class="form-group form-btns" th:class="${fieldApplyInfo.applyStatus == 0? '' : 'form-dis'}">
<div class="col-sm-offset-2 col-sm-10">
<button type="button" class="btn btn-sm btn-primary" onclick="AdoptSubmit()">审核通过</button>&nbsp;
<a class="btn btn-sm btn-danger" href="#field-reject-form" data-toggle="modal">
驳 回
</a>
</div>
</div>
<div id="field-reject-form" class="modal fade" aria-hidden="true">
<div class="modal-dialog" style="width:33%;">
<div class="modal-content" style="padding:0 20px;">
<div class="modal-body">
<div class="row">
<div>
<h3 class="m-t-none m-b text-center">驳回原因</h3>
<div class="form-group">
<textarea id="fieldRejectText" rows="3" name="reason" placeholder="请输入驳回原因" class="form-control"></textarea>
</div>
<div class="text-center" style="margin-bottom: -15px;margin-top: 10px;">
<button class="btn btn-sm btn-primary m-t-n-xs" type="button" onclick="Reject()">
<strong>确认驳回</strong>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</body> </body>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "merchant/field/apply";
var fieldInfo = [[${fieldApplyInfo}]]
var param = {
fieldApplyId:fieldInfo.fieldApplyId
}
function AdoptSubmit () {
$.operate.post(prefix + "/approve", param, function (res) {
location.reload();
});
}
function Reject () {
param.reject = $('#fieldRejectText').val();
$.operate.post(prefix + "/reject", param, function (res) {
location.reload();
});
}
</script>
</html> </html>
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head> <head>
<meta charset="UTF-8"> <th:block th:include="include :: header('场地审核详情')"/>
<title>Title</title> <style>
.field-detail-avatar{
width: 146px;
height: 146px;
}
.field-detail-avatar-certificates{
width: 300px;
height: 200px;
}
.form-btns{
padding-bottom: 20px;
}
.form-dis{
display: none;
}
</style>
</head> </head>
<body> <body class="white-bg">
<form class="form-horizontal m-t" id="signupForm">
<div class="form-group">
<label class="col-sm-2 control-label">主办名称:</label>
<div class="form-control-static" th:text="${sponsorApplyInfo.name}"></div>
<label class="col-sm-2 control-label">主办logo:</label>
<div class="form-control-static">
<img class="field-detail-avatar" th:src="${sponsorApplyInfo.logo}" alt="">
</div>
<label class="col-sm-2 control-label">主办背景图:</label>
<div class="form-control-static">
<img class="field-detail-avatar" th:src="${sponsorApplyInfo.background}" alt="">
</div>
<label class="col-sm-2 control-label">介绍:</label>
<div class="form-control-static" th:text="${sponsorApplyInfo.description}"></div>
<label class="col-sm-2 control-label">姓名:</label>
<div class="form-control-static" th:text="${sponsorApplyInfo.contactName}"></div>
<label class="col-sm-2 control-label">身份证号:</label>
<div class="form-control-static" th:text="${sponsorApplyInfo.contactIdentity}"></div>
<label class="col-sm-2 control-label">证件正面照:</label>
<div class="form-control-static">
<img class="field-detail-avatar-certificates" th:src="${sponsorApplyInfo.contactIdentityObverse}" alt="">
</div>
<label class="col-sm-2 control-label">证件反面照:</label>
<div class="form-control-static">
<img class="field-detail-avatar-certificates" th:src="${sponsorApplyInfo.contactIdentityReverse}" alt="">
</div>
<label class="col-sm-2 control-label">联系方式:</label>
<div class="form-control-static" th:text="${sponsorApplyInfo.contactEmail}"></div>
</div>
<div class="form-group form-btns" th:class="${sponsorApplyInfo.applyStatus == 0? '' : 'form-dis'}">
<div class="col-sm-offset-2 col-sm-10">
<button type="button" class="btn btn-sm btn-primary" onclick="AdoptSubmit()">审核通过</button>&nbsp;
<a class="btn btn-sm btn-danger" href="#sponsor-reject-form" data-toggle="modal">
驳 回
</a>
</div>
</div>
<div id="sponsor-reject-form" class="modal fade" aria-hidden="true">
<div class="modal-dialog" style="width:33%;">
<div class="modal-content" style="padding:0 20px;">
<div class="modal-body">
<div class="row">
<div>
<h3 class="m-t-none m-b text-center">驳回原因</h3>
<div class="form-group">
<textarea id="sponsorRejectText" rows="3" name="reason" placeholder="请输入驳回原因" class="form-control"></textarea>
</div>
<div class="text-center" style="margin-bottom: -15px;margin-top: 10px;">
<button class="btn btn-sm btn-primary m-t-n-xs" type="button" onclick="Reject()">
<strong>确认驳回</strong>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</body> </body>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "merchant/sponsor/apply";
var sponsorInfo = [[${sponsorApplyInfo}]]
var param = {
sponsorApplyId:sponsorInfo.sponsorApplyId
}
function AdoptSubmit () {
$.operate.post(prefix + "/approve", param, function (res) {
location.reload();
});
}
function Reject () {
param.reject = $('#sponsorRejectText').val();
$.operate.post(prefix + "/reject", param, function (res) {
location.reload();
});
}
</script>
</html> </html>
\ No newline at end of file
...@@ -10,7 +10,7 @@ import com.liquidnet.client.admin.zhengzai.merchant.utils.MerchantRedisUtil; ...@@ -10,7 +10,7 @@ import com.liquidnet.client.admin.zhengzai.merchant.utils.MerchantRedisUtil;
import com.liquidnet.common.exception.LiquidnetServiceException; import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.merchant.constant.MerchantPermissionConst; import com.liquidnet.service.merchant.constant.MerchantAuthorizationConst;
import com.liquidnet.service.merchant.dto.vo.*; import com.liquidnet.service.merchant.dto.vo.*;
import com.liquidnet.service.merchant.entity.*; import com.liquidnet.service.merchant.entity.*;
import com.liquidnet.service.merchant.mapper.MerchantAuthorizationRecordsMapper; import com.liquidnet.service.merchant.mapper.MerchantAuthorizationRecordsMapper;
...@@ -71,7 +71,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -71,7 +71,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
// 查询已有权限 // 查询已有权限
LambdaQueryWrapper<MerchantAuthorizationRecords> authorizationRecordsLambdaQueryWrapper = Wrappers.lambdaQuery(MerchantAuthorizationRecords.class); LambdaQueryWrapper<MerchantAuthorizationRecords> authorizationRecordsLambdaQueryWrapper = Wrappers.lambdaQuery(MerchantAuthorizationRecords.class);
authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getPerformanceId, performanceId); authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getPerformanceId, performanceId);
authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getUidRole, "creator"); authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getUidRole, MerchantAuthorizationConst.PerformanceRole.CREATOR.getRole());
authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getDeletedAt, null); authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getDeletedAt, null);
MerchantAuthorizationRecords authorizationRecords = getOne(authorizationRecordsLambdaQueryWrapper); MerchantAuthorizationRecords authorizationRecords = getOne(authorizationRecordsLambdaQueryWrapper);
...@@ -97,7 +97,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -97,7 +97,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
MerchantAuthorizationRecords creatorAuthorizationRecords = new MerchantAuthorizationRecords(); MerchantAuthorizationRecords creatorAuthorizationRecords = new MerchantAuthorizationRecords();
creatorAuthorizationRecords.setAuthorizationRecordId(IDGenerator.nextSnowId()); creatorAuthorizationRecords.setAuthorizationRecordId(IDGenerator.nextSnowId());
creatorAuthorizationRecords.setPerformanceId(performanceId); creatorAuthorizationRecords.setPerformanceId(performanceId);
creatorAuthorizationRecords.setUidRole("creator"); creatorAuthorizationRecords.setUidRole(MerchantAuthorizationConst.PerformanceRole.CREATOR.getRole());
creatorAuthorizationRecords.setUid(cuid); creatorAuthorizationRecords.setUid(cuid);
creatorAuthorizationRecords.setMobile(""); creatorAuthorizationRecords.setMobile("");
creatorAuthorizationRecords.setName(""); creatorAuthorizationRecords.setName("");
...@@ -109,12 +109,12 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -109,12 +109,12 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
// 授权权限 // 授权权限
ArrayList<MerchantAuthorizationPermissionsVo> creatorAuthorizationPermissionsVos = new ArrayList<>(); ArrayList<MerchantAuthorizationPermissionsVo> creatorAuthorizationPermissionsVos = new ArrayList<>();
String[] fielderPermissionIds = { String[] fielderPermissionIds = {
MerchantPermissionConst.PerformancePermission.READ.getId(), MerchantAuthorizationConst.PerformancePermission.READ.getId(),
MerchantPermissionConst.PerformancePermission.EDIT.getId(), MerchantAuthorizationConst.PerformancePermission.EDIT.getId(),
MerchantPermissionConst.PerformancePermission.ONOFF.getId(), MerchantAuthorizationConst.PerformancePermission.LINE.getId(),
MerchantPermissionConst.PerformancePermission.CHECK.getId(), MerchantAuthorizationConst.PerformancePermission.CHECK.getId(),
MerchantPermissionConst.PerformancePermission.SALES.getId(), MerchantAuthorizationConst.PerformancePermission.SALES.getId(),
MerchantPermissionConst.PerformancePermission.ACCREDIT.getId() MerchantAuthorizationConst.PerformancePermission.ACCREDIT.getId()
}; };
for (String permissionId : fielderPermissionIds) { for (String permissionId : fielderPermissionIds) {
// entity // entity
...@@ -160,7 +160,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -160,7 +160,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
// 查询已有权限 // 查询已有权限
LambdaQueryWrapper<MerchantAuthorizationRecords> authorizationRecordsLambdaQueryWrapper = Wrappers.lambdaQuery(MerchantAuthorizationRecords.class); LambdaQueryWrapper<MerchantAuthorizationRecords> authorizationRecordsLambdaQueryWrapper = Wrappers.lambdaQuery(MerchantAuthorizationRecords.class);
authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getPerformanceId, performanceId); authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getPerformanceId, performanceId);
authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getUidRole, "fielder"); authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getUidRole, MerchantAuthorizationConst.PerformanceRole.FIELDER.getRole());
authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getDeletedAt, null); authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getDeletedAt, null);
MerchantAuthorizationRecords authorizationRecords = getOne(authorizationRecordsLambdaQueryWrapper); MerchantAuthorizationRecords authorizationRecords = getOne(authorizationRecordsLambdaQueryWrapper);
...@@ -189,7 +189,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -189,7 +189,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
.eq(MerchantAuthorizationRecords::getAuthorizationRecordId, authorizationRecords.getAuthorizationRecordId()) .eq(MerchantAuthorizationRecords::getAuthorizationRecordId, authorizationRecords.getAuthorizationRecordId())
.or(wrapper1 -> wrapper1 .or(wrapper1 -> wrapper1
.eq(MerchantAuthorizationRecords::getCuid, authorizationRecords.getUid()) .eq(MerchantAuthorizationRecords::getCuid, authorizationRecords.getUid())
.eq(MerchantAuthorizationRecords::getCuidRole, "fielder")) .eq(MerchantAuthorizationRecords::getCuidRole, MerchantAuthorizationConst.PerformanceRole.FIELDER.getRole()))
); );
authorizationRecordsLambdaUpdateWrapper.set(MerchantAuthorizationRecords::getUpdatedAt, authorizationRecords.getUpdatedAt()); authorizationRecordsLambdaUpdateWrapper.set(MerchantAuthorizationRecords::getUpdatedAt, authorizationRecords.getUpdatedAt());
authorizationRecordsLambdaUpdateWrapper.set(MerchantAuthorizationRecords::getDeletedAt, authorizationRecords.getDeletedAt()); authorizationRecordsLambdaUpdateWrapper.set(MerchantAuthorizationRecords::getDeletedAt, authorizationRecords.getDeletedAt());
...@@ -203,7 +203,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -203,7 +203,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
Criteria criteria = Criteria.where("performanceId").is(performanceId).and("deletedAt").is(null); Criteria criteria = Criteria.where("performanceId").is(performanceId).and("deletedAt").is(null);
criteria.orOperator( criteria.orOperator(
Criteria.where("authorizationRecordId").is(authorizationRecords.getAuthorizationRecordId()), Criteria.where("authorizationRecordId").is(authorizationRecords.getAuthorizationRecordId()),
Criteria.where("cuid").is(authorizationRecords.getUid()).and("cuidRole").is("fielder") Criteria.where("cuid").is(authorizationRecords.getUid()).and("cuidRole").is(MerchantAuthorizationConst.PerformanceRole.FIELDER.getRole())
); );
Query query = Query.query(criteria); Query query = Query.query(criteria);
mongoTemplate.remove(query, MerchantAuthorizationRecordsVo.class, MerchantAuthorizationRecordsVo.class.getSimpleName()); mongoTemplate.remove(query, MerchantAuthorizationRecordsVo.class, MerchantAuthorizationRecordsVo.class.getSimpleName());
...@@ -221,7 +221,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -221,7 +221,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
MerchantAuthorizationRecords fielderAuthorizationRecords = new MerchantAuthorizationRecords(); MerchantAuthorizationRecords fielderAuthorizationRecords = new MerchantAuthorizationRecords();
fielderAuthorizationRecords.setAuthorizationRecordId(IDGenerator.nextSnowId()); fielderAuthorizationRecords.setAuthorizationRecordId(IDGenerator.nextSnowId());
fielderAuthorizationRecords.setPerformanceId(performanceId); fielderAuthorizationRecords.setPerformanceId(performanceId);
fielderAuthorizationRecords.setUidRole("fielder"); fielderAuthorizationRecords.setUidRole(MerchantAuthorizationConst.PerformanceRole.FIELDER.getRole());
fielderAuthorizationRecords.setUid(fields.getUid()); fielderAuthorizationRecords.setUid(fields.getUid());
fielderAuthorizationRecords.setMobile(""); fielderAuthorizationRecords.setMobile("");
fielderAuthorizationRecords.setName(""); fielderAuthorizationRecords.setName("");
...@@ -232,9 +232,9 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -232,9 +232,9 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
// 授权权限 entity vo // 授权权限 entity vo
ArrayList<MerchantAuthorizationPermissionsVo> fielderAuthorizationPermissionsVos = new ArrayList<>(); ArrayList<MerchantAuthorizationPermissionsVo> fielderAuthorizationPermissionsVos = new ArrayList<>();
String[] fielderPermissionIds = { String[] fielderPermissionIds = {
MerchantPermissionConst.PerformancePermission.READ.getId(), MerchantAuthorizationConst.PerformancePermission.READ.getId(),
MerchantPermissionConst.PerformancePermission.CHECK.getId(), MerchantAuthorizationConst.PerformancePermission.CHECK.getId(),
MerchantPermissionConst.PerformancePermission.ACCREDIT.getId() MerchantAuthorizationConst.PerformancePermission.ACCREDIT.getId()
}; };
for (String permissionId : fielderPermissionIds) { for (String permissionId : fielderPermissionIds) {
MerchantAuthorizationPermissions fielderAuthorizationPermissions = new MerchantAuthorizationPermissions(); MerchantAuthorizationPermissions fielderAuthorizationPermissions = new MerchantAuthorizationPermissions();
...@@ -264,19 +264,19 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -264,19 +264,19 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
if (!CollectionUtil.isEmpty(fieldCheckersList)) { if (!CollectionUtil.isEmpty(fieldCheckersList)) {
// 验票员 授权权限 // 验票员 授权权限
String[] checkerPermissionIds = { String[] checkerPermissionIds = {
MerchantPermissionConst.PerformancePermission.CHECK.getId() MerchantAuthorizationConst.PerformancePermission.CHECK.getId()
}; };
for (MerchantFieldCheckers fieldCheckers: fieldCheckersList) { for (MerchantFieldCheckers fieldCheckers: fieldCheckersList) {
// 验票员 授权记录 entity // 验票员 授权记录 entity
MerchantAuthorizationRecords checkerAuthorizationRecords = new MerchantAuthorizationRecords(); MerchantAuthorizationRecords checkerAuthorizationRecords = new MerchantAuthorizationRecords();
checkerAuthorizationRecords.setAuthorizationRecordId(IDGenerator.nextSnowId()); checkerAuthorizationRecords.setAuthorizationRecordId(IDGenerator.nextSnowId());
checkerAuthorizationRecords.setPerformanceId(performanceId); checkerAuthorizationRecords.setPerformanceId(performanceId);
checkerAuthorizationRecords.setUidRole("checker"); checkerAuthorizationRecords.setUidRole(MerchantAuthorizationConst.PerformanceRole.CHECKER.getRole());
checkerAuthorizationRecords.setUid(fieldCheckers.getUid()); checkerAuthorizationRecords.setUid(fieldCheckers.getUid());
checkerAuthorizationRecords.setMobile(fieldCheckers.getMobile()); checkerAuthorizationRecords.setMobile(fieldCheckers.getMobile());
checkerAuthorizationRecords.setName(fieldCheckers.getName()); checkerAuthorizationRecords.setName(fieldCheckers.getName());
checkerAuthorizationRecords.setCuid(fields.getUid()); checkerAuthorizationRecords.setCuid(fields.getUid());
checkerAuthorizationRecords.setCuidRole("fielder"); checkerAuthorizationRecords.setCuidRole(MerchantAuthorizationConst.PerformanceRole.FIELDER.getRole());
checkerAuthorizationRecords.setCreatedAt(now); checkerAuthorizationRecords.setCreatedAt(now);
authorizationRecordsArrayList.add(checkerAuthorizationRecords); authorizationRecordsArrayList.add(checkerAuthorizationRecords);
...@@ -331,7 +331,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -331,7 +331,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
// 查询已有权限 // 查询已有权限
LambdaQueryWrapper<MerchantAuthorizationRecords> authorizationRecordsLambdaQueryWrapper = Wrappers.lambdaQuery(MerchantAuthorizationRecords.class); LambdaQueryWrapper<MerchantAuthorizationRecords> authorizationRecordsLambdaQueryWrapper = Wrappers.lambdaQuery(MerchantAuthorizationRecords.class);
authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getPerformanceId, performanceId); authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getPerformanceId, performanceId);
authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getUidRole, "sponsor"); authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getUidRole, MerchantAuthorizationConst.PerformanceRole.SPONSOR.getRole());
authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getDeletedAt, null); authorizationRecordsLambdaQueryWrapper.eq(MerchantAuthorizationRecords::getDeletedAt, null);
MerchantAuthorizationRecords authorizationRecords = getOne(authorizationRecordsLambdaQueryWrapper); MerchantAuthorizationRecords authorizationRecords = getOne(authorizationRecordsLambdaQueryWrapper);
...@@ -360,7 +360,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -360,7 +360,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
.eq(MerchantAuthorizationRecords::getAuthorizationRecordId, authorizationRecords.getAuthorizationRecordId()) .eq(MerchantAuthorizationRecords::getAuthorizationRecordId, authorizationRecords.getAuthorizationRecordId())
.or(wrapper1 -> wrapper1 .or(wrapper1 -> wrapper1
.eq(MerchantAuthorizationRecords::getCuid, authorizationRecords.getUid()) .eq(MerchantAuthorizationRecords::getCuid, authorizationRecords.getUid())
.eq(MerchantAuthorizationRecords::getCuidRole, "sponsor")) .eq(MerchantAuthorizationRecords::getCuidRole, MerchantAuthorizationConst.PerformanceRole.SPONSOR.getRole()))
); );
authorizationRecordsLambdaUpdateWrapper.set(MerchantAuthorizationRecords::getUpdatedAt, authorizationRecords.getUpdatedAt()); authorizationRecordsLambdaUpdateWrapper.set(MerchantAuthorizationRecords::getUpdatedAt, authorizationRecords.getUpdatedAt());
authorizationRecordsLambdaUpdateWrapper.set(MerchantAuthorizationRecords::getDeletedAt, authorizationRecords.getDeletedAt()); authorizationRecordsLambdaUpdateWrapper.set(MerchantAuthorizationRecords::getDeletedAt, authorizationRecords.getDeletedAt());
...@@ -374,7 +374,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -374,7 +374,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
Criteria criteria = Criteria.where("performanceId").is(performanceId).and("deletedAt").is(null); Criteria criteria = Criteria.where("performanceId").is(performanceId).and("deletedAt").is(null);
criteria.orOperator( criteria.orOperator(
Criteria.where("authorizationRecordId").is(authorizationRecords.getAuthorizationRecordId()), Criteria.where("authorizationRecordId").is(authorizationRecords.getAuthorizationRecordId()),
Criteria.where("cuid").is(authorizationRecords.getUid()).and("cuidRole").is("sponsor") Criteria.where("cuid").is(authorizationRecords.getUid()).and("cuidRole").is(MerchantAuthorizationConst.PerformanceRole.SPONSOR.getRole())
); );
Query query = Query.query(criteria); Query query = Query.query(criteria);
mongoTemplate.remove(query, MerchantAuthorizationRecordsVo.class, MerchantAuthorizationRecordsVo.class.getSimpleName()); mongoTemplate.remove(query, MerchantAuthorizationRecordsVo.class, MerchantAuthorizationRecordsVo.class.getSimpleName());
...@@ -390,7 +390,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -390,7 +390,7 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
MerchantAuthorizationRecords sponsorAuthorizationRecords = new MerchantAuthorizationRecords(); MerchantAuthorizationRecords sponsorAuthorizationRecords = new MerchantAuthorizationRecords();
sponsorAuthorizationRecords.setAuthorizationRecordId(IDGenerator.nextSnowId()); sponsorAuthorizationRecords.setAuthorizationRecordId(IDGenerator.nextSnowId());
sponsorAuthorizationRecords.setPerformanceId(performanceId); sponsorAuthorizationRecords.setPerformanceId(performanceId);
sponsorAuthorizationRecords.setUidRole("sponsor"); sponsorAuthorizationRecords.setUidRole(MerchantAuthorizationConst.PerformanceRole.SPONSOR.getRole());
sponsorAuthorizationRecords.setUid(sponsors.getUid()); sponsorAuthorizationRecords.setUid(sponsors.getUid());
sponsorAuthorizationRecords.setMobile(""); sponsorAuthorizationRecords.setMobile("");
sponsorAuthorizationRecords.setName(""); sponsorAuthorizationRecords.setName("");
...@@ -401,10 +401,10 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me ...@@ -401,10 +401,10 @@ public class MerchantAuthorizationRecordsAdminServiceImpl extends ServiceImpl<Me
// 授权权限 entity vo // 授权权限 entity vo
ArrayList<MerchantAuthorizationPermissionsVo> sponsorAuthorizationPermissionsVos = new ArrayList<>(); ArrayList<MerchantAuthorizationPermissionsVo> sponsorAuthorizationPermissionsVos = new ArrayList<>();
String[] fielderPermissionIds = { String[] fielderPermissionIds = {
MerchantPermissionConst.PerformancePermission.READ.getId(), MerchantAuthorizationConst.PerformancePermission.READ.getId(),
MerchantPermissionConst.PerformancePermission.CHECK.getId(), MerchantAuthorizationConst.PerformancePermission.CHECK.getId(),
MerchantPermissionConst.PerformancePermission.SALES.getId(), MerchantAuthorizationConst.PerformancePermission.SALES.getId(),
MerchantPermissionConst.PerformancePermission.ACCREDIT.getId() MerchantAuthorizationConst.PerformancePermission.ACCREDIT.getId()
}; };
for (String permissionId : fielderPermissionIds) { for (String permissionId : fielderPermissionIds) {
MerchantAuthorizationPermissions sponsorAuthorizationPermissions = new MerchantAuthorizationPermissions(); MerchantAuthorizationPermissions sponsorAuthorizationPermissions = new MerchantAuthorizationPermissions();
......
package com.liquidnet.client.admin.zhengzai.merchant.utils; package com.liquidnet.client.admin.zhengzai.merchant.utils;
import com.liquidnet.service.merchant.constant.MerchantAuthorizationConst;
import com.liquidnet.service.merchant.dto.vo.*; import com.liquidnet.service.merchant.dto.vo.*;
import org.bson.Document; import org.bson.Document;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -52,6 +53,6 @@ public class MerchantMongoUtil { ...@@ -52,6 +53,6 @@ public class MerchantMongoUtil {
} }
public List<MerchantAuthorizationRecordsVo> getCheckersAuthorizationRecordsVosByCuid(String cuid, String performanceId) { public List<MerchantAuthorizationRecordsVo> getCheckersAuthorizationRecordsVosByCuid(String cuid, String performanceId) {
return mongoTemplate.find(Query.query(Criteria.where("uidRole").is("checker").and("cuid").is(cuid).and("performanceId").is(performanceId).and("deletedAt").is(null)), MerchantAuthorizationRecordsVo.class, MerchantAuthorizationRecordsVo.class.getSimpleName()); return mongoTemplate.find(Query.query(Criteria.where("uidRole").is(MerchantAuthorizationConst.PerformanceRole.CHECKER.getRole()).and("cuid").is(cuid).and("performanceId").is(performanceId).and("deletedAt").is(null)), MerchantAuthorizationRecordsVo.class, MerchantAuthorizationRecordsVo.class.getSimpleName());
} }
} }
...@@ -70,7 +70,7 @@ create table merchant_field_applies ...@@ -70,7 +70,7 @@ create table merchant_field_applies
apply_type varchar(255) default '' not null comment '类型 claim认领、create创建', apply_type varchar(255) default '' not null comment '类型 claim认领、create创建',
reject varchar(255) default '' not null comment '驳回原因', reject varchar(255) default '' not null comment '驳回原因',
uid varchar(64) default '' not null comment '申请者账号', uid varchar(64) default '' not null comment '申请者账号',
field_id varchar(64) default '' not null comment '认领的或创建的场地ID', field_id varchar(64) default '' not null comment '认领的或创建的场地ID',
name varchar(255) default '' not null comment '名称', name varchar(255) default '' not null comment '名称',
logo varchar(255) default '' not null comment 'logo图片地址', logo varchar(255) default '' not null comment 'logo图片地址',
background varchar(255) default '' not null comment '背景图片地址', background varchar(255) default '' not null comment '背景图片地址',
...@@ -144,7 +144,7 @@ create table merchant_sponsor_applies ...@@ -144,7 +144,7 @@ create table merchant_sponsor_applies
apply_type varchar(255) default '' not null comment '类型 create创建', apply_type varchar(255) default '' not null comment '类型 create创建',
reject varchar(255) default '' not null comment '驳回原因', reject varchar(255) default '' not null comment '驳回原因',
uid varchar(64) default '' not null comment '申请者账号', uid varchar(64) default '' not null comment '申请者账号',
sponsor_id varchar(64) default '' not null comment '要认领的或创建的主办ID', sponsor_id varchar(64) default '' not null comment '创建的主办ID',
name varchar(255) default '' not null comment '名称', name varchar(255) default '' not null comment '名称',
logo varchar(255) default '' not null comment 'logo图片地址', logo varchar(255) default '' not null comment 'logo图片地址',
background varchar(255) default '' not null comment '背景图片地址', background varchar(255) default '' not null comment '背景图片地址',
......
...@@ -81,8 +81,17 @@ public class MerchantFieldsController { ...@@ -81,8 +81,17 @@ public class MerchantFieldsController {
return ResponseDto.success(merchantFieldAppliesService.applyInfo(currentUid, fieldApplyId)); return ResponseDto.success(merchantFieldAppliesService.applyInfo(currentUid, fieldApplyId));
} }
@ApiOperationSupport(order = 20)
@ApiOperation(value = "场地详情")
@GetMapping("info")
public ResponseDto<MerchantFieldsVo> info(@RequestParam(required = true) String fieldId) {
String currentUid = CurrentUtil.getCurrentUid();
return ResponseDto.success(merchantFieldsService.fieldInfo(currentUid, fieldId));
}
@ApiOperationSupport(order = 21) @ApiOperationSupport(order = 21)
@ApiOperation(value = "更改场地是否审核演出") @ApiOperation(value = "场地更改是否审核演出")
@PostMapping("editIsCheck") @PostMapping("editIsCheck")
public ResponseDto<Object> editIsCheck(@RequestParam(required = true) String fieldId, public ResponseDto<Object> editIsCheck(@RequestParam(required = true) String fieldId,
@RequestParam(required = true) int isCheck){ @RequestParam(required = true) int isCheck){
...@@ -94,7 +103,7 @@ public class MerchantFieldsController { ...@@ -94,7 +103,7 @@ public class MerchantFieldsController {
} }
@ApiOperationSupport(order = 22) @ApiOperationSupport(order = 22)
@ApiOperation(value = "默认验票员列表") @ApiOperation(value = "场地默认验票员列表")
@GetMapping("checkers") @GetMapping("checkers")
public ResponseDto<List<MerchantFieldCheckersVo>> checkers(@RequestParam(required = true) String fieldId) { public ResponseDto<List<MerchantFieldCheckersVo>> checkers(@RequestParam(required = true) String fieldId) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
...@@ -103,7 +112,7 @@ public class MerchantFieldsController { ...@@ -103,7 +112,7 @@ public class MerchantFieldsController {
} }
@ApiOperationSupport(order = 23) @ApiOperationSupport(order = 23)
@ApiOperation(value = "添加默认验票员") @ApiOperation(value = "场地添加默认验票员")
@PostMapping("checker/add") @PostMapping("checker/add")
public ResponseDto<Object> checkerAdd(@RequestParam(required = true) String fieldId, public ResponseDto<Object> checkerAdd(@RequestParam(required = true) String fieldId,
@RequestParam(required = true) String uid, @RequestParam(required = true) String uid,
...@@ -117,7 +126,7 @@ public class MerchantFieldsController { ...@@ -117,7 +126,7 @@ public class MerchantFieldsController {
} }
@ApiOperationSupport(order = 24) @ApiOperationSupport(order = 24)
@ApiOperation(value = "移除默认验票员") @ApiOperation(value = "场地移除默认验票员")
@PostMapping("checker/del") @PostMapping("checker/del")
public ResponseDto<Object> checkerDel(@RequestParam(required = true) String fieldId, public ResponseDto<Object> checkerDel(@RequestParam(required = true) String fieldId,
@RequestParam(required = true) String uid){ @RequestParam(required = true) String uid){
......
...@@ -78,4 +78,13 @@ public class MerchantSponsorsController { ...@@ -78,4 +78,13 @@ public class MerchantSponsorsController {
return ResponseDto.success(merchantSponsorAppliesService.applyInfo(currentUid, sponsorApplyId)); return ResponseDto.success(merchantSponsorAppliesService.applyInfo(currentUid, sponsorApplyId));
} }
@ApiOperationSupport(order = 20)
@ApiOperation(value = "主办详情")
@GetMapping("info")
public ResponseDto<MerchantSponsorsVo> info(@RequestParam(required = true) String sponsorId) {
String currentUid = CurrentUtil.getCurrentUid();
return ResponseDto.success(merchantSponsorsService.sponsorInfo(currentUid, sponsorId));
}
} }
package com.liquidnet.service.merchant.service; package com.liquidnet.service.merchant.service;
import com.liquidnet.service.merchant.constant.MerchantAuthorizationConst;
import com.liquidnet.service.merchant.dto.vo.*; import com.liquidnet.service.merchant.dto.vo.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
...@@ -30,7 +31,11 @@ public class MerchantMongoService { ...@@ -30,7 +31,11 @@ public class MerchantMongoService {
return mongoTemplate.find(Query.query(Criteria.where("uid").is(uid).and("deletedAt").is(null)), MerchantSponsorAppliesVo.class, MerchantSponsorAppliesVo.class.getSimpleName()); return mongoTemplate.find(Query.query(Criteria.where("uid").is(uid).and("deletedAt").is(null)), MerchantSponsorAppliesVo.class, MerchantSponsorAppliesVo.class.getSimpleName());
} }
public List<MerchantAuthorizationRecordsVo> getAuthorizationRecordsVosByUid(String uid, String performanceId) {
return mongoTemplate.find(Query.query(Criteria.where("uid").is(uid).and("performanceId").is(performanceId).and("deletedAt").is(null)), MerchantAuthorizationRecordsVo.class, MerchantAuthorizationRecordsVo.class.getSimpleName());
}
public List<MerchantAuthorizationRecordsVo> getCheckersAuthorizationRecordsVosByCuid(String cuid, String performanceId) { public List<MerchantAuthorizationRecordsVo> getCheckersAuthorizationRecordsVosByCuid(String cuid, String performanceId) {
return mongoTemplate.find(Query.query(Criteria.where("uidRole").is("checker").and("cuid").is(cuid).and("performanceId").is(performanceId).and("deletedAt").is(null)), MerchantAuthorizationRecordsVo.class, MerchantAuthorizationRecordsVo.class.getSimpleName()); return mongoTemplate.find(Query.query(Criteria.where("uidRole").is(MerchantAuthorizationConst.PerformanceRole.CHECKER.getRole()).and("cuid").is(cuid).and("performanceId").is(performanceId).and("deletedAt").is(null)), MerchantAuthorizationRecordsVo.class, MerchantAuthorizationRecordsVo.class.getSimpleName());
} }
} }
package com.liquidnet.service.merchant.service.impl; package com.liquidnet.service.merchant.service.impl;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.merchant.constant.MerchantPermissionConst; import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.merchant.constant.MerchantAuthorizationConst;
import com.liquidnet.service.merchant.dto.vo.MerchantAuthorizationPermissionsVo; import com.liquidnet.service.merchant.dto.vo.MerchantAuthorizationPermissionsVo;
import com.liquidnet.service.merchant.dto.vo.MerchantAuthorizationRecordsVo; import com.liquidnet.service.merchant.dto.vo.MerchantAuthorizationRecordsVo;
import com.liquidnet.service.merchant.service.IMerchantAuthorizationRecordsService; import com.liquidnet.service.merchant.service.IMerchantAuthorizationRecordsService;
...@@ -25,20 +28,32 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori ...@@ -25,20 +28,32 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori
public void performanceCheckerAdd(String cuid, String performanceId, String uid, String mobile, String name, boolean statistics) { public void performanceCheckerAdd(String cuid, String performanceId, String uid, String mobile, String name, boolean statistics) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
MerchantAuthorizationConst.PerformanceRole maxPerformanceRole = this.getMaxPerformanceRole(cuid, performanceId);
if (null == maxPerformanceRole || maxPerformanceRole.getLevel() <= MerchantAuthorizationConst.PerformanceRole.CHECKER.getLevel()) {
// 无授权权限
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13301");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
if (statistics && maxPerformanceRole.getLevel() <= MerchantAuthorizationConst.PerformanceRole.FIELDER.getLevel()) {
// 无权限授于统计权限
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13302");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
MerchantAuthorizationRecordsVo checkerAuthorizationRecordsVo = MerchantAuthorizationRecordsVo.getNew(); MerchantAuthorizationRecordsVo checkerAuthorizationRecordsVo = MerchantAuthorizationRecordsVo.getNew();
checkerAuthorizationRecordsVo.setAuthorizationRecordId(IDGenerator.nextSnowId()); checkerAuthorizationRecordsVo.setAuthorizationRecordId(IDGenerator.nextSnowId());
checkerAuthorizationRecordsVo.setPerformanceId(performanceId); checkerAuthorizationRecordsVo.setPerformanceId(performanceId);
checkerAuthorizationRecordsVo.setUidRole("checker"); checkerAuthorizationRecordsVo.setUidRole(MerchantAuthorizationConst.PerformanceRole.CHECKER.getRole());
checkerAuthorizationRecordsVo.setUid(uid); checkerAuthorizationRecordsVo.setUid(uid);
checkerAuthorizationRecordsVo.setMobile(mobile); checkerAuthorizationRecordsVo.setMobile(mobile);
checkerAuthorizationRecordsVo.setName(name); checkerAuthorizationRecordsVo.setName(name);
checkerAuthorizationRecordsVo.setCuid("cuid"); checkerAuthorizationRecordsVo.setCuid("cuid");
// checkerAuthorizationRecordsVo.setCuidRole("fielder"); checkerAuthorizationRecordsVo.setCuidRole(maxPerformanceRole.getRole());
checkerAuthorizationRecordsVo.setCreatedAt(now); checkerAuthorizationRecordsVo.setCreatedAt(now);
// 验票员 授权权限 // 验票员 授权权限
String[] checkerPermissionIds = { String[] checkerPermissionIds = {
MerchantPermissionConst.PerformancePermission.CHECK.getId() MerchantAuthorizationConst.PerformancePermission.CHECK.getId()
}; };
// 验票员 授权权限 entity vo // 验票员 授权权限 entity vo
ArrayList<MerchantAuthorizationPermissionsVo> checkerAuthorizationPermissionsVos = new ArrayList<>(); ArrayList<MerchantAuthorizationPermissionsVo> checkerAuthorizationPermissionsVos = new ArrayList<>();
...@@ -54,6 +69,8 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori ...@@ -54,6 +69,8 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori
checkerAuthorizationPermissionsVos.add(checkerAuthorizationPermissionsVo); checkerAuthorizationPermissionsVos.add(checkerAuthorizationPermissionsVo);
} }
checkerAuthorizationRecordsVo.setPermissionsVos(checkerAuthorizationPermissionsVos); checkerAuthorizationRecordsVo.setPermissionsVos(checkerAuthorizationPermissionsVos);
} }
@Override @Override
...@@ -66,4 +83,22 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori ...@@ -66,4 +83,22 @@ public class MerchantAuthorizationRecordsServiceImpl implements IMerchantAuthori
List<MerchantAuthorizationRecordsVo> authorizationRecordsVos = merchantMongoService.getCheckersAuthorizationRecordsVosByCuid(cuid, performanceId); List<MerchantAuthorizationRecordsVo> authorizationRecordsVos = merchantMongoService.getCheckersAuthorizationRecordsVosByCuid(cuid, performanceId);
return authorizationRecordsVos; return authorizationRecordsVos;
} }
private MerchantAuthorizationConst.PerformanceRole getMaxPerformanceRole(String uid, String performanceId) {
List<MerchantAuthorizationRecordsVo> authorizationRecordsVos = merchantMongoService.getAuthorizationRecordsVosByUid(uid, performanceId);
if (!CollectionUtil.isEmpty(authorizationRecordsVos)) {
return null;
}
MerchantAuthorizationConst.PerformanceRole maxRole = MerchantAuthorizationConst.PerformanceRole.valueOf(authorizationRecordsVos.get(0).getUidRole());
for (MerchantAuthorizationRecordsVo authorizationRecordsVo : authorizationRecordsVos) {
MerchantAuthorizationConst.PerformanceRole role = MerchantAuthorizationConst.PerformanceRole.valueOf(authorizationRecordsVo.getUidRole());
if (role.getLevel() > maxRole.getLevel()) {
maxRole = role;
}
}
return maxRole;
}
} }
...@@ -67,7 +67,7 @@ public class MerchantFieldAppliesServiceImpl implements IMerchantFieldAppliesSer ...@@ -67,7 +67,7 @@ public class MerchantFieldAppliesServiceImpl implements IMerchantFieldAppliesSer
List<MerchantFieldAppliesVo> fieldAppliesVos = merchantRdmService.getFieldAppliesVosByUid(uid); List<MerchantFieldAppliesVo> fieldAppliesVos = merchantRdmService.getFieldAppliesVosByUid(uid);
if (!CollectionUtils.isEmpty(fieldAppliesVos)) { if (!CollectionUtils.isEmpty(fieldAppliesVos)) {
if (fieldAppliesVos.size() >= 10) { if (fieldAppliesVos.size() >= 10) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13103"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13111");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
} }
...@@ -166,7 +166,7 @@ public class MerchantFieldAppliesServiceImpl implements IMerchantFieldAppliesSer ...@@ -166,7 +166,7 @@ public class MerchantFieldAppliesServiceImpl implements IMerchantFieldAppliesSer
// 查找场地申请,是否存在且已经驳回 // 查找场地申请,是否存在且已经驳回
List<MerchantFieldAppliesVo> fieldAppliesVos = merchantRdmService.getFieldAppliesVosByUid(uid); List<MerchantFieldAppliesVo> fieldAppliesVos = merchantRdmService.getFieldAppliesVosByUid(uid);
if (CollectionUtils.isEmpty(fieldAppliesVos)) { if (CollectionUtils.isEmpty(fieldAppliesVos)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13104"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13112");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
int idx = IntStream.range(0, fieldAppliesVos.size()) int idx = IntStream.range(0, fieldAppliesVos.size())
...@@ -174,12 +174,12 @@ public class MerchantFieldAppliesServiceImpl implements IMerchantFieldAppliesSer ...@@ -174,12 +174,12 @@ public class MerchantFieldAppliesServiceImpl implements IMerchantFieldAppliesSer
.findFirst() .findFirst()
.orElse(-1); .orElse(-1);
if (idx < 0) { if (idx < 0) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13104"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13112");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
MerchantFieldAppliesVo fieldAppliesVo = fieldAppliesVos.get(idx); MerchantFieldAppliesVo fieldAppliesVo = fieldAppliesVos.get(idx);
if (fieldAppliesVo.getApplyStatus() != 2) { if (fieldAppliesVo.getApplyStatus() != 2) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13105"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13113");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
...@@ -221,7 +221,7 @@ public class MerchantFieldAppliesServiceImpl implements IMerchantFieldAppliesSer ...@@ -221,7 +221,7 @@ public class MerchantFieldAppliesServiceImpl implements IMerchantFieldAppliesSer
// 查找场地申请,是否存在 // 查找场地申请,是否存在
List<MerchantFieldAppliesVo> fieldAppliesVos = merchantRdmService.getFieldAppliesVosByUid(uid); List<MerchantFieldAppliesVo> fieldAppliesVos = merchantRdmService.getFieldAppliesVosByUid(uid);
if (CollectionUtils.isEmpty(fieldAppliesVos)) { if (CollectionUtils.isEmpty(fieldAppliesVos)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13104"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13112");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
int idx = IntStream.range(0, fieldAppliesVos.size()) int idx = IntStream.range(0, fieldAppliesVos.size())
...@@ -229,7 +229,7 @@ public class MerchantFieldAppliesServiceImpl implements IMerchantFieldAppliesSer ...@@ -229,7 +229,7 @@ public class MerchantFieldAppliesServiceImpl implements IMerchantFieldAppliesSer
.findFirst() .findFirst()
.orElse(-1); .orElse(-1);
if (idx < 0) { if (idx < 0) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13104"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13112");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
......
...@@ -72,6 +72,14 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -72,6 +72,14 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
return pagedResult; return pagedResult;
} }
@Override
public MerchantFieldsVo fieldInfo(String uid, String fieldId) {
// 当前用户是否管理该场地
MerchantFieldsVo fieldsVo = this.checkFieldAccount(uid, fieldId);
return fieldsVo;
}
@Override @Override
public void editIsCheck(String uid, String fieldId, int isCheck) { public void editIsCheck(String uid, String fieldId, int isCheck) {
// 当前用户是否管理该场地 // 当前用户是否管理该场地
...@@ -132,7 +140,7 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -132,7 +140,7 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
if (!CollectionUtils.isEmpty(fieldCheckersVos)) { if (!CollectionUtils.isEmpty(fieldCheckersVos)) {
for (MerchantFieldCheckersVo vo : fieldCheckersVos) { for (MerchantFieldCheckersVo vo : fieldCheckersVos) {
if (vo.getUid().equals(uid)) { if (vo.getUid().equals(uid)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13111"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13103");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
} }
...@@ -179,7 +187,7 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -179,7 +187,7 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
// 查找场地默认验票员,是否已经添加 // 查找场地默认验票员,是否已经添加
List<MerchantFieldCheckersVo> fieldCheckersVos = merchantRdmService.getFieldCheckersVosByFieldId(fieldId); List<MerchantFieldCheckersVo> fieldCheckersVos = merchantRdmService.getFieldCheckersVosByFieldId(fieldId);
if (CollectionUtils.isEmpty(fieldCheckersVos)) { if (CollectionUtils.isEmpty(fieldCheckersVos)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13112"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13104");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
int idx = IntStream.range(0, fieldCheckersVos.size()) int idx = IntStream.range(0, fieldCheckersVos.size())
...@@ -187,7 +195,7 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -187,7 +195,7 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
.findFirst() .findFirst()
.orElse(-1); .orElse(-1);
if (idx < 0) { if (idx < 0) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13112"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13104");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
...@@ -223,7 +231,7 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService { ...@@ -223,7 +231,7 @@ public class MerchantFieldsServiceImpl implements IMerchantFieldsService {
private MerchantFieldsVo checkFieldAccount(String uid, String fieldId) { private MerchantFieldsVo checkFieldAccount(String uid, String fieldId) {
// 当前用户是否管理该场地 // 当前用户是否管理该场地
MerchantFieldsVo fieldsVo = merchantRdmService.getFieldsVoByFieldId(fieldId); MerchantFieldsVo fieldsVo = merchantRdmService.getFieldsVoByFieldId(fieldId);
if (null == fieldsVo || !fieldsVo.getUid().equals(uid)) { if (null == fieldsVo || !uid.equals(fieldsVo.getUid())) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13101"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13101");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
......
...@@ -48,7 +48,7 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie ...@@ -48,7 +48,7 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie
List<MerchantSponsorAppliesVo> sponsorAppliesVos = merchantRdmService.getSponsorAppliesVosByUid(uid); List<MerchantSponsorAppliesVo> sponsorAppliesVos = merchantRdmService.getSponsorAppliesVosByUid(uid);
if (!CollectionUtils.isEmpty(sponsorAppliesVos)) { if (!CollectionUtils.isEmpty(sponsorAppliesVos)) {
if (sponsorAppliesVos.size() >= 10) { if (sponsorAppliesVos.size() >= 10) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13201"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13211");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
} }
...@@ -80,7 +80,7 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie ...@@ -80,7 +80,7 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie
|| sponsorAppliesVo.getLegalIdentity().isEmpty() || sponsorAppliesVo.getLegalIdentity().isEmpty()
|| sponsorAppliesVo.getLegalIdentityObverse().isEmpty() || sponsorAppliesVo.getLegalIdentityObverse().isEmpty()
|| sponsorAppliesVo.getLegalIdentityReverse().isEmpty()) { || sponsorAppliesVo.getLegalIdentityReverse().isEmpty()) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13202"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13212");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
...@@ -139,7 +139,7 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie ...@@ -139,7 +139,7 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie
// 查找主办申请,是否存在且已经驳回 // 查找主办申请,是否存在且已经驳回
List<MerchantSponsorAppliesVo> sponsorAppliesVos = merchantRdmService.getSponsorAppliesVosByUid(uid); List<MerchantSponsorAppliesVo> sponsorAppliesVos = merchantRdmService.getSponsorAppliesVosByUid(uid);
if (CollectionUtils.isEmpty(sponsorAppliesVos)) { if (CollectionUtils.isEmpty(sponsorAppliesVos)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13203"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13213");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
int idx = IntStream.range(0, sponsorAppliesVos.size()) int idx = IntStream.range(0, sponsorAppliesVos.size())
...@@ -147,12 +147,12 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie ...@@ -147,12 +147,12 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie
.findFirst() .findFirst()
.orElse(-1); .orElse(-1);
if (idx < 0) { if (idx < 0) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13203"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13213");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
MerchantSponsorAppliesVo sponsorAppliesVo = sponsorAppliesVos.get(idx); MerchantSponsorAppliesVo sponsorAppliesVo = sponsorAppliesVos.get(idx);
if (sponsorAppliesVo.getApplyStatus() != 2) { if (sponsorAppliesVo.getApplyStatus() != 2) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13204"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13214");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
...@@ -194,7 +194,7 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie ...@@ -194,7 +194,7 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie
// 查找主办申请,是否存在 // 查找主办申请,是否存在
List<MerchantSponsorAppliesVo> sponsorAppliesVos = merchantRdmService.getSponsorAppliesVosByUid(uid); List<MerchantSponsorAppliesVo> sponsorAppliesVos = merchantRdmService.getSponsorAppliesVosByUid(uid);
if (CollectionUtils.isEmpty(sponsorAppliesVos)) { if (CollectionUtils.isEmpty(sponsorAppliesVos)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13203"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13213");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
int idx = IntStream.range(0, sponsorAppliesVos.size()) int idx = IntStream.range(0, sponsorAppliesVos.size())
...@@ -202,7 +202,7 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie ...@@ -202,7 +202,7 @@ public class MerchantSponsorAppliesServiceImpl implements IMerchantSponsorApplie
.findFirst() .findFirst()
.orElse(-1); .orElse(-1);
if (idx < 0) { if (idx < 0) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13203"); ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13213");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
} }
......
package com.liquidnet.service.merchant.service.impl; package com.liquidnet.service.merchant.service.impl;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.PagedResult; import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.merchant.dto.vo.MerchantSponsorsVo; import com.liquidnet.service.merchant.dto.vo.MerchantSponsorsVo;
import com.liquidnet.service.merchant.service.IMerchantSponsorsService; import com.liquidnet.service.merchant.service.IMerchantSponsorsService;
import com.liquidnet.service.merchant.service.MerchantRdmService;
import com.liquidnet.service.merchant.util.ObjectUtil; import com.liquidnet.service.merchant.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -23,6 +26,9 @@ public class MerchantSponsorsServiceImpl implements IMerchantSponsorsService { ...@@ -23,6 +26,9 @@ public class MerchantSponsorsServiceImpl implements IMerchantSponsorsService {
@Autowired @Autowired
MongoTemplate mongoTemplate; MongoTemplate mongoTemplate;
@Autowired
MerchantRdmService merchantRdmService;
@Override @Override
public PagedResult<MerchantSponsorsVo> search(String name, int page, int size) { public PagedResult<MerchantSponsorsVo> search(String name, int page, int size) {
// 查询条件 // 查询条件
...@@ -51,5 +57,21 @@ public class MerchantSponsorsServiceImpl implements IMerchantSponsorsService { ...@@ -51,5 +57,21 @@ public class MerchantSponsorsServiceImpl implements IMerchantSponsorsService {
return pagedResult; return pagedResult;
} }
@Override
public MerchantSponsorsVo sponsorInfo(String uid, String sponsorId) {
// 当前用户是否管理该主办
MerchantSponsorsVo sponsorsVo = this.checkSponsorAccount(uid, sponsorId);
return sponsorsVo;
}
private MerchantSponsorsVo checkSponsorAccount(String uid, String sponsorId) {
// 当前用户是否管理该主办
MerchantSponsorsVo sponsorsVo = merchantRdmService.getSponsorsVoBySponsorId(sponsorId);
if (null == sponsorsVo || !uid.equals(sponsorsVo.getUid())) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("13201");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
return sponsorsVo;
}
} }
...@@ -6,24 +6,29 @@ ...@@ -6,24 +6,29 @@
13001=法人姓名与身份证不匹配 13001=法人姓名与身份证不匹配
13002=联系人姓名与身份证不匹配 13002=联系人姓名与身份证不匹配
# 场地 # 场地
13101=场地不存在,请核实 13101=场地不存在,请核实
13102=场地已被认领 13102=场地已被认领
13103=场地申请已达到上限 13103=验票员已存在
13104=申请不存在,请核实 13104=验票员不存在
13105=申请未驳回,不能删除
13111=验票员已存在 # 场地申请
13112=验票员不存在 13111=场地申请已达到上限
13112=申请不存在,请核实
13113=申请未驳回,不能删除
# 主办 # 主办
13201=主办申请已经达到上限 13201=主办不存在,请核实
13202=主办公司信息不能为空
13203=申请不存在,请核实
13204=申请未驳回,不能删除
# 主办申请
13211=主办申请已经达到上限
13212=主办公司信息不能为空
13213=申请不存在,请核实
13214=申请未驳回,不能删除
# 演出授权
13301=无授权权限
13302=无权限授于统计权限
......
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