diff --git a/src/main/java/com/cm/inspection/controller/app/resources/enterpriseofgridoperator/enterpriseofgridoperatorCountController.java b/src/main/java/com/cm/inspection/controller/app/resources/enterpriseofgridoperator/enterpriseofgridoperatorCountController.java new file mode 100644 index 0000000..b099339 --- /dev/null +++ b/src/main/java/com/cm/inspection/controller/app/resources/enterpriseofgridoperator/enterpriseofgridoperatorCountController.java @@ -0,0 +1,101 @@ +package com.cm.inspection.controller.app.resources.enterpriseofgridoperator; + + +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.exception.SearchException; +import com.cm.common.plugin.oauth.service.group.IGroupService; +import com.cm.common.plugin.pojo.bos.UserResourceBO; +import com.cm.common.pojo.ListPage; +import com.cm.common.pojo.bos.GroupBO; +import com.cm.common.result.ErrorResult; +import com.cm.common.result.SuccessResultList; +import com.cm.inspection.controller.app.resources.BigDataResult; +import com.cm.inspection.pojo.dtos.gridpersonnel.GridPersonnelDTO; +import com.cm.inspection.service.enterpriseofgridoperator.IEnterpriseOfGridOperatorService; +import com.cm.inspection.service.gridpersonnel.IGridPersonnelService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "网格员关联企业统计接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/enterpriseofgridoperator/"+ISystemConstant.APP_RELEASE_SUFFIX) +public class enterpriseofgridoperatorCountController extends AbstractController { + + + + @Autowired + private IGroupService groupService; + @Autowired + private IEnterpriseOfGridOperatorService ieoService; + @Autowired + private IGridPersonnelService gridPersonnelService; + + + + @ApiOperation(value = "按人员分组统计监管企业数量", notes = "按人员分组统计监管企业数量接口") + @GetMapping("count-groupuser-enterpriseo") + public BigDataResult countGroupUserEnterpriseo(){ + BigDataResult result= new BigDataResult(); + List list = new ArrayList<>(); + List groupBOList = groupService.list("0"); + for (int i = 0; i < groupBOList.size(); i++) { + Integer count = 0; + List userResourceBOS = groupService.listUser(groupBOList.get(i).getGroupId()); + List userList = new ArrayList<>(); + for (UserResourceBO userResourceBO : userResourceBOS) { + userList.add(userResourceBO.getUserId()); + } + if(userList.size() > 0){ + Map params = new HashMap<>(); + params.put("userIds",userList); + count = ieoService.countGroupUser(params); + } + + String[] arr = new String[4]; + arr[0] = i+1+""; + arr[1] = groupBOList.get(i).getGroupName(); + arr[2] = userList.size()+""; + arr[3] = count+""; + list.add(arr); + } + result.setList(list); + return result; + + } + + + + @ApiOperation(value = "网格人员分页列表", notes = "网格人员分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "area1", value = "1级地区", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "area2", value = "2级地区", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "area3", value = "3级地区", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "area4", value = "4级地区", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "area5", value = "5级地区", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(ListPage page) throws SearchException, UnsupportedEncodingException { + Map params = requestParams(); + page.setParams(params); + return gridPersonnelService.listPage(page); + } + + + + + +} diff --git a/src/main/java/com/cm/inspection/dao/enterpriseofgridoperator/IEnterpriseOfGridOperatorDao.java b/src/main/java/com/cm/inspection/dao/enterpriseofgridoperator/IEnterpriseOfGridOperatorDao.java index 018a103..07dc62d 100644 --- a/src/main/java/com/cm/inspection/dao/enterpriseofgridoperator/IEnterpriseOfGridOperatorDao.java +++ b/src/main/java/com/cm/inspection/dao/enterpriseofgridoperator/IEnterpriseOfGridOperatorDao.java @@ -144,6 +144,7 @@ public interface IEnterpriseOfGridOperatorDao { */ Integer countEnterpriseOfGridOperatorSimple(Map params) throws SearchException; + /** * 企业网格员列表(简单格式) * @@ -161,4 +162,13 @@ public interface IEnterpriseOfGridOperatorDao { * @throws SearchException */ List listEnterpriseId(Map params) throws SearchException; + + + /** + * 统计用户组认领企业数据 + * @param params + * @return + * @throws SearchException + */ + Integer countGroupUser(Map params) throws SearchException; } diff --git a/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/IEnterpriseOfGridOperatorService.java b/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/IEnterpriseOfGridOperatorService.java index f59b070..c65fc72 100644 --- a/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/IEnterpriseOfGridOperatorService.java +++ b/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/IEnterpriseOfGridOperatorService.java @@ -23,6 +23,8 @@ import java.util.Map; **/ public interface IEnterpriseOfGridOperatorService { + Integer countGroupUser(Map params); + /** * 新增网格员的企业 * diff --git a/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/impl/EnterpriseOfGridOperatorServiceImpl.java b/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/impl/EnterpriseOfGridOperatorServiceImpl.java index 1829d60..6045c2a 100644 --- a/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/impl/EnterpriseOfGridOperatorServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/impl/EnterpriseOfGridOperatorServiceImpl.java @@ -350,4 +350,10 @@ public class EnterpriseOfGridOperatorServiceImpl extends BaseService implements }); } + + + public Integer countGroupUser(Map params){ + return enterpriseOfGridOperatorDao.countGroupUser(params); + } + } diff --git a/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml b/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml index bb1361e..768c5a2 100644 --- a/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml +++ b/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml @@ -623,4 +623,21 @@ enterprise_id + + + \ No newline at end of file diff --git a/src/main/resources/static/route/dischargepermit/list-dischargepermit.html b/src/main/resources/static/route/dischargepermit/list-dischargepermit.html index 2f65382..498c2da 100644 --- a/src/main/resources/static/route/dischargepermit/list-dischargepermit.html +++ b/src/main/resources/static/route/dischargepermit/list-dischargepermit.html @@ -65,7 +65,8 @@ var laydate = layui.laydate; var common = layui.common; var resizeTimeout = null; - var tableUrl = 'api/dischargepermit/listpagedischargepermit?enterpriseId={enterpriseId}'; + var basePath = "/inspection/" + var tableUrl = '{path}api/dischargepermit/listpagedischargepermit?enterpriseId={enterpriseId}'; var enterpriseId = top.restAjax.params(window.location.href).enterpriseId; // 初始化表格 @@ -73,7 +74,7 @@ table.render({ elem: '#dataTable', id: 'dataTable', - url: top.restAjax.path(tableUrl, [enterpriseId]), + url: top.restAjax.path(tableUrl, [basePath,enterpriseId]), width: admin.screen() > 1 ? '100%' : '', height: $win.height() - 60, limit: 20, @@ -116,7 +117,7 @@ if(downloadFile.length > 0) { downloadFile += ' | '; } - downloadFile += '点击下载' + downloadFile += '点击下载' } return downloadFile; } @@ -136,7 +137,7 @@ // 重载表格 function reloadTable(currentPage) { table.reload('dataTable', { - url: top.restAjax.path(tableUrl, [enterpriseId]), + url: top.restAjax.path(tableUrl, [basePath,enterpriseId]), where: { keywords: $('#keywords').val(), startTime: $('#startTime').val(), @@ -169,7 +170,7 @@ yes: function (index) { top.dialog.close(index); var layIndex; - top.restAjax.delete(top.restAjax.path('api/dischargepermit/removedischargepermit/{ids}', [ids]), {}, null, function (code, data) { + top.restAjax.delete(top.restAjax.path('{path}api/dischargepermit/removedischargepermit/{ids}', [basePath,ids]), {}, null, function (code, data) { top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000}); reloadTable(); }, function (code, data) { @@ -208,7 +209,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/dischargepermit/save-dischargepermit.html?enterpriseId={enterpriseId}', [enterpriseId]), + content: top.restAjax.path('{path}route/dischargepermit/save-dischargepermit.html?enterpriseId={enterpriseId}', [basePath,enterpriseId]), end: function() { reloadTable(); } @@ -226,7 +227,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/dischargepermit/update-dischargepermit.html?dischargePermitId={dischargePermitId}', [checkDatas[0].dischargePermitId]), + content: top.restAjax.path('{path}route/dischargepermit/update-dischargepermit.html?dischargePermitId={dischargePermitId}', [basePath,checkDatas[0].dischargePermitId]), end: function() { reloadTable(); } diff --git a/src/main/resources/static/route/dischargepermit/save-dischargepermit.html b/src/main/resources/static/route/dischargepermit/save-dischargepermit.html index e79843e..2f1c1ad 100644 --- a/src/main/resources/static/route/dischargepermit/save-dischargepermit.html +++ b/src/main/resources/static/route/dischargepermit/save-dischargepermit.html @@ -122,6 +122,8 @@ var wangEditorObj = {}; var viewerObj = {}; + var basePath = "/inspection/" + function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); } @@ -256,7 +258,7 @@ // 初始化内容 function initData() { - top.restAjax.get(top.restAjax.path('api/dischargepermit/getcurrentuseridinfo', []), {}, null, function(code, data) { + top.restAjax.get(top.restAjax.path('{path}api/dischargepermit/getcurrentuseridinfo', [basePath]), {}, null, function(code, data) { initContentRichText(); initRemindTimeDateTime(); initFilesUploadFile(); @@ -276,7 +278,7 @@ top.dialog.close(index); var loadLayerIndex; formData.field['content'] = wangEditorObj['content'].txt.html(); - top.restAjax.post(top.restAjax.path('api/dischargepermit/savedischargepermit/{enterpriseId}', [enterpriseId]), formData.field, null, function(code, data) { + top.restAjax.post(top.restAjax.path('{path}api/dischargepermit/savedischargepermit/{enterpriseId}', [basePath,enterpriseId]), formData.field, null, function(code, data) { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { time: 0, btn: [top.dataMessage.button.yes, top.dataMessage.button.no], diff --git a/src/main/resources/static/route/dischargepermit/update-dischargepermit.html b/src/main/resources/static/route/dischargepermit/update-dischargepermit.html index 7d10585..657d272 100644 --- a/src/main/resources/static/route/dischargepermit/update-dischargepermit.html +++ b/src/main/resources/static/route/dischargepermit/update-dischargepermit.html @@ -123,6 +123,8 @@ var wangEditorObj = {}; var viewerObj = {}; + var basePath = "/inspection/" + function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); } @@ -259,7 +261,7 @@ // 初始化内容 function initData() { var loadLayerIndex; - top.restAjax.get(top.restAjax.path('api/dischargepermit/getdischargepermitbyid/{dischargePermitId}', [dischargePermitId]), {}, null, function(code, data) { + top.restAjax.get(top.restAjax.path('{path}api/dischargepermit/getdischargepermitbyid/{dischargePermitId}', [basePath,dischargePermitId]), {}, null, function(code, data) { var dataFormData = {}; for(var i in data) { dataFormData[i] = data[i] +''; @@ -285,7 +287,7 @@ top.dialog.close(index); var loadLayerIndex; formData.field['content'] = wangEditorObj['content'].txt.html(); - top.restAjax.put(top.restAjax.path('api/dischargepermit/updatedischargepermit/{dischargePermitId}', [dischargePermitId]), formData.field, null, function(code, data) { + top.restAjax.put(top.restAjax.path('{path}api/dischargepermit/updatedischargepermit/{dischargePermitId}', [basePath,dischargePermitId]), formData.field, null, function(code, data) { var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, { time: 0, btn: [top.dataMessage.button.yes, top.dataMessage.button.no], diff --git a/src/main/resources/static/route/eiareport/list-eiareport.html b/src/main/resources/static/route/eiareport/list-eiareport.html index 0950197..7b577c2 100644 --- a/src/main/resources/static/route/eiareport/list-eiareport.html +++ b/src/main/resources/static/route/eiareport/list-eiareport.html @@ -65,7 +65,9 @@ var laydate = layui.laydate; var common = layui.common; var resizeTimeout = null; - var tableUrl = 'api/eiareport/listpageeiareport?enterpriseId={enterpriseId}'; + var basePath = "/inspection/" + + var tableUrl = '{path}api/eiareport/listpageeiareport?enterpriseId={enterpriseId}'; var enterpriseId = top.restAjax.params(window.location.href).enterpriseId; // 初始化表格 @@ -73,7 +75,7 @@ table.render({ elem: '#dataTable', id: 'dataTable', - url: top.restAjax.path(tableUrl, [enterpriseId]), + url: top.restAjax.path(tableUrl, [basePath,enterpriseId]), width: admin.screen() > 1 ? '100%' : '', height: $win.height() - 60, limit: 20, @@ -116,7 +118,7 @@ if(downloadFile.length > 0) { downloadFile += ' | '; } - downloadFile += '点击下载' + downloadFile += '点击下载' } return downloadFile; } @@ -136,7 +138,7 @@ // 重载表格 function reloadTable(currentPage) { table.reload('dataTable', { - url: top.restAjax.path(tableUrl, [enterpriseId]), + url: top.restAjax.path(tableUrl, [basePath,enterpriseId]), where: { keywords: $('#keywords').val(), startTime: $('#startTime').val(), @@ -169,7 +171,7 @@ yes: function (index) { top.dialog.close(index); var layIndex; - top.restAjax.delete(top.restAjax.path('api/eiareport/removeeiareport/{ids}', [ids]), {}, null, function (code, data) { + top.restAjax.delete(top.restAjax.path('{path}api/eiareport/removeeiareport/{ids}', [basePath,ids]), {}, null, function (code, data) { top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000}); reloadTable(); }, function (code, data) { @@ -208,7 +210,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/eiareport/save-eiareport.html?enterpriseId={enterpriseId}', [enterpriseId]), + content: top.restAjax.path('{path}route/eiareport/save-eiareport.html?enterpriseId={enterpriseId}', [basePath,enterpriseId]), end: function() { reloadTable(); } @@ -226,7 +228,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/eiareport/update-eiareport.html?eiaReportId={eiaReportId}', [checkDatas[0].eiaReportId]), + content: top.restAjax.path('{path}route/eiareport/update-eiareport.html?eiaReportId={eiaReportId}', [basePath,checkDatas[0].eiaReportId]), end: function() { reloadTable(); } diff --git a/src/main/resources/static/route/eiareport/save-eiareport.html b/src/main/resources/static/route/eiareport/save-eiareport.html index c7f61b9..9f9fe3e 100644 --- a/src/main/resources/static/route/eiareport/save-eiareport.html +++ b/src/main/resources/static/route/eiareport/save-eiareport.html @@ -121,6 +121,7 @@ var wangEditor = window.wangEditor; var wangEditorObj = {}; var viewerObj = {}; + var basePath = "/inspection/" function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); @@ -256,7 +257,7 @@ // 初始化内容 function initData() { - top.restAjax.get(top.restAjax.path('api/eiareport/getcurrentuseridinfo', []), {}, null, function(code, data) { + top.restAjax.get(top.restAjax.path('{path}api/eiareport/getcurrentuseridinfo', [basePath]), {}, null, function(code, data) { initContentRichText(); initRemindTimeDateTime(); initFilesUploadFile(); @@ -276,7 +277,7 @@ top.dialog.close(index); var loadLayerIndex; formData.field['content'] = wangEditorObj['content'].txt.html(); - top.restAjax.post(top.restAjax.path('api/eiareport/saveeiareport/{enterpriseId}', [enterpriseId]), formData.field, null, function(code, data) { + top.restAjax.post(top.restAjax.path('{path}api/eiareport/saveeiareport/{enterpriseId}', [basePath,enterpriseId]), formData.field, null, function(code, data) { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { time: 0, btn: [top.dataMessage.button.yes, top.dataMessage.button.no], diff --git a/src/main/resources/static/route/eiareport/update-eiareport.html b/src/main/resources/static/route/eiareport/update-eiareport.html index b9a7edb..870eb1a 100644 --- a/src/main/resources/static/route/eiareport/update-eiareport.html +++ b/src/main/resources/static/route/eiareport/update-eiareport.html @@ -123,6 +123,8 @@ var wangEditorObj = {}; var viewerObj = {}; + var basePath = "/inspection/" + function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); } @@ -259,7 +261,7 @@ // 初始化内容 function initData() { var loadLayerIndex; - top.restAjax.get(top.restAjax.path('api/eiareport/geteiareportbyid/{eiaReportId}', [eiaReportId]), {}, null, function(code, data) { + top.restAjax.get(top.restAjax.path('{path}api/eiareport/geteiareportbyid/{eiaReportId}', [basePath,eiaReportId]), {}, null, function(code, data) { var dataFormData = {}; for(var i in data) { dataFormData[i] = data[i] +''; @@ -285,7 +287,7 @@ top.dialog.close(index); var loadLayerIndex; formData.field['content'] = wangEditorObj['content'].txt.html(); - top.restAjax.put(top.restAjax.path('api/eiareport/updateeiareport/{eiaReportId}', [eiaReportId]), formData.field, null, function(code, data) { + top.restAjax.put(top.restAjax.path('{path}api/eiareport/updateeiareport/{eiaReportId}', [basePath,eiaReportId]), formData.field, null, function(code, data) { var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, { time: 0, btn: [top.dataMessage.button.yes, top.dataMessage.button.no], diff --git a/src/main/resources/static/route/enterprise/list-enterprise.html b/src/main/resources/static/route/enterprise/list-enterprise.html index 4584a59..d601774 100644 --- a/src/main/resources/static/route/enterprise/list-enterprise.html +++ b/src/main/resources/static/route/enterprise/list-enterprise.html @@ -108,6 +108,7 @@ var resizeTimeout = null; var tableUrl = 'api/enterprise/listpageenterprise'; + // 初始化选择框、单选、复选模板 function initSelectRadioCheckboxTemplate(templateId, templateBoxId, data, callback) { laytpl(document.getElementById(templateId).innerHTML).render(data, function(html) { diff --git a/src/main/resources/static/route/enterprise/v2/update-enterprise-pollution.html b/src/main/resources/static/route/enterprise/v2/update-enterprise-pollution.html index f4e63af..e4e4252 100644 --- a/src/main/resources/static/route/enterprise/v2/update-enterprise-pollution.html +++ b/src/main/resources/static/route/enterprise/v2/update-enterprise-pollution.html @@ -192,6 +192,8 @@ var laydate = layui.laydate; var enterpriseId = top.restAjax.params(window.location.href).enterpriseId; + var baseUrl = "/inspection/" + var viewerObj = {}; var imageTextArray = [{ fileId: '', @@ -453,7 +455,7 @@ // 初始化污染因子 function initPollutionFactorTemplate(callback) { - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/48b6829b-24b8-4c42-a21d-fe98dbe23fd5', []), {}, null, function(code, data) { + top.restAjax.get(top.restAjax.path('{path}api/datadictionary/listdictionarybyparentid/48b6829b-24b8-4c42-a21d-fe98dbe23fd5', [baseUrl]), {}, null, function(code, data) { laytpl(document.getElementById('pollutionFactorTemplate').innerHTML).render(data, function(html) { document.getElementById('pollutionFactorTemplateBox').innerHTML = html; }); @@ -469,7 +471,7 @@ // 初始化内容 function initData() { var loadLayerIndex; - top.restAjax.get(top.restAjax.path('api/enterprise/getenterprisepollutionbyenterpriseid/{enterpriseId}', [enterpriseId]), {}, null, function(code, data) { + top.restAjax.get(top.restAjax.path('{path}api/enterprise/getenterprisepollutionbyenterpriseid/{enterpriseId}', [baseUrl,enterpriseId]), {}, null, function(code, data) { initPollutionFactorTemplate(function() { var pollutionFactorArray = data.pollutionFactor.split(','); @@ -508,7 +510,7 @@ top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; - top.restAjax.put(top.restAjax.path('api/enterprise/updateenterprisepollution/{enterpriseId}', [enterpriseId]), formData.field, null, function(code, data) { + top.restAjax.put(top.restAjax.path('{path}api/enterprise/updateenterprisepollution/{enterpriseId}', [baseUrl,enterpriseId]), formData.field, null, function(code, data) { var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, { time: 0, btn: [top.dataMessage.button.yes, top.dataMessage.button.no], diff --git a/src/main/resources/static/route/enterpriseofgridoperator/list-enterpriseofgridoperator.html b/src/main/resources/static/route/enterpriseofgridoperator/list-enterpriseofgridoperator.html index bd38c70..b3cd71d 100644 --- a/src/main/resources/static/route/enterpriseofgridoperator/list-enterpriseofgridoperator.html +++ b/src/main/resources/static/route/enterpriseofgridoperator/list-enterpriseofgridoperator.html @@ -92,7 +92,8 @@ var laytpl = layui.laytpl; var resizeTimeout = null; var userId = top.restAjax.params(window.location.href).userId; - var tableUrl = 'api/enterpriseofgridoperator/listpageenterpriseofgridoperatorbyuserid/'+ userId; + var basePath = "/inspection/"; + var tableUrl = basePath+'api/enterpriseofgridoperator/listpageenterpriseofgridoperatorbyuserid/'+ userId; // 初始化选择框、单选、复选模板 function initSelectRadioCheckboxTemplate(templateId, templateBoxId, data, callback) { @@ -104,7 +105,7 @@ // 初始化1级区域下拉选择 function initArea1Select() { - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/81583ade-5466-49aa-b7b6-c643c131ea34', []), {}, null, function(code, data, args) { + top.restAjax.get(top.restAjax.path('{basePath}api/datadictionary/listdictionarybyparentid/81583ade-5466-49aa-b7b6-c643c131ea34', [basePath]), {}, null, function(code, data, args) { initSelectRadioCheckboxTemplate('area1SelectTemplate', 'area1SelectTemplateBox', data); }, function(code, data) { top.dialog.msg(data.msg); @@ -117,7 +118,7 @@ initSelectRadioCheckboxTemplate('area2SelectTemplate', 'area2SelectTemplateBox', []); return; } - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area1}', [area1]), {}, null, function(code, data, args) { + top.restAjax.get(top.restAjax.path('{basePath}api/datadictionary/listdictionarybyparentid/{area1}', [basePath,area1]), {}, null, function(code, data, args) { initSelectRadioCheckboxTemplate('area2SelectTemplate', 'area2SelectTemplateBox', data); }, function(code, data) { top.dialog.msg(data.msg); @@ -131,7 +132,7 @@ initSelectRadioCheckboxTemplate('area3SelectTemplate', 'area3SelectTemplateBox', []); return; } - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area2}', [area2]), {}, null, function(code, data, args) { + top.restAjax.get(top.restAjax.path('{basePath}api/datadictionary/listdictionarybyparentid/{area2}', [basePath,area2]), {}, null, function(code, data, args) { initSelectRadioCheckboxTemplate('area3SelectTemplate', 'area3SelectTemplateBox', data); }, function(code, data) { top.dialog.msg(data.msg); @@ -144,7 +145,7 @@ initSelectRadioCheckboxTemplate('area4SelectTemplate', 'area4SelectTemplateBox', []); return; } - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area3}', [area3]), {}, null, function(code, data, args) { + top.restAjax.get(top.restAjax.path('{basePath}api/datadictionary/listdictionarybyparentid/{area3}', [basePath,area3]), {}, null, function(code, data, args) { initSelectRadioCheckboxTemplate('area4SelectTemplate', 'area4SelectTemplateBox', data); }, function(code, data) { top.dialog.msg(data.msg); @@ -158,7 +159,7 @@ initSelectRadioCheckboxTemplate('area5SelectTemplate', 'area5SelectTemplateBox', []); return; } - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area4}', [area4]), {}, null, function(code, data, args) { + top.restAjax.get(top.restAjax.path('{basePath}api/datadictionary/listdictionarybyparentid/{area4}', [basePath,area4]), {}, null, function(code, data, args) { initSelectRadioCheckboxTemplate('area5SelectTemplate', 'area5SelectTemplateBox', data); }, function(code, data) { top.dialog.msg(data.msg); @@ -378,7 +379,7 @@ var layEvent = obj.event; var data = obj.data; if(layEvent === 'claimEvent') { - top.restAjax.post(top.restAjax.path('api/enterpriseofgridoperator/saveenterpriseofgridoperator', []), { + top.restAjax.post(top.restAjax.path('{basePath}api/enterpriseofgridoperator/saveenterpriseofgridoperator', [basePath]), { userId: userId, enterpriseId: data.enterpriseId }, null, function(code, data) { @@ -388,7 +389,7 @@ top.dialog.msg(data.msg); }); } else if(layEvent === 'relieveEvent') { - top.restAjax.delete(top.restAjax.path('api/enterpriseofgridoperator/deleteenterpriseofgridoperator/{enterpriseId}/{userId}', [data.enterpriseId, userId]), {}, null, function (code, data) { + top.restAjax.delete(top.restAjax.path('{basePath}api/enterpriseofgridoperator/deleteenterpriseofgridoperator/{enterpriseId}/{userId}', [basePath,data.enterpriseId, userId]), {}, null, function (code, data) { top.dialog.msg('解除成功', {time: 1000}); reloadTable(); }, function (code, data) { diff --git a/src/main/resources/static/route/gridpersonnel/get-enterprise-location.html b/src/main/resources/static/route/gridpersonnel/get-enterprise-location.html index b435981..8f91b4f 100644 --- a/src/main/resources/static/route/gridpersonnel/get-enterprise-location.html +++ b/src/main/resources/static/route/gridpersonnel/get-enterprise-location.html @@ -26,6 +26,7 @@ }).use(['index', 'form', 'laydate', 'laytpl'], function(){ var $ = layui.$; var $win = $(window); + var basePath = "/inspection/" $('#mapContainer').css('height', ($win.height() - 32) +'px'); var userId = top.restAjax.params(window.location.href).userId; @@ -116,7 +117,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/enterprise/get-enterprise.html?enterpriseId={enterpriseId}', [self.enterpriseId]), + content: top.restAjax.path('{basePath}route/enterprise/get-enterprise.html?enterpriseId={enterpriseId}', [basePath,self.enterpriseId]), end: function() {} }); }); @@ -162,7 +163,7 @@ } // 获取全部企业 - top.restAjax.get(top.restAjax.path('api/enterprise/listenterprisebyuserid/{userId}', [userId]), {}, null, function(code, data, args) { + top.restAjax.get(top.restAjax.path('{basePath}api/enterprise/listenterprisebyuserid/{userId}', [basePath,userId]), {}, null, function(code, data, args) { var pointArray = []; for(var i = 0, item; item = data[i++];) { if((item.enterpriseLng && item.enterpriseLat) && (item.enterpriseLng > 0 && item.enterpriseLat > 0)) { diff --git a/src/main/resources/static/route/taskcheck/v2/list-task-checkitem-report.html b/src/main/resources/static/route/taskcheck/v2/list-task-checkitem-report.html index 27d123f..a80166d 100644 --- a/src/main/resources/static/route/taskcheck/v2/list-task-checkitem-report.html +++ b/src/main/resources/static/route/taskcheck/v2/list-task-checkitem-report.html @@ -38,7 +38,9 @@ var resizeTimeout = null; var taskEnterpriseId = top.restAjax.params(window.location.href).taskEnterpriseId; var checkItemListType = top.restAjax.params(window.location.href).checkItemListType; - var tableUrl = 'api/taskcheck/v2/listtaskcheckreport/{checkItemListType}/{taskEnterpriseId}'; + var baseHref = '/inspection/'; + + var tableUrl = baseHref+'api/taskcheck/v2/listtaskcheckreport/{checkItemListType}/{taskEnterpriseId}'; var treeTableObj; function closeBox() { diff --git a/src/main/resources/static/route/taskcheck/v2/list-task-checkitem.html b/src/main/resources/static/route/taskcheck/v2/list-task-checkitem.html index f42ecb6..0e724c8 100644 --- a/src/main/resources/static/route/taskcheck/v2/list-task-checkitem.html +++ b/src/main/resources/static/route/taskcheck/v2/list-task-checkitem.html @@ -38,7 +38,7 @@ var resizeTimeout = null; var taskEnterpriseId = top.restAjax.params(window.location.href).taskEnterpriseId; var checkItemListType = top.restAjax.params(window.location.href).checkItemListType; - var tableUrl = 'api/taskcheck/v2/listcheckitem/{checkItemListType}/{taskEnterpriseId}'; + var tableUrl = '/inspection/api/taskcheck/v2/listcheckitem/{checkItemListType}/{taskEnterpriseId}'; var treeTableObj; function closeBox() { diff --git a/src/main/resources/static/route/taskcheck/v2/list-task-enterprise.html b/src/main/resources/static/route/taskcheck/v2/list-task-enterprise.html index a496e85..af3b1ed 100644 --- a/src/main/resources/static/route/taskcheck/v2/list-task-enterprise.html +++ b/src/main/resources/static/route/taskcheck/v2/list-task-enterprise.html @@ -41,6 +41,7 @@ var taskId = top.restAjax.params(window.location.href).taskId; var checkItemListType = top.restAjax.params(window.location.href).checkItemListType; var tableUrl = 'api/taskcheck/v2/listpagetaskenterprise/{taskId}'; + var baseHref = '/inspection/'; // 初始化表格 function initTable() { @@ -176,7 +177,7 @@ var event = obj.event; if(event === 'contactOptionEvent') { top.dialog.open({ - url: top.restAjax.path('route/taskcheck/v2/list-task-checkitem-tab.html?taskEnterpriseId={taskEnterpriseId}&checkItemListType={checkItemListType}', [data.taskEnterpriseId, 1]), + url: top.restAjax.path('{baseHref}route/taskcheck/v2/list-task-checkitem-tab.html?taskEnterpriseId={taskEnterpriseId}&checkItemListType={checkItemListType}', [baseHref,data.taskEnterpriseId, 1]), title: false, width: '840px', height: '80%', @@ -184,7 +185,7 @@ }); } else if(event === 'customOptionEvent') { top.dialog.open({ - url: top.restAjax.path('route/taskcheck/v2/list-task-checkitem-tab.html?taskEnterpriseId={taskEnterpriseId}&checkItemListType={checkItemListType}', [data.taskEnterpriseId, 2]), + url: top.restAjax.path('{baseHref}route/taskcheck/v2/list-task-checkitem-tab.html?taskEnterpriseId={taskEnterpriseId}&checkItemListType={checkItemListType}', [baseHref,data.taskEnterpriseId, 2]), title: false, width: '840px', height: '80%', diff --git a/src/main/resources/static/route/taskcheck/v2/list-taskcheck.html b/src/main/resources/static/route/taskcheck/v2/list-taskcheck.html index 53e7950..59115fb 100644 --- a/src/main/resources/static/route/taskcheck/v2/list-taskcheck.html +++ b/src/main/resources/static/route/taskcheck/v2/list-taskcheck.html @@ -62,6 +62,7 @@ var common = layui.common; var resizeTimeout = null; var tableUrl = 'api/taskcheck/v2/listpagetask'; + var baseHref = '/inspection/'; // 初始化表格 function initTable() { @@ -368,7 +369,7 @@ }); } else if(event === 'taskEnterpriseEvent') { top.dialog.open({ - url: top.restAjax.path('route/taskcheck/v2/list-task-enterprise.html?taskId={taskId}&checkItemListType={checkItemListType}', [data.taskId, data.checkItemListType]), + url: top.restAjax.path('{baseHref}route/taskcheck/v2/list-task-enterprise.html?taskId={taskId}&checkItemListType={checkItemListType}', [baseHref,data.taskId, data.checkItemListType]), title: '检查企业列表', width: '70%', height: '80%', diff --git a/src/main/resources/static/route/taskcheck/v2/save-taskcheck.html b/src/main/resources/static/route/taskcheck/v2/save-taskcheck.html index 367a2c9..c2679ce 100644 --- a/src/main/resources/static/route/taskcheck/v2/save-taskcheck.html +++ b/src/main/resources/static/route/taskcheck/v2/save-taskcheck.html @@ -209,6 +209,7 @@ var laydate = layui.laydate; var pollutionFactorArray = []; var tableSelect = layui.tableSelect; + var baseHref = '/inspection'; // 检查项列表类型 var checkItemListType = '1'; // 任务类型 @@ -481,7 +482,7 @@ // 初始化1级区域下拉选择 function initArea1Select() { - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/81583ade-5466-49aa-b7b6-c643c131ea34', []), {}, null, function(code, data, args) { + top.restAjax.get(top.restAjax.path('{baseHref}/api/datadictionary/listdictionarybyparentid/81583ade-5466-49aa-b7b6-c643c131ea34', [baseHref]), {}, null, function(code, data, args) { initSelectRadioCheckboxTemplate('area1SelectTemplate', 'area1SelectTemplateBox', data); }, function(code, data) { top.dialog.msg(data.msg); @@ -494,7 +495,7 @@ initSelectRadioCheckboxTemplate('area2SelectTemplate', 'area2SelectTemplateBox', []); return; } - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area1}', [area1]), {}, null, function(code, data, args) { + top.restAjax.get(top.restAjax.path('{baseHref}/api/datadictionary/listdictionarybyparentid/{area1}', [baseHref, area1]), {}, null, function(code, data, args) { initSelectRadioCheckboxTemplate('area2SelectTemplate', 'area2SelectTemplateBox', data); }, function(code, data) { top.dialog.msg(data.msg); @@ -508,7 +509,7 @@ initSelectRadioCheckboxTemplate('area3SelectTemplate', 'area3SelectTemplateBox', []); return; } - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area2}', [area2]), {}, null, function(code, data, args) { + top.restAjax.get(top.restAjax.path('{baseHref}/api/datadictionary/listdictionarybyparentid/{area2}', [baseHref, area2]), {}, null, function(code, data, args) { initSelectRadioCheckboxTemplate('area3SelectTemplate', 'area3SelectTemplateBox', data); }, function(code, data) { top.dialog.msg(data.msg); @@ -521,7 +522,7 @@ initSelectRadioCheckboxTemplate('area4SelectTemplate', 'area4SelectTemplateBox', []); return; } - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area3}', [area3]), {}, null, function(code, data, args) { + top.restAjax.get(top.restAjax.path('{baseHref}/api/datadictionary/listdictionarybyparentid/{area3}', [baseHref, area3]), {}, null, function(code, data, args) { initSelectRadioCheckboxTemplate('area4SelectTemplate', 'area4SelectTemplateBox', data); }, function(code, data) { top.dialog.msg(data.msg); @@ -535,7 +536,7 @@ initSelectRadioCheckboxTemplate('area5SelectTemplate', 'area5SelectTemplateBox', []); return; } - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area4}', [area4]), {}, null, function(code, data, args) { + top.restAjax.get(top.restAjax.path('{baseHref}/api/datadictionary/listdictionarybyparentid/{area4}', [baseHref, area4]), {}, null, function(code, data, args) { initSelectRadioCheckboxTemplate('area5SelectTemplate', 'area5SelectTemplateBox', data); }, function(code, data) { top.dialog.msg(data.msg); @@ -544,7 +545,7 @@ // 初始化污染因子 function initPollutionFactorTemplate() { - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/48b6829b-24b8-4c42-a21d-fe98dbe23fd5', []), {}, null, function(code, data) { + top.restAjax.get(top.restAjax.path('{baseHref}/api/datadictionary/listdictionarybyparentid/48b6829b-24b8-4c42-a21d-fe98dbe23fd5', [baseHref]), {}, null, function(code, data) { laytpl(document.getElementById('pollutionFactorTemplate').innerHTML).render(data, function(html) { document.getElementById('pollutionFactorTemplateBox').innerHTML = html; });