Commit 13e76815 by yao.xiao

修改-经纪人申请专家逻辑

parent 017b24e1
...@@ -731,7 +731,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -731,7 +731,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//查询此商机是否有申请专家 //查询此商机是否有申请专家
info.setExpertType(0L); info.setExpertType(0L);
MktLeadsExpertRequest mktLeadsExpertRequest = mktLeadsExpertRequestDALService.findByLeadsAssignedId(mktLeadsAssigneds.getId()); MktLeadsExpertRequest mktLeadsExpertRequest = mktLeadsExpertRequestDALService.findByCustomerId(mktLeadsAssigneds.getCustomerId());
if (mktLeadsExpertRequest != null){ if (mktLeadsExpertRequest != null){
//有申请专家 查询是否指派专家 //有申请专家 查询是否指派专家
info.setExpertType(1L); info.setExpertType(1L);
...@@ -3009,7 +3009,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -3009,7 +3009,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
public ApplyForExpertSupportResponseVO applyForExpertSupport(ApplyForExpertSupportRequestVO requestVO) { public ApplyForExpertSupportResponseVO applyForExpertSupport(ApplyForExpertSupportRequestVO requestVO) {
ApplyForExpertSupportResponseVO resp = new ApplyForExpertSupportResponseVO(); ApplyForExpertSupportResponseVO resp = new ApplyForExpertSupportResponseVO();
//判断此商机专家支持是否已经申请 //判断此商机专家支持是否已经申请
MktLeadsExpertRequest isExpertRequest = mktLeadsExpertRequestDALService.findByLeadsAssignedId(requestVO.getLeadsAssignedId()); MktLeadsExpertRequest isExpertRequest = mktLeadsExpertRequestDALService.findByCustomerId(requestVO.getOpportunityId());
if (isExpertRequest != null){ if (isExpertRequest != null){
resp.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("830019"))); resp.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("830019")));
return resp; return resp;
...@@ -3018,6 +3018,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -3018,6 +3018,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//保存ag_mkt_leads_expert_request //保存ag_mkt_leads_expert_request
MktLeadsExpertRequest mktLeadsExpertRequest = new MktLeadsExpertRequest(); MktLeadsExpertRequest mktLeadsExpertRequest = new MktLeadsExpertRequest();
mktLeadsExpertRequest.setLeadsAssignedId(requestVO.getLeadsAssignedId()); mktLeadsExpertRequest.setLeadsAssignedId(requestVO.getLeadsAssignedId());
mktLeadsExpertRequest.setCustomerId(requestVO.getOpportunityId());
mktLeadsExpertRequest.setIsActive(1); mktLeadsExpertRequest.setIsActive(1);
mktLeadsExpertRequest.setCreatedAt(new Date()); mktLeadsExpertRequest.setCreatedAt(new Date());
mktLeadsExpertRequest.setUpdatedAt(new Date()); mktLeadsExpertRequest.setUpdatedAt(new Date());
......
...@@ -13,4 +13,6 @@ public class ApplyForExpertSupportRequestVO { ...@@ -13,4 +13,6 @@ public class ApplyForExpertSupportRequestVO {
* 申请经纪人id * 申请经纪人id
*/ */
private Long practitionerId; private Long practitionerId;
private Long opportunityId;
} }
...@@ -4,42 +4,47 @@ import java.util.Date; ...@@ -4,42 +4,47 @@ import java.util.Date;
import lombok.Data; import lombok.Data;
/** /**
* 经纪人申请专家辅助开发商机 * 经纪人申请专家辅助开发商机
*/ */
@Data @Data
public class MktLeadsExpertRequest { public class MktLeadsExpertRequest {
/** /**
* serial id * serial id
*/ */
private Long id; private Long id;
/** /**
* FK ag_mkt_leads_assigneds.id 商机指派表id * FK ag_mkt_leads_assigneds.id 商机指派表id
*/ */
private Long leadsAssignedId; private Long leadsAssignedId;
/** /**
* 0=No, 1=Yes * 商机用户id
*/ */
private Long customerId;
/**
* 0=No, 1=Yes
*/
private Integer isActive; private Integer isActive;
/** /**
* 分析建置时间 * 分析建置时间
*/ */
private Date createdAt; private Date createdAt;
/** /**
* 建置者 FK ag_acl_user.id * 建置者 FK ag_acl_user.id
*/ */
private Long createdBy; private Long createdBy;
/** /**
* 更新时间 * 更新时间
*/ */
private Date updatedAt; private Date updatedAt;
/** /**
* 更新者 FK ag_acl_user.id * 更新者 FK ag_acl_user.id
*/ */
private Long updatedBy; private Long updatedBy;
} }
\ No newline at end of file
...@@ -24,4 +24,6 @@ public interface MktLeadsExpertRequestMapper { ...@@ -24,4 +24,6 @@ public interface MktLeadsExpertRequestMapper {
int batchInsert(@Param("list") List<MktLeadsExpertRequest> list); int batchInsert(@Param("list") List<MktLeadsExpertRequest> list);
MktLeadsExpertRequest selectByAassignedId(Long assignedId); MktLeadsExpertRequest selectByAassignedId(Long assignedId);
MktLeadsExpertRequest selectByCustomerId(Long customerId);
} }
\ No newline at end of file
...@@ -22,4 +22,9 @@ public class MktLeadsExpertRequestDALServiceImpl implements MktLeadsExpertReques ...@@ -22,4 +22,9 @@ public class MktLeadsExpertRequestDALServiceImpl implements MktLeadsExpertReques
public MktLeadsExpertRequest findByLeadsAssignedId(Long assignedId) { public MktLeadsExpertRequest findByLeadsAssignedId(Long assignedId) {
return mktLeadsExpertRequestMapper.selectByAassignedId(assignedId); return mktLeadsExpertRequestMapper.selectByAassignedId(assignedId);
} }
@Override
public MktLeadsExpertRequest findByCustomerId(Long customerId) {
return mktLeadsExpertRequestMapper.selectByCustomerId(customerId);
}
} }
...@@ -6,4 +6,6 @@ public interface MktLeadsExpertRequestDALService { ...@@ -6,4 +6,6 @@ public interface MktLeadsExpertRequestDALService {
int save(MktLeadsExpertRequest mktLeadsExpertRequest); int save(MktLeadsExpertRequest mktLeadsExpertRequest);
MktLeadsExpertRequest findByLeadsAssignedId(Long assignedId); MktLeadsExpertRequest findByLeadsAssignedId(Long assignedId);
MktLeadsExpertRequest findByCustomerId(Long customerId);
} }
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<!--@Table ag_mkt_leads_expert_request--> <!--@Table ag_mkt_leads_expert_request-->
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="leads_assigned_id" jdbcType="BIGINT" property="leadsAssignedId" /> <result column="leads_assigned_id" jdbcType="BIGINT" property="leadsAssignedId" />
<result column="customer_id" jdbcType="BIGINT" property="customerId" />
<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" />
...@@ -14,7 +15,8 @@ ...@@ -14,7 +15,8 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, leads_assigned_id, is_active, created_at, created_by, updated_at, updated_by id, leads_assigned_id, customer_id, is_active, created_at, created_by, updated_at,
updated_by
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
...@@ -30,12 +32,12 @@ ...@@ -30,12 +32,12 @@
</delete> </delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.marketing.MktLeadsExpertRequest" useGeneratedKeys="true"> <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.marketing.MktLeadsExpertRequest" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into ag_mkt_leads_expert_request (leads_assigned_id, is_active, created_at, insert into ag_mkt_leads_expert_request (leads_assigned_id, customer_id, is_active,
created_by, updated_at, updated_by created_at, created_by, updated_at,
) updated_by)
values (#{leadsAssignedId,jdbcType=BIGINT}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, values (#{leadsAssignedId,jdbcType=BIGINT}, #{customerId,jdbcType=BIGINT}, #{isActive,jdbcType=INTEGER},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT} #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
) #{updatedBy,jdbcType=BIGINT})
</insert> </insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.marketing.MktLeadsExpertRequest" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.marketing.MktLeadsExpertRequest" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
...@@ -44,6 +46,9 @@ ...@@ -44,6 +46,9 @@
<if test="leadsAssignedId != null"> <if test="leadsAssignedId != null">
leads_assigned_id, leads_assigned_id,
</if> </if>
<if test="customerId != null">
customer_id,
</if>
<if test="isActive != null"> <if test="isActive != null">
is_active, is_active,
</if> </if>
...@@ -64,6 +69,9 @@ ...@@ -64,6 +69,9 @@
<if test="leadsAssignedId != null"> <if test="leadsAssignedId != null">
#{leadsAssignedId,jdbcType=BIGINT}, #{leadsAssignedId,jdbcType=BIGINT},
</if> </if>
<if test="customerId != null">
#{customerId,jdbcType=BIGINT},
</if>
<if test="isActive != null"> <if test="isActive != null">
#{isActive,jdbcType=INTEGER}, #{isActive,jdbcType=INTEGER},
</if> </if>
...@@ -88,6 +96,9 @@ ...@@ -88,6 +96,9 @@
<if test="leadsAssignedId != null"> <if test="leadsAssignedId != null">
leads_assigned_id = #{leadsAssignedId,jdbcType=BIGINT}, leads_assigned_id = #{leadsAssignedId,jdbcType=BIGINT},
</if> </if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=BIGINT},
</if>
<if test="isActive != null"> <if test="isActive != null">
is_active = #{isActive,jdbcType=INTEGER}, is_active = #{isActive,jdbcType=INTEGER},
</if> </if>
...@@ -110,6 +121,7 @@ ...@@ -110,6 +121,7 @@
<!--@mbg.generated--> <!--@mbg.generated-->
update ag_mkt_leads_expert_request update ag_mkt_leads_expert_request
set leads_assigned_id = #{leadsAssignedId,jdbcType=BIGINT}, set leads_assigned_id = #{leadsAssignedId,jdbcType=BIGINT},
customer_id = #{customerId,jdbcType=BIGINT},
is_active = #{isActive,jdbcType=INTEGER}, is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP}, created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT}, created_by = #{createdBy,jdbcType=BIGINT},
...@@ -126,6 +138,11 @@ ...@@ -126,6 +138,11 @@
when id = #{item.id,jdbcType=BIGINT} then #{item.leadsAssignedId,jdbcType=BIGINT} when id = #{item.id,jdbcType=BIGINT} then #{item.leadsAssignedId,jdbcType=BIGINT}
</foreach> </foreach>
</trim> </trim>
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.customerId,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="is_active = case" suffix="end,"> <trim prefix="is_active = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.isActive,jdbcType=INTEGER} when id = #{item.id,jdbcType=BIGINT} then #{item.isActive,jdbcType=INTEGER}
...@@ -168,6 +185,13 @@ ...@@ -168,6 +185,13 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.customerId != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.customerId,jdbcType=BIGINT}
</if>
</foreach>
</trim>
<trim prefix="is_active = case" suffix="end,"> <trim prefix="is_active = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <foreach collection="list" index="index" item="item">
<if test="item.isActive != null"> <if test="item.isActive != null">
...@@ -212,12 +236,13 @@ ...@@ -212,12 +236,13 @@
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true"> <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into ag_mkt_leads_expert_request insert into ag_mkt_leads_expert_request
(leads_assigned_id, is_active, created_at, created_by, updated_at, updated_by) (leads_assigned_id, customer_id, is_active, created_at, created_by, updated_at, updated_by
)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.leadsAssignedId,jdbcType=BIGINT}, #{item.isActive,jdbcType=INTEGER}, #{item.createdAt,jdbcType=TIMESTAMP}, (#{item.leadsAssignedId,jdbcType=BIGINT}, #{item.customerId,jdbcType=BIGINT}, #{item.isActive,jdbcType=INTEGER},
#{item.createdBy,jdbcType=BIGINT}, #{item.updatedAt,jdbcType=TIMESTAMP}, #{item.updatedBy,jdbcType=BIGINT} #{item.createdAt,jdbcType=TIMESTAMP}, #{item.createdBy,jdbcType=BIGINT}, #{item.updatedAt,jdbcType=TIMESTAMP},
) #{item.updatedBy,jdbcType=BIGINT})
</foreach> </foreach>
</insert> </insert>
...@@ -228,4 +253,11 @@ ...@@ -228,4 +253,11 @@
where leads_assigned_id = #{assignedId,jdbcType=BIGINT} where leads_assigned_id = #{assignedId,jdbcType=BIGINT}
and is_active = 1 and is_active = 1
</select> </select>
<select id="selectByCustomerId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_mkt_leads_expert_request
where customer_id = #{customerId,jdbcType=BIGINT}
and is_active = 1
</select>
</mapper> </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