Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
promotion-service
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
promotion
promotion-service
Commits
cc876d47
提交
cc876d47
authored
5月 26, 2025
作者:
000516
浏览文件
操作
浏览文件
下载
差异文件
在CP计划中,删除多个计划需要逐一确认,计划是否被执行,计划是否已开始并超过1小时
上级
a1889787
ab189fd7
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
16 行增加
和
11 行删除
+16
-11
ActivityPlanInfoDaoImpl.java
...main/activityplanv2/dao/impl/ActivityPlanInfoDaoImpl.java
+11
-5
ActivityPlanInfoMapper.java
.../domain/activityplanv2/mapper/ActivityPlanInfoMapper.java
+1
-1
PromPlanCoreServiceImpl.java
.../service/activityplanv2/impl/PromPlanCoreServiceImpl.java
+2
-2
ActivityPlanInfoMapper.xml
...esources/mapper/activityplanv2/ActivityPlanInfoMapper.xml
+2
-3
没有找到文件。
src/main/java/com/wangxiaolu/promotion/domain/activityplanv2/dao/impl/ActivityPlanInfoDaoImpl.java
浏览文件 @
cc876d47
...
@@ -11,6 +11,7 @@ import com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlan
...
@@ -11,6 +11,7 @@ import com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlan
import
com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper
;
import
com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper
;
import
com.wangxiaolu.promotion.enums.plan.PlanStatus
;
import
com.wangxiaolu.promotion.enums.plan.PlanStatus
;
import
com.wangxiaolu.promotion.exception.DataException
;
import
com.wangxiaolu.promotion.exception.DataException
;
import
com.wangxiaolu.promotion.exception.FlowException
;
import
com.wangxiaolu.promotion.pojo.PageInfo
;
import
com.wangxiaolu.promotion.pojo.PageInfo
;
import
com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto
;
import
com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto
;
import
com.wangxiaolu.promotion.result.basedata.RCode
;
import
com.wangxiaolu.promotion.result.basedata.RCode
;
...
@@ -19,7 +20,7 @@ import org.apache.ibatis.exceptions.PersistenceException;
...
@@ -19,7 +20,7 @@ import org.apache.ibatis.exceptions.PersistenceException;
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
java.time.LocalTime
;
import
java.time.Local
Date
Time
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
...
@@ -118,12 +119,17 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
...
@@ -118,12 +119,17 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
// 判断ID中是否包含之前数据、非个人数据
// 判断ID中是否包含之前数据、非个人数据
Integer
count
=
activityPlanInfoMapper
.
selectNotDelCount
(
planIds
,
employeeNo
);
Integer
count
=
activityPlanInfoMapper
.
selectNotDelCount
(
planIds
,
employeeNo
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
throw
new
Data
Exception
(
RCode
.
ACTIVITY_PLAN_NOT_SELF_DELETE
);
throw
new
Flow
Exception
(
RCode
.
ACTIVITY_PLAN_NOT_SELF_DELETE
);
}
}
Integer
countToday
=
activityPlanInfoMapper
.
selectTodayCount
(
planIds
);
List
<
ActivityPlanInfoDo
>
todayPlans
=
activityPlanInfoMapper
.
selectTodayCount
(
planIds
);
// 今日数据存在时,判断当前时间是否在今日10点前
// 今日数据存在时,判断当前时间是否在今日10点前
if
(
countToday
>
0
&&
(
LocalTime
.
now
().
getHour
()
>=
10
))
{
for
(
ActivityPlanInfoDo
todayPlan
:
todayPlans
)
{
throw
new
DataException
(
RCode
.
ACTIVITY_PLAN_NOT_DELETE
);
if
(
PlanStatus
.
EXECUTION
.
getCode
().
equals
(
todayPlan
.
getPlanStatus
()))
{
throw
new
FlowException
(
RCode
.
ACTIVITY_ID_IS_START
.
getCode
(),
String
.
format
(
RCode
.
ACTIVITY_ID_IS_START
.
getMsg
(),
todayPlan
.
getId
()));
}
if
(
LocalDateTime
.
now
().
isAfter
(
todayPlan
.
getClockInTime
().
plusHours
(
1
))){
throw
new
FlowException
(
RCode
.
ACTIVITY_PLAN_ID_NOT_DELETE
.
getCode
(),
String
.
format
(
RCode
.
ACTIVITY_PLAN_ID_NOT_DELETE
.
getMsg
(),
todayPlan
.
getId
()));
}
}
}
activityPlanInfoMapper
.
updateIsDelete
(
planIds
);
activityPlanInfoMapper
.
updateIsDelete
(
planIds
);
}
}
...
...
src/main/java/com/wangxiaolu/promotion/domain/activityplanv2/mapper/ActivityPlanInfoMapper.java
浏览文件 @
cc876d47
...
@@ -32,7 +32,7 @@ public interface ActivityPlanInfoMapper extends BaseMapper<ActivityPlanInfoDo> {
...
@@ -32,7 +32,7 @@ public interface ActivityPlanInfoMapper extends BaseMapper<ActivityPlanInfoDo> {
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
);
List
<
ActivityPlanInfoDo
>
selectTodayCount
(
List
<
Long
>
planIds
);
void
updatePlanStatus
(
@Param
(
"id"
)
Long
planId
,
@Param
(
"status"
)
Integer
status
);
void
updatePlanStatus
(
@Param
(
"id"
)
Long
planId
,
@Param
(
"status"
)
Integer
status
);
...
...
src/main/java/com/wangxiaolu/promotion/service/activityplanv2/impl/PromPlanCoreServiceImpl.java
浏览文件 @
cc876d47
...
@@ -482,11 +482,11 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
...
@@ -482,11 +482,11 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
ActivityPlanInfoDto
dto
=
activityPlanInfoDao
.
selectById
(
operVo
.
getId
());
ActivityPlanInfoDto
dto
=
activityPlanInfoDao
.
selectById
(
operVo
.
getId
());
// 已执行的计划不可修改
// 已执行的计划不可修改
if
(
PlanStatus
.
EXECUTION
.
getCode
().
equals
(
dto
.
getPlanStatus
())){
if
(
PlanStatus
.
EXECUTION
.
getCode
().
equals
(
dto
.
getPlanStatus
())){
throw
new
FlowException
(
RCode
.
ACTIVITY_
PLAN_EXECUTE_ERROR
);
throw
new
FlowException
(
RCode
.
ACTIVITY_
IS_START
);
}
}
// 判断修改时间是否在促销员上班1小时内
// 判断修改时间是否在促销员上班1小时内
if
(
LocalDateTime
.
now
().
isAfter
(
dto
.
getClockInTime
().
plusHours
(
1
))){
if
(
LocalDateTime
.
now
().
isAfter
(
dto
.
getClockInTime
().
plusHours
(
1
))){
dto
.
setErrorMsg
(
"已超促销员上班时间1小时,不可修改;"
);
throw
new
FlowException
(
RCode
.
ACTIVITY_PLAN_NOT_DELETE
);
}
}
ActivityPlanInfoDto
planDto
=
new
ActivityPlanInfoDto
();
ActivityPlanInfoDto
planDto
=
new
ActivityPlanInfoDto
();
...
...
src/main/resources/mapper/activityplanv2/ActivityPlanInfoMapper.xml
浏览文件 @
cc876d47
...
@@ -120,9 +120,8 @@
...
@@ -120,9 +120,8 @@
</if>
</if>
</select>
</select>
<select
id=
"selectTodayCount"
resultType=
"java.lang.Integer"
>
<select
id=
"selectTodayCount"
resultMap=
"SimResultMap"
>
select count(*)
select id,clock_in_time, plan_status
from activity_plan_info
where id in
where id in
<foreach
collection=
"planIds"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"planIds"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
#{item}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论