285154c6364401301d5246a81c89b3e44c3d1431.svn-base
8.79 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
package com.thinkgem.jeesite.modules.reg.service.pjxt;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.reg.dao.ywpjxt.YwpjDao;
import com.thinkgem.jeesite.modules.reg.entity.ywpjxt.Ywpj;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
/**
* 评价系统service
* @author Administrator
*
*/
@Service
@Transactional(readOnly=true)
public class YwpjService extends CrudService<YwpjDao, Ywpj> {
/**
* 新增评价信息
* @param ywpj
* @return
*/
public int addYwpj(Ywpj ywpj){
return dao.addYwpj(ywpj);
}
/**
* 更新待评价业务状态
* @param ywh
* @return
*/
public int updatePjslzt(Map map){
return dao.updatePjslzt(map);
}
/**
* 通过业务号获取ywpj防止重复添加
* @param ywh
* @return
*/
public String getYwpjIdByYwh(String ywh){
return dao.getYwpjIdByYwh(ywh);
}
/**
* 更新评价分数
* @param ywpj
* @return
*/
public int updatePjmycd(Ywpj ywpj){
return dao.updatePjmycd(ywpj);
}
/**
* 获取所有UserId
* @return
*/
public List<String> getAllUserId(){
return dao.getAllUserId();
}
/**
* 获取评价分数
* @param ywpjMap
* @return
*/
public int getPjfsByUserId(Map ywpjMap){
return dao.getPjfsByUserId(ywpjMap);
}
/**
* 获取ywpjList
*/
public List<Ywpj> findList(Ywpj ywpj){
return dao.findList(ywpj);
}
public Model getYwpjtj(HttpServletRequest request, HttpServletResponse response, Model model){
String qssj1 = request.getParameter("StartDate");
System.out.println(qssj1);
qssj1 = qssj1.substring(0, 4) + qssj1.substring(5, 7);
System.out.println(qssj1);
String qssj = qssj1.substring(0, 4)+" 年 "+qssj1.substring(4, 6)+" 月";
System.out.println(qssj);
String jssj1 = request.getParameter("EndDate");
System.out.println(jssj1);
jssj1 = jssj1.substring(0, 4) + jssj1.substring(5, 7);
System.out.println(jssj1);
String jssj = jssj1.substring(0, 4)+" 年 "+jssj1.substring(4, 6)+" 月";
System.out.println(jssj);
List<Map<String, Object>> userList1 = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> userList2 = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> userList3 = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> userList4 = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> userList5 = new ArrayList<Map<String, Object>>();
List<String> userIdList = getAllUserId();
User user = new User();
Map<String, Object> ywpjMap = new HashMap<String, Object>();
// int qsrqyf = Integer.parseInt(qssj1.substring(4, 6)) - 1;
// String qsrq;
// if (qsrqyf <= 9 && qsrqyf > 0) {
// qsrq = qssj1.substring(0, 4)+"-0"+qsrqyf;
// } else if (qsrqyf == 0) {
// qsrq = Integer.parseInt(qssj1.substring(0, 4))-1 + "-12";
// } else {
// qsrq = qssj1.substring(0, 4)+"-"+qsrqyf;
// }
int jsrqyf = 0; //起始
String jsrq;
if (Integer.parseInt(jssj1.substring(4, 6)) == 12) {
jsrqyf = Integer.parseInt(jssj1.substring(0, 4)) + 1;
jsrq = jsrqyf+"-01";
} else {
jsrqyf = Integer.parseInt(jssj1.substring(4, 6)) + 1;
jsrq = jssj1.substring(0, 4)+"-"+jsrqyf;
}
// ywpjMap.put("qssj", qsrq);
// ywpjMap.put("jssj", jsrq);
ywpjMap.put("qssj", qssj1);
ywpjMap.put("jssj", jsrq);
for (int i=0; i<userIdList.size(); i++) {
Map<String, Object> userMap = new HashMap<String, Object>();
String userId = userIdList.get(i);
user.setId(userId);
user = UserUtils.get(userId);
String officeName = user.getOffice().getName();
ywpjMap.put("userId",userId);
if ("权证受理".equals(officeName)) {
userMap.put("userId", userId);
userMap.put("username", user.getName());
ywpjMap.put("mycd","1");
int myCount = getPjfsByUserId(ywpjMap);
System.out.println(myCount);
userMap.put("myCount", myCount);
ywpjMap.put("mycd","2");
int ybCount = getPjfsByUserId(ywpjMap);
userMap.put("ybCount", ybCount);
ywpjMap.put("mycd","3");
int bmyCount = getPjfsByUserId(ywpjMap);
userMap.put("bmyCount", bmyCount);
int total = myCount + ybCount + bmyCount;
userMap.put("total", total);
if (total != 0) {
double myd = total; //转一下类型 要不计算会出错 会按照int类型计算
myd = myCount / myd * 100;
DecimalFormat df = new DecimalFormat("#.0");
String myl = df.format(myd) + "%";
userMap.put("myl", myl);
} else {
userMap.put("myl", "0%");
}
userList1.add(userMap);
}
if ("抵押受理".equals(officeName)) {
userMap.put("userId", userId);
userMap.put("username", user.getName());
ywpjMap.put("mycd","1");
int myCount = getPjfsByUserId(ywpjMap);
userMap.put("myCount", myCount);
ywpjMap.put("mycd","2");
int ybCount = getPjfsByUserId(ywpjMap);
userMap.put("ybCount", ybCount);
ywpjMap.put("mycd","3");
int bmyCount = getPjfsByUserId(ywpjMap);
userMap.put("bmyCount", bmyCount);
int total = myCount + ybCount + bmyCount;
userMap.put("total", total);
if (total != 0) {
double myd = total;
myd = myCount / myd * 100;
DecimalFormat df = new DecimalFormat("#.0");
String myl = df.format(myd) + "%";
userMap.put("myl", myl);
} else {
userMap.put("myl", "0%");
}
userList2.add(userMap);
}
if ("预告受理".equals(officeName)) {
userMap.put("userId", userId);
userMap.put("username", user.getName());
ywpjMap.put("mycd","1");
int myCount = getPjfsByUserId(ywpjMap);
userMap.put("myCount", myCount);
ywpjMap.put("mycd","2");
int ybCount = getPjfsByUserId(ywpjMap);
userMap.put("ybCount", ybCount);
ywpjMap.put("mycd","3");
int bmyCount = getPjfsByUserId(ywpjMap);
userMap.put("bmyCount", bmyCount);
int total = myCount + ybCount + bmyCount;
userMap.put("total", total);
if (total != 0) {
double myd = total;
myd = myCount / myd * 100;
DecimalFormat df = new DecimalFormat("#.0");
String myl = df.format(myd) + "%";
userMap.put("myl", myl);
} else {
userMap.put("myl", "0%");
}
userList3.add(userMap);
}
if ("邮储银行汉中市分行营业部".equals(officeName) || "建设银行".equals(officeName) || "长安银行汉中分行营业部".equals(officeName)) {
userMap.put("userId", userId);
userMap.put("username", user.getName());
ywpjMap.put("mycd","1");
int myCount = getPjfsByUserId(ywpjMap);
userMap.put("myCount", myCount);
ywpjMap.put("mycd","2");
int ybCount = getPjfsByUserId(ywpjMap);
userMap.put("ybCount", ybCount);
ywpjMap.put("mycd","3");
int bmyCount = getPjfsByUserId(ywpjMap);
userMap.put("bmyCount", bmyCount);
int total = myCount + ybCount + bmyCount;
userMap.put("total", total);
if (total != 0) {
double myd = total;
myd = myCount / myd * 100;
DecimalFormat df = new DecimalFormat("#.0");
String myl = df.format(myd) + "%";
userMap.put("myl", myl);
} else {
userMap.put("myl", "0%");
}
userList4.add(userMap);
}
if ("更正、异议查封受理".equals(officeName)) {
userMap.put("userId", userId);
userMap.put("username", user.getName());
ywpjMap.put("mycd","1");
int myCount = getPjfsByUserId(ywpjMap);
userMap.put("myCount", myCount);
ywpjMap.put("mycd","2");
int ybCount = getPjfsByUserId(ywpjMap);
userMap.put("ybCount", ybCount);
ywpjMap.put("mycd","3");
int bmyCount = getPjfsByUserId(ywpjMap);
userMap.put("bmyCount", bmyCount);
int total = myCount + ybCount + bmyCount;
userMap.put("total", total);
if (total != 0) {
double myd = total;
myd = myCount / myd * 100;
DecimalFormat df = new DecimalFormat("#.0");
String myl = df.format(myd) + "%";
userMap.put("myl", myl);
} else {
userMap.put("myl", "0%");
}
userList5.add(userMap);
}
}
if (qssj1.equals(jssj1)) {
model.addAttribute("flag", 1);
model.addAttribute("qssj", qssj);
} else {
model.addAttribute("flag", 2);
model.addAttribute("qssj", qssj);
model.addAttribute("jssj", jssj);
}
model.addAttribute("userList1", userList1);
model.addAttribute("userList2", userList2);
model.addAttribute("userList3", userList3);
model.addAttribute("userList4", userList4);
model.addAttribute("userList5", userList5);
return model;
}
}