📄 jcy_pxxx_submit.jsp
字号:
<%@ page contentType="text/html; charset=GBK" language="java" import="java.sql.*,com.vstsoft.std.*" errorPage="" %>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<jsp:useBean id="jcypurview" class="com.vstsoft.jcypurview" scope = "session" />
<html>
<%vststd std = new vststd();%>
<%
String pxxxid_id = std.getValue(request,"ID"); // 培训代码
String szt = std.getValue(request,"zt"); // 按钮类别
//String sfzh= std.getValue(request,"sfzh"); // 身份证号
String userid =std.getValue(request,"userid"); // 人员编号
String imager = "";
String lry =""; //录入人
String lrsj = ""; //录入时间
int ixy = 0;
%>
<%
if (jcypurview.checkLogin() == false)
{
%>
<Script Language=javascript>
alert("用户已断线或未正常登录,请重新登录!")
window.open("../index.htm","_top")
</Script>
<% return;
}
if (szt.equals("del"))
{
if (jcypurview.purviewVerdict("B0500038") == false) //判断是否有删除权限
{
%>
<Script Language=javascript>
alert("您没有操作此页权限!")
window.open("../index.jsp","_top")
</Script>
<% return;
}
}
if (szt.equals("modify"))
{
if (jcypurview.purviewVerdict("B0500037") == false) //判断是否有修改权限
{
%>
<Script Language=javascript>
alert("您没有操作此页权限!")
window.open("../index.jsp","_top")
</Script>
<% return;
}
}
if (szt.equals("new"))
{
if (jcypurview.purviewVerdict("B0500036") == false) //判断是否有新增权限
{
%>
<Script Language=javascript>
alert("您没有操作此页权限!")
window.open("../index.jsp","_top")
</Script>
<% return;
}
}%>
<%
String nowuserid = jcypurview.getUserid(); //取当前用户编号
String nowusername = jcypurview.getUserName(); //取当前用户名称
String nowuserszqx = jcypurview.getUserSzqx(); //取当前用户所在区县
String nowuserszdw = jcypurview.getUserSzdw(); //取当前用户所在单位
%>
<%
//公务员培训新增
if ( szt.equals("new"))
{
String pxnd= std.getValue(request,"pxnd").trim(); //公务员培训年度
if (pxnd.length() > 4)
{
imager = "年度长度不能超过4位!";
ixy = 1;
}
if (ixy != 1)
{
if (pxnd.equals(""))
{
imager = "年度长度不能为空!";
ixy = 1;
}
}
String pxbm = std.getValue(request,"pxbm").trim(); //公务员培训组织部门
String pxqr = std.getValue(request,"rq").trim(); //公务员培训时间起
String pxzr = std.getValue(request,"rqr").trim(); //公务员培训时间止
if (ixy != 1)
{
String newpxqz = "select count(*) from dual where to_date('"+pxzr+"','yyyy.mm.dd') >= to_date('"+pxqr+"','yyyy.mm.dd')";
sun.jdbc.rowset.CachedRowSet ii = std.getResultBySelect(newpxqz);
ii.next();
String newjl = ii.getString(1);
if (newjl.equals("0"))
{
imager = "请输入正确时间!";
ixy = 1;
}
}
String pxqc = std.getValue(request,"pxqc").trim(); //公务员培训班期次
if (ixy != 1)
{
if (pxqc.length() > 20)
{
imager = "培训班期次长度不能大于20个字符!";
ixy = 1;
}
}
if (ixy != 1)
{
if (pxqc.equals(""))
{
imager = "培训班期次长度不能为空";
ixy = 1;
}
}
String sfzh= std.getValue(request,"sfzh"); //公务员身份证号
String username = std.getValue(request,"username"); //公务员姓名
String pxqk = std.getValue(request,"pxqk").trim(); //备注
if (ixy != 1)
{
if (pxqk.length()> 1000)
{
ixy = 1;
imager = "培训情况长度不能超过1000字符!";
}
}
if (ixy != 1)
{
if (pxqk.equals(""))
{
ixy = 1;
imager = "培训情况不能为空!";
}
}
if (ixy == 0)
{
//取数据库时间
String lrrq = std.getDateStr("YYYY.MM.DD");
String qunianqi="select count(*) from jcy_pxxx where pxbm='"+pxbm+"' and pxqc='"+pxqc+"' and pxnd='"+pxnd+"' and userid = '"+userid+"' ";
sun.jdbc.rowset.CachedRowSet v_qunianqi = std.getResultBySelect(qunianqi);
v_qunianqi.next();
String p_qunianqi=v_qunianqi.getString(1);
if(p_qunianqi.equals("0"))
{
//单位序号
String id ="SELECT LPAD(SEQ_jcyID.NEXTVAL,10,'0') FROM DUAL";
sun.jdbc.rowset.CachedRowSet crs = std.getResultBySelect("SELECT LPAD(SEQ_jcyID.NEXTVAL,10,'0') FROM DUAL");
crs.next();
String suserid = crs.getString(1);
//查询人员表
String sql_insert = "insert into jcy_pxxx (pxxxid) values ('"+suserid+"')";
int isi = std.getResultByUpdate(sql_insert);
if (isi == 1 )
{
String sql_update = "update jcy_pxxx set pxbm='"+pxbm+"', pxqr=to_date('"+pxqr+"','YYYY.MM.DD'), pxzr=to_date('"+pxzr+"','YYYY.MM.DD'), pxnd='"+pxnd+"',pxqc='"+pxqc+"',pxqk='"+pxqk+"',lry='"+nowuserid+"',lrsj=to_date('"+lrrq+"','YYYY.MM.DD'),userid = '"+userid+"' where pxxxid = '"+suserid+"'";
int isu = std.getResultByUpdate(sql_update);
if (isu == 1)
{
imager = "保存成功!";
}else
{
ixy = 1;
imager = "新增失败!";
}
}
}else
{
imager = "该公务员已经记录过此次培训";
ixy = 1;
}
}
}
//公务员培训修
if (szt.equals("modify"))
{
String pxnd= std.getValue(request,"pxnd").trim(); //公务员培训年度
if (pxnd.length() > 4)
{
imager = "年度长度不能超过4位!";
ixy = 1;
}
if (ixy != 1)
{
if (pxnd.equals(""))
{
imager = "年度长度不能为空!";
ixy = 1;
}
}
String pxbm = std.getValue(request,"pxbm"); //公务员培训组织部门
String pxqr = std.getValue(request,"rq"); //公务员培训时间起
String pxzr = std.getValue(request,"rqr"); //公务员培训时间止
if (ixy != 1)
{
String pxqz = "select count(*) from dual where to_date('"+pxzr+"','yyyy.mm.dd') >= to_date('"+pxqr+"','yyyy.mm.dd')";
sun.jdbc.rowset.CachedRowSet ii = std.getResultBySelect(pxqz);
ii.next();
String jl = ii.getString(1);
if (jl.equals("0"))
{
imager = "请输入正确时间!";
ixy = 1;
}
}
String pxqc = std.getValue(request,"pxqc").trim(); //公务员培训班期次
if (ixy != 1)
{
if (pxqc.length() > 20)
{
imager = "培训班期次长度不能大于20个字符!";
ixy = 1;
}
}
if (ixy != 1)
{
if (pxqc.equals(""))
{
imager = "培训班期次长度不能为空";
ixy = 1;
}
}
String sfzh= std.getValue(request,"sfzh"); //公务员身份证号
String username = std.getValue(request,"username"); //公务员姓名
String pxqk = std.getValue(request,"pxqk").trim(); //备注
if (ixy != 1)
{
if (pxqk.length()> 1000)
{
ixy = 1;
imager = "培训情况长度不能超过1000字符!";
}
}
if (ixy != 1)
{
if (pxqk.equals(""))
{
ixy = 1;
imager = "培训情况不能为空!";
}
}
if(ixy == 0)
{
//取数据库时间
String lrrq = std.getDateStr("YYYY.MM.DD");
//判断是否修改
String xugai = "select pxqc from jcy_pxxx where pxxxid = '"+pxxxid_id+"'";
sun.jdbc.rowset.CachedRowSet v_xugai = std.getResultBySelect(xugai);
v_xugai.next();
String pi_xugai = v_xugai.getString(1);
if(!pi_xugai.equals(pxqc))
{
String qunianqi="select count(*) from jcy_pxxx where pxbm='"+pxbm+"' and pxqc='"+pxqc+"' and pxnd='"+pxnd+"' and userid = '"+userid+"' ";
sun.jdbc.rowset.CachedRowSet v_qunianqi = std.getResultBySelect(qunianqi);
v_qunianqi.next();
String p_qunianqi=v_qunianqi.getString(1);
if(p_qunianqi.equals("0"))
{
//修改人员培训
String sql_modify_update = "update jcy_pxxx set pxbm='"+pxbm+"', pxqr=to_date('"+pxqr+"','YYYY.MM.DD'), pxzr=to_date('"+pxzr+"','YYYY.MM.DD'), pxnd='"+pxnd+"',pxqc='"+pxqc+"',pxqk='"+pxqk+"',lry='"+nowuserid+"',lrsj=to_date('"+lrrq+"','YYYY.MM.DD'),userid = '"+userid+"' where pxxxid = '"+pxxxid_id+"'";
int imodify = std.getResultByUpdate(sql_modify_update);
if (imodify == 1 )
{
imager = "修改成功!";
}else
{
ixy = 1;
imager = "修改失败!";
}
}else
{
imager = "该公务员已经记录过此次培训";
ixy = 1;
}
}
else
{
//修改人员培训
String sql_modify_update = "update jcy_pxxx set pxbm='"+pxbm+"', pxqr=to_date('"+pxqr+"','YYYY.MM.DD'), pxzr=to_date('"+pxzr+"','YYYY.MM.DD'), pxnd='"+pxnd+"',pxqc='"+pxqc+"',pxqk='"+pxqk+"',lry='"+nowuserid+"',lrsj=to_date('"+lrrq+"','YYYY.MM.DD'),userid = '"+userid+"' where pxxxid = '"+pxxxid_id+"'";
int imodify = std.getResultByUpdate(sql_modify_update);
if (imodify == 1 )
{
imager = "修改成功!";
}else
{
ixy = 1;
imager = "修改失败!";
}
}
}
}
//公务员培训删除
if(szt.equals("del"))
{
String sql_del = "delete from jcy_pxxx where pxxxid = '"+pxxxid_id+"'";
int idel = std.getResultByUpdate(sql_del);
if (idel == 1)
{
imager = "删除成功!";
}else
{
ixy = 1;
imager = "删除失败!";
}
}
%>
<head>
<title>
</title>
</head>
<body onLoad="parent.f_imager('<%=imager%>','<%=ixy%>')">
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -