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