Commit 8e3a73d8 by yao.xiao

增加-经纪人更新/创建自己商机信息

parent 82003a8d
......@@ -2,11 +2,28 @@ package com.yd.api.practitioner.vo.opportunity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class OwnOpportunityBasicInformationSaveRequestVO {
/**
* 商机对象customerId
*/
private Long opportunityId;
/**
* 经纪人id
*/
private Long assignedPractitionerId;
/**
* 手机号码
*/
private String mobileNo;
/**
* 商机id
*/
private Long leadsAssignedId;
private String name;
private String birthDate;
private String sourceChannel;
......@@ -15,5 +32,41 @@ public class OwnOpportunityBasicInformationSaveRequestVO {
private String otherContacts;//其他类型方式
private String address;
private Long age;
/**
* 首年保费
*/
private BigDecimal fyp;
/**
* 首年佣金
*/
private BigDecimal fyc;
/**
* 预计成交时间
*/
private String timeToClose;
/**
* 线索预计件数
*/
private Integer pieces;
/**
* FK ag_md_drop_options.id 商机星座类型
*/
private Integer zodiacTypeId;
/**
* FK ag_md_drop_options.id 商机血型类型
*/
private Integer bloodTypeId;
/**
* 经纪人输入商机来源类型
*/
private Integer sourceFrom;
/**
* 备注
*/
private String remark;
private List<OpportunityCustomerTag> opportunityCustomerTags;
}
package com.yd.dal.entity.customer;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* ag_acl_customer
* @author
* Customer List 客戶
*/
@Data
public class AclCustomer implements Serializable {
public class AclCustomer {
private static final long serialVersionUID = 1L;
/**
* serial id
*/
......@@ -243,6 +242,16 @@ public class AclCustomer implements Serializable {
private String sourceChannel;
/**
* FK ag_md_drop_options.id 商机星座类型
*/
private Integer zodiacTypeId;
/**
* FK ag_md_drop_options.id 商机血型类型
*/
private Integer bloodTypeId;
/**
* 活动
*/
private String mktCampaign;
......@@ -281,6 +290,4 @@ public class AclCustomer implements Serializable {
* 年龄
*/
private Long age;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.entity.marketing;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* ag_mkt_leads_assigneds
* @author
* 商机线索指派表
*/
@Data
public class MktLeadsAssigneds implements Serializable {
public class MktLeadsAssigneds {
private static final long serialVersionUID = 1L;
/**
* serial id
*/
......@@ -42,6 +41,16 @@ public class MktLeadsAssigneds implements Serializable {
private Date timeToClose;
/**
* 线索预计件数
*/
private Integer pieces;
/**
* 备注
*/
private String remark;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
......@@ -65,6 +74,4 @@ public class MktLeadsAssigneds implements Serializable {
* 更新者 FK ag_acl_user.id
*/
private Long updatedBy;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.entity.marketing;
import java.util.Date;
import lombok.Data;
/**
* 线索添加池
*/
@Data
public class MktLeadsPool {
/**
* serial id
*/
private Long id;
/**
* 客户id
*/
private Long customerId;
/**
* 活动
*/
private String mktCampaign;
/**
* 活动任务
*/
private String mktTask;
/**
* 0=No, 1=Yes,是否已指派
*/
private Integer hasAssigned;
/**
* FK ag_md_drop_options.id 经纪人输入商机来源类型
*/
private Integer sourceFrom;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 分析建置时间
*/
private Date addedAt;
/**
* 建置者 FK ag_acl_user.id
*/
private Long addedBy;
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclCustomer;
import java.util.List;
import com.yd.dal.entity.customer.AclCustomer;import java.util.List;
public interface AclCustomerMapper {
int deleteByPrimaryKey(Long id);
......@@ -18,4 +16,6 @@ public interface AclCustomerMapper {
int updateByPrimaryKey(AclCustomer record);
List<AclCustomer> findByLogin(String mobileNo);
AclCustomer findByMobileNo(String mobileNo);
}
\ No newline at end of file
package com.yd.dal.mapper.marketing;
import com.yd.dal.entity.marketing.MktLeadsAssigneds;
import com.yd.dal.entity.marketing.MktLeadsAssigneds;import java.util.List;
public interface MktLeadsAssignedsMapper {
int deleteByPrimaryKey(Long id);
......@@ -15,5 +15,5 @@ public interface MktLeadsAssignedsMapper {
int updateByPrimaryKey(MktLeadsAssigneds record);
MktLeadsAssigneds findByMktLeadsAssigneds(MktLeadsAssigneds mktLeadsAssigneds);
List<MktLeadsAssigneds> findByMktLeadsAssigneds(MktLeadsAssigneds mktLeadsAssigneds);
}
\ No newline at end of file
package com.yd.dal.mapper.marketing;
import com.yd.dal.entity.marketing.MktLeadsPool;
public interface MktLeadsPoolMapper {
int deleteByPrimaryKey(Long id);
int insert(MktLeadsPool record);
int insertSelective(MktLeadsPool record);
MktLeadsPool selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(MktLeadsPool record);
int updateByPrimaryKey(MktLeadsPool record);
MktLeadsPool findByCustomerId(Long customerId);
}
\ No newline at end of file
......@@ -30,5 +30,7 @@ public interface AclCustomerDALService {
void save(AclCustomer aclCustomer);
AclCustomer findByCustomerId(Long customerId);
AclCustomer findByMobileNo(String mobileNo);
}
......@@ -3,6 +3,7 @@ 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 javax.annotation.Resource;
......@@ -41,4 +42,10 @@ public class AclCustomerDALServiceImpl implements AclCustomerDALService {
return aclCustomerMapper.selectByPrimaryKey(customerId);
}
@Override
public AclCustomer findByMobileNo(String mobileNo) {
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
return aclCustomerMapper.findByMobileNo(jpaCryptoConverter.encode(mobileNo));
}
}
......@@ -6,6 +6,7 @@ import com.yd.dal.service.marketing.MktLeadsAssignedsDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("mktLeadsAssignedsDALService")
public class MktLeadsAssignedsDALServiceImpl implements MktLeadsAssignedsDALService {
......@@ -13,7 +14,22 @@ public class MktLeadsAssignedsDALServiceImpl implements MktLeadsAssignedsDALServ
private MktLeadsAssignedsMapper mktLeadsAssignedsMapper;
@Override
public MktLeadsAssigneds findByMktLeadsAssigneds(MktLeadsAssigneds mktLeadsAssigneds) {
public List<MktLeadsAssigneds> findByMktLeadsAssigneds(MktLeadsAssigneds mktLeadsAssigneds) {
return mktLeadsAssignedsMapper.findByMktLeadsAssigneds(mktLeadsAssigneds);
}
@Override
public MktLeadsAssigneds findByLeadsAssignedId(Long leadsAssignedId) {
return mktLeadsAssignedsMapper.selectByPrimaryKey(leadsAssignedId);
}
@Override
public void updateMktLeadsAssigneds(MktLeadsAssigneds mktLeadsAssigneds) {
mktLeadsAssignedsMapper.updateByPrimaryKeySelective(mktLeadsAssigneds);
}
@Override
public void save(MktLeadsAssigneds assigneds) {
mktLeadsAssignedsMapper.insertSelective(assigneds);
}
}
......@@ -2,6 +2,14 @@ package com.yd.dal.service.marketing;
import com.yd.dal.entity.marketing.MktLeadsAssigneds;
import java.util.List;
public interface MktLeadsAssignedsDALService {
MktLeadsAssigneds findByMktLeadsAssigneds(MktLeadsAssigneds mktLeadsAssigneds);
List<MktLeadsAssigneds> findByMktLeadsAssigneds(MktLeadsAssigneds mktLeadsAssigneds);
MktLeadsAssigneds findByLeadsAssignedId(Long leadsAssignedId);
void updateMktLeadsAssigneds(MktLeadsAssigneds mktLeadsAssigneds);
void save(MktLeadsAssigneds assigneds);
}
package com.yd.dal.service.meta;
import com.yd.dal.entity.marketing.MktLeadsPool;
public interface MktLeadsPoolDALService {
MktLeadsPool findByCustomerId(Long customerId);
void save(MktLeadsPool pool);
}
package com.yd.dal.service.meta.impl;
import com.yd.dal.entity.marketing.MktLeadsPool;
import com.yd.dal.mapper.marketing.MktLeadsAssignedsMapper;
import com.yd.dal.mapper.marketing.MktLeadsPoolMapper;
import com.yd.dal.service.meta.MktLeadsPoolDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service("mktLeadsPoolDALService")
public class MktLeadsPoolDALServiceImpl implements MktLeadsPoolDALService {
@Resource
private MktLeadsPoolMapper mktLeadsPoolMapper;
@Override
public MktLeadsPool findByCustomerId(Long customerId) {
return mktLeadsPoolMapper.findByCustomerId(customerId);
}
@Override
public void save(MktLeadsPool pool) {
mktLeadsPoolMapper.insertSelective(pool);
}
}
......@@ -28,6 +28,6 @@
<if test="mdDropOptionId != null">
and t.md_drop_option_id = #{mdDropOptionId,jdbcType=BIGINT}
</if>
ORDER BY t.created_at DESC
ORDER BY t.seq DESC ,t.created_at DESC
</select>
</mapper>
\ No newline at end of file
......@@ -8,6 +8,7 @@
<result column="FYP" jdbcType="DECIMAL" property="fyp" />
<result column="FYC" jdbcType="DECIMAL" property="fyc" />
<result column="time_to_close" jdbcType="TIMESTAMP" property="timeToClose" />
<result column="pieces" jdbcType="BIGINT" property="pieces" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
......@@ -16,7 +17,7 @@
</resultMap>
<sql id="Base_Column_List">
id, assigned_practitioner_id, customer_id, FYP, FYC, time_to_close, is_active, created_at,
created_by, updated_at, updated_by
created_by, updated_at, updated_by,pieces
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
......@@ -32,11 +33,11 @@
insert into ag_mkt_leads_assigneds (assigned_practitioner_id, customer_id,
FYP, FYC, time_to_close,
is_active, created_at, created_by,
updated_at, updated_by)
updated_at, updated_by,pieces)
values (#{assignedPractitionerId,jdbcType=BIGINT}, #{customerId,jdbcType=BIGINT},
#{fyp,jdbcType=DECIMAL}, #{fyc,jdbcType=DECIMAL}, #{timeToClose,jdbcType=TIMESTAMP},
#{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT},
#{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT})
#{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT},#{pieces,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.marketing.MktLeadsAssigneds" useGeneratedKeys="true">
insert into ag_mkt_leads_assigneds
......@@ -71,6 +72,9 @@
<if test="updatedBy != null">
updated_by,
</if>
<if test="pieces!=null">
pieces,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="assignedPractitionerId != null">
......@@ -103,6 +107,9 @@
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
<if test="pieces != null">
#{pieces,jdbcType=INTEGER}
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.marketing.MktLeadsAssigneds">
......@@ -138,6 +145,9 @@
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
<if test="pieces != null">
pieces = #{pieces,jdbcType=INTEGER}
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -152,7 +162,8 @@
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT}
updated_by = #{updatedBy,jdbcType=BIGINT},
pieces = #{pieces,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="findByMktLeadsAssigneds" resultMap="BaseResultMap">
......@@ -193,6 +204,9 @@
<if test="updatedBy != null">
and updated_by = #{updatedBy,jdbcType=BIGINT}
</if>
<if test="pieces != null">
and pieces = #{pieces,jdbcType=INTEGER}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.dal.mapper.marketing.MktLeadsPoolMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.marketing.MktLeadsPool">
<!--@mbg.generated-->
<!--@Table ag_mkt_leads_pool-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="customer_id" jdbcType="BIGINT" property="customerId" />
<result column="mkt_campaign" jdbcType="VARCHAR" property="mktCampaign" />
<result column="mkt_task" jdbcType="VARCHAR" property="mktTask" />
<result column="has_assigned" jdbcType="INTEGER" property="hasAssigned" />
<result column="source_from" jdbcType="INTEGER" property="sourceFrom" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="added_at" jdbcType="TIMESTAMP" property="addedAt" />
<result column="added_by" jdbcType="BIGINT" property="addedBy" />
</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
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from ag_mkt_leads_pool
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from ag_mkt_leads_pool
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.marketing.MktLeadsPool" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_mkt_leads_pool (customer_id, mkt_campaign, mkt_task,
has_assigned, source_from,
is_active, added_at, added_by
)
values (#{customerId,jdbcType=BIGINT}, #{mktCampaign,jdbcType=VARCHAR}, #{mktTask,jdbcType=VARCHAR},
#{hasAssigned,jdbcType=INTEGER}, #{sourceFrom,jdbcType=INTEGER},
#{isActive,jdbcType=INTEGER}, #{addedAt,jdbcType=TIMESTAMP}, #{addedBy,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.marketing.MktLeadsPool" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_mkt_leads_pool
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="customerId != null">
customer_id,
</if>
<if test="mktCampaign != null">
mkt_campaign,
</if>
<if test="mktTask != null">
mkt_task,
</if>
<if test="hasAssigned != null">
has_assigned,
</if>
<if test="sourceFrom != null">
source_from,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="addedAt != null">
added_at,
</if>
<if test="addedBy != null">
added_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="customerId != null">
#{customerId,jdbcType=BIGINT},
</if>
<if test="mktCampaign != null">
#{mktCampaign,jdbcType=VARCHAR},
</if>
<if test="mktTask != null">
#{mktTask,jdbcType=VARCHAR},
</if>
<if test="hasAssigned != null">
#{hasAssigned,jdbcType=INTEGER},
</if>
<if test="sourceFrom != null">
#{sourceFrom,jdbcType=INTEGER},
</if>
<if test="isActive != null">
#{isActive,jdbcType=INTEGER},
</if>
<if test="addedAt != null">
#{addedAt,jdbcType=TIMESTAMP},
</if>
<if test="addedBy != null">
#{addedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.marketing.MktLeadsPool">
<!--@mbg.generated-->
update ag_mkt_leads_pool
<set>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=BIGINT},
</if>
<if test="mktCampaign != null">
mkt_campaign = #{mktCampaign,jdbcType=VARCHAR},
</if>
<if test="mktTask != null">
mkt_task = #{mktTask,jdbcType=VARCHAR},
</if>
<if test="hasAssigned != null">
has_assigned = #{hasAssigned,jdbcType=INTEGER},
</if>
<if test="sourceFrom != null">
source_from = #{sourceFrom,jdbcType=INTEGER},
</if>
<if test="isActive != null">
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if test="addedAt != null">
added_at = #{addedAt,jdbcType=TIMESTAMP},
</if>
<if test="addedBy != null">
added_by = #{addedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.marketing.MktLeadsPool">
<!--@mbg.generated-->
update ag_mkt_leads_pool
set customer_id = #{customerId,jdbcType=BIGINT},
mkt_campaign = #{mktCampaign,jdbcType=VARCHAR},
mkt_task = #{mktTask,jdbcType=VARCHAR},
has_assigned = #{hasAssigned,jdbcType=INTEGER},
source_from = #{sourceFrom,jdbcType=INTEGER},
is_active = #{isActive,jdbcType=INTEGER},
added_at = #{addedAt,jdbcType=TIMESTAMP},
added_by = #{addedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="findByCustomerId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_mkt_leads_pool
where customer_id = #{customerId,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment