@ -56,6 +56,8 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
private Emr_DictionaryMapper dictionaryMapper ;
@Autowired
private PaperPostionService paperPostionService ;
@Autowired
private TUuPrintMapper tUuPrintMapper ;
/ * *
* 在 院 列 表
* * /
@ -218,6 +220,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
Emr_Dictionary dictionary = new Emr_Dictionary ( ) ;
dictionary . setTypecode ( "dept_code" ) ;
List < Emr_Dictionary > dictionaries = dictionaryMapper . dicByTypeCode ( dictionary ) ;
StringBuilder patientIdStr = new StringBuilder ( ) ;
for ( Archive_Master_Vo masterVo : list ) {
//科室名称编码转名称
deptNameCode2Name ( dictionaries , masterVo ) ;
@ -228,6 +231,23 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
} else if ( status . equals ( EnumVerify . DocState . CallBacked . getCode ( ) ) ) {
masterVo . setStatus ( EnumVerify . DocState . CallBacked . getName ( ) ) ;
}
if ( StringUtils . isNotBlank ( patientIdStr ) ) {
patientIdStr . append ( "," ) ;
}
masterVo . setPrintStatus ( "否" ) ;
patientIdStr . append ( masterVo . getPatientId ( ) ) ;
}
//设置打印状态
List < TUuPrint > tUuPrints = tUuPrintMapper . selectAllByPatientId ( patientIdStr . toString ( ) ) ;
if ( ! CollectionUtils . isEmpty ( tUuPrints ) ) {
for ( Archive_Master_Vo masterVo : list ) {
for ( TUuPrint tUuPrint : tUuPrints ) {
if ( tUuPrint . getPatientId ( ) . equals ( masterVo . getPatientId ( ) ) ) {
masterVo . setPrintStatus ( "是" ) ;
break ;
}
}
}
}
}
return list ;
@ -270,9 +290,10 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
//组织完整性字段并完整的更新archive_master表的完整性字段值为完整LockInfo='完整'
//updateMasterBySuccess(list);
//转换科室与赋值超期天数
selectByColumnChange( list ) ;
String patientIds = selectByColumnChange( list ) ;
//根据状态code转换状态及判断显示按钮
if ( null ! = list & & ! list . isEmpty ( ) ) {
List < TUuPrint > tUuPrints = tUuPrintMapper . selectAllByPatientId ( patientIds ) ;
//查询流转角色集合
List < ArchiveFlowRole > flowRoles = flowRoleMapper . selectAll ( ) ;
//计算属于哪种审核角色
@ -297,6 +318,17 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
masterVo . setBtns ( btns ) ;
}
}
//定义打印状态
String printStatus = "否" ;
if ( ! CollectionUtils . isEmpty ( tUuPrints ) ) {
for ( TUuPrint tUuPrint : tUuPrints ) {
if ( tUuPrint . getPatientId ( ) . equals ( masterVo . getPatientId ( ) ) ) {
printStatus = "是" ;
break ;
}
}
}
masterVo . setPrintStatus ( printStatus ) ;
}
}
}
@ -346,11 +378,12 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
}
/ * *
* 出 院 浏 览 转 换 科 室 中 文 、 查 询 天 数
* 出 院 浏 览 转 换 科 室 中 文 、 查 询 天 数 , 赋 值 打 印 状 态
*
* @param list
* /
private void selectByColumnChange ( List < Archive_Master_Vo > list ) {
private String selectByColumnChange ( List < Archive_Master_Vo > list ) {
StringBuilder patientIdStr = new StringBuilder ( ) ;
if ( ! CollectionUtils . isEmpty ( list ) ) {
//查询科室集合
Emr_Dictionary dictionary = new Emr_Dictionary ( ) ;
@ -363,7 +396,6 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
} else {
selectDays = archiveMasterMapper . selectDaysByMasterIds ( list ) ;
}
for ( Archive_Master_Vo vo : list ) {
//科室名称编码转名称
deptNameCode2Name ( dictionaries , vo ) ;
@ -376,8 +408,13 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
}
}
}
if ( StringUtils . isNotBlank ( patientIdStr ) ) {
patientIdStr . append ( "," ) ;
}
patientIdStr . append ( vo . getPatientId ( ) ) ;
}
}
return patientIdStr . toString ( ) ;
}
/ * *