提交 | 用户 | age
|
a6a76f
|
1 |
package com.yc.utils; |
F |
2 |
|
|
3 |
import java.io.Serializable; |
6e88ad
|
4 |
import java.util.*; |
a6a76f
|
5 |
|
F |
6 |
|
|
7 |
/** |
|
8 |
* Gt-grid返回的json对象 |
|
9 |
* @author 邓文峰 |
|
10 |
* 2010-2-23 |
|
11 |
* **/ |
|
12 |
public class GTJson implements Serializable{ |
|
13 |
private String action; |
|
14 |
private PageInfo pageInfo; |
|
15 |
private String panelAction;//面板动作 |
|
16 |
private String panelTable;//面板的表名 |
|
17 |
private String doccode;//面板的单号 |
|
18 |
private String masterCode;//10类型参数转换 |
|
19 |
private List<HashMap<String,String>> deletedRecords=new ArrayList<HashMap<String,String>>(); |
|
20 |
private List<HashMap<String,String>> insertedRecords=new ArrayList<HashMap<String,String>>(); |
|
21 |
private List<HashMap<String,String>> updatedRecords=new ArrayList<HashMap<String,String>>(); |
|
22 |
private List<HashMap<String,String>> panelRecords=new ArrayList<HashMap<String,String>>(); |
|
23 |
private List<HashMap<String,String>> vssRecords=new ArrayList<HashMap<String,String>>();//更新时用全匹配更新 |
|
24 |
private List<HashMap<String,String>> oARecords=new ArrayList<HashMap<String,String>>();//保存OA审核时把格线数据传回后台 |
|
25 |
private List<HashMap<String,String>> tranRecords=new ArrayList<HashMap<String,String>>();//确定时提交的数据 |
|
26 |
private List<HashMap<String,String>> emptyRecords=new ArrayList<HashMap<String,String>>();//空数据 |
|
27 |
private List<HashMap<String,String>> auditRecords=new ArrayList<HashMap<String,String>>(); |
|
28 |
|
|
29 |
//---------3表结构 |
|
30 |
private List<HashMap<String,String>> otherDeleteds=new ArrayList<HashMap<String,String>>(); |
|
31 |
private List<HashMap<String,String>> otherInserteds=new ArrayList<HashMap<String,String>>(); |
|
32 |
private List<HashMap<String,String>> otherUpdateds=new ArrayList<HashMap<String,String>>(); |
|
33 |
private List<HashMap<String,String>> otherVss=new ArrayList<HashMap<String,String>>(); |
|
34 |
private List<HashMap<String,String>> otherOA=new ArrayList<HashMap<String,String>>(); |
|
35 |
private String otherTable;//三表的表类型 |
|
36 |
private int otherFormid=0;//三表的功能号 |
|
37 |
private String otherKey;//关联表关键字 |
|
38 |
private List<HashMap<String,String>> otherTranRecords=new ArrayList<HashMap<String,String>>();//确定时提交的数据 |
|
39 |
private List<HashMap<String,String>> muilTranRecords=new ArrayList<HashMap<String,String>>();//多表确定时提交的数据 |
|
40 |
private String[] fieldsName;//字段显示列表,把它提交到数据库,避免用*号查询,性能较好 |
|
41 |
private String fields;//字段显示列表,作为淘宝接口的字段列表 |
|
42 |
//---------多表结构 |
|
43 |
private List<Panel> panels;//面板数据集合 |
|
44 |
private List<Grid> grids;//表格数据集合 |
|
45 |
private String gType;//表示当前页面是哪一个窗体类型,因为499类型是由多个功能号组成,所以需要通过这个来区分 |
|
46 |
private String formid;//499类型的主功能号 |
|
47 |
private String fl;//499类型返回参数 |
|
48 |
private String oa="";//审核,通过,驳回 |
|
49 |
private boolean cp;//复单标记 |
|
50 |
private String expr="";//权限控制 |
|
51 |
private String cudoc="";//自定义单号功能 |
|
52 |
private String otherColns="";//过滤列 |
|
53 |
private String colns="";//过滤列 |
|
54 |
private String token ="";//令牌 |
|
55 |
private String disableDuplicateSubmitUUID ="";//防止重复提交的唯一标记 |
|
56 |
private int aFlag=0; |
|
57 |
private int isGantt=0;//是否为甘特图 |
|
58 |
private String[] rowids;//15类型 复单处理前台rowid更新不了的问题,传到这里再作进一步处理 |
59226b
|
59 |
private String btnId = ""; |
F |
60 |
private int clickTran = 0;//直接点击确认触发 |
|
61 |
private int dcFlag = 0;//flag标记数据范围检查已通过 |
|
62 |
private String primeKey = "";//主键,用作更新,删除时候做where条件,匹配 |
|
63 |
private String otherPrimeKey = "";//15,77类型的第三表主键 |
|
64 |
private Map<String, String> refKeyMap = new HashMap<>();//保存多表中子功能号有关联 |
|
65 |
private int is497 = 0;//app保存多表中的子功能时是传16,1类型,需要返回rowid,后端需要知道是多表才能返回rowid |
|
66 |
private String userName; |
|
67 |
private int onlinePay = -1;//在线支付 |
|
68 |
private int onlineRefund = -1;//在线退款 |
|
69 |
private String tableName; |
|
70 |
|
|
71 |
public String getTableName() { |
|
72 |
return tableName; |
|
73 |
} |
|
74 |
|
|
75 |
public void setTableName(String tableName) { |
|
76 |
this.tableName = tableName; |
|
77 |
} |
6e88ad
|
78 |
|
366271
|
79 |
public int getOnlinePay() { |
F |
80 |
return onlinePay; |
|
81 |
} |
|
82 |
|
|
83 |
public void setOnlinePay(int onlinePay) { |
|
84 |
this.onlinePay = onlinePay; |
|
85 |
} |
|
86 |
|
|
87 |
public int getOnlineRefund() { |
|
88 |
return onlineRefund; |
|
89 |
} |
|
90 |
|
|
91 |
public void setOnlineRefund(int onlineRefund) { |
|
92 |
this.onlineRefund = onlineRefund; |
|
93 |
} |
6e88ad
|
94 |
public String getUserName() { |
F |
95 |
return userName; |
|
96 |
} |
|
97 |
|
|
98 |
public void setUserName(String userName) { |
|
99 |
this.userName = userName; |
|
100 |
} |
a6a76f
|
101 |
|
F |
102 |
public int getIs497() { |
|
103 |
return is497; |
|
104 |
} |
|
105 |
|
|
106 |
public void setIs497(int is497) { |
|
107 |
this.is497 = is497; |
|
108 |
} |
|
109 |
|
|
110 |
public Map<String, String> getRefKeyMap() { |
|
111 |
return refKeyMap; |
|
112 |
} |
|
113 |
|
|
114 |
public void setRefKeyMap(Map<String, String> refKeyMap) { |
|
115 |
this.refKeyMap = refKeyMap; |
|
116 |
} |
|
117 |
|
|
118 |
public String getOtherPrimeKey() { |
|
119 |
return otherPrimeKey; |
|
120 |
} |
|
121 |
public void setOtherPrimeKey(String otherPrimeKey) { |
|
122 |
this.otherPrimeKey = otherPrimeKey; |
|
123 |
} |
|
124 |
public String getPrimeKey() { |
|
125 |
return primeKey; |
|
126 |
} |
|
127 |
public void setPrimeKey(String primeKey) { |
|
128 |
this.primeKey = primeKey; |
|
129 |
} |
|
130 |
public int getDcFlag() { |
|
131 |
return dcFlag; |
|
132 |
} |
|
133 |
public void setDcFlag(int dcFlag) { |
|
134 |
this.dcFlag = dcFlag; |
|
135 |
} |
|
136 |
public int getClickTran() { |
|
137 |
return clickTran; |
|
138 |
} |
|
139 |
public void setClickTran(int clickTran) { |
|
140 |
this.clickTran = clickTran; |
|
141 |
} |
|
142 |
public String getBtnId() { |
|
143 |
return btnId; |
|
144 |
} |
|
145 |
public void setBtnId(String btnId) { |
|
146 |
this.btnId = btnId; |
|
147 |
} |
|
148 |
public int getIsGantt() { |
|
149 |
return isGantt; |
|
150 |
} |
|
151 |
public void setIsGantt(int isGantt) { |
|
152 |
this.isGantt = isGantt; |
|
153 |
} |
|
154 |
//------treegrid增加需要处理的内容 |
|
155 |
private HashMap<String,String> IO; |
|
156 |
private List<HashMap<String,String>> Changes;//数据保存处理 |
|
157 |
private List<HashMap<String,String>> otherChanges;//数据保存处理 |
|
158 |
//---把treegrid的格式转化为以前gtgrid的格式,兼容以前的代码 |
|
159 |
private String funlink="";//功能链接 |
|
160 |
private List<Map<String,Map<String,String>>> taobao=new ArrayList<Map<String,Map<String,String>>>();//taobao接口集合,以接口名称为key,应用级参数集合为值 |
|
161 |
private int tbtotal=0;//淘宝接口返回数据总数量 |
|
162 |
public int getTbtotal() { |
|
163 |
return tbtotal; |
|
164 |
} |
|
165 |
public void setTbtotal(int tbtotal) { |
|
166 |
this.tbtotal = tbtotal; |
|
167 |
} |
|
168 |
Map<String, String> env; |
|
169 |
|
|
170 |
private String keyID;//接口主从表ID,用来处理当重复下载,需要根据这个ID来判断当前ERP是否已存在,以决定是用update,还是新增 |
|
171 |
private static String picMatch="^\\|/smallpic.*?"+JsonUtil.IMGRANG.replaceAll("\\|", "\\\\|")+"+?"; //去掉格式图片,因为这个不是真正的图片不需要保存到数据库 |
|
172 |
private static String picMatch_uuid="^\\|/getImage.*?"+JsonUtil.IMGRANG.replaceAll("\\|", "\\\\|")+"+?"; //去掉格式图片,因为这个不是真正的图片不需要保存到数据库 |
|
173 |
public List<HashMap<String, String>> getAuditRecords() { |
|
174 |
return auditRecords; |
|
175 |
} |
|
176 |
public void setAuditRecords(List<HashMap<String, String>> auditRecords) { |
|
177 |
this.auditRecords = auditRecords; |
|
178 |
} |
|
179 |
public String[] getRowids() { |
|
180 |
return rowids; |
|
181 |
} |
|
182 |
public void setRowids(String[] rowids) { |
|
183 |
this.rowids = rowids; |
|
184 |
} |
|
185 |
public String getKeyID() { |
|
186 |
return keyID; |
|
187 |
} |
|
188 |
public void setKeyID(String keyID) { |
|
189 |
this.keyID = keyID; |
|
190 |
} |
|
191 |
public Map<String, String> getEnv() { |
|
192 |
return env; |
|
193 |
} |
|
194 |
public void setEnv(Map<String, String> env) { |
|
195 |
this.env = env; |
|
196 |
} |
|
197 |
public List<Map<String, Map<String, String>>> getTaobao() { |
|
198 |
return taobao; |
|
199 |
} |
|
200 |
public void setTaobao(List<Map<String, Map<String, String>>> taobao) { |
|
201 |
this.taobao = taobao; |
|
202 |
} |
|
203 |
public String getFields() { |
|
204 |
return fields; |
|
205 |
} |
|
206 |
public void setFields(String fields) { |
|
207 |
this.fields = fields; |
|
208 |
} |
|
209 |
public String getFunlink() { |
|
210 |
return funlink; |
|
211 |
} |
|
212 |
public void setFunlink(String funlink) { |
|
213 |
this.funlink = funlink; |
|
214 |
} |
|
215 |
|
|
216 |
|
|
217 |
public String getMasterCode() { |
|
218 |
return masterCode; |
|
219 |
} |
|
220 |
public void setMasterCode(String masterCode) { |
|
221 |
this.masterCode = masterCode; |
|
222 |
} |
|
223 |
|
|
224 |
public List<HashMap<String, String>> getOtherOA() { |
|
225 |
return otherOA; |
|
226 |
} |
|
227 |
|
|
228 |
public void setOtherOA(List<HashMap<String, String>> otherOA) { |
|
229 |
this.otherOA = otherOA; |
|
230 |
} |
|
231 |
public String getDisableDuplicateSubmitUUID() { |
|
232 |
return disableDuplicateSubmitUUID; |
|
233 |
} |
|
234 |
|
|
235 |
public void setDisableDuplicateSubmitUUID(String disableDuplicateSubmitUUID) { |
|
236 |
this.disableDuplicateSubmitUUID = disableDuplicateSubmitUUID; |
|
237 |
} |
|
238 |
/** |
|
239 |
* 装配只有格线窗体类型数据作为集合传过去 |
|
240 |
* @param action-表示当前操作是保存还是确定(save,tran) |
|
241 |
* @param panelAction-指明面板数据当前是新增还是修改(add,update)--必填 |
|
242 |
* @param panelTable-指明面板当前所属的功能号和类型(格式:"formid;type")--必填 |
|
243 |
* @param doccode-单号(修改操作需要指定) |
|
244 |
* @param masterCode-关键主字段,作为查询替换的字段 |
|
245 |
* @param insertedRecords--表示格线新增数据 |
|
246 |
|
|
247 |
* @param updatedRecords--表示格线修改数据 |
|
248 |
* @param panelRecords--表示面板数据(新增或修改) |
|
249 |
* |
|
250 |
* |
|
251 |
* **/ |
|
252 |
public void create0(String action, String panelAction,String doccode, |
|
253 |
List<HashMap<String, String>> insertedRecords, |
|
254 |
List<HashMap<String, String>> updatedRecords, |
|
255 |
String gType, |
|
256 |
String formid |
|
257 |
) { |
|
258 |
this.action = action; |
|
259 |
this.panelAction = panelAction; |
|
260 |
this.panelTable = formid+";"+gType.split("\\|")[0]; |
|
261 |
this.doccode = doccode; |
|
262 |
this.insertedRecords = insertedRecords; |
|
263 |
this.updatedRecords = updatedRecords; |
|
264 |
this.gType = gType; |
|
265 |
this.formid = formid; |
|
266 |
} |
|
267 |
/** |
|
268 |
* 装配只有面板窗体类型数据作为集合传过去 |
|
269 |
* @param action-表示当前操作是保存还是确定(save,tran) |
|
270 |
* @param panelAction-指明面板数据当前是新增还是修改(add,update)--必填 |
|
271 |
* @param panelTable-指明面板当前所属的功能号和类型(格式:"formid;type")--必填 |
|
272 |
* @param doccode-单号(修改操作需要指定) |
|
273 |
* @param masterCode-关键主字段,作为查询替换的字段 |
|
274 |
* @param insertedRecords--表示格线新增数据 |
|
275 |
* @param updatedRecords--表示格线修改数据 |
|
276 |
* @param panelRecords--表示面板数据(新增或修改) |
|
277 |
* |
|
278 |
* |
|
279 |
* **/ |
|
280 |
public void create1(String action, String panelAction,String doccode, |
|
281 |
List<HashMap<String, String>> panelRecords, |
|
282 |
String gType, |
|
283 |
String formid |
|
284 |
) { |
|
285 |
this.action = action; |
|
286 |
this.panelAction = panelAction; |
|
287 |
this.panelTable = formid+";"+gType.split("\\|")[0]; |
|
288 |
this.doccode = doccode; |
|
289 |
this.panelRecords = panelRecords; |
|
290 |
this.gType = gType; |
|
291 |
this.formid = formid; |
|
292 |
} |
|
293 |
/** |
|
294 |
* 装配双表(面板和格线)窗体类型数据作为集合传过去 |
|
295 |
* @param action-表示当前操作是保存还是确定(save,tran) |
|
296 |
* @param panelAction-指明面板数据当前是新增还是修改(add,update)--必填 |
|
297 |
* @param panelTable-指明面板当前所属的功能号和类型(格式:"formid;type")--必填 |
|
298 |
* @param doccode-单号(修改操作需要指定) |
|
299 |
* @param masterCode-关键主字段,作为查询替换的字段 |
|
300 |
* @param insertedRecords--表示格线新增数据 |
|
301 |
* @param updatedRecords--表示格线修改数据 |
|
302 |
* @param panelRecords--表示面板数据(新增或修改) |
|
303 |
* |
|
304 |
* |
|
305 |
* **/ |
|
306 |
public void create2(String action, String panelAction,String doccode, |
|
307 |
List<HashMap<String, String>> insertedRecords, |
|
308 |
List<HashMap<String, String>> updatedRecords, |
|
309 |
List<HashMap<String, String>> panelRecords, |
|
310 |
String gType, |
|
311 |
String formid |
|
312 |
) { |
|
313 |
this.action = action; |
|
314 |
this.panelAction = panelAction; |
|
315 |
this.panelTable = formid+";"+gType.split("\\|")[0]; |
|
316 |
this.panelRecords = panelRecords; |
|
317 |
this.insertedRecords = insertedRecords; |
|
318 |
this.doccode = doccode; |
|
319 |
this.updatedRecords = updatedRecords; |
|
320 |
this.gType = gType; |
|
321 |
this.formid = formid; |
|
322 |
} |
|
323 |
|
|
324 |
/** |
|
325 |
* 淘宝调用 |
|
326 |
* @param action |
|
327 |
* @param panelAction |
|
328 |
* @param doccode |
|
329 |
* @param insertedRecords |
|
330 |
* @param updatedRecords |
|
331 |
* @param panelRecords |
|
332 |
* @param gType |
|
333 |
* @param formid |
|
334 |
* @param conts |
|
335 |
*/ |
|
336 |
public void create2taobao(String action, String panelAction,String doccode, |
|
337 |
List<HashMap<String, String>> insertedRecords, |
|
338 |
List<HashMap<String, String>> updatedRecords, |
|
339 |
List<HashMap<String, String>> panelRecords, |
|
340 |
String gType, |
|
341 |
String formid, |
|
342 |
String conts, |
|
343 |
int total |
|
344 |
) { |
|
345 |
// this.action = action; |
|
346 |
// this.panelAction = panelAction; |
|
347 |
// this.panelTable = formid+";"+gType.split("\\|")[0]; |
|
348 |
this.panelRecords = panelRecords; |
|
349 |
this.insertedRecords = insertedRecords; |
|
350 |
// this.doccode = doccode; |
|
351 |
this.updatedRecords = updatedRecords; |
|
352 |
this.colns=conts; |
|
353 |
this.tbtotal=total; |
|
354 |
// this.gType = gType; |
|
355 |
// this.formid = formid; |
|
356 |
} |
|
357 |
|
|
358 |
/** |
|
359 |
* 装配3表类型数据作为集合传过去 |
|
360 |
* @param action-表示当前操作是保存还是确定(save,tran) |
|
361 |
* @param panelAction-指明面板数据当前是新增还是修改(add,update)--必填 |
|
362 |
* @param panelTable-指明面板当前所属的功能号和类型(格式:"formid;type")--必填 |
|
363 |
* @param doccode-单号(修改操作需要指定) |
|
364 |
* @param masterCode-关键主字段,作为查询替换的字段 |
|
365 |
* @param insertedRecords--表示格线新增数据 |
|
366 |
* @param updatedRecords--表示格线修改数据 |
|
367 |
* @param panelRecords--表示面板数据(新增或修改) |
|
368 |
* |
|
369 |
* |
|
370 |
* **/ |
|
371 |
public void create3( |
|
372 |
//--常规基础数据 |
|
373 |
String action, String panelAction, String doccode, |
|
374 |
List<HashMap<String, String>> insertedRecords, |
|
375 |
List<HashMap<String, String>> updatedRecords, |
|
376 |
List<HashMap<String, String>> panelRecords, |
|
377 |
|
|
378 |
//如果当前是3表结构 则需要把下面的的传进来,否则为null |
|
379 |
List<HashMap<String, String>> otherInserteds, |
|
380 |
List<HashMap<String, String>> otherUpdateds, |
|
381 |
String otherTable, int otherFormid, String otherKey, |
|
382 |
String otherColns, |
|
383 |
//--3表 end |
|
384 |
String gType, |
|
385 |
String formid |
|
386 |
) { |
|
387 |
this.action = action; |
|
388 |
this.panelAction = panelAction; |
|
389 |
this.panelTable = formid+";"+gType.split("\\|")[0]; |
|
390 |
this.doccode = doccode; |
|
391 |
this.insertedRecords = insertedRecords; |
|
392 |
this.updatedRecords = updatedRecords; |
|
393 |
this.panelRecords = panelRecords; |
|
394 |
this.otherInserteds = otherInserteds; |
|
395 |
this.otherUpdateds = otherUpdateds; |
|
396 |
this.otherTable = otherTable; |
|
397 |
this.otherFormid = otherFormid; |
|
398 |
this.otherKey = otherKey; |
|
399 |
this.gType = gType; |
|
400 |
this.formid = formid; |
|
401 |
} |
|
402 |
/** |
|
403 |
* 装配多表窗体类型数据作为集合传过去 |
|
404 |
* @param action-表示当前操作是保存还是确定(save,tran) |
|
405 |
* @param panelAction-指明面板数据当前是新增还是修改(add,update)--必填 |
|
406 |
* @param panelTable-指明面板当前所属的功能号和类型(格式:"formid;type")--必填 |
|
407 |
* @param doccode-单号(修改操作需要指定) |
|
408 |
* @param masterCode-关键主字段,作为查询替换的字段 |
|
409 |
* @param insertedRecords--表示格线新增数据 |
|
410 |
* @param updatedRecords--表示格线修改数据 |
|
411 |
* @param panelRecords--表示面板数据(新增或修改) |
|
412 |
* |
|
413 |
* |
|
414 |
* **/ |
|
415 |
public void create4( |
|
416 |
//--常规基础数据 |
|
417 |
String action, String panelAction, String panelTable, String doccode, |
|
418 |
|
|
419 |
List<Panel> panels, |
|
420 |
List<Grid> grids, |
|
421 |
|
|
422 |
String gType, |
|
423 |
String formid |
|
424 |
) { |
|
425 |
this.action = action; |
|
426 |
this.panelAction = panelAction; |
|
427 |
this.panelTable = panelTable; |
|
428 |
this.doccode = doccode; |
|
429 |
this.panels = panels; |
|
430 |
this.grids = grids; |
|
431 |
this.gType = gType; |
|
432 |
this.formid = formid; |
|
433 |
} |
|
434 |
public void process(){ |
|
435 |
String delrowid="";//保存二表是新增且又删除的rowid,以便给第三表做关联删除用 |
|
436 |
if(Changes!=null&&Changes.size()>0){ |
|
437 |
int index=0; |
|
438 |
for(HashMap<String,String> map:Changes){ |
|
439 |
if(isGantt==0) map.remove("id"); |
|
440 |
if( |
|
441 |
("1".equalsIgnoreCase(map.get("Deleted"))||"true".equalsIgnoreCase(map.get("Deleted"))) |
|
442 |
&&(!"1".equalsIgnoreCase(map.get("Added"))&&!"true".equalsIgnoreCase(map.get("Added")))//当存在新增行又马上删除的情况,在这里需要做个判断 |
|
443 |
){ |
|
444 |
if(map.containsKey("G")) map.remove("G");//去掉甘特图的信息 |
|
445 |
deletedRecords.add(map); |
|
446 |
continue; |
|
447 |
} |
|
448 |
if("1".equalsIgnoreCase(map.get("Added"))&&"1".equalsIgnoreCase(map.get("Deleted"))){ |
|
449 |
//新增且又马上删除的情况 |
|
450 |
if("15".equalsIgnoreCase(this.getgType())){ |
|
451 |
delrowid+=","+map.get("rowid"); |
|
452 |
} |
|
453 |
} |
|
454 |
if( |
|
455 |
("1".equalsIgnoreCase(map.get("Added"))||"true".equalsIgnoreCase(map.get("Added"))) |
|
456 |
&&(!"1".equalsIgnoreCase(map.get("Deleted"))&&!"true".equalsIgnoreCase(map.get("Deleted"))) |
|
457 |
){ |
|
458 |
if(this.getCp()&&"15".equalsIgnoreCase(this.getgType())){//15类型且是复单情况处理rowid |
|
459 |
if(rowids!=null) { |
|
460 |
map.put("rowid", rowids[index]); |
|
461 |
} |
|
462 |
} |
|
463 |
insertedRecords.add(map); |
|
464 |
index++; |
|
465 |
continue; |
|
466 |
} |
|
467 |
if("1".equalsIgnoreCase(map.get("Changed"))||"true".equalsIgnoreCase(map.get("Changed"))){ |
|
468 |
getChanged(map,updatedRecords,vssRecords); |
|
469 |
continue; |
|
470 |
} |
|
471 |
if("1".equalsIgnoreCase(map.get("OAChanged"))||"true".equalsIgnoreCase(map.get("OAChanged"))){ |
|
472 |
oARecords.add(map); |
|
473 |
continue; |
|
474 |
} |
|
475 |
if("1".equalsIgnoreCase(map.get("_YCAUDIT_"))||"true".equalsIgnoreCase(map.get("_YCAUDIT_"))){//处理审计数据 |
|
476 |
auditRecords.add(map); |
|
477 |
continue; |
|
478 |
} |
|
479 |
|
|
480 |
} |
|
481 |
} |
|
482 |
if(otherChanges!=null&&otherChanges.size()>0){//三表结构 |
|
483 |
for(HashMap<String,String> map:otherChanges){ |
|
484 |
map.remove("id"); |
|
485 |
if( |
|
486 |
//"1".equalsIgnoreCase(map.get("Deleted"))||"true".equalsIgnoreCase(map.get("Deleted")) |
|
487 |
("1".equalsIgnoreCase(map.get("Deleted"))||"true".equalsIgnoreCase(map.get("Deleted"))) |
|
488 |
&&(!"1".equalsIgnoreCase(map.get("Added"))&&!"true".equalsIgnoreCase(map.get("Added"))) |
|
489 |
){ |
|
490 |
otherDeleteds.add(map); |
|
491 |
continue; |
|
492 |
} |
|
493 |
if( |
|
494 |
//"1".equalsIgnoreCase(map.get("Added"))||"true".equalsIgnoreCase(map.get("Added")) |
|
495 |
("1".equalsIgnoreCase(map.get("Added"))||"true".equalsIgnoreCase(map.get("Added"))) |
|
496 |
&&(!"1".equalsIgnoreCase(map.get("Deleted"))&&!"true".equalsIgnoreCase(map.get("Deleted"))) |
|
497 |
){ |
|
498 |
if(delrowid.contains(","+map.get("rowid"))){ |
|
499 |
if(this.cp) continue;//复单时且当前行关联的第二表是删除,且这一行也就不需要增加写到后台 |
|
500 |
otherDeleteds.add(map); |
|
501 |
}else |
|
502 |
otherInserteds.add(map); |
|
503 |
continue; |
|
504 |
} |
|
505 |
if("1".equalsIgnoreCase(map.get("Changed"))||"true".equalsIgnoreCase(map.get("Changed"))){ |
|
506 |
getChanged(map,otherUpdateds,otherVss); |
|
507 |
continue; |
|
508 |
} |
|
509 |
if("1".equalsIgnoreCase(map.get("OAChanged"))||"true".equalsIgnoreCase(map.get("OAChanged"))){ |
|
510 |
otherOA.add(map); |
|
511 |
continue; |
|
512 |
} |
|
513 |
if("1".equalsIgnoreCase(map.get("_YCAUDIT_"))||"true".equalsIgnoreCase(map.get("_YCAUDIT_"))){//处理审计数据 |
|
514 |
auditRecords.add(map); |
|
515 |
continue; |
|
516 |
} |
|
517 |
} |
|
518 |
} |
|
519 |
} |
|
520 |
public void getChanged(HashMap<String, String> map,List<HashMap<String,String>> upp,List<HashMap<String,String>> vss) { |
|
521 |
HashMap<String,String> up=new HashMap<String,String>(); |
|
522 |
HashMap<String,String> vs=new HashMap<String,String>(); |
|
523 |
map.remove("Changed"); |
|
524 |
Iterator<Map.Entry<String,String>> iter = map.entrySet().iterator(); |
|
525 |
String flg=""; |
|
526 |
int ind=0; |
|
527 |
boolean img=false; |
|
528 |
while (iter.hasNext()) { |
|
529 |
Map.Entry<String,String> entry =iter.next(); |
|
530 |
img=false; |
|
531 |
String key = entry.getKey(); |
|
532 |
String value = entry.getValue(); |
|
533 |
if(key.lastIndexOf("Orig")<0&&!map.containsKey(key+"Orig")){ |
|
534 |
img=this.checkImg(value); |
|
535 |
if(img) continue; |
|
536 |
}else{ |
|
537 |
flg=key; |
|
538 |
} |
|
539 |
if(value!=null&&value!="") value=value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">"); |
|
540 |
if(key.equalsIgnoreCase("_ConstWidth")) continue; |
|
541 |
if(key.equalsIgnoreCase("id")){ |
|
542 |
if(value!=null&&value!="") |
|
543 |
if(value.startsWith("AR")) continue; |
|
544 |
|
|
545 |
} |
|
546 |
if(key.lastIndexOf("Orig")>-1){//表示需要放在匹配里面 |
|
547 |
ind+=1; |
|
548 |
// if(value!=null&&!"".equalsIgnoreCase(value)){ |
|
549 |
// img=this.checkImg(map.get(key.substring(0,key.length()-4)));//取得当是Orig时候,原值是不是就是图片的值,需要处理这种情况 |
|
550 |
// if(img) continue; |
|
551 |
// } |
|
552 |
if(value!=null&&!value.matches(picMatch_uuid)){//当前是上传,但不是图片,保留的只是显示值,而不是实际值需要去掉 |
|
553 |
|
|
554 |
vs.put(key.substring(0,key.length()-4), value); |
|
555 |
|
|
556 |
}else{ |
|
557 |
flg=key.substring(0,key.length()-4);//保存在当前行中需要移除的值 |
|
558 |
|
|
559 |
} |
|
560 |
String temp=map.get(key.substring(0,key.length()-4));//取新值 |
|
561 |
if(temp!=null&&temp!="") temp=temp.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");//去掉更新时候存在&的转义 |
|
562 |
if(!img) |
|
563 |
up.put(key.substring(0,key.length()-4),temp ); |
|
564 |
}else{ |
|
565 |
if(flg.equalsIgnoreCase(key)){ |
|
566 |
continue; |
|
567 |
}else |
|
568 |
if(!vs.containsKey(key)) vs.put(key, value); |
|
569 |
} |
|
570 |
} |
|
571 |
if((!img&&ind>0)){//(!img&&ind>0)是没有图片的情况, |
|
572 |
upp.add(up); |
|
573 |
vss.add(vs); |
|
574 |
} |
|
575 |
} |
|
576 |
|
|
577 |
|
|
578 |
|
|
579 |
private boolean checkImg(String value) { |
|
580 |
if(value==null) return false; |
|
581 |
if(value.matches(picMatch_uuid)) //JsonUtil.IMGRANG |
|
582 |
return true; |
|
583 |
|
|
584 |
return false; |
|
585 |
} |
|
586 |
public int getaFlag() { |
|
587 |
return aFlag; |
|
588 |
} |
|
589 |
|
|
590 |
|
|
591 |
|
|
592 |
public void setaFlag(int aFlag) { |
|
593 |
this.aFlag = aFlag; |
|
594 |
} |
|
595 |
|
|
596 |
|
|
597 |
|
|
598 |
public List<HashMap<String, String>> getOtherChanges() { |
|
599 |
return otherChanges; |
|
600 |
} |
|
601 |
|
|
602 |
|
|
603 |
|
|
604 |
public void setOtherChanges(List<HashMap<String, String>> otherChanges) { |
|
605 |
this.otherChanges = otherChanges; |
|
606 |
} |
|
607 |
|
|
608 |
|
|
609 |
|
|
610 |
public HashMap<String, String> getIO() { |
|
611 |
return IO; |
|
612 |
} |
|
613 |
|
|
614 |
|
|
615 |
|
|
616 |
public void setIO(HashMap<String, String> iO) { |
|
617 |
IO = iO; |
|
618 |
} |
|
619 |
|
|
620 |
|
|
621 |
|
|
622 |
public List<HashMap<String, String>> getChanges() { |
|
623 |
return Changes; |
|
624 |
} |
|
625 |
|
|
626 |
|
|
627 |
|
|
628 |
public void setChanges(List<HashMap<String, String>> changes) { |
|
629 |
Changes = changes; |
|
630 |
} |
|
631 |
|
|
632 |
|
|
633 |
|
|
634 |
public String getToken() { |
|
635 |
return token; |
|
636 |
} |
|
637 |
public void setToken(String token) { |
|
638 |
this.token = token; |
|
639 |
} |
|
640 |
public String getOtherColns() { |
|
641 |
return otherColns; |
|
642 |
} |
|
643 |
public void setOtherColns(String otherColns) { |
|
644 |
this.otherColns = otherColns; |
|
645 |
} |
|
646 |
public String getColns() { |
|
647 |
return colns; |
|
648 |
} |
|
649 |
public void setColns(String colns) { |
|
650 |
this.colns = colns; |
|
651 |
} |
|
652 |
public String getCudoc() { |
|
653 |
return cudoc; |
|
654 |
} |
|
655 |
public void setCudoc(String cudoc) { |
|
656 |
this.cudoc = cudoc; |
|
657 |
} |
|
658 |
public String getExpr() { |
|
659 |
return expr; |
|
660 |
} |
|
661 |
public void setExpr(String expr) { |
|
662 |
this.expr = expr; |
|
663 |
} |
|
664 |
public boolean getCp() { |
|
665 |
return cp; |
|
666 |
} |
|
667 |
public void setCp(boolean cp) { |
|
668 |
this.cp = cp; |
|
669 |
} |
|
670 |
public String getOa() { |
|
671 |
return oa; |
|
672 |
} |
|
673 |
public void setOa(String oa) { |
|
674 |
this.oa = oa; |
|
675 |
} |
|
676 |
public String getFl() { |
|
677 |
return fl; |
|
678 |
} |
|
679 |
public void setFl(String fl) { |
|
680 |
this.fl = fl; |
|
681 |
} |
|
682 |
public List<HashMap<String, String>> getEmptyRecords() { |
|
683 |
return emptyRecords; |
|
684 |
} |
|
685 |
public void setEmptyRecords(List<HashMap<String, String>> emptyRecords) { |
|
686 |
this.emptyRecords = emptyRecords; |
|
687 |
} |
|
688 |
public String getFormid() { |
|
689 |
return formid; |
|
690 |
} |
|
691 |
public void setFormid(String formid) { |
|
692 |
this.formid = formid; |
|
693 |
} |
|
694 |
public List<HashMap<String, String>> getMuilTranRecords() { |
|
695 |
return muilTranRecords; |
|
696 |
} |
|
697 |
public void setMuilTranRecords(List<HashMap<String, String>> muilTranRecords) { |
|
698 |
this.muilTranRecords = muilTranRecords; |
|
699 |
} |
|
700 |
public String getgType() { |
|
701 |
return gType; |
|
702 |
} |
|
703 |
public void setgType(String gType) { |
|
704 |
this.gType = gType; |
|
705 |
} |
|
706 |
public List<Panel> getPanels() { |
|
707 |
return panels; |
|
708 |
} |
|
709 |
public void setPanels(List<Panel> panels) { |
|
710 |
this.panels = panels; |
|
711 |
} |
|
712 |
public List<Grid> getGrids() { |
|
713 |
return grids; |
|
714 |
} |
|
715 |
public void setGrids(List<Grid> grids) { |
|
716 |
this.grids = grids; |
|
717 |
} |
|
718 |
public String getOtherKey() { |
|
719 |
return otherKey; |
|
720 |
} |
|
721 |
public void setOtherKey(String otherKey) { |
|
722 |
this.otherKey = otherKey; |
|
723 |
} |
|
724 |
public int getOtherFormid() { |
|
725 |
return otherFormid; |
|
726 |
} |
|
727 |
public void setOtherFormid(int otherFormid) { |
|
728 |
this.otherFormid = otherFormid; |
|
729 |
} |
|
730 |
public List<HashMap<String, String>> getOtherDeleteds() { |
|
731 |
return otherDeleteds; |
|
732 |
} |
|
733 |
public void setOtherDeleteds(List<HashMap<String, String>> otherDeleteds) { |
|
734 |
this.otherDeleteds = otherDeleteds; |
|
735 |
} |
|
736 |
public List<HashMap<String, String>> getOtherInserteds() { |
|
737 |
return otherInserteds; |
|
738 |
} |
|
739 |
public void setOtherInserteds(List<HashMap<String, String>> otherInserteds) { |
|
740 |
this.otherInserteds = otherInserteds; |
|
741 |
} |
|
742 |
public List<HashMap<String, String>> getOtherUpdateds() { |
|
743 |
return otherUpdateds; |
|
744 |
} |
|
745 |
public void setOtherUpdateds(List<HashMap<String, String>> otherUpdateds) { |
|
746 |
this.otherUpdateds = otherUpdateds; |
|
747 |
} |
|
748 |
public List<HashMap<String, String>> getOtherVss() { |
|
749 |
return otherVss; |
|
750 |
} |
|
751 |
public void setOtherVss(List<HashMap<String, String>> otherVss) { |
|
752 |
this.otherVss = otherVss; |
|
753 |
} |
|
754 |
|
|
755 |
public String getOtherTable() { |
|
756 |
return otherTable; |
|
757 |
} |
|
758 |
public void setOtherTable(String otherTable) { |
|
759 |
this.otherTable = otherTable; |
|
760 |
} |
|
761 |
public List<HashMap<String, String>> getOtherTranRecords() { |
|
762 |
return otherTranRecords; |
|
763 |
} |
|
764 |
public void setOtherTranRecords(List<HashMap<String, String>> otherTranRecords) { |
|
765 |
this.otherTranRecords = otherTranRecords; |
|
766 |
} |
|
767 |
public String getDoccode() { |
|
768 |
return doccode; |
|
769 |
} |
|
770 |
public void setDoccode(String doccode) { |
|
771 |
this.doccode = doccode; |
|
772 |
} |
|
773 |
public String getPanelAction() { |
|
774 |
return panelAction; |
|
775 |
} |
|
776 |
public void setPanelAction(String panelAction) { |
|
777 |
this.panelAction = panelAction; |
|
778 |
} |
|
779 |
public String getPanelTable() { |
|
780 |
return panelTable; |
|
781 |
} |
|
782 |
public void setPanelTable(String panelTable) { |
|
783 |
this.panelTable = panelTable; |
|
784 |
} |
|
785 |
public List<HashMap<String, String>> getTranRecords() { |
|
786 |
return tranRecords; |
|
787 |
} |
|
788 |
public void setTranRecords(List<HashMap<String, String>> tranRecords) { |
|
789 |
this.tranRecords = tranRecords; |
|
790 |
} |
|
791 |
public List<HashMap<String, String>> getDeletedRecords() { |
|
792 |
return deletedRecords; |
|
793 |
} |
|
794 |
public void setDeletedRecords(List<HashMap<String, String>> deletedRecords) { |
|
795 |
this.deletedRecords = deletedRecords; |
|
796 |
} |
|
797 |
public List<HashMap<String, String>> getInsertedRecords() { |
|
798 |
return insertedRecords; |
|
799 |
} |
|
800 |
public void setInsertedRecords(List<HashMap<String, String>> insertedRecords) { |
|
801 |
this.insertedRecords = insertedRecords; |
|
802 |
} |
|
803 |
public List<HashMap<String, String>> getUpdatedRecords() { |
|
804 |
return updatedRecords; |
|
805 |
} |
|
806 |
public void setUpdatedRecords(List<HashMap<String, String>> updatedRecords) { |
|
807 |
this.updatedRecords = updatedRecords; |
|
808 |
} |
|
809 |
public List<HashMap<String, String>> getVssRecords() { |
|
810 |
return vssRecords; |
|
811 |
} |
|
812 |
public void setVssRecords(List<HashMap<String, String>> vssRecords) { |
|
813 |
this.vssRecords = vssRecords; |
|
814 |
} |
|
815 |
public String[] getFieldsName() { |
|
816 |
return fieldsName; |
|
817 |
} |
|
818 |
public void setFieldsName(String[] fieldsName) { |
|
819 |
this.fieldsName = fieldsName; |
|
820 |
} |
|
821 |
|
|
822 |
public String getAction() { |
|
823 |
return action; |
|
824 |
} |
|
825 |
public void setAction(String action) { |
|
826 |
this.action = action; |
|
827 |
} |
|
828 |
public PageInfo getPageInfo() { |
|
829 |
return pageInfo; |
|
830 |
} |
|
831 |
public void setPageInfo(PageInfo pageInfo) { |
|
832 |
this.pageInfo = pageInfo; |
|
833 |
} |
|
834 |
public List<HashMap<String, String>> getPanelRecords() { |
|
835 |
return panelRecords; |
|
836 |
} |
|
837 |
public void setPanelRecords(List<HashMap<String, String>> panelRecords) { |
|
838 |
this.panelRecords = panelRecords; |
|
839 |
} |
|
840 |
|
|
841 |
public List<HashMap<String, String>> getoARecords() { |
|
842 |
return oARecords; |
|
843 |
} |
|
844 |
|
|
845 |
public void setoARecords(List<HashMap<String, String>> oARecords) { |
|
846 |
this.oARecords = oARecords; |
|
847 |
} |
|
848 |
} |