自动化立体仓库 - WMS系统
#
pang.jiabao
4 天以前 2dc12d419733c094bb0bbc7ef4f7a32d5067cfb9
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
package com.zy.asrs.service.impl;
 
import com.alibaba.excel.util.StringUtils;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.mes.TransArrivalStation;
import com.zy.asrs.entity.mes.TransParent;
import com.zy.asrs.entity.rcs.*;
import com.zy.asrs.enums.RcsRetMethodEnum;
import com.zy.asrs.mapper.BlockStationMapper;
import com.zy.asrs.mapper.BlockTaskMapper;
import com.zy.asrs.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.io.*;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.List;
import java.util.Objects;
 
@Slf4j
@Service
public class RcsServiceImpl implements RcsService {
 
    // 海康RCS地址
    @Value("${hik.url}")
    private String HIK_URL;
    // 华晓RCS地址
    @Value("${hx.url}")
    private String HX_URL;
    @Value("${mes.defaultUserId}")
    public long defaultUserId;
 
 
    @Resource
    private MesService mesService;
    @Resource
    private TaskService taskService;
    @Resource
    private BlockStationMapper blockStationMapper;
    @Resource
    private BlockTaskMapper blockTaskMapper;
    @Resource
    private TaskDetlServiceImpl taskDetlService;
    @Resource
    private WrkMastService wrkMastService;
 
 
    // region 封锁区逻辑,目前只有一个大封锁区,任务全部转到滑块库处理,或直接写到滑块库
 
    /**
     * 申请封锁区请求
     *
     * @param apply
     * @return
     */
    private int applyBlock(RcsReporterEqpt apply) {
 
        BlockTask blockTask = new BlockTask();
        blockTask.setTaskCode(apply.getTaskCode());
        blockTask.setApplyTime(new Date());
        blockTask.setBlockNo(apply.getEqptCode());
        blockTask.setBlockName(apply.getEqptName());
        blockTask.setMethod(apply.getMethod());
        blockTask.setCompleted(0);
 
        return blockTaskMapper.insert(blockTask);
    }
 
    /**
     * 管理封锁区进入
     * TODO:增加锁防冲突,可能为分布式锁,定期5秒循环调用
     *
     */
    public void managerBlock() {
 
       try {
           BlockTask firstTask = blockTaskMapper.findTop();
           if (firstTask == null) {
               return;
           }
           EntityWrapper<BlockStation> wrapper = new EntityWrapper<>();
           wrapper.eq("block_no", firstTask.getBlockNo());
           List<BlockStation> stations = blockStationMapper.selectList(wrapper);
           if (!stations.isEmpty()) {
               boolean locked = false;
               for (BlockStation station : stations) {
                   // 只允许1个厂家设备进入封锁区,status状态:0 空闲;1 海康封锁中;2 华晓封锁中;-1 异常;
                   if (station.getStatus() > 0 && !station.getStatus().equals(firstTask.getAgvFactory())) {
                       locked = true;
                       break;
                   }
               }
 
               if (!locked) {
                   // 封锁状态
                   int success = blockStationMapper.addByBlockNo(firstTask.getBlockNo(), firstTask.getAgvFactory());
                   if (success > 0) {
                       // 通知RCS
                       RcsEqptNotify notify = new RcsEqptNotify();
                       notify.setEqptCode(firstTask.getBlockNo());
                       notify.setTaskCode(firstTask.getTaskCode());
                       notify.setActionStatus("1");
                       notifyEqpt(notify, firstTask.getAgvFactory());
                   }
               }
           }
       } catch (Exception e) {
           log.error("管理封锁区异常", e);
       }
    }
 
    /**
     * 离开释放封锁区请求
     * TODO:增加锁防冲突,可能为分布式锁
     *
     * @param apply
     * @return
     */
    private int releaseBlock(RcsReporterEqpt apply) {
 
        BlockTask task = blockTaskMapper.findByTaskCode(apply.getTaskCode());
 
        EntityWrapper<BlockStation> wrapper = new EntityWrapper<>();
        wrapper.eq("block_no", task.getBlockNo());
        List<BlockStation> stations = blockStationMapper.selectList(wrapper);
        if (!stations.isEmpty()) {
            // 先完成任务
            task.setCompleted(1);
            task.setCompletedTime(new Date());
            int updateTask = blockTaskMapper.updateById(task);
            // 再更新封锁区数量
            for (BlockStation station : stations) {
                if (station.getAgvNum() - 1 == 0) {
                    station.setStatus(0);
                }
                station.setAgvNum(station.getAgvNum() - 1);
                int updateBlock = blockStationMapper.updateById(station);
            }
        }
 
        return 1;
    }
 
    // endregion
 
 
    // region 海康RCS,AGV
 
    /**
     * 2.1.2任务下发接口
     * 厂家:海量、华晓
     *
     * @param rcsTaskSubmit
     * @param rcsFactory 1 海康;2 华晓;
     * @return
     */
    public int submitTask(RcsTaskSubmit rcsTaskSubmit, int rcsFactory){
        return 1;
 
//        String url = rcsFactory == 2 ? HX_URL :HIK_URL + "api/robot/controller/task/submit";
//        String response = sendPost(url, rcsTaskSubmit.toString());
//        if (!StringUtils.isEmpty(response) && response.contains("code")){
//            RcsReturn rcsReturn = JSONObject.parseObject(response, RcsReturn.class);
//            if("SUCCESS".equals(rcsReturn.getCode())) {
//                JSONObject data = rcsReturn.getData();
//                String robotTaskCode = data.getString("robotTaskCode");
//                if (robotTaskCode.equals(rcsTaskSubmit.getRobotTaskCode())){
//                    return 1;
//                }
//            }
//        }
//
//        return 0;
    }
 
    /**
     * 2.1.3任务继续执行接口
     *
     * @param rcsTaskContinue
     * @param rcsFactory
     * @return
     */
    public int continueTask(RcsTaskContinue rcsTaskContinue, int rcsFactory){
 
        String url = rcsFactory == 2 ? HX_URL :HIK_URL + "api/robot/controller/task/extend/continue";
        String response = sendPost(url, rcsTaskContinue.toString());
        if (!StringUtils.isEmpty(response) && response.contains("code")){
            RcsReturn rcsReturn = JSONObject.parseObject(response, RcsReturn.class);
            if("SUCCESS".equals(rcsReturn.getCode())) {
                JSONObject data = rcsReturn.getData();
                String robotTaskCode = data.getString("robotTaskCode");
                if (robotTaskCode.equals(rcsTaskContinue.getRobotTaskCode())) {
                    return 1;
                }
            }
        }
 
        return 0;
    }
 
    /**
     * 2.1.4任务取消接口
     *
     * @param rcsTaskCancel
     * @param rcsFactory
     * @return
     */
    public int cancelTask(RcsTaskCancel rcsTaskCancel, int rcsFactory){
 
        String url = rcsFactory == 2 ? HX_URL :HIK_URL  + "api/robot/controller/task/cancel";
        String response = sendPost(url, rcsTaskCancel.toString());
        if (!StringUtils.isEmpty(response) && response.contains("code")){
            RcsReturn rcsReturn = JSONObject.parseObject(response, RcsReturn.class);
            if("SUCCESS".equals(rcsReturn.getCode())) {
                JSONObject data = rcsReturn.getData();
                String robotTaskCode = data.getString("robotTaskCode");
                if (robotTaskCode.equals(rcsTaskCancel.getRobotTaskCode())) {
                    return 1;
                }
            }
        }
 
        return 0;
    }
 
    /**
     * 2.1.15外设执行通知接口,通知进入封锁区
     *
     * @param rcsEqptNotify
     * @param rcsFactory
     * @return
     */
    private int notifyEqpt(RcsEqptNotify rcsEqptNotify, int rcsFactory){
 
        String url = rcsFactory == 2 ? HX_URL :HIK_URL + "api/wcs/robot/eqpt/notify";
        String response = sendPost(url, rcsEqptNotify.toString());
        if (!StringUtils.isEmpty(response) && response.contains("code")){
            RcsReturn rcsReturn = JSONObject.parseObject(response, RcsReturn.class);
            if("SUCCESS".equals(rcsReturn.getCode())) {
                JSONObject data = rcsReturn.getData();
                String applyCode = data.getString("taskCode");  //申请请求编号,非任务编号
                if (applyCode.equals(rcsEqptNotify.getTaskCode())) {
                    return 1;
                }
            }
        }
 
        return 0;
    }
 
    /**
     * 2.2.1任务执行回馈
     * 厂家:海量、华晓
     *
     * @param rcsReporterTask
     * @return
     */
    public RcsReturn reporterTask(RcsReporterTask rcsReporterTask) {
 
        RcsReturn rcsReturn = new RcsReturn();
 
        String robotTaskCode = rcsReporterTask.getRobotTaskCode();
        String singleRobotCode = rcsReporterTask.getSingleRobotCode();
        JSONObject values = rcsReporterTask.getExtra().getJSONObject("values");
        // start : 任务开始;outbin : 走出储位;end : 任务完成
        String method = values.getString("method");
        String carrierType = values.getString("carrierType");
 
        try {
            if ("Q3".equals(carrierType) || "Q8".equals(carrierType)) {    //AGV
                EntityWrapper<Task> wrapper = new EntityWrapper<>();
                wrapper.eq("task_no", robotTaskCode);
                Task task = taskService.selectOne(wrapper);
                if (task == null || !task.getTaskNo().equals(robotTaskCode)) {
                    rcsReturn.setCode("Err_RobotCodeNotMatch");
                    rcsReturn.setMessage("");
                    JSONObject data = new JSONObject();
                    data.put("robotTaskCode", robotTaskCode);
                    rcsReturn.setData(data);
                    return rcsReturn;
                }
                JSONObject memo = JSONObject.parseObject(task.getMemo());
 
                switch (Objects.requireNonNull(RcsRetMethodEnum.getEnum(method))) {
                    case TASK_START: {
                        task.setWrkSts(302L);   // 301 任务下发、302 任务执行、303 任务中断、304 任务结束
                        task.setModiTime(new Date());
                        task.setModiUser(defaultUserId);
                        taskService.updateById(task);
                    } break;
//                    case TASK_OUT_BIN: {} break;
                    case TASK_END: {
                        // 更新任务状态等内部逻辑
                        task.setWrkSts(304L);   // 301 任务下发、302 任务执行、303 任务中断、304 任务结束
                        task.setModiTime(new Date());
                        task.setModiUser(defaultUserId);
                        taskService.updateById(task);
                        // 任务完成
                        mesService.reporterTask(rcsReporterTask);
 
//                    EntityWrapper<TaskDetl> wapper2 = new EntityWrapper<>();
//                    wapper2.eq("wrk_no", task.getWrkNo())
//                            .eq("matnr", memo.getString("ItemNo"))
//                            .eq("order_no", memo.getString("OrderNo"));
//                    TaskDetl taskDetl = taskDetlService.selectOne(wapper2);
//                    taskDetl.setAnfme()
//                    taskDetlService.updateById();
 
//                    // 301 任务下发、302 任务执行、303 任务中断、304 任务结束
//                    taskService.completeWrkMast();
//                    taskDetlService.
 
                    } break;
                    case APPLY_IN_STATION:
                    case APPLY_OFF_STATION:
                    case ARRIVE_OFF_STATION: {
                        TransParent apply = new TransParent();
                        apply.setTaskno(robotTaskCode);
                        apply.setTaskname(memo.getString("taskName"));
                        apply.setAgvCode(singleRobotCode);
                        apply.setTransType(memo.getString("TransType"));
                        apply.setProductLineId(memo.getString("ProductLineId"));
//                        apply.setStationId(task.getStaNo());
                        String transType = memo.getString("TransType");
                        if(transType.equals("02") || transType.equals("04") || transType.equals("06")) {
                            apply.setStationId(task.getSourceStaNo());
                        } else {
                            apply.setStationId(task.getStaNo());
                        }
                        if (RcsRetMethodEnum.APPLY_IN_STATION.getCode().equals(method)) {
                            mesService.applyInStation(apply);
                        } else if (RcsRetMethodEnum.APPLY_OFF_STATION.getCode().equals(method)) {
                            mesService.applyOutStation(apply);
                        } else if (RcsRetMethodEnum.ARRIVE_OFF_STATION.getCode().equals(method)) {
                            mesService.outStation(apply);
                        }
                    } break;
                    case ARRIVE_ON_STATION: {
                        EntityWrapper<TaskDetl> wapper2 = new EntityWrapper<>();
                        wapper2.eq("wrk_no", task.getWrkNo())
//                                .eq("matnr", memo.getString("Itemno"))
                                .eq("order_no", memo.getString("OrderNo"));
                        TaskDetl taskDetl = taskDetlService.selectOne(wapper2);
                        TransArrivalStation arrivalStation = new TransArrivalStation();
                        arrivalStation.setTaskno(robotTaskCode);
                        arrivalStation.setTaskname(memo.getString("taskName"));
                        arrivalStation.setTuoPanId(taskDetl == null || taskDetl.getZpallet() == null ? "" : taskDetl.getZpallet());
                        arrivalStation.setDaotype(memo.getString("TransType"));
                        arrivalStation.setProductLineId(memo.getString("ProductLineId"));
//                        arrivalStation.setStationId(task.getStaNo());
                        arrivalStation.setOrderNo(memo.getString("OrderNo"));
                        String transType = memo.getString("TransType");
                        String dJNo = memo.getString("djNo");
                        arrivalStation.setDJNo(dJNo);
                        if(transType.equals("02") || transType.equals("04") || transType.equals("06")) {
                            arrivalStation.setStationID(task.getSourceStaNo());
                        } else {
                            arrivalStation.setStationID(task.getStaNo());
                        }
                        String path;
                        if(transType.equals("05") || transType.equals("06")) {
                            path = "ToolArrivalNotice";
                        } else {
                            path = "AGVArrivalCompleted";
                        }
                        if(transType.equals("01") && arrivalStation.getStationID().contains("XL") || arrivalStation.getStationID().contains("TOOL")) {
                            path = "ToolArrivalNotice";
                        }
                        mesService.arriveOnStation(arrivalStation,path);
                    } break;
                    default: {} break;
                }
            } else if ("CTU".equals(carrierType)) { //CTU
                EntityWrapper<WrkMast> wrapper = new EntityWrapper<>();
                wrapper.eq("task_no", robotTaskCode);
                WrkMast task = wrkMastService.selectOne(wrapper);
                if (task == null || !task.getTaskNo().equals(robotTaskCode)) {
                    rcsReturn.setCode("Err_RobotCodeNotMatch");
                    rcsReturn.setMessage("");
                    JSONObject data = new JSONObject();
                    data.put("robotTaskCode", robotTaskCode);
                    rcsReturn.setData(data);
                    return rcsReturn;
                }
//                JSONObject memo = JSONObject.parseObject(task.getMemo());
 
                switch (Objects.requireNonNull(RcsRetMethodEnum.getEnum(method))) {
                    case TASK_START: {
//                        task.setWrkSts(302L);   // 301 任务下发、302 任务执行、303 任务中断、304 任务结束
//                        task.setModiTime(new Date());
//                        task.setModiUser(defaultUserId);
//                        taskService.updateById(task);
                    } break;
//                    case TASK_OUT_BIN: {} break;
                    case TASK_END: {
                        // 更新任务状态等内部逻辑
                        long wrkSts = task.getWrkSts(); // 1.入库;101.出库;
                        if (task.getIoType() == 1) {
                            wrkSts = 4L;
                        } else if (task.getIoType() == 101) {
                            wrkSts = 14L;
                        }
 
                        task.setWrkSts(wrkSts); // 4.入库完成;14.已出库未确认;
                        task.setModiTime(new Date());
                        task.setModiUser(defaultUserId);
                        wrkMastService.updateById(task);
 
                        // TODO:任务完成触发出入库变更操作
 
 
//                        // 入库完成
//                        mesService.inFeedback(memo.getString("OrderNo"));
//                        // 出库完成
//                        mesService.outFeedback(memo.getString("OrderNo"));
                    } break;
                    default: {} break;
                }
            }
 
            // 返回RCS
            rcsReturn.setCode("SUCCESS");
            rcsReturn.setMessage("");
            JSONObject data = new JSONObject();
            data.put("robotTaskCode", robotTaskCode);
            rcsReturn.setData(data);
        } catch (Exception e) {
            log.error("RCS反馈任务进度处理异常 - {}", rcsReporterTask, e);
            rcsReturn.setCode("Err_Internal");
            rcsReturn.setMessage("内部处理异常");
            JSONObject data = new JSONObject();
            data.put("robotTaskCode", robotTaskCode);
            rcsReturn.setData(data);
        }
 
        return rcsReturn;
    }
 
    /**
     * 2.2.4请求外设接口(请求封锁区)
     * 厂家:海量、华晓
     *
     * @param rcsReporterEqpt
     * @return
     */
    public RcsReturn reporterEqpt(RcsReporterEqpt rcsReporterEqpt){
 
        int success = 0;
        if ("APPLY_LOCK".equals(rcsReporterEqpt.getMethod())) { //申请
            success = applyBlock(rcsReporterEqpt);
        } else if ("RELEASE_EQPT".equals(rcsReporterEqpt.getMethod())) { //释放
            success = releaseBlock(rcsReporterEqpt);
        }
 
        // 返回RCS
        RcsReturn rcsReturn = new RcsReturn();
        rcsReturn.setCode(success > 0 ? "SUCCESS" : "Err_Internal");
        rcsReturn.setMessage(success > 0 ? "" : "内部错误");
        JSONObject data = new JSONObject();
        data.put("extra", null);
        rcsReturn.setData(data);
 
        return rcsReturn;
    }
 
    // endregion
 
 
    // region 海康CTU 刀具库
 
    // TODO: CTU上层组参引用,
 
    // 2.1.2任务下发接口
 
    // 2.1.3任务继续执行接口
 
    // 2.1.4任务取消接口
 
    // 2.2.1任务执行回馈
 
////    @Transactional(rollbackFor = Exception.class)
//    public void receiveTaskStatus(RcsReporterTask callbackParam, String method, String stockType, Long hostId) {
//
//        JSONObject values = callbackParam.getExtra().getJSONObject("values");
//        EntityWrapper<Task> wapper = new EntityWrapper<>();
//        wapper.eq("task_no", callbackParam.getRobotTaskCode());
//        Task task = taskService.selectOne(wapper);
//        if (task == null && !StringUtils.isEmpty(task.getWrkNo())) {
//            if (1 == task.getIoType()) {   // 入库
//                // 更新库存
//
//                // 更新任务状态
//            } else if (101 == task.getIoType()) {    // 出库
//                // 更新库存
//
//                // 更新任务状态
//
//                // 货物和托盘解绑
//            }
//        }
//    }
 
    // endregion
 
 
    // region 华晓RCS
 
    /**
     * 9.7申请进入生产线
     *
     * @param apply
     * @return
     */
    public JSONObject hxApplyInLine(TransParent apply) {
 
        String status = mesService.applyInLine(apply);
        JSONObject result = new JSONObject();
        result.put("Success", 1);
        result.put("Message", status);
        JSONObject data = new JSONObject();
        data.put("status", status);
        result.put("Data", data);
 
        return result;
    }
 
    // endregion
 
    // region httpUtil
 
    /**
     * 向指定 URL 发送POST方法的请求
     *
     * @param url 发送请求的 URL
     * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
     * @return 所代表远程资源的响应结果
     */
    public static String sendPost(String url, String param) {
        PrintWriter out = null;
        BufferedReader in = null;
        StringBuilder result = new StringBuilder();
        try
        {
            log.info("sendPost - {} - {}", url, param);
            URL realUrl = new URL(url);
            URLConnection conn = realUrl.openConnection();
            conn.setRequestProperty("accept", "*/*");
            conn.setRequestProperty("connection", "Keep-Alive");
            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
            conn.setRequestProperty("Accept-Charset", "utf-8");
            conn.setRequestProperty("Content-Type", "application/json;charset=utf-8");
            conn.setConnectTimeout(5000);
            conn.setReadTimeout(5000);
            conn.setDoOutput(true);
            conn.setDoInput(true);
            out = new PrintWriter(conn.getOutputStream());
            out.print(param);
            out.flush();
            in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
            String line;
            while ((line = in.readLine()) != null)
            {
                result.append(line);
            }
            log.info("recv - {}", result);
        }
        catch (ConnectException e)
        {
            log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
        }
        catch (SocketTimeoutException e)
        {
            log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
        }
        catch (IOException e)
        {
            log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
        }
        catch (Exception e)
        {
            log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
        }
        finally
        {
            try
            {
                if (out != null)
                {
                    out.close();
                }
                if (in != null)
                {
                    in.close();
                }
            }
            catch (IOException ex)
            {
                log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
            }
        }
        return result.toString();
    }
 
    // endregion
}