Commit c05ab1d9 authored by 332784038@qq.com's avatar 332784038@qq.com

Merge branch 'dev-fix' into dev

parents 85d47e37 ab7852be
......@@ -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 编号
......
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 "";
// }
//}
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 "";
// }
//}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment