You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
package weaver.interfaces.kr.workflow.action ;
import weaver.conn.RecordSet ;
import weaver.interfaces.workflow.action.Action ;
import weaver.soa.workflow.request.MainTableInfo ;
import weaver.soa.workflow.request.Property ;
import weaver.soa.workflow.request.RequestInfo ;
/ * *
* @author : dxfeng
* @createTime : 2023 / 05 / 24
* @version : 1.0
* /
public class KrLeaveRepeatAction implements Action {
@Override
public String execute ( RequestInfo requestInfo ) {
MainTableInfo mainTableInfo = requestInfo . getMainTableInfo ( ) ;
String resourceId = "" ;
String leaveType = "" ;
Property [ ] properties = mainTableInfo . getProperty ( ) ;
for ( Property property : properties ) {
String name = property . getName ( ) ;
String value = property . getValue ( ) ;
switch ( name ) {
case "resourceId" :
resourceId = value ;
break ;
case "jqlx" :
leaveType = value ;
break ;
default :
break ;
}
}
String billTableName = requestInfo . getRequestManager ( ) . getBillTableName ( ) ;
RecordSet rs = new RecordSet ( ) ;
rs . executeQuery ( "select count(1) as num from " + billTableName + " a LEFT JOIN workflow_requestbase w ON a.requestid = w.requestid where a.resourceId = ? and a.jqlx =? and a.requestid != ? and w.currentnodetype IN ( 1, 2 )" , resourceId , leaveType , requestInfo . getRequestid ( ) ) ;
if ( rs . next ( ) ) {
int num = rs . getInt ( "num" ) ;
if ( num > 0 ) {
requestInfo . getRequestManager ( ) . setMessagecontent ( "当前人员存在未审批完成的请假审核流程,请勿重复提交" ) ;
return FAILURE_AND_CONTINUE ;
}
}
return SUCCESS ;
}
}