@ -10,6 +10,7 @@ import com.engine.organization.entity.staff.bo.StaffPlanBO;
import com.engine.organization.entity.staff.param.StaffPlanSearchParam ;
import com.engine.organization.entity.staff.param.StaffPlanSearchParam ;
import com.engine.organization.entity.staff.po.StaffPlanPO ;
import com.engine.organization.entity.staff.po.StaffPlanPO ;
import com.engine.organization.entity.staff.vo.StaffPlanTableVO ;
import com.engine.organization.entity.staff.vo.StaffPlanTableVO ;
import com.engine.organization.exception.OrganizationRunTimeException ;
import com.engine.organization.mapper.staff.StaffPlanMapper ;
import com.engine.organization.mapper.staff.StaffPlanMapper ;
import com.engine.organization.service.StaffPlanService ;
import com.engine.organization.service.StaffPlanService ;
import com.engine.organization.util.* ;
import com.engine.organization.util.* ;
@ -73,8 +74,8 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
Date startDate = DateUtil . parseToDate ( timeStart ) ;
Date startDate = DateUtil . parseToDate ( timeStart ) ;
Date endDate = DateUtil . parseToDate ( timeEnd ) ;
Date endDate = DateUtil . parseToDate ( timeEnd ) ;
OrganizationAssert . isFalse ( startDate . after ( endDate ) , "开始时间不允许在结束时间之后" ) ;
OrganizationAssert . isFalse ( startDate . after ( endDate ) , "开始时间不允许在结束时间之后" ) ;
StaffPlanPO staffPlanPO1 = getStaffPlanMapper ( ) . customSelect ( param . getTimeStart ( ) , param . getTimeEnd ( ) , param . getEcCompany ( ) , param . getControlDimension ( ) ) ;
List< StaffPlanPO> staffPlanPO1 = getStaffPlanMapper ( ) . customSelect ( param . getTimeStart ( ) , param . getTimeEnd ( ) , param . getEcCompany ( ) , param . getControlDimension ( ) ) ;
OrganizationAssert . is Null ( staffPlanPO1 , "同一维度下,相同适用公司编制方案的时间段不允许出现交叉" ) ;
OrganizationAssert . is Empty ( staffPlanPO1 , "同一维度下,相同适用公司编制方案的时间段不允许出现交叉" ) ;
return getStaffPlanMapper ( ) . insertIgnoreNull ( staffPlanPO ) ;
return getStaffPlanMapper ( ) . insertIgnoreNull ( staffPlanPO ) ;
}
}
@ -94,8 +95,10 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
Date startDate = DateUtil . parseToDate ( timeStart ) ;
Date startDate = DateUtil . parseToDate ( timeStart ) ;
Date endDate = DateUtil . parseToDate ( timeEnd ) ;
Date endDate = DateUtil . parseToDate ( timeEnd ) ;
OrganizationAssert . isFalse ( startDate . after ( endDate ) , "开始时间不允许在结束时间之后" ) ;
OrganizationAssert . isFalse ( startDate . after ( endDate ) , "开始时间不允许在结束时间之后" ) ;
StaffPlanPO staffPlanPO1 = getStaffPlanMapper ( ) . customSelect ( param . getTimeStart ( ) , param . getTimeEnd ( ) , param . getEcCompany ( ) , param . getControlDimension ( ) ) ;
List < StaffPlanPO > staffPlanPO1 = getStaffPlanMapper ( ) . customSelect ( param . getTimeStart ( ) , param . getTimeEnd ( ) , param . getEcCompany ( ) , param . getControlDimension ( ) ) ;
OrganizationAssert . isNull ( staffPlanPO1 , "同一维度下,相同适用公司编制方案的时间段不允许出现交叉" ) ;
if ( staffPlanPO1 . size ( ) > 1 ) {
throw new OrganizationRunTimeException ( "同一维度下,相同适用公司编制方案已存在" ) ;
}
// 多选赋值
// 多选赋值
staffPlanPO . setCompanyId ( staffPlanPO . getEcCompany ( ) ) ;
staffPlanPO . setCompanyId ( staffPlanPO . getEcCompany ( ) ) ;
return getStaffPlanMapper ( ) . updateStaffPlan ( staffPlanPO ) ;
return getStaffPlanMapper ( ) . updateStaffPlan ( staffPlanPO ) ;