Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
promotion-service
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
promotion
promotion-service
Commits
7a235d24
提交
7a235d24
authored
2月 13, 2025
作者:
李秋林
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
关于计划接口,由用户ID判断权限改为由用户工号判断;根据工号获取人员数据进行补充参数信息
上级
0923f2be
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
43 行增加
和
19 行删除
+43
-19
PromPlanCoreController.java
...ion/controller/activityplanv2/PromPlanCoreController.java
+23
-3
ManageEmployeeInfoDao.java
.../promotion/domain/activity/dao/ManageEmployeeInfoDao.java
+2
-2
ManageEmployeeInfoInfoDaoImpl.java
...main/activity/dao/impl/ManageEmployeeInfoInfoDaoImpl.java
+4
-4
ManageEmployeeInfoMapper.java
...tion/domain/activity/mapper/ManageEmployeeInfoMapper.java
+2
-2
ManageEmployeeQueryService.java
...lu/promotion/service/user/ManageEmployeeQueryService.java
+2
-2
ManageEmployeeQueryServiceImpl.java
...ion/service/user/impl/ManageEmployeeQueryServiceImpl.java
+4
-4
ManageEmployeeInfoMapper.xml
src/main/resources/mapper/ManageEmployeeInfoMapper.xml
+6
-2
没有找到文件。
src/main/java/com/wangxiaolu/promotion/controller/activityplanv2/PromPlanCoreController.java
浏览文件 @
7a235d24
...
@@ -4,6 +4,8 @@ import com.wangxiaolu.promotion.common.excel.FileUtils;
...
@@ -4,6 +4,8 @@ import com.wangxiaolu.promotion.common.excel.FileUtils;
import
com.wangxiaolu.promotion.exception.DataException
;
import
com.wangxiaolu.promotion.exception.DataException
;
import
com.wangxiaolu.promotion.exception.ParamException
;
import
com.wangxiaolu.promotion.exception.ParamException
;
import
com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanVo
;
import
com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanVo
;
import
com.wangxiaolu.promotion.pojo.activity.manage.vo.ManageEmployeeVo
;
import
com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto
;
import
com.wangxiaolu.promotion.result.basedata.R
;
import
com.wangxiaolu.promotion.result.basedata.R
;
import
com.wangxiaolu.promotion.result.basedata.RCode
;
import
com.wangxiaolu.promotion.result.basedata.RCode
;
import
com.wangxiaolu.promotion.service.activityplanv2.PromPlanCoreService
;
import
com.wangxiaolu.promotion.service.activityplanv2.PromPlanCoreService
;
...
@@ -36,9 +38,15 @@ public class PromPlanCoreController {
...
@@ -36,9 +38,15 @@ public class PromPlanCoreController {
@PostMapping
(
"/self/upload"
)
@PostMapping
(
"/self/upload"
)
public
R
selfPlan
(
@RequestBody
ActivityPlanVo
activityPlanVo
)
{
public
R
selfPlan
(
@RequestBody
ActivityPlanVo
activityPlanVo
)
{
// 判断当前账号是否是城市经理
// 判断当前账号是否是城市经理
boolean
isSelf
=
manageEmployeeQueryService
.
isOneSelf
(
activityPlanVo
.
getEmployee
Id
());
boolean
isSelf
=
manageEmployeeQueryService
.
isOneSelf
(
activityPlanVo
.
getEmployee
No
());
if
(!
isSelf
)
{
if
(!
isSelf
)
{
throw
new
DataException
(
RCode
.
EMP_PRIVILEGE_ERROR
);
throw
new
DataException
(
RCode
.
EMP_PRIVILEGE_ERROR
);
}
else
{
ManageEmployeeInfoDto
one
=
manageEmployeeQueryService
.
findOne
(
new
ManageEmployeeVo
().
setEmployeeNo
(
activityPlanVo
.
getEmployeeNo
()));
activityPlanVo
.
setEmployeeId
(
one
.
getId
())
.
setEmployeeName
(
one
.
getName
())
.
setDeptQcId
(
one
.
getDeptQcId
())
.
setDeptQcName
(
one
.
getDeptQcName
());
}
}
try
{
try
{
...
@@ -64,9 +72,15 @@ public class PromPlanCoreController {
...
@@ -64,9 +72,15 @@ public class PromPlanCoreController {
@PutMapping
(
"/self/put"
)
@PutMapping
(
"/self/put"
)
public
R
selfPlanPut
(
@RequestBody
ActivityPlanVo
activityPlanVo
)
{
public
R
selfPlanPut
(
@RequestBody
ActivityPlanVo
activityPlanVo
)
{
// 判断当前账号是否是城市经理
// 判断当前账号是否是城市经理
boolean
isSelf
=
manageEmployeeQueryService
.
isOneSelf
(
activityPlanVo
.
getEmployee
Id
());
boolean
isSelf
=
manageEmployeeQueryService
.
isOneSelf
(
activityPlanVo
.
getEmployee
No
());
if
(!
isSelf
)
{
if
(!
isSelf
)
{
throw
new
DataException
(
RCode
.
EMP_PRIVILEGE_ERROR
);
throw
new
DataException
(
RCode
.
EMP_PRIVILEGE_ERROR
);
}
else
{
ManageEmployeeInfoDto
one
=
manageEmployeeQueryService
.
findOne
(
new
ManageEmployeeVo
().
setEmployeeNo
(
activityPlanVo
.
getEmployeeNo
()));
activityPlanVo
.
setEmployeeId
(
one
.
getId
())
.
setEmployeeName
(
one
.
getName
())
.
setDeptQcId
(
one
.
getDeptQcId
())
.
setDeptQcName
(
one
.
getDeptQcName
());
}
}
try
{
try
{
...
@@ -101,9 +115,15 @@ public class PromPlanCoreController {
...
@@ -101,9 +115,15 @@ public class PromPlanCoreController {
@PostMapping
(
"/auth/upload"
)
@PostMapping
(
"/auth/upload"
)
public
R
authPlan
(
@RequestBody
ActivityPlanVo
activityPlanVo
)
{
public
R
authPlan
(
@RequestBody
ActivityPlanVo
activityPlanVo
)
{
// 判断当前账号是否是城市经理
// 判断当前账号是否是城市经理
boolean
isAuth
=
manageEmployeeQueryService
.
isAuth
(
activityPlanVo
.
getEmployee
Id
());
boolean
isAuth
=
manageEmployeeQueryService
.
isAuth
(
activityPlanVo
.
getEmployee
No
());
if
(!
isAuth
)
{
if
(!
isAuth
)
{
throw
new
DataException
(
RCode
.
EMP_PRIVILEGE_ERROR
);
throw
new
DataException
(
RCode
.
EMP_PRIVILEGE_ERROR
);
}
else
{
ManageEmployeeInfoDto
one
=
manageEmployeeQueryService
.
findOne
(
new
ManageEmployeeVo
().
setEmployeeNo
(
activityPlanVo
.
getEmployeeNo
()));
activityPlanVo
.
setEmployeeId
(
one
.
getId
())
.
setEmployeeName
(
one
.
getName
())
.
setDeptQcId
(
one
.
getDeptQcId
())
.
setDeptQcName
(
one
.
getDeptQcName
());
}
}
try
{
try
{
String
[]
urlArr
=
activityPlanVo
.
getExcelUrl
().
split
(
"weda-uploader/"
);
String
[]
urlArr
=
activityPlanVo
.
getExcelUrl
().
split
(
"weda-uploader/"
);
...
...
src/main/java/com/wangxiaolu/promotion/domain/activity/dao/ManageEmployeeInfoDao.java
浏览文件 @
7a235d24
...
@@ -25,7 +25,7 @@ public interface ManageEmployeeInfoDao {
...
@@ -25,7 +25,7 @@ public interface ManageEmployeeInfoDao {
void
updateAccount
(
String
employeeNo
,
Integer
privilegeId
,
String
status
);
void
updateAccount
(
String
employeeNo
,
Integer
privilegeId
,
String
status
);
boolean
isOneSelf
(
Integer
employeeId
);
boolean
isOneSelf
(
String
employeeNo
);
boolean
isAuth
(
Integer
employeeId
);
boolean
isAuth
(
String
employeeNo
);
}
}
src/main/java/com/wangxiaolu/promotion/domain/activity/dao/impl/ManageEmployeeInfoInfoDaoImpl.java
浏览文件 @
7a235d24
...
@@ -88,13 +88,13 @@ public class ManageEmployeeInfoInfoDaoImpl implements ManageEmployeeInfoDao {
...
@@ -88,13 +88,13 @@ public class ManageEmployeeInfoInfoDaoImpl implements ManageEmployeeInfoDao {
}
}
@Override
@Override
public
boolean
isOneSelf
(
Integer
employeeId
)
{
public
boolean
isOneSelf
(
String
employeeNo
)
{
return
manageEmployeeInfoMapper
.
isOneSelf
(
employee
Id
);
return
manageEmployeeInfoMapper
.
isOneSelf
(
employee
No
);
}
}
@Override
@Override
public
boolean
isAuth
(
Integer
employeeId
)
{
public
boolean
isAuth
(
String
employeeNo
)
{
return
manageEmployeeInfoMapper
.
isAuth
(
employee
Id
);
return
manageEmployeeInfoMapper
.
isAuth
(
employee
No
);
}
}
/**
/**
...
...
src/main/java/com/wangxiaolu/promotion/domain/activity/mapper/ManageEmployeeInfoMapper.java
浏览文件 @
7a235d24
...
@@ -28,8 +28,8 @@ public interface ManageEmployeeInfoMapper extends BaseMapper<ManageEmployeeInfoD
...
@@ -28,8 +28,8 @@ public interface ManageEmployeeInfoMapper extends BaseMapper<ManageEmployeeInfoD
void
updatePrivilege
(
@Param
(
"employeeNo"
)
String
employeeNo
,
@Param
(
"privilegeId"
)
Integer
privilegeId
);
void
updatePrivilege
(
@Param
(
"employeeNo"
)
String
employeeNo
,
@Param
(
"privilegeId"
)
Integer
privilegeId
);
boolean
isOneSelf
(
Integer
employeeId
);
boolean
isOneSelf
(
@Param
(
"employeeNo"
)
String
employeeNo
);
boolean
isAuth
(
Integer
employeeId
);
boolean
isAuth
(
@Param
(
"employeeNo"
)
String
employeeNo
);
}
}
...
...
src/main/java/com/wangxiaolu/promotion/service/user/ManageEmployeeQueryService.java
浏览文件 @
7a235d24
...
@@ -22,7 +22,7 @@ public interface ManageEmployeeQueryService {
...
@@ -22,7 +22,7 @@ public interface ManageEmployeeQueryService {
boolean
hasByEmpNo
(
String
employeeNo
);
boolean
hasByEmpNo
(
String
employeeNo
);
boolean
isOneSelf
(
Integer
employeeId
);
boolean
isOneSelf
(
String
employeeNo
);
boolean
isAuth
(
Integer
employeeId
);
boolean
isAuth
(
String
employeeNo
);
}
}
src/main/java/com/wangxiaolu/promotion/service/user/impl/ManageEmployeeQueryServiceImpl.java
浏览文件 @
7a235d24
...
@@ -59,12 +59,12 @@ public class ManageEmployeeQueryServiceImpl implements ManageEmployeeQueryServic
...
@@ -59,12 +59,12 @@ public class ManageEmployeeQueryServiceImpl implements ManageEmployeeQueryServic
}
}
@Override
@Override
public
boolean
isOneSelf
(
Integer
employeeId
)
{
public
boolean
isOneSelf
(
String
employeeNo
)
{
return
manageEmployeeInfoDao
.
isOneSelf
(
employee
Id
);
return
manageEmployeeInfoDao
.
isOneSelf
(
employee
No
);
}
}
@Override
@Override
public
boolean
isAuth
(
Integer
employeeId
)
{
public
boolean
isAuth
(
String
employeeNo
)
{
return
manageEmployeeInfoDao
.
isAuth
(
employee
Id
);
return
manageEmployeeInfoDao
.
isAuth
(
employee
No
);
}
}
}
}
src/main/resources/mapper/ManageEmployeeInfoMapper.xml
浏览文件 @
7a235d24
...
@@ -70,12 +70,16 @@
...
@@ -70,12 +70,16 @@
<!-- 权限(1:oneself,2:admin)-->
<!-- 权限(1:oneself,2:admin)-->
<select
id=
"isOneSelf"
resultType=
"boolean"
>
<select
id=
"isOneSelf"
resultType=
"boolean"
>
select count(*) > 0
select count(*) > 0
from manage_employee_ref_privilege where employee_id = #{employeeId} and privilege_id = 1;
from manage_employee_info ei
inner join manage_employee_ref_privilege er
on ei.id = er.employee_id and ei.employee_no = #{employeeNo} and ei.status = 0 and er.privilege_id = 1;
</select>
</select>
<!-- 权限(1:oneself,2:admin)-->
<!-- 权限(1:oneself,2:admin)-->
<select
id=
"isAuth"
resultType=
"boolean"
>
<select
id=
"isAuth"
resultType=
"boolean"
>
select count(*) > 0
select count(*) > 0
from manage_employee_ref_privilege where employee_id = #{employeeId} and privilege_id = 2;
from manage_employee_info ei
inner join manage_employee_ref_privilege er
on ei.id = er.employee_id and ei.employee_no = #{employeeNo} and ei.status = 0 and er.privilege_id = 2;
</select>
</select>
</mapper>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论