Commit fbb45b38 by Water Wang

opitimize

parent 568012d5
...@@ -505,11 +505,41 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -505,11 +505,41 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
} }
aclPractitionerPotentialAssignedTrackDALService.saveAll(potentialAssignedTrackList); aclPractitionerPotentialAssignedTrackDALService.saveAll(potentialAssignedTrackList);
} }
} }
@Override @Override
public AddRecruitTrackResponseVO addRecruitTrack(AddRecruitTrackRequestVO requestVO) { 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; return null;
} }
......
...@@ -2,6 +2,9 @@ package com.yd.api.practitioner.vo.recruit; ...@@ -2,6 +2,9 @@ package com.yd.api.practitioner.vo.recruit;
public class AddRecruitTrackRequestVO { public class AddRecruitTrackRequestVO {
private Long trackId; private Long trackId;
private Long practitionerId;
private Long practitionerPotentialId;
private Integer trackScore;
private Long trackStatusId; private Long trackStatusId;
private String notice; private String notice;
private Integer isActive; private Integer isActive;
...@@ -37,4 +40,28 @@ public class AddRecruitTrackRequestVO { ...@@ -37,4 +40,28 @@ public class AddRecruitTrackRequestVO {
public void setIsActive(Integer isActive) { public void setIsActive(Integer isActive) {
this.isActive = 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 { ...@@ -66,5 +66,7 @@ public class AclPractitionerPotentialAssignedTrack implements Serializable {
private Integer isLasted; private Integer isLasted;
private Integer trackScore;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -18,4 +18,6 @@ public interface AclPractitionerPotentialAssignedTrackMapper { ...@@ -18,4 +18,6 @@ public interface AclPractitionerPotentialAssignedTrackMapper {
int updateByPrimaryKey(AclPractitionerPotentialAssignedTrack record); int updateByPrimaryKey(AclPractitionerPotentialAssignedTrack record);
void insertList(@Param("potentialAssignedTrackList") List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList); 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; ...@@ -9,4 +9,6 @@ import java.util.List;
public interface AclPractitionerPotentialAssignedTrackDALService { public interface AclPractitionerPotentialAssignedTrackDALService {
void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList); void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId);
} }
...@@ -17,4 +17,9 @@ public class AclPractitionerPotentialAssignedTrackDALServiceImpl implements AclP ...@@ -17,4 +17,9 @@ public class AclPractitionerPotentialAssignedTrackDALServiceImpl implements AclP
public void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList) { public void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList) {
aclPractitionerPotentialAssignedTrackMapper.insertList(potentialAssignedTrackList); aclPractitionerPotentialAssignedTrackMapper.insertList(potentialAssignedTrackList);
} }
@Override
public List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId) {
return aclPractitionerPotentialAssignedTrackMapper.findByPractitionerIdAndPotentialId(practitionerId,potentialId);
}
} }
...@@ -15,9 +15,10 @@ ...@@ -15,9 +15,10 @@
<result column="updator_type" jdbcType="INTEGER" property="updatorType" /> <result column="updator_type" jdbcType="INTEGER" property="updatorType" />
<result column="creator_type" jdbcType="INTEGER" property="creatorType" /> <result column="creator_type" jdbcType="INTEGER" property="creatorType" />
<result column="is_lasted" jdbcType="INTEGER" property="isLasted" /> <result column="is_lasted" jdbcType="INTEGER" property="isLasted" />
<result column="track_score" jdbcType="INTEGER" property="trackScore" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <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 is_active, created_at, created_by, updated_at, updated_by, creator_type, updator_type,is_lasted
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
...@@ -26,17 +27,25 @@ ...@@ -26,17 +27,25 @@
from ag_acl_practitioner_potential_assigned_track from ag_acl_practitioner_potential_assigned_track
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</select> </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 id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_potential_assigned_track delete from ag_acl_practitioner_potential_assigned_track
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</delete> </delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack" useGeneratedKeys="true"> <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, 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, created_at, created_by, updated_at,
updated_by, updator_type,creator_type,is_lasted ) updated_by, updator_type,creator_type,is_lasted )
values (#{practitionerPotentialId,jdbcType=BIGINT}, #{practitionerAssignedId,jdbcType=BIGINT}, 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}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT},#{updatorType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{isLasted,jdbcType=INTEGER}) #{updatedBy,jdbcType=BIGINT},#{updatorType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{isLasted,jdbcType=INTEGER})
</insert> </insert>
...@@ -52,6 +61,9 @@ ...@@ -52,6 +61,9 @@
<if test="trackStatusId != null"> <if test="trackStatusId != null">
track_status_id, track_status_id,
</if> </if>
<if test="trackScore != null">
track_score,
</if>
<if test="notice != null"> <if test="notice != null">
notice, notice,
</if> </if>
...@@ -103,7 +115,7 @@ ...@@ -103,7 +115,7 @@
</insert> </insert>
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" > <insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" >
insert into ag_acl_practitioner_potential_assigned_track(practitioner_potential_id, practitioner_assigned_id, 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, created_at, created_by, updated_at,
updated_by, updator_type,creator_type,is_lasted ) updated_by, updator_type,creator_type,is_lasted )
values values
...@@ -112,6 +124,7 @@ ...@@ -112,6 +124,7 @@
#{item.practitionerPotentialId}, #{item.practitionerPotentialId},
#{item.practitionerAssignedId}, #{item.practitionerAssignedId},
#{item.trackStatusId}, #{item.trackStatusId},
#{item.trackScore},
#{item.notice}, #{item.notice},
#{item.isActive}, #{item.isActive},
#{item.createdAt}, #{item.createdAt},
...@@ -136,6 +149,9 @@ ...@@ -136,6 +149,9 @@
<if test="trackStatusId != null"> <if test="trackStatusId != null">
track_status_id = #{trackStatusId,jdbcType=BIGINT}, track_status_id = #{trackStatusId,jdbcType=BIGINT},
</if> </if>
<if test="trackScore != null">
track_score = #{trackScore,jdbcType=INTEGER},
</if>
<if test="notice != null"> <if test="notice != null">
notice = #{notice,jdbcType=VARCHAR}, notice = #{notice,jdbcType=VARCHAR},
</if> </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