LgcToolsOperation.jsp
4.1 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
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.lgc.maintenance.AssetAssortmentComInfo" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<%
String operation = Util.null2String(request.getParameter("operation"));
char separator = Util.getSeparator() ;
if(operation.equals("attributemove")){
String assortmentid = Util.null2String(request.getParameter("assortmentid"));
String issales_from = Util.null2String(request.getParameter("issales_from"));
String issales_to = Util.null2String(request.getParameter("issales_to"));
String ispurchase_from = Util.null2String(request.getParameter("ispurchase_from"));
String ispurchase_to = Util.null2String(request.getParameter("ispurchase_to"));
String isstock_from = Util.null2String(request.getParameter("isstock_from"));
String isstock_to = Util.null2String(request.getParameter("isstock_to"));
String iswebsales_from = Util.null2String(request.getParameter("iswebsales_from"));
String iswebsales_to = Util.null2String(request.getParameter("iswebsales_to"));
String isorder_from = Util.null2String(request.getParameter("isorder_from"));
String isorder_to = Util.null2String(request.getParameter("isorder_to"));
String para = "";
int countid = 0 ;
if(!issales_from.equals("")) {
para = assortmentid + separator + "1|" ;
if(issales_from.equals("0")) RecordSet.executeProc("LgcAttributeMove_Add",para);
else RecordSet.executeProc("LgcAttributeMove_Remove",para);
RecordSet.next() ;
countid += RecordSet.getInt(1) ;
}
if(!ispurchase_from.equals("")) {
para = assortmentid + separator + "2|" ;
if(ispurchase_from.equals("0")) RecordSet.executeProc("LgcAttributeMove_Add",para);
else RecordSet.executeProc("LgcAttributeMove_Remove",para);
RecordSet.next() ;
countid += RecordSet.getInt(1) ;
}
if(!isstock_from.equals("")) {
para = assortmentid + separator + "3|" ;
if(isstock_from.equals("0")) RecordSet.executeProc("LgcAttributeMove_Add",para);
else RecordSet.executeProc("LgcAttributeMove_Remove",para);
RecordSet.next() ;
countid += RecordSet.getInt(1) ;
}
if(!iswebsales_from.equals("")) {
para = assortmentid + separator + "4|" ;
if(iswebsales_from.equals("0")) RecordSet.executeProc("LgcAttributeMove_Add",para);
else RecordSet.executeProc("LgcAttributeMove_Remove",para);
RecordSet.next() ;
countid += RecordSet.getInt(1) ;
}
if(!isorder_from.equals("")) {
para = assortmentid + separator + "5|" ;
if(isorder_from.equals("0")) RecordSet.executeProc("LgcAttributeMove_Add",para);
else RecordSet.executeProc("LgcAttributeMove_Remove",para);
RecordSet.next() ;
countid += RecordSet.getInt(1) ;
}
response.sendRedirect("LgcAttributeMove.jsp?countid="+countid);
}
else if(operation.equals("assortmentmove")){
String assortmentid1 = Util.null2String(request.getParameter("assortmentid1"));
String assortmentid2 = Util.null2String(request.getParameter("assortmentid2"));
String[] selectasset = request.getParameterValues("selectasset");
String para = "" ;
int countid = 0 ;
if(selectasset != null) {
for(int i=0 ; i< selectasset.length ; i++) {
if(selectasset[i] != null) {
para = assortmentid2 + separator + selectasset[i] ;
RecordSet.executeProc("LgcAssortmentMove_Move",para);
countid ++ ;
}
}
}
if(countid != 0) {
AssetAssortmentComInfo ac = new AssetAssortmentComInfo() ;
para = assortmentid1 + separator + assortmentid2 + separator + countid ;
RecordSet.executeProc("LgcAssortmentMove_ChgCount",para);
ac.removeAssetAssortmentCache() ;
}
response.sendRedirect("LgcAssortmentMove.jsp?countid="+countid);
}
else if(operation.equals("markchange")){
String assetid = Util.null2String(request.getParameter("assetid"));
String assetmark = Util.null2String(request.getParameter("assetmark"));
String msgid = "" ;
String para = assetid + separator + assetmark ;
RecordSet.executeProc("LgcAssetmark_Change",para);
if(RecordSet.next()) msgid = "13" ;
else msgid = "29" ;
response.sendRedirect("LgcAssetmarkChg.jsp?msgid="+msgid);
}
%>