Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/resources/static/assets/images/backgrounds/1.jpg
#	src/main/resources/static/assets/images/backgrounds/2.jpg
#	src/main/resources/static/assets/images/backgrounds/3.jpg
#	src/main/resources/static/assets/images/backgrounds/4.jpg
#	src/main/resources/static/assets/images/backgrounds/5.jpg
#	src/main/resources/static/assets/images/backgrounds/6.jpg
#	src/main/resources/static/assets/images/backgrounds/7.jpg
#	src/main/resources/static/assets/images/backgrounds/8.jpg
#	src/main/resources/static/assets/images/backgrounds/9.jpg
#	src/main/resources/static/assets/js/dialog.js
#	src/main/resources/static/assets/js/vendor/ckplayer/ckplayer/ckplayer.js
#	src/main/resources/static/assets/js/vendor/ueditor/lang/zh-cn/images/localimage.png
#	src/main/resources/static/assets/js/vendor/ueditor/themes/default/css/ueditor.css
#	src/main/resources/static/assets/js/vendor/ueditor/themes/default/css/ueditor.min.css
#	src/main/resources/static/assets/js/vendor/ueditor/themes/iframe.css
#	src/main/resources/static/assets/js/vendor/ueditor/ueditor.config.js
#	src/main/resources/static/assets/layuiadmin/config.js
#	src/main/resources/static/assets/layuiadmin/layui/lay/modules/form.js
#	src/main/resources/static/assets/layuiadmin/lib/admin.js
#	src/main/resources/static/assets/layuiadmin/modules/common.js
#	src/main/resources/static/assets/layuiadmin/modules/dialog.js
#	src/main/resources/static/assets/layuiadmin/modules/restajax.js
#	src/main/resources/static/assets/layuiadmin/style/admin.css
#	src/main/resources/static/assets/layuiadmin/style/login.css
#	src/main/resources/static/default.html
This commit is contained in:
ly19960718 2021-04-29 11:51:29 +08:00
parent 5b1ff22b8b
commit 3e2efe1695
8 changed files with 323 additions and 29 deletions

View File

@ -39,4 +39,8 @@ public class InstitutionRouteController extends DefaultBaseController {
return new ModelAndView("institution/list");
}
@GetMapping("baidumap")
public ModelAndView baiDuMap(){return new ModelAndView("baidumap/map-baidu.html");}
}

View File

@ -1,12 +1,13 @@
package cn.com.tenlion.institutionmanagement.dao.institution;
import cn.com.tenlion.institutionmanagement.pojo.bos.institution.InstitutionBO;
import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO;
import cn.com.tenlion.institutionmanagement.pojo.pos.institution.InstitutionPO;
import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import cn.com.tenlion.pojo.bos.institution.InstitutionBO;
import cn.com.tenlion.pojo.pos.institution.InstitutionPO;
import cn.com.tenlion.pojo.dtos.institution.InstitutionDTO;
import org.springframework.stereotype.Repository;
import java.util.List;

View File

@ -1,17 +1,18 @@
package cn.com.tenlion.institutionmanagement.service.institution.impl;
import cn.com.tenlion.institutionmanagement.dao.institution.IInstitutionDao;
import cn.com.tenlion.institutionmanagement.pojo.bos.institution.InstitutionBO;
import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO;
import cn.com.tenlion.institutionmanagement.pojo.pos.institution.InstitutionPO;
import cn.com.tenlion.institutionmanagement.pojo.vos.institution.InstitutionVO;
import cn.com.tenlion.institutionmanagement.service.institution.IInstitutionService;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.util.map.HashMapUtil;
import ink.wgink.util.UUIDUtil;
import cn.com.tenlion.dao.institution.IInstitutionDao;
import cn.com.tenlion.pojo.dtos.institution.InstitutionDTO;
import cn.com.tenlion.pojo.vos.institution.InstitutionVO;
import cn.com.tenlion.pojo.bos.institution.InstitutionBO;
import cn.com.tenlion.pojo.pos.institution.InstitutionPO;
import cn.com.tenlion.service.institution.IInstitutionService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.tenlion.dao.institution.IInstitutionDao">
<mapper namespace="cn.com.tenlion.institutionmanagement.dao.institution.IInstitutionDao">
<resultMap id="institutionDTO" type="cn.com.tenlion.pojo.dtos.institution.InstitutionDTO">
<resultMap id="institutionDTO" type="cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO">
<result column="institution_id" property="institutionId"/>
<result column="institution_name" property="institutionName"/>
<result column="institution_desc" property="institutionDesc"/>
@ -22,7 +22,7 @@
<result column="gmt_create" property="gmtCreate"/>
</resultMap>
<resultMap id="institutionBO" type="cn.com.tenlion.pojo.bos.institution.InstitutionBO">
<resultMap id="institutionBO" type="cn.com.tenlion.institutionmanagement.pojo.bos.institution.InstitutionBO">
<result column="institution_id" property="institutionId"/>
<result column="institution_name" property="institutionName"/>
<result column="institution_desc" property="institutionDesc"/>
@ -45,7 +45,7 @@
<result column="is_delete" property="isDelete"/>
</resultMap>
<resultMap id="institutionPO" type="cn.com.tenlion.pojo.pos.institution.InstitutionPO">
<resultMap id="institutionPO" type="cn.com.tenlion.institutionmanagement.pojo.pos.institution.InstitutionPO">
<result column="institution_id" property="institutionId"/>
<result column="institution_name" property="institutionName"/>
<result column="institution_desc" property="institutionDesc"/>

View File

@ -0,0 +1,275 @@
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<base th:href="${#request.getContextPath() + '/'}">
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=2qzNKd33lQERUDakqDDyvLOyqM1x2i8y"></script>
</head>
<body>
<div class="layui-anim layui-anim-fadein">
<div class="layui-card">
<div class="layui-inline">
<input type="text" class="layui-input search-item" name="searchMapId" id="searchMapId" value="">
</div>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id = "searchMap">
<i class="fa fa-lg fa-search"></i>
</button>
<input type="hidden" id="mapX" value=""><!--经度-->
<input type="hidden" id="mapY" value=""><!--纬度-->
<input type="hidden" id="mapName" value=""><!--名称-->
<div id="maplocation" style="width:100%;height:500px;"></div>
<div class="layui-form-item layui-layout-admin">
<div class="layui-input-block">
<div class="layui-footer" style="left: 0;">
<button type="button" class="layui-btn" id = "save">保存</button>
</div>
</div>
</div>
</div>
</div>
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
<script src="assets/js/jquery-2.1.1.min.js"></script>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var common = layui.common;
var mapObj = {}
initMap(88.886487,29.276981);
var zoomNum = 17;
$("#save").on('click',function(){
var mapX = $("#mapX").val();
var mapY = $("#mapY").val();
if ("经度:空" == mapX || "纬度:空" == mapY) {
layer.msg("尚未选择位置");
} else {
top.dialog.dialogData.activityAddressX = mapX;
top.dialog.dialogData.activityAddressY = mapY;
top.dialog.dialogData.activityAddress = $("#mapName").val();
closeWindow();
}
});
function ComplexCustomOverlay(point, text) { // 构造函数
this._point = point;
this._text = text;
}
ComplexCustomOverlay.prototype = new BMap.Overlay();
// 监听事件 通过构造函数的prototype属性 添加任自定义的方法
ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
this._div['on' + event] = fun;
}
ComplexCustomOverlay.prototype.initialize = function (map) {
this._map = map;
var A = this._div = document.createElement("a");
A.style.display = "block";
A.style.position = "absolute";
A.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
A.style.border = "1px solid #ff6000";
A.style.color = "#FF0000";
A.style.display = "block";
A.style.fontWeight = "bold";
A.style.height = "20px";
A.style.padding = "0px 4px 0px 0px";
A.style.lineHeight = "15px";
A.style.whiteSpace = "nowrap";
A.style.MozUserSelect = "none";
A.style.fontSize = "13px"
var span = this._span = document.createElement("span");
var img = document.createElement("img");
img.src = "<%=basePath%>static/images/department.png";
img.style.height = "18px";
img.style.width = "20px";
A.appendChild(img);
A.appendChild(span);
span.appendChild(document.createTextNode(this._text));
var that = this;
var arrow = this._arrow = document.createElement("div");
arrow.style.background = "url(<%=basePath%>static/images/member.png) -77px -119px no-repeat";
arrow.style.position = "absolute";
arrow.style.width = "21px";
arrow.style.height = "32px";
arrow.style.top = "-1px";
arrow.style.left = "-11px";//-11
arrow.style.overflow = "hidden";
A.appendChild(arrow);
A.onmouseover = function () {
this.style.borderColor = "#32CD32";
this.style.color = "#32CD32";
arrow.style.backgroundPosition = "-77px -161px";
this.style.cursor = "pointer";
this.style.zIndex = 100;
}
A.onmouseout = function () {
this.style.borderColor = "#ff6000";
this.style.color = "#ff6000";
arrow.style.backgroundPosition = "-77px -119px";
this.style.zIndex = 1;
}
map.getPanes().labelPane.appendChild(A);
return A;
}
// 实现绘制方法
ComplexCustomOverlay.prototype.draw = function () {
var map = this._map;
var pixel = map.pointToOverlayPixel(this._point);
this._div.style.left = pixel.x + "px";
this._div.style.top = pixel.y + "px";
}
function closeWindow() {
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
parent.layer.close(index);
}
// 查询地名对象
var geoc = new BMap.Geocoder();
//创建和初始化地图函数:
function initMap(x, y) {
createMap(x, y);//创建地图
setMapEvent();//设置地图事件
addMapControl();//向地图添加控件
}
//创建地图函数:
function createMap(x, y) {
var map = new BMap.Map("maplocation");//在百度地图容器中创建一个地图
var point = new BMap.Point(x, y);//定义一个中心点坐标
map.addOverlay(new BMap.Marker(point));//定点坐标红点覆盖
/*map.centerAndZoom(point, zoomNum);//设定地图的中心点和坐标并将地图显示在地图容器中*/
map.centerAndZoom(point, 12)
window.map = map;//将map变量存储在全局
}
//地图事件设置函数:
function setMapEvent() {
map.enableDragging();//启用地图拖拽事件,默认启用(可不写)
map.enableScrollWheelZoom();//启用地图滚轮放大缩小
map.enableContinuousZoom();//开启缩放平滑
map.enableDoubleClickZoom();//启用鼠标双击放大,默认启用(可不写)
map.enableKeyboard();//启用键盘上下左右键移动地图
map.addEventListener("click", function (e) {
var LONGITUDE = e.point.lng;
var LATITUDE = e.point.lat;
/*$("#LONGITUDE").text("经度:"+LONGITUDE);
$("#LATITUDE").text("纬度:"+LATITUDE);*/
geoc.getLocation(e.point, function (rs) {
var addComp = rs.addressComponents;
var site = addComp.province + "." + addComp.city + "." + addComp.district;
if (addComp.street) {
site = site + "." + addComp.street;
}
if (addComp.streetNumber) {
site = site + "." + addComp.streetNumber;
}
/*$("#MAP_NAME").text(site);*/
$('#mapX').val(LONGITUDE);
$('#mapY').val(LATITUDE);
$('#mapName').val(site);
/* console.log("经度"+LONGITUDE)
console.log("纬度"+LATITUDE)
console.log("名称"+site)*/
});
// 如果不循环删除遮罩会一直累加
var allOverlay = map.getOverlays();
for (var i = 0; i < allOverlay.length; i++) {
map.removeOverlay(allOverlay[i]);
}
// 第一种"显示太大
// var point = new BMap.Point(LONGITUDE, LATITUDE);
// var myCompOverlay = new ComplexCustomOverlay(point, "经度:"+LONGITUDE + "|纬度:"+LATITUDE);
// map.addOverlay(myCompOverlay);
// 第二中"系统默认
var point = new BMap.Point(LONGITUDE, LATITUDE);//定义一个中心点坐标
map.addOverlay(new BMap.Marker(point));//定点坐标红点覆盖
// 重新初始化
// initMap(LONGITUDE, LATITUDE);
});
map.addEventListener("zoomend", function (e) {
zoomNum = map.getZoom();
});
}
// 地图控件添加函数:
function addMapControl() {
// 向地图中添加缩放控件
var ctrl_nav = new BMap.NavigationControl({
anchor: BMAP_ANCHOR_TOP_LEFT,
type: BMAP_NAVIGATION_CONTROL_LARGE
});
map.addControl(ctrl_nav);
// 向地图中添加缩略图控件
var ctrl_ove = new BMap.OverviewMapControl({
anchor: BMAP_ANCHOR_BOTTOM_RIGHT,
isOpen: 2
});
map.addControl(ctrl_ove);
// 向地图中添加比例尺控件
var ctrl_sca = new BMap.ScaleControl({
anchor: BMAP_ANCHOR_BOTTOM_LEFT
});
map.addControl(ctrl_sca);
}
$("#searchMap").on('click',function(){
var searchInput = $('#searchMapId').val();
if (!searchInput) {
layer.msg("查询内容不能为空");
}
var localSearch = new BMap.LocalSearch(map);
localSearch.setSearchCompleteCallback(function (msg) {
if (localSearch.getStatus() == BMAP_STATUS_SUCCESS) {
var poi = msg.getPoi(0);
if (poi) {
initMap(poi.point.lng, poi.point.lat);
var LONGITUDE = poi.point.lng;
var LATITUDE = poi.point.lat;
$("#mapX").val(LONGITUDE);
$("#mapY").val(LATITUDE);
$("#mapName").val((poi.province ? poi.province + "." : "") + (poi.address ? poi.address + "." : poi.city + ".") + poi.title);
console.log(poi);
$("#MAP_NAME").text((poi.province ? poi.province + "." : "") + (poi.address ? poi.address + "." : poi.city + ".") + poi.title);
}
} else {
layer.msg("没有查询结果");
}
});
localSearch.search(searchInput);
});
});
</script>
</body>
</html>

View File

@ -10,6 +10,14 @@
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
<style>
.layui-form-label{
width:120px;
}
.layui-input-block{
margin-left:120px;
}
</style>
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
@ -64,22 +72,12 @@
</script>
</div>
</div>
<div class="layui-form-item layui-form-text">
<div class="layui-form-item">
<label class="layui-form-label">机构详情地址</label>
<div class="layui-input-block">
<textarea id="institutionAddress" name="institutionAddress" class="layui-textarea" placeholder="请输入机构详情地址"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">机构经度</label>
<div class="layui-input-block">
<input type="text" id="institutionX" name="institutionX" class="layui-input" value="" placeholder="请输入机构经度" maxlength="50">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">机构纬度</label>
<div class="layui-input-block">
<input type="text" id="institutionY" name="institutionY" class="layui-input" value="" placeholder="请输入机构纬度" maxlength="50">
<input type="hidden" id="institutionX" name="institutionX" value="" placeholder="请输入机构经度">
<input type="hidden" id="institutionY" name="institutionY" value="" placeholder="请输入机构纬度">
<input type="text" id="institutionAddress" name="institutionAddress" class="layui-input" value="" placeholder="请输入机构详情地址" maxlength="50">
</div>
</div>
<div class="layui-form-item">
@ -101,7 +99,7 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">行政区划-省</label>
<label class="layui-form-label">行政区划</label>
<div class="layui-input-inline">
<select name="institutionRegionProvince" id="institutionRegionProvince" placeholder="请选择省" lay-verify="">
<option value="">请选择省</option>
@ -269,7 +267,6 @@
laydate.render({
elem: '#institutionFoundingTime',
type: 'datetime',
value: new Date(),
trigger: 'click'
});
}
@ -315,6 +312,22 @@
closeBox();
});
$("#institutionAddress").on('click',function () {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['50%', '50%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/institution/baidumap', []),
end: function() {
}
});
});
// 校验
form.verify({
});