UpOutline.java
4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package com.servlet.bksh.DMC;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.service.bksh.SHExecuteService;
import com.vo.SH_outline_DataManage;
public class UpOutline extends HttpServlet {
/**
*
*/
private static final long serialVersionUID = 1L;
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
response.setContentType("text/html");
SH_outline_DataManage sh = new SH_outline_DataManage();
SHExecuteService serve=new SHExecuteService();
boolean re=true;
String datetime = request.getParameter("a_datetime");
String ss = request.getParameter("a_ss");
String tn = request.getParameter("a_tn");
String tp = request.getParameter("a_tp");
String shxyl = request.getParameter("a_shxyl");
String dzwy = request.getParameter("a_dzwy");
String syl = request.getParameter("a_syl");
String ylzbmhxj = request.getParameter("a_ylzbmhxj");
String sd = request.getParameter("a_sd");
String fdcjq = request.getParameter("a_fdcjq");
String tcd = request.getParameter("a_tcd");
String tcr = request.getParameter("a_tcr");
String ljg = request.getParameter("a_ljg");
String tas = request.getParameter("a_tas");
String tpb = request.getParameter("a_tpb");
String wjg = request.getParameter("a_wjg");
// sh.setA_id(request.getParameter("a_id"));
if(tn==null||tp==null||shxyl==null||dzwy==null||syl==null||ylzbmhxj==null||wjg==null||
sd==null||fdcjq==null||tcd==null||tcr==null||ljg==null||tas==null||tpb==null||
tn==""||tp==""||shxyl==""||dzwy==""||syl==""||ylzbmhxj==""||wjg==""||
sd==""||fdcjq==""||tcd==""||tcr==""||ljg==""||tas==""||tpb==""){
response.getWriter().print("{success:true,msg:' 您所填数据不能为空!'}");
response.getWriter().close();
return;
}
sh.setA_ss(Double.valueOf(ss));
sh.setA_ss_note(request.getParameter("a_ss_note"));
//System.out.println(request.getParameter("a_ss_note"));
sh.setA_tn(Double.valueOf(tn));
sh.setA_tn_note(request.getParameter("a_tn_note"));
sh.setA_tp(Double.valueOf(tp));
sh.setA_tp_note(request.getParameter("a_tp_note"));
sh.setA_shxyl(Double.valueOf(shxyl));
sh.setA_shxyl_note(request.getParameter("a_shxyl_note"));
sh.setA_dzwy(Double.valueOf(dzwy));
sh.setA_dzwy_note(request.getParameter("a_dzwy_note"));
sh.setA_syl(Double.valueOf(syl));
sh.setA_syl_note(request.getParameter("a_syl_note"));
sh.setA_ylzbmhxj(Double.valueOf(ylzbmhxj));
sh.setA_ylzbmhxj_note(request.getParameter("a_ylzbmhxj_note"));
sh.setA_sd(Double.valueOf(sd));
sh.setA_sd_note(request.getParameter("a_sd_note"));
sh.setA_fdcjq(Double.valueOf(fdcjq));
sh.setA_fdcjq_note(request.getParameter("a_fdcjq_note"));
sh.setA_tcd(Double.valueOf(tcd));
sh.setA_tcd_note(request.getParameter("a_tcd_note"));
sh.setA_tcr(Double.valueOf(tcr));
sh.setA_tcr_note(request.getParameter("a_tcr_note"));
sh.setA_ljg(Double.valueOf(ljg));
sh.setA_ljg_note(request.getParameter("a_ljg_note"));
sh.setA_tas(Double.valueOf(tas));
sh.setA_tas_note(request.getParameter("a_tas_note"));
sh.setA_tpb(Double.valueOf(tpb));
sh.setA_tpb_note(request.getParameter("a_tpb_note"));
sh.setA_wjg(Double.valueOf(wjg));
sh.setA_wjg_note(request.getParameter("a_wjg_note"));
String id = request.getParameter("a_id");
if (id == null) {
sh.setDate(datetime);
re=serve.insertoutlinedata(sh);
} else {
sh.setA_id(Integer.valueOf(id));
re=serve.getDataManageUpdate(sh);
}
if(!re){
response.getWriter().print("{success:true,msg:'数据操作成功'}");
response.getWriter().close();
}else{
response.getWriter().print("{success:true,msg:'数据操作失败,请检查时间和数据是否正确'}");
response.getWriter().close();
}
}
}