📄 contractadddo.jsp
字号:
<%--
模块名称:撰拟合同
模块功能:新增记录
版 本:V1.0
著 作 人:谢永刚 SIMM(java)
著作日期:2001-11-08
该模块所需的文件:
使用说明:
主要技术说明:文件为数据流的处理方式
参考文献:法律事务设计书
修改历史:= = = = = = = = = = = = = = = = = = = = = = = = = =
修改日期:
修 改 人:
修改理由:
修改出处:
= = = = = = = = = = = = = = = = = = = = = = = = = =
--%>
<%@ page language="java" import="com.jspsmart.upload.*,
java.util.Date,
java.util.Locale,
java.text.DateFormat,
java.io.*,
java.sql.*"%>
<%@ page contentType= "text/html; charset=gb2312" %>
<%@ page import="system.*" %>
<jsp:useBean id="db" class="dbconnection.DbConnection" scope="page" />
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<% mySmartUpload.initialize(pageContext);
mySmartUpload.upload();
%>
<HTML>
<HEAD>
<TITLE>
新增记录
</TITLE>
</HEAD>
<BODY>
<%
GetID gid = new GetID();
ExtendString es = new ExtendString();
String fid = "";
String caseID = "",
caseReason = "",
beginDate = "",
lawyer = "",
contractType = "",
mainContent="",
referForeign = "",
charged = "",
noPayReason = "",
customer = "";
int num1 = 0;
String customerSysID = "";
String toDate = es.getNowDate(0);
//BEGIN-处理附件传送------------------------------
//copy from WEBOA-AFFICHE.JSP,ADD_SUCCESS.JSP
Date timenow=new Date();
String accessory = ""; //附件字符串
long timenownum=timenow.getTime();
DateFormat df = DateFormat.getDateTimeInstance();
for (int i=0; i<mySmartUpload.getFiles().getCount();i++)
{
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(i);
if (!myFile.isMissing())
{
//myFile.getFileName()
myFile.saveAs("/upload/" +String.valueOf(timenownum+i)+"."+myFile.getFileExt() , mySmartUpload.SAVE_VIRTUAL);
accessory=accessory+myFile.getFileName()+";"+String.valueOf(timenownum+i)+"."+myFile.getFileExt()+";";
}
}
//END----------------------------
caseID = mySmartUpload.getRequest().getParameter("txtCaseID");
caseReason = mySmartUpload.getRequest().getParameter("txtCaseReason");
beginDate = mySmartUpload.getRequest().getParameter("txtBeginDate");
lawyer = mySmartUpload.getRequest().getParameter("txtLawyer");
contractType = mySmartUpload.getRequest().getParameter("txtContractType");
mainContent = mySmartUpload.getRequest().getParameter("txtMainContent");
referForeign = mySmartUpload.getRequest().getParameter("txtReferForeign");
charged = mySmartUpload.getRequest().getParameter("txtCharged");
noPayReason = mySmartUpload.getRequest().getParameter("txtNoPayReason");
customer = mySmartUpload.getRequest().getParameter("txtCustomer");
if((customer == null) || (customer.equals("")))
customer = mySmartUpload.getRequest().getParameter("customer_id");
//处理t_caseinfo数据表的插入记录
String sql = "insert into t_caseinfo(case_id,case_reason,case_type,case_attribute";
sql = sql + ",case_state,begin_date";
sql = sql + ",refer_foreign,charged";
if(noPayReason != null)
sql = sql + ",no_pay_reason";
if(lawyer!=null)
sql = sql + ",employee_id";
sql = sql + ",customer_id";
sql = sql + ") values('"+caseID+"','"+caseReason;
sql = sql + "','fssaj','znht"; //fssaj----非诉讼案件;znht----撰拟合同
sql = sql + "','sazt"; //sazt----收案状态
sql = sql + "','" + beginDate;
sql = sql + "','" + referForeign;
sql = sql + "','" + charged;
if(noPayReason != null)
sql = sql + "','" + noPayReason;
if(lawyer!=null)
sql = sql + "','" + lawyer;
sql = sql + "','" + customer;
sql = sql + "')";
int num = db.executeUpdate(sql);
if (num <= 0) {
%>
<script language="javascript">
alert("新增失败!");
</script>
<%
}else
{
gid.setIDNumber("case_id", gid.getIDNumber("case_id")+1);
//处理T_NONCOURT 内容--main_content--
sql = " insert into t_noncourt (case_id";
if(mainContent != null)
sql = sql + ",main_content";
if(accessory != null)
sql = sql + ",accessory";
if(contractType != null)
sql = sql + ",pact_type";
sql = sql + ") values('" + caseID;
if(mainContent != null)
sql = sql + "','" + mainContent;
if(accessory != null)
sql = sql + "','" + accessory;
if(contractType != null)
sql = sql + "','" + contractType + "')";
int k = db.executeUpdate(sql);
}
//--------------------------------------
//BEGIN---处理合同费用新增---LAYER2-----
String charge_id = mySmartUpload.getRequest().getParameter("charge_id"),
charge_sum = mySmartUpload.getRequest().getParameter("charge_sum");
if((num>0) && (charge_id != null) && (!charge_id.equals(""))
&& (charge_sum != null) && (!charge_sum.equals("")))
{ //费用记录存在时处理
String part_proportion, case_object;
String time_limit, payment_method, receive_time, charge_standard, discount;
String discount_person, charge_person, currency_kind, comment;
charge_id = mySmartUpload.getRequest().getParameter("charge_id");
charge_sum = mySmartUpload.getRequest().getParameter("charge_sum");
part_proportion = mySmartUpload.getRequest().getParameter("part_proportion");
case_object = mySmartUpload.getRequest().getParameter("case_object");
time_limit = mySmartUpload.getRequest().getParameter("time_limit");
payment_method = mySmartUpload.getRequest().getParameter("payment_method");
receive_time = mySmartUpload.getRequest().getParameter("receive_time");
charge_standard = mySmartUpload.getRequest().getParameter("charge_standard");
discount = mySmartUpload.getRequest().getParameter("discount");
discount_person = mySmartUpload.getRequest().getParameter("discount_person");
charge_person = mySmartUpload.getRequest().getParameter("charge_person");
currency_kind = mySmartUpload.getRequest().getParameter("currency_kind");
comment = mySmartUpload.getRequest().getParameter("comment");
sql = "insert into t_charge(charge_id, charge_sum, charge_type";
if ((caseID!=null) && (!caseID.equals("")))
sql = sql + ", case_id";
if ((part_proportion!=null) && (!part_proportion.equals("")))
sql = sql + ", part_proportion";
if ((case_object!=null) && (!case_object.equals("")))
sql = sql + ", case_object";
if ((time_limit!=null) && (!time_limit.equals("")))
sql = sql + ", time_limit";
if (payment_method!=null)
sql = sql + ", payment_method";
if ((receive_time!=null) && (!receive_time.equals("")))
sql = sql + ", receive_time";
if ((charge_standard!=null) && (!charge_standard.equals("")))
sql = sql + ", charge_standard";
if ((discount!=null) && (!discount.equals("")))
sql = sql + ", discount";
if ((discount_person!=null) && (!discount_person.equals("")))
sql = sql + ", discount_person";
if ((charge_person!=null) && (!charge_person.equals("")))
sql = sql + ", charge_person";
if (currency_kind!=null)
sql = sql + ", currency_kind";
if ((comment!=null) && (!comment.equals("")))
sql = sql + ", comment";
sql = sql + ") values('" + charge_id + "'," + charge_sum + ",'ht'";
if ((caseID!=null) && (!caseID.equals("")))
sql = sql + ",'" + caseID + "'";
if ((part_proportion!=null) && (!part_proportion.equals("")))
sql = sql + ",'" + part_proportion + "'";
if ((case_object!=null) && (!case_object.equals("")))
sql = sql + ",'" + case_object + "'";
if ((time_limit!=null) && (!time_limit.equals("")))
sql = sql + ",'" + time_limit + "'";
if (payment_method!=null)
sql = sql + ",'" + payment_method + "'";
if ((receive_time!=null) && (!receive_time.equals("")))
sql = sql + ",'" + receive_time + "'";
if ((charge_standard!=null) && (!charge_standard.equals("")))
sql = sql + ",'" + charge_standard + "'";
if ((discount!=null) && (!discount.equals("")))
sql = sql + ",'" + discount + "'";
if ((discount_person!=null) && (!discount_person.equals("")))
sql = sql + ",'" + discount_person + "'";
if ((charge_person!=null) && (!charge_person.equals("")))
sql = sql + ",'" + charge_person + "'";
if (currency_kind!=null)
sql = sql + ",'" + currency_kind + "'";
if ((comment!=null) && (!comment.equals("")))
sql = sql + ",'" + comment + "'";
sql = sql + ")";
num1 = db.executeUpdate(sql);
if (num1 <= 0) {%>
<script language="javascript">
alert("费用信息新增失败!");
</script>
<%}else gid.setIDNumber("charge_id", gid.getIDNumber("charge_id")+1);
} //if(num>0)
//END LAYER2----------------------------
//BEGIN LAYER4 ------处理客户新增信息
String customer_id = mySmartUpload.getRequest().getParameter("customer_id"),
customer_name = mySmartUpload.getRequest().getParameter("customer_name"),
tempCustomer = mySmartUpload.getRequest().getParameter("txtCustomer");
if((num>0) && (customer_id != null) && (!customer_id.equals(""))
&& (customer_name != null) && (!customer_name.equals(""))
&& ((tempCustomer == null) || (tempCustomer.equals(""))))
{ //客户记录存在时处理
String link_man, telephone, mobile_telephone;
String email, address, customer_type, customer_introduce, fax, enter_date, lawyer_id;
customer_id = mySmartUpload.getRequest().getParameter("customer_id");
customer_name = mySmartUpload.getRequest().getParameter("customer_name");
link_man = mySmartUpload.getRequest().getParameter("link_man");
telephone = mySmartUpload.getRequest().getParameter("telephone");
mobile_telephone = mySmartUpload.getRequest().getParameter("mobile_telephone");
email = mySmartUpload.getRequest().getParameter("email");
address = mySmartUpload.getRequest().getParameter("address");
customer_type = mySmartUpload.getRequest().getParameter("customer_type");
customer_introduce = mySmartUpload.getRequest().getParameter("customer_introduce");
fax = mySmartUpload.getRequest().getParameter("fax");
enter_date = toDate; //mySmartUpload.getRequest().getParameter("enter_date"); //
lawyer_id = mySmartUpload.getRequest().getParameter("txtLawyer"); //
sql = "insert into t_customer(customer_id,customer_name";
if (link_man!=null)
sql = sql + ",link_man";
if (telephone!=null)
sql = sql + ",telephone";
if (mobile_telephone!=null)
sql = sql + ",mobile_telephone";
if (email!=null)
sql = sql + ",email";
if (address!=null)
sql = sql + ",address";
if (customer_type!=null)
sql = sql + ",customer_type";
if (customer_introduce!=null)
sql = sql + ",customer_introduce";
if (fax!=null)
sql = sql + ",fax";
if ((enter_date!=null) && (!enter_date.equals("")))
sql = sql + ",enter_date";
if ((lawyer_id!=null) && (!lawyer_id.equals("")))
sql = sql + ",lawyer_id";
sql = sql + ") values('"+customer_id+"','"+customer_name+"'";
if (link_man!=null)
sql = sql + ",'" + link_man + "'";
if (telephone!=null)
sql = sql + ",'" + telephone + "'";
if (mobile_telephone!=null)
sql = sql + ",'" + mobile_telephone + "'";
if (email!=null)
sql = sql + ",'" + email + "'";
if (address!=null)
sql = sql + ",'" + address + "'";
if (customer_type!=null)
sql = sql + ",'" + customer_type + "'";
if (customer_introduce!=null)
sql = sql + ",'" + customer_introduce + "'";
if (fax!=null)
sql = sql + ",'" + fax + "'";
if ((enter_date!=null) && (!enter_date.equals("")))
sql = sql + ",'" + enter_date + "'";
if ((lawyer_id!=null) && (!lawyer_id.equals("")))
sql = sql + ",'" + lawyer_id + "'";
sql = sql + ")";
num1 = db.executeUpdate(sql);
if (num1 <= 0) {%>
<script language="javascript">
alert("客户信息新增失败!");
</script>
<%}
else {
gid.setIDNumber("customer_id", gid.getIDNumber("customer_id")+1);
customerSysID = "KH" + es.digitToString(gid.getIDNumber("customer_id")+1);
}
} // if((num>0) &&
//END LAYER4--------------------------
%>
<script language="javascript">
location = "ContractAdd.jsp";
</script>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -