Commit 4b41b72a by yao.xiao

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

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