@ -124,9 +124,10 @@ public class StaffInfoImportUtil {
List < StaffPlanPO > staffPlanPOS = MapperProxyFactory . getProxy ( StaffPlanMapper . class ) . listByNo ( Util . null2String ( reallyValue ) ) ;
List < StaffPlanPO > staffPlanPOS = MapperProxyFactory . getProxy ( StaffPlanMapper . class ) . listByNo ( Util . null2String ( reallyValue ) ) ;
if ( CollectionUtils . isNotEmpty ( staffPlanPOS ) ) {
if ( CollectionUtils . isNotEmpty ( staffPlanPOS ) ) {
staffPlanPO = staffPlanPOS . get ( 0 ) ;
staffPlanPO = staffPlanPOS . get ( 0 ) ;
map . put ( "plan_id" , staffPlanPO . getId ( ) ) ;
map . put ( "plan_id" , staffPlanPO . getId ( ) ) ;
historyDetailPO . setRelatedName ( staffPlanPO . getPlanNo ( ) ) ;
historyDetailPO . setRelatedName ( staffPlanPO . getPlanNo ( ) ) ;
} else {
} else {
historyDetailPO . setRelatedName ( "" ) ;
historyDetailPO . setOperateDetail ( "编号:" + reallyValue + ",未找到对应数据" ) ;
historyDetailPO . setOperateDetail ( "编号:" + reallyValue + ",未找到对应数据" ) ;
historyDetailPO . setStatus ( "0" ) ;
historyDetailPO . setStatus ( "0" ) ;
OrgImportUtil . saveImportDetailLog ( historyDetailPO ) ;
OrgImportUtil . saveImportDetailLog ( historyDetailPO ) ;
@ -169,7 +170,7 @@ public class StaffInfoImportUtil {
}
}
for ( String s : split ) {
for ( String s : split ) {
parentDepartmentId = MapperProxyFactory . getProxy ( DepartmentMapper . class ) . getIdByNameAndPid ( s , parentCompanyId , parentDepartmentId = = null ? 0 : parentDepartmentId ) ;
parentDepartmentId = MapperProxyFactory . getProxy ( DepartmentMapper . class ) . getIdByNameAndPid ( s , parentCompanyId , parentDepartmentId = = null ? 0 : parentDepartmentId ) ;
if ( null = = parent Company Id) {
if ( null = = parent Department Id) {
historyDetailPO . setOperateDetail ( cellValue + "部门未找到对应数据" ) ;
historyDetailPO . setOperateDetail ( cellValue + "部门未找到对应数据" ) ;
historyDetailPO . setStatus ( "0" ) ;
historyDetailPO . setStatus ( "0" ) ;
OrgImportUtil . saveImportDetailLog ( historyDetailPO ) ;
OrgImportUtil . saveImportDetailLog ( historyDetailPO ) ;
@ -213,6 +214,15 @@ public class StaffInfoImportUtil {
map . put ( "job_id" , parentJobId ) ;
map . put ( "job_id" , parentJobId ) ;
}
}
// 编制数大于0
if ( "staff_num" . equals ( infoPO . getFieldName ( ) ) & & Integer . parseInt ( Util . null2String ( reallyValue ) ) < 0 ) {
historyDetailPO . setOperateDetail ( "编制数不可小于0" ) ;
historyDetailPO . setStatus ( "0" ) ;
OrgImportUtil . saveImportDetailLog ( historyDetailPO ) ;
continue nextRow ;
}
}
}
}
}
// 校验、数据交互
// 校验、数据交互
@ -226,6 +236,7 @@ public class StaffInfoImportUtil {
OrgImportUtil . saveImportDetailLog ( historyDetailPO ) ;
OrgImportUtil . saveImportDetailLog ( historyDetailPO ) ;
continue ;
continue ;
}
}
StaffSearchParam param = JSONObject . toJavaObject ( ( JSON ) JSONObject . toJSON ( map ) , StaffSearchParam . class ) ;
String controlDimension = staffPlanPO . getControlDimension ( ) ;
String controlDimension = staffPlanPO . getControlDimension ( ) ;
String checkMsg = "" ;
String checkMsg = "" ;
switch ( controlDimension ) {
switch ( controlDimension ) {
@ -233,6 +244,9 @@ public class StaffInfoImportUtil {
if ( null = = parentCompanyId ) {
if ( null = = parentCompanyId ) {
checkMsg = "编制维度选择分部时,分部必填!" ;
checkMsg = "编制维度选择分部时,分部必填!" ;
}
}
// 取消部门、岗位赋值
param . setDeptId ( null ) ;
param . setJobId ( null ) ;
break ;
break ;
case "2" : // 部门
case "2" : // 部门
if ( null = = parentCompanyId ) {
if ( null = = parentCompanyId ) {
@ -240,6 +254,8 @@ public class StaffInfoImportUtil {
} else if ( null = = parentDepartmentId ) {
} else if ( null = = parentDepartmentId ) {
checkMsg = "编制维度选择部门时,部门必填!" ;
checkMsg = "编制维度选择部门时,部门必填!" ;
}
}
// 取消岗位赋值
param . setJobId ( null ) ;
break ;
break ;
case "3" : // 岗位
case "3" : // 岗位
if ( null = = parentCompanyId ) {
if ( null = = parentCompanyId ) {
@ -254,16 +270,15 @@ public class StaffInfoImportUtil {
checkMsg = "编制方案数据有误,请确认" ;
checkMsg = "编制方案数据有误,请确认" ;
break ;
break ;
}
}
if ( StringUtils . isNotBlank ( checkMsg ) ) {
if ( StringUtils . isNotBlank ( checkMsg ) ) {
historyDetailPO . setOperateDetail ( checkMsg ) ;
historyDetailPO . setOperateDetail ( checkMsg ) ;
historyDetailPO . setStatus ( "0" ) ;
historyDetailPO . setStatus ( "0" ) ;
OrgImportUtil . saveImportDetailLog ( historyDetailPO ) ;
OrgImportUtil . saveImportDetailLog ( historyDetailPO ) ;
continue ;
continue ;
}
}
StaffSearchParam param = JSONObject . toJavaObject ( ( JSON ) JSONObject . toJSON ( map ) , StaffSearchParam . class ) ;
StaffPO staffPO = StaffBO . convertParamToPO ( param , ( long ) user . getUID ( ) ) ;
StaffPO staffPO = StaffBO . convertParamToPO ( param , ( long ) user . getUID ( ) ) ;
if ( null = = staffPO . getControlPolicy ( ) ) {
if ( null = = staffPO . getControlPolicy ( ) ) {
staffPO . setControlPolicy ( 1 ) ;
staffPO . setControlPolicy ( 1 ) ;
}
}
MapperProxyFactory . getProxy ( StaffMapper . class ) . insertIgnoreNull ( staffPO ) ;
MapperProxyFactory . getProxy ( StaffMapper . class ) . insertIgnoreNull ( staffPO ) ;