Commit 150d5052 by Water Wang

Merge branch 'dev_20200427_practitioner' into dev

parents 19d6843f be3eb8b0
......@@ -7,6 +7,8 @@ import com.yd.api.customer.vo.CustomerFortuneResponseVO;
import com.yd.api.customer.vo.CustomerQueryRequestVO;
import com.yd.api.customer.vo.CustomerQueryResponseVO;
import com.yd.api.customer.vo.CustomerVO;
import com.yd.api.customer.vo.register.RegisterRequestVO;
import com.yd.api.customer.vo.register.RegisterResponseVO;
public interface CustomerService {
......@@ -15,4 +17,6 @@ public interface CustomerService {
CustomerQueryResponseVO findByPage(CustomerQueryRequestVO customerQueryRequestVO);
CustomerFortuneResponseVO selectByCustomerId(CustomerFortuneRequestVO customer);
RegisterResponseVO register(RegisterRequestVO register);
}
package com.yd.api.customer.service;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.google.common.base.Strings;
import com.yd.api.customer.vo.register.RegisterRequestVO;
import com.yd.api.customer.vo.register.RegisterResponseVO;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.customer.AclCustomer;
import com.yd.dal.service.customer.AclCustomerDALService;
import com.yd.dal.service.customer.CustomerDALService;
import com.yd.util.EncryptUtil;
import com.yd.util.config.ZHBErrorConfig;
import com.yd.util.deshandler.DESTypeHandler;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -16,7 +27,6 @@ import com.yd.api.customer.vo.CustomerQueryResponseVO;
import com.yd.api.customer.vo.CustomerVO;
import com.yd.dal.entity.customer.Customer;
import com.yd.dal.entity.customer.CustomerFortune;
import com.yd.dal.mapper.customer.CustomerFortuneMapper;
@Service("customerServiceImpl")
public class CustomerServiceImpl implements CustomerService{
......@@ -25,12 +35,12 @@ public class CustomerServiceImpl implements CustomerService{
private CustomerDALService customerServiceDA;
@Autowired
private CustomerFortuneMapper customerFortuneMapper;
private AclCustomerDALService aclCustomerDALService;
@Override
public List<CustomerVO> listAllCustomer() {
List<CustomerVO> listTo =new ArrayList<CustomerVO>();
List<Customer> list = new ArrayList<Customer>();
List<CustomerVO> listTo =new ArrayList<>();
List<Customer> list ;
list = customerServiceDA.listAllCustomers();
CustomerVO oneDestVO;
for(Customer oneSrc:list)
......@@ -74,5 +84,71 @@ public class CustomerServiceImpl implements CustomerService{
return customerQueryResponseVO;
}
@Override
public RegisterResponseVO register(RegisterRequestVO requestVO) {
RegisterResponseVO registerResponseVO = new RegisterResponseVO();
String mobileNo = requestVO.getMobileNo();
String checkResult = paramCheck(mobileNo);
//入参校验
if(Strings.isNullOrEmpty(checkResult)){
String accountId = createAccountId(mobileNo);
List<AclCustomer> aclCustomerList = aclCustomerDALService.findByLogin(mobileNo);
if(aclCustomerList.isEmpty()){
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
AclCustomer aclCustomer = new AclCustomer();
aclCustomer.setRole(2);//1= Staff 2=Customer 3=Partner
aclCustomer.setAccountId(accountId);
aclCustomer.setLogin(mobileNo);
aclCustomer.setMobileNo(jpaCryptoConverter.encode(mobileNo));
aclCustomer.setPassword(EncryptUtil.encrypt(requestVO.getPassword(),null));
aclCustomer.setEmail(requestVO.getEmail());
aclCustomer.setCusLevel(1);
aclCustomer.setName(requestVO.getName());
aclCustomer.setIsActive(1);
aclCustomer.setRoleId(3L);
aclCustomer.setWithdrawType(0);
aclCustomer.setCreatedAt(new Date());
aclCustomer.setCreatedBy(-1L);
aclCustomer.setUpdatedAt(new Date());
aclCustomer.setUpdatedBy(-1L);
aclCustomer.setChannelReferralRateId(3L);
aclCustomerDALService.save(aclCustomer);
//202003对新注册的客户还需保存至ag_mkt_leads_pool
// saveLeadsPool(aclCustomer);
registerResponseVO.setCustomerId(aclCustomer.getId());
registerResponseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{
String [] params = {mobileNo};
registerResponseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("630002",params)));
registerResponseVO.setCustomerId(aclCustomerList.get(0).getId());
}
}else{
registerResponseVO.setCommonResult(new CommonResult(false,checkResult));
}
return registerResponseVO;
}
private String createAccountId(String mobileNo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String sub = null;
if(mobileNo != null && !"".equals(mobileNo)){
sub = mobileNo.substring(mobileNo.length()-6);
}
return "C_"+sub+"_"+sdf.format(new Date());
}
private String paramCheck(String mobileNo) {
if(Strings.isNullOrEmpty(mobileNo)){
String[] params ={"mobileNo"};
return ZHBErrorConfig.getErrorInfo("610002", params);
}else{
if(mobileNo.length() != 11 || !mobileNo.startsWith("1")){
String[] params = {mobileNo};
return ZHBErrorConfig.getErrorInfo("630001", params);
}
}
return null;
}
}
package com.yd.api.customer.vo.register;
public class RegisterRequestVO {
private String name;
private String mobileNo;
private String email;
private String password;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
package com.yd.api.customer.vo.register;
import com.yd.api.result.CommonResult;
public class RegisterResponseVO {
private Long customerId;
private CommonResult commonResult;
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
......@@ -7,6 +7,7 @@ import com.yd.api.practitioner.vo.media.MediaGetReqVO;
import com.yd.api.practitioner.vo.media.MediaGetRespVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO;
import com.yd.api.practitioner.vo.recruit.*;
import com.yd.api.practitioner.vo.setting.*;
import com.yd.api.result.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -25,8 +26,8 @@ public class PractitionerController {
/**
* 经纪人登录
* @param requestVO
* @return
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/login")
public Object practitionerLogin(@RequestBody PractitionerLoginRequestVO requestVO){
......@@ -39,7 +40,7 @@ public class PractitionerController {
/**
* 经纪人(排行榜) + (保费+佣金+件数)查询
* @param requestVO
* @param requestVO 请求数据
* @return Object
*/
@RequestMapping("/rank")
......@@ -53,7 +54,7 @@ public class PractitionerController {
/**
* 查询经纪人的个人设置
* @param requestVO
* @param requestVO 请求数据
* @return responseVO
*/
@RequestMapping("/settingQuery")
......@@ -67,7 +68,7 @@ public class PractitionerController {
/**
* 保存经纪人的个人设置
* @param requestVO
* @param requestVO 请求数据
* @return responseVO
*/
@RequestMapping("/settingSave")
......@@ -92,11 +93,67 @@ public class PractitionerController {
}
@RequestMapping("/mediaGet")
public Object mediaGet(@RequestBody MediaGetReqVO requestVO) throws Exception{
public Object mediaGet(@RequestBody MediaGetReqVO requestVO){
JsonResult result = new JsonResult();
MediaGetRespVO responseVO = practitionerService.mediaGet(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/**
* 团队长--新增增员
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/recruit")
public Object recruit(@RequestBody RecruitRequestVO requestVO){
JsonResult result = new JsonResult();
RecruitResponseVO responseVO = practitionerService.recruit(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/**
* 团队长--新增增员记录
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/addRecruitTrack")
public Object addRecruitTrack(@RequestBody AddRecruitTrackRequestVO requestVO){
JsonResult result = new JsonResult();
AddRecruitTrackResponseVO responseVO = practitionerService.addRecruitTrack(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/**
* 团队长--增员记录查询
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/recruitTrackQuery")
public Object recruitTrackQuery(@RequestBody RecruitTrackQueryRequestVO requestVO){
JsonResult result = new JsonResult();
RecruitTrackQueryResponseVO responseVO = practitionerService.recruitTrackQuery(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/**
* 团队长--增员列表查询
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/recruitListQuery")
public Object recruitListQuery(@RequestBody RecruitListRequestVO requestVO){
JsonResult result = new JsonResult();
RecruitListResponseVO responseVO = practitionerService.recruitListQuery(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
}
......@@ -6,6 +6,7 @@ import com.yd.api.practitioner.vo.media.MediaGetReqVO;
import com.yd.api.practitioner.vo.media.MediaGetRespVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO;
import com.yd.api.practitioner.vo.recruit.*;
import com.yd.api.practitioner.vo.setting.*;
import org.springframework.stereotype.Service;
......@@ -53,4 +54,31 @@ public interface PractitionerService {
* @return
*/
MediaGetRespVO mediaGet(MediaGetReqVO requestVO);
/**
* 团队长--增员
* @param requestVO 请求信息
* @return responseVO
*/
RecruitResponseVO recruit(RecruitRequestVO requestVO);
/**
* 团队长--新增增员记录
* @param requestVO 请求信息
* @return responseVO
*/
AddRecruitTrackResponseVO addRecruitTrack(AddRecruitTrackRequestVO requestVO);
/**
* 团队长--增员记录查询
* @param requestVO 请求信息
* @return responseVO
*/
RecruitTrackQueryResponseVO recruitTrackQuery(RecruitTrackQueryRequestVO requestVO);
/**
* 团队长--增员列表查询
* @param requestVO 请求信息
* @return responseVO
*/
RecruitListResponseVO recruitListQuery(RecruitListRequestVO requestVO);
}
......@@ -3,7 +3,7 @@ package com.yd.api.practitioner.vo.rank;
public class PractitionerRankRequestVO {
private String mobileNo;
private Integer platform;//1-online,2-offline
private Integer time;//1-month,2-year
private Integer time;//1-month,2-year,3-quarter
private Integer type;//1-保费,2-佣金,3-件数
public String getMobileNo() {
......
package com.yd.api.practitioner.vo.recruit;
public class AddRecruitTrackRequestVO {
private Long trackId;
private Long trackStatusId;
private String notice;
private Integer isActive;
public Long getTrackId() {
return trackId;
}
public void setTrackId(Long trackId) {
this.trackId = trackId;
}
public Long getTrackStatusId() {
return trackStatusId;
}
public void setTrackStatusId(Long trackStatusId) {
this.trackStatusId = trackStatusId;
}
public String getNotice() {
return notice;
}
public void setNotice(String notice) {
this.notice = notice;
}
public Integer getIsActive() {
return isActive;
}
public void setIsActive(Integer isActive) {
this.isActive = isActive;
}
}
package com.yd.api.practitioner.vo.recruit;
import com.yd.api.result.CommonResult;
public class AddRecruitTrackResponseVO {
private Long trackId;
private Integer isActive;
private CommonResult commonResult;
public Long getTrackId() {
return trackId;
}
public void setTrackId(Long trackId) {
this.trackId = trackId;
}
public Integer getIsActive() {
return isActive;
}
public void setIsActive(Integer isActive) {
this.isActive = isActive;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.recruit;
public class PractitionerPotentialInfo {
private Long potentialId;
private String name;
private Integer gender;
private Long age;
private String mobileNo;
private String wechatId;
private String qqId;
private String othersContacts;
private String educationLevel;
private Long resourceDropMasterId;
private String resourceDropMasterName;
private String introducer;
private String tag;
private String remark;
private String ossPathResume;
private String assignedId;
private String assignedName;
private Long trackStatusId;
private String trackStatus;
private Long trackId;
private Long operateUserId;
private String operateUserName;
private String createdAt;
public Long getPotentialId() {
return potentialId;
}
public void setPotentialId(Long potentialId) {
this.potentialId = potentialId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getGender() {
return gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public Long getAge() {
return age;
}
public void setAge(Long age) {
this.age = age;
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
public String getWechatId() {
return wechatId;
}
public void setWechatId(String wechatId) {
this.wechatId = wechatId;
}
public String getQqId() {
return qqId;
}
public void setQqId(String qqId) {
this.qqId = qqId;
}
public String getOthersContacts() {
return othersContacts;
}
public void setOthersContacts(String othersContacts) {
this.othersContacts = othersContacts;
}
public String getEducationLevel() {
return educationLevel;
}
public void setEducationLevel(String educationLevel) {
this.educationLevel = educationLevel;
}
public Long getResourceDropMasterId() {
return resourceDropMasterId;
}
public void setResourceDropMasterId(Long resourceDropMasterId) {
this.resourceDropMasterId = resourceDropMasterId;
}
public String getResourceDropMasterName() {
return resourceDropMasterName;
}
public void setResourceDropMasterName(String resourceDropMasterName) {
this.resourceDropMasterName = resourceDropMasterName;
}
public String getIntroducer() {
return introducer;
}
public void setIntroducer(String introducer) {
this.introducer = introducer;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getOssPathResume() {
return ossPathResume;
}
public void setOssPathResume(String ossPathResume) {
this.ossPathResume = ossPathResume;
}
public String getAssignedId() {
return assignedId;
}
public void setAssignedId(String assignedId) {
this.assignedId = assignedId;
}
public String getAssignedName() {
return assignedName;
}
public void setAssignedName(String assignedName) {
this.assignedName = assignedName;
}
public Long getTrackStatusId() {
return trackStatusId;
}
public void setTrackStatusId(Long trackStatusId) {
this.trackStatusId = trackStatusId;
}
public String getTrackStatus() {
return trackStatus;
}
public void setTrackStatus(String trackStatus) {
this.trackStatus = trackStatus;
}
public Long getTrackId() {
return trackId;
}
public void setTrackId(Long trackId) {
this.trackId = trackId;
}
public Long getOperateUserId() {
return operateUserId;
}
public void setOperateUserId(Long operateUserId) {
this.operateUserId = operateUserId;
}
public String getOperateUserName() {
return operateUserName;
}
public void setOperateUserName(String operateUserName) {
this.operateUserName = operateUserName;
}
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
}
package com.yd.api.practitioner.vo.recruit;
public class RecruitListRequestVO {
private Long assignedId;
private Integer status;//1-待跟进,2-跟进中,3-以完成
public Long getAssignedId() {
return assignedId;
}
public void setAssignedId(Long assignedId) {
this.assignedId = assignedId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
package com.yd.api.practitioner.vo.recruit;
import com.github.pagehelper.PageInfo;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.customer.Customer;
import java.util.List;
public class RecruitListResponseVO {
private List<PractitionerPotentialInfo> practitionerPotentialInfoList;
private PageInfo<PractitionerPotentialInfo> page;
private CommonResult commonResult;
public List<PractitionerPotentialInfo> getPractitionerPotentialInfoList() {
return practitionerPotentialInfoList;
}
public void setPractitionerPotentialInfoList(List<PractitionerPotentialInfo> practitionerPotentialInfoList) {
this.practitionerPotentialInfoList = practitionerPotentialInfoList;
}
public PageInfo<PractitionerPotentialInfo> getPage() {
return page;
}
public void setPage(PageInfo<PractitionerPotentialInfo> page) {
this.page = page;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.recruit;
public class RecruitRequestVO {
private Long potentialId;
private String name;
private Integer gender;
private Long age;
private String mobileNo;
private String wechatId;
private String qqId;
private String othersContacts;
private String educationLevel;
private Long resourceDropMasterId;
private String introducer;
private String tag;
private String remark;
private String ossPathResume;
private Long practitionerId;
public Long getPotentialId() {
return potentialId;
}
public void setPotentialId(Long potentialId) {
this.potentialId = potentialId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getGender() {
return gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public Long getAge() {
return age;
}
public void setAge(Long age) {
this.age = age;
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
public String getWechatId() {
return wechatId;
}
public void setWechatId(String wechatId) {
this.wechatId = wechatId;
}
public String getQqId() {
return qqId;
}
public void setQqId(String qqId) {
this.qqId = qqId;
}
public String getOthersContacts() {
return othersContacts;
}
public void setOthersContacts(String othersContacts) {
this.othersContacts = othersContacts;
}
public String getEducationLevel() {
return educationLevel;
}
public void setEducationLevel(String educationLevel) {
this.educationLevel = educationLevel;
}
public Long getResourceDropMasterId() {
return resourceDropMasterId;
}
public void setResourceDropMasterId(Long resourceDropMasterId) {
this.resourceDropMasterId = resourceDropMasterId;
}
public String getIntroducer() {
return introducer;
}
public void setIntroducer(String introducer) {
this.introducer = introducer;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getOssPathResume() {
return ossPathResume;
}
public void setOssPathResume(String ossPathResume) {
this.ossPathResume = ossPathResume;
}
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 RecruitResponseVO {
private Long potentialCustomerId;
private Long potentialId;
private CommonResult commonResult;
public Long getPotentialCustomerId() {
return potentialCustomerId;
}
public void setPotentialCustomerId(Long potentialCustomerId) {
this.potentialCustomerId = potentialCustomerId;
}
public Long getPotentialId() {
return potentialId;
}
public void setPotentialId(Long potentialId) {
this.potentialId = potentialId;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.recruit;
public class RecruitTrackQueryRequestVO {
private Long potentialId;
private Long assignedId;
public Long getPotentialId() {
return potentialId;
}
public void setPotentialId(Long potentialId) {
this.potentialId = potentialId;
}
public Long getAssignedId() {
return assignedId;
}
public void setAssignedId(Long assignedId) {
this.assignedId = assignedId;
}
}
package com.yd.api.practitioner.vo.recruit;
public class RecruitTrackQueryResponseVO {
private Long trackId;
private Long trackStatusId;
private String trackStatus;
private String notice;
private String createAt;
private Long operateUserId;
private String operateUserName;
public Long getTrackId() {
return trackId;
}
public void setTrackId(Long trackId) {
this.trackId = trackId;
}
public Long getTrackStatusId() {
return trackStatusId;
}
public void setTrackStatusId(Long trackStatusId) {
this.trackStatusId = trackStatusId;
}
public String getTrackStatus() {
return trackStatus;
}
public void setTrackStatus(String trackStatus) {
this.trackStatus = trackStatus;
}
public String getNotice() {
return notice;
}
public void setNotice(String notice) {
this.notice = notice;
}
public String getCreateAt() {
return createAt;
}
public void setCreateAt(String createAt) {
this.createAt = createAt;
}
public Long getOperateUserId() {
return operateUserId;
}
public void setOperateUserId(Long operateUserId) {
this.operateUserId = operateUserId;
}
public String getOperateUserName() {
return operateUserName;
}
public void setOperateUserName(String operateUserName) {
this.operateUserName = operateUserName;
}
}
package com.yd.dal.entity.customer;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* ag_acl_customer
* @author
*/
@Data
public class AclCustomer implements Serializable {
/**
* serial id
*/
private Long id;
/**
* 1= Staff 2=Customer 3=Partner 6=VIP 9=Car Insurance Chanel
*/
private Integer role;
/**
* customer# for referral use -######## = login ID
*/
private String accountId;
private String login;
private String mobileNo;
/**
* for mobile
*/
private String authenCode;
/**
* for staff or partner
*/
private String password;
private String email;
/**
* FK ag_md_province.id 省
*/
private Long provinceId;
/**
* FK ag_md_city.id 城市
*/
private Long cityId;
/**
* FK ag_md_district.id 县(区)
*/
private Long districtId;
/**
* mailing address
*/
private String address;
/**
* FK ag_md_industry_occupation.id
*/
private Long occupationId;
/**
* 1=普通会员 2=黄金会员 3=白金会员 4=黑金会员 5=钻石会员
*/
private Integer cusLevel;
/**
* Chinese Name
*/
private String name;
/**
* 自行编辑昵称
*/
private String nicknameModify;
/**
* Englsih First name
*/
private String enFirstname;
/**
* English Last name
*/
private String enLastname;
/**
* ag_md_id_type.id
*/
private Long idTypeId;
private String idNo;
/**
* 1=Male, 2=Female
*/
private Integer gender;
/**
* 0000-00-00
*/
private Date birthDate;
private Date lastLoginTime;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 0=逐单提现, 1=对冲记录提现
*/
private Integer withdrawType;
private BigDecimal referralRate;
private BigDecimal referralTotalAmount;
/**
* FK ag_acl_channel_referral_rate.id 角色渠道推荐佣金比率对应
*/
private Long channelReferralRateId;
/**
* URL path of of Customer picture
*/
private String imagePath;
/**
* 微信客户标识,对当前开发账户唯一
*/
private String wechatOpenid;
/**
* 银盾经纪公众号的微信客户标识,对当前开发账户唯一
*/
private String ydWechatOpenid;
/**
* 微信调接昵称
*/
private String nickname;
/**
* FK ag_system_dept.id
*/
private Long deptId;
/**
* FK ag_system_role.id
*/
private Long roleId;
/**
* 创建时间
*/
private Date createdAt;
/**
* 创建人
*/
private Long createdBy;
/**
* 修改时间
*/
private Date updatedAt;
private Long updatedBy;
/**
* 推荐达人等级 1=一袋达人 2=二袋达人 3=三袋达人 4=四袋达人 5=五袋达人
*/
private Integer referralLevel;
/**
* 执业者编号(登记代理人资格)
*/
private String practitionerRegNo;
/**
* 所属公司(登记代理人资格)
*/
private String practitionerRegCompany;
/**
* 执业证有效日期(登记代理人资格)
*/
private Date practitionerRegExpirydate;
/**
* 执业证是否有效 0=无效, 1=有效
*/
private Integer practitionerRegStatus;
/**
* 执业者教育程度 1博士 2硕士 3本科 4大专 5高中及同等学历 6初中及同等学历 7初中以下学历
*/
private Integer practitionerRegEducationLevel;
/**
* 执业登记姓名
*/
private String practitionerRegName;
/**
* 执业登记者的证件类型 FK ag_md_id_type, 1=身份证 2=护照 4=台胞证 5=香港身份证
*/
private Integer practitionerIdTypeId;
/**
* 执业登记者的证件号
*/
private String practitionerIdNo;
/**
* 执业登记者的生日
*/
private Date practitionerBirthdate;
/**
* 执业登记者的性别 1=Male, 2=Female
*/
private Integer practitionerGender;
/**
* 执业登记者大头照存放的URL
*/
private String practitionerPortaitUrl;
/**
* 营销投放渠道来源 hmsr
*/
private String sourceChannel;
/**
* 活动
*/
private String mktCampaign;
/**
* 活动任务
*/
private String mktTask;
/**
* 营销投放产品名 hmpl
*/
private String sourcePlanName;
/**
* 营销投放推送日期 hmkw
*/
private String sourcePublishdate;
/**
* 营销投放推送文章或其他 hmci
*/
private String sourceArticle;
/**
* 微信号
*/
private String wechatNo;
/**
* 其他联系方式
*/
private String otherContacts;
/**
* 年龄
*/
private Long age;
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
* @author
*/
@Data
public class AclPractitioner implements Serializable {
/**
* serial id
*/
private Long id;
/**
* FK ag_acl_insurer.id
*/
private Long insurerId;
/**
* FK ag_acl_insurer_branch.id
*/
private Long insurerBranchId;
/**
* FK ag_acl_insurer_branch_dept.id 所属部门id
*/
private Long deptId;
/**
* FK ag_acl_practitioner_subordinate_system.id 所属部门id
*/
private Long subordinateSystemId;
/**
* 从业人员编号
*/
private String practitionerCode;
/**
* 从业人员姓名
*/
private String name;
/**
* 从业人员电话
*/
private String mobileNo;
/**
* FK ag_md_id_type.id
*/
private Long idTypeId;
/**
* 从业人员证件类型
*/
private String idType;
/**
* 从业人员证件号
*/
private String idNo;
/**
* 从业人员生日
*/
private Date practitionerBirthdate;
/**
* 从业人员执业证编号
*/
private String practitionerRegNo;
/**
* 从业人员所属公司
*/
private String practitionerRegCompany;
/**
* 有效起日
*/
private Date effectiveStartDate;
/**
* 有效终日
*/
private Date effectiveEndDate;
/**
* 备注
*/
private String remark;
/**
* FK ag_acl_customer.id
*/
private Long customerId;
/**
* 公司员工编码
*/
private String employeeNo;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 建置日
*/
private Date createdAt;
/**
* 建置者
*/
private Long createdBy;
/**
* 更新日
*/
private Date updatedAt;
private Long updatedBy;
/**
* 从业人员所属区域-省份 FK ag_md_province.id
*/
private Long provinceId;
/**
* 所属区域省份名
*/
private String provinceName;
/**
* 从业人员所属区域-城市 FK ag_md_city.id
*/
private Long cityId;
/**
* 所属区域城市名
*/
private String cityName;
/**
* 从业人员证照/荣誉列 FK ag_md_certificate.id
*/
private String certList;
/**
* 从业人员自我简介
*/
private String bioIntro;
/**
* 从业人员微信号
*/
private String wechatId;
/**
* 从业人员QQ号
*/
private String qqId;
/**
* 查询是否显示 0=No=不显示 1=Yes=显示
*/
private Integer isProfileShow;
/**
* 姓名是否显示 0=No=不显示 1=Yes=显示
*/
private Integer isNameShow;
/**
* 电话是否显示 0=No=不显示 1=Yes=显示
*/
private Integer isMobileShow;
/**
* 教育程度
*/
private String educationLevel;
/**
* FK ag_acl_practitioner.id 辅导人
*/
private Long mentorId;
/**
* FK ag_acl_practitioner.id 介绍人
*/
private Long introducerId;
/**
* 1=Male, 2=Female
*/
private Integer gender;
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
* @author
*/
@Data
public class AclPractitionerPotential implements Serializable {
/**
* serial id
*/
private Long id;
/**
* 姓名
*/
private String name;
/**
* 年龄
*/
private Long age;
/**
* 1=Male, 2=Female
*/
private Integer gender;
/**
* 从业人员电话
*/
private String mobileNo;
/**
* 从业人员微信号
*/
private String wechatId;
/**
* 从业人员QQ号
*/
private String qqId;
/**
* 其他联系方式
*/
private String othersContacts;
/**
* 教育程度
*/
private String educationLevel;
/**
* 介绍人
*/
private String introducer;
/**
* 标签
*/
private String tag;
/**
* 备注
*/
private String remark;
/**
* FK ag_drop_master.id 来源
*/
private Long resourceDropMasterId;
/**
* 简历附件
*/
private String ossPathResume;
/**
* FK ag_acl_practitioner.id 指派团队长
*/
private String practitionerAssignedIds;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 分析建置时间
*/
private Date createdAt;
/**
* 建置者 FK ag_acl_user.id
*/
private Long createdBy;
/**
* 更新时间
*/
private Date updatedAt;
/**
* 更新者 FK ag_acl_user.id
*/
private Long updatedBy;
private static final long serialVersionUID = 1L;
private Integer creatorType;
private Integer updatorType;
private Long customerId;
}
\ 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_assigned_track
* @author
*/
@Data
public class AclPractitionerPotentialAssignedTrack implements Serializable {
/**
* serial id
*/
private Long id;
/**
* FK ag_mkt_practitioner_potential.id 线索指派表
*/
private Long practitionerPotentialId;
/**
* FK ag_acl_practitioner.id 指派团队长id
*/
private Long practitionerAssignedId;
/**
* FK ag_md_drop_options.id 团队长增员状态
*/
private Long trackStatusId;
/**
* 潜在经纪人增员(团队长)类似回访记录
*/
private String notice;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 分析建置时间
*/
private Date createdAt;
/**
* 建置者 FK ag_acl_user.id
*/
private Long createdBy;
/**
* 更新时间
*/
private Date updatedAt;
/**
* 更新者 FK ag_acl_user.id
*/
private Long updatedBy;
private Integer creatorType;
private Integer updatorType;
private Integer isLasted;
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_subordinate_system
* @author
*/
@Data
public class AclPractitionerSubordinateSystem implements Serializable {
/**
* serial id
*/
private Long id;
/**
* FK ag_acl_insurer.id
*/
private Long insurerId;
/**
* FK ag_acl_insurer.id
*/
private Long insurerBranchId;
/**
* FK ag_acl_insurer_branch_dept.id 所属部门id
*/
private Long deptId;
/**
* 编码
*/
private String subordinateSystemCode;
/**
* dept name
*/
private String name;
/**
* dept english name
*/
private String nameEn;
/**
* FK ag_acl_practitioner.id,体系主管
*/
private Long ownerPractitionerId;
/**
* 联系人
*/
private String contactName;
/**
* 联系电话
*/
private String contactNo;
/**
* memo or tips
*/
private String remark;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
private Date createdAt;
/**
* FK ag_acl_user.id
*/
private Long createdBy;
private Date updatedAt;
/**
* FK ag_acl_user.id
*/
private Long updatedBy;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.entity.practitioner;
package com.yd.dal.entity.customer.practitioner;
import java.io.Serializable;
import java.util.Date;
......
package com.yd.dal.entity.practitioner;
package com.yd.dal.entity.customer.practitioner;
public class PractitionerBasicInfo {
private Long customerId;
......
package com.yd.dal.entity.practitioner;
package com.yd.dal.entity.customer.practitioner;
public class PractitionerInfo {
private Long customerId;
......
package com.yd.dal.entity.practitioner;
package com.yd.dal.entity.customer.practitioner;
public class PractitionerRankInfo {
private Long customerId;
......
package com.yd.dal.entity.practitioner;
package com.yd.dal.entity.customer.practitioner;
public class PractitionerSubordinateInfo {
private Long subordinateId;
......
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclCustomer;
import java.util.List;
public interface AclCustomerMapper {
int deleteByPrimaryKey(Long id);
int insert(AclCustomer record);
int insertSelective(AclCustomer record);
AclCustomer selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclCustomer record);
int updateByPrimaryKey(AclCustomer record);
List<AclCustomer> findByLogin(String mobileNo);
}
\ No newline at end of file
package com.yd.dal.mapper.practitioner;
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.practitioner.PractitionerInfo;
import com.yd.dal.entity.practitioner.PractitionerRankInfo;
import com.yd.dal.entity.customer.AclPractitioner;
import com.yd.dal.entity.customer.practitioner.AclPractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerRankInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface PractitionerMapper {
public interface AclPractitionerMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitioner record);
int insertSelective(AclPractitioner record);
AclPractitionerInfo selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerInfo record);
int updateByPrimaryKey(AclPractitioner record);
PractitionerBasicInfo getPractitionerInfoByMobileNoForOffline(String mobileNo);
List<PractitionerRankInfo> getPractitionerRankInfoForOffline(@Param("time") Integer time);
......@@ -19,4 +33,6 @@ public interface PractitionerMapper {
List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(@Param("mobileSpecials") List<String> mobileSpecials, @Param("time")Integer time);
PractitionerInfo findPractitionerInfoByLogin(@Param("mobileNo")String mobileNo);
AclPractitioner findByCustomerIdIsActive(@Param("customerId") Long customerId, @Param("isActive")int isActive);
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AclPractitionerPotentialAssignedTrackMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitionerPotentialAssignedTrack record);
int insertSelective(AclPractitionerPotentialAssignedTrack record);
AclPractitionerPotentialAssignedTrack selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerPotentialAssignedTrack record);
int updateByPrimaryKey(AclPractitionerPotentialAssignedTrack record);
void insertList(@Param("potentialAssignedTrackList") List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList);
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerPotential;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AclPractitionerPotentialMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitionerPotential record);
int insertSelective(AclPractitionerPotential record);
AclPractitionerPotential selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerPotential record);
int updateByPrimaryKey(AclPractitionerPotential record);
List<AclPractitionerPotential> findByMobileNo(@Param("mobileNo") String mobileNo, @Param("isActive") Integer isActive);
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerSubordinateSystem;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
public interface AclPractitionerSubordinateSystemMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitionerSubordinateSystem record);
int insertSelective(AclPractitionerSubordinateSystem record);
AclPractitionerSubordinateSystem selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerSubordinateSystem record);
int updateByPrimaryKey(AclPractitionerSubordinateSystem record);
PractitionerSubordinateInfo findSubordinateInfo(Long subordinateId);
}
\ No newline at end of file
package com.yd.dal.mapper.practitioner;
import com.yd.dal.entity.practitioner.AclPractitionerInfo;
public interface AclPractitionerMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitionerInfo record);
int insertSelective(AclPractitionerInfo record);
AclPractitionerInfo selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerInfo record);
int updateByPrimaryKey(AclPractitionerInfo record);
}
\ No newline at end of file
package com.yd.dal.mapper.practitioner;
import com.yd.dal.entity.practitioner.PractitionerSubordinateInfo;
import org.apache.ibatis.annotations.Param;
public interface PractitionerSubordinateMapper {
PractitionerSubordinateInfo findSubordinateInfo(@Param("subordinateId") Long subordinateId);
}
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclCustomer;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclCustomerDALService")
public interface AclCustomerDALService {
/**
* 通过登录号进行查找
* @param mobileNo 手机号
* @return
*/
List<AclCustomer> findByLogin(String mobileNo);
/**
* 保存数据
* @param aclCustomer
* @return
*/
void save(AclCustomer aclCustomer);
}
package com.yd.dal.service.practitioner;
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclFileUpload;
import com.yd.dal.entity.practitioner.AclPractitionerInfo;
import com.yd.dal.entity.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.practitioner.PractitionerInfo;
import com.yd.dal.entity.practitioner.PractitionerRankInfo;
import com.yd.dal.entity.customer.AclPractitioner;
import com.yd.dal.entity.customer.practitioner.AclPractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerRankInfo;
import org.springframework.stereotype.Service;
import java.util.List;
public interface PractitionerDALService {
@Service("aclPractitionerDALService")
public interface AclPractitionerDALService {
/**
* 通过customerId 和is_active 获取用户
* @param customerId
* @param i
* @return
*/
AclPractitioner findByCustomerIdIsActive(Long customerId, int i);
/**
* 线下--通过手机号码获取经纪人的基础信息
* @param mobileNo
......@@ -62,5 +72,4 @@ public interface PractitionerDALService {
* @param practitioner
*/
void updatePractitioner(AclPractitionerInfo practitioner);
}
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialAssignedTrackDALService")
public interface AclPractitionerPotentialAssignedTrackDALService {
void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList);
}
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPractitionerPotential;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialDALService")
public interface AclPractitionerPotentialDALService {
/**
* 根据手机号查询
* @param mobileNo
* @return
*/
List<AclPractitionerPotential> findByMobileNo(String mobileNo,Integer isActive);
/**
* 保存
* @param practitionerPotential
* @return
*/
int save(AclPractitionerPotential practitionerPotential);
}
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
import org.springframework.stereotype.Service;
@Service("aclPractitionerSubordinateSystemDALService")
public interface AclPractitionerSubordinateSystemDALService {
PractitionerSubordinateInfo findSubordinateInfo(Long subordinateId);
}
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclCustomer;
import com.yd.dal.mapper.customer.AclCustomerMapper;
import com.yd.dal.service.customer.AclCustomerDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclCustomerDalService")
public class AclCustomerDALServiceImpl implements AclCustomerDALService {
@Autowired
private AclCustomerMapper aclCustomerMapper;
@Override
public List<AclCustomer> findByLogin(String mobileNo) {
return aclCustomerMapper.findByLogin(mobileNo);
}
@Override
public void save(AclCustomer aclCustomer) {
aclCustomerMapper.insert(aclCustomer);
}
}
package com.yd.dal.service.practitioner.impl;
package com.yd.dal.service.customer.impl;
import com.google.common.base.Strings;
import com.yd.dal.entity.practitioner.AclPractitionerInfo;
import com.yd.dal.entity.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.practitioner.PractitionerInfo;
import com.yd.dal.entity.practitioner.PractitionerRankInfo;
import com.yd.dal.mapper.practitioner.AclPractitionerMapper;
import com.yd.dal.mapper.practitioner.PractitionerMapper;
import com.yd.dal.service.customer.impl.CustomerDALServiceImpl;
import com.yd.dal.service.practitioner.PractitionerDALService;
import com.yd.dal.entity.customer.AclPractitioner;
import com.yd.dal.entity.customer.practitioner.AclPractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerRankInfo;
import com.yd.dal.mapper.customer.AclPractitionerMapper;
import com.yd.dal.service.customer.AclPractitionerDALService;
import com.yd.util.intercept.annotation.TargetDataSource;
import com.yd.util.intercept.commons.DataSourceKey;
import org.apache.log4j.Logger;
......@@ -16,19 +15,21 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("practitionerServiceDAL")
public class PractitionerDALServiceImpl implements PractitionerDALService {
private static final Logger LOG = Logger.getLogger(CustomerDALServiceImpl.class);
@Resource
private PractitionerMapper practitionerMapper;
@Service("aclPractitionerDALService")
public class AclPractitionerDALServiceImpl implements AclPractitionerDALService {
private static final Logger LOG = Logger.getLogger(AclPractitionerDALServiceImpl.class);
@Resource
private AclPractitionerMapper aclPractitionerMapper;
@Override
public AclPractitioner findByCustomerIdIsActive(Long customerId, int isActive) {
return aclPractitionerMapper.findByCustomerIdIsActive(customerId,isActive);
}
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_EGOLDEN)
public PractitionerBasicInfo getPractitionerBasicInfoForOffline(String mobileNo) {
if(!Strings.isNullOrEmpty(mobileNo)){
return practitionerMapper.getPractitionerInfoByMobileNoForOffline(mobileNo);
return aclPractitionerMapper.getPractitionerInfoByMobileNoForOffline(mobileNo);
}else{
LOG.error("mobileNo is null!");
}
......@@ -38,7 +39,7 @@ public class PractitionerDALServiceImpl implements PractitionerDALService {
@Override
public PractitionerBasicInfo getPractitionerBasicInfoForOnline(String mobileNo) {
if(!Strings.isNullOrEmpty(mobileNo)){
return practitionerMapper.getPractitionerInfoByMobileNoForOnline(mobileNo);
return aclPractitionerMapper.getPractitionerInfoByMobileNoForOnline(mobileNo);
}else{
LOG.error("mobileNo is null!");
}
......@@ -48,22 +49,22 @@ public class PractitionerDALServiceImpl implements PractitionerDALService {
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_EGOLDEN)
public List<PractitionerRankInfo> getPractitionerRankInfoForOffline(Integer time) {
return practitionerMapper.getPractitionerRankInfoForOffline(time);
return aclPractitionerMapper.getPractitionerRankInfoForOffline(time);
}
@Override
public List<PractitionerRankInfo> getPractitionerRankInfoForOnline(Integer time,Long practitionerTypeId) {
return practitionerMapper.getPractitionerRankInfoForOnline(time,practitionerTypeId);
return aclPractitionerMapper.getPractitionerRankInfoForOnline(time,practitionerTypeId);
}
@Override
public List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(List<String> mobileSpecials,Integer time) {
return practitionerMapper.getPractitionerRankInfoForSpecials(mobileSpecials,time);
return aclPractitionerMapper.getPractitionerRankInfoForSpecials(mobileSpecials,time);
}
@Override
public PractitionerInfo findPractitionerInfoByLogin(String mobileNo) {
return practitionerMapper.findPractitionerInfoByLogin(mobileNo);
return aclPractitionerMapper.findPractitionerInfoByLogin(mobileNo);
}
@Override
......
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack;
import com.yd.dal.mapper.customer.AclPractitionerPotentialAssignedTrackMapper;
import com.yd.dal.service.customer.AclPractitionerPotentialAssignedTrackDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialAssignedTrackDALService")
public class AclPractitionerPotentialAssignedTrackDALServiceImpl implements AclPractitionerPotentialAssignedTrackDALService {
@Autowired
private AclPractitionerPotentialAssignedTrackMapper aclPractitionerPotentialAssignedTrackMapper;
@Override
public void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList) {
aclPractitionerPotentialAssignedTrackMapper.insertList(potentialAssignedTrackList);
}
}
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclPractitionerPotential;
import com.yd.dal.mapper.customer.AclPractitionerPotentialMapper;
import com.yd.dal.service.customer.AclPractitionerPotentialDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialDALService")
public class AclPractitionerPotentialDALServiceImpl implements AclPractitionerPotentialDALService {
@Autowired
private AclPractitionerPotentialMapper aclPractitionerPotentialMapper;
@Override
public List<AclPractitionerPotential> findByMobileNo(String mobileNo, Integer isActive) {
return aclPractitionerPotentialMapper.findByMobileNo(mobileNo,isActive);
}
@Override
public int save(AclPractitionerPotential practitionerPotential) {
return aclPractitionerPotentialMapper.insert(practitionerPotential);
}
}
package com.yd.dal.service.practitioner.impl;
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.practitioner.PractitionerSubordinateInfo;
import com.yd.dal.mapper.practitioner.PractitionerSubordinateMapper;
import com.yd.dal.service.practitioner.PractitionerSubordinateDALService;
import org.springframework.beans.factory.annotation.Autowired;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
import com.yd.dal.mapper.customer.AclPractitionerSubordinateSystemMapper;
import com.yd.dal.service.customer.AclPractitionerSubordinateSystemDALService;
import org.springframework.stereotype.Service;
@Service("practitionerSubordinateDALService")
public class PractitionerSubordinateDALServiceImpl implements PractitionerSubordinateDALService {
import javax.annotation.Resource;
@Autowired
private PractitionerSubordinateMapper practitionerSubordinateMapper;
@Service("aclPractitionerSubordinateSystemDALService")
public class AclPractitionerSubordinateSystemDALServiceImpl implements AclPractitionerSubordinateSystemDALService {
@Resource
private AclPractitionerSubordinateSystemMapper aclPractitionerSubordinateSystemMapper;
/**
* 根据体系ID获取体系相关信息
* @param subordinateId 体系ID
......@@ -19,7 +20,7 @@ public class PractitionerSubordinateDALServiceImpl implements PractitionerSubord
public PractitionerSubordinateInfo findSubordinateInfo(Long subordinateId) {
PractitionerSubordinateInfo subordinateInfo = null;
if(subordinateId != null){
subordinateInfo = practitionerSubordinateMapper.findSubordinateInfo(subordinateId);
subordinateInfo = aclPractitionerSubordinateSystemMapper.findSubordinateInfo(subordinateId);
}
return subordinateInfo;
}
......
package com.yd.dal.service.practitioner;
import com.yd.dal.entity.practitioner.PractitionerSubordinateInfo;
import org.springframework.stereotype.Service;
@Service("practitionerSubordinateDALService")
public interface PractitionerSubordinateDALService {
PractitionerSubordinateInfo findSubordinateInfo(Long subordinateId);
}
......@@ -3,7 +3,11 @@
600000=参数检验成功!
610001=入参中[{0}]不能为空!
610002=入参中[{0}]不能同时为空!
##用户信息校验
630001=用户的手机号码[{0}]格式不正确!
630002=手机号[{0}]已被注册,请勿重复注册!
######################用户提示信息########################
800000=执行成功!
##系统提示信息
810001=token无效或者错误!
......@@ -17,5 +21,7 @@
830007=上传头像失败,请重新上传!
830008=上传生活照失败,请重新上传!
830009=上传微信二维码失败,请重新上传!
830010=该用户已经注册为银盾经纪人
830011=该增员已存在!
900003=保险公司响应报文为空!
\ 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.AclPractitionerPotentialAssignedTrackMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="practitioner_potential_id" jdbcType="BIGINT" property="practitionerPotentialId" />
<result column="practitioner_assigned_id" jdbcType="BIGINT" property="practitionerAssignedId" />
<result column="track_status_id" jdbcType="BIGINT" property="trackStatusId" />
<result column="notice" jdbcType="VARCHAR" property="notice" />
<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" />
<result column="updator_type" jdbcType="INTEGER" property="updatorType" />
<result column="creator_type" jdbcType="INTEGER" property="creatorType" />
<result column="is_lasted" jdbcType="INTEGER" property="isLasted" />
</resultMap>
<sql id="Base_Column_List">
id, practitioner_potential_id, practitioner_assigned_id, track_status_id, notice,
is_active, created_at, created_by, updated_at, updated_by, creator_type, updator_type,is_lasted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigned_track
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_potential_assigned_track
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigned_track (practitioner_potential_id, practitioner_assigned_id,
track_status_id, notice, is_active,
created_at, created_by, updated_at,
updated_by, updator_type,creator_type,is_lasted )
values (#{practitionerPotentialId,jdbcType=BIGINT}, #{practitionerAssignedId,jdbcType=BIGINT},
#{trackStatusId,jdbcType=BIGINT}, #{notice,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT},#{updatorType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{isLasted,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigned_track
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="practitionerPotentialId != null">
practitioner_potential_id,
</if>
<if test="practitionerAssignedId != null">
practitioner_assigned_id,
</if>
<if test="trackStatusId != null">
track_status_id,
</if>
<if test="notice != null">
notice,
</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="practitionerPotentialId != null">
#{practitionerPotentialId,jdbcType=BIGINT},
</if>
<if test="practitionerAssignedId != null">
#{practitionerAssignedId,jdbcType=BIGINT},
</if>
<if test="trackStatusId != null">
#{trackStatusId,jdbcType=BIGINT},
</if>
<if test="notice != null">
#{notice,jdbcType=VARCHAR},
</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>
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" >
insert into ag_acl_practitioner_potential_assigned_track(practitioner_potential_id, practitioner_assigned_id,
track_status_id, notice, is_active,
created_at, created_by, updated_at,
updated_by, updator_type,creator_type,is_lasted )
values
<foreach collection="potentialAssignedTrackList" item="item" index="index" separator=",">
(
#{item.practitionerPotentialId},
#{item.practitionerAssignedId},
#{item.trackStatusId},
#{item.notice},
#{item.isActive},
#{item.createdAt},
#{item.createdBy},
#{item.updatedAt},
#{item.updatedBy},
#{item.updatorType},
#{item.creatorType},
#{item.isLasted}
)
</foreach>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack">
update ag_acl_practitioner_potential_assigned_track
<set>
<if test="practitionerPotentialId != null">
practitioner_potential_id = #{practitionerPotentialId,jdbcType=BIGINT},
</if>
<if test="practitionerAssignedId != null">
practitioner_assigned_id = #{practitionerAssignedId,jdbcType=BIGINT},
</if>
<if test="trackStatusId != null">
track_status_id = #{trackStatusId,jdbcType=BIGINT},
</if>
<if test="notice != null">
notice = #{notice,jdbcType=VARCHAR},
</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.AclPractitionerPotentialAssignedTrack">
update ag_acl_practitioner_potential_assigned_track
set practitioner_potential_id = #{practitionerPotentialId,jdbcType=BIGINT},
practitioner_assigned_id = #{practitionerAssignedId,jdbcType=BIGINT},
track_status_id = #{trackStatusId,jdbcType=BIGINT},
notice = #{notice,jdbcType=VARCHAR},
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>
</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.practitioner.PractitionerMapper">
<resultMap id="base_result_map_practitioner_info" type="com.yd.dal.entity.practitioner.PractitionerBasicInfo">
<result column="customerId" property="customerId"/>
<result column="practitionerIdForOnline" property="practitionerIdForOnline"/>
<result column="practitionerId" property="practitionerId"/>
<result column="name" property="name"/>
<result column="titleCode" property="titleCode" />
<!-- <result column="mobile_no" property="titleCode" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>-->
<result column="titleName" property="titleName"/>
<result column="gender" property="gender"/>
</resultMap>
<select id="getPractitionerInfoByMobileNoForOffline" resultMap="base_result_map_practitioner_info">
SELECT
p.SAL_MST_ID as practitionerId,
p.SAL_MST_NAME as name,
p.SAL_MST_GENDER as gender,
md.DRP_TITLE_LEVEL as titleCode,
md.DRP_TITLE_NAME as titleName
FROM sal001 p left join DRP003 md on md.DRP_TITLE_CODE = p.FK_DRP_TITLE_CODE
where p.SAL_MST_MOBILE = #{mobileNo}
</select>
<select id="getPractitionerInfoByMobileNoForOnline" resultMap="base_result_map_practitioner_info">
select
p.customer_id as customerId,
p.id as practitionerIdForOnline,
p.name as name,
o.drop_option_code as titleCode,
o.drop_option_name as titleName,
p.gender as gender
from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
inner join ag_md_drop_options o on s.practitioner_level = o.id
where c.login = #{mobileNo};
</select>
<resultMap id="practitioner_rank_map" type="com.yd.dal.entity.practitioner.PractitionerRankInfo">
<result column="customerId" property="customerId"/>
<result column="practitionerIdForOnLine" property="practitionerIdForOnLine"/>
<result column="practitionerId" property="practitionerId"/>
<result column="name" property="name"/>
<result column="titleCode" property="titleCode" />
<result column="titleName" property="titleName"/>
<result column="count" property="count"/>
<result column="fyp" property="fyp"/>
<result column="fyc" property="fyc"/>
</resultMap>
<select id="getPractitionerRankInfoForOffline" resultMap="practitioner_rank_map" resultType="java.lang.Integer">
SELECT
p.SAL_MST_ID as practitionerId ,
p.SAL_MST_NAME as name ,-- 姓名
md.DRP_TITLE_LEVEL as titleCode,-- 职称code
md.DRP_TITLE_NAME as titleName,-- 职称名称
spc.SPC_DIV_NAME as spcDivName,-- 体系id
count(m.MON025_002) as count,-- 保单id
sum(m.MON025_401) as fyp,-- 保费
sum(m.MON025_405) as fyc -- 应发佣金
FROM MON025 m INNER JOIN sal001 p on m.MON025_007 = p.SAL_MST_ID -- 业务员id
left join DRP003 md on p.FK_DRP_TITLE_CODE = md.DRP_TITLE_CODE
inner JOIN ins001 policy on m.MON025_002 = policy.INS_MST_ID -- 保单id
inner join spc004 spc on m.MON025_006 = spc.SPC_DIV_ID -- 体系
WHERE m.MON025_109 IN (1,2,3) AND m.MON025_303 = 1
<choose>
<when test="time == 1">
and DATE_FORMAT(policy.INS_MST_ACCEPT_DATE, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<otherwise>
and YEAR(policy.INS_MST_ACCEPT_DATE) = YEAR(now())
</otherwise>
</choose>
group by p.SAL_MST_ID;
</select>
<select id="getPractitionerRankInfoForOnline" resultMap="practitioner_rank_map">
SELECT
p.customer_id as customerId,
p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名
ss.name as spcDivName,-- 体系id
count(f.id) as count,-- 保单id
sum(f.order_price) as fyp,-- 保费
sum(f.referral_amount) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3 and o.order_price > 0
<if test="practitionerTypeId != null">
and s.practitioner_type_id = #{practitionerTypeId}
</if>
<choose>
<when test="time == 1">
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
group by p.id;
</select>
<select id="getPractitionerRankInfoForSpecials" resultMap="practitioner_rank_map" resultType="java.util.List">
SELECT
p.customer_id as customerId,
p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名
ss.name as spcDivName,-- 体系id
count(f.id) as count,-- 保单id
sum(f.order_price) as fyp,-- 保费
sum(f.referral_amount) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_customer c on p.customer_id = c.id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3 and o.order_price > 0
and c.login in
<foreach collection="mobileSpecials" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<choose>
<when test="time == 1">
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
group by p.id;
</select>
<resultMap id="practitioner_info_map" type="com.yd.dal.entity.practitioner.PractitionerInfo">
<result column="customerId" property="customerId"/>
<result column="practitionerId" property="practitionerId"/>
<result column="name" property="name"/>
<result column="gender" property="gender"/>
<result column="practitionerType" property="practitionerType" />
<result column="levelCode" property="levelCode" />
<result column="levelName" property="levelName"/>
<result column="insurerBranchName" property="insurerBranchName"/>
<result column="subordinateId" property="subordinateId"/>
<result column="weChatId" property="weChatId"/>
<result column="qqId" property="qqId"/>
<result column="practitionerRegNo" property="practitionerRegNo"/>
</resultMap>
<select id="findPractitionerInfoByLogin" resultMap="practitioner_info_map">
select
p.customer_id as customerId,
p.id as practitionerId,
p.name as name,
p.gender as gender,
s.practitioner_type_id as practitionerType,
o.drop_option_code as levelCode,
o.drop_option_name as levelName,
b.branch_name as insurerBranchName,
p.subordinate_system_id as subordinateId,
p.wechat_id as weChatId,
p.qq_id as qqId,
p.practitioner_reg_no as practitionerRegNo
from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
inner join ag_md_drop_options o on s.practitioner_level = o.id
where c.login = #{mobileNo};
</select>
</mapper>
<?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.practitioner.PractitionerSubordinateMapper">
<resultMap id="practitioner_subordinate_map" type="com.yd.dal.entity.practitioner.PractitionerSubordinateInfo">
<result column="subordinateId" property="subordinateId"/>
<result column="subordinateName" property="subordinateName"/>
<result column="subordinateCode" property="subordinateCode"/>
<result column="ownerId" property="ownerId"/>
<result column="subordinateLeader" property="subordinateLeader"/>
<result column="contactName" property="contactName"/>
<result column="contactNo" property="contactNo"/>
<result column="remark" property="remark"/>
</resultMap>
<select id="findSubordinateInfo" resultMap="practitioner_subordinate_map">
SELECT
s.id as subordinateId,
s.name as subordinateName,
s.subordinate_system_code as subordinateCode,
s.owner_practitioner_id as ownerId,
p.name as subordinateLeader,
s.contact_name as contactName,
s.contact_no as contactNo,
s.remark as remark
FROM ag_acl_practitioner_subordinate_system s left join ag_acl_practitioner p on s.owner_practitioner_id = p.id
where s.is_active = 1
and s.id = #{subordinateId}
</select>
</mapper>
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