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; ...@@ -16,10 +16,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
*/ */
public interface TargetLogService extends IService<TargetLogDO> { public interface TargetLogService extends IService<TargetLogDO> {
//批量处理业绩归属问题
void dealTargetLogTask(Long orderId, Date achievementTime, long targetId);
void dealTargetLogTask2(Long orderId, Date achievementTime, long targetId);
/** /**
* 创建部门业绩日志 * 创建部门业绩日志
* @param createReqVO 创建信息 * @param createReqVO 创建信息
...@@ -39,8 +35,6 @@ public interface TargetLogService extends IService<TargetLogDO> { ...@@ -39,8 +35,6 @@ public interface TargetLogService extends IService<TargetLogDO> {
*/ */
void deleteTargetLog(Long id); void deleteTargetLog(Long id);
List<TargetLogDO> selectList2(String sDate);
/** /**
* 获得部门业绩日志 * 获得部门业绩日志
* @param id 编号 * @param id 编号
......
package cn.iocoder.yudao.module.order.task; //package cn.iocoder.yudao.module.order.task;
//
import cn.hutool.core.collection.CollectionUtil; //import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil; //import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler; //import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob; //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.order.zTest;
import cn.iocoder.yudao.module.order.dal.dataobject.targetLog.TargetLogDO; //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.dal.mysql.order.ZTestMapper2;
import cn.iocoder.yudao.module.order.service.targetLog.TargetLogServiceImpl; //import cn.iocoder.yudao.module.order.service.targetLog.TargetLogServiceImpl;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; //import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
import javax.annotation.Resource; //import javax.annotation.Resource;
import java.util.Date; //import java.util.Date;
import java.util.List; //import java.util.List;
//
@Component //@Component
@TenantJob //@TenantJob
@Slf4j //@Slf4j
public class TargetLogJob implements JobHandler { //public class TargetLogJob implements JobHandler {
@Resource // @Resource
ZTestMapper2 zTestMapper2; // ZTestMapper2 zTestMapper2;
//
@Resource // @Resource
TargetLogServiceImpl targetLogService; // TargetLogServiceImpl targetLogService;
//
@Override // @Override
public String execute(String param) throws Exception { // public String execute(String param) throws Exception {
int var1 = 30; // int var1 = 30;
int var2 = 3; // int var2 = 3;
int var3 = 6; // int var3 = 6;
String sDate = ""; // String sDate = "";
//
if (StringUtils.isNotBlank(param)) { // if (StringUtils.isNotBlank(param)) {
String[] vars = param.split(StrUtil.COMMA); // String[] vars = param.split(StrUtil.COMMA);
if (vars.length > 0) { // if (vars.length > 0) {
var1 = Integer.parseInt(vars[0]); // var1 = Integer.parseInt(vars[0]);
} // }
if (vars.length > 1) { // if (vars.length > 1) {
var2 = Integer.parseInt(vars[1]); // var2 = Integer.parseInt(vars[1]);
} // }
if (vars.length > 2) { // if (vars.length > 2) {
var3 = Integer.parseInt(vars[2]); // var3 = Integer.parseInt(vars[2]);
} // }
sDate = vars[0] + "-" + vars[1]; // sDate = vars[0] + "-" + vars[1];
} // }
//
zTest m = new zTest(); // zTest m = new zTest();
if (sDate == null || sDate.length() == 0) { // if (sDate == null || sDate.length() == 0) {
m.setTestname("日期参数为空。"); // m.setTestname("日期参数为空。");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper2.insert(m); // zTestMapper2.insert(m);
return ""; // return "";
} // }
//
//System.out.println("定时任务参数:" + param); // //System.out.println("定时任务参数:" + param);
List<TargetLogDO> list = targetLogService.selectList2(sDate); // List<TargetLogDO> list = targetLogService.selectList2(sDate);
if (CollectionUtil.isEmpty(list)) { // if (CollectionUtil.isEmpty(list)) {
m.setTestname(sDate+"获取业绩归属数据为空"); // m.setTestname(sDate+"获取业绩归属数据为空");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper2.insert(m); // zTestMapper2.insert(m);
} // }
//
m.setTestname(sDate+"开始处理业绩归属数据:"+list.size()); // m.setTestname(sDate+"开始处理业绩归属数据:"+list.size());
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper2.insert(m); // zTestMapper2.insert(m);
//
for (TargetLogDO t : list) { // for (TargetLogDO t : list) {
targetLogService.dealTargetLogTask(t.getOrderId(), // targetLogService.dealTargetLogTask(t.getOrderId(),
null, t.getId()); // null, t.getId());
} // }
zTest m2 = new zTest(); // zTest m2 = new zTest();
m2.setTestname("业绩归属计算完毕"); // m2.setTestname("业绩归属计算完毕");
m2.setCreatedate(new Date()); // m2.setCreatedate(new Date());
zTestMapper2.insert(m2); // zTestMapper2.insert(m2);
return ""; // return "";
} // }
} //}
package cn.iocoder.yudao.module.order.task; //package cn.iocoder.yudao.module.order.task;
//
import cn.hutool.core.collection.CollectionUtil; //import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil; //import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler; //import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob; //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.order.zTest;
import cn.iocoder.yudao.module.order.dal.dataobject.targetLog.TargetLogDO; //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.dal.mysql.order.ZTestMapper2;
import cn.iocoder.yudao.module.order.service.targetLog.TargetLogServiceImpl; //import cn.iocoder.yudao.module.order.service.targetLog.TargetLogServiceImpl;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; //import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
import javax.annotation.Resource; //import javax.annotation.Resource;
import java.util.Date; //import java.util.Date;
import java.util.List; //import java.util.List;
//
@Component //@Component
@TenantJob //@TenantJob
@Slf4j //@Slf4j
public class TestTargetLogJob implements JobHandler { //public class TestTargetLogJob implements JobHandler {
//
@Resource // @Resource
ZTestMapper2 zTestMapper2; // ZTestMapper2 zTestMapper2;
//
@Resource // @Resource
TargetLogServiceImpl targetLogService; // TargetLogServiceImpl targetLogService;
//
@Override // @Override
public String execute(String param) throws Exception { // public String execute(String param) throws Exception {
int var1 = 30; // int var1 = 30;
int var2 = 3; // int var2 = 3;
int var3 = 6; // int var3 = 6;
String sDate = ""; // String sDate = "";
//
if (StringUtils.isNotBlank(param)) { // if (StringUtils.isNotBlank(param)) {
String[] vars = param.split(StrUtil.COMMA); // String[] vars = param.split(StrUtil.COMMA);
if (vars.length > 0) { // if (vars.length > 0) {
var1 = Integer.parseInt(vars[0]); // var1 = Integer.parseInt(vars[0]);
} // }
if (vars.length > 1) { // if (vars.length > 1) {
var2 = Integer.parseInt(vars[1]); // var2 = Integer.parseInt(vars[1]);
} // }
if (vars.length > 2) { // if (vars.length > 2) {
var3 = Integer.parseInt(vars[2]); // var3 = Integer.parseInt(vars[2]);
} // }
sDate = vars[0] + "-" + vars[1]; // sDate = vars[0] + "-" + vars[1];
} // }
//
zTest m = new zTest(); // zTest m = new zTest();
if (sDate == null || sDate.length() == 0) { // if (sDate == null || sDate.length() == 0) {
m.setTestname("日期参数为空。"); // m.setTestname("日期参数为空。");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper2.insert(m); // zTestMapper2.insert(m);
return ""; // return "";
} // }
//
//System.out.println("定时任务参数:" + param); // //System.out.println("定时任务参数:" + param);
List<TargetLogDO> list = targetLogService.selectList2(sDate); // List<TargetLogDO> list = targetLogService.selectList2(sDate);
//
if (CollectionUtil.isEmpty(list)) { // if (CollectionUtil.isEmpty(list)) {
m.setTestname(sDate+"获取业绩归属数据为空"); // m.setTestname(sDate+"获取业绩归属数据为空");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper2.insert(m); // zTestMapper2.insert(m);
} // }
//
m.setTestname(sDate+"开始处理业绩归属数据:"+list.size()); // m.setTestname(sDate+"开始处理业绩归属数据:"+list.size());
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper2.insert(m); // zTestMapper2.insert(m);
//
for (TargetLogDO t : list) { // for (TargetLogDO t : list) {
targetLogService.dealTargetLogTask2(t.getOrderId(), // targetLogService.dealTargetLogTask2(t.getOrderId(),
null, t.getId()); // null, t.getId());
} // }
zTest m2 = new zTest(); // zTest m2 = new zTest();
m2.setTestname("业绩归属计算完毕"); // m2.setTestname("业绩归属计算完毕");
m2.setCreatedate(new Date()); // m2.setCreatedate(new Date());
zTestMapper2.insert(m2); // zTestMapper2.insert(m2);
return ""; // 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