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.
58 lines
2.6 KiB
Java
58 lines
2.6 KiB
Java
3 years ago
|
package weaver.formmode.organization.modeexpand;
|
||
3 years ago
|
|
||
|
import com.engine.organization.util.OrganizationDateUtil;
|
||
|
import weaver.conn.RecordSet;
|
||
|
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||
|
import weaver.general.Util;
|
||
|
import weaver.hrm.User;
|
||
|
import weaver.soa.workflow.request.RequestInfo;
|
||
|
|
||
|
import java.sql.Date;
|
||
|
import java.util.HashMap;
|
||
|
import java.util.Map;
|
||
|
|
||
|
/**
|
||
|
* 虚拟组织删除map表接口
|
||
|
*/
|
||
|
public class VODeleteModeExpand extends AbstractModeExpandJavaCodeNew {
|
||
|
|
||
|
public Map<String, String> doModeExpand(Map<String, Object> param) {
|
||
|
Map<String, String> result = new HashMap<String, String>();
|
||
|
try {
|
||
|
User user = (User) param.get("user");
|
||
|
int billid = -1;//数据id
|
||
|
int modeid = -1;//模块id
|
||
|
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
|
||
|
if (requestInfo != null) {
|
||
|
billid = Util.getIntValue(requestInfo.getRequestid());
|
||
|
modeid = Util.getIntValue(requestInfo.getWorkflowid());
|
||
|
if (billid > 0 && modeid > 0) {
|
||
|
//------请在下面编写业务逻辑代码------
|
||
|
String billids = (String) param.get("billids");
|
||
|
String[] billidsTmp = billids.split(",");
|
||
|
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
||
|
for (String id : billidsTmp) {
|
||
|
RecordSet rs = new RecordSet();
|
||
|
rs.executeQuery("select id, fid, fecid, fname, ftype, forder, fparentid, fdate from uf_jcl_org_vir where id ='" + id + "'");
|
||
3 years ago
|
RecordSet recordSet = new RecordSet();
|
||
3 years ago
|
if (rs.next()) {
|
||
|
String ftype = rs.getString("ftype");
|
||
|
String fdate = rs.getString("fdate");
|
||
|
String delsql = "delete JCL_ORG_MAP where id=" + id + " and ftype='" + ftype + "' and fisvitual='1' and fdatebegin='" + fdate + "'";
|
||
|
recordSet.execute(delsql);
|
||
|
String updatesql = "update JCL_ORG_MAP set fdateend=' " + new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()) +
|
||
|
"' where id=" + id + " and ftype='" + ftype + "' and fisvitual='1' and fdateend > '" +fdate + "'";
|
||
|
recordSet.execute(updatesql);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
} catch (Exception e) {
|
||
|
result.put("errmsg", "自定义出错信息");
|
||
|
result.put("flag", "false");
|
||
|
}
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
}
|