|
@@ -45,6 +45,16 @@ public class AuthServiceImpl implements AuthService {
|
|
}
|
|
}
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
List<AuthVo> authList = authMapper.getAuthList(authUserId, authParty);
|
|
List<AuthVo> authList = authMapper.getAuthList(authUserId, authParty);
|
|
|
|
+ authList.forEach(auth->{
|
|
|
|
+ Integer waitAuditNum = authMapper.getProductWaitAuditNum(auth.getAuthId());
|
|
|
|
+ if (waitAuditNum > 0) {
|
|
|
|
+ auth.setLowerAuditStatus(0);
|
|
|
|
+ auth.setWaitAuditNum(waitAuditNum);
|
|
|
|
+ } else {
|
|
|
|
+ auth.setLowerAuditStatus(1);
|
|
|
|
+ auth.setWaitAuditNum(0);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
PageInfo<AuthVo> pageData = new PageInfo<>(authList);
|
|
PageInfo<AuthVo> pageData = new PageInfo<>(authList);
|
|
return ResponseJson.success(pageData);
|
|
return ResponseJson.success(pageData);
|
|
}
|
|
}
|
|
@@ -52,12 +62,10 @@ public class AuthServiceImpl implements AuthService {
|
|
@Override
|
|
@Override
|
|
public ResponseJson updateAuthStatus(Integer authId, Integer status) {
|
|
public ResponseJson updateAuthStatus(Integer authId, Integer status) {
|
|
if (authId == null) {
|
|
if (authId == null) {
|
|
- return ResponseJson.error("请输入用户id");
|
|
|
|
|
|
+ return ResponseJson.error("请输入授权id");
|
|
}
|
|
}
|
|
if (status == null) {
|
|
if (status == null) {
|
|
return ResponseJson.error("请输入要更新的状态值");
|
|
return ResponseJson.error("请输入要更新的状态值");
|
|
- } else if (status != 0 && status != 1) {
|
|
|
|
- return ResponseJson.error("状态值只能为0或1");
|
|
|
|
}
|
|
}
|
|
authMapper.updateAuthStatusByAuthId(authId, status);
|
|
authMapper.updateAuthStatusByAuthId(authId, status);
|
|
if (status == 0) {
|
|
if (status == 0) {
|
|
@@ -85,18 +93,13 @@ public class AuthServiceImpl implements AuthService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ResponseJson saveAuth(Integer authId, Integer authUserId, String authParty, Integer status, Integer createBy) {
|
|
|
|
|
|
+ public ResponseJson saveAuth(Integer authId, Integer authUserId, String authParty, Integer createBy) {
|
|
if (null == authUserId) {
|
|
if (null == authUserId) {
|
|
return ResponseJson.error("参数异常,请输入供应商用户id");
|
|
return ResponseJson.error("参数异常,请输入供应商用户id");
|
|
}
|
|
}
|
|
if (StringUtils.isBlank(authParty)) {
|
|
if (StringUtils.isBlank(authParty)) {
|
|
return ResponseJson.error("参数异常,请输入授权机构名称");
|
|
return ResponseJson.error("参数异常,请输入授权机构名称");
|
|
}
|
|
}
|
|
- if (null == status) {
|
|
|
|
- return ResponseJson.error("参数异常,请输入授权状态值");
|
|
|
|
- } else if (status != 0 && status != 1) {
|
|
|
|
- return ResponseJson.error("参数异常,授权状态值只能为0或1");
|
|
|
|
- }
|
|
|
|
if (null == createBy) {
|
|
if (null == createBy) {
|
|
return ResponseJson.error("参数异常,请输入创建人id");
|
|
return ResponseJson.error("参数异常,请输入创建人id");
|
|
}
|
|
}
|
|
@@ -106,7 +109,8 @@ public class AuthServiceImpl implements AuthService {
|
|
CmBrandAuthPo auth = new CmBrandAuthPo();
|
|
CmBrandAuthPo auth = new CmBrandAuthPo();
|
|
auth.setAuthUserId(authUserId);
|
|
auth.setAuthUserId(authUserId);
|
|
auth.setAuthParty(authParty);
|
|
auth.setAuthParty(authParty);
|
|
- auth.setStatus(status);
|
|
|
|
|
|
+ // 保存品牌授权信息,上线状态默认为“待上线”
|
|
|
|
+ auth.setStatus(2);
|
|
if (null == authId) {
|
|
if (null == authId) {
|
|
auth.setCreateBy(createBy);
|
|
auth.setCreateBy(createBy);
|
|
auth.setCreateTime(new Date());
|
|
auth.setCreateTime(new Date());
|
|
@@ -123,4 +127,19 @@ public class AuthServiceImpl implements AuthService {
|
|
}
|
|
}
|
|
return ResponseJson.success("保存品牌授权成功");
|
|
return ResponseJson.success("保存品牌授权成功");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public ResponseJson auditAuth(Integer authId, Integer auditStatus, String invalidReason) {
|
|
|
|
+ if (authId == null) {
|
|
|
|
+ return ResponseJson.error("请输入授权id");
|
|
|
|
+ }
|
|
|
|
+ if (auditStatus == null) {
|
|
|
|
+ return ResponseJson.error("请输入审核结果");
|
|
|
|
+ }
|
|
|
|
+ if (auditStatus == 0 && StringUtils.isEmpty(invalidReason)) {
|
|
|
|
+ return ResponseJson.error("请输入审核不通过的理由");
|
|
|
|
+ }
|
|
|
|
+ authMapper.updateAuthAuditStatus(authId, auditStatus, invalidReason);
|
|
|
|
+ return ResponseJson.success("审核品牌授权成功");
|
|
|
|
+ }
|
|
}
|
|
}
|