Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
promotion-service
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
promotion
promotion-service
Commits
2089ae62
提交
2089ae62
authored
9月 09, 2024
作者:
李秋林
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. employee_activity_plan_info删除字段2. 计划表导入批量报错
上级
189e6fb4
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
38 行增加
和
94 行删除
+38
-94
EmployeeActivityPlanInfoDaoImpl.java
...main/manage/dao/impl/EmployeeActivityPlanInfoDaoImpl.java
+0
-4
EmployeeActivityPlanInfoDO.java
...main/manage/mapper/entity/EmployeeActivityPlanInfoDO.java
+0
-24
EmployeeActivityPlanInfoDto.java
...pojo/activity/manage/dto/EmployeeActivityPlanInfoDto.java
+0
-25
ActivityPlanRecordCoreServiceImpl.java
...tivity/manage/impl/ActivityPlanRecordCoreServiceImpl.java
+31
-32
EmployeeActivityPlanInfoMapper.xml
src/main/resources/mapper/EmployeeActivityPlanInfoMapper.xml
+7
-9
没有找到文件。
src/main/java/com/wangxiaolu/promotion/domain/manage/dao/impl/EmployeeActivityPlanInfoDaoImpl.java
浏览文件 @
2089ae62
...
@@ -90,10 +90,6 @@ public class EmployeeActivityPlanInfoDaoImpl implements EmployeeActivityPlanInfo
...
@@ -90,10 +90,6 @@ public class EmployeeActivityPlanInfoDaoImpl implements EmployeeActivityPlanInfo
qw
.
eq
(
EmployeeActivityPlanInfoDO:
:
getActivityMonth
,
wrapper
.
getActivityMonth
());
qw
.
eq
(
EmployeeActivityPlanInfoDO:
:
getActivityMonth
,
wrapper
.
getActivityMonth
());
}
}
if
(
Objects
.
nonNull
(
wrapper
.
getActivityStartDate
()))
{
qw
.
eq
(
EmployeeActivityPlanInfoDO:
:
getActivityStartDate
,
wrapper
.
getActivityStartDate
());
}
if
(
StringUtils
.
isNotBlank
(
wrapper
.
getDealerName
()))
{
if
(
StringUtils
.
isNotBlank
(
wrapper
.
getDealerName
()))
{
qw
.
like
(
EmployeeActivityPlanInfoDO:
:
getDealerName
,
wrapper
.
getDealerName
());
qw
.
like
(
EmployeeActivityPlanInfoDO:
:
getDealerName
,
wrapper
.
getDealerName
());
}
}
...
...
src/main/java/com/wangxiaolu/promotion/domain/manage/mapper/entity/EmployeeActivityPlanInfoDO.java
浏览文件 @
2089ae62
...
@@ -82,30 +82,6 @@ public class EmployeeActivityPlanInfoDO implements Serializable {
...
@@ -82,30 +82,6 @@ public class EmployeeActivityPlanInfoDO implements Serializable {
*/
*/
private
String
activityPattern
;
private
String
activityPattern
;
/**
* 活动开始日期
*/
private
Date
activityStartDate
;
/**
* 活动结束日期
*/
private
Date
activityEndDate
;
/**
* 虎皮场次
*/
private
Integer
hupiCount
;
/**
* 去骨场次
*/
private
Integer
quguCount
;
/**
* 促销员上班时间
*/
private
String
temporaryOnTime
;
private
Date
createTime
;
private
Date
createTime
;
private
Date
modifyTime
;
private
Date
modifyTime
;
...
...
src/main/java/com/wangxiaolu/promotion/pojo/activity/manage/dto/EmployeeActivityPlanInfoDto.java
浏览文件 @
2089ae62
...
@@ -85,31 +85,6 @@ public class EmployeeActivityPlanInfoDto implements Serializable {
...
@@ -85,31 +85,6 @@ public class EmployeeActivityPlanInfoDto implements Serializable {
*/
*/
private
String
activityPattern
;
private
String
activityPattern
;
/**
* 活动开始日期
*/
private
Date
activityStartDate
;
/**
* 活动结束日期
*/
private
Date
activityEndDate
;
/**
* 虎皮场次
*/
private
Integer
hupiCount
;
/**
* 去骨场次
*/
private
Integer
quguCount
;
/**
* 促销员上班时间
*/
private
String
temporaryOnTime
;
private
Integer
activityStatus
;
private
Integer
activityStatus
;
/**
/**
...
...
src/main/java/com/wangxiaolu/promotion/service/activity/manage/impl/ActivityPlanRecordCoreServiceImpl.java
浏览文件 @
2089ae62
...
@@ -57,15 +57,16 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore
...
@@ -57,15 +57,16 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore
private
void
saveActivityPlanInfo
(
ActivityPlanVo
activityPlanVo
,
EmployeeActivityPlanRecordDto
planDto
)
throws
Exception
{
private
void
saveActivityPlanInfo
(
ActivityPlanVo
activityPlanVo
,
EmployeeActivityPlanRecordDto
planDto
)
throws
Exception
{
// 下载
// 下载
String
filePath
=
"/var/logs/activity_plan/"
+
activityPlanVo
.
getEmployeeNo
()
+
"/"
+
planDto
.
getExcelFiledId
();
// String filePath = "/var/logs/activity_plan/" + activityPlanVo.getEmployeeNo() + "/" + planDto.getExcelFiledId();
downloadExcel
(
activityPlanVo
.
getExcelUrl
(),
filePath
);
String
filePath
=
"/Users/a02200059/Desktop/错误图片/push/"
+
planDto
.
getExcelFiledId
();
downloadExcel
(
activityPlanVo
.
getExcelUrl
(),
filePath
);
// 读取
// 读取
List
<
EmployeeActivityPlanInfoDto
>
planInfoDtos
=
readSheet0
(
filePath
,
activityPlanVo
,
planDto
);
List
<
EmployeeActivityPlanInfoDto
>
planInfoDtos
=
readSheet0
(
filePath
,
activityPlanVo
,
planDto
);
// 保存
// 保存
employeeActivityPlanInfoDao
.
saveList
(
planInfoDtos
);
employeeActivityPlanInfoDao
.
saveList
(
planInfoDtos
);
}
}
private
void
downloadExcel
(
String
urlStr
,
String
filePath
)
throws
Exception
{
private
void
downloadExcel
(
String
urlStr
,
String
filePath
)
throws
Exception
{
// 保存文件
// 保存文件
URL
url
=
new
URL
(
urlStr
);
URL
url
=
new
URL
(
urlStr
);
URLConnection
urlConnection
=
url
.
openConnection
();
URLConnection
urlConnection
=
url
.
openConnection
();
...
@@ -91,7 +92,7 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore
...
@@ -91,7 +92,7 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore
Map
<
Object
,
Object
>
dealers
=
redisCache
.
getAllHash
(
RedisKeys
.
UserKeys
.
DEALER_HAVE_LIST
.
getKey
());
Map
<
Object
,
Object
>
dealers
=
redisCache
.
getAllHash
(
RedisKeys
.
UserKeys
.
DEALER_HAVE_LIST
.
getKey
());
// 2、校验数据准确性
// 2、校验数据准确性
verifyRow
(
rows
,
dealers
);
verifyRow
(
rows
,
dealers
);
/**
/**
* 3、保存入库
* 3、保存入库
...
@@ -113,12 +114,7 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore
...
@@ -113,12 +114,7 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore
.
setDealerName
((
String
)
dealers
.
get
(
value
.
get
(
1
)))
.
setDealerName
((
String
)
dealers
.
get
(
value
.
get
(
1
)))
.
setLineName
((
String
)
value
.
get
(
2
))
.
setLineName
((
String
)
value
.
get
(
2
))
.
setStoreName
((
String
)
value
.
get
(
3
))
.
setStoreName
((
String
)
value
.
get
(
3
))
.
setActivityPattern
((
String
)
value
.
get
(
4
))
.
setActivityPattern
((
String
)
value
.
get
(
4
));
.
setActivityStartDate
((
Date
)
value
.
get
(
5
))
.
setActivityEndDate
((
Date
)
value
.
get
(
6
))
.
setHupiCount
(
Integer
.
parseInt
(
StringUtils
.
isBlank
((
String
)
value
.
get
(
7
))
?
"0"
:
(
String
)
value
.
get
(
7
)))
.
setQuguCount
(
Integer
.
parseInt
(
StringUtils
.
isBlank
((
String
)
value
.
get
(
8
))
?
"0"
:
(
String
)
value
.
get
(
8
)))
.
setTemporaryOnTime
((
String
)
value
.
get
(
9
));
planInfoDtos
.
add
(
planInfoDto
);
planInfoDtos
.
add
(
planInfoDto
);
}
}
...
@@ -129,45 +125,48 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore
...
@@ -129,45 +125,48 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore
* 校验数据是否规范
* 校验数据是否规范
*/
*/
private
void
verifyRow
(
Map
<
Integer
,
List
<
Object
>>
rows
,
Map
<
Object
,
Object
>
dealers
)
throws
Exception
{
private
void
verifyRow
(
Map
<
Integer
,
List
<
Object
>>
rows
,
Map
<
Object
,
Object
>
dealers
)
throws
Exception
{
StringBuilder
msg
=
new
StringBuilder
();
List
<
String
>
storeList
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
Integer
,
List
<
Object
>>
entry
:
rows
.
entrySet
())
{
for
(
Map
.
Entry
<
Integer
,
List
<
Object
>>
entry
:
rows
.
entrySet
())
{
Integer
rowNo
=
entry
.
getKey
()
+
1
;
Integer
rowNo
=
entry
.
getKey
()
+
1
;
List
<
Object
>
value
=
entry
.
getValue
();
List
<
Object
>
value
=
entry
.
getValue
();
System
.
out
.
println
(
value
);
String
city
=
(
String
)
value
.
get
(
0
);
StringBuilder
sb
=
new
StringBuilder
();
if
(
StringUtils
.
isBlank
(
city
))
{
throw
new
DataException
(
"第"
+
rowNo
+
"行 - 城市不可为空"
);
if
(
StringUtils
.
isBlank
((
String
)
value
.
get
(
0
)))
{
sb
.
append
(
"城市不可为空;"
);
}
}
String
dealerId
=
(
String
)
value
.
get
(
1
);
if
(!
dealers
.
containsKey
(((
String
)
value
.
get
(
1
)).
trim
()))
{
if
(!
dealers
.
containsKey
(
dealerId
.
trim
()))
{
sb
.
append
(
"经销商编码错误;"
);
throw
new
DataException
(
"第"
+
rowNo
+
"行 - 经销商编码错误"
);
}
}
String
lineName
=
(
String
)
value
.
get
(
2
);
if
(
StringUtils
.
isBlank
((
String
)
value
.
get
(
2
)))
{
if
(
StringUtils
.
isBlank
(
lineName
))
{
sb
.
append
(
"系统名称不可为空;"
);
throw
new
DataException
(
"第"
+
rowNo
+
"行 - 系统名称为空"
);
}
}
String
storeName
=
(
String
)
value
.
get
(
3
);
String
storeName
=
(
String
)
value
.
get
(
3
);
if
(
StringUtils
.
isBlank
(
storeName
))
{
if
(
StringUtils
.
isBlank
(
storeName
))
{
throw
new
DataException
(
"第"
+
rowNo
+
"行 - 店铺名称为空"
);
sb
.
append
(
"店铺名称不可为空;"
);
}
else
if
(
storeList
.
contains
(
storeName
))
{
sb
.
append
(
"店铺名称重复;"
);
}
else
{
storeList
.
add
(
storeName
);
}
}
String
pattern
=
(
String
)
value
.
get
(
4
);
if
(
StringUtils
.
isBlank
((
String
)
value
.
get
(
4
)))
{
if
(
StringUtils
.
isBlank
(
pattern
))
{
sb
.
append
(
"活动模式不可为空;"
);
throw
new
DataException
(
"第"
+
rowNo
+
"行 - 活动模式为空"
);
}
}
Object
activityStartDateO
=
value
.
get
(
5
);
if
(
sb
.
length
()
>
0
)
{
if
(
StringUtils
.
isBlank
(
activityStartDateO
.
toString
())
||
!(
activityStartDateO
instanceof
Date
))
{
msg
.
append
(
"第"
).
append
(
rowNo
).
append
(
"行:"
).
append
(
sb
);
throw
new
DataException
(
"第"
+
rowNo
+
"行 - 活动开始时间为空或格式错误(请将【开始日期】【结束日期】两列设置为时间格式)"
);
}
}
Object
activityENDDateO
=
value
.
get
(
6
);
if
(
StringUtils
.
isBlank
(
activityENDDateO
.
toString
())
||
!(
activityENDDateO
instanceof
Date
))
{
throw
new
DataException
(
"第"
+
rowNo
+
"行 - 活动结束时间为空或格式错误(请将【开始日期】【结束日期】两列设置为时间格式)"
);
}
}
}
if
(
msg
.
length
()
>
0
)
{
throw
new
DataException
(
msg
.
toString
());
}
}
}
}
}
src/main/resources/mapper/EmployeeActivityPlanInfoMapper.xml
浏览文件 @
2089ae62
...
@@ -18,11 +18,11 @@
...
@@ -18,11 +18,11 @@
<result
property=
"lineName"
column=
"line_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"lineName"
column=
"line_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"storeName"
column=
"store_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"storeName"
column=
"store_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"activityPattern"
column=
"activity_pattern"
jdbcType=
"VARCHAR"
/>
<result
property=
"activityPattern"
column=
"activity_pattern"
jdbcType=
"VARCHAR"
/>
<result
property=
"activityStartDate"
column=
"activity_start_date"
jdbcType=
"DATE"
/
>
<!-- <result property="activityStartDate" column="activity_start_date" jdbcType="DATE"/>--
>
<result
property=
"activityEndDate"
column=
"activity_end_date"
jdbcType=
"DATE"
/
>
<!-- <result property="activityEndDate" column="activity_end_date" jdbcType="DATE"/>--
>
<result
property=
"hupiCount"
column=
"hupi_count"
jdbcType=
"INTEGER"
/
>
<!-- <result property="hupiCount" column="hupi_count" jdbcType="INTEGER"/>--
>
<result
property=
"quguCount"
column=
"qugu_count"
jdbcType=
"INTEGER"
/
>
<!-- <result property="quguCount" column="qugu_count" jdbcType="INTEGER"/>--
>
<result
property=
"temporaryOnTime"
column=
"temporary_on_time"
jdbcType=
"VARCHAR"
/
>
<!-- <result property="temporaryOnTime" column="temporary_on_time" jdbcType="VARCHAR"/>--
>
<result
property=
"isDelete"
column=
"is_delete"
jdbcType=
"INTEGER"
/>
<result
property=
"isDelete"
column=
"is_delete"
jdbcType=
"INTEGER"
/>
</resultMap>
</resultMap>
...
@@ -39,14 +39,12 @@
...
@@ -39,14 +39,12 @@
<insert
id=
"saveList"
>
<insert
id=
"saveList"
>
insert into employee_activity_plan_info (activity_plan_record_id, excel_filed_id, employee_id, employee_name,
insert into employee_activity_plan_info (activity_plan_record_id, excel_filed_id, employee_id, employee_name,
employee_no, activity_month, city, dealer_id, dealer_name, line_name,
employee_no, activity_month, city, dealer_id, dealer_name, line_name,
store_name, activity_pattern, activity_start_date, activity_end_date,
store_name, activity_pattern)
hupi_count, qugu_count, temporary_on_time)
values
values
<foreach
collection=
"dos"
item=
"item"
separator=
","
>
<foreach
collection=
"dos"
item=
"item"
separator=
","
>
(#{item.activityPlanRecordId},#{item.excelFiledId},#{item.employeeId},#{item.employeeName},
(#{item.activityPlanRecordId},#{item.excelFiledId},#{item.employeeId},#{item.employeeName},
#{item.employeeNo},#{item.activityMonth},#{item.city},#{item.dealerId},#{item.dealerName},#{item.lineName},
#{item.employeeNo},#{item.activityMonth},#{item.city},#{item.dealerId},#{item.dealerName},#{item.lineName},
#{item.storeName},#{item.activityPattern},#{item.activityStartDate},#{item.activityEndDate},
#{item.storeName},#{item.activityPattern})
#{item.hupiCount},#{item.quguCount},#{item.temporaryOnTime})
</foreach>
</foreach>
</insert>
</insert>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论