Commit 13e76815 by yao.xiao

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

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