Commit 4b41b72a by yao.xiao

去除无团队不能保存目标判断

parent ad776e3e
...@@ -1324,20 +1324,22 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1324,20 +1324,22 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
for (MktLeadsAssignedTrack info : mktLeadsAssignedTracks){ for (MktLeadsAssignedTrack info : mktLeadsAssignedTracks){
boolean isStatistics = false; boolean isStatistics = false;
String time = CommonUtil.dateParseString(info.getTrackTime(), "yyyy-MM-dd"); String time = CommonUtil.dateParseString(info.getTrackTime(), "yyyy-MM-dd");
if (CommonUtil.isThisMonth(time)){ if (!CommonUtil.isNullOrBlank(time)){
scoreMonth += info.getTrackScore(); if (CommonUtil.isThisMonth(time)){
if (CommonUtil.isToday(time)){ scoreMonth += info.getTrackScore();
scoreDay += info.getTrackScore(); if (CommonUtil.isToday(time)){
scoreDay += info.getTrackScore();
}
isStatistics = true;
}
if (CommonUtil.isThisWeek(time)){
scoreWeek += info.getTrackScore();
isStatistics = true;
}
//既不属于月也不属于周跳出
if (!isStatistics){
break;
} }
isStatistics = true;
}
if (CommonUtil.isThisWeek(time)){
scoreWeek += info.getTrackScore();
isStatistics = true;
}
//既不属于月也不属于周跳出
if (!isStatistics){
break;
} }
} }
//计算新增商机个数 //计算新增商机个数
...@@ -1394,7 +1396,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1394,7 +1396,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
Integer goalsType = requestVO.getGoalsType(); Integer goalsType = requestVO.getGoalsType();
//初始化之前数据 全部修改为不启用 //初始化之前数据 全部修改为不启用
initializationAction(practitionerId,year,goalsType); initializationAction(practitionerId,year,goalsType);
AclPractitionerSubordinateSystem subordinate; AclPractitionerSubordinateSystem subordinate = new AclPractitionerSubordinateSystem();
if (goalsType == 2){ if (goalsType == 2){
//查询经纪人所在团队 //查询经纪人所在团队
List<AclPractitionerSubordinateSystem> subordinates = aclPractitionerSubordinateSystemDALService.findByOwnerPractitionerId(practitionerId); List<AclPractitionerSubordinateSystem> subordinates = aclPractitionerSubordinateSystemDALService.findByOwnerPractitionerId(practitionerId);
...@@ -1403,13 +1405,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1403,13 +1405,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return responseVO; return responseVO;
} }
subordinate = subordinates.get(0); subordinate = subordinates.get(0);
}else { }//else {
subordinate = aclPractitionerSubordinateSystemDALService.findByPractitionerId(practitionerId); // subordinate = aclPractitionerSubordinateSystemDALService.findByPractitionerId(practitionerId);
if (subordinate == null){ // if (subordinate == null){
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830018"))); // responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830018")));
return responseVO; // return responseVO;
} // }
} // }
//保存年目标 //保存年目标
Date date = new Date(); Date date = new Date();
saveYearGoal(requestVO,practitionerId,date,year,goalsType,subordinate); saveYearGoal(requestVO,practitionerId,date,year,goalsType,subordinate);
...@@ -1461,7 +1463,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1461,7 +1463,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
mktLeadsGoals.setPractitionerId(practitionerId); mktLeadsGoals.setPractitionerId(practitionerId);
mktLeadsGoals.setCurrentYear(year); mktLeadsGoals.setCurrentYear(year);
mktLeadsGoals.setGoalsType(goalsType); mktLeadsGoals.setGoalsType(goalsType);
AclPractitionerSubordinateSystem subordinateSystem ; AclPractitionerSubordinateSystem subordinateSystem = new AclPractitionerSubordinateSystem();
if (goalsType == 2){ if (goalsType == 2){
List<AclPractitionerSubordinateSystem> subordinateSystems = aclPractitionerSubordinateSystemDALService.findByOwnerPractitionerId(practitionerId); List<AclPractitionerSubordinateSystem> subordinateSystems = aclPractitionerSubordinateSystemDALService.findByOwnerPractitionerId(practitionerId);
if (subordinateSystems.isEmpty()){ if (subordinateSystems.isEmpty()){
...@@ -1469,13 +1471,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1469,13 +1471,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return responseVO; return responseVO;
} }
subordinateSystem = subordinateSystems.get(0); subordinateSystem = subordinateSystems.get(0);
}else { }//else {
subordinateSystem = aclPractitionerSubordinateSystemDALService.findByPractitionerId(practitionerId); // subordinateSystem = aclPractitionerSubordinateSystemDALService.findByPractitionerId(practitionerId);
if (subordinateSystem == null){ // if (subordinateSystem == null){
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830018"))); // responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830018")));
return responseVO; // return responseVO;
} // }
} // }
mktLeadsGoals.setSubordinateSystemId(subordinateSystem.getId()); mktLeadsGoals.setSubordinateSystemId(subordinateSystem.getId());
List<MktLeadsGoals> mktLeadsGoalsList = mktLeadsGoalsDALService.findByMktLeadsGoals(mktLeadsGoals); List<MktLeadsGoals> mktLeadsGoalsList = mktLeadsGoalsDALService.findByMktLeadsGoals(mktLeadsGoals);
List<SalesTargetMonth> salesTargetMonthList = new ArrayList<>(); List<SalesTargetMonth> salesTargetMonthList = new ArrayList<>();
......
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