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.
50 lines
1.7 KiB
Java
50 lines
1.7 KiB
Java
2 years ago
|
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 + " where resourceId = ? and jqlx =? and spzt != 2", resourceId, leaveType);
|
||
|
if (rs.next()) {
|
||
|
int num = rs.getInt("num");
|
||
|
if (num > 0) {
|
||
|
requestInfo.getRequestManager().setMessagecontent("当前人员存在未审批完成的请假审核流程,请勿重复提交");
|
||
|
return FAILURE_AND_CONTINUE;
|
||
|
}
|
||
|
}
|
||
|
return SUCCESS;
|
||
|
}
|
||
|
}
|