Commit 84f60115 by huangZW

111

parent c141bb79
......@@ -151,11 +151,11 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
public void staffEdit(StaffDTO staffDTO, String departmentIds) {
TabHaobanStaff oldStaff = staffMapper.selectByPrimaryKey(staffDTO.getStaffId());
//1、先更新staff
TabHaobanStaff tab = EntityUtil.changeEntityByJSON(TabHaobanStaff.class, staffDTO);
staffService.updateByPrimaryKey(tab);
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedService.listStaffDepartmentByStaffId(staffDTO.getStaffId());
Map<String,TabHaobanStaffDepartmentRelated> map = com.gic.commons.util.CollectionUtil.toMap(list, "departmentId");
//2、该员工新增部门
......@@ -179,10 +179,21 @@ public class StaffApiServiceImpl implements StaffApiService {
}else{
//该员工部门没做改变(只更新手机号即可)
TabHaobanStaffDepartmentRelated related = map.get(addId);
related.setPhoneNumber(staffDTO.getPhoneNumber());
related.setNationCode(staffDTO.getNationCode());
related.setUpdateTime(new Date());
staffDepartmentRelatedMapper.updateByPrimaryKeySelective(related);
if(!staffDTO.getPhoneNumber().equals(related.getPhoneNumber())){
related.setPhoneNumber(staffDTO.getPhoneNumber());
related.setNationCode(staffDTO.getNationCode());
related.setUpdateTime(new Date());
staffDepartmentRelatedMapper.updateByPrimaryKeySelective(related);
}
if(org.apache.commons.lang3.StringUtils.isNoneBlank(related.getClerkCode())){
if(!staffDTO.getPhoneNumber().equals(related.getPhoneNumber())||!staffDTO.getNickName().equals(oldStaff.getNickName())){
//TODO 通知gic换绑手机号或者更换姓名
}
}
}
}
}
......@@ -195,6 +206,10 @@ public class StaffApiServiceImpl implements StaffApiService {
if(!departmentIds.contains(tab1.getDepartmentId())){
StaffDepartmentRelatedDTO related = EntityUtil.changeEntityByJSON(StaffDepartmentRelatedDTO.class, tab1);
staffDepartmentRelatedService.del(related);
if(org.apache.commons.lang3.StringUtils.isNoneBlank(tab1.getClerkCode())){
//TODO 通知gic解绑
}
}
}
}
......
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