Commit 56b9a1c6 authored by lanbaoming's avatar lanbaoming

2024-07-02-4提交

parent 3f5ef328
......@@ -73,9 +73,9 @@ public interface TargetLogMapper extends AbstractMapper<TargetLogDO> {
@Select({
"<script>",
"select * from ecw_target_log where deleted=0 and DATE_FORMAT(create_time,'%Y-%m')='2024-06'",
"select * from ecw_target_log where deleted=0 and (DATE_FORMAT(create_time,'%Y-%m')=#{sDate} OR DATE_FORMAT(achievement_time,'%Y-%m')=#{sDate})",
"</script>"
})
List<TargetLogDO> selectList2();
List<TargetLogDO> selectList2(String sDate);
}
......@@ -38,7 +38,7 @@ public interface TargetLogService extends IService<TargetLogDO> {
*/
void deleteTargetLog(Long id);
List<TargetLogDO> selectList2();
List<TargetLogDO> selectList2(String sDate);
/**
* 获得部门业绩日志
......
......@@ -62,8 +62,8 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
private OrderConsignorService orderConsignorService;
public List<TargetLogDO> selectList2() {
return targetLogMapper.selectList2();
public List<TargetLogDO> selectList2(String sDate) {
return targetLogMapper.selectList2(sDate);
}
@Override
......@@ -334,6 +334,7 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
//收货人
CustomerDO consigneeDO =
customerService.getCustomer(info.getConsigneeVO().getCustomerId());
if (info.getType().contains("2")) {
//层级1: 订单为海外仓订单,业绩归属发货人+
//发货人归属客户经理(判断优先级最高,只要是海外仓,不需要判断其他条件)
......
......@@ -31,6 +31,8 @@ public class TargetLogJob implements JobHandler {
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) {
......@@ -42,21 +44,33 @@ public class TargetLogJob implements JobHandler {
if (vars.length > 2) {
var3 = Integer.parseInt(vars[2]);
}
sDate = vars[0] + "-" + vars[1];
}
zTest m = new zTest();
m.setTestname("开始计算业绩归属");
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);
//System.out.println("定时任务参数:" + param);
List<TargetLogDO> list = targetLogService.selectList2();
if (CollectionUtil.isNotEmpty(list)) {
for (TargetLogDO t : list
) {
targetLogService.dealTargetLogTask(t.getOrderId(),
null, t.getId());
}
for (TargetLogDO t : list) {
targetLogService.dealTargetLogTask(t.getOrderId(),
null, t.getId());
}
zTest m2 = new zTest();
m2.setTestname("业绩归属计算完毕");
......
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