Commit fbb45b38 by Water Wang

opitimize

parent 568012d5
......@@ -505,11 +505,41 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
}
aclPractitionerPotentialAssignedTrackDALService.saveAll(potentialAssignedTrackList);
}
}
@Override
public AddRecruitTrackResponseVO addRecruitTrack(AddRecruitTrackRequestVO requestVO) {
AddRecruitTrackResponseVO responseVO = new AddRecruitTrackResponseVO();
Long trackId = requestVO.getTrackId();
Long trackStatusId = requestVO.getTrackStatusId();
Long practitionerId = requestVO.getPractitionerId();
Long potentialId = requestVO.getPractitionerPotentialId();
if(trackId != null && trackStatusId != null && practitionerId != null && potentialId != null){
AclPractitionerPotentialAssignedTrack assignedTrack = new AclPractitionerPotentialAssignedTrack();
//1、查询团队长对该增员几天是否已经进行过该增员状态
List<AclPractitionerPotentialAssignedTrack> assignedTrackList = aclPractitionerPotentialAssignedTrackDALService.findByPractitionerIdAndPotentialId(practitionerId,potentialId);
if(assignedTrackList == null || assignedTrackList.isEmpty()){//3、如果没有,获取增员状态对应的分值,
// assignedTrack.setTrackScore();
}
assignedTrack.setPractitionerAssignedId(practitionerId);
assignedTrack.setPractitionerPotentialId(potentialId);
assignedTrack.setTrackStatusId(trackStatusId);
assignedTrack.setNotice(requestVO.getNotice());
assignedTrack.setIsActive(1);
assignedTrack.setCreatorType(2);
assignedTrack.setCreatedBy(practitionerId);
assignedTrack.setCreatedAt(new Date());
}else{
String [] paras = {"trackId,trackStatusId,practitionerId,potentialId"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
}
return null;
}
......
......@@ -2,6 +2,9 @@ package com.yd.api.practitioner.vo.recruit;
public class AddRecruitTrackRequestVO {
private Long trackId;
private Long practitionerId;
private Long practitionerPotentialId;
private Integer trackScore;
private Long trackStatusId;
private String notice;
private Integer isActive;
......@@ -37,4 +40,28 @@ public class AddRecruitTrackRequestVO {
public void setIsActive(Integer isActive) {
this.isActive = isActive;
}
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public Long getPractitionerPotentialId() {
return practitionerPotentialId;
}
public void setPractitionerPotentialId(Long practitionerPotentialId) {
this.practitionerPotentialId = practitionerPotentialId;
}
public Integer getTrackScore() {
return trackScore;
}
public void setTrackScore(Integer trackScore) {
this.trackScore = trackScore;
}
}
......@@ -66,5 +66,7 @@ public class AclPractitionerPotentialAssignedTrack implements Serializable {
private Integer isLasted;
private Integer trackScore;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -18,4 +18,6 @@ public interface AclPractitionerPotentialAssignedTrackMapper {
int updateByPrimaryKey(AclPractitionerPotentialAssignedTrack record);
void insertList(@Param("potentialAssignedTrackList") List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(@Param("practitionerId") Long practitionerId, @Param("potentialId")Long potentialId);
}
\ No newline at end of file
......@@ -9,4 +9,6 @@ import java.util.List;
public interface AclPractitionerPotentialAssignedTrackDALService {
void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId);
}
......@@ -17,4 +17,9 @@ public class AclPractitionerPotentialAssignedTrackDALServiceImpl implements AclP
public void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList) {
aclPractitionerPotentialAssignedTrackMapper.insertList(potentialAssignedTrackList);
}
@Override
public List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId) {
return aclPractitionerPotentialAssignedTrackMapper.findByPractitionerIdAndPotentialId(practitionerId,potentialId);
}
}
......@@ -15,9 +15,10 @@
<result column="updator_type" jdbcType="INTEGER" property="updatorType" />
<result column="creator_type" jdbcType="INTEGER" property="creatorType" />
<result column="is_lasted" jdbcType="INTEGER" property="isLasted" />
<result column="track_score" jdbcType="INTEGER" property="trackScore" />
</resultMap>
<sql id="Base_Column_List">
id, practitioner_potential_id, practitioner_assigned_id, track_status_id, notice,
id, practitioner_potential_id, practitioner_assigned_id, track_status_id, track_score,notice,
is_active, created_at, created_by, updated_at, updated_by, creator_type, updator_type,is_lasted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
......@@ -26,17 +27,25 @@
from ag_acl_practitioner_potential_assigned_track
where id = #{id,jdbcType=BIGINT}
</select>
<select id="findByPractitionerIdAndPotentialId"
resultType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigned_track
where practitioner_assigned_id = #{practitionerId,jdbcType=BIGINT}
AND practitioner_potential_id = #{potentialId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_potential_assigned_track
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigned_track (practitioner_potential_id, practitioner_assigned_id,
track_status_id, notice, is_active,
track_status_id, track_score,notice, is_active,
created_at, created_by, updated_at,
updated_by, updator_type,creator_type,is_lasted )
values (#{practitionerPotentialId,jdbcType=BIGINT}, #{practitionerAssignedId,jdbcType=BIGINT},
#{trackStatusId,jdbcType=BIGINT}, #{notice,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER},
#{trackStatusId,jdbcType=BIGINT},#{trackScore,jdbcType=INTEGER}, #{notice,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT},#{updatorType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{isLasted,jdbcType=INTEGER})
</insert>
......@@ -52,6 +61,9 @@
<if test="trackStatusId != null">
track_status_id,
</if>
<if test="trackScore != null">
track_score,
</if>
<if test="notice != null">
notice,
</if>
......@@ -103,7 +115,7 @@
</insert>
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" >
insert into ag_acl_practitioner_potential_assigned_track(practitioner_potential_id, practitioner_assigned_id,
track_status_id, notice, is_active,
track_status_id, track_score,notice, is_active,
created_at, created_by, updated_at,
updated_by, updator_type,creator_type,is_lasted )
values
......@@ -112,6 +124,7 @@
#{item.practitionerPotentialId},
#{item.practitionerAssignedId},
#{item.trackStatusId},
#{item.trackScore},
#{item.notice},
#{item.isActive},
#{item.createdAt},
......@@ -136,6 +149,9 @@
<if test="trackStatusId != null">
track_status_id = #{trackStatusId,jdbcType=BIGINT},
</if>
<if test="trackScore != null">
track_score = #{trackScore,jdbcType=INTEGER},
</if>
<if test="notice != null">
notice = #{notice,jdbcType=VARCHAR},
</if>
......
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