Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
promotion-service
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
promotion
promotion-service
Commits
cb638099
提交
cb638099
authored
6月 11, 2025
作者:
000516
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'main' into lql-jicha
上级
71c8f541
d1995915
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
75 行增加
和
16 行删除
+75
-16
PromPlanCoreController.java
...ion/controller/activityplanv2/PromPlanCoreController.java
+6
-0
ActivityPlanInfoDaoImpl.java
...main/activityplanv2/dao/impl/ActivityPlanInfoDaoImpl.java
+21
-10
QinCeClienteleStoreDaoImpl.java
...tion/domain/user/dao/impl/QinCeClienteleStoreDaoImpl.java
+5
-0
StoreWrapper.java
...gxiaolu/promotion/domain/user/wrapperQo/StoreWrapper.java
+1
-0
ClienteleStoreQueryVo.java
...gxiaolu/promotion/pojo/user/vo/ClienteleStoreQueryVo.java
+4
-0
PromPlanCoreServiceImpl.java
.../service/activityplanv2/impl/PromPlanCoreServiceImpl.java
+31
-6
DateUtils.java
src/main/java/com/wangxiaolu/promotion/utils/DateUtils.java
+7
-0
没有找到文件。
src/main/java/com/wangxiaolu/promotion/controller/activityplanv2/PromPlanCoreController.java
浏览文件 @
cb638099
...
@@ -200,6 +200,9 @@ public class PromPlanCoreController {
...
@@ -200,6 +200,9 @@ public class PromPlanCoreController {
return
R
.
success
();
return
R
.
success
();
}
}
/**
* 修改计划
*/
@PutMapping
(
"/one"
)
@PutMapping
(
"/one"
)
public
R
putActivityPlan
(
@RequestBody
ActivityPlanOperVo
operVo
){
public
R
putActivityPlan
(
@RequestBody
ActivityPlanOperVo
operVo
){
if
(
Objects
.
isNull
(
operVo
.
getId
())){
if
(
Objects
.
isNull
(
operVo
.
getId
())){
...
@@ -214,6 +217,9 @@ public class PromPlanCoreController {
...
@@ -214,6 +217,9 @@ public class PromPlanCoreController {
return
R
.
success
();
return
R
.
success
();
}
}
/**
* 变更归属人
*/
@PutMapping
(
"/more"
)
@PutMapping
(
"/more"
)
public
R
putActivityPlans
(
@RequestBody
ActivityPlanOperVo
operVo
){
public
R
putActivityPlans
(
@RequestBody
ActivityPlanOperVo
operVo
){
if
(
Objects
.
isNull
(
operVo
.
getEmployeeId
())
||
Collections
.
isEmpty
(
operVo
.
getPlanIds
())){
if
(
Objects
.
isNull
(
operVo
.
getEmployeeId
())
||
Collections
.
isEmpty
(
operVo
.
getPlanIds
())){
...
...
src/main/java/com/wangxiaolu/promotion/domain/activityplanv2/dao/impl/ActivityPlanInfoDaoImpl.java
浏览文件 @
cb638099
...
@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
...
@@ -68,6 +69,11 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
...
@@ -68,6 +69,11 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
@Override
@Override
public
void
updateById
(
ActivityPlanInfoDto
planDto
)
{
public
void
updateById
(
ActivityPlanInfoDto
planDto
)
{
// 判断计划是否存在
ActivityPlanInfoDo
activityPlanInfoDo
=
activityPlanInfoMapper
.
selectPlan
(
planDto
.
getStoreCode
(),
planDto
.
getDate
());
if
(
Objects
.
nonNull
(
activityPlanInfoDo
)){
throw
new
DataException
(
RCode
.
ACTIVITY_PLAN_REPETITION_ERROR
);
}
ActivityPlanInfoDo
planDo
=
BeanUtils
.
transitionDto
(
planDto
,
ActivityPlanInfoDo
.
class
);
ActivityPlanInfoDo
planDo
=
BeanUtils
.
transitionDto
(
planDto
,
ActivityPlanInfoDo
.
class
);
activityPlanInfoMapper
.
updateById
(
planDo
);
activityPlanInfoMapper
.
updateById
(
planDo
);
}
}
...
@@ -96,6 +102,7 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
...
@@ -96,6 +102,7 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
@Override
@Override
public
void
updateByIds
(
List
<
Long
>
planIds
,
ActivityPlanInfoDto
planDto
)
{
public
void
updateByIds
(
List
<
Long
>
planIds
,
ActivityPlanInfoDto
planDto
)
{
errorMoreDate
(
planIds
);
activityPlanInfoMapper
.
updateByIds
(
planIds
,
planDto
);
activityPlanInfoMapper
.
updateByIds
(
planIds
,
planDto
);
}
}
...
@@ -121,16 +128,7 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
...
@@ -121,16 +128,7 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
if
(
count
>
0
)
{
if
(
count
>
0
)
{
throw
new
FlowException
(
RCode
.
ACTIVITY_PLAN_NOT_SELF_DELETE
);
throw
new
FlowException
(
RCode
.
ACTIVITY_PLAN_NOT_SELF_DELETE
);
}
}
List
<
ActivityPlanInfoDo
>
todayPlans
=
activityPlanInfoMapper
.
selectTodayCount
(
planIds
);
errorMoreDate
(
planIds
);
// 今日数据存在时,判断当前时间是否在今日10点前
for
(
ActivityPlanInfoDo
todayPlan
:
todayPlans
)
{
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
,
operNo
);
activityPlanInfoMapper
.
updateIsDelete
(
planIds
,
operNo
);
}
}
private
LambdaQueryWrapper
<
ActivityPlanInfoDo
>
buildWrapper
(
ActivityPlanInfoWrapper
wrapper
)
{
private
LambdaQueryWrapper
<
ActivityPlanInfoDo
>
buildWrapper
(
ActivityPlanInfoWrapper
wrapper
)
{
...
@@ -175,5 +173,18 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
...
@@ -175,5 +173,18 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
return
qw
;
return
qw
;
}
}
private
void
errorMoreDate
(
List
<
Long
>
planIds
){
List
<
ActivityPlanInfoDo
>
todayPlans
=
activityPlanInfoMapper
.
selectTodayCount
(
planIds
);
// 今日数据存在时,判断是否执行、上班时间顺延1小时
for
(
ActivityPlanInfoDo
todayPlan
:
todayPlans
)
{
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
()));
}
// 判断修改时间是否在促销员上班1小时内
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
()));
}
}
}
}
}
src/main/java/com/wangxiaolu/promotion/domain/user/dao/impl/QinCeClienteleStoreDaoImpl.java
浏览文件 @
cb638099
...
@@ -105,6 +105,7 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao {
...
@@ -105,6 +105,7 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao {
// 指定字段查询
// 指定字段查询
qw
.
select
(
QinCeClienteleStoreDO:
:
getQcId
,
qw
.
select
(
QinCeClienteleStoreDO:
:
getQcId
,
QinCeClienteleStoreDO:
:
getStoreName
,
QinCeClienteleStoreDO:
:
getStoreName
,
QinCeClienteleStoreDO:
:
getStoreCode
,
QinCeClienteleStoreDO:
:
getDealersName
,
QinCeClienteleStoreDO:
:
getDealersName
,
QinCeClienteleStoreDO:
:
getDealerId
,
QinCeClienteleStoreDO:
:
getDealerId
,
QinCeClienteleStoreDO:
:
getLineName
,
QinCeClienteleStoreDO:
:
getLineName
,
...
@@ -139,6 +140,10 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao {
...
@@ -139,6 +140,10 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao {
if
(
StringUtils
.
isNotBlank
(
storeWrapper
.
getStoreNameVague
()))
{
if
(
StringUtils
.
isNotBlank
(
storeWrapper
.
getStoreNameVague
()))
{
qw
.
like
(
QinCeClienteleStoreDO:
:
getStoreName
,
storeWrapper
.
getStoreNameVague
().
trim
());
qw
.
like
(
QinCeClienteleStoreDO:
:
getStoreName
,
storeWrapper
.
getStoreNameVague
().
trim
());
}
}
// 按经销商ID查询
if
(
StringUtils
.
isNotBlank
(
storeWrapper
.
getDealerId
()))
{
qw
.
eq
(
QinCeClienteleStoreDO:
:
getDealerId
,
storeWrapper
.
getDealerId
());
}
return
qw
;
return
qw
;
}
}
...
...
src/main/java/com/wangxiaolu/promotion/domain/user/wrapperQo/StoreWrapper.java
浏览文件 @
cb638099
...
@@ -30,4 +30,5 @@ public class StoreWrapper {
...
@@ -30,4 +30,5 @@ public class StoreWrapper {
private
String
storeStatus
=
"1"
;
private
String
storeStatus
=
"1"
;
private
String
storeApprovalStatus
=
"3"
;
private
String
storeApprovalStatus
=
"3"
;
private
String
storeCode
;
private
String
storeCode
;
private
String
dealerId
;
}
}
src/main/java/com/wangxiaolu/promotion/pojo/user/vo/ClienteleStoreQueryVo.java
浏览文件 @
cb638099
...
@@ -32,4 +32,8 @@ public class ClienteleStoreQueryVo {
...
@@ -32,4 +32,8 @@ public class ClienteleStoreQueryVo {
*/
*/
private
String
storeStatus
=
"1"
;
private
String
storeStatus
=
"1"
;
private
String
storeApprovalStatus
=
"3"
;
private
String
storeApprovalStatus
=
"3"
;
/**
* 经销商ID(查询同一经销商内的门店)
*/
private
String
dealerId
;
}
}
src/main/java/com/wangxiaolu/promotion/service/activityplanv2/impl/PromPlanCoreServiceImpl.java
浏览文件 @
cb638099
package
com
.
wangxiaolu
.
promotion
.
service
.
activityplanv2
.
impl
;
package
com
.
wangxiaolu
.
promotion
.
service
.
activityplanv2
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -19,17 +19,15 @@ import com.wangxiaolu.promotion.enums.plan.OperationType;
...
@@ -19,17 +19,15 @@ import com.wangxiaolu.promotion.enums.plan.OperationType;
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.exception.FlowException
;
import
com.wangxiaolu.promotion.
exception.ParamException
;
import
com.wangxiaolu.promotion.
pojo.activity.manage.vo.ActivityPlanVo
;
import
com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto
;
import
com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto
;
import
com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanRecordDto
;
import
com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanRecordDto
;
import
com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanVo
;
import
com.wangxiaolu.promotion.pojo.activity.planv2.vo.ActivityPlanOperVo
;
import
com.wangxiaolu.promotion.pojo.activity.planv2.vo.ActivityPlanOperVo
;
import
com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto
;
import
com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto
;
import
com.wangxiaolu.promotion.pojo.user.dto.QinCeClienteleStoreDto
;
import
com.wangxiaolu.promotion.pojo.user.dto.QinCeClienteleStoreDto
;
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
;
import
com.wangxiaolu.promotion.utils.DateUtils
;
import
com.wangxiaolu.promotion.utils.DateUtils
;
import
groovyjarjarpicocli.CommandLine
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -38,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -38,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.*
;
import
java.time.*
;
import
java.time.temporal.TemporalAdjusters
;
import
java.util.*
;
import
java.util.*
;
/**
/**
...
@@ -484,11 +483,20 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
...
@@ -484,11 +483,20 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
if
(
PlanStatus
.
EXECUTION
.
getCode
().
equals
(
dto
.
getPlanStatus
())){
if
(
PlanStatus
.
EXECUTION
.
getCode
().
equals
(
dto
.
getPlanStatus
())){
throw
new
FlowException
(
RCode
.
ACTIVITY_IS_START
);
throw
new
FlowException
(
RCode
.
ACTIVITY_IS_START
);
}
}
//
判断修改时间是否在促销员上班1小时内
//
不可修改活动日期 <= 今日 的计划
if
(
LocalDateTime
.
now
().
isAfter
(
dto
.
getClockInTime
().
plusHours
(
1
))){
if
(
DateUtils
.
parseDateBylocalDate
(
dto
.
getDate
()).
isBefore
(
LocalDate
.
now
(
))){
throw
new
FlowException
(
RCode
.
ACTIVITY_PLAN_NOT_DELETE
);
throw
new
FlowException
(
RCode
.
ACTIVITY_PLAN_NOT_DELETE
);
}
}
// 判断修改后 月底 >= 活动日期 > 今日
LocalDate
today
=
LocalDate
.
now
();
Date
planDate
=
operVo
.
getDate
();
LocalDate
localDatePlan
=
DateUtils
.
parseDateBylocalDate
(
planDate
);
LocalDate
lastDayOfMonth
=
today
.
with
(
TemporalAdjusters
.
lastDayOfMonth
());
if
(!
localDatePlan
.
isAfter
(
today
)
||
localDatePlan
.
isAfter
(
lastDayOfMonth
)){
throw
new
FlowException
(
RCode
.
ACTIVITY_PLAN_DATA_ERROR
);
}
ActivityPlanInfoDto
planDto
=
new
ActivityPlanInfoDto
();
ActivityPlanInfoDto
planDto
=
new
ActivityPlanInfoDto
();
// 归属人改变
// 归属人改变
if
(!
operVo
.
getEmployeeId
().
equals
(
dto
.
getEmployeeId
())){
if
(!
operVo
.
getEmployeeId
().
equals
(
dto
.
getEmployeeId
())){
...
@@ -500,7 +508,24 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
...
@@ -500,7 +508,24 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
.
setOrgName
(
employeeInfoDto
.
getDeptQcName
());
.
setOrgName
(
employeeInfoDto
.
getDeptQcName
());
}
}
StoreWrapper
storeWrap
=
new
StoreWrapper
().
setStoreCode
(
operVo
.
getStoreCode
());
QinCeClienteleStoreDto
storeDto
=
qinCeClienteleStoreDao
.
getOneStore
(
storeWrap
);
if
(!
storeDto
.
getDealerId
().
equals
(
dto
.
getDealerId
())){
throw
new
FlowException
(
RCode
.
QINCE_STORE_DEALER_ERROR
);
}
planDto
.
setId
(
operVo
.
getId
())
planDto
.
setId
(
operVo
.
getId
())
.
setLineName
(
storeDto
.
getLineName
())
.
setStoreCode
(
storeDto
.
getStoreCode
())
.
setStoreName
(
storeDto
.
getStoreName
())
.
setDealerId
(
storeDto
.
getDealerId
())
.
setDealerName
(
storeDto
.
getDealersName
())
.
setProvince
(
storeDto
.
getStoreMssProvince
())
.
setCity
(
storeDto
.
getStoreMssCity
())
.
setArea
(
storeDto
.
getStoreMssArea
())
.
setAddr
(
storeDto
.
getStoreAddr
())
.
setDate
(
planDate
)
.
setPattern
(
operVo
.
getPattern
())
.
setPattern
(
operVo
.
getPattern
())
.
setClockInTime
(
operVo
.
getClockInTime
())
.
setClockInTime
(
operVo
.
getClockInTime
())
.
setClockOutTime
(
operVo
.
getClockOutTime
())
.
setClockOutTime
(
operVo
.
getClockOutTime
())
...
...
src/main/java/com/wangxiaolu/promotion/utils/DateUtils.java
浏览文件 @
cb638099
...
@@ -50,4 +50,11 @@ public class DateUtils {
...
@@ -50,4 +50,11 @@ public class DateUtils {
Instant
instant
=
zonedDateTime
.
toInstant
();
Instant
instant
=
zonedDateTime
.
toInstant
();
return
Date
.
from
(
instant
);
return
Date
.
from
(
instant
);
}
}
public
static
LocalDate
parseDateBylocalDate
(
Date
date
)
{
if
(
date
==
null
)
{
return
null
;
}
return
date
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论