Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
cms
Commits
9ac3167f
提交
9ac3167f
authored
8月 01, 2023
作者:
zhenjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
后台账号绑定单位相关bug修复
上级
bb8611b4
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
75 行增加
和
13 行删除
+75
-13
ResultEnum.java
...-util/src/main/java/com/mmc/iuav/response/ResultEnum.java
+1
-0
CompanyDao.java
...-user/src/main/java/com/mmc/iuav/user/dao/CompanyDao.java
+4
-0
CompanyService.java
...c/main/java/com/mmc/iuav/user/service/CompanyService.java
+16
-1
BackUserAccountServiceImpl.java
...mc/iuav/user/service/impl/BackUserAccountServiceImpl.java
+24
-0
CompanyServiceImpl.java
...va/com/mmc/iuav/user/service/impl/CompanyServiceImpl.java
+17
-1
CompanyDao.xml
...cms-service-user/src/main/resources/mapper/CompanyDao.xml
+8
-0
CooperationDao.xml
...service-user/src/main/resources/mapper/CooperationDao.xml
+5
-11
没有找到文件。
cms-common/cms-common-util/src/main/java/com/mmc/iuav/response/ResultEnum.java
浏览文件 @
9ac3167f
...
@@ -57,6 +57,7 @@ public enum ResultEnum implements BaseErrorInfoInterface {
...
@@ -57,6 +57,7 @@ public enum ResultEnum implements BaseErrorInfoInterface {
ONLY_ONE_ADMIN_ERROR
(
"8010"
,
"禁止该账号获取超级管理员角色"
),
ONLY_ONE_ADMIN_ERROR
(
"8010"
,
"禁止该账号获取超级管理员角色"
),
DELETE_ADMIN_ERROR
(
"8011"
,
"禁止删除超级管理员角色账号"
),
DELETE_ADMIN_ERROR
(
"8011"
,
"禁止删除超级管理员角色账号"
),
DELETE_YOURSELF_ERROR
(
"8011"
,
"禁止删除自己的账号"
),
DELETE_YOURSELF_ERROR
(
"8011"
,
"禁止删除自己的账号"
),
FRANCHISEE_ACCOUNT_MORE_THAN_ONE_ERROR
(
"8012"
,
"绑定企业为加盟公司,禁止使用该单位"
),
ID_INFO_AND_ID_card_MISMATCH
(
"3904"
,
"身份信息与身份证不匹配"
),
ID_INFO_AND_ID_card_MISMATCH
(
"3904"
,
"身份信息与身份证不匹配"
),
INTERFACE_ACCESS_EXCEPTION
(
"36894"
,
"接口访问异常/次数用尽"
),
INTERFACE_ACCESS_EXCEPTION
(
"36894"
,
"接口访问异常/次数用尽"
),
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/CompanyDao.java
浏览文件 @
9ac3167f
...
@@ -193,4 +193,8 @@ public interface CompanyDao {
...
@@ -193,4 +193,8 @@ public interface CompanyDao {
List
<
UserAccountDO
>
listCompanyMembersPage
(
Integer
id
,
Integer
pageNo
,
Integer
pageSize
);
List
<
UserAccountDO
>
listCompanyMembersPage
(
Integer
id
,
Integer
pageNo
,
Integer
pageSize
);
int
countBingingCompanyInfoByUID
(
Integer
userAccountId
);
int
countBingingCompanyInfoByUID
(
Integer
userAccountId
);
void
unbindingAllAppUsers
(
Integer
id
);
void
unbindingAllPcUsers
(
Integer
id
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/CompanyService.java
浏览文件 @
9ac3167f
...
@@ -45,7 +45,7 @@ public interface CompanyService {
...
@@ -45,7 +45,7 @@ public interface CompanyService {
* @param id
* @param id
* @return
* @return
*/
*/
ResultBody
getCompanyInfoById
(
Integer
id
);
ResultBody
<
CompanyInfoVO
>
getCompanyInfoById
(
Integer
id
);
/**
/**
* 单位列表
* 单位列表
...
@@ -147,4 +147,19 @@ public interface CompanyService {
...
@@ -147,4 +147,19 @@ public interface CompanyService {
ResultBody
listCompanyMembers
(
Integer
companyInfoId
,
LoginSuccessDTO
userLoginInfoFromRedis
,
Integer
pageNo
,
Integer
pageSize
);
ResultBody
listCompanyMembers
(
Integer
companyInfoId
,
LoginSuccessDTO
userLoginInfoFromRedis
,
Integer
pageNo
,
Integer
pageSize
);
ResultBody
<
CompanyInfoVO
>
getCompanyInfoByBUId
(
Integer
backUserAccountId
);
ResultBody
<
CompanyInfoVO
>
getCompanyInfoByBUId
(
Integer
backUserAccountId
);
/**
* 查看绑定的后台账号个数
*
* @param id
* @return
*/
Integer
countCompanyBackUser
(
Integer
id
);
/**
* 解绑当前单位全部成员
*
* @param id
*/
void
unbindingAllUsers
(
Integer
id
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/BackUserAccountServiceImpl.java
浏览文件 @
9ac3167f
...
@@ -11,6 +11,7 @@ import com.mmc.iuav.user.entity.BackUserAccountDO;
...
@@ -11,6 +11,7 @@ import com.mmc.iuav.user.entity.BackUserAccountDO;
import
com.mmc.iuav.user.entity.CompanyBackUserDO
;
import
com.mmc.iuav.user.entity.CompanyBackUserDO
;
import
com.mmc.iuav.user.entity.CompanyInfoDO
;
import
com.mmc.iuav.user.entity.CompanyInfoDO
;
import
com.mmc.iuav.user.entity.RoleInfoDO
;
import
com.mmc.iuav.user.entity.RoleInfoDO
;
import
com.mmc.iuav.user.enums.CompanyTypeEnums
;
import
com.mmc.iuav.user.enums.RoleEnums
;
import
com.mmc.iuav.user.enums.RoleEnums
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
import
com.mmc.iuav.user.model.qo.BUserAccountQO
;
import
com.mmc.iuav.user.model.qo.BUserAccountQO
;
...
@@ -65,6 +66,15 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
...
@@ -65,6 +66,15 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
}
catch
(
NoSuchAlgorithmException
e
)
{
}
catch
(
NoSuchAlgorithmException
e
)
{
return
ResultBody
.
error
(
ResultEnum
.
PWD_CREATE_ERROR
);
return
ResultBody
.
error
(
ResultEnum
.
PWD_CREATE_ERROR
);
}
}
ResultBody
<
CompanyInfoVO
>
companyInfoVOResultBody
=
companyService
.
getCompanyInfoById
(
bUserAccountVO
.
getCompanyId
());
CompanyInfoVO
companyInfoVO
=
companyInfoVOResultBody
.
getResult
();
if
(
companyInfoVO
!=
null
&&
companyInfoVO
.
getCompanyType
().
equals
(
CompanyTypeEnums
.
FRANCHISEE
.
getType
()))
{
// 绑定企业为加盟公司,不能生成多个账号
int
bindingCount
=
companyService
.
countCompanyBackUser
(
companyInfoVO
.
getId
());
if
(
bindingCount
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
FRANCHISEE_ACCOUNT_MORE_THAN_ONE_ERROR
);
}
}
backUserAccountDao
.
insertBackUserAccount
(
backUserAccountDO
);
backUserAccountDao
.
insertBackUserAccount
(
backUserAccountDO
);
// 添加角色
// 添加角色
roleDao
.
insertUserRoleRel
(
backUserAccountDO
.
getId
(),
bUserAccountVO
.
getRoleId
());
roleDao
.
insertUserRoleRel
(
backUserAccountDO
.
getId
(),
bUserAccountVO
.
getRoleId
());
...
@@ -103,6 +113,15 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
...
@@ -103,6 +113,15 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
if
(
bUserAccountVO
.
getId
().
equals
(
1
)
&&
!
bUserAccountVO
.
getRoleId
().
equals
(
RoleEnums
.
ADMIN
.
getId
()))
{
if
(
bUserAccountVO
.
getId
().
equals
(
1
)
&&
!
bUserAccountVO
.
getRoleId
().
equals
(
RoleEnums
.
ADMIN
.
getId
()))
{
return
ResultBody
.
error
(
ResultEnum
.
UPDATE_ADMIN_ROLE_ERROR
);
return
ResultBody
.
error
(
ResultEnum
.
UPDATE_ADMIN_ROLE_ERROR
);
}
}
ResultBody
<
CompanyInfoVO
>
companyInfoVOResultBody
=
companyService
.
getCompanyInfoById
(
bUserAccountVO
.
getCompanyId
());
CompanyInfoVO
companyInfoVO
=
companyInfoVOResultBody
.
getResult
();
if
(
companyInfoVO
!=
null
&&
companyInfoVO
.
getCompanyType
().
equals
(
CompanyTypeEnums
.
FRANCHISEE
.
getType
()))
{
// 绑定企业为加盟公司,不能生成多个账号
int
bindingCount
=
companyService
.
countCompanyBackUser
(
companyInfoVO
.
getId
());
if
(
bindingCount
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
FRANCHISEE_ACCOUNT_MORE_THAN_ONE_ERROR
);
}
}
BackUserAccountDO
userAccountDO
=
new
BackUserAccountDO
(
bUserAccountVO
);
BackUserAccountDO
userAccountDO
=
new
BackUserAccountDO
(
bUserAccountVO
);
backUserAccountDao
.
updateBackUserAccount
(
userAccountDO
);
backUserAccountDao
.
updateBackUserAccount
(
userAccountDO
);
// 修改单位信息
// 修改单位信息
...
@@ -125,6 +144,11 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
...
@@ -125,6 +144,11 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
if
(
accountId
.
toString
().
equals
(
backUserAccountId
.
toString
()))
{
if
(
accountId
.
toString
().
equals
(
backUserAccountId
.
toString
()))
{
return
ResultBody
.
error
(
ResultEnum
.
DELETE_YOURSELF_ERROR
);
return
ResultBody
.
error
(
ResultEnum
.
DELETE_YOURSELF_ERROR
);
}
}
CompanyInfoVO
companyInfoVO
=
companyService
.
getCompanyInfoByBackUserAccountId
(
backUserAccountId
);
if
(
companyInfoVO
!=
null
&&
companyInfoVO
.
getCompanyType
().
equals
(
CompanyTypeEnums
.
FRANCHISEE
.
getType
()))
{
// 加盟企业的账号,需要把对应的成员和后台账号解绑
companyService
.
unbindingAllUsers
(
companyInfoVO
.
getId
());
}
backUserAccountDao
.
disableBackUserAccountDO
(
accountId
);
backUserAccountDao
.
disableBackUserAccountDO
(
accountId
);
return
ResultBody
.
success
();
return
ResultBody
.
success
();
}
}
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/CompanyServiceImpl.java
浏览文件 @
9ac3167f
...
@@ -16,6 +16,7 @@ import com.mmc.iuav.user.model.vo.UserAccountVO;
...
@@ -16,6 +16,7 @@ import com.mmc.iuav.user.model.vo.UserAccountVO;
import
com.mmc.iuav.user.service.CompanyService
;
import
com.mmc.iuav.user.service.CompanyService
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
org.springframework.util.CollectionUtils
;
import
java.util.List
;
import
java.util.List
;
...
@@ -78,7 +79,7 @@ public class CompanyServiceImpl implements CompanyService {
...
@@ -78,7 +79,7 @@ public class CompanyServiceImpl implements CompanyService {
}
}
@Override
@Override
public
ResultBody
getCompanyInfoById
(
Integer
id
)
{
public
ResultBody
<
CompanyInfoVO
>
getCompanyInfoById
(
Integer
id
)
{
CompanyInfoDO
companyInfoDO
=
companyDao
.
getCompanyInfoById
(
id
);
CompanyInfoDO
companyInfoDO
=
companyDao
.
getCompanyInfoById
(
id
);
if
(
companyInfoDO
!=
null
)
{
if
(
companyInfoDO
!=
null
)
{
return
ResultBody
.
success
(
companyInfoDO
.
buildCompanyInfoVO
());
return
ResultBody
.
success
(
companyInfoDO
.
buildCompanyInfoVO
());
...
@@ -214,4 +215,19 @@ public class CompanyServiceImpl implements CompanyService {
...
@@ -214,4 +215,19 @@ public class CompanyServiceImpl implements CompanyService {
}
}
return
ResultBody
.
success
();
return
ResultBody
.
success
();
}
}
@Override
public
Integer
countCompanyBackUser
(
Integer
id
)
{
int
countCompanyBackUser
=
companyDao
.
countCompanyBackUser
(
id
);
return
countCompanyBackUser
;
}
@Transactional
@Override
public
void
unbindingAllUsers
(
Integer
id
)
{
// 解绑小程序成员
companyDao
.
unbindingAllAppUsers
(
id
);
// 解绑后台账号
companyDao
.
unbindingAllPcUsers
(
id
);
}
}
}
csm-service/cms-service-user/src/main/resources/mapper/CompanyDao.xml
浏览文件 @
9ac3167f
...
@@ -99,6 +99,14 @@
...
@@ -99,6 +99,14 @@
delete from company_member where user_account_id = #{userAccountId} and company_info_id = #{companyInfoId}
delete from company_member where user_account_id = #{userAccountId} and company_info_id = #{companyInfoId}
</delete>
</delete>
<delete
id=
"unbindingAllAppUsers"
>
delete from company_member where company_info_id = #{companyInfoId}
</delete>
<delete
id=
"unbindingAllPcUsers"
>
delete from company_back_user where company_info_id = #{companyInfoId}
</delete>
<select
id=
"getCompanyInfoById"
resultType=
"com.mmc.iuav.user.entity.CompanyInfoDO"
>
<select
id=
"getCompanyInfoById"
resultType=
"com.mmc.iuav.user.entity.CompanyInfoDO"
>
select id, company_type, company_name, full_name, province, city, district, address, company_user_name,
select id, company_type, company_name, full_name, province, city, district, address, company_user_name,
phone_num, remark, create_time, lon, lat, credit_code, license_img, brand_name, brand_logo,content, score
phone_num, remark, create_time, lon, lat, credit_code, license_img, brand_name, brand_logo,content, score
...
...
csm-service/cms-service-user/src/main/resources/mapper/CooperationDao.xml
浏览文件 @
9ac3167f
...
@@ -106,13 +106,7 @@
...
@@ -106,13 +106,7 @@
apply_status = #{applyStatus},
apply_status = #{applyStatus},
</if>
</if>
<if
test=
"remark != null and remark != '' "
>
<if
test=
"remark != null and remark != '' "
>
remark = #{remark},
remark = #{remark}
</if>
<if
test=
"content != null and content != ''"
>
content = #{content},
</if>
<if
test=
"score != null"
>
score = #{score}
</if>
</if>
</set>
</set>
WHERE id = #{id}
WHERE id = #{id}
...
@@ -305,8 +299,8 @@
...
@@ -305,8 +299,8 @@
ci.lon,
ci.lon,
ci.lat,
ci.lat,
ct.id AS type,
ct.id AS type,
uat
.content,
ci
.content,
uat
.score,
ci
.score,
st_distance_sphere(point(ci.lon,ci.lat), point(${lon}, ${lat})) AS distance
st_distance_sphere(point(ci.lon,ci.lat), point(${lon}, ${lat})) AS distance
FROM
FROM
user_apply_tag uat
user_apply_tag uat
...
@@ -376,8 +370,8 @@
...
@@ -376,8 +370,8 @@
ua.apply_status,
ua.apply_status,
ua.remark,
ua.remark,
ua.create_time,
ua.create_time,
ua
.content,
ci
.content,
ua
.score,
ci
.score,
ct.tag_name,
ct.tag_name,
ci.company_name,
ci.company_name,
ci.brand_name,
ci.brand_name,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论