梅州三院基础数据同步加主管医生名字

master
宇宙皮皮娃 11 months ago
parent 1a20c03d01
commit b9b5e52f2b

@ -5,7 +5,9 @@ import com.docus.core.util.ObjectUtil;
import com.docus.infrastructure.redis.service.IdService;
import com.docus.server.archive.constans.SyncConstant;
import com.docus.server.archive.converter.MzsyPatientInfoConverter;
import com.docus.server.archive.entity.PowerUser;
import com.docus.server.archive.entity.TBasic;
import com.docus.server.archive.mapper.PowerUserMapper;
import com.docus.server.archive.mapper.TBasicMapper;
import com.docus.server.archive.service.PatientInfoSyncService;
import com.docus.server.mzsy.entity.MzsyPatientInfoView;
@ -30,6 +32,8 @@ public class MzsyPatientInfoSyncServiceImpl implements PatientInfoSyncService {
private MzsyPatientInfoViewMapper mzsyPatientInfoViewMapper;
@Resource
private IdService idService;
@Resource
private PowerUserMapper powerUserMapper;
@Override
public void syncByDisDate(LocalDateTime start, LocalDateTime end) {
@ -53,6 +57,17 @@ public class MzsyPatientInfoSyncServiceImpl implements PatientInfoSyncService {
List<TBasic> basicList = patientInfoViews.stream()
.map(MzsyPatientInfoConverter::convertPatientInfo)
.collect(Collectors.toList());
List<String> collect = basicList.stream().map(TBasic::getAttending).collect(Collectors.toList());
List<PowerUser> byUserNames = powerUserMapper.findByUserNames(collect);
if(ObjectUtil.isNotEmpty(byUserNames)){
Map<String, String> map = byUserNames.stream().collect(Collectors.toMap(PowerUser::getUserName, PowerUser::getName));
for (TBasic tBasic : basicList) {
String attending = tBasic.getAttending();
if(ObjectUtil.isNotEmpty(attending)) {
tBasic.setAttendingName(map.get(attending));
}
}
}
saveOrUpdate(basicList);
}
if (Func.isEmpty(patientInfoViews) || patientInfoViews.size() < size) {

@ -15,4 +15,7 @@ public interface MzsyPatientInfoViewMapper {
* @return
*/
List<MzsyPatientInfoView> pageByViwe(@Param("cyrqStart") String cyrqStart,@Param("startTime") String startTime,@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
}

Loading…
Cancel
Save