Commit 994b3e88 by jianan

Merge branch 'dev_20221018' into dev

# Conflicts:
#	yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
parents 760364d9 6005e8c3
...@@ -892,7 +892,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -892,7 +892,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
} }
String subject = "回退财富"; String subject = "回退财富";
sendService.sendEmailOrSMS("email", email, "3", messageText, null, subject, ccAddresses, "回复财富", 99, null); sendService.sendEmailOrSMS("email", email, "3", messageText, null, subject, ccAddresses, "回复财富", 99, null, null);
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return resp; return resp;
} }
......
...@@ -688,7 +688,7 @@ public class AgmsHiringServiceImpl implements AgmsHiringService { ...@@ -688,7 +688,7 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
} else { } else {
content.put("approveName", approveName + ",退回原因<" + rejectNote + ">" + ",请至“赢家平台>我的团队-报聘审批”进行查看审批,谢谢!" + jumpUrl); content.put("approveName", approveName + ",退回原因<" + rejectNote + ">" + ",请至“赢家平台>我的团队-报聘审批”进行查看审批,谢谢!" + jumpUrl);
} }
sendService.sendEmailOrSMS("sms", mobileNo, "0", content.toJSONString(), templateCode, null, null, "电子报聘审批退回", 99, basicInfoId); sendService.sendEmailOrSMS("sms", mobileNo, "0", content.toJSONString(), templateCode, null, null, "电子报聘审批退回", 99, basicInfoId, null);
} else { } else {
logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》电子报聘聘退回发送短信电话号码不存在"); logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》电子报聘聘退回发送短信电话号码不存在");
logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》" + name + ": " + mobileNo); logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》" + name + ": " + mobileNo);
...@@ -923,6 +923,6 @@ public class AgmsHiringServiceImpl implements AgmsHiringService { ...@@ -923,6 +923,6 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
messageText.append("的电子报聘流程线上审批已经通过,请尽快帮助完成该报聘人的经纪人执业登记,并在AGMS 里更新并生成电子合同。谢谢!"); messageText.append("的电子报聘流程线上审批已经通过,请尽快帮助完成该报聘人的经纪人执业登记,并在AGMS 里更新并生成电子合同。谢谢!");
String subject = "电子报聘审批通过"; String subject = "电子报聘审批通过";
sendService.sendEmailOrSMS("email", address, "3", messageText.toString(), null, subject, ccAddresses, "电子报聘审批通过", 99, null); sendService.sendEmailOrSMS("email", address, "3", messageText.toString(), null, subject, ccAddresses, "电子报聘审批通过", 99, null, null);
} }
} }
...@@ -456,7 +456,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService { ...@@ -456,7 +456,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
messageText.append("来佣比对已退保,请知悉"); messageText.append("来佣比对已退保,请知悉");
String subject = "来佣比对已退保"; String subject = "来佣比对已退保";
sendService.sendEmailOrSMS("email", email, "3", messageText.toString(), null, subject, ccAddresses, "来佣比对已退保", 99, null); sendService.sendEmailOrSMS("email", email, "3", messageText.toString(), null, subject, ccAddresses, "来佣比对已退保", 99, null, null);
} }
private void updateFortune(Long commissionId, String status, String loginId, String checkBatch) { private void updateFortune(Long commissionId, String status, String loginId, String checkBatch) {
......
...@@ -863,7 +863,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -863,7 +863,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
templateCode = smsParam.get(mobileNo).get(0); templateCode = smsParam.get(mobileNo).get(0);
content = smsParam.get(mobileNo).get(1); content = smsParam.get(mobileNo).get(1);
sendService.sendEmailOrSMS("sms", mobileNo, "0", content, templateCode, null, null, "电子报聘合同生成提醒", 99, hiringBasicInfoId); sendService.sendEmailOrSMS("sms", mobileNo, "0", content, templateCode, null, null, "电子报聘合同生成提醒", 99, hiringBasicInfoId, null);
} }
} }
} }
......
package com.yd.api.practitioner.service.impl; package com.yd.api.practitioner.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.itextpdf.text.*; import com.itextpdf.text.*;
...@@ -9,6 +11,7 @@ import com.libs.pdf.PDFTemplate; ...@@ -9,6 +11,7 @@ import com.libs.pdf.PDFTemplate;
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.service.ScheduleTrackService;
import com.yd.api.practitioner.vo.PractitionerIdRequestVO; import com.yd.api.practitioner.vo.PractitionerIdRequestVO;
import com.yd.api.practitioner.vo.QueryCanSeeResponseVO; import com.yd.api.practitioner.vo.QueryCanSeeResponseVO;
import com.yd.api.practitioner.vo.businessCard.Certificate; import com.yd.api.practitioner.vo.businessCard.Certificate;
...@@ -32,6 +35,8 @@ import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO; ...@@ -32,6 +35,8 @@ import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO; import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO;
import com.yd.api.practitioner.vo.recruit.*; import com.yd.api.practitioner.vo.recruit.*;
import com.yd.api.practitioner.vo.salestarget.*; import com.yd.api.practitioner.vo.salestarget.*;
import com.yd.api.practitioner.vo.sechedule.AddScheduleTrackRequestVO;
import com.yd.api.practitioner.vo.sechedule.AddScheduleTrackResponseVO;
import com.yd.api.practitioner.vo.setting.*; import com.yd.api.practitioner.vo.setting.*;
import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberInfo; import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberInfo;
import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryRequestVO; import com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryRequestVO;
...@@ -62,9 +67,11 @@ import com.yd.dal.service.marketing.*; ...@@ -62,9 +67,11 @@ import com.yd.dal.service.marketing.*;
import com.yd.dal.service.meta.*; import com.yd.dal.service.meta.*;
import com.yd.dal.service.order.PoOrderDALService; import com.yd.dal.service.order.PoOrderDALService;
import com.yd.dal.service.survey.SurveyCustomerAnswersDALService; import com.yd.dal.service.survey.SurveyCustomerAnswersDALService;
import com.yd.dal.service.tencent.TenInterfRecordDALService;
import com.yd.dal.service.user.AclUserDALService; import com.yd.dal.service.user.AclUserDALService;
import com.yd.rmi.ali.mail.service.MailService; import com.yd.rmi.ali.mail.service.MailService;
import com.yd.rmi.ali.oss.service.OssService; import com.yd.rmi.ali.oss.service.OssService;
import com.yd.rmi.ali.send.service.SendService;
import com.yd.rmi.cache.SystemConfigService; import com.yd.rmi.cache.SystemConfigService;
import com.yd.rmi.n22.salary.pojo.Achieve; import com.yd.rmi.n22.salary.pojo.Achieve;
import com.yd.rmi.n22.salary.pojo.SearchStaffAchievementRequestBody; import com.yd.rmi.n22.salary.pojo.SearchStaffAchievementRequestBody;
...@@ -77,13 +84,21 @@ import com.yd.rmi.n22.staff.pojo.Staff; ...@@ -77,13 +84,21 @@ import com.yd.rmi.n22.staff.pojo.Staff;
import com.yd.rmi.n22.staff.service.N22StaffService; import com.yd.rmi.n22.staff.service.N22StaffService;
import com.yd.rmi.tencent.wechat.service.WechatService; import com.yd.rmi.tencent.wechat.service.WechatService;
import com.yd.rmi.tencent.wechat.vo.WeChatInfoByENV; import com.yd.rmi.tencent.wechat.vo.WeChatInfoByENV;
import com.yd.rmi.tencent.wechatinterf.pojo.accesstoken.AccessTokenRequest;
import com.yd.rmi.tencent.wechatinterf.pojo.templetemessage.DataDetailInfo;
import com.yd.rmi.tencent.wechatinterf.pojo.templetemessage.MiniProgramSfpInfo;
import com.yd.rmi.tencent.wechatinterf.pojo.templetemessage.SendTemplateSfpRequest;
import com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketRequest; import com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketRequest;
import com.yd.rmi.tencent.wechatinterf.pojo.token.TokenRequest; import com.yd.rmi.tencent.wechatinterf.pojo.token.TokenRequest;
import com.yd.rmi.tencent.wechatinterf.service.WechatInterfService;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
import com.yd.util.HttpUtil; import com.yd.util.HttpUtil;
import com.yd.util.JsonUtil;
import com.yd.util.PDFConfiguration; import com.yd.util.PDFConfiguration;
import com.yd.util.SpringContextUtil;
import com.yd.util.config.ZHBErrorConfig; import com.yd.util.config.ZHBErrorConfig;
import com.yd.util.deshandler.DESTypeHandler; import com.yd.util.deshandler.DESTypeHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate; import org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -114,6 +129,7 @@ import java.util.stream.Collectors; ...@@ -114,6 +129,7 @@ import java.util.stream.Collectors;
import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toList;
@Service("practitionerService") @Service("practitionerService")
@Slf4j
public class PractitionerServiceImpl implements com.yd.api.practitioner.service.PractitionerService { public class PractitionerServiceImpl implements com.yd.api.practitioner.service.PractitionerService {
@Autowired @Autowired
...@@ -202,7 +218,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -202,7 +218,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private AgPoInformedMapper informedMapper; private AgPoInformedMapper informedMapper;
@Autowired @Autowired
private MktLeadsAssignedsMapper mktLeadsAssignedsMapper; private MktLeadsAssignedsMapper mktLeadsAssignedsMapper;
@Autowired
private ScheduleTrackService scheduleTrackService;
@Autowired
private WechatInterfService wechatInterfService;
@Autowired
private SendService sendService;
@Override @Override
public PractitionerLoginResponseVO practitionerLogin(PractitionerLoginRequestVO requestVO) { public PractitionerLoginResponseVO practitionerLogin(PractitionerLoginRequestVO requestVO) {
PractitionerLoginResponseVO responseVO = new PractitionerLoginResponseVO(); PractitionerLoginResponseVO responseVO = new PractitionerLoginResponseVO();
...@@ -877,6 +898,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -877,6 +898,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
List<OwnOpportunityInfo> ownOpportunityInfos = aclPractitionerDALService.ownOpportunityQuery(practitionerId); List<OwnOpportunityInfo> ownOpportunityInfos = aclPractitionerDALService.ownOpportunityQuery(practitionerId);
for (OwnOpportunityInfo info : ownOpportunityInfos) { for (OwnOpportunityInfo info : ownOpportunityInfos) {
info.setOrderId(opportunityDateMap.get(info.getOpportunityId())); info.setOrderId(opportunityDateMap.get(info.getOpportunityId()));
if(info.getMobileNo() != null && info.getMobileNo().length() >11){
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
info.setMobileNo(jpaCryptoConverter.decode(info.getMobileNo()));
}
} }
responseVO.setOwnOpportunityInfos(ownOpportunityInfos); responseVO.setOwnOpportunityInfos(ownOpportunityInfos);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
...@@ -971,7 +998,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -971,7 +998,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
info.setAge(customer.getAge()); info.setAge(customer.getAge());
info.setBirthDate(CommonUtil.dateParseString(customer.getBirthDate(),"yyyy-MM-dd")); info.setBirthDate(CommonUtil.dateParseString(customer.getBirthDate(),"yyyy-MM-dd"));
info.setGender(customer.getGender()); info.setGender(customer.getGender());
info.setMobileNo(customer.getMobileNo()); String mobileNo = customer.getMobileNo();
if (StringUtils.isNotBlank(mobileNo) && mobileNo.length() >11) {
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
mobileNo = jpaCryptoConverter.decode(mobileNo);
}
info.setMobileNo(mobileNo);
info.setWeChat(customer.getWechatNo()); info.setWeChat(customer.getWechatNo());
info.setOtherContacts(customer.getOtherContacts()); info.setOtherContacts(customer.getOtherContacts());
info.setZodiacTypeId(customer.getZodiacTypeId()); info.setZodiacTypeId(customer.getZodiacTypeId());
...@@ -984,8 +1016,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -984,8 +1016,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
MdDropOptions mdDropOption = mdDropOptionsDALService.findByDropOptionId(Long.valueOf(customer.getBloodTypeId())); MdDropOptions mdDropOption = mdDropOptionsDALService.findByDropOptionId(Long.valueOf(customer.getBloodTypeId()));
info.setBloodType(mdDropOption.getDropOptionName()); info.setBloodType(mdDropOption.getDropOptionName());
} }
String mktCampaign = customer.getMktCampaign(); // String mktCampaign = customer.getMktCampaign();
MktLeadsPool pool = mktLeadsPoolDALService.findByCustomerId(customerId); MktLeadsPool pool = null;
if(null != requestVO.getSfpMainId()){
pool = mktLeadsPoolDALService.findBySfpMainId(requestVO.getSfpMainId());
}else{
pool = mktLeadsPoolDALService.findByCustomerId(customerId);
}
if (pool != null) { if (pool != null) {
Integer sourceFrom = pool.getSourceFrom(); Integer sourceFrom = pool.getSourceFrom();
String campaign = pool.getMktCampaign(); String campaign = pool.getMktCampaign();
...@@ -996,6 +1033,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -996,6 +1033,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
MdMkCampaign mdMkCampaign = mdMkCampaignDALService.findByMktCampaignId(Long.valueOf(campaign)); MdMkCampaign mdMkCampaign = mdMkCampaignDALService.findByMktCampaignId(Long.valueOf(campaign));
info.setSourceChannel(mdMkCampaign.getName()); info.setSourceChannel(mdMkCampaign.getName());
} }
info.setSfpUserId(pool.getSfpUserId());
} }
info.setAddress(customer.getAddress()); info.setAddress(customer.getAddress());
...@@ -1141,10 +1179,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1141,10 +1179,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private List<OpportunityRecordInfo> getOpportunityRecords(OwnOpportunityDetailQueryRequestVO requestVO) { private List<OpportunityRecordInfo> getOpportunityRecords(OwnOpportunityDetailQueryRequestVO requestVO) {
Long practitionerId = requestVO.getPractitionerId(); Long practitionerId = requestVO.getPractitionerId();
Long customerId = requestVO.getOpportunityId(); Long customerId = requestVO.getOpportunityId();
Long sfpMainId = requestVO.getSfpMainId();
List<OpportunityRecordInfo> infos = new ArrayList<>(); List<OpportunityRecordInfo> infos = new ArrayList<>();
MktLeadsAssignedTrack mktLeadsAssignedTrack = new MktLeadsAssignedTrack(); MktLeadsAssignedTrack mktLeadsAssignedTrack = new MktLeadsAssignedTrack();
mktLeadsAssignedTrack.setPractitionerId(practitionerId); mktLeadsAssignedTrack.setPractitionerId(practitionerId);
mktLeadsAssignedTrack.setCustomerId(customerId); mktLeadsAssignedTrack.setCustomerId(customerId);
if(sfpMainId != null){
mktLeadsAssignedTrack.setSfpMainId(sfpMainId);
}
PageHelper.orderBy("track_time DESC , created_at DESC , updated_at DESC"); PageHelper.orderBy("track_time DESC , created_at DESC , updated_at DESC");
List<MktLeadsAssignedTrack> mktLeadsAssignedTracks = mktLeadsAssignedTrackDALService.findByMktLeadsAssignedTrack(mktLeadsAssignedTrack); List<MktLeadsAssignedTrack> mktLeadsAssignedTracks = mktLeadsAssignedTrackDALService.findByMktLeadsAssignedTrack(mktLeadsAssignedTrack);
List<MdDropOptions> dropOptionsList = mdDropOptionsDALService.findByDropMasterCode("bizchance_promotion_action"); List<MdDropOptions> dropOptionsList = mdDropOptionsDALService.findByDropMasterCode("bizchance_promotion_action");
...@@ -1534,6 +1577,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1534,6 +1577,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
@Override @Override
public OwnOpportunityBasicInformationSaveResponseVO ownOpportunityBasicInformationSave(OwnOpportunityBasicInformationSaveRequestVO requestVO) { public OwnOpportunityBasicInformationSaveResponseVO ownOpportunityBasicInformationSave(OwnOpportunityBasicInformationSaveRequestVO requestVO) {
OwnOpportunityBasicInformationSaveResponseVO resp = new OwnOpportunityBasicInformationSaveResponseVO(); OwnOpportunityBasicInformationSaveResponseVO resp = new OwnOpportunityBasicInformationSaveResponseVO();
if (CommonUtil.isNullOrBlank(requestVO.getMobileNo()) && CommonUtil.isNullOrBlank(requestVO.getWeChat())) {
CommonResult commonResult = new CommonResult(false, "手机号与微信号不能同时为空!");
resp.setCommonResult(commonResult);
return resp;
}
Long leadsAssignedId = requestVO.getLeadsAssignedId(); Long leadsAssignedId = requestVO.getLeadsAssignedId();
Long customerId = requestVO.getOpportunityId(); Long customerId = requestVO.getOpportunityId();
if (CommonUtil.isNullOrZero(leadsAssignedId)) { if (CommonUtil.isNullOrZero(leadsAssignedId)) {
...@@ -1547,9 +1595,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1547,9 +1595,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
} }
//保存基础信息 //保存基础信息
saveCustomerInfo(customerId, requestVO); CommonResult commonResult = saveCustomerInfo(customerId, requestVO);
if (!commonResult.isSuccess()) {
resp.setCommonResult(commonResult);
return resp;
}
//保存/激活新的标签 //保存/激活新的标签
saveCustomerTag(customerId, requestVO.getOpportunityCustomerTags()); saveCustomerTag(customerId, requestVO.getOpportunityCustomerTags(),requestVO);
//更新预设值 //更新预设值
saveLeadsAssigneds(requestVO); saveLeadsAssigneds(requestVO);
resp.setLeadsAssignedId(requestVO.getLeadsAssignedId()); resp.setLeadsAssignedId(requestVO.getLeadsAssignedId());
...@@ -1564,7 +1616,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1564,7 +1616,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//当指派id为null时,认为是保存新的商机 //当指派id为null时,认为是保存新的商机
//校验商机号码,手机号码对应的customer是否存在 //校验商机号码,手机号码对应的customer是否存在
String mobileNo = requestVO.getMobileNo(); String mobileNo = requestVO.getMobileNo();
AclCustomer aclCustomer = aclCustomerDALService.findByMobileNo(mobileNo); AclCustomer aclCustomer = null;
if(CommonUtil.isNullOrBlank(mobileNo) && !CommonUtil.isNullOrBlank(requestVO.getWeChat())){
aclCustomer = aclCustomerDALService.findByWeChatNo(requestVO.getWeChat());
}else{
aclCustomer = aclCustomerDALService.findByMobileNo(mobileNo);
}
Long mdMkCampaignId = systemConfigService.getMdMkCampaignId("leadaddedbypractioner"); Long mdMkCampaignId = systemConfigService.getMdMkCampaignId("leadaddedbypractioner");
//判断是否通过手机号码找到客户 //判断是否通过手机号码找到客户
...@@ -1598,9 +1655,16 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1598,9 +1655,16 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//帮其经行注册 //帮其经行注册
aclCustomer = new AclCustomer(); aclCustomer = new AclCustomer();
aclCustomer.setRole(2);//1= Staff 2=Customer 3=Partner aclCustomer.setRole(2);//1= Staff 2=Customer 3=Partner
aclCustomer.setAccountId(createAccountId(mobileNo)); if(CommonUtil.isNullOrBlank(mobileNo) && !CommonUtil.isNullOrBlank(requestVO.getWeChat())){
aclCustomer.setLogin(mobileNo); aclCustomer.setAccountId(createAccountId(requestVO.getWeChat(), "W_"));
aclCustomer.setMobileNo(mobileNo); aclCustomer.setLogin(requestVO.getWeChat());
aclCustomer.setMobileNo(mobileNo);
aclCustomer.setWechatNo(requestVO.getWeChat());
}else{
aclCustomer.setAccountId(createAccountId(mobileNo));
aclCustomer.setLogin(mobileNo);
aclCustomer.setMobileNo(mobileNo);
}
aclCustomer.setCusLevel(1); aclCustomer.setCusLevel(1);
aclCustomer.setName(requestVO.getName()); aclCustomer.setName(requestVO.getName());
aclCustomer.setIsActive(1); aclCustomer.setIsActive(1);
...@@ -1664,18 +1728,50 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1664,18 +1728,50 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")); return new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"));
} }
private String createAccountId(String mobileNo) { private String createAccountId(String mobileNo, String type) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String sub = null; String sub = null;
if (mobileNo != null && !"".equals(mobileNo)) { if (mobileNo != null && !"".equals(mobileNo)) {
sub = mobileNo.substring(mobileNo.length() - 6); if(mobileNo.length() > 6){
sub = mobileNo.substring(mobileNo.length() - 6);
}else{
sub = mobileNo;
}
} }
return "C_" + sub + "_" + sdf.format(new Date()); return type + sub + "_" + sdf.format(new Date());
}
private String createAccountId(String mobileNo) {
return createAccountId(mobileNo, "C_");
} }
private void saveCustomerInfo(Long customerId, OwnOpportunityBasicInformationSaveRequestVO requestVO) { private CommonResult saveCustomerInfo(Long customerId, OwnOpportunityBasicInformationSaveRequestVO requestVO) {
CommonResult commonResult = new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"));
AclCustomer customer = aclCustomerDALService.findById(customerId); AclCustomer customer = aclCustomerDALService.findById(customerId);
String mobileNo = customer.getMobileNo(); String mobileNo = requestVO.getMobileNo();
String weChat = requestVO.getWeChat();
Long leadsAssignedId = requestVO.getLeadsAssignedId();
if (!CommonUtil.isNullOrZero(leadsAssignedId)) {
AclCustomer aclCustomer = null;
//判断手机号是否有修改
if(!CommonUtil.isNullOrBlank(requestVO.getMobileNo()) && !requestVO.getMobileNo().equals(customer.getMobileNo())){
aclCustomer = aclCustomerDALService.findByMobileNo(requestVO.getMobileNo());
commonResult = checkMobileNoAndWechat(aclCustomer, customerId, requestVO);
if (!commonResult.isSuccess()) {
return commonResult;
}
}
//判断微信号是否有修改
if(!CommonUtil.isNullOrBlank(requestVO.getWeChat()) && !requestVO.getWeChat().equals(customer.getWechatNo())){
aclCustomer = aclCustomerDALService.findByWeChatNo(requestVO.getWeChat());
commonResult = checkMobileNoAndWechat(aclCustomer, customerId, requestVO);
if (!commonResult.isSuccess()) {
return commonResult;
}
}
}
String idNo = customer.getIdNo(); String idNo = customer.getIdNo();
customer.setMobileNo(mobileNo); customer.setMobileNo(mobileNo);
customer.setIdNo(idNo); customer.setIdNo(idNo);
...@@ -1684,11 +1780,46 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1684,11 +1780,46 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
customer.setGender(requestVO.getGender()); customer.setGender(requestVO.getGender());
customer.setAddress(requestVO.getAddress()); customer.setAddress(requestVO.getAddress());
customer.setAge(requestVO.getAge()); customer.setAge(requestVO.getAge());
customer.setWechatNo(requestVO.getWeChat()); customer.setWechatNo(weChat);
customer.setOtherContacts(requestVO.getOtherContacts()); customer.setOtherContacts(requestVO.getOtherContacts());
customer.setZodiacTypeId(requestVO.getZodiacTypeId()); customer.setZodiacTypeId(requestVO.getZodiacTypeId());
customer.setBloodTypeId(requestVO.getBloodTypeId()); customer.setBloodTypeId(requestVO.getBloodTypeId());
aclCustomerDALService.update(customer); aclCustomerDALService.update(customer);
return commonResult;
}
private CommonResult checkMobileNoAndWechat (AclCustomer aclCustomer, Long customerId, OwnOpportunityBasicInformationSaveRequestVO requestVO){
CommonResult commonResult = new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"));
//判断是否通过手机号码找到客户
if (aclCustomer != null && aclCustomer.getId().longValue() != customerId.longValue()) {
MktLeadsAssigneds mktLeadsAssigneds = new MktLeadsAssigneds();
mktLeadsAssigneds.setCustomerId(aclCustomer.getId());
mktLeadsAssigneds.setIsActive(1);
List<MktLeadsAssigneds> mktLeadsAssignedsList = mktLeadsAssignedsDALService.findByMktLeadsAssigneds(mktLeadsAssigneds);
if (!mktLeadsAssignedsList.isEmpty()) {
MktLeadsAssignedTrack leadsAssignedTrack = mktLeadsAssignedTrackDALService.findByListNotesForCustomerId(aclCustomer.getId());
Long mdDropOptionId = leadsAssignedTrack.getMdDropOptionId();
//判断最后一条跟进状态是否为失败,是失败则无需判断经纪人id和之前是否一致
MdDropOptions mdDropOption = mdDropOptionsDALService.findById(mdDropOptionId);
if (!"refused".equalsIgnoreCase(mdDropOption.getDropOptionCode())) {
Long assignedPractitionerId = requestVO.getAssignedPractitionerId();
//获取最新track对应的leads
for (MktLeadsAssigneds item : mktLeadsAssignedsList) {
if (item.getId().equals(leadsAssignedTrack.getLeadsAssignedId())) {
//跳出错误
if (item.getAssignedPractitionerId().equals(assignedPractitionerId)) {
return new CommonResult(false, "该商机已存在");
} else {
return new CommonResult(false, ZHBErrorConfig.getErrorInfo("830014"));
}
}
}
}
}
}
return commonResult;
} }
private void saveLeadsAssigneds(OwnOpportunityBasicInformationSaveRequestVO requestVO) { private void saveLeadsAssigneds(OwnOpportunityBasicInformationSaveRequestVO requestVO) {
...@@ -1702,7 +1833,17 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1702,7 +1833,17 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
mktLeadsAssignedsDALService.updateMktLeadsAssigneds(mktLeadsAssigneds); mktLeadsAssignedsDALService.updateMktLeadsAssigneds(mktLeadsAssigneds);
} }
private void saveCustomerTag(Long customerId, List<OpportunityCustomerTag> opportunityCustomerTags) { private void saveCustomerTag(Long customerId, List<OpportunityCustomerTag> opportunityCustomerTags,OwnOpportunityBasicInformationSaveRequestVO requestVO) {
if(CommonUtil.isNullOrBlank(requestVO.getMobileNo()) && !CommonUtil.isNullOrBlank(requestVO.getWeChat())){
if(opportunityCustomerTags == null || opportunityCustomerTags.size() == 0){
String ljbWechatTag = mdCodeDALService.findCodeByType("LJB_Wechat_tag");
if (!Strings.isNullOrEmpty(ljbWechatTag)) {
OpportunityCustomerTag e = new OpportunityCustomerTag();
e.setTagId(Long.valueOf(ljbWechatTag));
opportunityCustomerTags.add(e);
}
}
}
//保存标签 //保存标签
//此人的原有标签全部至0 //此人的原有标签全部至0
ObjectCollectionTagged tagged = new ObjectCollectionTagged(); ObjectCollectionTagged tagged = new ObjectCollectionTagged();
...@@ -1764,6 +1905,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1764,6 +1905,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
if (CommonUtil.isNullOrZero(requestVO.getId())) { if (CommonUtil.isNullOrZero(requestVO.getId())) {
//保存 //保存
mktLeadsAssignedTrackDALService.saveTrack(track); mktLeadsAssignedTrackDALService.saveTrack(track);
//1,如果 预约状态是status 0-待确认 isComplete 0-未沟通 ,修改预约状态和是否沟通为1
//2,给客户发送预约成功短信
//3,关联当前商机,并且添加到日程
updateAgSfpAppointmentRecordInfo(requestVO, track);
} else { } else {
//更新 //更新
mktLeadsAssignedTrackDALService.updateTrack(track); mktLeadsAssignedTrackDALService.updateTrack(track);
...@@ -1773,6 +1918,136 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1773,6 +1918,136 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return resp; return resp;
} }
private void updateAgSfpAppointmentRecordInfo(OwnOpportunityRecordSaveRequestVO requestVO, MktLeadsAssignedTrack track) {
MktLeadsPool pool = mktLeadsPoolDALService.findByCustomerIdForSfp(track.getCustomerId());
if(pool != null){
AgSfpAppointmentRecord agSfpAppointmentRecord = new AgSfpAppointmentRecord();
agSfpAppointmentRecord.setSfpMainId(pool.getSfpMainId());
mktLeadsAssignedTrackDALService.updateAppointmentRecord(agSfpAppointmentRecord);
AclPractitioner aclPractitioner = null;
if(requestVO.getPractitionerId() != null){
aclPractitioner = aclPractitionerDALService.findById(requestVO.getPractitionerId());
}
String mobileNo = pool.getMobile();
//给客户发送预约短信
if (StringUtils.isNotBlank(mobileNo)) {
try {
if (mobileNo.length() > 11) {
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
mobileNo = jpaCryptoConverter.decode(mobileNo);
}
log.error("SFP客户手机号:{}",mobileNo);
// 发短信 ALI_SMS_CUS_RESERVATION SMS_461985299
String templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_CUS_RESERVATION1");
if(aclPractitioner != null){
String time = CommonUtil.dateParseString(track.getTrackTime(), "yyyy-MM-dd");
if(StringUtils.isNotBlank(requestVO.getTaskTimeFrom())){
time = time + " " + requestVO.getTaskTimeFrom();
}
JSONObject content = new JSONObject();
content.put("name", aclPractitioner.getName());
content.put("date", time);
sendService.sendEmailOrSMS("sms", mobileNo, "0", content.toJSONString(), templateCode, null, null, "SFP智能财策预约通知", 99, pool.getId(),"sfp");
}
}catch (Exception e){
e.printStackTrace();
log.error("给客户发送短信异常:{}",e.getMessage());
}
}
//小程序给客户发送预约成功通知
if (StringUtils.isNotBlank(pool.getWxOpenId())) {
JSONObject result = null;
String requestJson = "";
String templateId = systemConfigService.getSingleConfigValue("SFP_TENCENT_WECHAT_TEMPLATE_ID");
String jumpUrl = systemConfigService.getSingleConfigValue("SFP_PAGE_CUS_URL");
String color = systemConfigService.getSingleConfigValue("TENCENT_WECHAT_TEMPLATE_COLOR_XB");
String pages = systemConfigService.getSingleConfigValue("TENCENT_WECHAT_TEMPLATE_PAGES");
String remarkValue = systemConfigService.getSingleConfigValue("SFP_TENCENT_WECHAT_TEMPLATE_CUS_REMARK1");
String accessToken = getAccessToken();
String url = systemConfigService.getSingleConfigValue("SFP_TENCENT_WECHAT_TEMPLATE_SEND_URL")+accessToken;
if(aclPractitioner != null){
// remarkValue = remarkValue.replace("name", aclPractitioner.getName());
remarkValue = remarkValue.replace("date", CommonUtil.dateParseString(track.getTrackTime(), "yyyy-MM-dd"));
// if(StringUtils.isNotBlank(requestVO.getTaskTimeFrom())){
// remarkValue = remarkValue + " " + requestVO.getTaskTimeFrom();
// }
}
// 组装模板数据
DataDetailInfo thing2 = new DataDetailInfo("SFP智能财策", color);
DataDetailInfo thing3 = new DataDetailInfo("专家("+aclPractitioner.getName()+")已接单", null);
DataDetailInfo date4 = new DataDetailInfo(CommonUtil.dateParseString(new Date(),"yyyy-MM-dd HH:mm:ss"), null);
DataDetailInfo thing5 = new DataDetailInfo(remarkValue, null);
MiniProgramSfpInfo dataInfo = new MiniProgramSfpInfo();
dataInfo.setThing2(thing2);
dataInfo.setThing3(thing3);
dataInfo.setDate4(date4);
dataInfo.setThing5(thing5);
SendTemplateSfpRequest sendTemplateRequest = new SendTemplateSfpRequest();
sendTemplateRequest.setTemplateId(templateId);
sendTemplateRequest.setUrl(jumpUrl);
sendTemplateRequest.setPage(pages);
sendTemplateRequest.setData(dataInfo);
sendTemplateRequest.setToUser(pool.getWxOpenId());
requestJson = JsonUtil.objToJson(sendTemplateRequest);
log.info("ydLife,请求信息:{}",JsonUtil.format(requestJson));
String responseJson = wechatInterfService.weChatTransaction(url,requestJson);
result = JSON.parseObject(responseJson);
log.info("ydLife,返回信息:{}",result);
int errCode = result.getIntValue("errCode");
String errMsg = result.getString("errmsg");
log.info("ydLife,错误代码{},错误信息{}",errCode,errMsg);
}
}
if(requestVO.getSfpMainId() != null && StringUtils.isNotBlank(requestVO.getTaskTimeFrom()) && StringUtils.isNotBlank(requestVO.getTaskTimeEnd())) {
//关联商机
//添加到日程
AddScheduleTrackRequestVO addScheduleTrackRequestVO = new AddScheduleTrackRequestVO();
addScheduleTrackRequestVO.setPractitionerId(track.getPractitionerId());
addScheduleTrackRequestVO.setTaskType(1);
addScheduleTrackRequestVO.setReferLeadsId(track.getId());
addScheduleTrackRequestVO.setTaskImportantTag(0);
addScheduleTrackRequestVO.setIsActive(1);
addScheduleTrackRequestVO.setTaskTimeFrom(requestVO.getTaskTimeFrom() == null ? "09:00:00" : requestVO.getTaskTimeFrom());
addScheduleTrackRequestVO.setTaskTimeEnd(requestVO.getTaskTimeEnd() == null ? "20:00:00" : requestVO.getTaskTimeEnd());
addScheduleTrackRequestVO.setCustomerId(track.getCustomerId());
addScheduleTrackRequestVO.setMdDropOptionId(requestVO.getMdDropOptionId());
addScheduleTrackRequestVO.setTrackTime(track.getTrackTime());
addScheduleTrackRequestVO.setNotice(requestVO.getSalesNotice());
AddScheduleTrackResponseVO res = scheduleTrackService.insert(addScheduleTrackRequestVO);
if (!res.getCommonResult().isSuccess()) {
log.info("添加到日程失败,错误信息{}", res.getCommonResult().getMessage());
}
}
}
private String getAccessToken() {
String appId = systemConfigService.getSingleConfigValue("SFP_TENCENT_WECHAT_APPID");
String secret = systemConfigService.getSingleConfigValue("SFP_TENCENT_WECHAT_APPSECRET");
String grantType = systemConfigService.getSingleConfigValue("TENCENT_WECHAT_TOKEN_GRANT_TYPE");
AccessTokenRequest accessTokenRequest = new AccessTokenRequest();
accessTokenRequest.setAppid(appId);
accessTokenRequest.setSecret(secret);
accessTokenRequest.setGrant_type(grantType);
boolean isLocal = SpringContextUtil.isLocal();
return isLocal ? getAccessTokenByDEV(accessTokenRequest) : wechatService.getAccessToken(accessTokenRequest);
}
private String getAccessTokenByDEV(AccessTokenRequest accessTokenRequest) {
String requestJson = JsonUtil.objToJson(accessTokenRequest);
String responseJson = HttpUtil.postForJson("https://mdev.zuihuibi.cn/api/getAccessToken",requestJson);
JSONObject result = JSON.parseObject(responseJson);
return result.getString("data");
}
@Override @Override
public OpportunityStatisticsResponseVO opportunityStatistics(OpportunityStatisticsRequestVO requestVO) { public OpportunityStatisticsResponseVO opportunityStatistics(OpportunityStatisticsRequestVO requestVO) {
OpportunityStatisticsResponseVO resp = new OpportunityStatisticsResponseVO(); OpportunityStatisticsResponseVO resp = new OpportunityStatisticsResponseVO();
...@@ -4960,7 +5235,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -4960,7 +5235,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
mktLeadsAssigneds.setUpdatedBy(requestVO.getPractitionerId()); mktLeadsAssigneds.setUpdatedBy(requestVO.getPractitionerId());
mktLeadsAssignedsDALService.updateMktLeadsAssigneds(mktLeadsAssigneds); mktLeadsAssignedsDALService.updateMktLeadsAssigneds(mktLeadsAssigneds);
MktLeadsPool pool = mktLeadsPoolDALService.findByCustomerId(mktLeadsAssigneds.getCustomerId()); MktLeadsPool pool = null;
if(mktLeadsAssigneds.getSfpMainId() != null){
pool = mktLeadsPoolDALService.findBySfpMainId(mktLeadsAssigneds.getSfpMainId());
}else{
pool = mktLeadsPoolDALService.findByCustomerId(mktLeadsAssigneds.getCustomerId());
}
if (pool != null) { if (pool != null) {
pool.setIsActive(0); pool.setIsActive(0);
mktLeadsPoolDALService.updateMktLeadsAssigneds(pool); mktLeadsPoolDALService.updateMktLeadsAssigneds(pool);
......
...@@ -22,6 +22,7 @@ import com.yd.dal.service.meta.MdDropOptionsDALService; ...@@ -22,6 +22,7 @@ import com.yd.dal.service.meta.MdDropOptionsDALService;
import com.yd.rmi.n22.salary.pojo.Achieve; import com.yd.rmi.n22.salary.pojo.Achieve;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
import com.yd.util.config.ZHBErrorConfig; import com.yd.util.config.ZHBErrorConfig;
import com.yd.util.deshandler.DESTypeHandler;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -228,6 +229,13 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService { ...@@ -228,6 +229,13 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
// 获取optionName // 获取optionName
optionName = taskTypeMap.get(schedule.getMdDropOptionId()).getDropOptionName(); optionName = taskTypeMap.get(schedule.getMdDropOptionId()).getDropOptionName();
scheduleTrackVO.setMdDropOptionName(optionName); scheduleTrackVO.setMdDropOptionName(optionName);
if (StringUtils.isNotBlank(scheduleTrackVO.getMobileNo())) {
if(scheduleTrackVO.getMobileNo().length() >11) {
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
scheduleTrackVO.setMobileNo(jpaCryptoConverter.decode(scheduleTrackVO.getMobileNo()));
}
}
showList.add(scheduleTrackVO); showList.add(scheduleTrackVO);
} }
} }
......
...@@ -61,5 +61,6 @@ public class OpportunityBasicInformationInfo { ...@@ -61,5 +61,6 @@ public class OpportunityBasicInformationInfo {
*/ */
private String timeToClose; private String timeToClose;
private List<OpportunityCustomerTag> opportunityCustomerTags; private List<OpportunityCustomerTag> opportunityCustomerTags;
private Long sfpUserId;
} }
...@@ -25,4 +25,8 @@ public class OpportunityRecordInfo { ...@@ -25,4 +25,8 @@ public class OpportunityRecordInfo {
* 告知书签署状态 * 告知书签署状态
*/ */
private String status; private String status;
private Long sfpMainId;//sfp商家专用
private String taskTimeFrom;//跟进开始时间
private String taskTimeEnd;//跟进结束时间
} }
...@@ -7,4 +7,7 @@ public class OwnOpportunityDetailQueryRequestVO { ...@@ -7,4 +7,7 @@ public class OwnOpportunityDetailQueryRequestVO {
private Long practitionerId; private Long practitionerId;
private Long opportunityId;//商机Id,客户的customerId private Long opportunityId;//商机Id,客户的customerId
private Long orderId; private Long orderId;
private Long sfpMainId;//sfp商家专用
private String taskTimeFrom;//跟进开始时间
private String taskTimeEnd;//跟进结束时间
} }
...@@ -12,4 +12,9 @@ public class OwnOpportunityRecordSaveRequestVO { ...@@ -12,4 +12,9 @@ public class OwnOpportunityRecordSaveRequestVO {
private Long mdDropOptionId; private Long mdDropOptionId;
private String noticeDate; private String noticeDate;
private Long leadsAssignedId; private Long leadsAssignedId;
private String taskTimeFrom;//跟进开始时间
private String taskTimeEnd;//跟进结束时间
private Long sfpMainId;
} }
...@@ -29,6 +29,6 @@ public class ScheduleTrackVO { ...@@ -29,6 +29,6 @@ public class ScheduleTrackVO {
private String name; private String name;
private String mobileNo; private String mobileNo;
private Integer trackScore; private Integer trackScore;
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
private Date trackTime; private Date trackTime;
} }
package com.yd.dal.entity.marketing;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class AgSfpAppointmentRecord implements Serializable{
private static final long serialVersionUID = 1L;
private Long id;//serial idPRIauto_increment
private Long sfpMainId;//主表ID
private Long userId;//客户id ag_sfp_user.id
private Integer appointmentType;//预约类型
private Integer customerSource;//客户来源
private String expecteTime;//客户期望沟通时间
private Integer status;//预约确认状态 0-待确认 1-已确认
private Integer isComplete;//是否沟通 0-未沟通 1-已沟通
private String expert;//专家
private Integer isActive;//1=active 0=inactive
private String remark;//备注
private Date createdAt;//创建时间
private String createdBy;//创建人
private Date updatedAt;//修改时间
private String updatedBy;//修改人
}
...@@ -110,5 +110,9 @@ public class MktLeadsAssignedTrack implements Serializable { ...@@ -110,5 +110,9 @@ public class MktLeadsAssignedTrack implements Serializable {
*/ */
private String informedStatus; private String informedStatus;
private Long sfpMainId;
private String taskTimeFrom;//跟进开始时间
private String taskTimeEnd;//跟进结束时间
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -15,7 +15,7 @@ public class MktLeadsAssigneds { ...@@ -15,7 +15,7 @@ public class MktLeadsAssigneds {
* serial id * serial id
*/ */
private Long id; private Long id;
private Long sfpMainId;
/** /**
* 经纪人id * 经纪人id
*/ */
...@@ -83,4 +83,4 @@ public class MktLeadsAssigneds { ...@@ -83,4 +83,4 @@ public class MktLeadsAssigneds {
* 更新者 FK ag_acl_user.id * 更新者 FK ag_acl_user.id
*/ */
private Long updatedBy; private Long updatedBy;
} }
\ No newline at end of file
...@@ -54,4 +54,11 @@ public class MktLeadsPool { ...@@ -54,4 +54,11 @@ public class MktLeadsPool {
private Long addedBy; private Long addedBy;
private Integer adderType; private Integer adderType;
} private String remark;//备注
\ No newline at end of file private Long appointmentRecordId;//预约表id
private Long sfpMainId;
private String mobile;
private String wxOpenId;//sfp 用户小程序openid
private Long sfpUserId;
}
...@@ -15,4 +15,7 @@ public class OwnOpportunityInfo { ...@@ -15,4 +15,7 @@ public class OwnOpportunityInfo {
private Double scoreDay; private Double scoreDay;
private Double scoreTotal; private Double scoreTotal;
private Long expertType;//0.经纪人指派 1.专家指派 private Long expertType;//0.经纪人指派 1.专家指派
} private Long sfpMainId;
\ No newline at end of file private String wechatNo;
}
...@@ -22,6 +22,8 @@ public interface AclCustomerMapper { ...@@ -22,6 +22,8 @@ public interface AclCustomerMapper {
AclCustomer findByMobileNo(String mobileNo); AclCustomer findByMobileNo(String mobileNo);
AclCustomer findByWeChatNo(String weChatNo);
List<AclCustomer> findByIds(@Param("customerIds") List<Long> customerIds); List<AclCustomer> findByIds(@Param("customerIds") List<Long> customerIds);
List<AclCustomer> findByObj(AclCustomer aclCustomer); List<AclCustomer> findByObj(AclCustomer aclCustomer);
......
...@@ -2,6 +2,7 @@ package com.yd.dal.mapper.marketing; ...@@ -2,6 +2,7 @@ package com.yd.dal.mapper.marketing;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.yd.api.practitioner.vo.opportunity.SalesScoreDetail; import com.yd.api.practitioner.vo.opportunity.SalesScoreDetail;
import com.yd.dal.entity.marketing.AgSfpAppointmentRecord;
import com.yd.dal.entity.marketing.MktLeadsAssignedTrack; import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -37,4 +38,7 @@ public interface MktLeadsAssignedTrackMapper { ...@@ -37,4 +38,7 @@ public interface MktLeadsAssignedTrackMapper {
int updateInformedOssPathByInformedId(@Param("informedOssPath") String InformedOssPath, @Param("informedId") Long informedId); int updateInformedOssPathByInformedId(@Param("informedOssPath") String InformedOssPath, @Param("informedId") Long informedId);
int updateCustomerIdByLeadsAssignedId(@Param("customerId") Long customerId, @Param("leadsAssignedId") Long leadsAssignedId); int updateCustomerIdByLeadsAssignedId(@Param("customerId") Long customerId, @Param("leadsAssignedId") Long leadsAssignedId);
}
\ No newline at end of file int updateAppointmentRecord(AgSfpAppointmentRecord appointmentRecord);
}
...@@ -28,4 +28,8 @@ public interface MktLeadsPoolMapper { ...@@ -28,4 +28,8 @@ public interface MktLeadsPoolMapper {
List<LeadsStatisticsInfo> findIsAssignLeads(); List<LeadsStatisticsInfo> findIsAssignLeads();
List<LeadsStatusInfo> findLeadsStatusMap(); List<LeadsStatusInfo> findLeadsStatusMap();
}
\ No newline at end of file MktLeadsPool findByCustomerIdForSfp(Long customerId);
MktLeadsPool findBySfpMainId(Long sfpMainId);
}
...@@ -265,7 +265,7 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService { ...@@ -265,7 +265,7 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService {
// ${name},您好!${name2}(S3纵队S2体系S1分部的XX)经纪人已提交报聘审批,请至“赢家平台>我的团队-报聘审批”进行查看审批,谢谢! // ${name},您好!${name2}(S3纵队S2体系S1分部的XX)经纪人已提交报聘审批,请至“赢家平台>我的团队-报聘审批”进行查看审批,谢谢!
String templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_HiringApproveNotice"); String templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_HiringApproveNotice");
String content = "{\"name\":\"" + name + "\",\"hiringName\":\"" + hiringName + "\"}"; String content = "{\"name\":\"" + name + "\",\"hiringName\":\"" + hiringName + "\"}";
sendService.sendEmailOrSMS("sms", mobileNo, "0", content, templateCode, null, null, "电子报聘审批通知", 99, basicInfo.getId()); sendService.sendEmailOrSMS("sms", mobileNo, "0", content, templateCode, null, null, "电子报聘审批通知", 99, basicInfo.getId(), null);
} else { } else {
logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》电子报聘审批人电话号码不存在"); logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》电子报聘审批人电话号码不存在");
throw new RuntimeException("电子报聘审批人电话号码不存在"); throw new RuntimeException("电子报聘审批人电话号码不存在");
......
...@@ -32,6 +32,8 @@ public interface AclCustomerDALService { ...@@ -32,6 +32,8 @@ public interface AclCustomerDALService {
AclCustomer findByCustomerId(Long customerId); AclCustomer findByCustomerId(Long customerId);
AclCustomer findByMobileNo(String mobileNo); AclCustomer findByMobileNo(String mobileNo);
AclCustomer findByWeChatNo(String weChatNo);
List<AclCustomer> findByIds(List<Long> customerIds); List<AclCustomer> findByIds(List<Long> customerIds);
......
package com.yd.dal.service.customer.impl; package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclCustomer; import java.util.List;
import com.yd.dal.mapper.customer.AclCustomerMapper;
import com.yd.dal.service.customer.AclCustomerDALService;
import com.yd.util.deshandler.DESTypeHandler;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import com.yd.dal.entity.customer.AclCustomer;
import com.yd.dal.mapper.customer.AclCustomerMapper;
import com.yd.dal.service.customer.AclCustomerDALService;
@Service("aclCustomerDalService") @Service("aclCustomerDalService")
public class AclCustomerDALServiceImpl implements AclCustomerDALService { public class AclCustomerDALServiceImpl implements AclCustomerDALService {
...@@ -48,6 +45,11 @@ public class AclCustomerDALServiceImpl implements AclCustomerDALService { ...@@ -48,6 +45,11 @@ public class AclCustomerDALServiceImpl implements AclCustomerDALService {
} }
@Override @Override
public AclCustomer findByWeChatNo(String weChatNo) {
return aclCustomerMapper.findByWeChatNo(weChatNo);
}
@Override
public List<AclCustomer> findByIds(List<Long> customerIds) { public List<AclCustomer> findByIds(List<Long> customerIds) {
return aclCustomerMapper.findByIds(customerIds); return aclCustomerMapper.findByIds(customerIds);
} }
......
...@@ -3,6 +3,7 @@ package com.yd.dal.service.marketing.Impl; ...@@ -3,6 +3,7 @@ package com.yd.dal.service.marketing.Impl;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yd.api.practitioner.vo.opportunity.SalesScoreDetail; import com.yd.api.practitioner.vo.opportunity.SalesScoreDetail;
import com.yd.dal.entity.marketing.AgSfpAppointmentRecord;
import com.yd.dal.entity.marketing.MktLeadsAssignedTrack; import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import com.yd.dal.mapper.marketing.MktLeadsAssignedTrackMapper; import com.yd.dal.mapper.marketing.MktLeadsAssignedTrackMapper;
import com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService; import com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService;
...@@ -70,4 +71,10 @@ public class MktLeadsAssignedTrackDALServiceImpl implements MktLeadsAssignedTrac ...@@ -70,4 +71,10 @@ public class MktLeadsAssignedTrackDALServiceImpl implements MktLeadsAssignedTrac
public int updateCustomerIdByLeadsAssignedId(Long customerId, Long leadsAssignedId) { public int updateCustomerIdByLeadsAssignedId(Long customerId, Long leadsAssignedId) {
return mktLeadsAssignedTrackMapper.updateCustomerIdByLeadsAssignedId(customerId, leadsAssignedId); return mktLeadsAssignedTrackMapper.updateCustomerIdByLeadsAssignedId(customerId, leadsAssignedId);
} }
@Override
public void updateAppointmentRecord(AgSfpAppointmentRecord appointmentRecord) {
mktLeadsAssignedTrackMapper.updateAppointmentRecord(appointmentRecord);
}
} }
...@@ -62,4 +62,14 @@ public class MktLeadsPoolDALServiceImpl implements MktLeadsPoolDALService { ...@@ -62,4 +62,14 @@ public class MktLeadsPoolDALServiceImpl implements MktLeadsPoolDALService {
public void updateMktLeadsAssigneds(MktLeadsPool pool){ public void updateMktLeadsAssigneds(MktLeadsPool pool){
mktLeadsPoolMapper.updateByPrimaryKeySelective(pool); mktLeadsPoolMapper.updateByPrimaryKeySelective(pool);
} }
@Override
public MktLeadsPool findByCustomerIdForSfp(Long customerId) {
return mktLeadsPoolMapper.findByCustomerIdForSfp(customerId);
}
@Override
public MktLeadsPool findBySfpMainId(Long sfpMainId) {
return mktLeadsPoolMapper.findBySfpMainId(sfpMainId);
}
} }
package com.yd.dal.service.marketing; package com.yd.dal.service.marketing;
import com.yd.api.practitioner.vo.opportunity.SalesScoreDetail; import com.yd.api.practitioner.vo.opportunity.SalesScoreDetail;
import com.yd.dal.entity.marketing.AgSfpAppointmentRecord;
import com.yd.dal.entity.marketing.MktLeadsAssignedTrack; import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -38,4 +39,6 @@ public interface MktLeadsAssignedTrackDALService { ...@@ -38,4 +39,6 @@ public interface MktLeadsAssignedTrackDALService {
int updateInformedOssPathByInformedId(String ossPath, Long informedId); int updateInformedOssPathByInformedId(String ossPath, Long informedId);
int updateCustomerIdByLeadsAssignedId(Long customerId, Long leadsAssignedId); int updateCustomerIdByLeadsAssignedId(Long customerId, Long leadsAssignedId);
void updateAppointmentRecord(AgSfpAppointmentRecord appointmentRecord);
} }
...@@ -21,4 +21,8 @@ public interface MktLeadsPoolDALService { ...@@ -21,4 +21,8 @@ public interface MktLeadsPoolDALService {
PageInfo<LeadsStatisticsInfo> findByConditionPage(int pageNum, int size, Integer isStatement, Integer leadsStatus, Integer expertApplyStatus, String leadsStartTime, String leadsEndTime); PageInfo<LeadsStatisticsInfo> findByConditionPage(int pageNum, int size, Integer isStatement, Integer leadsStatus, Integer expertApplyStatus, String leadsStartTime, String leadsEndTime);
void updateMktLeadsAssigneds(MktLeadsPool pool); void updateMktLeadsAssigneds(MktLeadsPool pool);
MktLeadsPool findByCustomerIdForSfp(Long customerId);
MktLeadsPool findBySfpMainId(Long sfpMainId);
} }
...@@ -20,7 +20,7 @@ public interface SendService { ...@@ -20,7 +20,7 @@ public interface SendService {
* @param useFor 该短信和邮件主要是为了什么发送的,1=订单 2=提现 3=客户意见 4=汽车问卷 5=活动 6=wordpress 7=生日快乐 99=其他' * @param useFor 该短信和邮件主要是为了什么发送的,1=订单 2=提现 3=客户意见 4=汽车问卷 5=活动 6=wordpress 7=生日快乐 99=其他'
* @param useForId 相应的主键ID,如:订单id等 * @param useForId 相应的主键ID,如:订单id等
*/ */
void sendEmailOrSMS(String category,String number,String type,String content,String templateCode,String subject,String[] ccAddress,String contentSummary,Integer useFor,Long useForId); void sendEmailOrSMS(String category,String number,String type,String content,String templateCode,String subject,String[] ccAddress,String contentSummary,Integer useFor,Long useForId, String source);
/** /**
* 发送短信 * 发送短信
...@@ -35,7 +35,7 @@ public interface SendService { ...@@ -35,7 +35,7 @@ public interface SendService {
*/ */
void sendSMS(String mobile, String type, String content, String templateCode, String subject, String contentSummary, Integer useFor, Long useForId); void sendSMS(String mobile, String type, String content, String templateCode, String subject, String contentSummary, Integer useFor, Long useForId);
void sendEmail(String category, String number, String content, String subject, String[] ccAddress, String contentSummary, Integer useFor, List<String> attachmentFiles); void sendEmail(String category, String number, String content, String subject, String[] ccAddress, String contentSummary, Integer useFor, List<String> attachmentFiles);
boolean sendEmail(String email, String messageText, String subject, String[] ccAddresses); boolean sendEmail(String email, String messageText, String subject, String[] ccAddresses);
} }
...@@ -57,7 +57,7 @@ public class SendServiceImpl implements SendService { ...@@ -57,7 +57,7 @@ public class SendServiceImpl implements SendService {
@Override @Override
@Async("sendAsyncServiceExecutor") @Async("sendAsyncServiceExecutor")
public void sendEmailOrSMS(String category, String number, String type, String content, String templateCode, public void sendEmailOrSMS(String category, String number, String type, String content, String templateCode,
String subject, String[] ccAddress, String contentSummary, Integer useFor, Long useForId) { String subject, String[] ccAddress, String contentSummary, Integer useFor, Long useForId, String source) {
int failCount = 0; int failCount = 0;
boolean sendResult = false; boolean sendResult = false;
if(CommonUtil.isNullOrBlank(category) || CommonUtil.isNullOrBlank(number) || CommonUtil.isNullOrBlank(type)){ if(CommonUtil.isNullOrBlank(category) || CommonUtil.isNullOrBlank(number) || CommonUtil.isNullOrBlank(type)){
...@@ -86,7 +86,7 @@ public class SendServiceImpl implements SendService { ...@@ -86,7 +86,7 @@ public class SendServiceImpl implements SendService {
boolean isCanSend = canSendForMobile(number); boolean isCanSend = canSendForMobile(number);
if(isCanSend){ if(isCanSend){
if(!CommonUtil.isNullOrBlank(templateCode)){ if(!CommonUtil.isNullOrBlank(templateCode)){
List<String> smsResult = executeSendSMS(number,type,content,templateCode,subject); List<String> smsResult = executeSendSMS(source,number,type,content,templateCode,subject);
// result = smsResult.get(0); // result = smsResult.get(0);
failCount = Integer.parseInt(smsResult.get(1)); failCount = Integer.parseInt(smsResult.get(1));
sendResult = Boolean.parseBoolean(smsResult.get(2)); sendResult = Boolean.parseBoolean(smsResult.get(2));
...@@ -176,7 +176,7 @@ public class SendServiceImpl implements SendService { ...@@ -176,7 +176,7 @@ public class SendServiceImpl implements SendService {
} else { } else {
AclCustomer customer = getCustomerInfo("sms", mobile); AclCustomer customer = getCustomerInfo("sms", mobile);
if (!CommonUtil.isNullOrBlank(templateCode)) { if (!CommonUtil.isNullOrBlank(templateCode)) {
List<String> smsResult = executeSendSMS(mobile, type, content, templateCode, subject); List<String> smsResult = executeSendSMS(mobile, type, content, templateCode, subject, null);
// result = smsResult.get(0); // result = smsResult.get(0);
int failCount = Integer.parseInt(smsResult.get(1)); int failCount = Integer.parseInt(smsResult.get(1));
boolean sendResult = Boolean.parseBoolean(smsResult.get(2)); boolean sendResult = Boolean.parseBoolean(smsResult.get(2));
...@@ -250,7 +250,7 @@ public class SendServiceImpl implements SendService { ...@@ -250,7 +250,7 @@ public class SendServiceImpl implements SendService {
* @param subject * @param subject
* @return * @return
*/ */
private List<String> executeSendSMS(String number, String type, String content, String templateCode, String subject) { private List<String> executeSendSMS(String source,String number, String type, String content, String templateCode, String subject) {
List<String> resultInfo = new ArrayList<>(); List<String> resultInfo = new ArrayList<>();
String result = null; String result = null;
int failCount = 0; int failCount = 0;
...@@ -261,13 +261,13 @@ public class SendServiceImpl implements SendService { ...@@ -261,13 +261,13 @@ public class SendServiceImpl implements SendService {
smsRecord.setTemplateCode(templateCode); smsRecord.setTemplateCode(templateCode);
boolean smsResult = false; boolean smsResult = false;
while (!smsResult && (failCount < 4)){ while (!smsResult && (failCount < 4)){
SendSmsResponse response =aliSmsInterfService.sendSms(smsRecord,subject); SendSmsResponse response =aliSmsInterfService.sendSms(source,smsRecord,subject);
result = response.getMessage(); result = response.getMessage();
if ("OK".equals(response.getCode())) { if ("OK".equals(response.getCode())) {
smsResult = true; smsResult = true;
}else{ }else{
failCount++; failCount++;
System.out.println(">>>>>>>>>>>>第"+failCount+"次失败原因:"+response.getMessage()); LOGGER.info(">>>>>>>>>>>>第"+failCount+"次失败原因:"+response.getMessage());
} }
} }
resultInfo.add(result); resultInfo.add(result);
......
...@@ -6,6 +6,6 @@ import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; ...@@ -6,6 +6,6 @@ import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.yd.dal.entity.sms.ShortMessageSendRecord; import com.yd.dal.entity.sms.ShortMessageSendRecord;
public interface AliSmsInterfService { public interface AliSmsInterfService {
public SendSmsResponse sendSms(ShortMessageSendRecord smsRecord, String signName); public SendSmsResponse sendSms(String source,ShortMessageSendRecord smsRecord, String signName);
// public QuerySendDetailsResponse querySmsDetail(ShortMessageSendRecord smsRecord); // public QuerySendDetailsResponse querySmsDetail(ShortMessageSendRecord smsRecord);
} }
...@@ -38,13 +38,21 @@ public class AliSmsInterfServiceImpl implements AliSmsInterfService { ...@@ -38,13 +38,21 @@ public class AliSmsInterfServiceImpl implements AliSmsInterfService {
* @return SendSmsResponse * @return SendSmsResponse
* @throws ClientException * @throws ClientException
*/ */
private SendSmsResponse send(String phoneNumber,String signName,String templateCode,String templateParam,String outId) throws ClientException { private SendSmsResponse send(String source,String phoneNumber,String signName,String templateCode,String templateParam,String outId) throws ClientException {
//可自助调整超时时间 //可自助调整超时时间
System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000"); System.setProperty("sun.net.client.defaultReadTimeout", "10000");
//初始化acsClient,暂不支持region化 //初始化acsClient,暂不支持region化
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", systemConfigService.getSingleConfigValue("ALI_SMS_ACCESS_KEY_ID"), systemConfigService.getSingleConfigValue("ALI_SMS_ACCESS_KEY_SECRET")); IClientProfile profile;
if ("sfp".equals(source)) {
profile = DefaultProfile.getProfile("cn-hangzhou", systemConfigService.getSingleConfigValue("ALI_SMS_ACCESS_KEY_ID_CFFP"), systemConfigService.getSingleConfigValue("ALI_SMS_ACCESS_KEY_SECRET_CFFP"));
signName = (CommonUtil.isNullOrBlank(signName)) ? systemConfigService.getSingleConfigValue("ALI_SMS_SIGN_NAME_SFP") : signName;
}else{
profile = DefaultProfile.getProfile("cn-hangzhou", systemConfigService.getSingleConfigValue("ALI_SMS_ACCESS_KEY_ID"), systemConfigService.getSingleConfigValue("ALI_SMS_ACCESS_KEY_SECRET"));
signName = (CommonUtil.isNullOrBlank(signName)) ? systemConfigService.getSingleConfigValue("ALI_SMS_SIGN_NAME") : signName;
}
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", systemConfigService.getSingleConfigValue("ALI_SMS_PRODUCT"), systemConfigService.getSingleConfigValue("ALI_SMS_DOMAIN")); DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", systemConfigService.getSingleConfigValue("ALI_SMS_PRODUCT"), systemConfigService.getSingleConfigValue("ALI_SMS_DOMAIN"));
IAcsClient acsClient = new DefaultAcsClient(profile); IAcsClient acsClient = new DefaultAcsClient(profile);
...@@ -110,7 +118,7 @@ public class AliSmsInterfServiceImpl implements AliSmsInterfService { ...@@ -110,7 +118,7 @@ public class AliSmsInterfServiceImpl implements AliSmsInterfService {
* @return QuerySendDetailsResponse * @return QuerySendDetailsResponse
*/ */
@Override @Override
public SendSmsResponse sendSms(ShortMessageSendRecord smsRecord, String signName) { public SendSmsResponse sendSms(String source,ShortMessageSendRecord smsRecord, String signName) {
String phoneNumber = smsRecord.getMobileNo(); String phoneNumber = smsRecord.getMobileNo();
String templateParam; String templateParam;
String outId = "ajb"; String outId = "ajb";
...@@ -139,8 +147,7 @@ public class AliSmsInterfServiceImpl implements AliSmsInterfService { ...@@ -139,8 +147,7 @@ public class AliSmsInterfServiceImpl implements AliSmsInterfService {
templateParam = smsRecord.getSmsContent(); templateParam = smsRecord.getSmsContent();
} }
try { try {
signName = (CommonUtil.isNullOrBlank(signName)) ? systemConfigService.getSingleConfigValue("ALI_SMS_SIGN_NAME") : signName; sendSmsResponse = send(source, phoneNumber, signName, templateCode, templateParam, outId);
sendSmsResponse = send(phoneNumber, signName, templateCode, templateParam, outId);
smsRecord.setSendTime(new Date()); smsRecord.setSendTime(new Date());
smsRecord.setSendStatus(sendSmsResponse.getCode()); smsRecord.setSendStatus(sendSmsResponse.getCode());
smsRecord.setReturnMessage(sendSmsResponse.getMessage()); smsRecord.setReturnMessage(sendSmsResponse.getMessage());
......
package com.yd.rmi.tencent.wechatinterf.pojo.templetemessage;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author: hongzhong
* @date 2023年06月15日 17:13
*/
public class MiniProgramSfpInfo {
@JsonProperty("thing2")
private DataDetailInfo thing2;
@JsonProperty("thing3")
private DataDetailInfo thing3;
@JsonProperty("date4")
private DataDetailInfo date4;
@JsonProperty("thing5")
private DataDetailInfo thing5;
public DataDetailInfo getThing2() {
return thing2;
}
public void setThing2(DataDetailInfo thing2) {
this.thing2 = thing2;
}
public DataDetailInfo getThing3() {
return thing3;
}
public void setThing3(DataDetailInfo thing3) {
this.thing3 = thing3;
}
public DataDetailInfo getDate4() {
return date4;
}
public void setDate4(DataDetailInfo date4) {
this.date4 = date4;
}
public DataDetailInfo getThing5() {
return thing5;
}
public void setThing5(DataDetailInfo thing5) {
this.thing5 = thing5;
}
}
package com.yd.rmi.tencent.wechatinterf.pojo.templetemessage;
import com.fasterxml.jackson.annotation.JsonProperty;
public class SendTemplateSfpRequest {
@JsonProperty("touser")
private String toUser;
@JsonProperty("template_id")
private String templateId;
private String url;
@JsonProperty("miniprogram")
private MiniProgramInfo miniProgram;
private MiniProgramSfpInfo data;
private String page;
public String getToUser() {
return toUser;
}
public void setToUser(String toUser) {
this.toUser = toUser;
}
public String getTemplateId() {
return templateId;
}
public void setTemplateId(String templateId) {
this.templateId = templateId;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public MiniProgramInfo getMiniProgram() {
return miniProgram;
}
public void setMiniProgram(MiniProgramInfo miniProgram) {
this.miniProgram = miniProgram;
}
public MiniProgramSfpInfo getData() {
return data;
}
public void setData(MiniProgramSfpInfo data) {
this.data = data;
}
public String getPage() {
return page;
}
public void setPage(String page) {
this.page = page;
}
}
...@@ -770,7 +770,14 @@ ...@@ -770,7 +770,14 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from ag_acl_customer from ag_acl_customer
where mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler} where mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler}
and is_active=1 and is_active=1 order by id desc limit 0,1
</select>
<select id="findByWeChatNo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_customer
where wechat_no = #{wechatNo,jdbcType=VARCHAR}
and is_active=1 order by id desc limit 0,1
</select> </select>
<select id="findByIds" resultMap="BaseResultMap"> <select id="findByIds" resultMap="BaseResultMap">
......
...@@ -1516,6 +1516,8 @@ ...@@ -1516,6 +1516,8 @@
<result column="scoreDay" property="scoreDay" /> <result column="scoreDay" property="scoreDay" />
<result column="scoreTotal" property="scoreTotal" /> <result column="scoreTotal" property="scoreTotal" />
<result column="expertType" property="expertType" /> <result column="expertType" property="expertType" />
<result column="sfpMainId" property="sfpMainId" />
<result column="wechatNo" property="wechatNo" />
</resultMap> </resultMap>
<select id="ownOpportunityQuery" resultMap="opportunityQuery"> <select id="ownOpportunityQuery" resultMap="opportunityQuery">
SELECT SELECT
...@@ -1528,12 +1530,16 @@ ...@@ -1528,12 +1530,16 @@
(SELECT md.drop_option_name from ag_md_drop_options md LEFT JOIN ag_mkt_leads_assigned_track amlat ON md.id = amlat.md_drop_option_id where amlat.practitioner_id = a.assigned_practitioner_id and amlat.customer_id = a.customer_id ORDER BY amlat.created_at DESC LIMIT 1) mdDropOptionName, (SELECT md.drop_option_name from ag_md_drop_options md LEFT JOIN ag_mkt_leads_assigned_track amlat ON md.id = amlat.md_drop_option_id where amlat.practitioner_id = a.assigned_practitioner_id and amlat.customer_id = a.customer_id ORDER BY amlat.created_at DESC LIMIT 1) mdDropOptionName,
(SELECT sum(t.track_score) from ag_mkt_leads_assigned_track t where t.leads_assigned_id = a.id) scoreTotal , (SELECT sum(t.track_score) from ag_mkt_leads_assigned_track t where t.leads_assigned_id = a.id) scoreTotal ,
(SELECT sum(t.track_score) from ag_mkt_leads_assigned_track t where t.leads_assigned_id = a.id and to_days(track_time) = to_days(now())) scoreDay, (SELECT sum(t.track_score) from ag_mkt_leads_assigned_track t where t.leads_assigned_id = a.id and to_days(track_time) = to_days(now())) scoreDay,
if(ass.id is null ,0,1) expertType if(ass.id is null ,0,1) expertType ,
p.remark remark,
p.appointment_record_id appointmentRecordId,
p.sfp_main_id sfpMainId,
c.wechat_no wechatNo
FROM FROM
ag_mkt_leads_assigneds a ag_mkt_leads_assigneds a
left join ag_mkt_leads_expert_request r on r.customer_id = a.customer_id and r.is_active =1 left join ag_mkt_leads_expert_request r on r.customer_id = a.customer_id and r.is_active =1
left join ag_mkt_leads_expert_assign ass on ass.leads_expert_request_id = r.id and ass.is_active =1 left join ag_mkt_leads_expert_assign ass on ass.leads_expert_request_id = r.id and ass.is_active =1
left join ag_mkt_leads_pool p ON p.customer_id = a.customer_id and p.is_active =1 left join ag_mkt_leads_pool p ON p.customer_id = a.customer_id and p.is_active =1 and p.sfp_main_id = a.sfp_main_id
left join ag_acl_customer c ON c.id = a.customer_id left join ag_acl_customer c ON c.id = a.customer_id
where a.is_active=1 where a.is_active=1
<if test="practitionerId != null"> <if test="practitionerId != null">
......
...@@ -209,7 +209,6 @@ ...@@ -209,7 +209,6 @@
</select> </select>
<sql id="queryLifecommissionList"> <sql id="queryLifecommissionList">
(SELECT o.id orderId, (SELECT o.id orderId,
IFNULL(o.plan_id,b.plan_id) plan_id, IFNULL(o.plan_id,b.plan_id) plan_id,
IFNULL(o.product_id,b.product_id) product_id, IFNULL(o.product_id,b.product_id) product_id,
...@@ -255,14 +254,16 @@ ...@@ -255,14 +254,16 @@
union all union all
<include refid="manualCommission"/> <include refid="manualCommission"/>
) t ) t
left join ag_acl_insurer_branch ib on t.insurer_branch_id = ib.id <!--
left join ag_acl_insurer_branch ib on t.insurer_branch_id = ib.id
left join ag_acl_insurer i ON t.insurer_id = i.id left join ag_acl_insurer i ON t.insurer_id = i.id
left join ag_po_order_commission_check c on t.commission_check_id = c.id
left join ag_product_plan a on t.plan_id = a.id left join ag_product_plan a on t.plan_id = a.id
left join ag_product p on t.product_id = p.id left join ag_product p on t.product_id = p.id
left join ag_acl_life_insurance_practitioner l on l.order_id = t.orderId and l.practitioner_id = practitioner.id
-->
left join ag_po_order_commission_check c on t.commission_check_id = c.id
left join ag_acl_practitioner practitioner on t.broker_customer_id = practitioner.customer_id left join ag_acl_practitioner practitioner on t.broker_customer_id = practitioner.customer_id
left join ag_acl_practitioner_setting setting on setting.practitioner_id = practitioner.id left join ag_acl_practitioner_setting setting on setting.practitioner_id = practitioner.id
left join ag_acl_life_insurance_practitioner l on l.order_id = t.orderId and l.practitioner_id = practitioner.id
where 1=1 where 1=1
<if test="startDate != null "> <if test="startDate != null ">
and date_format(t.commissionYear, '%Y-%m') &gt;= #{startDate} and date_format(t.commissionYear, '%Y-%m') &gt;= #{startDate}
......
...@@ -22,11 +22,16 @@ ...@@ -22,11 +22,16 @@
<result column="informed_oss_path" jdbcType="VARCHAR" property="informedOssPath" /> <result column="informed_oss_path" jdbcType="VARCHAR" property="informedOssPath" />
<result column="informed_id" jdbcType="BIGINT" property="informedId" /> <result column="informed_id" jdbcType="BIGINT" property="informedId" />
<result column="informed_status" jdbcType="VARCHAR" property="informedStatus" /> <result column="informed_status" jdbcType="VARCHAR" property="informedStatus" />
<result column="sfp_main_id" jdbcType="BIGINT" property="sfpMainId" />
<result column="task_time_from" jdbcType="VARCHAR" property="taskTimeFrom" />
<result column="task_time_end" jdbcType="VARCHAR" property="taskTimeEnd" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, order_id, order_no, sales_notice, is_active, created_at, created_by, creator_type, id, order_id, order_no, sales_notice, is_active, created_at, created_by, creator_type,
updated_at, updated_by, updator_type, practitioner_id, customer_id, md_drop_option_id, updated_at, updated_by, updator_type, practitioner_id, customer_id, md_drop_option_id,
track_score, leads_assigned_id,track_time,informed_oss_path,informed_id,informed_status track_score, leads_assigned_id,track_time,informed_oss_path,informed_id,informed_status,
sfp_main_id,task_time_from,task_time_end
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select select
...@@ -116,6 +121,15 @@ ...@@ -116,6 +121,15 @@
<if test="informedStatus != null"> <if test="informedStatus != null">
informed_status, informed_status,
</if> </if>
<if test="sfpMainId != null">
sfp_main_id,
</if>
<if test="taskTimeFrom != null">
task_time_from,
</if>
<if test="taskTimeEnd != null">
task_time_end,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null"> <if test="orderId != null">
...@@ -178,6 +192,15 @@ ...@@ -178,6 +192,15 @@
<if test="informedStatus != null"> <if test="informedStatus != null">
#{informedStatus,jdbcType=VARCHAR}, #{informedStatus,jdbcType=VARCHAR},
</if> </if>
<if test="sfpMainId != null">
#{sfpMainId,jdbcType=BIGINT},
</if>
<if test="taskTimeFrom != null">
#{taskTimeFrom,jdbcType=VARCHAR},
</if>
<if test="taskTimeEnd != null">
#{taskTimeEnd,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.marketing.MktLeadsAssignedTrack"> <update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.marketing.MktLeadsAssignedTrack">
...@@ -240,6 +263,15 @@ ...@@ -240,6 +263,15 @@
<if test="informedId != null"> <if test="informedId != null">
leads_assigned_id = #{informedId,jdbcType=BIGINT}, leads_assigned_id = #{informedId,jdbcType=BIGINT},
</if> </if>
<if test="sfpMainId != null">
sfp_main_id = #{sfpMainId,jdbcType=BIGINT},
</if>
<if test="taskTimeFrom != null">
task_time_from = #{taskTimeFrom,jdbcType=VARCHAR},
</if>
<if test="taskTimeEnd != null">
task_time_end = #{taskTimeEnd,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
...@@ -319,6 +351,9 @@ ...@@ -319,6 +351,9 @@
<if test="trackTime != null"> <if test="trackTime != null">
and track_time = #{trackTime,jdbcType=TIMESTAMP} and track_time = #{trackTime,jdbcType=TIMESTAMP}
</if> </if>
<if test="sfpMainId != null">
and sfp_main_id = #{sfpMainId,jdbcType=BIGINT}
</if>
</where> </where>
</select> </select>
<select id="findByTrackTimeForNew" resultMap="BaseResultMap"> <select id="findByTrackTimeForNew" resultMap="BaseResultMap">
...@@ -423,4 +458,11 @@ ...@@ -423,4 +458,11 @@
set customer_id = #{customerId,jdbcType=BIGINT} set customer_id = #{customerId,jdbcType=BIGINT}
where leads_assigned_id = #{leadsAssignedId,jdbcType=BIGINT} where leads_assigned_id = #{leadsAssignedId,jdbcType=BIGINT}
</update> </update>
</mapper>
\ No newline at end of file <update id="updateAppointmentRecord" parameterType="com.yd.dal.entity.marketing.AgSfpAppointmentRecord">
update ag_sfp_appointment_record
set status = 1,is_complete = 1,updated_at = now()
where sfp_main_id = #{sfpMainId,jdbcType=BIGINT}
</update>
</mapper>
...@@ -19,11 +19,13 @@ ...@@ -19,11 +19,13 @@
<result column="created_by" jdbcType="BIGINT" property="createdBy" /> <result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" /> <result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
<result column="sfp_main_id" jdbcType="BIGINT" property="sfpMainId" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, assigned_practitioner_id, customer_id, FYP, FYC, time_to_close, pieces, remark, id, assigned_practitioner_id, customer_id, FYP, FYC, time_to_close, pieces, remark,
is_active, created_at, created_by, updated_at, updated_by is_active, created_at, created_by, updated_at, updated_by,sfp_main_id
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
...@@ -309,4 +311,4 @@ ...@@ -309,4 +311,4 @@
where t.md_drop_option_id = #{dropOptionsId,jdbcType=BIGINT} where t.md_drop_option_id = #{dropOptionsId,jdbcType=BIGINT}
and a.id = t.leads_assigned_id) and a.id = t.leads_assigned_id)
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -13,11 +13,15 @@ ...@@ -13,11 +13,15 @@
<result column="is_active" jdbcType="INTEGER" property="isActive" /> <result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="added_at" jdbcType="TIMESTAMP" property="addedAt" /> <result column="added_at" jdbcType="TIMESTAMP" property="addedAt" />
<result column="added_by" jdbcType="BIGINT" property="addedBy" /> <result column="added_by" jdbcType="BIGINT" property="addedBy" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="appointment_record_id" jdbcType="BIGINT" property="appointmentRecordId" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, customer_id, mkt_campaign, mkt_task, has_assigned, source_from, is_active, id, customer_id, mkt_campaign, mkt_task, has_assigned, source_from, is_active,
added_at, added_by added_at, added_by,remark,appointment_record_id
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
...@@ -262,4 +266,25 @@ ...@@ -262,4 +266,25 @@
INNER JOIN ag_mkt_leads_assigned_track tr on maxt.customer_id=tr.customer_id AND maxt.track_time = tr.updated_at order by tr.leads_assigned_id INNER JOIN ag_mkt_leads_assigned_track tr on maxt.customer_id=tr.customer_id AND maxt.track_time = tr.updated_at order by tr.leads_assigned_id
</select> </select>
</mapper>
\ No newline at end of file <select id="findByCustomerIdForSfp" resultType="com.yd.dal.entity.marketing.MktLeadsPool">
select
a.id, a.customer_id customerId, a.mkt_campaign mktCampaign, a.mkt_task mktTask, a.has_assigned hasAssigned, a.source_from sourceFrom,
a.is_active isActive,c.mobile mobile,
a.added_at addedAt, a.added_by addedBy,a.remark remark,a.appointment_record_id appointmentRecordId,b.sfp_main_id sfpMainId ,c.wx_open_id wxOpenId
from ag_mkt_leads_pool a , ag_sfp_appointment_record b , ag_sfp_user c
where a.appointment_record_id=b.id and b.user_id=c.id
and b.status = 0 and b.is_complete =0
and a.customer_id = #{customerId,jdbcType=BIGINT}
and a.appointment_record_id is not null
and a.is_active=1
</select>
<select id="findBySfpMainId" resultType="com.yd.dal.entity.marketing.MktLeadsPool">
select t.id id, t.customer_id customerId, t.mkt_campaign mktCampaign, t.mkt_task mktTask, t.has_assigned hasAssigned, t.source_from sourceFrom,
t.is_active isActive,t.added_at addedAt, t.added_by addedBy,t.remark remark,t.appointment_record_id appointmentRecordId,m.user_id sfpUserId
from ag_mkt_leads_pool t,ag_sfp_main m
where t.sfp_main_id =m.id and t.sfp_main_id = #{customerId,jdbcType=BIGINT}
and t.is_active=1
</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