-
Notifications
You must be signed in to change notification settings - Fork 0
/
Activity.java
143 lines (130 loc) · 2.77 KB
/
Activity.java
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package Action;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import javax.mail.Session;
import org.apache.struts2.dispatcher.SessionMap;
import com.opensymphony.xwork2.ActionSupport;
@SuppressWarnings("serial")
public class Activity extends ActionSupport {
private int activityID;
private String name;
private String date;
private String location;
private double money;
private String model;
private int num;
private int unLockNum;
private double unLockWeight;
private int[] ID = new int[4];
private double[] weight = new double[4];
private int[] lock = new int[4];
private double[] payed = new double[4];
private double[] moneyout = new double[4];
public int getActivityID() {
return activityID;
}
public void setActivityID(int activityID) {
this.activityID = activityID;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public double getMoney() {
return money;
}
public void setMoney(double money) {
this.money = money;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public int getUnLockNum() {
return unLockNum;
}
public void setUnLockNum(int unLockNum) {
this.unLockNum = unLockNum;
}
public double getUnLockWeight() {
return unLockWeight;
}
public void setUnLockWeight(double unLockWeight) {
this.unLockWeight = unLockWeight;
}
public int[] getID() {
return ID;
}
public void setID(int[] iD) {
ID = iD;
}
public double[] getWeight() {
return weight;
}
public void setWeight(double[] weight) {
this.weight = weight;
}
public int[] getLock() {
return lock;
}
public void setLock(int[] lock) {
this.lock = lock;
}
public double[] getPayed() {
return payed;
}
public void setPayed(double[] payed) {
this.payed = payed;
}
public double[] getMoneyout() {
return moneyout;
}
public void setMoneyout(double[] moneyout) {
this.moneyout = moneyout;
}
public String execute() {
/*unLockNum=num;
unLockWeight=1.00;
for(int ii=0;ii<num;ii++){
if(lock[ii] == 1){
unLockNum=unLockNum-1;
unLockWeight=unLockWeight-weight[ii];
}
}
for(int iii=0;iii<num;iii++){
if(lock[iii] == 0){
weight[iii]=unLockWeight/unLockNum;
}
}*/
for (int i = 0; i < 4; i++) {
moneyout[i] = weight[i] * money;
}
return SUCCESS;
}
}