Commit cad8712bc671e8cb797245c39d2d58b1a7979f0d

Authored by ljq
2 parents 7c68baa1 b8e2698f

Merge branch 'lggj' of http://192.168.168.245:8888/panzhaov5/bsth_control into lggj

src/main/java/com/bsth/controller/realcontrol/ReportRegisterController.java
... ... @@ -10,6 +10,7 @@ import com.bsth.util.HttpClientUtils;
10 10 import org.slf4j.Logger;
11 11 import org.slf4j.LoggerFactory;
12 12 import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.beans.factory.annotation.Value;
13 14 import org.springframework.beans.propertyeditors.CustomDateEditor;
14 15 import org.springframework.web.bind.WebDataBinder;
15 16 import org.springframework.web.bind.annotation.InitBinder;
... ... @@ -36,9 +37,11 @@ public class ReportRegisterController extends BaseController<ReportRegister, Lon
36 37  
37 38 Logger log = LoggerFactory.getLogger(this.getClass());
38 39  
39   - final static String url = "http://61.171.28.220:8018/complaint/TsReport/input.do";
  40 +// final static String url = "http://61.171.28.220:8018/complaint/TsReport/input.do";
40 41 // final static String url = "http://114.80.178.13/complaint/TsReport/input.do";
41 42 // final static String url = "http://192.168.168.228:8080/complaint/TsReport/input.do";
  43 + @Value("${report_register.complaint.url}")
  44 + private String url;
42 45  
43 46 @Autowired
44 47 ReportRegisterService reportRegisterService;
... ... @@ -69,7 +72,7 @@ public class ReportRegisterController extends BaseController<ReportRegister, Lon
69 72 // map = baseService.delete(id);
70 73 reportRegisterService.deleteInfo(t);
71 74 String data = "{ID:'"+t.getID()+"', STATUS:'2'}";
72   - StringBuilder sb = HttpClientUtils.post(url,data);
  75 + StringBuilder sb = HttpClientUtils.post(url, data);
73 76 JSONObject obj = JSON.parseObject(sb.toString());
74 77 map.put("status2", obj);
75 78 } catch (Exception e) {
... ... @@ -86,7 +89,7 @@ public class ReportRegisterController extends BaseController<ReportRegister, Lon
86 89 reportRegisterService.save(t);
87 90 map.put("status", ResponseCode.SUCCESS);
88 91 map.put("t", t);
89   - StringBuilder sb = HttpClientUtils.post(url,t.toString());
  92 + StringBuilder sb = HttpClientUtils.post(url, t.toString());
90 93 JSONObject obj = JSON.parseObject(sb.toString());
91 94 map.put("status2", obj);
92 95 } catch (Exception e) {
... ...
src/main/java/com/bsth/util/ReportRegisterHTTPUtil.java
... ... @@ -24,7 +24,8 @@ public class ReportRegisterHTTPUtil extends HttpServlet {
24 24 //创建默认连接
25 25 CloseableHttpClient httpClient = HttpClients.createDefault();
26 26 //创建HttpGet对象,处理get请求,转发到A站点
27   - HttpPost httpPost = new HttpPost("http://114.80.178.13/complaint/TsReport/input.do");
  27 +// HttpPost httpPost = new HttpPost("http://114.80.178.13/complaint/TsReport/input.do");
  28 + HttpPost httpPost = new HttpPost("http://10.10.200.113:8060/complaint/TsReport/input.do");
28 29 //执行
29 30 CloseableHttpResponse response = httpClient.execute(httpPost);
30 31 int code = response.getStatusLine().getStatusCode();
... ...
src/main/resources/application-prod.properties
... ... @@ -44,3 +44,5 @@ baidu.ak=AYiBOs3f9qBQFhdKFsaboX6CfObmKwRP
44 44 passengerFlow.url = http://192.168.168.32:9999/images/
45 45  
46 46 electricity.importFile.path= /home/control/elecImportFile
  47 +
  48 +report_register.complaint.url= http://10.10.200.113:8060/complaint/TsReport/input.do
... ...
src/main/resources/application-test.properties
... ... @@ -44,3 +44,5 @@ baidu.ak=AYiBOs3f9qBQFhdKFsaboX6CfObmKwRP
44 44 passengerFlow.url = http://127.0.0.1:9999/images/
45 45  
46 46 electricity.importFile.path= E:/elecImportFile
  47 +
  48 +report_register.complaint.url= http://192.168.168.172:8080/complaint/TsReport/input.do
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/report_register/add.html
... ... @@ -568,7 +568,9 @@
568 568  
569 569 //校验
570 570 formActive.formValidation({framework: 'uikit', locale: 'zh_CN'});
571   - //提交
  571 + //解绑事件(防止重复绑定同一事件提交多份数据)
  572 + formActive.off('success.form.fv');
  573 + //提交事件
572 574 formActive.on('success.form.fv', function (e) {
573 575 e.preventDefault();
574 576 // disabled_submit_btn(formActive);
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/report_register/update.html
... ... @@ -578,8 +578,13 @@
578 578  
579 579 //校验
580 580 formActive.formValidation({framework: 'uikit', locale: 'zh_CN'});
581   - //提交
582   - formActive.on('success.form.fv', function (e) {
  581 + //解绑事件(防止重复绑定同一事件提交多份数据)
  582 + formActive.off('success.form.fv');
  583 + formActive.off('success');
  584 + formActive.off('click');
  585 + formActive.off('err');
  586 + //提交事件(one:只触发一次后自动解绑)
  587 + formActive.one('success.form.fv', function (e) {
583 588 e.preventDefault();
584 589 var headData = $('#add_head_table').serializeJSON();
585 590 var bodyData = $(formActive).serializeJSON();
... ... @@ -600,6 +605,8 @@
600 605 notify_err('修改失败!');
601 606 });
602 607 });
  608 +// var events = $._data($('#'+tableActiveStr)[0], "events");
  609 +// console.log(events);
603 610 }
604 611  
605 612 //submit
... ...