Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
c05ab1d9
Commit
c05ab1d9
authored
Jul 22, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-fix' into dev
parents
85d47e37
ab7852be
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
182 additions
and
902 deletions
+182
-902
TargetLogService.java
...udao/module/order/service/targetLog/TargetLogService.java
+0
-6
TargetLogServiceImpl.java
.../module/order/service/targetLog/TargetLogServiceImpl.java
+20
-734
TargetLogJob.java
...java/cn/iocoder/yudao/module/order/task/TargetLogJob.java
+80
-80
TestTargetLogJob.java
.../cn/iocoder/yudao/module/order/task/TestTargetLogJob.java
+82
-82
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/targetLog/TargetLogService.java
View file @
c05ab1d9
...
...
@@ -16,10 +16,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
*/
public
interface
TargetLogService
extends
IService
<
TargetLogDO
>
{
//批量处理业绩归属问题
void
dealTargetLogTask
(
Long
orderId
,
Date
achievementTime
,
long
targetId
);
void
dealTargetLogTask2
(
Long
orderId
,
Date
achievementTime
,
long
targetId
);
/**
* 创建部门业绩日志
* @param createReqVO 创建信息
...
...
@@ -39,8 +35,6 @@ public interface TargetLogService extends IService<TargetLogDO> {
*/
void
deleteTargetLog
(
Long
id
);
List
<
TargetLogDO
>
selectList2
(
String
sDate
);
/**
* 获得部门业绩日志
* @param id 编号
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/targetLog/TargetLogServiceImpl.java
View file @
c05ab1d9
This diff is collapsed.
Click to expand it.
yudao-module-order/yudao-module-order-rest/src/main/java/cn/iocoder/yudao/module/order/task/TargetLogJob.java
View file @
c05ab1d9
package
cn
.
iocoder
.
yudao
.
module
.
order
.
task
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.iocoder.yudao.framework.quartz.core.handler.JobHandler
;
import
cn.iocoder.yudao.framework.tenant.core.job.TenantJob
;
import
cn.iocoder.yudao.module.order.dal.dataobject.order.zTest
;
import
cn.iocoder.yudao.module.order.dal.dataobject.targetLog.TargetLogDO
;
import
cn.iocoder.yudao.module.order.dal.mysql.order.ZTestMapper2
;
import
cn.iocoder.yudao.module.order.service.targetLog.TargetLogServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
@Component
@TenantJob
@Slf4j
public
class
TargetLogJob
implements
JobHandler
{
@Resource
ZTestMapper2
zTestMapper2
;
@Resource
TargetLogServiceImpl
targetLogService
;
@Override
public
String
execute
(
String
param
)
throws
Exception
{
int
var1
=
30
;
int
var2
=
3
;
int
var3
=
6
;
String
sDate
=
""
;
if
(
StringUtils
.
isNotBlank
(
param
))
{
String
[]
vars
=
param
.
split
(
StrUtil
.
COMMA
);
if
(
vars
.
length
>
0
)
{
var1
=
Integer
.
parseInt
(
vars
[
0
]);
}
if
(
vars
.
length
>
1
)
{
var2
=
Integer
.
parseInt
(
vars
[
1
]);
}
if
(
vars
.
length
>
2
)
{
var3
=
Integer
.
parseInt
(
vars
[
2
]);
}
sDate
=
vars
[
0
]
+
"-"
+
vars
[
1
];
}
zTest
m
=
new
zTest
();
if
(
sDate
==
null
||
sDate
.
length
()
==
0
)
{
m
.
setTestname
(
"日期参数为空。"
);
m
.
setCreatedate
(
new
Date
());
zTestMapper2
.
insert
(
m
);
return
""
;
}
//System.out.println("定时任务参数:" + param);
List
<
TargetLogDO
>
list
=
targetLogService
.
selectList2
(
sDate
);
if
(
CollectionUtil
.
isEmpty
(
list
))
{
m
.
setTestname
(
sDate
+
"获取业绩归属数据为空"
);
m
.
setCreatedate
(
new
Date
());
zTestMapper2
.
insert
(
m
);
}
m
.
setTestname
(
sDate
+
"开始处理业绩归属数据:"
+
list
.
size
());
m
.
setCreatedate
(
new
Date
());
zTestMapper2
.
insert
(
m
);
for
(
TargetLogDO
t
:
list
)
{
targetLogService
.
dealTargetLogTask
(
t
.
getOrderId
(),
null
,
t
.
getId
());
}
zTest
m2
=
new
zTest
();
m2
.
setTestname
(
"业绩归属计算完毕"
);
m2
.
setCreatedate
(
new
Date
());
zTestMapper2
.
insert
(
m2
);
return
""
;
}
}
//
package cn.iocoder.yudao.module.order.task;
//
//
import cn.hutool.core.collection.CollectionUtil;
//
import cn.hutool.core.util.StrUtil;
//
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
//
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
//
import cn.iocoder.yudao.module.order.dal.dataobject.order.zTest;
//
import cn.iocoder.yudao.module.order.dal.dataobject.targetLog.TargetLogDO;
//
import cn.iocoder.yudao.module.order.dal.mysql.order.ZTestMapper2;
//
import cn.iocoder.yudao.module.order.service.targetLog.TargetLogServiceImpl;
//
import lombok.extern.slf4j.Slf4j;
//
import org.apache.commons.lang3.StringUtils;
//
import org.springframework.stereotype.Component;
//
//
import javax.annotation.Resource;
//
import java.util.Date;
//
import java.util.List;
//
//
@Component
//
@TenantJob
//
@Slf4j
//
public class TargetLogJob implements JobHandler {
//
@Resource
//
ZTestMapper2 zTestMapper2;
//
//
@Resource
//
TargetLogServiceImpl targetLogService;
//
//
@Override
//
public String execute(String param) throws Exception {
//
int var1 = 30;
//
int var2 = 3;
//
int var3 = 6;
//
String sDate = "";
//
//
if (StringUtils.isNotBlank(param)) {
//
String[] vars = param.split(StrUtil.COMMA);
//
if (vars.length > 0) {
//
var1 = Integer.parseInt(vars[0]);
//
}
//
if (vars.length > 1) {
//
var2 = Integer.parseInt(vars[1]);
//
}
//
if (vars.length > 2) {
//
var3 = Integer.parseInt(vars[2]);
//
}
//
sDate = vars[0] + "-" + vars[1];
//
}
//
//
zTest m = new zTest();
//
if (sDate == null || sDate.length() == 0) {
//
m.setTestname("日期参数为空。");
//
m.setCreatedate(new Date());
//
zTestMapper2.insert(m);
//
return "";
//
}
//
//
//System.out.println("定时任务参数:" + param);
//
List<TargetLogDO> list = targetLogService.selectList2(sDate);
//
if (CollectionUtil.isEmpty(list)) {
//
m.setTestname(sDate+"获取业绩归属数据为空");
//
m.setCreatedate(new Date());
//
zTestMapper2.insert(m);
//
}
//
//
m.setTestname(sDate+"开始处理业绩归属数据:"+list.size());
//
m.setCreatedate(new Date());
//
zTestMapper2.insert(m);
//
//
for (TargetLogDO t : list) {
//
targetLogService.dealTargetLogTask(t.getOrderId(),
//
null, t.getId());
//
}
//
zTest m2 = new zTest();
//
m2.setTestname("业绩归属计算完毕");
//
m2.setCreatedate(new Date());
//
zTestMapper2.insert(m2);
//
return "";
//
}
//
}
yudao-module-order/yudao-module-order-rest/src/main/java/cn/iocoder/yudao/module/order/task/TestTargetLogJob.java
View file @
c05ab1d9
package
cn
.
iocoder
.
yudao
.
module
.
order
.
task
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.iocoder.yudao.framework.quartz.core.handler.JobHandler
;
import
cn.iocoder.yudao.framework.tenant.core.job.TenantJob
;
import
cn.iocoder.yudao.module.order.dal.dataobject.order.zTest
;
import
cn.iocoder.yudao.module.order.dal.dataobject.targetLog.TargetLogDO
;
import
cn.iocoder.yudao.module.order.dal.mysql.order.ZTestMapper2
;
import
cn.iocoder.yudao.module.order.service.targetLog.TargetLogServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
@Component
@TenantJob
@Slf4j
public
class
TestTargetLogJob
implements
JobHandler
{
@Resource
ZTestMapper2
zTestMapper2
;
@Resource
TargetLogServiceImpl
targetLogService
;
@Override
public
String
execute
(
String
param
)
throws
Exception
{
int
var1
=
30
;
int
var2
=
3
;
int
var3
=
6
;
String
sDate
=
""
;
if
(
StringUtils
.
isNotBlank
(
param
))
{
String
[]
vars
=
param
.
split
(
StrUtil
.
COMMA
);
if
(
vars
.
length
>
0
)
{
var1
=
Integer
.
parseInt
(
vars
[
0
]);
}
if
(
vars
.
length
>
1
)
{
var2
=
Integer
.
parseInt
(
vars
[
1
]);
}
if
(
vars
.
length
>
2
)
{
var3
=
Integer
.
parseInt
(
vars
[
2
]);
}
sDate
=
vars
[
0
]
+
"-"
+
vars
[
1
];
}
zTest
m
=
new
zTest
();
if
(
sDate
==
null
||
sDate
.
length
()
==
0
)
{
m
.
setTestname
(
"日期参数为空。"
);
m
.
setCreatedate
(
new
Date
());
zTestMapper2
.
insert
(
m
);
return
""
;
}
//System.out.println("定时任务参数:" + param);
List
<
TargetLogDO
>
list
=
targetLogService
.
selectList2
(
sDate
);
if
(
CollectionUtil
.
isEmpty
(
list
))
{
m
.
setTestname
(
sDate
+
"获取业绩归属数据为空"
);
m
.
setCreatedate
(
new
Date
());
zTestMapper2
.
insert
(
m
);
}
m
.
setTestname
(
sDate
+
"开始处理业绩归属数据:"
+
list
.
size
());
m
.
setCreatedate
(
new
Date
());
zTestMapper2
.
insert
(
m
);
for
(
TargetLogDO
t
:
list
)
{
targetLogService
.
dealTargetLogTask2
(
t
.
getOrderId
(),
null
,
t
.
getId
());
}
zTest
m2
=
new
zTest
();
m2
.
setTestname
(
"业绩归属计算完毕"
);
m2
.
setCreatedate
(
new
Date
());
zTestMapper2
.
insert
(
m2
);
return
""
;
}
}
//
package cn.iocoder.yudao.module.order.task;
//
//
import cn.hutool.core.collection.CollectionUtil;
//
import cn.hutool.core.util.StrUtil;
//
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
//
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
//
import cn.iocoder.yudao.module.order.dal.dataobject.order.zTest;
//
import cn.iocoder.yudao.module.order.dal.dataobject.targetLog.TargetLogDO;
//
import cn.iocoder.yudao.module.order.dal.mysql.order.ZTestMapper2;
//
import cn.iocoder.yudao.module.order.service.targetLog.TargetLogServiceImpl;
//
import lombok.extern.slf4j.Slf4j;
//
import org.apache.commons.lang3.StringUtils;
//
import org.springframework.stereotype.Component;
//
//
import javax.annotation.Resource;
//
import java.util.Date;
//
import java.util.List;
//
//
@Component
//
@TenantJob
//
@Slf4j
//
public class TestTargetLogJob implements JobHandler {
//
//
@Resource
//
ZTestMapper2 zTestMapper2;
//
//
@Resource
//
TargetLogServiceImpl targetLogService;
//
//
@Override
//
public String execute(String param) throws Exception {
//
int var1 = 30;
//
int var2 = 3;
//
int var3 = 6;
//
String sDate = "";
//
//
if (StringUtils.isNotBlank(param)) {
//
String[] vars = param.split(StrUtil.COMMA);
//
if (vars.length > 0) {
//
var1 = Integer.parseInt(vars[0]);
//
}
//
if (vars.length > 1) {
//
var2 = Integer.parseInt(vars[1]);
//
}
//
if (vars.length > 2) {
//
var3 = Integer.parseInt(vars[2]);
//
}
//
sDate = vars[0] + "-" + vars[1];
//
}
//
//
zTest m = new zTest();
//
if (sDate == null || sDate.length() == 0) {
//
m.setTestname("日期参数为空。");
//
m.setCreatedate(new Date());
//
zTestMapper2.insert(m);
//
return "";
//
}
//
//
//System.out.println("定时任务参数:" + param);
//
List<TargetLogDO> list = targetLogService.selectList2(sDate);
//
//
if (CollectionUtil.isEmpty(list)) {
//
m.setTestname(sDate+"获取业绩归属数据为空");
//
m.setCreatedate(new Date());
//
zTestMapper2.insert(m);
//
}
//
//
m.setTestname(sDate+"开始处理业绩归属数据:"+list.size());
//
m.setCreatedate(new Date());
//
zTestMapper2.insert(m);
//
//
for (TargetLogDO t : list) {
//
targetLogService.dealTargetLogTask2(t.getOrderId(),
//
null, t.getId());
//
}
//
zTest m2 = new zTest();
//
m2.setTestname("业绩归属计算完毕");
//
m2.setCreatedate(new Date());
//
zTestMapper2.insert(m2);
//
return "";
//
}
//
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment