diff --git a/src/main/java/com/cm/inspection/config/ResourceConfig.java b/src/main/java/com/cm/inspection/config/ResourceConfig.java new file mode 100644 index 0000000..b60ee74 --- /dev/null +++ b/src/main/java/com/cm/inspection/config/ResourceConfig.java @@ -0,0 +1,33 @@ +package com.cm.inspection.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; +import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; + +/** + * @ClassName: ResourceConfig + * @Description: 资源服务器 + * @Author: WangGeng + * @Date: 2019/2/27 11:33 AM + * @Version: 1.0 + **/ +@Configuration +@EnableResourceServer +public class ResourceConfig extends ResourceServerConfigurerAdapter { + + @Override + public void configure(HttpSecurity http) throws Exception { + http + .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED) + .and() + .requestMatchers() + .antMatchers("/resource/**", "/client/**") + .and() + .authorizeRequests() + .antMatchers("/resource/**", "/client/**") + .authenticated(); + } + +} diff --git a/src/main/java/com/cm/inspection/pojo/dtos/check/CheckDTO.java b/src/main/java/com/cm/inspection/pojo/dtos/check/CheckDTO.java index 080e13d..ddaa643 100644 --- a/src/main/java/com/cm/inspection/pojo/dtos/check/CheckDTO.java +++ b/src/main/java/com/cm/inspection/pojo/dtos/check/CheckDTO.java @@ -55,6 +55,10 @@ public class CheckDTO { private String masterJoinByEnterpriseId; @ApiModelProperty(name = "phoneJoinByEnterpriseId", value = "企业ID的联系电话") private String phoneJoinByEnterpriseId; + @ApiModelProperty(name = "enterpriseLngByEnterpriseId", value = "企业经度") + private String enterpriseLngByEnterpriseId; + @ApiModelProperty(name = "enterpriseLatByEnterpriseId", value = "企业纬度") + private String enterpriseLatByEnterpriseId; @ApiModelProperty(name = "checkType", value = "检查类型") private Integer checkType; @ApiModelProperty(name = "taskCheckId", value = "任务检查ID") @@ -224,6 +228,23 @@ public class CheckDTO { this.phoneJoinByEnterpriseId = phoneJoinByEnterpriseId; } + + public String getEnterpriseLngByEnterpriseId() { + return enterpriseLngByEnterpriseId == null ? "" : enterpriseLngByEnterpriseId; + } + + public void setEnterpriseLngByEnterpriseId(String enterpriseLngByEnterpriseId) { + this.enterpriseLngByEnterpriseId = enterpriseLngByEnterpriseId; + } + + public String getEnterpriseLatByEnterpriseId() { + return enterpriseLatByEnterpriseId == null ? "" : enterpriseLatByEnterpriseId; + } + + public void setEnterpriseLatByEnterpriseId(String enterpriseLatByEnterpriseId) { + this.enterpriseLatByEnterpriseId = enterpriseLatByEnterpriseId; + } + public Integer getCheckType() { return checkType; } @@ -326,46 +347,50 @@ public class CheckDTO { @Override public String toString() { final StringBuilder sb = new StringBuilder("{"); - sb.append("\"checkId\":") - .append("\"").append(checkId).append("\""); - sb.append(",\"enterpriseId\":") - .append("\"").append(enterpriseId).append("\""); - sb.append(",\"nameJoinByEnterpriseId\":") - .append("\"").append(nameJoinByEnterpriseId).append("\""); - sb.append(",\"typeJoinByEnterpriseId\":") - .append("\"").append(typeJoinByEnterpriseId).append("\""); - sb.append(",\"typeDictionaryName\":") - .append("\"").append(typeDictionaryName).append("\""); - sb.append(",\"area1JoinByEnterpriseId\":") - .append("\"").append(area1JoinByEnterpriseId).append("\""); - sb.append(",\"area2JoinByEnterpriseId\":") - .append("\"").append(area2JoinByEnterpriseId).append("\""); - sb.append(",\"area3JoinByEnterpriseId\":") - .append("\"").append(area3JoinByEnterpriseId).append("\""); - sb.append(",\"area4JoinByEnterpriseId\":") - .append("\"").append(area4JoinByEnterpriseId).append("\""); - sb.append(",\"area5JoinByEnterpriseId\":") - .append("\"").append(area5JoinByEnterpriseId).append("\""); - sb.append(",\"addressJoinByEnterpriseId\":") - .append("\"").append(addressJoinByEnterpriseId).append("\""); - sb.append(",\"industryJoinByEnterpriseId\":") - .append("\"").append(industryJoinByEnterpriseId).append("\""); - sb.append(",\"industryDictionaryName\":") - .append("\"").append(industryDictionaryName).append("\""); - sb.append(",\"engagedCountJoinByEnterpriseId\":") - .append("\"").append(engagedCountJoinByEnterpriseId).append("\""); - sb.append(",\"riskOperationJoinByEnterpriseId\":") - .append("\"").append(riskOperationJoinByEnterpriseId).append("\""); - sb.append(",\"riskOperationDictionaryName\":") - .append("\"").append(riskOperationDictionaryName).append("\""); - sb.append(",\"masterJoinByEnterpriseId\":") - .append("\"").append(masterJoinByEnterpriseId).append("\""); - sb.append(",\"phoneJoinByEnterpriseId\":") - .append("\"").append(phoneJoinByEnterpriseId).append("\""); + sb.append("\"checkId\":\"") + .append(checkId).append('\"'); + sb.append(",\"enterpriseId\":\"") + .append(enterpriseId).append('\"'); + sb.append(",\"nameJoinByEnterpriseId\":\"") + .append(nameJoinByEnterpriseId).append('\"'); + sb.append(",\"typeJoinByEnterpriseId\":\"") + .append(typeJoinByEnterpriseId).append('\"'); + sb.append(",\"typeDictionaryName\":\"") + .append(typeDictionaryName).append('\"'); + sb.append(",\"area1JoinByEnterpriseId\":\"") + .append(area1JoinByEnterpriseId).append('\"'); + sb.append(",\"area2JoinByEnterpriseId\":\"") + .append(area2JoinByEnterpriseId).append('\"'); + sb.append(",\"area3JoinByEnterpriseId\":\"") + .append(area3JoinByEnterpriseId).append('\"'); + sb.append(",\"area4JoinByEnterpriseId\":\"") + .append(area4JoinByEnterpriseId).append('\"'); + sb.append(",\"area5JoinByEnterpriseId\":\"") + .append(area5JoinByEnterpriseId).append('\"'); + sb.append(",\"addressJoinByEnterpriseId\":\"") + .append(addressJoinByEnterpriseId).append('\"'); + sb.append(",\"industryJoinByEnterpriseId\":\"") + .append(industryJoinByEnterpriseId).append('\"'); + sb.append(",\"industryDictionaryName\":\"") + .append(industryDictionaryName).append('\"'); + sb.append(",\"engagedCountJoinByEnterpriseId\":\"") + .append(engagedCountJoinByEnterpriseId).append('\"'); + sb.append(",\"riskOperationJoinByEnterpriseId\":\"") + .append(riskOperationJoinByEnterpriseId).append('\"'); + sb.append(",\"riskOperationDictionaryName\":\"") + .append(riskOperationDictionaryName).append('\"'); + sb.append(",\"masterJoinByEnterpriseId\":\"") + .append(masterJoinByEnterpriseId).append('\"'); + sb.append(",\"phoneJoinByEnterpriseId\":\"") + .append(phoneJoinByEnterpriseId).append('\"'); + sb.append(",\"enterpriseLngByEnterpriseId\":\"") + .append(enterpriseLngByEnterpriseId).append('\"'); + sb.append(",\"enterpriseLatByEnterpriseId\":\"") + .append(enterpriseLatByEnterpriseId).append('\"'); sb.append(",\"checkType\":") .append(checkType); - sb.append(",\"taskCheckId\":") - .append("\"").append(taskCheckId).append("\""); + sb.append(",\"taskCheckId\":\"") + .append(taskCheckId).append('\"'); sb.append(",\"isCoordination\":") .append(isCoordination); sb.append(",\"isComplete\":") @@ -376,14 +401,14 @@ public class CheckDTO { .append(immediatelyChangeType); sb.append(",\"rectificationDays\":") .append(rectificationDays); - sb.append(",\"summary\":") - .append("\"").append(summary).append("\""); - sb.append(",\"checkLng\":") - .append("\"").append(checkLng).append("\""); - sb.append(",\"checkLat\":") - .append("\"").append(checkLat).append("\""); - sb.append(",\"gmtCreate\":") - .append("\"").append(gmtCreate).append("\""); + sb.append(",\"summary\":\"") + .append(summary).append('\"'); + sb.append(",\"checkLng\":\"") + .append(checkLng).append('\"'); + sb.append(",\"checkLat\":\"") + .append(checkLat).append('\"'); + sb.append(",\"gmtCreate\":\"") + .append(gmtCreate).append('\"'); sb.append(",\"checkItems\":") .append(checkItems); sb.append('}'); diff --git a/src/main/resources/mybatis/mapper/check/check-mapper.xml b/src/main/resources/mybatis/mapper/check/check-mapper.xml index 9635d45..f4ecd81 100644 --- a/src/main/resources/mybatis/mapper/check/check-mapper.xml +++ b/src/main/resources/mybatis/mapper/check/check-mapper.xml @@ -21,6 +21,8 @@ + + @@ -187,6 +189,8 @@ dt3.dictionary_name risk_operation_dictionary_name, jt1.master master_join_by_enterprise_id, jt1.phone phone_join_by_enterprise_id, + jt1.enterprise_lng enterprise_lng_by_enterprise_id, + jt1.enterprise_lat enterprise_lat_by_enterprise_id, t1.check_type, t1.task_check_id, t1.is_coordination, diff --git a/src/main/resources/static/route/check/list-check.html b/src/main/resources/static/route/check/list-check.html index eed91ec..4d4ba0a 100644 --- a/src/main/resources/static/route/check/list-check.html +++ b/src/main/resources/static/route/check/list-check.html @@ -9,6 +9,51 @@ +
@@ -141,131 +186,77 @@ cols: [[ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'gmtCreate', width: 200, title: '检查时间', align:'center', + {field:'col1', width: 300, title: '检查企业', align: 'center', templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; + var infoDiv = ''; + infoDiv += ''; + infoDiv += ''; + infoDiv += ''; + infoDiv += '
'+ row.gmtCreate +'
企业名称
'+ row.nameJoinByEnterpriseId +'
企业类型'+ row.typeDictionaryName +'
'; + return infoDiv; } }, - {field: 'nameJoinByEnterpriseId', width: 200, title: '企业名称', align:'center', + {field:'col2', width: 400, title: '行业风险', align: 'center', templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; + var infoDiv = ''; + infoDiv += ''; + infoDiv += ''; + if(row.enterpriseLngByEnterpriseId && row.enterpriseLatByEnterpriseId) { + infoDiv += ''; + } else { + infoDiv += ''; } - return rowData; + infoDiv += '
管理行业'+ (row.industryDictionaryName ? row.industryDictionaryName : '-') +'
作业风险'+ (row.riskOperationDictionaryName ? row.riskOperationDictionaryName : '-') +'
'+ (row.addressJoinByEnterpriseId ? row.addressJoinByEnterpriseId : '查看企业定位') +'
'+ (row.addressJoinByEnterpriseId ? row.addressJoinByEnterpriseId : '-') +'
'; + return infoDiv; } }, - {field: 'typeDictionaryName', width: 200, title: '企业类型', align:'center', + {field:'col3', width: 240, title: '人员信息', align: 'center', templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; + var infoDiv = ''; + infoDiv += ''; + infoDiv += ''; + infoDiv += ''; + infoDiv += '
负责人 '+ (row.masterJoinByEnterpriseId ? row.masterJoinByEnterpriseId : '-') +'
联系电话 '+ (row.phoneJoinByEnterpriseId ? row.phoneJoinByEnterpriseId : '-') +'
从业人数 '+ (row.engagedCountJoinByEnterpriseId ? (row.engagedCountJoinByEnterpriseId +' 人') : '-') +'
'; + return infoDiv; } }, - {field: 'addressJoinByEnterpriseId', width: 200, title: '详细地址', align:'center', + {field:'col4', width: 100, title: '状态', align: 'center', templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'industryDictionaryName', width: 200, title: '管理行业', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'engagedCountJoinByEnterpriseId', width: 100, title: '从业人数', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'riskOperationDictionaryName', width: 200, title: '风险作业', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'masterJoinByEnterpriseId', width: 150, title: '负责人', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'phoneJoinByEnterpriseId', width: 150, title: '联系电话', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'checkType', width: 150, title: '检查类型', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - if(rowData == 1) { - return '检查'; + var checkType = '【无检查类型】'; + if(row.checkType == 1) { + checkType = '【检查】'; } else if(rowData == 2) { - return '复查'; + checkType = '【复查】'; } - return '无'; + var isCoordination = '【不配合】'; + if(row.isCoordination == 1) { + isCoordination = '【配合】'; + } + var isComplete = '【未完成】'; + if(row.isComplete == 1) { + isComplete = '【完成】' + } + var infoDiv = ''; + infoDiv += ''; + infoDiv += ''; + infoDiv += ''; + infoDiv += '
'+ checkType +'
'+ isCoordination +'
'+ isComplete +'
'; + return infoDiv; } }, - {field: 'isCoordination', width: 100, title: '是否配合', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null) { - return '-'; - } - if(rowData == 1) { - return '配合' - } - return '不配合'; - } - }, - {field: 'isComplete', width: 100, title: '是否完成', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null) { - return '-'; - } - if(rowData == 1) { - return '完成' - } - return '未完成'; - } - }, - {field: 'updateCheckMine', width: 110, title: '检查结果', fixed:'right', align:'center', + {field:'col5', width: 120, title: '操作', align: 'center', templet: function(row) { + var isCoordinationBtn = ''; if(row.isCoordination != 1) { - return '不配合'; + isCoordinationBtn = '不配合'; } - return ''; + var infoDiv = ''; + infoDiv += ''; + if(row.checkLng && row.checkLat) { + infoDiv += ''; + } + infoDiv += '
'+ isCoordinationBtn +'
查看检查位置
'; + return infoDiv; } }, ]], @@ -328,6 +319,10 @@ reloadTable(); }, 500); }); + // 60s自动刷新 + setInterval(function() { + reloadTable(); + }, 60000); // 事件 - 搜索 $(document).on('click', '#search', function() { reloadTable(1); @@ -385,17 +380,35 @@ } }); - table.on('tool(dataTable)', function(obj) { - var layEvent = obj.event; - var data = obj.data; - if(layEvent === 'getCheckMineEvent') { - top.dialog.open({ - url: top.restAjax.path('route/check/get-check-item.html?checkId={checkId}', [data.checkId]), - title: '【'+ data.nameJoinByEnterpriseId + '】检、复查选项', - width: '80%', - height: '80%', - onClose: function() {} - }); + $(document).on('click', '.check-detail', function() { + var checkId = this.dataset.checkid; + var nameJoinByEnterpriseId = this.dataset.name; + top.dialog.open({ + url: top.restAjax.path('route/check/get-check-item.html?checkId={checkId}', [checkId]), + title: '【'+ nameJoinByEnterpriseId + '】检、复查选项', + width: '80%', + height: '80%', + onClose: function() {} + }); + }); + + $(document).on('click', '.enterprise-location', function() { + var lng = this.dataset.lng; + var lat = this.dataset.lat; + if(lng && lat) { + + } else { + top.dialog.msg('暂无定位信息'); + } + }); + + $(document).on('click', '.check-location', function() { + var lng = this.dataset.lng; + var lat = this.dataset.lat; + if(lng && lat) { + + } else { + top.dialog.msg('暂无检查定位信息'); } }); });