Commit a5234234 by 徐高华

离职在职继承

parent 8e72fca8
......@@ -24,6 +24,7 @@ import com.gic.haoban.manage.service.service.HaobanHandoverService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -56,31 +57,40 @@ public class HaobanHandoverServiceImpl implements HaobanHandoverService {
String wxEnterpriseId = qdto.getWxEnterpriseId() ;
// 0离职继承 1在职继承
int handoverType = qdto.getHandoverType() ;
List<HandoverStaffDTO> retList = null ;
if(handoverType==0) {
List<TabHandoverStaff> list = this.handoverStaffMapper.listByHandover(wxEnterpriseId, storeId) ;
retList = EntityUtil.changeEntityListByJSON(HandoverStaffDTO.class, list) ;
}else {
List<StaffClerkRelationDTO> list = this.staffClerkRelationMapper.listByStoreIds(wxEnterpriseId, Arrays.asList(storeId)) ;
retList = EntityUtil.changeEntityListByJSON(HandoverStaffDTO.class, list) ;
}
if(CollectionUtils.isNotEmpty(retList)) {
List<String> staffIdList = retList.stream().map(HandoverStaffDTO::getStaffId).collect(Collectors.toList());
List<FriendCountBO> numList= this.externalClerkRelatedMapper.friendNum(staffIdList, storeId) ;
Map<String,Integer> map = numList.stream().collect(Collectors.toMap(FriendCountBO::getStaffId, FriendCountBO::getNum, (e, x) -> e));
List<HandoverStaffDTO> retList = EntityUtil.changeEntityListByJSON(HandoverStaffDTO.class, list) ;
for (HandoverStaffDTO handoverStaffDTO : retList) {
handoverStaffDTO.setFriendCount(map.get(handoverStaffDTO.getStaffId()));
handoverStaffDTO.setHaobanFriendCount(handoverStaffDTO.getFriendCount());
if(qdto.getNoClerkInfoFlag()==0) {
ClerkDTO clerk = this.clerkService.getClerkByClerkIdNodel(handoverStaffDTO.getClerkId()) ;
if(null != clerk) {
if(StringUtils.isNotBlank(handoverStaffDTO.getClerkId())) {
ClerkDTO clerk = this.clerkService.getClerkByClerkIdNodel(handoverStaffDTO.getClerkId());
if (null != clerk) {
handoverStaffDTO.setClerkName(clerk.getClerkName());
handoverStaffDTO.setClerkCode(clerk.getClerkCode());
}
}
}
return retList;
}else {
List<StaffClerkRelationDTO> list = this.staffClerkRelationMapper.listByStoreIds(wxEnterpriseId, Arrays.asList(storeId)) ;
List<HandoverStaffDTO> retList = EntityUtil.changeEntityListByJSON(HandoverStaffDTO.class, list) ;
if(CollectionUtils.isNotEmpty(retList)) {
List<String> staffIdList = retList.stream().map(HandoverStaffDTO::getStaffId).collect(Collectors.toList());
List<FriendCountBO> numList= this.externalClerkRelatedMapper.friendNum(staffIdList, storeId) ;
Map<String,Integer> map = numList.stream().collect(Collectors.toMap(FriendCountBO::getStaffId, FriendCountBO::getNum, (e, x) -> e));
for (HandoverStaffDTO handoverStaffDTO : retList) {
handoverStaffDTO.setFriendCount(map.get(handoverStaffDTO.getStaffId()));
handoverStaffDTO.setHaobanFriendCount(handoverStaffDTO.getFriendCount());
if(qdto.getNoClerkInfoFlag()==0) {
ClerkDTO clerk = this.clerkService.getClerkByClerkIdNodel(handoverStaffDTO.getClerkId());
if (null != clerk) {
handoverStaffDTO.setClerkName(clerk.getClerkName());
handoverStaffDTO.setClerkCode(clerk.getClerkCode());
}
}
}
}
return retList ;
}
return retList ;
}
@Override
......@@ -114,6 +124,7 @@ public class HaobanHandoverServiceImpl implements HaobanHandoverService {
this.memberTransferLogMapper.insertBatch(transferList) ;
}
@Override
public void saveHandover(HandoverSaveDTO dto) {
TabHandoverTransfer transfer = EntityUtil.changeEntityByJSON(TabHandoverTransfer.class, dto) ;
......
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