Commit aa6b8ae3 by qwmqiuwenmin

fix

parent 75199c8d
......@@ -21,6 +21,8 @@ public class StaffDepartmentRelatedDTO implements Serializable {
private Integer statusFlag;
private String clerkCode;
private String staffName;
private Date createTime;
......@@ -115,6 +117,14 @@ public class StaffDepartmentRelatedDTO implements Serializable {
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
}
\ No newline at end of file
......@@ -40,6 +40,6 @@ public interface StaffDepartmentRelatedMapper {
TabHaobanStaffDepartmentRelated getDepartmentIdAndCode(@Param("departmentId")String departmentId, @Param("clerkCode")String code);
List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByClerkCode(@Param("departmentId")String departmentId, @Param("keyword")String keyword);
List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByKeyword(@Param("departmentId")String departmentId, @Param("keyword")String keyword);
}
\ No newline at end of file
......@@ -26,6 +26,8 @@ public class TabHaobanStaffDepartmentRelated implements Serializable {
private Date updateTime;
private String staffName;
private static final long serialVersionUID = 1L;
......@@ -117,6 +119,14 @@ public class TabHaobanStaffDepartmentRelated implements Serializable {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
}
\ No newline at end of file
......@@ -24,5 +24,5 @@ public interface StaffDepartmentRelatedService {
int countByDepartmentId(String departmentId);
List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByClerkCode(String departmentId, String keyword);
List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByKeyword(String departmentId, String keyword);
}
......@@ -76,8 +76,8 @@ public class StaffDepartmentRelatedServiceImpl implements StaffDepartmentRelated
}
@Override
public List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByClerkCode(String departmentId, String keyword) {
return mapper.listByDepartmentIdByClerkCode(departmentId,keyword);
public List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByKeyword(String departmentId, String keyword) {
return mapper.listByDepartmentIdByKeyword(departmentId,keyword);
}
......
......@@ -159,6 +159,7 @@ public class StaffApiServiceImpl implements StaffApiService {
related.setPhoneNumber(staff.getPhoneNumber());
related.setStaffId(staffId);
related.setWxUserId(wxUserId);
related.setStaffName(staff.getStaffName());
related.setWxEnterpriseId(staff.getWxEnterpriseId());
staffDepartmentRelatedService.add(related);
}
......@@ -178,7 +179,7 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
public Page<StaffDTO> pageStaff(String departmentId, Integer activeFlag, String keyword, BasePageInfo pageInfo) {
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedService.listByDepartmentId(departmentId);
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedService.listByDepartmentIdByKeyword(departmentId,keyword);
Set<String> staffIds = new HashSet<String>();
for (TabHaobanStaffDepartmentRelated tabHaobanStaffDepartmentRelated : list) {
staffIds.add(tabHaobanStaffDepartmentRelated.getStaffId());
......@@ -318,6 +319,7 @@ public class StaffApiServiceImpl implements StaffApiService {
dto.setStatusFlag(1);
dto.setDepartmentId(tabDepartment.getDepartmentId());
dto.setNationCode("86");
dto.setStaffName(user.getName());
staffDepartmentRelatedService.add(dto);
}
}
......@@ -335,6 +337,7 @@ public class StaffApiServiceImpl implements StaffApiService {
logger.info("【员工修改】staffDTO={}",JSON.toJSONString(staffDTO));
TabHaobanStaff tab = EntityUtil.changeEntityByJSON(TabHaobanStaff.class, staffDTO);
staffService.updateByPrimaryKey(tab);
String staffName = tab.getStaffName();
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedService.listStaffDepartmentByStaffId(staffDTO.getStaffId());
Map<String,TabHaobanStaffDepartmentRelated> map = com.gic.commons.util.CollectionUtil.toMap(list, "departmentId");
......@@ -356,6 +359,7 @@ public class StaffApiServiceImpl implements StaffApiService {
related.setUpdateTime(new Date());
related.setWxUserId(oldStaff.getWxUserId());
related.setWxEnterpriseId(staffDTO.getWxEnterpriseId());
related.setStaffName(staffName);
staffDepartmentRelatedService.add(related);
}else{
//该员工部门没做改变(只更新手机号即可)
......@@ -364,6 +368,7 @@ public class StaffApiServiceImpl implements StaffApiService {
related.setPhoneNumber(staffDTO.getPhoneNumber());
related.setNationCode(staffDTO.getNationCode());
related.setUpdateTime(new Date());
related.setStaffName(staffName);
staffDepartmentRelatedMapper.updateByPrimaryKeySelective(related);
}
......
......@@ -11,12 +11,13 @@
<result column="department_id" property="departmentId" jdbcType="VARCHAR" />
<result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
<result column="clerk_code" property="clerkCode" jdbcType="VARCHAR" />
<result column="staff_name" property="staffName" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
staff_department_related_id, staff_id, phone_number, nation_code, wx_user_id, department_id,
status_flag, clerk_code, create_time, update_time,wx_enterprise_id
status_flag, clerk_code, create_time, update_time,wx_enterprise_id,staff_name
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
......@@ -32,11 +33,11 @@
insert into tab_haoban_staff_department_related (staff_department_related_id, staff_id,
phone_number, nation_code, wx_user_id,
department_id, status_flag, clerk_code,
create_time, update_time,wx_enterprise_id)
create_time, update_time,wx_enterprise_id,staff_name)
values (#{staffDepartmentRelatedId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR},
#{phoneNumber,jdbcType=VARCHAR}, #{nationCode,jdbcType=VARCHAR}, #{wxUserId,jdbcType=VARCHAR},
#{departmentId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER}, #{clerkCode,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},#{wxEnterpriseId})
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},#{wxEnterpriseId},#{staffName})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated" >
insert into tab_haoban_staff_department_related
......@@ -68,6 +69,9 @@
<if test="clerkCode != null" >
clerk_code,
</if>
<if test="staffName != null" >
staff_name,
</if>
<if test="createTime != null" >
create_time,
</if>
......@@ -104,6 +108,9 @@
<if test="clerkCode != null" >
#{clerkCode,jdbcType=VARCHAR},
</if>
<if test="staffName != null" >
#{staffName,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -139,6 +146,9 @@
<if test="clerkCode != null" >
clerk_code = #{clerkCode,jdbcType=VARCHAR},
</if>
<if test="staffName != null" >
staff_name = #{staffName,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -240,7 +250,7 @@
and status_flag = 1
</select>
<select id="listByDepartmentIdByClerkCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
<select id="listByDepartmentIdByKeyword" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_department_related
......@@ -248,7 +258,7 @@
and department_id = #{departmentId}
and status_flag = 1
<if test="keyword != null and keyword != ''">
and clerk_code like CONCAT('%',#{keyword},'%')
and (clerk_code like CONCAT('%',#{keyword},'%') or phone_number like CONCAT('%',#{keyword},'%') or staff_name like CONCAT('%',#{keyword},'%'))
</if>
</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