Commit d64b5853 by hongzhong

Merge remote-tracking branch 'origin/dev_20210330' into dev_20210330

parents 6e8c844f 38ef5764
...@@ -3612,16 +3612,33 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -3612,16 +3612,33 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
CommonResultIDResponseVO resp = new CommonResultIDResponseVO(); CommonResultIDResponseVO resp = new CommonResultIDResponseVO();
try { try {
// 先判断传入的客户姓名和客户电话与传入的customerId是否一致 // 先判断传入的客户姓名和客户电话与传入的customerId是否一致
AclCustomer aclCustomer = aclCustomerDALService.findById(requestVO.getCustomerId()); AclCustomer oldCustomer = aclCustomerDALService.findById(requestVO.getCustomerId());
String customerName = requestVO.getCustomerName(); String newName = requestVO.getCustomerName();
String customerMobile = requestVO.getCustomerMobile(); String newMobile = requestVO.getCustomerMobile();
if (!customerMobile.equals(aclCustomer.getMobileNo())) {
}
// 数据库实体 // 数据库实体
AclCustomer newerCustomer = aclCustomerDALService.findByMobileNo(newMobile);
if (newerCustomer == null) {
// 注册
RegisterRequestVO registerRequestVO = new RegisterRequestVO();
registerRequestVO.setMobileNo(newName);
registerRequestVO.setName(newMobile);
//将增员对象进行注册
RegisterResponseVO registerResp = customerService.register(registerRequestVO);
newerCustomer = new AclCustomer();
newerCustomer.setId(registerResp.getCustomerId());
}
if (!newMobile.equals(oldCustomer.getMobileNo()) || !newName.equals(oldCustomer.getName())) {// 如果电话不一样,就更新商机的电话
MktLeadsAssigneds mktLeadsAssigneds = new MktLeadsAssigneds();
mktLeadsAssigneds.setId(requestVO.getLeadsAssignedId());
mktLeadsAssigneds.setCustomerMobile(newMobile);
mktLeadsAssigneds.setCustomerName(newName);
mktLeadsAssigneds.setCustomerId(newerCustomer.getId());
mktLeadsAssignedsMapper.updateByPrimaryKeySelective(mktLeadsAssigneds);
}
AgPoInformed informed = new AgPoInformed(); AgPoInformed informed = new AgPoInformed();
BeanUtils.copyProperties(requestVO, informed); BeanUtils.copyProperties(requestVO, informed);
informed.setCustomerId(aclCustomer.getId()); informed.setCustomerId(newerCustomer.getId());
informed.setStatus("0"); informed.setStatus("0");
informed.setIsActive(1); informed.setIsActive(1);
...@@ -3637,7 +3654,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -3637,7 +3654,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
// 商机更新一条告知书待签署的记录 // 商机更新一条告知书待签署的记录
MktLeadsAssignedTrack track = new MktLeadsAssignedTrack(); MktLeadsAssignedTrack track = new MktLeadsAssignedTrack();
track.setCustomerId(requestVO.getLeadsAssignedId()); track.setCustomerId(newerCustomer.getId());// 商机的id还是得用旧的customerId
track.setLeadsAssignedId(requestVO.getLeadsAssignedId());
track.setTrackTime(curDate); track.setTrackTime(curDate);
track.setCreatedBy(loginId); track.setCreatedBy(loginId);
track.setCreatedAt(new Date()); track.setCreatedAt(new Date());
...@@ -3645,20 +3663,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -3645,20 +3663,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
track.setUpdatedBy(loginId); track.setUpdatedBy(loginId);
track.setUpdatorType(1); track.setUpdatorType(1);
track.setUpdatedAt(new Date()); track.setUpdatedAt(new Date());
MdDropOptions dropOption = systemConfigService.getDropOption("action_code", "customerNotice_0"); MdDropOptions dropOption = systemConfigService.getDropOption("bizchance_promotion_action", "customerNotice_0");
track.setMdDropOptionId(dropOption.getId()); track.setMdDropOptionId(dropOption.getId());
track.setTrackScore(dropOption.getDropOptionScore()); track.setTrackScore(dropOption.getDropOptionScore());
//保存 //保存
mktLeadsAssignedTrackDALService.saveTrack(track); mktLeadsAssignedTrackDALService.saveTrack(track);
// 如果名字不一样,就更新商机的名字
// if () {
// AclCustomer customer = aclCustomerDALService.findById(requestVO.getCustomerId());
// }
// MktLeadsAssigneds mktLeadsAssigneds = new MktLeadsAssigneds();
// mktLeadsAssigneds
// mktLeadsAssignedsMapper.updateByPrimaryKeySelective();
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
resp.setId(informed.getId()); resp.setId(informed.getId());
} catch (Exception e) { } catch (Exception e) {
...@@ -3742,17 +3752,18 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -3742,17 +3752,18 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
informed.setStatus("1"); informed.setStatus("1");
informedMapper.updateByPrimaryKeySelective(informed); informedMapper.updateByPrimaryKeySelective(informed);
// 商机更新一条告知书签署的记录 // 商机更新一条告知书签署的记录
MktLeadsAssignedTrack track = new MktLeadsAssignedTrack(); MktLeadsAssignedTrack track = new MktLeadsAssignedTrack();
track.setCustomerId(informed.getLeadsId()); track.setInformedId(id);
track.setCustomerId(informed.getCustomerId());
track.setTrackTime(curDate); track.setTrackTime(curDate);
track.setCreatedBy(informed.getLeadsId()); track.setCreatedBy(-1L);
track.setCreatedAt(curDate); track.setCreatedAt(curDate);
track.setCreatorType(1); track.setCreatorType(1);
track.setUpdatedBy(informed.getLeadsId()); track.setUpdatedBy(-1L);
track.setUpdatorType(1); track.setUpdatorType(1);
track.setUpdatedAt(new Date()); track.setUpdatedAt(new Date());
MdDropOptions dropOption = systemConfigService.getDropOption("action_code", "customerNotice_1"); MdDropOptions dropOption = systemConfigService.getDropOption("bizchance_promotion_action", "customerNotice_1");
track.setMdDropOptionId(dropOption.getId()); track.setMdDropOptionId(dropOption.getId());
track.setTrackScore(dropOption.getDropOptionScore()); track.setTrackScore(dropOption.getDropOptionScore());
//保存 //保存
...@@ -3765,15 +3776,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -3765,15 +3776,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
@Override @Override
public void run() { public void run() {
AgPoInformed informed = informedMapper.selectByPrimaryKey(requestVO.getId());
if (informed != null) { if (informed != null) {
Long informedId = informed.getId();
String templatePDF = PDFConfiguration.getProperty("informed.pdf.template"); String templatePDF = PDFConfiguration.getProperty("informed.pdf.template");
//模板文件生成临时文件目录 //模板文件生成临时文件目录
String tmpPathPDF = PDFConfiguration.getProperty("informed.pdf.temp.path"); String tmpPathPDF = PDFConfiguration.getProperty("informed.pdf.temp.path");
//PDF模板输出结果文件 //PDF模板输出结果文件
String templateResultPDF = tmpPathPDF + informed.getId() + "-signedInformed.pdf"; String templateResultPDF = tmpPathPDF + informedId + "-signedInformed.pdf";
//填充数据 //填充数据
Map<String, String> initDatas = new HashMap<>(); Map<String, String> initDatas = new HashMap<>();
...@@ -3788,12 +3799,16 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -3788,12 +3799,16 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//按模板填充数据生成结果PDF //按模板填充数据生成结果PDF
PDFTemplate.generatePDF(templatePDF, templateResultPDF, initDatas, initImages); PDFTemplate.generatePDF(templatePDF, templateResultPDF, initDatas, initImages);
try { try {
//上传至oss ossService //上传至oss ossService
String ossPath = this.putContractFileToOSS("informed", templateResultPDF, informed.getId()); String ossPath = this.putContractFileToOSS("informed", templateResultPDF, informedId);
informed.setInformedOssPath(ossPath); informed.setInformedOssPath(ossPath);
informedMapper.updateByPrimaryKeySelective(informed); informedMapper.updateByPrimaryKeySelective(informed);
//更新track
mktLeadsAssignedTrackDALService.updateInformedOssPathByInformedId(ossPath, informedId);
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -9,4 +9,11 @@ public class QueryInformedSheetListRequestVO { ...@@ -9,4 +9,11 @@ public class QueryInformedSheetListRequestVO {
private String customerMobile; private String customerMobile;
private String policyNo; private String policyNo;
private String signDate; private String signDate;
/**
* 系统标志,区分公司营业部和体系,1,分公司,2营业部,3,S1分部,4,S2体系,5,S3纵队
*/
private String systemFlag;
private Long s3Id;
private Long s2Id;
private Long s1Id;
} }
package com.yd.dal.entity.marketing; package com.yd.dal.entity.marketing;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data;
/** /**
* ag_mkt_leads_assigned_track * ag_mkt_leads_assigned_track
...@@ -96,6 +97,14 @@ public class MktLeadsAssignedTrack implements Serializable { ...@@ -96,6 +97,14 @@ public class MktLeadsAssignedTrack implements Serializable {
* 关联ag_mkt_schedule_task_tracking.id 日程表 * 关联ag_mkt_schedule_task_tracking.id 日程表
*/ */
private Long scheduleTaskTrackingId; private Long scheduleTaskTrackingId;
/**
* 告知书记录Id
*/
private Long informedId;
/**
* 告知书url
*/
private String informedOssPath;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
package com.yd.dal.entity.marketing; package com.yd.dal.entity.marketing;
import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import lombok.Data;
/** /**
* 商机线索指派表 * 商机线索指派表
...@@ -24,6 +25,14 @@ public class MktLeadsAssigneds { ...@@ -24,6 +25,14 @@ public class MktLeadsAssigneds {
* 经纪人商机对应的客户id * 经纪人商机对应的客户id
*/ */
private Long customerId; private Long customerId;
/**
* 客户姓名
*/
private String customerName;
/**
* 客户电话
*/
private String customerMobile;
/** /**
* 首年保费 * 首年保费
......
package com.yd.dal.entity.meta; package com.yd.dal.entity.meta;
import java.util.Date;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data @Data
public class MdDropOptions { public class MdDropOptions implements Serializable {
/** /**
* 选项编号 * 选项编号
*/ */
......
...@@ -33,4 +33,6 @@ public interface MktLeadsAssignedTrackMapper { ...@@ -33,4 +33,6 @@ public interface MktLeadsAssignedTrackMapper {
List<SalesScoreDetail> getSalesScoreDetailByPractitionerId(@Param("practitionerId") Long practitionerId,@Param("time") String time); List<SalesScoreDetail> getSalesScoreDetailByPractitionerId(@Param("practitionerId") Long practitionerId,@Param("time") String time);
void deleteScheduleTrackById(Long scheduleTrackId); void deleteScheduleTrackById(Long scheduleTrackId);
int updateInformedOssPathByInformedId(@Param("informedOssPath") String InformedOssPath, @Param("informedId") Long informedId);
} }
\ No newline at end of file
...@@ -60,4 +60,9 @@ public class MktLeadsAssignedTrackDALServiceImpl implements MktLeadsAssignedTrac ...@@ -60,4 +60,9 @@ public class MktLeadsAssignedTrackDALServiceImpl implements MktLeadsAssignedTrac
public void deleteScheduleTrackById(Long scheduleTrackId) { public void deleteScheduleTrackById(Long scheduleTrackId) {
mktLeadsAssignedTrackMapper.deleteScheduleTrackById(scheduleTrackId); mktLeadsAssignedTrackMapper.deleteScheduleTrackById(scheduleTrackId);
} }
@Override
public int updateInformedOssPathByInformedId(String ossPath, Long informedId) {
return mktLeadsAssignedTrackMapper.updateInformedOssPathByInformedId(ossPath, informedId);
}
} }
...@@ -34,4 +34,6 @@ public interface MktLeadsAssignedTrackDALService { ...@@ -34,4 +34,6 @@ public interface MktLeadsAssignedTrackDALService {
List<SalesScoreDetail> getSalesScoreDetailByPractitionerId(Long practitionerId, String time); List<SalesScoreDetail> getSalesScoreDetailByPractitionerId(Long practitionerId, String time);
void deleteScheduleTrackById(Long scheduleTrackId); void deleteScheduleTrackById(Long scheduleTrackId);
int updateInformedOssPathByInformedId(String ossPath, Long informedId);
} }
...@@ -182,6 +182,9 @@ ...@@ -182,6 +182,9 @@
<if test="signDate != null"> <if test="signDate != null">
sign_date = #{signDate,jdbcType=VARCHAR}, sign_date = #{signDate,jdbcType=VARCHAR},
</if> </if>
<if test="signOssPath != null">
sign_oss_path = #{signOssPath,jdbcType=VARCHAR},
</if>
<if test="status != null"> <if test="status != null">
`status` = #{status,jdbcType=VARCHAR}, `status` = #{status,jdbcType=VARCHAR},
</if> </if>
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<result column="track_score" jdbcType="INTEGER" property="trackScore" /> <result column="track_score" jdbcType="INTEGER" property="trackScore" />
<result column="leads_assigned_id" jdbcType="BIGINT" property="leadsAssignedId" /> <result column="leads_assigned_id" jdbcType="BIGINT" property="leadsAssignedId" />
<result column="track_time" jdbcType="TIMESTAMP" property="trackTime" /> <result column="track_time" jdbcType="TIMESTAMP" property="trackTime" />
<result column="informed_oss_path" jdbcType="VARCHAR" property="informedOssPath" />
</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,
...@@ -104,6 +105,9 @@ ...@@ -104,6 +105,9 @@
<if test="scheduleTaskTrackingId != null"> <if test="scheduleTaskTrackingId != null">
schedule_task_tracking_id, schedule_task_tracking_id,
</if> </if>
<if test="informedId != null">
informed_id,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null"> <if test="orderId != null">
...@@ -157,6 +161,9 @@ ...@@ -157,6 +161,9 @@
<if test="scheduleTaskTrackingId != null"> <if test="scheduleTaskTrackingId != null">
#{scheduleTaskTrackingId,jdbcType=BIGINT}, #{scheduleTaskTrackingId,jdbcType=BIGINT},
</if> </if>
<if test="informedId != null">
#{informedId,jdbcType=BIGINT},
</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">
...@@ -383,4 +390,9 @@ ...@@ -383,4 +390,9 @@
delete from ag_mkt_leads_assigned_track delete from ag_mkt_leads_assigned_track
where schedule_task_tracking_id = #{scheduleTrackId,jdbcType=BIGINT} where schedule_task_tracking_id = #{scheduleTrackId,jdbcType=BIGINT}
</delete> </delete>
<update id="updateInformedOssPathByInformedId">
update ag_mkt_leads_assigned_track
set informed_oss_path = #{informedOssPath,jdbcType=VARCHAR}
where informed_id = #{informedId,jdbcType=BIGINT}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
<result column="time_to_close" jdbcType="TIMESTAMP" property="timeToClose" /> <result column="time_to_close" jdbcType="TIMESTAMP" property="timeToClose" />
<result column="pieces" jdbcType="INTEGER" property="pieces" /> <result column="pieces" jdbcType="INTEGER" property="pieces" />
<result column="remark" jdbcType="LONGVARCHAR" property="remark" /> <result column="remark" jdbcType="LONGVARCHAR" property="remark" />
<result column="customer_name" jdbcType="VARCHAR" property="customerName" />
<result column="customer_mobile" jdbcType="VARCHAR" property="customerMobile" />
<result column="is_active" jdbcType="INTEGER" property="isActive" /> <result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" /> <result column="created_by" jdbcType="BIGINT" property="createdBy" />
...@@ -168,6 +170,12 @@ ...@@ -168,6 +170,12 @@
<if test="updatedBy != null"> <if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT}, updated_by = #{updatedBy,jdbcType=BIGINT},
</if> </if>
<if test="customerName != null">
customer_name = #{customerName,jdbcType=VARCHAR},
</if>
<if test="customerMobile != null">
customer_mobile = #{customerMobile,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
......
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