Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
promotion-service
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
promotion
promotion-service
Commits
0923f2be
提交
0923f2be
authored
2月 13, 2025
作者:
李秋林
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改计划逻辑;上传计划文件获取url中的文件名;
上级
764e15bd
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
71 行增加
和
16 行删除
+71
-16
PromPlanCoreController.java
...ion/controller/activityplanv2/PromPlanCoreController.java
+26
-8
PlanStatus.java
.../java/com/wangxiaolu/promotion/enums/plan/PlanStatus.java
+26
-0
PromPlanCoreService.java
...promotion/service/activityplanv2/PromPlanCoreService.java
+3
-1
PromPlanCoreServiceImpl.java
.../service/activityplanv2/impl/PromPlanCoreServiceImpl.java
+0
-0
AliyunUtils.java
...main/java/com/wangxiaolu/promotion/utils/AliyunUtils.java
+4
-5
ActivityPlanInfoMapper.xml
...esources/mapper/activityplanv2/ActivityPlanInfoMapper.xml
+12
-2
没有找到文件。
src/main/java/com/wangxiaolu/promotion/controller/activityplanv2/PromPlanCoreController.java
浏览文件 @
0923f2be
...
@@ -42,15 +42,11 @@ public class PromPlanCoreController {
...
@@ -42,15 +42,11 @@ public class PromPlanCoreController {
}
}
try
{
try
{
String
[]
urlArr
=
activityPlanVo
.
getExcelUrl
().
split
(
"
weda-uploader
/"
);
String
[]
urlArr
=
activityPlanVo
.
getExcelUrl
().
split
(
"/"
);
String
fileId
=
urlArr
[
urlArr
.
length
-
1
];
String
fileId
=
urlArr
[
urlArr
.
length
-
1
];
if
(
fileId
.
length
()
>
53
)
{
String
filePath
=
"/root/promotion/planv2/"
+
fileId
;
throw
new
DataException
(
RCode
.
ACTIVITY_PLAN_FILENAME_LONG
);
//todo String filePath = "/Users/a02200059/Desktop/2.0/" + fileId;
}
String
filePath
=
"/home/"
+
fileId
;
FileUtils
.
downloadExcel
(
activityPlanVo
.
getExcelUrl
(),
filePath
);
FileUtils
.
downloadExcel
(
activityPlanVo
.
getExcelUrl
(),
filePath
);
// todo String filePath = "/Users/a02200059/Desktop/测试新增v3 2.xlsx";
activityPlanVo
.
setExcelId
(
fileId
);
activityPlanVo
.
setExcelId
(
fileId
);
Map
<
String
,
Object
>
map
=
promPlanCoreService
.
selfPlanUp
(
activityPlanVo
,
filePath
);
Map
<
String
,
Object
>
map
=
promPlanCoreService
.
selfPlanUp
(
activityPlanVo
,
filePath
);
return
R
.
success
(
map
);
return
R
.
success
(
map
);
...
@@ -63,9 +59,31 @@ public class PromPlanCoreController {
...
@@ -63,9 +59,31 @@ public class PromPlanCoreController {
/**
/**
*
todo
城市经理修改
* 城市经理修改
*/
*/
@PutMapping
(
"/self/put"
)
public
R
selfPlanPut
(
@RequestBody
ActivityPlanVo
activityPlanVo
)
{
// 判断当前账号是否是城市经理
boolean
isSelf
=
manageEmployeeQueryService
.
isOneSelf
(
activityPlanVo
.
getEmployeeId
());
if
(!
isSelf
)
{
throw
new
DataException
(
RCode
.
EMP_PRIVILEGE_ERROR
);
}
try
{
String
[]
urlArr
=
activityPlanVo
.
getExcelUrl
().
split
(
"/"
);
String
fileId
=
urlArr
[
urlArr
.
length
-
1
];
String
filePath
=
"/root/promotion/planv2/"
+
fileId
;
//todo String filePath = "/Users/a02200059/Desktop/2.0/" + fileId;
FileUtils
.
downloadExcel
(
activityPlanVo
.
getExcelUrl
(),
filePath
);
activityPlanVo
.
setExcelId
(
fileId
);
Map
<
String
,
Object
>
map
=
promPlanCoreService
.
selfPlanPut
(
activityPlanVo
,
filePath
);
return
R
.
success
(
map
);
}
catch
(
DataException
e
)
{
return
new
R
(
e
.
getCode
(),
e
.
getMsg
(),
null
);
}
catch
(
Exception
e
)
{
return
R
.
fail
();
}
}
...
...
src/main/java/com/wangxiaolu/promotion/enums/plan/PlanStatus.java
0 → 100644
浏览文件 @
0923f2be
package
com
.
wangxiaolu
.
promotion
.
enums
.
plan
;
/**
* @author : liqiulin
* @date : 2025-02-12 17
* @describe :
*/
public
enum
PlanStatus
{
/**
* 是否执行:1:执行;0:未执行;
*/
EXECUTION
(
1
,
"执行"
),
NOT_EXECUTION
(
0
,
"未执行"
);
private
final
Integer
code
;
private
final
String
desc
;
PlanStatus
(
Integer
code
,
String
desc
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
}
public
Integer
getCode
()
{
return
code
;
}
}
src/main/java/com/wangxiaolu/promotion/service/activityplanv2/PromPlanCoreService.java
浏览文件 @
0923f2be
...
@@ -18,5 +18,7 @@ public interface PromPlanCoreService {
...
@@ -18,5 +18,7 @@ public interface PromPlanCoreService {
void
deletePlan
(
List
<
Long
>
planIds
);
void
deletePlan
(
List
<
Long
>
planIds
);
Map
<
String
,
Object
>
authPlanUp
(
ActivityPlanVo
activityPlanVo
,
String
filePath
);
Map
<
String
,
Object
>
authPlanUp
(
ActivityPlanVo
activityPlanVo
,
String
filePath
)
throws
DataException
;
Map
<
String
,
Object
>
selfPlanPut
(
ActivityPlanVo
activityPlanVo
,
String
filePath
)
throws
DataException
;
}
}
src/main/java/com/wangxiaolu/promotion/service/activityplanv2/impl/PromPlanCoreServiceImpl.java
浏览文件 @
0923f2be
差异被折叠。
点击展开。
src/main/java/com/wangxiaolu/promotion/utils/AliyunUtils.java
浏览文件 @
0923f2be
...
@@ -3,19 +3,18 @@ package com.wangxiaolu.promotion.utils;
...
@@ -3,19 +3,18 @@ package com.wangxiaolu.promotion.utils;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.aliyun.oss.common.utils.BinaryUtil
;
import
com.aliyun.oss.common.utils.BinaryUtil
;
import
com.aliyun.sts20150401.models.AssumeRoleResponseBody
;
import
com.aliyun.sts20150401.Client
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
org.apache.commons.codec.binary.Base64
;
import
com.aliyuncs.DefaultAcsClient
;
import
com.aliyuncs.DefaultAcsClient
;
import
com.aliyuncs.IAcsClient
;
import
com.aliyuncs.IAcsClient
;
import
com.aliyuncs.auth.sts.AssumeRoleRequest
;
import
com.aliyuncs.auth.sts.AssumeRoleRequest
;
import
com.aliyuncs.auth.sts.AssumeRoleResponse
;
import
com.aliyuncs.auth.sts.AssumeRoleResponse
;
import
com.aliyuncs.exceptions.ClientException
;
import
com.aliyuncs.exceptions.ClientException
;
import
com.aliyuncs.profile.DefaultProfile
;
import
com.aliyuncs.profile.DefaultProfile
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
org.apache.commons.codec.binary.Base64
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.aliyun.sts20150401.Client
;
import
javax.crypto.Mac
;
import
javax.crypto.Mac
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.crypto.spec.SecretKeySpec
;
...
...
src/main/resources/mapper/activityplanv2/ActivityPlanInfoMapper.xml
浏览文件 @
0923f2be
...
@@ -34,6 +34,16 @@
...
@@ -34,6 +34,16 @@
</resultMap>
</resultMap>
<resultMap
id=
"SimResultMap"
type=
"com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlanInfoDo"
>
<id
property=
"id"
column=
"id"
jdbcType=
"BIGINT"
/>
<result
property=
"employeeName"
column=
"employee_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"employeeNo"
column=
"employee_no"
jdbcType=
"VARCHAR"
/>
<result
property=
"province"
column=
"province"
jdbcType=
"VARCHAR"
/>
<result
property=
"planStatus"
column=
"plan_status"
jdbcType=
"INTEGER"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"modifyTime"
column=
"modify_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<resultMap
id=
"PlanBase"
type=
"com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlanInfoDo"
>
<resultMap
id=
"PlanBase"
type=
"com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlanInfoDo"
>
<id
property=
"id"
column=
"id"
jdbcType=
"BIGINT"
/>
<id
property=
"id"
column=
"id"
jdbcType=
"BIGINT"
/>
<result
property=
"employeeName"
column=
"employee_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"employeeName"
column=
"employee_name"
jdbcType=
"VARCHAR"
/>
...
@@ -66,8 +76,8 @@
...
@@ -66,8 +76,8 @@
</foreach>
</foreach>
</insert>
</insert>
<select
id=
"selectPlan"
resultMap=
"
Base
ResultMap"
>
<select
id=
"selectPlan"
resultMap=
"
Sim
ResultMap"
>
select
employee_name, create
_time
select
id,employee_name,employee_no,province,plan_status,create_time,modify
_time
from activity_plan_info
from activity_plan_info
where date = #{date} and store_code = #{storeCode} and is_delete = 1;
where date = #{date} and store_code = #{storeCode} and is_delete = 1;
</select>
</select>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论