80 lines
3.1 KiB
Java
80 lines
3.1 KiB
Java
package weaver.formmode.customjavacode.modeexpand;
|
||
|
||
import java.util.HashMap;
|
||
import java.util.Map;
|
||
|
||
import weaver.conn.RecordSet;
|
||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||
import weaver.general.Util;
|
||
import weaver.hrm.User;
|
||
import weaver.soa.workflow.request.RequestInfo;
|
||
|
||
|
||
/**
|
||
* 说明
|
||
* 修改时
|
||
* 类名要与文件名保持一致
|
||
* class文件存放位置与路径保持一致。
|
||
* 请把编译后的class文件,放在对应的目录中才能生效
|
||
* 注意 同一路径下java名不能相同。
|
||
* @author Administrator
|
||
*
|
||
*/
|
||
public class KqsdExpandTemplate extends AbstractModeExpandJavaCodeNew {
|
||
/**
|
||
* 执行模块扩展动作
|
||
* @param param
|
||
* param包含(但不限于)以下数据
|
||
* user 当前用户
|
||
* importtype 导入方式(仅在批量导入的接口动作会传输) 1 追加,2覆盖,3更新,获取方式(int)param.get("importtype")
|
||
* 导入链接中拼接的特殊参数(仅在批量导入的接口动作会传输),比如a=1,可通过param.get("a")获取参数值
|
||
* 页面链接拼接的参数,比如b=2,可以通过param.get("b")来获取参数
|
||
* @return
|
||
*/
|
||
public Map<String, String> doModeExpand(Map<String, Object> param) {
|
||
Map<String, String> result = new HashMap<String, String>();
|
||
RecordSet rs = new RecordSet();
|
||
RecordSet rs1 = new RecordSet();
|
||
RecordSet rst = new RecordSet();
|
||
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){
|
||
//------请在下面编写业务逻辑代码------
|
||
rs.executeQuery("select * from uf_kqbbsd where id = ?",billid);
|
||
rs.next();
|
||
String deptid = Util.null2String(rs.getString("bm"));
|
||
String ksrq = Util.null2String(rs.getString("ksrq"));
|
||
String jsrq = Util.null2String(rs.getString("jsrq"));
|
||
int sfsd = Util.getIntValue(rs.getString("sfsd"),0);
|
||
|
||
rs1.executeQuery("select a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle,case when b.sfqr='0' then '是' else '否' end as sfqr, " +
|
||
"b.kqdate " +
|
||
"from hrmresource a, kq_format_total b " +
|
||
"where a.id= b.resourceid and b.kqdate >='"+ksrq+"' and b.kqdate <='"+jsrq+"' " +
|
||
"and a.loginid is not null and a.loginid<>'' and (a.status = 0 or a.status = 1 or a.status = 2 or a.status = 3) and a.departmentid ="+deptid);
|
||
while(rs1.next()){
|
||
String mxid = Util.null2String(rs1.getString("id"));
|
||
String kqdate = Util.null2String(rs1.getString("kqdate"));
|
||
|
||
rst.executeUpdate("update kq_format_total set sfqr=? where resourceid = ? and kqdate = ?",sfsd,mxid,kqdate);
|
||
|
||
}
|
||
|
||
rst.executeUpdate("delete from uf_kqbbsdtxjlb where ksrq=? and bm=?",ksrq,deptid);
|
||
|
||
}
|
||
}
|
||
} catch (Exception e) {
|
||
result.put("errmsg","自定义出错信息");
|
||
result.put("flag", "false");
|
||
}
|
||
return result;
|
||
}
|
||
|
||
} |