Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
promotion-service
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
promotion
promotion-service
Commits
2ccff0bc
提交
2ccff0bc
authored
2月 14, 2025
作者:
李秋林
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除计划做限制计划日期是今日则必需是10点之前,包含过去日期不可删除,非职能角色不可删除他人计划
上级
aa49c971
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
39 行增加
和
13 行删除
+39
-13
PromPlanCoreController.java
...ion/controller/activityplanv2/PromPlanCoreController.java
+8
-2
ActivityPlanInfoDao.java
...motion/domain/activityplanv2/dao/ActivityPlanInfoDao.java
+1
-1
ActivityPlanInfoDaoImpl.java
...main/activityplanv2/dao/impl/ActivityPlanInfoDaoImpl.java
+8
-5
ActivityPlanInfoMapper.java
.../domain/activityplanv2/mapper/ActivityPlanInfoMapper.java
+4
-1
PromPlanCoreService.java
...promotion/service/activityplanv2/PromPlanCoreService.java
+1
-1
PromPlanCoreServiceImpl.java
.../service/activityplanv2/impl/PromPlanCoreServiceImpl.java
+2
-2
ActivityPlanInfoMapper.xml
...esources/mapper/activityplanv2/ActivityPlanInfoMapper.xml
+15
-1
没有找到文件。
src/main/java/com/wangxiaolu/promotion/controller/activityplanv2/PromPlanCoreController.java
浏览文件 @
2ccff0bc
...
@@ -72,7 +72,6 @@ public class PromPlanCoreController {
...
@@ -72,7 +72,6 @@ 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
.
getEmployeeNo
());
boolean
isAuth
=
manageEmployeeQueryService
.
isAuth
(
activityPlanVo
.
getEmployeeNo
());
if
(!
isAuth
)
{
if
(!
isAuth
)
{
throw
new
DataException
(
RCode
.
EMP_PRIVILEGE_ERROR
);
throw
new
DataException
(
RCode
.
EMP_PRIVILEGE_ERROR
);
...
@@ -148,7 +147,14 @@ public class PromPlanCoreController {
...
@@ -148,7 +147,14 @@ public class PromPlanCoreController {
if
(
Collections
.
isEmpty
(
activityPlanVo
.
getPlanIds
())){
if
(
Collections
.
isEmpty
(
activityPlanVo
.
getPlanIds
())){
throw
new
ParamException
(
RCode
.
NEED_PARAM_ERROR
);
throw
new
ParamException
(
RCode
.
NEED_PARAM_ERROR
);
}
}
promPlanCoreService
.
deletePlan
(
activityPlanVo
.
getPlanIds
());
// 判断当前账号是否是职能角色
String
employeeNo
=
activityPlanVo
.
getEmployeeNo
();
boolean
isAuth
=
manageEmployeeQueryService
.
isAuth
(
employeeNo
);
if
(
isAuth
)
{
employeeNo
=
""
;
}
promPlanCoreService
.
deletePlan
(
activityPlanVo
.
getPlanIds
(),
employeeNo
);
return
R
.
success
();
return
R
.
success
();
}
}
...
...
src/main/java/com/wangxiaolu/promotion/domain/activityplanv2/dao/ActivityPlanInfoDao.java
浏览文件 @
2ccff0bc
...
@@ -20,7 +20,7 @@ public interface ActivityPlanInfoDao {
...
@@ -20,7 +20,7 @@ public interface ActivityPlanInfoDao {
ActivityPlanInfoDto
selectPlan
(
String
storeCode
,
Date
date
);
ActivityPlanInfoDto
selectPlan
(
String
storeCode
,
Date
date
);
void
deleteByPlanIds
(
List
<
Long
>
planIds
);
void
deleteByPlanIds
(
List
<
Long
>
planIds
,
String
employeeNo
);
void
updateList
(
JSONArray
table
,
Long
recordId
);
void
updateList
(
JSONArray
table
,
Long
recordId
);
}
}
src/main/java/com/wangxiaolu/promotion/domain/activityplanv2/dao/impl/ActivityPlanInfoDaoImpl.java
浏览文件 @
2ccff0bc
...
@@ -19,7 +19,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -19,7 +19,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalTime
;
import
java.time.LocalTime
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
...
@@ -77,11 +76,15 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
...
@@ -77,11 +76,15 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
}
}
@Override
@Override
public
void
deleteByPlanIds
(
List
<
Long
>
planIds
)
{
public
void
deleteByPlanIds
(
List
<
Long
>
planIds
,
String
employeeNo
)
{
// 判断ID中是否包含今日数据
// 判断ID中是否包含之前数据、非个人数据
Integer
count
=
activityPlanInfoMapper
.
selectNotDelCount
(
planIds
);
Integer
count
=
activityPlanInfoMapper
.
selectNotDelCount
(
planIds
,
employeeNo
);
if
(
count
>
0
)
{
throw
new
DataException
(
RCode
.
ACTIVITY_PLAN_NOT_SELF_DELETE
);
}
Integer
countToday
=
activityPlanInfoMapper
.
selectTodayCount
(
planIds
);
// 今日数据存在时,判断当前时间是否在今日10点前
// 今日数据存在时,判断当前时间是否在今日10点前
if
(
count
>
0
&&
(
LocalTime
.
now
().
getHour
()
>=
10
))
{
if
(
count
Today
>
0
&&
(
LocalTime
.
now
().
getHour
()
>=
10
))
{
throw
new
DataException
(
RCode
.
ACTIVITY_PLAN_NOT_DELETE
);
throw
new
DataException
(
RCode
.
ACTIVITY_PLAN_NOT_DELETE
);
}
}
activityPlanInfoMapper
.
updateIsDelete
(
planIds
);
activityPlanInfoMapper
.
updateIsDelete
(
planIds
);
...
...
src/main/java/com/wangxiaolu/promotion/domain/activityplanv2/mapper/ActivityPlanInfoMapper.java
浏览文件 @
2ccff0bc
...
@@ -26,9 +26,12 @@ public interface ActivityPlanInfoMapper extends BaseMapper<ActivityPlanInfoDo> {
...
@@ -26,9 +26,12 @@ public interface ActivityPlanInfoMapper extends BaseMapper<ActivityPlanInfoDo> {
void
updateIsDelete
(
List
<
Long
>
planIds
);
void
updateIsDelete
(
List
<
Long
>
planIds
);
Integer
selectNotDelCount
(
@Param
(
"planIds"
)
List
<
Long
>
planIds
);
Integer
selectNotDelCount
(
@Param
(
"planIds"
)
List
<
Long
>
planIds
,
@Param
(
"employeeNo"
)
String
employeeNo
);
void
updateOne
(
@Param
(
"pDo"
)
ActivityPlanInfoDo
pDo
,
@Param
(
"recordId"
)
Long
recordId
);
void
updateOne
(
@Param
(
"pDo"
)
ActivityPlanInfoDo
pDo
,
@Param
(
"recordId"
)
Long
recordId
);
Integer
selectTodayCount
(
List
<
Long
>
planIds
);
}
}
...
...
src/main/java/com/wangxiaolu/promotion/service/activityplanv2/PromPlanCoreService.java
浏览文件 @
2ccff0bc
...
@@ -16,7 +16,7 @@ public interface PromPlanCoreService {
...
@@ -16,7 +16,7 @@ public interface PromPlanCoreService {
void
selfPlanAf
(
String
planUuid
);
void
selfPlanAf
(
String
planUuid
);
void
deletePlan
(
List
<
Long
>
planIds
);
void
deletePlan
(
List
<
Long
>
planIds
,
String
employeeNo
);
Map
<
String
,
Object
>
authPlanUp
(
ActivityPlanVo
activityPlanVo
,
String
filePath
)
throws
DataException
;
Map
<
String
,
Object
>
authPlanUp
(
ActivityPlanVo
activityPlanVo
,
String
filePath
)
throws
DataException
;
...
...
src/main/java/com/wangxiaolu/promotion/service/activityplanv2/impl/PromPlanCoreServiceImpl.java
浏览文件 @
2ccff0bc
...
@@ -641,7 +641,7 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
...
@@ -641,7 +641,7 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
}
}
@Override
@Override
public
void
deletePlan
(
List
<
Long
>
planIds
)
{
public
void
deletePlan
(
List
<
Long
>
planIds
,
String
employeeNo
)
{
activityPlanInfoDao
.
deleteByPlanIds
(
planIds
);
activityPlanInfoDao
.
deleteByPlanIds
(
planIds
,
employeeNo
);
}
}
}
}
src/main/resources/mapper/activityplanv2/ActivityPlanInfoMapper.xml
浏览文件 @
2ccff0bc
...
@@ -107,6 +107,20 @@
...
@@ -107,6 +107,20 @@
</update>
</update>
<select
id=
"selectNotDelCount"
resultType=
"java.lang.Integer"
>
<select
id=
"selectNotDelCount"
resultType=
"java.lang.Integer"
>
select count(*)
from activity_plan_info
where id in
<foreach
collection=
"planIds"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
and is_delete = 1
and date
<
date_format(now(),'%Y-%m-%d')
<if
test=
"employeeNo != null and employeeNo != ''"
>
or employee_no != #{employeeNo}
</if>
</select>
<select
id=
"selectTodayCount"
resultType=
"java.lang.Integer"
>
select count(*)
select count(*)
from activity_plan_info
from activity_plan_info
where id in
where id in
...
@@ -114,7 +128,7 @@
...
@@ -114,7 +128,7 @@
#{item}
#{item}
</foreach>
</foreach>
and is_delete = 1
and is_delete = 1
and date
<
= now(
)
and date
= date_format(now(),'%Y-%m-%d'
)
</select>
</select>
<update
id=
"updateOne"
>
<update
id=
"updateOne"
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论