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 {
}
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")));
return resp;
}
......
......@@ -688,7 +688,7 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
} else {
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 {
logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》电子报聘聘退回发送短信电话号码不存在");
logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》" + name + ": " + mobileNo);
......@@ -923,6 +923,6 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
messageText.append("的电子报聘流程线上审批已经通过,请尽快帮助完成该报聘人的经纪人执业登记,并在AGMS 里更新并生成电子合同。谢谢!");
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 {
messageText.append("来佣比对已退保,请知悉");
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) {
......
......@@ -863,7 +863,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
templateCode = smsParam.get(mobileNo).get(0);
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);
}
}
}
......
......@@ -22,6 +22,7 @@ import com.yd.dal.service.meta.MdDropOptionsDALService;
import com.yd.rmi.n22.salary.pojo.Achieve;
import com.yd.util.CommonUtil;
import com.yd.util.config.ZHBErrorConfig;
import com.yd.util.deshandler.DESTypeHandler;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -228,6 +229,13 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
// 获取optionName
optionName = taskTypeMap.get(schedule.getMdDropOptionId()).getDropOptionName();
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);
}
}
......
......@@ -61,5 +61,6 @@ public class OpportunityBasicInformationInfo {
*/
private String timeToClose;
private List<OpportunityCustomerTag> opportunityCustomerTags;
private Long sfpUserId;
}
......@@ -25,4 +25,8 @@ public class OpportunityRecordInfo {
* 告知书签署状态
*/
private String status;
private Long sfpMainId;//sfp商家专用
private String taskTimeFrom;//跟进开始时间
private String taskTimeEnd;//跟进结束时间
}
......@@ -7,4 +7,7 @@ public class OwnOpportunityDetailQueryRequestVO {
private Long practitionerId;
private Long opportunityId;//商机Id,客户的customerId
private Long orderId;
private Long sfpMainId;//sfp商家专用
private String taskTimeFrom;//跟进开始时间
private String taskTimeEnd;//跟进结束时间
}
......@@ -12,4 +12,9 @@ public class OwnOpportunityRecordSaveRequestVO {
private Long mdDropOptionId;
private String noticeDate;
private Long leadsAssignedId;
private String taskTimeFrom;//跟进开始时间
private String taskTimeEnd;//跟进结束时间
private Long sfpMainId;
}
......@@ -29,6 +29,6 @@ public class ScheduleTrackVO {
private String name;
private String mobileNo;
private Integer trackScore;
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
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 {
*/
private String informedStatus;
private Long sfpMainId;
private String taskTimeFrom;//跟进开始时间
private String taskTimeEnd;//跟进结束时间
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
}
......@@ -15,7 +15,7 @@ public class MktLeadsAssigneds {
* serial id
*/
private Long id;
private Long sfpMainId;
/**
* 经纪人id
*/
......@@ -83,4 +83,4 @@ public class MktLeadsAssigneds {
* 更新者 FK ag_acl_user.id
*/
private Long updatedBy;
}
\ No newline at end of file
}
......@@ -54,4 +54,11 @@ public class MktLeadsPool {
private Long addedBy;
private Integer adderType;
}
\ No newline at end of file
private String remark;//备注
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 {
private Double scoreDay;
private Double scoreTotal;
private Long expertType;//0.经纪人指派 1.专家指派
}
\ No newline at end of file
private Long sfpMainId;
private String wechatNo;
}
......@@ -22,6 +22,8 @@ public interface AclCustomerMapper {
AclCustomer findByMobileNo(String mobileNo);
AclCustomer findByWeChatNo(String weChatNo);
List<AclCustomer> findByIds(@Param("customerIds") List<Long> customerIds);
List<AclCustomer> findByObj(AclCustomer aclCustomer);
......
......@@ -2,6 +2,7 @@ package com.yd.dal.mapper.marketing;
import com.github.pagehelper.Page;
import com.yd.api.practitioner.vo.opportunity.SalesScoreDetail;
import com.yd.dal.entity.marketing.AgSfpAppointmentRecord;
import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import org.apache.ibatis.annotations.Param;
......@@ -37,4 +38,7 @@ public interface MktLeadsAssignedTrackMapper {
int updateInformedOssPathByInformedId(@Param("informedOssPath") String InformedOssPath, @Param("informedId") Long informedId);
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 {
List<LeadsStatisticsInfo> findIsAssignLeads();
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 {
// ${name},您好!${name2}(S3纵队S2体系S1分部的XX)经纪人已提交报聘审批,请至“赢家平台>我的团队-报聘审批”进行查看审批,谢谢!
String templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_HiringApproveNotice");
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 {
logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》电子报聘审批人电话号码不存在");
throw new RuntimeException("电子报聘审批人电话号码不存在");
......
......@@ -32,6 +32,8 @@ public interface AclCustomerDALService {
AclCustomer findByCustomerId(Long customerId);
AclCustomer findByMobileNo(String mobileNo);
AclCustomer findByWeChatNo(String weChatNo);
List<AclCustomer> findByIds(List<Long> customerIds);
......
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 com.yd.util.deshandler.DESTypeHandler;
import org.springframework.stereotype.Service;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
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")
public class AclCustomerDALServiceImpl implements AclCustomerDALService {
......@@ -48,6 +45,11 @@ public class AclCustomerDALServiceImpl implements AclCustomerDALService {
}
@Override
public AclCustomer findByWeChatNo(String weChatNo) {
return aclCustomerMapper.findByWeChatNo(weChatNo);
}
@Override
public List<AclCustomer> findByIds(List<Long> customerIds) {
return aclCustomerMapper.findByIds(customerIds);
}
......
......@@ -3,6 +3,7 @@ package com.yd.dal.service.marketing.Impl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
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.mapper.marketing.MktLeadsAssignedTrackMapper;
import com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService;
......@@ -70,4 +71,10 @@ public class MktLeadsAssignedTrackDALServiceImpl implements MktLeadsAssignedTrac
public int updateCustomerIdByLeadsAssignedId(Long customerId, Long leadsAssignedId) {
return mktLeadsAssignedTrackMapper.updateCustomerIdByLeadsAssignedId(customerId, leadsAssignedId);
}
@Override
public void updateAppointmentRecord(AgSfpAppointmentRecord appointmentRecord) {
mktLeadsAssignedTrackMapper.updateAppointmentRecord(appointmentRecord);
}
}
......@@ -62,4 +62,14 @@ public class MktLeadsPoolDALServiceImpl implements MktLeadsPoolDALService {
public void updateMktLeadsAssigneds(MktLeadsPool 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;
import com.yd.api.practitioner.vo.opportunity.SalesScoreDetail;
import com.yd.dal.entity.marketing.AgSfpAppointmentRecord;
import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import java.math.BigDecimal;
......@@ -38,4 +39,6 @@ public interface MktLeadsAssignedTrackDALService {
int updateInformedOssPathByInformedId(String ossPath, Long informedId);
int updateCustomerIdByLeadsAssignedId(Long customerId, Long leadsAssignedId);
void updateAppointmentRecord(AgSfpAppointmentRecord appointmentRecord);
}
......@@ -21,4 +21,8 @@ public interface MktLeadsPoolDALService {
PageInfo<LeadsStatisticsInfo> findByConditionPage(int pageNum, int size, Integer isStatement, Integer leadsStatus, Integer expertApplyStatus, String leadsStartTime, String leadsEndTime);
void updateMktLeadsAssigneds(MktLeadsPool pool);
MktLeadsPool findByCustomerIdForSfp(Long customerId);
MktLeadsPool findBySfpMainId(Long sfpMainId);
}
......@@ -20,7 +20,7 @@ public interface SendService {
* @param useFor 该短信和邮件主要是为了什么发送的,1=订单 2=提现 3=客户意见 4=汽车问卷 5=活动 6=wordpress 7=生日快乐 99=其他'
* @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 {
*/
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 {
@Override
@Async("sendAsyncServiceExecutor")
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;
boolean sendResult = false;
if(CommonUtil.isNullOrBlank(category) || CommonUtil.isNullOrBlank(number) || CommonUtil.isNullOrBlank(type)){
......@@ -86,7 +86,7 @@ public class SendServiceImpl implements SendService {
boolean isCanSend = canSendForMobile(number);
if(isCanSend){
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);
failCount = Integer.parseInt(smsResult.get(1));
sendResult = Boolean.parseBoolean(smsResult.get(2));
......@@ -176,7 +176,7 @@ public class SendServiceImpl implements SendService {
} else {
AclCustomer customer = getCustomerInfo("sms", mobile);
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);
int failCount = Integer.parseInt(smsResult.get(1));
boolean sendResult = Boolean.parseBoolean(smsResult.get(2));
......@@ -250,7 +250,7 @@ public class SendServiceImpl implements SendService {
* @param subject
* @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<>();
String result = null;
int failCount = 0;
......@@ -261,13 +261,13 @@ public class SendServiceImpl implements SendService {
smsRecord.setTemplateCode(templateCode);
boolean smsResult = false;
while (!smsResult && (failCount < 4)){
SendSmsResponse response =aliSmsInterfService.sendSms(smsRecord,subject);
SendSmsResponse response =aliSmsInterfService.sendSms(source,smsRecord,subject);
result = response.getMessage();
if ("OK".equals(response.getCode())) {
smsResult = true;
}else{
failCount++;
System.out.println(">>>>>>>>>>>>第"+failCount+"次失败原因:"+response.getMessage());
LOGGER.info(">>>>>>>>>>>>第"+failCount+"次失败原因:"+response.getMessage());
}
}
resultInfo.add(result);
......
......@@ -6,6 +6,6 @@ import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.yd.dal.entity.sms.ShortMessageSendRecord;
public interface AliSmsInterfService {
public SendSmsResponse sendSms(ShortMessageSendRecord smsRecord, String signName);
public SendSmsResponse sendSms(String source,ShortMessageSendRecord smsRecord, String signName);
// public QuerySendDetailsResponse querySmsDetail(ShortMessageSendRecord smsRecord);
}
......@@ -38,13 +38,21 @@ public class AliSmsInterfServiceImpl implements AliSmsInterfService {
* @return SendSmsResponse
* @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.defaultReadTimeout", "10000");
//初始化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"));
IAcsClient acsClient = new DefaultAcsClient(profile);
......@@ -110,7 +118,7 @@ public class AliSmsInterfServiceImpl implements AliSmsInterfService {
* @return QuerySendDetailsResponse
*/
@Override
public SendSmsResponse sendSms(ShortMessageSendRecord smsRecord, String signName) {
public SendSmsResponse sendSms(String source,ShortMessageSendRecord smsRecord, String signName) {
String phoneNumber = smsRecord.getMobileNo();
String templateParam;
String outId = "ajb";
......@@ -139,8 +147,7 @@ public class AliSmsInterfServiceImpl implements AliSmsInterfService {
templateParam = smsRecord.getSmsContent();
}
try {
signName = (CommonUtil.isNullOrBlank(signName)) ? systemConfigService.getSingleConfigValue("ALI_SMS_SIGN_NAME") : signName;
sendSmsResponse = send(phoneNumber, signName, templateCode, templateParam, outId);
sendSmsResponse = send(source, phoneNumber, signName, templateCode, templateParam, outId);
smsRecord.setSendTime(new Date());
smsRecord.setSendStatus(sendSmsResponse.getCode());
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 @@
<include refid="Base_Column_List" />
from ag_acl_customer
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 id="findByIds" resultMap="BaseResultMap">
......
......@@ -1516,6 +1516,8 @@
<result column="scoreDay" property="scoreDay" />
<result column="scoreTotal" property="scoreTotal" />
<result column="expertType" property="expertType" />
<result column="sfpMainId" property="sfpMainId" />
<result column="wechatNo" property="wechatNo" />
</resultMap>
<select id="ownOpportunityQuery" resultMap="opportunityQuery">
SELECT
......@@ -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 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,
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
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_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
where a.is_active=1
<if test="practitionerId != null">
......
......@@ -209,7 +209,6 @@
</select>
<sql id="queryLifecommissionList">
(SELECT o.id orderId,
IFNULL(o.plan_id,b.plan_id) plan_id,
IFNULL(o.product_id,b.product_id) product_id,
......@@ -255,14 +254,16 @@
union all
<include refid="manualCommission"/>
) 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_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 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_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
<if test="startDate != null ">
and date_format(t.commissionYear, '%Y-%m') &gt;= #{startDate}
......
......@@ -22,11 +22,16 @@
<result column="informed_oss_path" jdbcType="VARCHAR" property="informedOssPath" />
<result column="informed_id" jdbcType="BIGINT" property="informedId" />
<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>
<sql id="Base_Column_List">
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,
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>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
......@@ -116,6 +121,15 @@
<if test="informedStatus != null">
informed_status,
</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 prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">
......@@ -178,6 +192,15 @@
<if test="informedStatus != null">
#{informedStatus,jdbcType=VARCHAR},
</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>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.marketing.MktLeadsAssignedTrack">
......@@ -240,6 +263,15 @@
<if test="informedId != null">
leads_assigned_id = #{informedId,jdbcType=BIGINT},
</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>
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -319,6 +351,9 @@
<if test="trackTime != null">
and track_time = #{trackTime,jdbcType=TIMESTAMP}
</if>
<if test="sfpMainId != null">
and sfp_main_id = #{sfpMainId,jdbcType=BIGINT}
</if>
</where>
</select>
<select id="findByTrackTimeForNew" resultMap="BaseResultMap">
......@@ -423,4 +458,11 @@
set customer_id = #{customerId,jdbcType=BIGINT}
where leads_assigned_id = #{leadsAssignedId,jdbcType=BIGINT}
</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 @@
<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="sfp_main_id" jdbcType="BIGINT" property="sfpMainId" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
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>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
......@@ -309,4 +311,4 @@
where t.md_drop_option_id = #{dropOptionsId,jdbcType=BIGINT}
and a.id = t.leads_assigned_id)
</select>
</mapper>
\ No newline at end of file
</mapper>
......@@ -13,11 +13,15 @@
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="added_at" jdbcType="TIMESTAMP" property="addedAt" />
<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>
<sql id="Base_Column_List">
<!--@mbg.generated-->
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>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
......@@ -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
</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