@ -63,7 +63,7 @@ public class CommonUtil {
public static String makeUpdateSql ( String tableName , Map < String , Object > map , Map < String , Object > condition ) {
public static String makeUpdateSql ( String tableName , Map < String , Object > map , Map < String , Object > condition ) {
String updateSql = "update " + tableName + " set " ;
String updateSql = "update " + tableName + " set " ;
for ( Map . Entry < String , Object > e : map . entrySet ( ) ) {
for ( Map . Entry < String , Object > e : map . entrySet ( ) ) {
if ( e . getValue ( ) ! = null & & ! "" . equals ( e . getValue ( ) ) ) {
if ( e . getValue ( ) ! = null & & ! "" . equals ( e . getValue ( ) ) & & ! e . getKey ( ) . equals ( "id" ) ) {
updateSql = updateSql + e . getKey ( ) + "='" + e . getValue ( ) . toString ( ) + "'," ;
updateSql = updateSql + e . getKey ( ) + "='" + e . getValue ( ) . toString ( ) + "'," ;
}
}
}
}
@ -111,11 +111,10 @@ public class CommonUtil {
* 获 得 包 含 该 人 员 的 适 用 范 围 的 模 块 的 数 据 id , 按 照 人 员 - 人 员 分 组 - 部 门 - 分 部 优 先 级 取 到 最 优 先 的
* 获 得 包 含 该 人 员 的 适 用 范 围 的 模 块 的 数 据 id , 按 照 人 员 - 人 员 分 组 - 部 门 - 分 部 优 先 级 取 到 最 优 先 的
* @param resourceId
* @param resourceId
* @param modeId
* @param modeId
* @param startDate
* @param date
* @param endDate
* @return
* @return
* /
* /
public static Set < String > getDataIds ( String resourceId , String modeId , String startDate, String en dD ate) {
public static Set < String > getDataIds ( String resourceId , String modeId , String date) {
String sql = "select dxlx,dataid,dx from uf_jcl_syzz where modeid=?" ;
String sql = "select dxlx,dataid,dx from uf_jcl_syzz where modeid=?" ;
List < Map < String , Object > > organizationList = DbTools . getSqlToList ( sql , modeId ) ;
List < Map < String , Object > > organizationList = DbTools . getSqlToList ( sql , modeId ) ;
@ -145,7 +144,7 @@ public class CommonUtil {
sql = "select mainid,empid,filters,bdate,edate,sqltj from uf_ryqz_dt1 where mainid in (" + String . join ( "," , personGroupIds ) + ")" ;
sql = "select mainid,empid,filters,bdate,edate,sqltj from uf_ryqz_dt1 where mainid in (" + String . join ( "," , personGroupIds ) + ")" ;
log . debug ( "query personGroupData : {}" , sql ) ;
log . debug ( "query personGroupData : {}" , sql ) ;
List < Map < String , Object > > personGroupData = DbTools . getSqlToList ( sql ) ;
List < Map < String , Object > > personGroupData = DbTools . getSqlToList ( sql ) ;
Set < String > personnelGroupIds = PersongroupCommonUtil . getPersonnelGroupingByPerson ( personGroupData , resourceId , startDate, en dD ate) ;
Set < String > personnelGroupIds = PersongroupCommonUtil . getPersonnelGroupingByPerson ( personGroupData , resourceId , date) ;
log . debug ( "personnelGroupIds : {}" , personnelGroupIds ) ;
log . debug ( "personnelGroupIds : {}" , personnelGroupIds ) ;
for ( Map < String , Object > personGroupOrganization : personGroupOrganizationList ) {
for ( Map < String , Object > personGroupOrganization : personGroupOrganizationList ) {
String personnelGroupId = Util . null2String ( personGroupOrganization . get ( "dx" ) ) . split ( "-" ) [ 0 ] ;
String personnelGroupId = Util . null2String ( personGroupOrganization . get ( "dx" ) ) . split ( "-" ) [ 0 ] ;
@ -196,11 +195,10 @@ public class CommonUtil {
* 获 得 包 含 该 人 员 的 适 用 范 围 的 模 块 的 所 有 数 据 id , 给 班 次 适 用 范 围 用
* 获 得 包 含 该 人 员 的 适 用 范 围 的 模 块 的 所 有 数 据 id , 给 班 次 适 用 范 围 用
* @param resourceId
* @param resourceId
* @param modeId
* @param modeId
* @param startDate
* @param date
* @param endDate
* @return
* @return
* /
* /
public static Set < String > getAllDataIds ( String resourceId , String modeId , String startDate, String en dD ate) {
public static Set < String > getAllDataIds ( String resourceId , String modeId , String date) {
String sql = "select dxlx,dataid,dx from uf_jcl_syzz where modeid=?" ;
String sql = "select dxlx,dataid,dx from uf_jcl_syzz where modeid=?" ;
List < Map < String , Object > > organizationList = DbTools . getSqlToList ( sql , modeId ) ;
List < Map < String , Object > > organizationList = DbTools . getSqlToList ( sql , modeId ) ;
@ -230,7 +228,7 @@ public class CommonUtil {
sql = "select mainid,empid,filters,bdate,edate,sqltj from uf_ryqz_dt1 where mainid in (" + String . join ( "," , personGroupIds ) + ")" ;
sql = "select mainid,empid,filters,bdate,edate,sqltj from uf_ryqz_dt1 where mainid in (" + String . join ( "," , personGroupIds ) + ")" ;
log . debug ( "query personGroupData : {}" , sql ) ;
log . debug ( "query personGroupData : {}" , sql ) ;
List < Map < String , Object > > personGroupData = DbTools . getSqlToList ( sql ) ;
List < Map < String , Object > > personGroupData = DbTools . getSqlToList ( sql ) ;
Set < String > personnelGroupIds = PersongroupCommonUtil . getPersonnelGroupingByPerson ( personGroupData , resourceId , startDate, en dD ate) ;
Set < String > personnelGroupIds = PersongroupCommonUtil . getPersonnelGroupingByPerson ( personGroupData , resourceId , date) ;
log . debug ( "personnelGroupIds : {}" , personnelGroupIds ) ;
log . debug ( "personnelGroupIds : {}" , personnelGroupIds ) ;
for ( Map < String , Object > personGroupOrganization : personGroupOrganizationList ) {
for ( Map < String , Object > personGroupOrganization : personGroupOrganizationList ) {
String personnelGroupId = Util . null2String ( personGroupOrganization . get ( "dx" ) ) . split ( "-" ) [ 0 ] ;
String personnelGroupId = Util . null2String ( personGroupOrganization . get ( "dx" ) ) . split ( "-" ) [ 0 ] ;
@ -521,6 +519,9 @@ public class CommonUtil {
sqltj = sqltj . replace ( "a n d " , "and" ) ;
sqltj = sqltj . replace ( "a n d " , "and" ) ;
sqltj = sqltj . replace ( "o r " , "or" ) ;
sqltj = sqltj . replace ( "o r " , "or" ) ;
sqltj = sqltj . replace ( "j o i n " , "join" ) ;
sqltj = sqltj . replace ( "j o i n " , "join" ) ;
sqltj = sqltj . replace ( "l i k e " , "like" ) ;
sqltj = sqltj . replace ( "i n " , "in" ) ;
sqltj = sqltj . replace ( "u n i o n " , "in" ) ;
log . info ( "getPersonnelGroupingByPerson sqltj : [{}]" , sqltj ) ;
log . info ( "getPersonnelGroupingByPerson sqltj : [{}]" , sqltj ) ;
List < Map < String , Object > > dataList = DbTools . getSqlToList ( sqltj ) ;
List < Map < String , Object > > dataList = DbTools . getSqlToList ( sqltj ) ;
for ( Map < String , Object > dataMap : dataList ) {
for ( Map < String , Object > dataMap : dataList ) {
@ -597,6 +598,9 @@ public class CommonUtil {
sqltj = sqltj . replace ( "a n d " , "and" ) ;
sqltj = sqltj . replace ( "a n d " , "and" ) ;
sqltj = sqltj . replace ( "o r " , "or" ) ;
sqltj = sqltj . replace ( "o r " , "or" ) ;
sqltj = sqltj . replace ( "j o i n " , "join" ) ;
sqltj = sqltj . replace ( "j o i n " , "join" ) ;
sqltj = sqltj . replace ( "l i k e " , "like" ) ;
sqltj = sqltj . replace ( "i n " , "in" ) ;
sqltj = sqltj . replace ( "u n i o n " , "in" ) ;
log . info ( "getPersonnelGroupingByPerson sqltj : [{}]" , sqltj ) ;
log . info ( "getPersonnelGroupingByPerson sqltj : [{}]" , sqltj ) ;
List < Map < String , Object > > dataList = DbTools . getSqlToList ( sqltj ) ;
List < Map < String , Object > > dataList = DbTools . getSqlToList ( sqltj ) ;
for ( Map < String , Object > dataMap : dataList ) {
for ( Map < String , Object > dataMap : dataList ) {
@ -655,7 +659,7 @@ public class CommonUtil {
* /
* /
public static String getRqlx ( String userId , String date ) {
public static String getRqlx ( String userId , String date ) {
String modeId = Utils . getFormmodeIdMap ( ) . get ( "uf_jcl_kq_rlmc" ) ;
String modeId = Utils . getFormmodeIdMap ( ) . get ( "uf_jcl_kq_rlmc" ) ;
Set < String > calendarSetIdsSets = CommonUtil . getDataIds ( userId , modeId , DateUtil . getCurrentDate ( ) ,DateUtil . getCurrentDate ( ) );
Set < String > calendarSetIdsSets = CommonUtil . getDataIds ( userId , modeId , DateUtil . getCurrentDate ( ) );
log . debug ( "getRqlx calendarSetIdsSets : [{}]" , calendarSetIdsSets ) ;
log . debug ( "getRqlx calendarSetIdsSets : [{}]" , calendarSetIdsSets ) ;
String rqlx = "" ;
String rqlx = "" ;
if ( calendarSetIdsSets . size ( ) > 0 ) {
if ( calendarSetIdsSets . size ( ) > 0 ) {
@ -686,7 +690,7 @@ public class CommonUtil {
* /
* /
public static List < Map < String , Object > > getYearCalendarList ( String userId , String year ) {
public static List < Map < String , Object > > getYearCalendarList ( String userId , String year ) {
String modeId = Utils . getFormmodeIdMap ( ) . get ( "uf_jcl_kq_rlmc" ) ;
String modeId = Utils . getFormmodeIdMap ( ) . get ( "uf_jcl_kq_rlmc" ) ;
Set < String > calendarSetIdsSets = CommonUtil . getDataIds ( userId , modeId , DateUtil . getCurrentDate ( ) ,DateUtil . getCurrentDate ( ) );
Set < String > calendarSetIdsSets = CommonUtil . getDataIds ( userId , modeId , DateUtil . getCurrentDate ( ) );
log . debug ( "getRqlx calendarSetIdsSets : [{}]" , calendarSetIdsSets ) ;
log . debug ( "getRqlx calendarSetIdsSets : [{}]" , calendarSetIdsSets ) ;
List < Map < String , Object > > resultList = Lists . newArrayList ( ) ;
List < Map < String , Object > > resultList = Lists . newArrayList ( ) ;
if ( calendarSetIdsSets . size ( ) > 0 ) {
if ( calendarSetIdsSets . size ( ) > 0 ) {
@ -792,7 +796,9 @@ public class CommonUtil {
Map < String , List < Map < String , Object > > > detailDataGroupMap = DbTools . getSqlToList ( sql ) . stream ( ) . collect ( Collectors . groupingBy ( e - > e . get ( "id" ) . toString ( ) ) ) ;
Map < String , List < Map < String , Object > > > detailDataGroupMap = DbTools . getSqlToList ( sql ) . stream ( ) . collect ( Collectors . groupingBy ( e - > e . get ( "id" ) . toString ( ) ) ) ;
try {
try {
//打卡卡点扩展类
/ * *
* 打 卡 卡 点 扩 展 类
* /
List < AbstractAdjustClockPointAction > adjustClockPointAction = Lists . newArrayList ( ) ;
List < AbstractAdjustClockPointAction > adjustClockPointAction = Lists . newArrayList ( ) ;
List < Map < String , Object > > adjustClockPointActionResultList = dataList . stream ( ) . filter ( e - > "0" . equals ( e . get ( "jkdzsxlx" ) ) ) . sorted ( Comparator . comparing ( e - > Integer . valueOf ( e . get ( "zhsx" ) . toString ( ) ) ) ) . collect ( Collectors . toList ( ) ) ;
List < Map < String , Object > > adjustClockPointActionResultList = dataList . stream ( ) . filter ( e - > "0" . equals ( e . get ( "jkdzsxlx" ) ) ) . sorted ( Comparator . comparing ( e - > Integer . valueOf ( e . get ( "zhsx" ) . toString ( ) ) ) ) . collect ( Collectors . toList ( ) ) ;
for ( Map < String , Object > adjustClockPointActionMap : adjustClockPointActionResultList ) {
for ( Map < String , Object > adjustClockPointActionMap : adjustClockPointActionResultList ) {
@ -810,6 +816,13 @@ public class CommonUtil {
adjustClockPointAction . add ( action ) ;
adjustClockPointAction . add ( action ) ;
}
}
ExtensionClassHolder . setAdjustClockPointAction ( adjustClockPointAction ) ;
ExtensionClassHolder . setAdjustClockPointAction ( adjustClockPointAction ) ;
/ * *
* 全 局 变 量 设 置
* /
sql = "select csm id,csz name from uf_jcl_kq_globalset where zt=0" ;
Map < String , Object > globalMap = DbTools . getSqlToMapList ( sql ) ;
ExtensionClassHolder . setGlobalSetMap ( globalMap ) ;
} catch ( Exception e ) {
} catch ( Exception e ) {
log . error ( "initExtensionClassHolder fail" ) ;
log . error ( "initExtensionClassHolder fail" ) ;
throw new AttendanceRunTimeException ( "初始化扩展类失败" ) ;
throw new AttendanceRunTimeException ( "初始化扩展类失败" ) ;
@ -904,7 +917,7 @@ public class CommonUtil {
sql = "select mainid,empid,filters,sqltj,bdate,edate from uf_ryqz_dt1 where mainid in (" + String . join ( "," , personGroupIds ) + ")" ;
sql = "select mainid,empid,filters,sqltj,bdate,edate from uf_ryqz_dt1 where mainid in (" + String . join ( "," , personGroupIds ) + ")" ;
List < Map < String , Object > > personGroupData = DbTools . getSqlToList ( sql ) ;
List < Map < String , Object > > personGroupData = DbTools . getSqlToList ( sql ) ;
Set < String > personnelGroupIds = PersongroupCommonUtil . getPersonnelGroupingByPerson ( personGroupData , empId , date , date );
Set < String > personnelGroupIds = PersongroupCommonUtil . getPersonnelGroupingByPerson ( personGroupData , empId , date );
for ( Map < String , Object > personGroupOrganization : personGroupOrganizationList ) {
for ( Map < String , Object > personGroupOrganization : personGroupOrganizationList ) {
String personnelGroupId = Util . null2String ( personGroupOrganization . get ( "dx" ) ) . split ( "-" ) [ 0 ] ;
String personnelGroupId = Util . null2String ( personGroupOrganization . get ( "dx" ) ) . split ( "-" ) [ 0 ] ;