@ -17,19 +17,17 @@ import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory ;
import com.engine.organization.util.db.MapperProxyFactory ;
import com.engine.organization.util.detach.DetachUtil ;
import com.engine.organization.util.detach.DetachUtil ;
import org.apache.commons.lang3.StringUtils ;
import org.apache.commons.lang3.StringUtils ;
import tebie.applib.api.O ;
import weaver.conn.RecordSet ;
import weaver.conn.RecordSet ;
import weaver.general.Util ;
import weaver.general.Util ;
import weaver.hrm.User ;
import weaver.hrm.User ;
import java.time.LocalDate ;
import java.time.LocalDateTime ;
import java.util.* ;
import java.util.* ;
import java.util.stream.Collectors ;
import java.util.stream.Collectors ;
/ * *
* @className : OrgChartServiceImpl
* @author : dengjp
* @date : 2022 / 7 / 7
* @description : 组 织 架 构 图 ServiceImpl
* * /
public class OrgChartServiceImpl extends Service implements OrgChartService {
public class OrgChartServiceImpl extends Service implements OrgChartService {
private RecordSet grs = new RecordSet ( ) ;
private RecordSet grs = new RecordSet ( ) ;
@ -67,7 +65,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
if ( detachUtil . isDETACH ( ) ) {
if ( detachUtil . isDETACH ( ) ) {
String jclRoleLevels = detachUtil . getJclRoleLevels ( ) ;
String jclRoleLevels = detachUtil . getJclRoleLevels ( ) ;
if ( StringUtils . isNotBlank ( jclRoleLevels ) ) {
if ( StringUtils . isNotBlank ( jclRoleLevels ) ) {
sql = "select id, fnumber, fname, ftype from jcl_org_map where getSubCompanyTree (ftype = 0 or (ftype = 1 and fobjid in(" + jclRoleLevels + "))) " ;
sql = "select id, fnumber, fname, ftype from jcl_org_map where (ftype = 0 or (ftype = 1 and fobjid in(" + jclRoleLevels + "))) " ;
} else {
} else {
sql = "select id, fnumber, fname, ftype from jcl_org_map where ftype = 0 " ;
sql = "select id, fnumber, fname, ftype from jcl_org_map where ftype = 0 " ;
}
}
@ -606,6 +604,22 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
return "同步成功" ;
return "同步成功" ;
}
}
@Override
public void insertChartVersion ( Integer fclass , String description ) {
RecordSet rs = new RecordSet ( ) ;
String recordDate = OrganizationDateUtil . getFormatLocalDateTime ( LocalDateTime . now ( ) ) ;
String createDate = OrganizationDateUtil . getFormatLocalDate ( LocalDate . now ( ) ) ;
rs . executeQuery ( "select id from JCL_ORG_CHARTVERSION where fclass = ? and createdate = ?" , fclass , createDate ) ;
rs . next ( ) ;
String id = Util . null2String ( rs . getString ( "id" ) ) ;
if ( StringUtils . isNotEmpty ( id ) ) {
rs . executeUpdate ( "update JCL_ORG_CHARTVERSION set recorddate = ?,description = ?,creator = ? where fclass = ? and createdate = ?" , recordDate , description , user . getUID ( ) , fclass , createDate ) ;
} else {
rs . executeUpdate ( "insert into JCL_ORG_CHARTVERSION (recorddate,description,creator,deletetype,createdate,fclass) values(?,?,?,?,?,?)" , recordDate , description , user . getUID ( ) , 0 , createDate , fclass ) ;
}
}
/ * *
/ * *
* 刷 新 在 岗 、 编 制 数
* 刷 新 在 岗 、 编 制 数
* /
* /