@ -39,22 +39,32 @@ public class BatchAskForLeaveWorkFlowSubmitAction implements Action {
public String execute ( RequestInfo requestInfo ) {
String requestid = requestInfo . getRequestid ( ) ;
int billid = requestInfo . getRequestManager ( ) . getBillid ( ) ;
// String requestid = "921921";
// int billid = 62;
log . info ( "billid : [{}]" , billid ) ;
User user = new User ( Integer . parseInt ( "1" ) ) ;
try {
// 流程表单主表数据
HashMap < String , String > mainTableData = CommonUtil . getMainTableInfo ( requestInfo , WorkFlowTypeEnum . ASKFORLEAVE ) ;
HashMap < String , String > mainTableData = CommonUtil . getMainTableInfo ( requestInfo , WorkFlowTypeEnum . ASKFORLEAVE , requestInfo . getWorkflowid ( ) ) ;
// String querysql = "select * from formtable_main_228 where id=?";
// Map<String,Object> mainTableData = DbTools.getSqlToMap(querysql,billid);
log . info ( "mainTableData : [{}]" , mainTableData ) ;
// 流程表单明细表1数据
List < Map < String , String > > detailTableData = CommonUtil . getDetailTableInfo ( requestInfo , 0 , WorkFlowTypeEnum . ASKFORLEAVE ) ;
List < Map < String , String > > detailTableData = CommonUtil . getDetailTableInfo ( requestInfo , 0 , WorkFlowTypeEnum . ASKFORLEAVE , requestInfo . getWorkflowid ( ) ) ;
// querysql = "select * from formtable_main_228_dt1 where mainid=?";
//List<Map<String, String>> detailTableData = DbTools.getSqlToListStr(querysql,billid);
log . info ( "detailTableData : [{}]" , detailTableData ) ;
String detail1TableName = CommonUtil . getDetailTableInfoTableName ( requestInfo . getDetailTableInfo ( ) . getDetailTable ( ) [ 0 ] . getTableDBName ( ) , 0 , WorkFlowTypeEnum . ASKFORLEAVE ) ;
String detail1TableName = CommonUtil . getDetailTableInfoTableName ( requestInfo . getDetailTableInfo ( ) . getDetailTable ( ) [ 0 ] . getTableDBName ( ) , 0 , WorkFlowTypeEnum . ASKFORLEAVE , requestInfo . getWorkflowid ( ) ) ;
//String detail1TableName = "formtable_main_228_dt1";
log . info ( "detail1TableName : [{}]" , detail1TableName ) ;
String detail2TableName = CommonUtil . getDetailTableInfoTableName ( requestInfo . getDetailTableInfo ( ) . getDetailTable ( ) [ 1 ] . getTableDBName ( ) , 1 , WorkFlowTypeEnum . ASKFORLEAVE ) ;
String detail2TableName = CommonUtil . getDetailTableInfoTableName ( requestInfo . getDetailTableInfo ( ) . getDetailTable ( ) [ 1 ] . getTableDBName ( ) , 1 , WorkFlowTypeEnum . ASKFORLEAVE , requestInfo . getWorkflowid ( ) ) ;
//String detail2TableName= "formtable_main_228_dt2";
log . info ( "detail2TableName : [{}]" , detail2TableName ) ;
//流程表单明细表3数据
List < Map < String , String > > detailTable3Data = CommonUtil . getDetailTableInfo ( requestInfo , 2 , WorkFlowTypeEnum . ASKFORLEAVE ) ;
List < Map < String , String > > detailTable3Data = CommonUtil . getDetailTableInfo ( requestInfo , 2 , WorkFlowTypeEnum . ASKFORLEAVE , requestInfo . getWorkflowid ( ) ) ;
//querysql = "select * from formtable_main_228_dt3 where mainid=?";
//List<Map<String, String>> detailTable3Data = DbTools.getSqlToListStr(querysql,billid);
log . info ( "detailTable3Data : [{}]" , detailTable3Data ) ;
//20241127需求变更, 明细表1存在数据时, 直接走原有校验逻辑; 明细表1没有数据时, 就根据明细表3重新生成明细表1数据, 然后继续原有校验逻辑
Map < String , Object > params = new HashMap < > ( ) ;
@ -105,7 +115,7 @@ public class BatchAskForLeaveWorkFlowSubmitAction implements Action {
log . info ( "insertDetail1List : [{}]" , insertDetail1List ) ;
String deleteSql = "delete from " + detail1TableName + " where mainid=?" ;
if ( insertDetail1List . size ( ) > 0 & & DbTools . update ( deleteSql , mainTableData . get ( "id" ) ) & & ! CommonUtil . insertBatch ( insertDetail1List , detail1TableName ) ) {
//更新流程明细表2失败
//更新流程明细表2失败
String message = "新增流程明细表1失败" ;
log . error ( message ) ;
requestInfo . getRequestManager ( ) . setMessageid ( "11111" + requestid + "22222" ) ;
@ -145,7 +155,7 @@ public class BatchAskForLeaveWorkFlowSubmitAction implements Action {
empIdToName = data . stream ( ) . collect ( Collectors . toMap ( e - > Util . null2String ( e . get ( "id" ) ) , e - > Util . null2String ( e . get ( "lastname" ) ) ) ) ;
}
//获取假期类型的考勤项目
sql = "select id, mc, hsdw, zdyzsl, yxyz from uf_jcl_kq_kqxm where xmlx=?";
sql = "select id, mc, hsdw, zdyzsl, yxyz ,qzsyyxjb,jcbyxsyqjb,yxsydjb from uf_jcl_kq_kqxm where xmlx=?";
List < Map < String , Object > > holidayItemList = DbTools . getSqlToList ( sql , AttendanceItemTypeEnum . HOLIDAY . getKey ( ) ) ;
Map < String , Map < String , Object > > kqxmInfo = holidayItemList . stream ( ) . collect ( Collectors . toMap ( e - > Util . null2String ( e . get ( "id" ) ) , e - > e ) ) ;
@ -164,12 +174,7 @@ public class BatchAskForLeaveWorkFlowSubmitAction implements Action {
for ( Map . Entry < String , List < Map < String , String > > > entry : detail1TabDataGroupByJqlx . entrySet ( ) ) {
if ( checkAmountJqIdList . contains ( entry . getKey ( ) ) ) {
sql = "select id,jqid,sxrq,ktsc,yxsc,wxsc,yqsxrq,ztsc,ygid from uf_jcl_kq_jqye where jqid=? and sxrq <= ? order by yqsxrq, modedatacreatedate, modedatacreatetime" ;
List < Map < String , Object > > holidayBalanceList = DbTools . getSqlToList ( sql , entry . getKey ( ) , minStartDate ) ;
if ( holidayBalanceList . size ( ) > 0 ) {
holidayBalanceMap . putAll ( holidayBalanceList . stream ( ) . collect ( Collectors . toMap ( e - > e . get ( "id" ) . toString ( ) , e - > e ) ) ) ;
jqlxToJqye . put ( entry . getKey ( ) , holidayBalanceList ) ;
}
sql = "select id,mc,hsdw,hsl,jcbyxsyqjb,yxsydjb,qzsyyxjb from uf_jcl_kq_kqxm where id=?" ;
Map < String , Object > holidayItem = DbTools . getSqlToMap ( sql , entry . getKey ( ) ) ;
//假期核算单位
@ -200,7 +205,22 @@ public class BatchAskForLeaveWorkFlowSubmitAction implements Action {
//收集使用该假期类型的人员id
empIds . add ( Util . null2String ( detailData . get ( "qjr" ) ) ) ;
}
List < Map < String , Object > > holidayPriorityItemList = Lists . newArrayList ( ) ;
CommonUtil . getHolidayPriorityItem ( holidayPriorityItemList , kqxmInfo , holidayItem ) ;
jqlxToEmpIds . put ( entry . getKey ( ) , empIds ) ;
for ( Map < String , Object > map : holidayPriorityItemList ) {
jqlxToEmpIds . put ( map . get ( "id" ) . toString ( ) , empIds ) ;
}
holidayPriorityItemList . add ( holidayItem ) ;
for ( Map < String , Object > holidayPriorityItem : holidayPriorityItemList ) {
sql = "select id,jqid,sxrq,ktsc,yxsc,wxsc,yqsxrq,ztsc,ygid from uf_jcl_kq_jqye where jqid=? and sxrq <= ? order by yqsxrq, modedatacreatedate, modedatacreatetime" ;
List < Map < String , Object > > holidayBalanceList = DbTools . getSqlToList ( sql , holidayPriorityItem . get ( "id" ) , minStartDate ) ;
if ( holidayBalanceList . size ( ) > 0 ) {
holidayBalanceMap . putAll ( holidayBalanceList . stream ( ) . collect ( Collectors . toMap ( e - > e . get ( "id" ) . toString ( ) , e - > e ) ) ) ;
jqlxToJqye . put ( holidayPriorityItem . get ( "id" ) . toString ( ) , holidayBalanceList ) ;
}
}
}
}
//校验假期余额使用是否满足要求,并且区分核算单位“天”和“小时”