Commit 111d8f2c by Water Wang

resolve conflict

parents 7ee2b80b 491394c9
...@@ -221,7 +221,6 @@ public class PractitionerController { ...@@ -221,7 +221,6 @@ public class PractitionerController {
} }
/** /**
<<<<<<< HEAD
* 经纪人-ydLife查询此经纪人总分数 按年月周日 分别统计 新增商机个数 达成率 * 经纪人-ydLife查询此经纪人总分数 按年月周日 分别统计 新增商机个数 达成率
* @param requestVO 请求数据 * @param requestVO 请求数据
* @return 响应数据 * @return 响应数据
...@@ -234,6 +233,19 @@ public class PractitionerController { ...@@ -234,6 +233,19 @@ public class PractitionerController {
result.setData(responseVO); result.setData(responseVO);
return result; return result;
} }
/**
* 团队长--设置增员目标
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/potentialGoalsSetting")
public Object potentialGoalsSetting(@RequestBody PotentialGoalsSettingRequestVO requestVO){
JsonResult result = new JsonResult();
PotentialGoalsSettingResponseVO responseVO = practitionerService.potentialGoalsSetting(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/** /**
* 经纪人-保存销售目标 * 经纪人-保存销售目标
...@@ -248,6 +260,19 @@ public class PractitionerController { ...@@ -248,6 +260,19 @@ public class PractitionerController {
result.setData(responseVO); result.setData(responseVO);
return result; return result;
} }
/**
* 团队长--查询增员目标
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/potentialGoalsQuery")
public Object potentialGoalsQuery(@RequestBody PotentialGoalsQueryRequestVO requestVO){
JsonResult result = new JsonResult();
PotentialGoalsQueryResponseVO responseVO = practitionerService.potentialGoalsQuery(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/** /**
* 经纪人-查询销售目标 * 经纪人-查询销售目标
...@@ -262,6 +287,19 @@ public class PractitionerController { ...@@ -262,6 +287,19 @@ public class PractitionerController {
result.setData(responseVO); result.setData(responseVO);
return result; return result;
} }
/**
* 团队长--查询增员目标活动量
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/potentialGoalsActionsQuery")
public Object potentialGoalsActionsQuery(@RequestBody PotentialGoalsActionsQueryRequestVO requestVO){
JsonResult result = new JsonResult();
PotentialGoalsActionsQueryResponseVO responseVO = practitionerService.potentialGoalsActionsQuery(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/** /**
* 经纪人-保存月均目标 * 经纪人-保存月均目标
...@@ -276,6 +314,19 @@ public class PractitionerController { ...@@ -276,6 +314,19 @@ public class PractitionerController {
result.setData(responseVO); result.setData(responseVO);
return result; return result;
} }
/**
* 团队长--更新增员目标活动量
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/potentialGoalsActionsUpdate")
public Object potentialGoalsActionsUpdate(@RequestBody PotentialGoalsActionsUpdateRequestVO requestVO){
JsonResult result = new JsonResult();
PotentialGoalsActionsUpdateResponseVO responseVO = practitionerService.potentialGoalsActionsUpdate(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/** /**
* 团队长-查看组员得分均值 * 团队长-查看组员得分均值
...@@ -290,6 +341,19 @@ public class PractitionerController { ...@@ -290,6 +341,19 @@ public class PractitionerController {
result.setData(responseVO); result.setData(responseVO);
return result; return result;
} }
/**
* 团队长--查看目前活动量
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/potentialActivityQuery")
public Object potentialActivityQuery(@RequestBody PotentialActivityQueryRequestVO requestVO){
JsonResult result = new JsonResult();
PotentialActivityQueryResponseVO responseVO = practitionerService.potentialActivityQuery(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/** /**
* 队员销售活动量列表 * 队员销售活动量列表
......
package com.yd.api.practitioner.service; package com.yd.api.practitioner.service;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsActionsUpdateResponseVO;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsQueryResponseVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO; import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO; import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO;
import com.yd.api.practitioner.vo.media.MediaGetReqVO; import com.yd.api.practitioner.vo.media.MediaGetReqVO;
...@@ -167,4 +169,37 @@ public interface PractitionerService { ...@@ -167,4 +169,37 @@ public interface PractitionerService {
* @return * @return
*/ */
SubordinateSystemMemberQueryResponseVO subordinateSystemMemberQuery(SubordinateSystemMemberQueryRequestVO requestVO); SubordinateSystemMemberQueryResponseVO subordinateSystemMemberQuery(SubordinateSystemMemberQueryRequestVO requestVO);
/**
* 保存增员目标
* @param requestVO 请求数据
* @return 响应数据
*/
PotentialGoalsSettingResponseVO potentialGoalsSetting(PotentialGoalsSettingRequestVO requestVO);
/**
* 查询增员目标
* @param requestVO 请求数据
* @return 响应数据
*/
PotentialGoalsQueryResponseVO potentialGoalsQuery(PotentialGoalsQueryRequestVO requestVO);
/**
* 查询增员目标活动量
* @param requestVO 请求数据
* @return 响应数据
*/
PotentialGoalsActionsQueryResponseVO potentialGoalsActionsQuery(PotentialGoalsActionsQueryRequestVO requestVO);
/**
* 团队长--更新增员目标活动量
* @param requestVO 请求数据
* @return 响应数据
*/
PotentialGoalsActionsUpdateResponseVO potentialGoalsActionsUpdate(PotentialGoalsActionsUpdateRequestVO requestVO);
/**
* 团队长--查看目前自己的活动量
* @param requestVO 请求数据
* @return 响应数据
*/
PotentialActivityQueryResponseVO potentialActivityQuery(PotentialActivityQueryRequestVO requestVO);
} }
...@@ -4,6 +4,8 @@ import com.github.pagehelper.PageHelper; ...@@ -4,6 +4,8 @@ import com.github.pagehelper.PageHelper;
import com.yd.api.customer.service.CustomerService; import com.yd.api.customer.service.CustomerService;
import com.yd.api.customer.vo.register.RegisterRequestVO; import com.yd.api.customer.vo.register.RegisterRequestVO;
import com.yd.api.customer.vo.register.RegisterResponseVO; import com.yd.api.customer.vo.register.RegisterResponseVO;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsActionsUpdateResponseVO;
import com.yd.api.practitioner.vo.recruit.PotentialGoalsQueryResponseVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginBasicInfo; import com.yd.api.practitioner.vo.login.PractitionerLoginBasicInfo;
import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO; import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO; import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO;
...@@ -29,10 +31,7 @@ import com.yd.dal.entity.marketing.MktLeadsAssignedTrack; ...@@ -29,10 +31,7 @@ import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import com.yd.dal.entity.marketing.MktLeadsAssigneds; import com.yd.dal.entity.marketing.MktLeadsAssigneds;
import com.yd.dal.entity.marketing.MktLeadsGoals; import com.yd.dal.entity.marketing.MktLeadsGoals;
import com.yd.dal.entity.marketing.MktLeadsPool; import com.yd.dal.entity.marketing.MktLeadsPool;
import com.yd.dal.entity.meta.MdDropOptions; import com.yd.dal.entity.meta.*;
import com.yd.dal.entity.meta.MdMkCampaign;
import com.yd.dal.entity.meta.MdTag;
import com.yd.dal.entity.meta.ObjectCollectionTagged;
import com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo; import com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo;
import com.yd.dal.entity.order.PoOrder; import com.yd.dal.entity.order.PoOrder;
import com.yd.dal.entity.practitioner.opportunity.PlayerSalesActivityInfo; import com.yd.dal.entity.practitioner.opportunity.PlayerSalesActivityInfo;
...@@ -146,6 +145,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -146,6 +145,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private AclPractitionerSettingDALService aclpractitionersettingDALService; private AclPractitionerSettingDALService aclpractitionersettingDALService;
@Autowired @Autowired
private AclCustomerFortuneDALService aclCustomerFortuneDALService; private AclCustomerFortuneDALService aclCustomerFortuneDALService;
@Autowired
private AclPractitionerPotentialGoalsDALService aclPractitionerPotentialGoalsDALService;
@Autowired
private MdGoalsCalculateExpressionDALService mdGoalsCalculateExpressionDALService;
@Autowired
private AclPractitionerPotentialGoalsActionsDALService aclPractitionerPotentialGoalsActionsDALService;
@Override @Override
public PractitionerLoginResponseVO practitionerLogin(PractitionerLoginRequestVO requestVO) { public PractitionerLoginResponseVO practitionerLogin(PractitionerLoginRequestVO requestVO) {
...@@ -809,26 +814,33 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -809,26 +814,33 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
if(practitioner == null){ if(practitioner == null){
//判断该增员是否已存在 //判断该增员是否已存在
Long potentialId = requestVO.getPotentialId(); Long potentialId = requestVO.getPotentialId();
String timeToOnboarding = requestVO.getTimeToOnboarding();
List<AclPractitionerPotential> practitionerPotentialList = aclPractitionerPotentialDALService.findByMobileNo(mobileNo,1); List<AclPractitionerPotential> practitionerPotentialList = aclPractitionerPotentialDALService.findByMobileNo(mobileNo,1);
if(potentialId != null || practitionerPotentialList.isEmpty()){ if(potentialId != null || practitionerPotentialList.isEmpty()){
String remark = requestVO.getRemark();
AclPractitionerPotential practitionerPotential = new AclPractitionerPotential(); AclPractitionerPotential practitionerPotential = new AclPractitionerPotential();
BeanUtils.copyProperties(requestVO,practitionerPotential); BeanUtils.copyProperties(requestVO,practitionerPotential);
practitionerPotential.setCustomerId(customerId); practitionerPotential.setCustomerId(customerId);
practitionerPotential.setPractitionerAssignedIds(practitionerId.toString()); practitionerPotential.setPractitionerAssignedIds(practitionerId.toString());
practitionerPotential.setCreatedAt(new Date());
practitionerPotential.setCreatedBy(practitionerId);
practitionerPotential.setCreatorType(2);
practitionerPotential.setIsActive(1); practitionerPotential.setIsActive(1);
if(potentialId != null){ if(potentialId != null){
practitionerPotential.setId(potentialId); practitionerPotential.setId(potentialId);
practitionerPotential.setUpdatedAt(new Date());
practitionerPotential.setUpdatedBy(practitionerId);
practitionerPotential.setUpdaterType(2);
aclPractitionerPotentialDALService.update(practitionerPotential); aclPractitionerPotentialDALService.update(practitionerPotential);
//更新该经纪人的备注
updateRecruitRemark(potentialId,practitionerId,remark,timeToOnboarding);
}else{ }else{
practitionerPotential.setCreatedAt(new Date());
practitionerPotential.setCreatedBy(practitionerId);
practitionerPotential.setCreatorType(2);
aclPractitionerPotentialDALService.save(practitionerPotential); aclPractitionerPotentialDALService.save(practitionerPotential);
potentialId = practitionerPotential.getId(); potentialId = practitionerPotential.getId();
//如果已经分配团队长,则在追踪表中增加记录 //如果已经分配团队长,则在追踪表中增加记录
List<Long> practitionerPotentialIdList = new ArrayList<>(); List<Long> practitionerPotentialIdList = new ArrayList<>();
practitionerPotentialIdList.add(potentialId); practitionerPotentialIdList.add(potentialId);
addPractitionerPotentialTrack(practitionerPotentialIdList, practitionerId); addPractitionerPotentialTrack(practitionerPotentialIdList, practitionerId,remark,timeToOnboarding);
} }
responseVO.setPotentialCustomerId(customerId); responseVO.setPotentialCustomerId(customerId);
responseVO.setPotentialId(potentialId); responseVO.setPotentialId(potentialId);
...@@ -852,7 +864,25 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -852,7 +864,25 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return responseVO; return responseVO;
} }
private void addPractitionerPotentialTrack(List<Long> practitionerPotentialIdList, Long practitionerId) { /**
* 更新经纪人对增员对备注
* @param potentialId 增员id
* @param practitionerId 团队长id
* @param remark 备注
*/
private void updateRecruitRemark(Long potentialId, Long practitionerId, String remark,String timeToOnboarding) {
if(potentialId != null && practitionerId != null && !Strings.isNullOrEmpty(remark)){
List<AclPractitionerPotentialAssigneds> assignedsList = aclPractitionerPotentialAssignedsDALService.findByPotentialIdAndPractitionerId(potentialId,practitionerId);
if(assignedsList != null && !assignedsList.isEmpty()){
AclPractitionerPotentialAssigneds assigneds = assignedsList.get(0);
assigneds.setRemark(remark);
assigneds.setTimeToOnboarding(CommonUtil.stringParseDate(timeToOnboarding,"yyyy-MM-dd"));
aclPractitionerPotentialAssignedsDALService.update(assigneds);
}
}
}
private void addPractitionerPotentialTrack(List<Long> practitionerPotentialIdList, Long practitionerId,String remark,String timeToOnboarding) {
if (practitionerId != null && !practitionerPotentialIdList.isEmpty()) { if (practitionerId != null && !practitionerPotentialIdList.isEmpty()) {
List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList = new ArrayList<>(); List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList = new ArrayList<>();
AclPractitionerPotentialAssignedTrack potentialAssignedTrack; AclPractitionerPotentialAssignedTrack potentialAssignedTrack;
...@@ -883,6 +913,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -883,6 +913,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
potentialAssigneds = new AclPractitionerPotentialAssigneds(); potentialAssigneds = new AclPractitionerPotentialAssigneds();
potentialAssigneds.setAssignedPractitionerId(practitionerId); potentialAssigneds.setAssignedPractitionerId(practitionerId);
potentialAssigneds.setPractitionerPotentialId(potentialId); potentialAssigneds.setPractitionerPotentialId(potentialId);
potentialAssigneds.setTimeToOnboarding(CommonUtil.stringParseDate(timeToOnboarding,"yyyy-MM-dd"));
potentialAssigneds.setRemark(remark);
potentialAssigneds.setIsActive(1); potentialAssigneds.setIsActive(1);
potentialAssigneds.setCreatedAt(new Date()); potentialAssigneds.setCreatedAt(new Date());
potentialAssigneds.setCreatedBy(practitionerId); potentialAssigneds.setCreatedBy(practitionerId);
...@@ -924,21 +956,27 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -924,21 +956,27 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
if(assignedTrackList == null || assignedTrackList.isEmpty()){//3、如果没有,获取增员状态对应的分值, if(assignedTrackList == null || assignedTrackList.isEmpty()){//3、如果没有,获取增员状态对应的分值,
MdDropOptions options = mdDropOptionsDALService.findById(trackStatusId); MdDropOptions options = mdDropOptionsDALService.findById(trackStatusId);
assignedTrack.setTrackScore(options.getDropOptionScore()); assignedTrack.setTrackScore(options.getDropOptionScore());
assignedTrack.setPractitionerAssignedId(practitionerId);
assignedTrack.setPractitionerPotentialId(potentialId);
assignedTrack.setTrackStatusId(trackStatusId);
assignedTrack.setNotice(requestVO.getNotice());
assignedTrack.setTrackTime(trackTimeDate);
assignedTrack.setIsActive(1);
assignedTrack.setIsLasted(1);
assignedTrack.setCreatorType(2);
assignedTrack.setCreatedBy(practitionerId);
assignedTrack.setCreatedAt(new Date());
aclPractitionerPotentialAssignedTrackDALService.save(assignedTrack);
responseVO.setTrackId(assignedTrack.getId());
}else{ }else{
assignedTrack.setTrackScore(0); assignedTrack = assignedTrackList.get(0);
} assignedTrack.setNotice(requestVO.getNotice());
assignedTrack.setPractitionerAssignedId(practitionerId); assignedTrack.setIsLasted(1);
assignedTrack.setPractitionerPotentialId(potentialId); assignedTrack.setUpdatedAt(new Date());
assignedTrack.setTrackStatusId(trackStatusId); assignedTrack.setUpdatedBy(practitionerId);
assignedTrack.setNotice(requestVO.getNotice()); assignedTrack.setUpdaterType(2);
assignedTrack.setTrackTime(trackTimeDate); aclPractitionerPotentialAssignedTrackDALService.update(assignedTrack);
assignedTrack.setIsActive(1); }
assignedTrack.setIsLasted(1);
assignedTrack.setCreatorType(2);
assignedTrack.setCreatedBy(practitionerId);
assignedTrack.setCreatedAt(new Date());
aclPractitionerPotentialAssignedTrackDALService.save(assignedTrack);
responseVO.setTrackId(assignedTrack.getId());
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{ }else{
String [] paras = {"trackStatusId,practitionerId,potentialId,trackTime"}; String [] paras = {"trackStatusId,practitionerId,potentialId,trackTime"};
...@@ -1042,18 +1080,26 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1042,18 +1080,26 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
recruitSourceList.forEach(i->recruitSourceMap.put(i.getId(),i.getDropOptionName())); recruitSourceList.forEach(i->recruitSourceMap.put(i.getId(),i.getDropOptionName()));
List<PractitionerPotentialInfo> potentialInfoList = new ArrayList<>(); List<PractitionerPotentialInfo> potentialInfoList = new ArrayList<>();
Long trackStatusId; Long trackStatusId;
List<AclPractitionerPotentialAssigneds> assignedsList = aclPractitionerPotentialAssignedsDALService.findByPractitionerId(practitionerId);
Map<Long,String> remarkMap = new HashMap<>();
assignedsList.forEach(i->remarkMap.put(i.getPractitionerPotentialId(),i.getRemark()));
List<Long> potentialIdList = new ArrayList<>(remarkMap.keySet());
List<AclPractitionerPotentialAssigneds> assigneds = aclPractitionerPotentialAssignedsDALService.findByPractitionerIdAndPotentialIdList(practitionerId,potentialIdList);
Map<Long,Date> timeToOnBoardingMap = new HashMap<>();
assigneds.forEach(i->timeToOnBoardingMap.put(i.getPractitionerPotentialId(),i.getTimeToOnboarding()));
//待开发 --查询预计报聘时间
for(PractitionerPotentialInfo item : practitionerPotentialInfoList){ for(PractitionerPotentialInfo item : practitionerPotentialInfoList){
trackStatusId = item.getTrackStatusId(); trackStatusId = item.getTrackStatusId();
if(status != null){ if(status != null){
if(status == 1 && trackStatusId.longValue() == firstTrackStatusId){ if(status == 1 && trackStatusId.longValue() == firstTrackStatusId){
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item); getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap,timeToOnBoardingMap);
}else if(status == 3 && trackStatusId.longValue() == LastStatusId){ }else if(status == 3 && trackStatusId.longValue() == LastStatusId){
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item); getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap,timeToOnBoardingMap);
}else if(status == 2 && trackStatusId.longValue() != LastStatusId && trackStatusId.longValue() != firstTrackStatusId){ }else if(status == 2 && trackStatusId.longValue() != LastStatusId && trackStatusId.longValue() != firstTrackStatusId){
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item); getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap,timeToOnBoardingMap);
} }
}else{ }else{
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item); getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap,timeToOnBoardingMap);
} }
} }
responseVO.setPractitionerPotentialInfoList(potentialInfoList); responseVO.setPractitionerPotentialInfoList(potentialInfoList);
...@@ -1069,11 +1115,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1069,11 +1115,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
} }
private void getResponseMessage(List<PractitionerPotentialInfo> potentialInfoList, Map<Long, String> trackStatusMap,Map<Long,String> recruitSourceMap, PractitionerPotentialInfo item) { private void getResponseMessage(List<PractitionerPotentialInfo> potentialInfoList, Map<Long, String> trackStatusMap,Map<Long,String> recruitSourceMap, PractitionerPotentialInfo item,Map<Long,String> remarkMap,Map<Long,Date> timeToOnBoardingMap) {
PractitionerPotentialInfo potentialInfo = new PractitionerPotentialInfo(); PractitionerPotentialInfo potentialInfo = new PractitionerPotentialInfo();
BeanUtils.copyProperties(item,potentialInfo); BeanUtils.copyProperties(item,potentialInfo);
potentialInfo.setRemark(remarkMap.get(item.getPotentialId()));
potentialInfo.setTrackStatus(trackStatusMap.get(item.getTrackStatusId())); potentialInfo.setTrackStatus(trackStatusMap.get(item.getTrackStatusId()));
potentialInfo.setResourceDropMasterName(recruitSourceMap.get(item.getResourceDropMasterId())); potentialInfo.setResourceDropMasterName(recruitSourceMap.get(item.getResourceDropMasterId()));
potentialInfo.setTimeToOnboarding(CommonUtil.dateParseString(timeToOnBoardingMap.get(item.getPotentialId()),"yyyy-MM-dd"));
potentialInfoList.add(potentialInfo); potentialInfoList.add(potentialInfo);
} }
...@@ -1466,6 +1514,69 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1466,6 +1514,69 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO; return responseVO;
} }
@Override
@Transactional
public PotentialGoalsSettingResponseVO potentialGoalsSetting(PotentialGoalsSettingRequestVO requestVO) {
PotentialGoalsSettingResponseVO responseVO = new PotentialGoalsSettingResponseVO();
Long practitionerId = requestVO.getPractitionerId();
Integer numberRecruitsYear = requestVO.getNumberRecruitsYear();
Integer numberMDRTYear = requestVO.getNumberMDRTYear();
List<RecruitGoalForMonth> recruitGoalForMonthList = requestVO.getRecruitGoalForMonthList();
if(practitionerId != null && numberMDRTYear != null && numberRecruitsYear != null && !recruitGoalForMonthList.isEmpty()){
Integer month,numberRecruits,numberMDRT;
int numberRecruits1=0,numberMDRT1=0,numberRecruits2=0,numberMDRT2=0,numberRecruits3=0,numberMDRT3=0,numberRecruits4=0,numberMDRT4=0;
Calendar calendar = Calendar.getInstance();
Integer currentYear = calendar.get(Calendar.YEAR);
Date version = new Date();
List<AclPractitionerPotentialGoals> potentialGoalsUpdateList = new ArrayList<>();
List<AclPractitionerPotentialGoals> potentialGoalsOld = aclPractitionerPotentialGoalsDALService.findByPractitionerAndCurrentYear(practitionerId,currentYear);
if(potentialGoalsOld != null && !potentialGoalsOld.isEmpty()){
for(AclPractitionerPotentialGoals item : potentialGoalsOld){
item.setUpdatedAt(new Date());
item.setUpdatedBy(practitionerId);
item.setIsActive(0);
potentialGoalsUpdateList.add(item);
}
aclPractitionerPotentialGoalsDALService.updateList(potentialGoalsUpdateList);
}
//1、统计全年
List<AclPractitionerPotentialGoals> potentialGoalsList = new ArrayList<>();
getPotentialGoalsList(potentialGoalsList,practitionerId,1,1,numberRecruitsYear,numberMDRTYear,currentYear,version);
//2、统计每个月
for(RecruitGoalForMonth item : recruitGoalForMonthList){
month = item.getMonth();
numberRecruits = item.getNumberRecruits();
numberMDRT = item.getNumberMDRT();
if(month < 4){
numberRecruits1 = numberRecruits1 + numberRecruits;
numberMDRT1 = numberMDRT1 + numberMDRT;
}else if(month < 7){
numberRecruits2 = numberRecruits2 + numberRecruits;
numberMDRT2 = numberMDRT2 + numberMDRT;
}else if(month < 10){
numberRecruits3 = numberRecruits3 + numberRecruits;
numberMDRT3 = numberMDRT3 + numberMDRT;
}else {
numberRecruits4 = numberRecruits4 + numberRecruits;
numberMDRT4 = numberMDRT4 + numberMDRT;
}
getPotentialGoalsList(potentialGoalsList,practitionerId,3,month,numberRecruits,numberMDRT,currentYear,version);
}
//3、统计每个季度 -- 1-2-3,4-5-6,7-8-9,10-11-12
getPotentialGoalsList(potentialGoalsList,practitionerId,2,1,numberRecruits1,numberMDRT1,currentYear,version);
getPotentialGoalsList(potentialGoalsList,practitionerId,2,2,numberRecruits2,numberMDRT2,currentYear,version);
getPotentialGoalsList(potentialGoalsList,practitionerId,2,3,numberRecruits3,numberMDRT3,currentYear,version);
getPotentialGoalsList(potentialGoalsList,practitionerId,2,4,numberRecruits4,numberMDRT4,currentYear,version);
aclPractitionerPotentialGoalsDALService.saveAll(potentialGoalsList);
//4、根据年度总目标计算年度活动量M
savePotentialActions(practitionerId,numberRecruitsYear,currentYear,version);
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{
String [] paras = {"practitionerId,numberMDRTYear,numberRecruitsYear,recruitGoalForMonthList"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
}
return responseVO;
}
@Override @Override
public SalesTargetQueryResponseVO salesTargetQuery(SalesTargetQueryRequestVO requestVO) { public SalesTargetQueryResponseVO salesTargetQuery(SalesTargetQueryRequestVO requestVO) {
...@@ -1574,6 +1685,39 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1574,6 +1685,39 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO; return responseVO;
} }
@Override
public PotentialGoalsQueryResponseVO potentialGoalsQuery(PotentialGoalsQueryRequestVO requestVO) {
PotentialGoalsQueryResponseVO responseVO = new PotentialGoalsQueryResponseVO();
Long practitionerId = requestVO.getPractitionerId();
if(practitionerId != null){
Calendar calendar = Calendar.getInstance();
Integer currentYear = calendar.get(Calendar.YEAR);
List<Integer> timeTypeList = Arrays.asList(1,3);
List<AclPractitionerPotentialGoals> potentialGoalsList = aclPractitionerPotentialGoalsDALService.findByPractitionerAndCurrentYearAndTimeUnit(practitionerId,currentYear,timeTypeList);
List<RecruitGoalForMonth> recruitGoalForMonthList = new ArrayList<>();
if(potentialGoalsList != null && !potentialGoalsList.isEmpty()){
RecruitGoalForMonth recruitGoalForMonth;
for(AclPractitionerPotentialGoals item : potentialGoalsList){
if(item.getStatisticTimeUnit() == 1){
responseVO.setNumberRecruitsYear(item.getNumberRecruits());
responseVO.setNumberMDRTYear(item.getNumberMdrt());
}else{
recruitGoalForMonth = new RecruitGoalForMonth();
recruitGoalForMonth.setMonth(item.getSeqTime());
recruitGoalForMonth.setNumberMDRT(item.getNumberMdrt());
recruitGoalForMonth.setNumberRecruits(item.getNumberRecruits());
recruitGoalForMonthList.add(recruitGoalForMonth);
}
}
}
responseVO.setRecruitGoalForMonthList(recruitGoalForMonthList);
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{
String [] paras = {"practitionerId"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
}
return responseVO;
}
@Override @Override
public TeamActionsAverageQueryResponseVO teamScoreAverageQuery(TeamActionsAverageQueryRequestVO requestVO) { public TeamActionsAverageQueryResponseVO teamScoreAverageQuery(TeamActionsAverageQueryRequestVO requestVO) {
...@@ -1646,6 +1790,31 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1646,6 +1790,31 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO; return responseVO;
} }
@Override
public PotentialGoalsActionsQueryResponseVO potentialGoalsActionsQuery(PotentialGoalsActionsQueryRequestVO requestVO) {
PotentialGoalsActionsQueryResponseVO responseVO = new PotentialGoalsActionsQueryResponseVO();
Long practitionerId = requestVO.getPractitionerId();
if(practitionerId != null){
Calendar calendar = Calendar.getInstance();
Integer currentYear = calendar.get(Calendar.YEAR);
List<PotentialGoalsActionsInfo> goalsActionsInfoList = new ArrayList<>();
List<AclPractitionerPotentialGoalsActions> goalsActionsList = aclPractitionerPotentialGoalsActionsDALService.findByPractitionerIdAndCurrentYearAndIsActiveAndTimeUnit(practitionerId,currentYear,1,3);
if(goalsActionsList != null && !goalsActionsList.isEmpty()){
PotentialGoalsActionsInfo goalsActionsInfo;
for(AclPractitionerPotentialGoalsActions item : goalsActionsList){
goalsActionsInfo = new PotentialGoalsActionsInfo();
BeanUtils.copyProperties(item,goalsActionsInfo);
goalsActionsInfoList.add(goalsActionsInfo);
}
responseVO.setGoalsActionsInfoList(goalsActionsInfoList);
}
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{
String [] paras = {"practitionerId"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
}
return responseVO;
}
@Override @Override
public PlayerSalesActivityQueryResponseVO playerSalesActivityQuery(PlayerSalesActivityQueryRequestVO requestVO) { public PlayerSalesActivityQueryResponseVO playerSalesActivityQuery(PlayerSalesActivityQueryRequestVO requestVO) {
...@@ -1680,6 +1849,36 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1680,6 +1849,36 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO; return responseVO;
} }
@Override
public PotentialGoalsActionsUpdateResponseVO potentialGoalsActionsUpdate(PotentialGoalsActionsUpdateRequestVO requestVO) {
PotentialGoalsActionsUpdateResponseVO responseVO = new PotentialGoalsActionsUpdateResponseVO();
Long practitionerId = requestVO.getPractitionerId();
List<PotentialGoalsActionsInfo> goalsActionsInfoList = requestVO.getGoalsActionsInfoList();
if(practitionerId != null && !goalsActionsInfoList.isEmpty()){
Calendar calendar = Calendar.getInstance();
Integer currentYear = calendar.get(Calendar.YEAR);
Date version = new Date();
//1、更新旧数据
updateOldDataForGoalsActions(practitionerId,currentYear);
//2、保存数据
int result;
Long potentialActionId;
String potentialActionName;
List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsList = new ArrayList<>();
for(PotentialGoalsActionsInfo item : goalsActionsInfoList){
result = item.getActionStandards();
potentialActionId = item.getPotentialActionId();
potentialActionName = item.getPotentialActionName();
savePotentialGoalsActions(potentialGoalsActionsList,practitionerId,currentYear,potentialActionId,potentialActionName,result,version);
}
aclPractitionerPotentialGoalsActionsDALService.saveAll(potentialGoalsActionsList);
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{
String [] paras = {"practitionerId,goalsActionsInfoList"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
}
return responseVO;
}
@Override @Override
public SalesPerformanceForecastListQueryResponseVO salesPerformanceForecastListQuery(SalesPerformanceForecastListQueryRequestVO requestVO) { public SalesPerformanceForecastListQueryResponseVO salesPerformanceForecastListQuery(SalesPerformanceForecastListQueryRequestVO requestVO) {
...@@ -2219,17 +2418,217 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2219,17 +2418,217 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
} }
private List<Integer> getMonthListForQuarter(int month) { private List<Integer> getMonthListForQuarter(int month) {
if(month < 4){ if (month < 4) {
return Arrays.asList(1,2,3); return Arrays.asList(1, 2, 3);
}else if(month < 7){ } else if (month < 7) {
return Arrays.asList(4,5,6); return Arrays.asList(4, 5, 6);
}else if(month < 10){ } else if (month < 10) {
return Arrays.asList(7,8,9); return Arrays.asList(7, 8, 9);
} else {
return Arrays.asList(10, 11, 12);
}
}
@Override
public PotentialActivityQueryResponseVO potentialActivityQuery(PotentialActivityQueryRequestVO requestVO) {
PotentialActivityQueryResponseVO responseVO = new PotentialActivityQueryResponseVO();
Long practitionerId = requestVO.getPractitionerId();
if(practitionerId != null){
List<AclPractitionerPotentialAssignedTrack> assignedTrackList = aclPractitionerPotentialAssignedTrackDALService.findScoreByPractitionerIdAndDate(practitionerId,"month");
int activityForToday = 0,activityForWeek = 0,activityForMonth = 0,activityForQuarter = 0;
Set<Long> succeedRecruitSet = new HashSet<>();
if(assignedTrackList != null && !assignedTrackList.isEmpty()){
Integer trackScore;
Date trackTime;
Long trackStatusId;
Calendar calendar = Calendar.getInstance();
//获取增员成功id
List<MdDropOptions> optionsList = mdDropOptionsDALService.findByMasterCodeAndOptionsCode("team_building_track","7");
long trackSucceedId = (optionsList != null && !optionsList.isEmpty()) ? optionsList.get(0).getId() : 113L;
Date todayStartDate = getTimeStartDate(calendar,"today");//本天的开始时间
Date weekStartDate = getTimeStartDate(calendar,"week");//本周的开始时间
Date monthStartDate = getTimeStartDate(calendar,"month");//本月的开始时间
// Date quarterStartDate = getTimeStartDate(calendar,"quarter"); //本季的开始时间
for(AclPractitionerPotentialAssignedTrack item : assignedTrackList){
trackStatusId = item.getTrackStatusId();
trackScore = item.getTrackScore();
trackTime = item.getTrackTime();
if(trackStatusId != null && trackSucceedId == trackStatusId && item.getIsLasted() == 1){
succeedRecruitSet.add(item.getId());
}
if(trackScore != null && trackScore != 0){
if(!trackTime.before(todayStartDate)){
activityForToday += trackScore;
activityForWeek += trackScore;
activityForMonth += trackScore;
activityForQuarter += trackScore;
}else if(!trackTime.before(weekStartDate)){
activityForWeek += trackScore;
activityForMonth += trackScore;
activityForQuarter += trackScore;
}else if(!trackTime.before(monthStartDate)){
activityForMonth += trackScore;
activityForQuarter += trackScore;
}else{
activityForQuarter += trackScore;
}
}
}
}
responseVO.setActivityForToday(activityForToday);
responseVO.setActivityForWeek(activityForWeek);
responseVO.setActivityForMonth(activityForMonth);
responseVO.setActivityForQuarter(activityForQuarter);
responseVO.setRecruitSucceed(succeedRecruitSet.size());
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{ }else{
return Arrays.asList(10,11,12); String [] paras = {"practitionerId"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
}
return responseVO;
}
private Date getTimeStartDate(Calendar calendar, String time) {
if(calendar != null){
switch (time) {
case "today":
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
case "week":
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
return calendar.getTime();
case "month":
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
return calendar.getTime();
default:
int currentMonth = calendar.get(Calendar.MONTH) + 1;
SimpleDateFormat longSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat shortSdf = new SimpleDateFormat("yyyy-MM-dd");
try {
if (currentMonth <= 3)
calendar.set(Calendar.MONTH, 0);
else if (currentMonth <= 6)
calendar.set(Calendar.MONTH, 3);
else if (currentMonth <= 9)
calendar.set(Calendar.MONTH, 4);
else if (currentMonth <= 12)
calendar.set(Calendar.MONTH, 9);
calendar.set(Calendar.DATE, 1);
return longSdf.parse(shortSdf.format(calendar.getTime()) + " 00:00:00");
} catch (Exception e) {
e.printStackTrace();
}
}
}
return null;
}
private void savePotentialGoalsActions(List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsList, Long practitionerId, Integer currentYear, Long potentialActionId, String potentialActionName, int result, Date version) {
//月
savePotentialGoalsActionsDetail(potentialGoalsActionsList,practitionerId,currentYear,3,potentialActionId,potentialActionName,result,version);
//季度
result = result*3;
savePotentialGoalsActionsDetail(potentialGoalsActionsList,practitionerId,currentYear,2,potentialActionId,potentialActionName,result,version);
//周
result = result*4;
result = result%52 == 0 ? (result/52) : (result/52)+1;
savePotentialGoalsActionsDetail(potentialGoalsActionsList,practitionerId,currentYear,4,potentialActionId,potentialActionName,result,version);
}
/**
* 计算活动量
* @param numberRecruitsYear 年目标
*/
private void savePotentialActions(Long practitionerId,Integer numberRecruitsYear,Integer currentYear,Date version) {
if(numberRecruitsYear != null){
//清空就逻辑
updateOldDataForGoalsActions(practitionerId,currentYear);
//1、获取所有的逻辑
List<MdGoalsCalculateExpression> calculateExpressionList = mdGoalsCalculateExpressionDALService.findByMasterCodeAndIsActive("team_building_track",1);
if(calculateExpressionList != null && !calculateExpressionList.isEmpty()){
try {
ScriptEngine jScriptEngine=new ScriptEngineManager().getEngineByName("JavaScript");
int a = numberRecruitsYear%12 == 0 ? (numberRecruitsYear/12) : (numberRecruitsYear/12)+1;
String expression;
int result;
Long potentialActionId;
String potentialActionName;
List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsList = new ArrayList<>();
for(MdGoalsCalculateExpression item : calculateExpressionList){
expression = item.getCalculateScriptExpression();
if(!Strings.isNullOrEmpty(expression)){
expression = expression.replaceAll("num",String.valueOf(a));
result = (int) jScriptEngine.eval(expression);
potentialActionId = item.getActionId();
potentialActionName = item.getDropOptionName();
savePotentialGoalsActions(potentialGoalsActionsList,practitionerId,currentYear,potentialActionId,potentialActionName,result,version);
}
}
aclPractitionerPotentialGoalsActionsDALService.saveAll(potentialGoalsActionsList);
}catch (Exception e){
e.printStackTrace();
}
}
}
}
private void updateOldDataForGoalsActions(Long practitionerId, Integer currentYear) {
List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsListUpdate = new ArrayList<>();
List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsListOld = aclPractitionerPotentialGoalsActionsDALService.findByPractitionerIdAndCurrentYearAndIsActive(practitionerId,currentYear,1);
if(potentialGoalsActionsListOld != null && !potentialGoalsActionsListOld.isEmpty()){
for(AclPractitionerPotentialGoalsActions item : potentialGoalsActionsListOld){
item.setIsActive(0);
item.setUpdatedAt(new Date());
item.setUpdatedBy(practitionerId);
potentialGoalsActionsListUpdate.add(item);
}
aclPractitionerPotentialGoalsActionsDALService.updateAll(potentialGoalsActionsListUpdate);
} }
} }
private void savePotentialGoalsActionsDetail(List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsList, Long practitionerId, Integer currentYear, Integer timeUnit, Long potentialActionId, String potentialActionName, int result, Date version) {
AclPractitionerPotentialGoalsActions potentialGoalsActions = new AclPractitionerPotentialGoalsActions();
potentialGoalsActions.setPractitionerId(practitionerId);
potentialGoalsActions.setCurrentYear(currentYear);
potentialGoalsActions.setStatisticTimeUnit(timeUnit);
potentialGoalsActions.setPotentialActionId(potentialActionId);
potentialGoalsActions.setPotentialActionName(potentialActionName);
potentialGoalsActions.setActionStandards(result);
potentialGoalsActions.setCurrentVersion(version);
potentialGoalsActions.setIsActive(1);
potentialGoalsActions.setCreatedAt(new Date());
potentialGoalsActions.setCreatedBy(practitionerId);
potentialGoalsActionsList.add(potentialGoalsActions);
}
/**
* 生成保存列表
* @param potentialGoalsList 列表
* @param practitionerId 经纪人id
* @param timeType 时间类型
* @param seq 序号
* @param numberRecruitsYear 年目标
* @param numberMDRTYear MDRT年目标
*/
private void getPotentialGoalsList(List<AclPractitionerPotentialGoals> potentialGoalsList, Long practitionerId, Integer timeType, Integer seq, Integer numberRecruitsYear, Integer numberMDRTYear,Integer currentYear,Date version) {
AclPractitionerPotentialGoals potentialGoals = new AclPractitionerPotentialGoals();
potentialGoals.setPractitionerId(practitionerId);
potentialGoals.setCurrentYear(currentYear);
potentialGoals.setStatisticTimeUnit(timeType);
potentialGoals.setSeqTime(seq);
potentialGoals.setNumberRecruits(numberRecruitsYear);
potentialGoals.setNumberMdrt(numberMDRTYear);
potentialGoals.setCurrentVersion(version);
potentialGoals.setIsActive(1);
potentialGoals.setCreatedAt(new Date());
potentialGoals.setCreatedBy(practitionerId);
potentialGoalsList.add(potentialGoals);
}
private CommonResult check(OwnOpportunityRecordSaveRequestVO requestVO) { private CommonResult check(OwnOpportunityRecordSaveRequestVO requestVO) {
String noticeDate = requestVO.getNoticeDate(); String noticeDate = requestVO.getNoticeDate();
if (CommonUtil.isNullOrBlank(noticeDate)){ if (CommonUtil.isNullOrBlank(noticeDate)){
......
package com.yd.api.practitioner.vo.recruit;
public class PotentialActivityQueryRequestVO {
private Long practitionerId;
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
}
package com.yd.api.practitioner.vo.recruit;
import com.yd.api.result.CommonResult;
public class PotentialActivityQueryResponseVO {
private Integer activityForToday;
private Integer activityForWeek;
private Integer activityForMonth;
private Integer activityForQuarter;
private Integer recruitSucceed;
private CommonResult commonResult;
public Integer getActivityForToday() {
return activityForToday;
}
public void setActivityForToday(Integer activityForToday) {
this.activityForToday = activityForToday;
}
public Integer getActivityForWeek() {
return activityForWeek;
}
public void setActivityForWeek(Integer activityForWeek) {
this.activityForWeek = activityForWeek;
}
public Integer getActivityForMonth() {
return activityForMonth;
}
public void setActivityForMonth(Integer activityForMonth) {
this.activityForMonth = activityForMonth;
}
public Integer getActivityForQuarter() {
return activityForQuarter;
}
public void setActivityForQuarter(Integer activityForQuarter) {
this.activityForQuarter = activityForQuarter;
}
public Integer getRecruitSucceed() {
return recruitSucceed;
}
public void setRecruitSucceed(Integer recruitSucceed) {
this.recruitSucceed = recruitSucceed;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.recruit;
public class PotentialGoalsActionsInfo {
private Long id;
private Long practitionerId;
private Integer currentYear;
private Integer statisticTimeUnit;
private Long potentialActionId;
private String potentialActionName;
private Integer actionStandards;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public Integer getCurrentYear() {
return currentYear;
}
public void setCurrentYear(Integer currentYear) {
this.currentYear = currentYear;
}
public Integer getStatisticTimeUnit() {
return statisticTimeUnit;
}
public void setStatisticTimeUnit(Integer statisticTimeUnit) {
this.statisticTimeUnit = statisticTimeUnit;
}
public Long getPotentialActionId() {
return potentialActionId;
}
public void setPotentialActionId(Long potentialActionId) {
this.potentialActionId = potentialActionId;
}
public String getPotentialActionName() {
return potentialActionName;
}
public void setPotentialActionName(String potentialActionName) {
this.potentialActionName = potentialActionName;
}
public Integer getActionStandards() {
return actionStandards;
}
public void setActionStandards(Integer actionStandards) {
this.actionStandards = actionStandards;
}
}
package com.yd.api.practitioner.vo.recruit;
public class PotentialGoalsActionsQueryRequestVO {
private Long practitionerId;
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
}
package com.yd.api.practitioner.vo.recruit;
import com.yd.api.result.CommonResult;
import java.util.List;
public class PotentialGoalsActionsQueryResponseVO {
private List<PotentialGoalsActionsInfo> goalsActionsInfoList;
private CommonResult commonResult;
public List<PotentialGoalsActionsInfo> getGoalsActionsInfoList() {
return goalsActionsInfoList;
}
public void setGoalsActionsInfoList(List<PotentialGoalsActionsInfo> goalsActionsInfoList) {
this.goalsActionsInfoList = goalsActionsInfoList;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.recruit;
import java.util.List;
public class PotentialGoalsActionsUpdateRequestVO {
private Long practitionerId;
private List<PotentialGoalsActionsInfo> goalsActionsInfoList;
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public List<PotentialGoalsActionsInfo> getGoalsActionsInfoList() {
return goalsActionsInfoList;
}
public void setGoalsActionsInfoList(List<PotentialGoalsActionsInfo> goalsActionsInfoList) {
this.goalsActionsInfoList = goalsActionsInfoList;
}
}
package com.yd.api.practitioner.vo.recruit;
import com.yd.api.result.CommonResult;
public class PotentialGoalsActionsUpdateResponseVO {
private CommonResult commonResult;
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.recruit;
public class PotentialGoalsQueryRequestVO {
private Long practitionerId;
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
}
package com.yd.api.practitioner.vo.recruit;
import com.yd.api.practitioner.vo.recruit.RecruitGoalForMonth;
import com.yd.api.result.CommonResult;
import java.util.List;
public class PotentialGoalsQueryResponseVO {
private Integer numberRecruitsYear;
private Integer numberMDRTYear;
private List<RecruitGoalForMonth> recruitGoalForMonthList;
private CommonResult commonResult;
public Integer getNumberRecruitsYear() {
return numberRecruitsYear;
}
public void setNumberRecruitsYear(Integer numberRecruitsYear) {
this.numberRecruitsYear = numberRecruitsYear;
}
public Integer getNumberMDRTYear() {
return numberMDRTYear;
}
public void setNumberMDRTYear(Integer numberMDRTYear) {
this.numberMDRTYear = numberMDRTYear;
}
public List<RecruitGoalForMonth> getRecruitGoalForMonthList() {
return recruitGoalForMonthList;
}
public void setRecruitGoalForMonthList(List<RecruitGoalForMonth> recruitGoalForMonthList) {
this.recruitGoalForMonthList = recruitGoalForMonthList;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.recruit;
import java.util.List;
public class PotentialGoalsSettingRequestVO {
private Long practitionerId;
private Integer numberRecruitsYear;
private Integer numberMDRTYear;
private List<RecruitGoalForMonth> recruitGoalForMonthList;
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public Integer getNumberRecruitsYear() {
return numberRecruitsYear;
}
public void setNumberRecruitsYear(Integer numberRecruitsYear) {
this.numberRecruitsYear = numberRecruitsYear;
}
public Integer getNumberMDRTYear() {
return numberMDRTYear;
}
public void setNumberMDRTYear(Integer numberMDRTYear) {
this.numberMDRTYear = numberMDRTYear;
}
public List<RecruitGoalForMonth> getRecruitGoalForMonthList() {
return recruitGoalForMonthList;
}
public void setRecruitGoalForMonthList(List<RecruitGoalForMonth> recruitGoalForMonthList) {
this.recruitGoalForMonthList = recruitGoalForMonthList;
}
}
package com.yd.api.practitioner.vo.recruit;
import com.yd.api.result.CommonResult;
public class PotentialGoalsSettingResponseVO {
private CommonResult commonResult;
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
...@@ -20,6 +20,7 @@ public class PractitionerPotentialInfo { ...@@ -20,6 +20,7 @@ public class PractitionerPotentialInfo {
private String trackStatus; private String trackStatus;
private Long trackId; private Long trackId;
private String createdAt; private String createdAt;
private String timeToOnboarding;
public Long getPotentialId() { public Long getPotentialId() {
return potentialId; return potentialId;
...@@ -172,4 +173,12 @@ public class PractitionerPotentialInfo { ...@@ -172,4 +173,12 @@ public class PractitionerPotentialInfo {
public void setCreatedAt(String createdAt) { public void setCreatedAt(String createdAt) {
this.createdAt = createdAt; this.createdAt = createdAt;
} }
public String getTimeToOnboarding() {
return timeToOnboarding;
}
public void setTimeToOnboarding(String timeToOnboarding) {
this.timeToOnboarding = timeToOnboarding;
}
} }
package com.yd.api.practitioner.vo.recruit;
public class RecruitGoalForMonth {
private Integer month;
private Integer numberRecruits;
private Integer numberMDRT;
public Integer getMonth() {
return month;
}
public void setMonth(Integer month) {
this.month = month;
}
public Integer getNumberRecruits() {
return numberRecruits;
}
public void setNumberRecruits(Integer numberRecruits) {
this.numberRecruits = numberRecruits;
}
public Integer getNumberMDRT() {
return numberMDRT;
}
public void setNumberMDRT(Integer numberMDRT) {
this.numberMDRT = numberMDRT;
}
}
...@@ -16,6 +16,7 @@ public class RecruitRequestVO { ...@@ -16,6 +16,7 @@ public class RecruitRequestVO {
private String remark; private String remark;
private String ossPathResume; private String ossPathResume;
private Long practitionerId; private Long practitionerId;
private String timeToOnboarding;
public Long getPotentialId() { public Long getPotentialId() {
return potentialId; return potentialId;
...@@ -136,4 +137,12 @@ public class RecruitRequestVO { ...@@ -136,4 +137,12 @@ public class RecruitRequestVO {
public void setPractitionerId(Long practitionerId) { public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId; this.practitionerId = practitionerId;
} }
public String getTimeToOnboarding() {
return timeToOnboarding;
}
public void setTimeToOnboarding(String timeToOnboarding) {
this.timeToOnboarding = timeToOnboarding;
}
} }
...@@ -117,4 +117,5 @@ public class AclPractitionerPotential implements Serializable { ...@@ -117,4 +117,5 @@ public class AclPractitionerPotential implements Serializable {
private Integer updaterType; private Integer updaterType;
private Long customerId; private Long customerId;
} }
\ No newline at end of file
...@@ -64,6 +64,10 @@ public class AclPractitionerPotentialAssigneds implements Serializable { ...@@ -64,6 +64,10 @@ public class AclPractitionerPotentialAssigneds implements Serializable {
* 创建者类型:1为user id(AGMS),2为本人practitioner id(银盾经纪) * 创建者类型:1为user id(AGMS),2为本人practitioner id(银盾经纪)
*/ */
private Integer creatorType; private Integer creatorType;
/**
* 备注
*/
private String remark;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
package com.yd.dal.entity.customer;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ag_acl_practitioner_potential_goals
* @author
*/
@Data
public class AclPractitionerPotentialGoals implements Serializable {
/**
* serial id
*/
private Long id;
/**
* FK ag_acl_practitioner.id 经纪人
*/
private Long practitionerId;
/**
* 目标所属年度
*/
private Integer currentYear;
/**
* 1:年度,2:季度,3:月度
*/
private Integer statisticTimeUnit;
/**
* 1:年度,3:月度
*/
private Integer seqTime;
/**
* 招聘增员数
*/
private Integer numberRecruits;
/**
* 百万圆桌成员数
*/
private Integer numberMdrt;
/**
* 版本控制
*/
private Date currentVersion;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 创建时间
*/
private Date createdAt;
/**
* 创建人
*/
private Long createdBy;
/**
* 修改时间
*/
private Date updatedAt;
private Long updatedBy;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.entity.customer;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ag_acl_practitioner_potential_goals_actions
* @author
*/
@Data
public class AclPractitionerPotentialGoalsActions implements Serializable {
/**
* serial id
*/
private Long id;
/**
* FK ag_acl_practitioner.id 经纪人
*/
private Long practitionerId;
/**
* 目标所属年度
*/
private Integer currentYear;
/**
* 2:季度,3:月度,4:周
*/
private Integer statisticTimeUnit;
/**
* FK ag_md_drop_options.id 团队长发掘活动drop_master id = 16
*/
private Long potentialActionId;
/**
* FK ag_md_drop_options.drop_option_name 团队长发掘活动drop_master id = 16
*/
private String potentialActionName;
/**
* 报聘(a)= 年目标增员对象/12
报聘面谈 b = a
OPP创说会 c = b * 3
甄选面谈 d = c
增员面谈 e = d * 3
建立名单 f = e
*/
private Integer actionStandards;
/**
* 版本控制
*/
private Date currentVersion;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 创建时间
*/
private Date createdAt;
/**
* 创建人
*/
private Long createdBy;
/**
* 修改时间
*/
private Date updatedAt;
private Long updatedBy;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.entity.meta; package com.yd.dal.entity.meta;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data; import lombok.Data;
...@@ -7,7 +8,7 @@ import lombok.Data; ...@@ -7,7 +8,7 @@ import lombok.Data;
* 经纪人商机增员目标分摊计算公式 * 经纪人商机增员目标分摊计算公式
*/ */
@Data @Data
public class MdGoalsCalculateExpression { public class MdGoalsCalculateExpression implements Serializable {
/** /**
* serial id * serial id
*/ */
...@@ -78,4 +79,6 @@ public class MdGoalsCalculateExpression { ...@@ -78,4 +79,6 @@ public class MdGoalsCalculateExpression {
private Date updatedAt; private Date updatedAt;
private Long updatedBy; private Long updatedBy;
private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -28,4 +28,6 @@ public interface AclPractitionerPotentialAssignedTrackMapper { ...@@ -28,4 +28,6 @@ public interface AclPractitionerPotentialAssignedTrackMapper {
void updateAll(@Param("assignedTrackUpdateList")List<AclPractitionerPotentialAssignedTrack> assignedTrackUpdateList); void updateAll(@Param("assignedTrackUpdateList")List<AclPractitionerPotentialAssignedTrack> assignedTrackUpdateList);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(@Param("practitionerId")Long practitionerId, @Param("potentialId")Long potentialId); List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(@Param("practitionerId")Long practitionerId, @Param("potentialId")Long potentialId);
List<AclPractitionerPotentialAssignedTrack> findScoreByPractitionerIdAndDate(@Param("practitionerId")Long practitionerId, @Param("time")String time);
} }
\ No newline at end of file
...@@ -19,4 +19,10 @@ public interface AclPractitionerPotentialAssignedsMapper { ...@@ -19,4 +19,10 @@ public interface AclPractitionerPotentialAssignedsMapper {
int updateByPrimaryKey(AclPractitionerPotentialAssigneds record); int updateByPrimaryKey(AclPractitionerPotentialAssigneds record);
void insertList(@Param("potentialAssignedsList") List<AclPractitionerPotentialAssigneds> potentialAssignedsList); void insertList(@Param("potentialAssignedsList") List<AclPractitionerPotentialAssigneds> potentialAssignedsList);
List<AclPractitionerPotentialAssigneds> findByPotentialIdAndPractitionerId(@Param("potentialId")Long potentialId, @Param("practitionerId")Long practitionerId);
List<AclPractitionerPotentialAssigneds> findByPractitionerId(@Param("practitionerId")Long practitionerId);
List<AclPractitionerPotentialAssigneds> findByPractitionerIdAndPotentialIdList(@Param("practitionerId")Long practitionerId, @Param("potentialIdList")List<Long> potentialIdList);
} }
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AclPractitionerPotentialGoalsActionsMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitionerPotentialGoalsActions record);
int insertSelective(AclPractitionerPotentialGoalsActions record);
AclPractitionerPotentialGoalsActions selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerPotentialGoalsActions record);
int updateByPrimaryKey(AclPractitionerPotentialGoalsActions record);
List<AclPractitionerPotentialGoalsActions> findByPractitionerIdAndCurrentYearAndIsActive(@Param("practitionerId")Long practitionerId, @Param("currentYear") Integer currentYear, @Param("isActive") Integer isActive);
void saveAll(@Param("potentialGoalsActionsList") List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsList);
List<AclPractitionerPotentialGoalsActions> findByPractitionerIdAndCurrentYearAndIsActiveAndTimeUnit(@Param("practitionerId")Long practitionerId, @Param("currentYear")Integer currentYear, @Param("isActive")Integer isActive, @Param("timeType")Integer timeType);
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoals;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AclPractitionerPotentialGoalsMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitionerPotentialGoals record);
int insertSelective(AclPractitionerPotentialGoals record);
AclPractitionerPotentialGoals selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerPotentialGoals record);
int updateByPrimaryKey(AclPractitionerPotentialGoals record);
List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYear(@Param("practitionerId") Long practitionerId, @Param("currentYear") Integer currentYear);
void saveAll(@Param("potentialGoalsList")List<AclPractitionerPotentialGoals> potentialGoalsList);
List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYearAndTimeUnit(@Param("practitionerId")Long practitionerId, @Param("currentYear")Integer currentYear, @Param("timeTypeList")List<Integer> timeTypeList);
}
\ No newline at end of file
...@@ -26,4 +26,6 @@ public interface MdDropOptionsMapper { ...@@ -26,4 +26,6 @@ public interface MdDropOptionsMapper {
List<MdDropOptions> findByMasterCodeAndOrderId(@Param("masterCode")String masterCode, @Param("orderId")int orderId); List<MdDropOptions> findByMasterCodeAndOrderId(@Param("masterCode")String masterCode, @Param("orderId")int orderId);
MdDropOptions selectByMasterCodeAndOptionsCode(@Param("masterCode") String masterCode, @Param("optionsCode") String optionsCode); MdDropOptions selectByMasterCodeAndOptionsCode(@Param("masterCode") String masterCode, @Param("optionsCode") String optionsCode);
List<MdDropOptions> findByMasterCodeAndOptionsCode(@Param("masterCode")String masterCode, @Param("optionsCode")String optionsCode);
} }
\ No newline at end of file
package com.yd.dal.mapper.meta; package com.yd.dal.mapper.meta;
import com.yd.dal.entity.meta.MdGoalsCalculateExpression;import java.util.List; import com.yd.dal.entity.meta.MdGoalsCalculateExpression;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MdGoalsCalculateExpressionMapper { public interface MdGoalsCalculateExpressionMapper {
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
...@@ -16,4 +18,6 @@ public interface MdGoalsCalculateExpressionMapper { ...@@ -16,4 +18,6 @@ public interface MdGoalsCalculateExpressionMapper {
int updateByPrimaryKey(MdGoalsCalculateExpression record); int updateByPrimaryKey(MdGoalsCalculateExpression record);
List<MdGoalsCalculateExpression> findByMasterId(Long masterId); List<MdGoalsCalculateExpression> findByMasterId(Long masterId);
List<MdGoalsCalculateExpression> findByMasterCodeAndIsActive(@Param("masterCode") String masterCode, @Param("isActive") Integer isActive);
} }
\ No newline at end of file
...@@ -20,4 +20,8 @@ public interface AclPractitionerPotentialAssignedTrackDALService { ...@@ -20,4 +20,8 @@ public interface AclPractitionerPotentialAssignedTrackDALService {
void updateAll(List<AclPractitionerPotentialAssignedTrack> assignedTrackUpdateList); void updateAll(List<AclPractitionerPotentialAssignedTrack> assignedTrackUpdateList);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId); List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId);
List<AclPractitionerPotentialAssignedTrack> findScoreByPractitionerIdAndDate(Long practitionerId, String time);
void update(AclPractitionerPotentialAssignedTrack assignedTrack);
} }
...@@ -9,4 +9,12 @@ import java.util.List; ...@@ -9,4 +9,12 @@ import java.util.List;
public interface AclPractitionerPotentialAssignedsDALService { public interface AclPractitionerPotentialAssignedsDALService {
void saveAll(List<AclPractitionerPotentialAssigneds> potentialAssignedsList); void saveAll(List<AclPractitionerPotentialAssigneds> potentialAssignedsList);
List<AclPractitionerPotentialAssigneds> findByPotentialIdAndPractitionerId(Long potentialId, Long practitionerId);
void update(AclPractitionerPotentialAssigneds assigneds);
List<AclPractitionerPotentialAssigneds> findByPractitionerId(Long practitionerId);
List<AclPractitionerPotentialAssigneds> findByPractitionerIdAndPotentialIdList(Long practitionerId, List<Long> potentialIdList);
} }
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialGoalsActionsDALService")
public interface AclPractitionerPotentialGoalsActionsDALService {
List<AclPractitionerPotentialGoalsActions> findByPractitionerIdAndCurrentYearAndIsActive(Long practitionerId, Integer currentYear, Integer isActive);
void updateAll(List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsListUpdate);
void saveAll(List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsList);
List<AclPractitionerPotentialGoalsActions> findByPractitionerIdAndCurrentYearAndIsActiveAndTimeUnit(Long practitionerId, Integer currentYear, Integer isActive, Integer timeType);
}
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoals;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialGoalsDALService")
public interface AclPractitionerPotentialGoalsDALService {
List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYear(Long practitionerId, Integer currentYear);
void updateList(List<AclPractitionerPotentialGoals> potentialGoalsUpdateList);
void saveAll(List<AclPractitionerPotentialGoals> potentialGoalsList);
List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYearAndTimeUnit(Long practitionerId, Integer currentYear, List<Integer> timeTypeList);
}
...@@ -45,4 +45,14 @@ public class AclPractitionerPotentialAssignedTrackDALServiceImpl implements AclP ...@@ -45,4 +45,14 @@ public class AclPractitionerPotentialAssignedTrackDALServiceImpl implements AclP
public List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId) { public List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId) {
return aclPractitionerPotentialAssignedTrackMapper.findByPractitionerIdAndPotentialId(practitionerId,potentialId); return aclPractitionerPotentialAssignedTrackMapper.findByPractitionerIdAndPotentialId(practitionerId,potentialId);
} }
@Override
public List<AclPractitionerPotentialAssignedTrack> findScoreByPractitionerIdAndDate(Long practitionerId, String time) {
return aclPractitionerPotentialAssignedTrackMapper.findScoreByPractitionerIdAndDate(practitionerId,time);
}
@Override
public void update(AclPractitionerPotentialAssignedTrack assignedTrack) {
aclPractitionerPotentialAssignedTrackMapper.updateByPrimaryKeySelective(assignedTrack);
}
} }
...@@ -17,4 +17,24 @@ public class AclPractitionerPotentialAssignedsDALServiceImpl implements AclPract ...@@ -17,4 +17,24 @@ public class AclPractitionerPotentialAssignedsDALServiceImpl implements AclPract
public void saveAll(List<AclPractitionerPotentialAssigneds> potentialAssignedsList) { public void saveAll(List<AclPractitionerPotentialAssigneds> potentialAssignedsList) {
aclPractitionerPotentialAssignedsMapper.insertList(potentialAssignedsList); aclPractitionerPotentialAssignedsMapper.insertList(potentialAssignedsList);
} }
@Override
public List<AclPractitionerPotentialAssigneds> findByPotentialIdAndPractitionerId(Long potentialId, Long practitionerId) {
return aclPractitionerPotentialAssignedsMapper.findByPotentialIdAndPractitionerId(potentialId,practitionerId);
}
@Override
public void update(AclPractitionerPotentialAssigneds assigneds) {
aclPractitionerPotentialAssignedsMapper.updateByPrimaryKeySelective(assigneds);
}
@Override
public List<AclPractitionerPotentialAssigneds> findByPractitionerId(Long practitionerId) {
return aclPractitionerPotentialAssignedsMapper.findByPractitionerId(practitionerId);
}
@Override
public List<AclPractitionerPotentialAssigneds> findByPractitionerIdAndPotentialIdList(Long practitionerId, List<Long> potentialIdList) {
return aclPractitionerPotentialAssignedsMapper.findByPractitionerIdAndPotentialIdList(practitionerId,potentialIdList);
}
} }
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions;
import com.yd.dal.mapper.customer.AclPractitionerPotentialGoalsActionsMapper;
import com.yd.dal.service.customer.AclPractitionerPotentialGoalsActionsDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("aclPractitionerPotentialGoalsActionsDALService")
public class AclPractitionerPotentialGoalsActionsDALServiceImpl implements AclPractitionerPotentialGoalsActionsDALService {
@Resource
private AclPractitionerPotentialGoalsActionsMapper aclPractitionerPotentialGoalsActionsMapper;
@Override
public List<AclPractitionerPotentialGoalsActions> findByPractitionerIdAndCurrentYearAndIsActive(Long practitionerId, Integer currentYear, Integer isActive) {
return aclPractitionerPotentialGoalsActionsMapper.findByPractitionerIdAndCurrentYearAndIsActive(practitionerId,currentYear,isActive);
}
@Override
public void updateAll(List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsListUpdate) {
for(AclPractitionerPotentialGoalsActions item : potentialGoalsActionsListUpdate){
aclPractitionerPotentialGoalsActionsMapper.updateByPrimaryKeySelective(item);
}
}
@Override
public void saveAll(List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsList) {
aclPractitionerPotentialGoalsActionsMapper.saveAll(potentialGoalsActionsList);
}
@Override
public List<AclPractitionerPotentialGoalsActions> findByPractitionerIdAndCurrentYearAndIsActiveAndTimeUnit(Long practitionerId, Integer currentYear, Integer isActive, Integer timeType) {
return aclPractitionerPotentialGoalsActionsMapper.findByPractitionerIdAndCurrentYearAndIsActiveAndTimeUnit(practitionerId,currentYear,isActive,timeType);
}
}
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoals;
import com.yd.dal.mapper.customer.AclPractitionerPotentialGoalsMapper;
import com.yd.dal.service.customer.AclPractitionerPotentialGoalsDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialGoalsDALService")
public class AclPractitionerPotentialGoalsDALServiceImpl implements AclPractitionerPotentialGoalsDALService {
@Autowired
private AclPractitionerPotentialGoalsMapper aclPractitionerPotentialGoalsMapper;
@Override
public List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYear(Long practitionerId, Integer currentYear) {
return aclPractitionerPotentialGoalsMapper.findByPractitionerAndCurrentYear(practitionerId,currentYear);
}
@Override
public void updateList(List<AclPractitionerPotentialGoals> potentialGoalsUpdateList) {
for(AclPractitionerPotentialGoals item : potentialGoalsUpdateList){
aclPractitionerPotentialGoalsMapper.updateByPrimaryKeySelective(item);
}
}
@Override
public void saveAll(List<AclPractitionerPotentialGoals> potentialGoalsList) {
aclPractitionerPotentialGoalsMapper.saveAll(potentialGoalsList);
}
@Override
public List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYearAndTimeUnit(Long practitionerId, Integer currentYear, List<Integer> timeTypeList) {
return aclPractitionerPotentialGoalsMapper.findByPractitionerAndCurrentYearAndTimeUnit(practitionerId,currentYear,timeTypeList);
}
}
...@@ -16,4 +16,6 @@ public interface MdDropOptionsDALService { ...@@ -16,4 +16,6 @@ public interface MdDropOptionsDALService {
List<MdDropOptions> findByMasterCodeAndOrderId(String masterCode, int orderId); List<MdDropOptions> findByMasterCodeAndOrderId(String masterCode, int orderId);
MdDropOptions selectByMasterCodeAndOptionsCode(String masterCode, String optionsCode); MdDropOptions selectByMasterCodeAndOptionsCode(String masterCode, String optionsCode);
List<MdDropOptions> findByMasterCodeAndOptionsCode(String team_building_track, String s);
} }
package com.yd.dal.service.meta;
import com.yd.dal.entity.meta.MdGoalsCalculateExpression;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("mdGoalsCalculateExpressionDALService")
public interface MdGoalsCalculateExpressionDALService {
List<MdGoalsCalculateExpression> findByMasterCodeAndIsActive(String masterCode, Integer isActive);
}
...@@ -48,4 +48,8 @@ public class MdDropOptionsDALServiceImpl implements MdDropOptionsDALService { ...@@ -48,4 +48,8 @@ public class MdDropOptionsDALServiceImpl implements MdDropOptionsDALService {
public MdDropOptions selectByMasterCodeAndOptionsCode(String masterCode, String optionsCode) { public MdDropOptions selectByMasterCodeAndOptionsCode(String masterCode, String optionsCode) {
return mdDropOptionsMapper.selectByMasterCodeAndOptionsCode(masterCode, optionsCode); return mdDropOptionsMapper.selectByMasterCodeAndOptionsCode(masterCode, optionsCode);
} }
@Override
public List<MdDropOptions> findByMasterCodeAndOptionsCode(String masterCode, String optionsCode) {
return mdDropOptionsMapper.findByMasterCodeAndOptionsCode(masterCode,optionsCode);
}
} }
package com.yd.dal.service.meta.impl;
import com.yd.dal.entity.meta.MdGoalsCalculateExpression;
import com.yd.dal.mapper.meta.MdGoalsCalculateExpressionMapper;
import com.yd.dal.service.meta.MdGoalsCalculateExpressionDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("MdGoalsCalculateExpressionDALService")
public class MdGoalsCalculateExpressionDALServiceImpl implements MdGoalsCalculateExpressionDALService {
@Resource
private MdGoalsCalculateExpressionMapper mdGoalsCalculateExpressionMapper;
@Override
public List<MdGoalsCalculateExpression> findByMasterCodeAndIsActive(String masterCode, Integer isActive) {
return mdGoalsCalculateExpressionMapper.findByMasterCodeAndIsActive(masterCode,isActive);
}
}
...@@ -301,4 +301,28 @@ ...@@ -301,4 +301,28 @@
where id = #{item.id,jdbcType=BIGINT} where id = #{item.id,jdbcType=BIGINT}
</foreach> </foreach>
</update> </update>
<select id="findScoreByPractitionerIdAndDate" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigned_track
where practitioner_assigned_id = #{practitionerId,jdbcType=BIGINT} and track_score > 0
<choose>
<when test="time == 'today'">
and to_days(track_time) = to_days(now())
</when>
<when test="time == 'week'">
and yearweek(date_format(track_time,'%Y-%m-%d') = yearweek(NOW())
</when>
<when test="time == 'month'">
and date_format(track_time,'%Y%m') = date_format(curdate(),'%Y%m')
</when>
<when test="time == 'quarter'">
and QUARTER(track_time) = QUARTER(NOW()) AND year(track_time)=year(now())
</when>
<otherwise>
and YEAR(track_time) = YEAR(now())
</otherwise>
</choose>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -13,10 +13,11 @@ ...@@ -13,10 +13,11 @@
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" /> <result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
<result column="updater_type" jdbcType="INTEGER" property="updaterType" /> <result column="updater_type" jdbcType="INTEGER" property="updaterType" />
<result column="creator_type" jdbcType="INTEGER" property="creatorType" /> <result column="creator_type" jdbcType="INTEGER" property="creatorType" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, assigned_practitioner_id, practitioner_potential_id, time_to_onboarding, is_active, id, assigned_practitioner_id, practitioner_potential_id, time_to_onboarding, is_active,
created_at, created_by, updated_at, updated_by, updater_type, creator_type created_at, created_by, updated_at, updated_by, updater_type, creator_type,remark
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select select
...@@ -24,7 +25,29 @@ ...@@ -24,7 +25,29 @@
from ag_acl_practitioner_potential_assigneds from ag_acl_practitioner_potential_assigneds
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <select id="findByPotentialIdAndPractitionerId" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigneds
where practitioner_potential_id = #{potentialId,jdbcType=BIGINT} and assigned_practitioner_id = #{practitionerId,jdbcType=BIGINT}
</select>
<select id="findByPractitionerId" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigneds
where assigned_practitioner_id = #{practitionerId,jdbcType=BIGINT}
</select>
<select id="findByPractitionerIdAndPotentialIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigneds
where assigned_practitioner_id = #{practitionerId,jdbcType=BIGINT}
and practitioner_potential_id in
<foreach collection="potentialIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_potential_assigneds delete from ag_acl_practitioner_potential_assigneds
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</delete> </delete>
...@@ -32,11 +55,11 @@ ...@@ -32,11 +55,11 @@
insert into ag_acl_practitioner_potential_assigneds (assigned_practitioner_id, practitioner_potential_id, insert into ag_acl_practitioner_potential_assigneds (assigned_practitioner_id, practitioner_potential_id,
time_to_onboarding, is_active, created_at, time_to_onboarding, is_active, created_at,
created_by, updated_at, updated_by, created_by, updated_at, updated_by,
updater_type, creator_type) updater_type, creator_type,remark)
values (#{assignedPractitionerId,jdbcType=BIGINT}, #{practitionerPotentialId,jdbcType=BIGINT}, values (#{assignedPractitionerId,jdbcType=BIGINT}, #{practitionerPotentialId,jdbcType=BIGINT},
#{timeToOnboarding,jdbcType=TIMESTAMP}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{timeToOnboarding,jdbcType=TIMESTAMP}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT},
#{updaterType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER}) #{updaterType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigneds insert into ag_acl_practitioner_potential_assigneds
...@@ -71,6 +94,9 @@ ...@@ -71,6 +94,9 @@
<if test="creatorType != null"> <if test="creatorType != null">
creator_type, creator_type,
</if> </if>
<if test="remark != null">
remark,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="assignedPractitionerId != null"> <if test="assignedPractitionerId != null">
...@@ -103,6 +129,9 @@ ...@@ -103,6 +129,9 @@
<if test="creatorType != null"> <if test="creatorType != null">
#{creatorType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},
</if> </if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds"> <update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds">
...@@ -138,6 +167,9 @@ ...@@ -138,6 +167,9 @@
<if test="creatorType != null"> <if test="creatorType != null">
creator_type = #{creatorType,jdbcType=INTEGER}, creator_type = #{creatorType,jdbcType=INTEGER},
</if> </if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
...@@ -152,14 +184,15 @@ ...@@ -152,14 +184,15 @@
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT}, updated_by = #{updatedBy,jdbcType=BIGINT},
updater_type = #{updaterType,jdbcType=INTEGER}, updater_type = #{updaterType,jdbcType=INTEGER},
creator_type = #{creatorType,jdbcType=INTEGER} creator_type = #{creatorType,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true"> <insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigneds (assigned_practitioner_id, practitioner_potential_id, insert into ag_acl_practitioner_potential_assigneds (assigned_practitioner_id, practitioner_potential_id,
time_to_onboarding, is_active, created_at, time_to_onboarding, is_active, created_at,
created_by, updated_at, updated_by, created_by, updated_at, updated_by,
updater_type, creator_type) updater_type, creator_type,remark)
values values
<foreach collection="potentialAssignedsList" item="item" index="index" separator=","> <foreach collection="potentialAssignedsList" item="item" index="index" separator=",">
( (
...@@ -172,7 +205,8 @@ ...@@ -172,7 +205,8 @@
#{item.updatedAt}, #{item.updatedAt},
#{item.updatedBy}, #{item.updatedBy},
#{item.updaterType}, #{item.updaterType},
#{item.creatorType} #{item.creatorType},
#{item.remark}
) )
</foreach> </foreach>
</insert> </insert>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.dal.mapper.customer.AclPractitionerPotentialGoalsActionsMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" />
<result column="current_year" jdbcType="INTEGER" property="currentYear" />
<result column="statistic_time_unit" jdbcType="INTEGER" property="statisticTimeUnit" />
<result column="potential_action_id" jdbcType="BIGINT" property="potentialActionId" />
<result column="potential_action_name" jdbcType="VARCHAR" property="potentialActionName" />
<result column="action_standards" jdbcType="INTEGER" property="actionStandards" />
<result column="current_version" jdbcType="TIMESTAMP" property="currentVersion" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap>
<sql id="Base_Column_List">
id, practitioner_id, current_year, statistic_time_unit, potential_action_id, potential_action_name,
action_standards, current_version, is_active, created_at, created_by, updated_at,
updated_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_goals_actions
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_potential_goals_actions
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_goals_actions (practitioner_id, current_year, statistic_time_unit,
potential_action_id, potential_action_name,
action_standards, current_version, is_active,
created_at, created_by, updated_at,
updated_by)
values (#{practitionerId,jdbcType=BIGINT}, #{currentYear,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER},
#{potentialActionId,jdbcType=BIGINT}, #{potentialActionName,jdbcType=VARCHAR},
#{actionStandards,jdbcType=INTEGER}, #{currentVersion,jdbcType=TIMESTAMP}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_goals_actions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="practitionerId != null">
practitioner_id,
</if>
<if test="currentYear != null">
current_year,
</if>
<if test="statisticTimeUnit != null">
statistic_time_unit,
</if>
<if test="potentialActionId != null">
potential_action_id,
</if>
<if test="potentialActionName != null">
potential_action_name,
</if>
<if test="actionStandards != null">
action_standards,
</if>
<if test="currentVersion != null">
current_version,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="practitionerId != null">
#{practitionerId,jdbcType=BIGINT},
</if>
<if test="currentYear != null">
#{currentYear,jdbcType=INTEGER},
</if>
<if test="statisticTimeUnit != null">
#{statisticTimeUnit,jdbcType=INTEGER},
</if>
<if test="potentialActionId != null">
#{potentialActionId,jdbcType=BIGINT},
</if>
<if test="potentialActionName != null">
#{potentialActionName,jdbcType=VARCHAR},
</if>
<if test="actionStandards != null">
#{actionStandards,jdbcType=INTEGER},
</if>
<if test="currentVersion != null">
#{currentVersion,jdbcType=TIMESTAMP},
</if>
<if test="isActive != null">
#{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions">
update ag_acl_practitioner_potential_goals_actions
<set>
<if test="practitionerId != null">
practitioner_id = #{practitionerId,jdbcType=BIGINT},
</if>
<if test="currentYear != null">
current_year = #{currentYear,jdbcType=INTEGER},
</if>
<if test="statisticTimeUnit != null">
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
</if>
<if test="potentialActionId != null">
potential_action_id = #{potentialActionId,jdbcType=BIGINT},
</if>
<if test="potentialActionName != null">
potential_action_name = #{potentialActionName,jdbcType=VARCHAR},
</if>
<if test="actionStandards != null">
action_standards = #{actionStandards,jdbcType=INTEGER},
</if>
<if test="currentVersion != null">
current_version = #{currentVersion,jdbcType=TIMESTAMP},
</if>
<if test="isActive != null">
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions">
update ag_acl_practitioner_potential_goals_actions
set practitioner_id = #{practitionerId,jdbcType=BIGINT},
current_year = #{currentYear,jdbcType=INTEGER},
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
potential_action_id = #{potentialActionId,jdbcType=BIGINT},
potential_action_name = #{potentialActionName,jdbcType=VARCHAR},
action_standards = #{actionStandards,jdbcType=INTEGER},
current_version = #{currentVersion,jdbcType=TIMESTAMP},
is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="findByPractitionerIdAndCurrentYearAndIsActive" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_goals_actions
where practitioner_id = #{practitionerId,jdbcType=BIGINT} and is_active = #{isActive,jdbcType=INTEGER} and current_year = #{currentYear,jdbcType=INTEGER}
</select>
<insert id="saveAll" parameterType="java.util.List" useGeneratedKeys="true" >
insert into ag_acl_practitioner_potential_goals_actions (practitioner_id, current_year, statistic_time_unit,
potential_action_id, potential_action_name,
action_standards, current_version, is_active,
created_at, created_by, updated_at,
updated_by)
values
<foreach collection="potentialGoalsActionsList" item="item" index="index" separator=",">
(
#{item.practitionerId},
#{item.currentYear},
#{item.statisticTimeUnit},
#{item.potentialActionId},
#{item.potentialActionName},
#{item.actionStandards},
#{item.currentVersion},
#{item.isActive},
#{item.createdAt},
#{item.createdBy},
#{item.updatedAt},
#{item.updatedBy}
)
</foreach>
</insert>
<select id="findByPractitionerIdAndCurrentYearAndIsActiveAndTimeUnit" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_goals_actions
where practitioner_id = #{practitionerId,jdbcType=BIGINT} and is_active = #{isActive,jdbcType=INTEGER} and current_year = #{currentYear,jdbcType=INTEGER} and statistic_time_unit = #{timeType,jdbcType=INTEGER}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.dal.mapper.customer.AclPractitionerPotentialGoalsMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclPractitionerPotentialGoals">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" />
<result column="current_year" jdbcType="INTEGER" property="currentYear" />
<result column="statistic_time_unit" jdbcType="INTEGER" property="statisticTimeUnit" />
<result column="seq_time" jdbcType="INTEGER" property="seqTime" />
<result column="number_recruits" jdbcType="INTEGER" property="numberRecruits" />
<result column="number_mdrt" jdbcType="INTEGER" property="numberMdrt" />
<result column="current_version" jdbcType="TIMESTAMP" property="currentVersion" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap>
<sql id="Base_Column_List">
id, practitioner_id, current_year, statistic_time_unit, seq_time, number_recruits,
number_mdrt, current_version, is_active, created_at, created_by, updated_at, updated_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_goals
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_potential_goals
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoals" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_goals (practitioner_id, current_year, statistic_time_unit,
seq_time, number_recruits, number_mdrt,
current_version, is_active, created_at,
created_by, updated_at, updated_by
)
values (#{practitionerId,jdbcType=BIGINT}, #{currentYear,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER},
#{seqTime,jdbcType=INTEGER}, #{numberRecruits,jdbcType=INTEGER}, #{numberMdrt,jdbcType=INTEGER},
#{currentVersion,jdbcType=TIMESTAMP}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoals" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_goals
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="practitionerId != null">
practitioner_id,
</if>
<if test="currentYear != null">
current_year,
</if>
<if test="statisticTimeUnit != null">
statistic_time_unit,
</if>
<if test="seqTime != null">
seq_time,
</if>
<if test="numberRecruits != null">
number_recruits,
</if>
<if test="numberMdrt != null">
number_mdrt,
</if>
<if test="currentVersion != null">
current_version,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="practitionerId != null">
#{practitionerId,jdbcType=BIGINT},
</if>
<if test="currentYear != null">
#{currentYear,jdbcType=INTEGER},
</if>
<if test="statisticTimeUnit != null">
#{statisticTimeUnit,jdbcType=INTEGER},
</if>
<if test="seqTime != null">
#{seqTime,jdbcType=INTEGER},
</if>
<if test="numberRecruits != null">
#{numberRecruits,jdbcType=INTEGER},
</if>
<if test="numberMdrt != null">
#{numberMdrt,jdbcType=INTEGER},
</if>
<if test="currentVersion != null">
#{currentVersion,jdbcType=TIMESTAMP},
</if>
<if test="isActive != null">
#{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoals">
update ag_acl_practitioner_potential_goals
<set>
<if test="practitionerId != null">
practitioner_id = #{practitionerId,jdbcType=BIGINT},
</if>
<if test="currentYear != null">
current_year = #{currentYear,jdbcType=INTEGER},
</if>
<if test="statisticTimeUnit != null">
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
</if>
<if test="seqTime != null">
seq_time = #{seqTime,jdbcType=INTEGER},
</if>
<if test="numberRecruits != null">
number_recruits = #{numberRecruits,jdbcType=INTEGER},
</if>
<if test="numberMdrt != null">
number_mdrt = #{numberMdrt,jdbcType=INTEGER},
</if>
<if test="currentVersion != null">
current_version = #{currentVersion,jdbcType=TIMESTAMP},
</if>
<if test="isActive != null">
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoals">
update ag_acl_practitioner_potential_goals
set practitioner_id = #{practitionerId,jdbcType=BIGINT},
current_year = #{currentYear,jdbcType=INTEGER},
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
seq_time = #{seqTime,jdbcType=INTEGER},
number_recruits = #{numberRecruits,jdbcType=INTEGER},
number_mdrt = #{numberMdrt,jdbcType=INTEGER},
current_version = #{currentVersion,jdbcType=TIMESTAMP},
is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="findByPractitionerAndCurrentYear" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_goals
where practitioner_id = #{practitionerId,jdbcType=BIGINT} and current_year = #{currentYear,jdbcType=INTEGER} and is_active = 1
</select>
<insert id="saveAll" parameterType="java.util.List" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_goals (practitioner_id, current_year, statistic_time_unit,
seq_time, number_recruits, number_mdrt,
current_version, is_active, created_at,
created_by, updated_at, updated_by
)
values
<foreach collection="potentialGoalsList" item="item" index="index" separator=",">
(
#{item.practitionerId},
#{item.currentYear},
#{item.statisticTimeUnit},
#{item.seqTime},
#{item.numberRecruits},
#{item.numberMdrt},
#{item.currentVersion},
#{item.isActive},
#{item.createdAt},
#{item.createdBy},
#{item.updatedAt},
#{item.updatedBy}
)
</foreach>
</insert>
<select id="findByPractitionerAndCurrentYearAndTimeUnit" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_goals
where practitioner_id = #{practitionerId,jdbcType=BIGINT} and current_year = #{currentYear,jdbcType=INTEGER} and is_active = 1 and statistic_time_unit in
<foreach collection="timeTypeList" item="timeType" open="(" separator="," close=")">
#{timeType}
</foreach>
</select>
</mapper>
\ No newline at end of file
...@@ -227,4 +227,19 @@ ...@@ -227,4 +227,19 @@
and o.is_active=1 and o.is_active=1
and m.is_active=1 and m.is_active=1
</select> </select>
<select id="findByMasterCodeAndOptionsCode" resultType="com.yd.dal.entity.meta.MdDropOptions">
select
o.id id,
o.drop_master_id dropMasterId,
o.drop_option_name dropOptionName,
o.drop_option_code dropOptionCode,
o.drop_option_order dropOptionOrder,
o.drop_option_score dropOptionScore,
o.drop_option_remark dropOptionRemark,
o.is_active isActive,
o.created_at createdAt,
o.created_by createdBy
from ag_md_drop_master m left join ag_md_drop_options o on m.id = o.drop_master_id and o.is_active = 1 and o.drop_option_code = #{optionsCode,jdbcType=VARCHAR}
where m.scenario_code = #{masterCode,jdbcType=BIGINT}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.dal.mapper.meta.MdGoalsCalculateExpressionMapper"> <mapper namespace="com.yd.dal.mapper.meta.MdGoalsCalculateExpressionMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.meta.MdGoalsCalculateExpression"> <resultMap id="BaseResultMap" type="com.yd.dal.entity.meta.MdGoalsCalculateExpression">
<!--@mbg.generated-->
<!--@Table ag_md_goals_calculate_expression-->
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="current_year" jdbcType="INTEGER" property="currentYear" /> <result column="current_year" jdbcType="INTEGER" property="currentYear" />
<result column="drop_master_id" jdbcType="BIGINT" property="dropMasterId" /> <result column="drop_master_id" jdbcType="BIGINT" property="dropMasterId" />
...@@ -18,35 +16,30 @@ ...@@ -18,35 +16,30 @@
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" /> <result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated-->
id, current_year, drop_master_id, drop_master_name, action_id, drop_option_name, id, current_year, drop_master_id, drop_master_name, action_id, drop_option_name,
calculate_script_expression, is_active, created_at, created_by, updated_at, updated_by calculate_script_expression, is_active, created_at, created_by, updated_at, updated_by
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from ag_md_goals_calculate_expression from ag_md_goals_calculate_expression
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from ag_md_goals_calculate_expression delete from ag_md_goals_calculate_expression
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</delete> </delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression" useGeneratedKeys="true"> <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_md_goals_calculate_expression (current_year, drop_master_id, drop_master_name, insert into ag_md_goals_calculate_expression (current_year, drop_master_id, drop_master_name,
action_id, drop_option_name, calculate_script_expression, action_id, drop_option_name, calculate_script_expression,
is_active, created_at, created_by, is_active, created_at, created_by,
updated_at, updated_by) updated_at, updated_by)
values (#{currentYear,jdbcType=INTEGER}, #{dropMasterId,jdbcType=BIGINT}, #{dropMasterName,jdbcType=VARCHAR}, values (#{currentYear,jdbcType=INTEGER}, #{dropMasterId,jdbcType=BIGINT}, #{dropMasterName,jdbcType=VARCHAR},
#{actionId,jdbcType=BIGINT}, #{dropOptionName,jdbcType=VARCHAR}, #{calculateScriptExpression,jdbcType=LONGVARCHAR}, #{actionId,jdbcType=BIGINT}, #{dropOptionName,jdbcType=VARCHAR}, #{calculateScriptExpression,jdbcType=LONGVARCHAR},
#{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT},
#{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}) #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT})
</insert> </insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_md_goals_calculate_expression insert into ag_md_goals_calculate_expression
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="currentYear != null"> <if test="currentYear != null">
...@@ -120,7 +113,6 @@ ...@@ -120,7 +113,6 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression"> <update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression">
<!--@mbg.generated-->
update ag_md_goals_calculate_expression update ag_md_goals_calculate_expression
<set> <set>
<if test="currentYear != null"> <if test="currentYear != null">
...@@ -160,7 +152,6 @@ ...@@ -160,7 +152,6 @@
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression"> <update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression">
<!--@mbg.generated-->
update ag_md_goals_calculate_expression update ag_md_goals_calculate_expression
set current_year = #{currentYear,jdbcType=INTEGER}, set current_year = #{currentYear,jdbcType=INTEGER},
drop_master_id = #{dropMasterId,jdbcType=BIGINT}, drop_master_id = #{dropMasterId,jdbcType=BIGINT},
...@@ -186,4 +177,22 @@ ...@@ -186,4 +177,22 @@
and e.is_active = 1 and e.is_active = 1
order by o.drop_option_order; order by o.drop_option_order;
</select> </select>
<select id="findByMasterCodeAndIsActive" resultType="com.yd.dal.entity.meta.MdGoalsCalculateExpression">
select
e.id id,
e.current_year currentYear,
e.drop_master_id dropMasterId,
e.drop_master_name dropMasterName,
e.action_id actionId,
e.drop_option_name dropOptionName,
e.calculate_script_expression calculateScriptExpression,
e.is_active isActive,
e.created_at createdAt,
e.created_by createdBy,
e.updated_at updatedAt,
e.updated_by updatedBy
from ag_md_drop_master m left join ag_md_goals_calculate_expression e on m.id = e.drop_master_id and e.is_active = #{isActive,jdbcType=INTEGER}
where m.scenario_code = #{masterCode,jdbcType=VARCHAR}
</select>
</mapper> </mapper>
\ No newline at end of file
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