调整地图网格表字段、新增网格组
This commit is contained in:
parent
2ca3f5612a
commit
416cc38ad5
@ -0,0 +1,102 @@
|
||||
package ink.wgink.module.map.controller.api.grid;
|
||||
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridDTO;
|
||||
import ink.wgink.module.map.pojo.vos.grid.GridVO;
|
||||
import ink.wgink.module.map.service.grid.IGridService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: GridControler
|
||||
* @Description: 网格管理
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/10/19 10:21 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "网格接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.API_PREFIX + "/grid")
|
||||
public class GridController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IGridService gridService;
|
||||
|
||||
@ApiOperation(value = "新增网格", notes = "新增网格接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("save")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult save(@RequestBody GridVO gridVO) throws Exception {
|
||||
gridService.save(gridVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除网格", notes = "删除网格接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@DeleteMapping("remove/{ids}")
|
||||
public SuccessResult remove(@PathVariable("ids") String ids) {
|
||||
gridService.remove(Arrays.asList(ids.split("\\_")));
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改网格", notes = "修改网格接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gridIdId", value = "网格ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update/{gridId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult update(@PathVariable("gridId") String gridId, @RequestBody GridVO gridVO) throws Exception {
|
||||
gridService.update(gridId, gridVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格详情", notes = "网格详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gridIdId", value = "网格ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{gridId}")
|
||||
public GridDTO get(@PathVariable("gridId") String gridId) {
|
||||
return gridService.get(gridId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格列表", notes = "网格列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<GridDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return gridService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格分页列表", notes = "网格分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<GridDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return gridService.listPage(page);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package ink.wgink.module.map.controller.api.grid;
|
||||
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.exceptions.ParamsException;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridGroupDTO;
|
||||
import ink.wgink.module.map.pojo.vos.grid.GridGroupVO;
|
||||
import ink.wgink.module.map.service.grid.IGridGroupService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.RegexUtil;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: GridGroupController
|
||||
* @Description: 网格组管理
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/10/19 10:21 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "网格组接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.API_PREFIX + "/grid-group")
|
||||
public class GridGroupController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IGridGroupService gridGroupService;
|
||||
|
||||
@ApiOperation(value = "新增网格组", notes = "新增网格组接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("save")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult save(@RequestBody GridGroupVO gridGroupVO) throws Exception {
|
||||
if (StringUtils.isBlank(gridGroupVO.getGridGroupCode())) {
|
||||
throw new ParamsException("编码不能为空");
|
||||
}
|
||||
if (!RegexUtil.isLetter(gridGroupVO.getGridGroupCode())) {
|
||||
throw new ParamsException("编码只能是字母");
|
||||
}
|
||||
gridGroupService.save(gridGroupVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除网格组", notes = "删除网格组接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@DeleteMapping("remove/{ids}")
|
||||
public SuccessResult remove(@PathVariable("ids") String ids) {
|
||||
gridGroupService.remove(Arrays.asList(ids.split("\\_")));
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改网格组", notes = "修改网格组接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gridGroupIdId", value = "网格组ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update/{gridGroupId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult update(@PathVariable("gridGroupId") String gridGroupId, @RequestBody GridGroupVO gridGroupVO) throws Exception {
|
||||
gridGroupService.update(gridGroupId, gridGroupVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格组详情", notes = "网格组详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gridGroupIdId", value = "网格组ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{gridGroupId}")
|
||||
public GridGroupDTO get(@PathVariable("gridGroupId") String gridGroupId) {
|
||||
return gridGroupService.get(gridGroupId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格组列表", notes = "网格组列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<GridGroupDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return gridGroupService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格组分页列表", notes = "网格组分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<GridGroupDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return gridGroupService.listPage(page);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package ink.wgink.module.map.controller.route.grid;
|
||||
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* @ClassName: GridGroupRouteController
|
||||
* @Description: 网格组路由
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/10/19 11:54 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "网格组接口")
|
||||
@Controller
|
||||
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/grid-group")
|
||||
public class GridGroupRouteController {
|
||||
|
||||
@GetMapping("list")
|
||||
public ModelAndView list() {
|
||||
return new ModelAndView("grid/grid-group/list");
|
||||
}
|
||||
|
||||
@GetMapping("save")
|
||||
public ModelAndView save() {
|
||||
return new ModelAndView("grid/grid-group/save");
|
||||
}
|
||||
|
||||
@GetMapping("update")
|
||||
public ModelAndView update() {
|
||||
return new ModelAndView("grid/grid-group/update");
|
||||
}
|
||||
|
||||
}
|
@ -5,7 +5,8 @@ import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.exceptions.UpdateException;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import ink.wgink.module.map.pojo.dto.grid.GridDTO;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridDTO;
|
||||
import ink.wgink.module.map.pojo.pos.grid.GridPO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@ -31,6 +32,14 @@ public interface IGridDao extends IInitBaseTable {
|
||||
*/
|
||||
void save(Map<String, Object> params) throws SaveException;
|
||||
|
||||
/**
|
||||
* 删除网格
|
||||
*
|
||||
* @param params
|
||||
* @throws RemoveException
|
||||
*/
|
||||
void remove(Map<String, Object> params) throws RemoveException;
|
||||
|
||||
/**
|
||||
* 删除网格
|
||||
*
|
||||
@ -47,6 +56,24 @@ public interface IGridDao extends IInitBaseTable {
|
||||
*/
|
||||
void update(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 网格详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
GridDTO get(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 网格详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
GridPO getPO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 获取网格列表
|
||||
*
|
||||
@ -65,4 +92,5 @@ public interface IGridDao extends IInitBaseTable {
|
||||
*/
|
||||
List<GridDTO> listGroup(Map<String, Object> params) throws SearchException;
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,84 @@
|
||||
package ink.wgink.module.map.dao.grid;
|
||||
|
||||
import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.exceptions.UpdateException;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridGroupDTO;
|
||||
import ink.wgink.module.map.pojo.pos.grid.GridGroupPO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: IGridGroupDao
|
||||
* @Description: 网格组
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/10/19 10:26 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Repository
|
||||
public interface IGridGroupDao extends IInitBaseTable {
|
||||
|
||||
/**
|
||||
* 新增网格组
|
||||
*
|
||||
* @param params
|
||||
* @throws SaveException
|
||||
*/
|
||||
void save(Map<String, Object> params) throws SaveException;
|
||||
|
||||
/**
|
||||
* 删除网格组
|
||||
*
|
||||
* @param params
|
||||
* @throws RemoveException
|
||||
*/
|
||||
void remove(Map<String, Object> params) throws RemoveException;
|
||||
|
||||
/**
|
||||
* 修改网格组
|
||||
*
|
||||
* @param params
|
||||
* @throws UpdateException
|
||||
*/
|
||||
void update(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 网格组详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
GridGroupDTO get(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 网格组详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
GridGroupPO getPO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 网格组列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<GridGroupDTO> list(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 网格组列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<GridGroupPO> listPO(Map<String, Object> params) throws SearchException;
|
||||
}
|
@ -4,7 +4,7 @@ import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import ink.wgink.module.map.pojo.dto.grid.GridPointDTO;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridPointDTO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -4,7 +4,7 @@ import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import ink.wgink.module.map.pojo.dto.grid.GridRelationDTO;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridRelationDTO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -1,83 +0,0 @@
|
||||
package ink.wgink.module.map.pojo.dto.grid;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: GridDTO
|
||||
* @Description: 网格
|
||||
* @Author: WangGeng
|
||||
* @Date: 2020/10/21 17:01
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@ApiModel
|
||||
public class GridDTO extends GridRelationDTO {
|
||||
|
||||
@ApiModelProperty(name = "fillColor", value = "填充颜色")
|
||||
private String fillColor;
|
||||
@ApiModelProperty(name = "gridName", value = "网格名称")
|
||||
private String gridName;
|
||||
@ApiModelProperty(name = "relationIdArray", value = "关联ID列表")
|
||||
private List<String> relationIdArray;
|
||||
@ApiModelProperty(name = "pointArray", value = "网格点列表")
|
||||
private List<GridPointDTO> pointArray;
|
||||
|
||||
public String getFillColor() {
|
||||
return fillColor == null ? "" : fillColor.trim();
|
||||
}
|
||||
|
||||
public void setFillColor(String fillColor) {
|
||||
this.fillColor = fillColor;
|
||||
}
|
||||
|
||||
public String getGridName() {
|
||||
return gridName == null ? "" : gridName.trim();
|
||||
}
|
||||
|
||||
public void setGridName(String gridName) {
|
||||
this.gridName = gridName;
|
||||
}
|
||||
|
||||
public List<String> getRelationIdArray() {
|
||||
if (relationIdArray == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return relationIdArray;
|
||||
}
|
||||
|
||||
public void setRelationIdArray(List<String> relationIdArray) {
|
||||
this.relationIdArray = relationIdArray;
|
||||
}
|
||||
|
||||
public List<GridPointDTO> getPointArray() {
|
||||
if (pointArray == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return pointArray;
|
||||
}
|
||||
|
||||
public void setPointArray(List<GridPointDTO> pointArray) {
|
||||
this.pointArray = pointArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"fillColor\":\"")
|
||||
.append(fillColor).append('\"');
|
||||
sb.append(",\"gridName\":\"")
|
||||
.append(gridName).append('\"');
|
||||
sb.append(",\"relationIdArray\":")
|
||||
.append(relationIdArray);
|
||||
sb.append(",\"pointArray\":")
|
||||
.append(pointArray);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,185 @@
|
||||
package ink.wgink.module.map.pojo.dtos.grid;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: GridDTO
|
||||
* @Description: 网格
|
||||
* @Author: WangGeng
|
||||
* @Date: 2020/10/21 17:01
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@ApiModel
|
||||
public class GridDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8205867660055311853L;
|
||||
@ApiModelProperty(name = "gridId", value = "主键")
|
||||
private String gridId;
|
||||
@ApiModelProperty(name = "gridName", value = "网格名称")
|
||||
private String gridName;
|
||||
@ApiModelProperty(name = "gridSummary", value = "网格描述")
|
||||
private String gridSummary;
|
||||
@ApiModelProperty(name = "gridGroupId", value = "网格组ID")
|
||||
private String gridGroupId;
|
||||
@ApiModelProperty(name = "gridDuty", value = "网格职责")
|
||||
private String gridDuty;
|
||||
@ApiModelProperty(name = "gridCode", value = "网格编码")
|
||||
private String gridCode;
|
||||
@ApiModelProperty(name = "gridSquare", value = "网格面积")
|
||||
private Double gridSquare;
|
||||
@ApiModelProperty(name = "areaCode", value = "区域编码")
|
||||
private String areaCode;
|
||||
@ApiModelProperty(name = "areaName", value = "区域名称")
|
||||
private String areaName;
|
||||
@ApiModelProperty(name = "fillColor", value = "填充颜色")
|
||||
private String fillColor;
|
||||
@ApiModelProperty(name = "relationId", value = "关联ID")
|
||||
private String relationId;
|
||||
@ApiModelProperty(name = "gmtCreate", value = "添加时间")
|
||||
private String gmtCreate;
|
||||
@ApiModelProperty(name = "relationIdArray", value = "关联ID列表")
|
||||
private List<String> relationIdArray;
|
||||
@ApiModelProperty(name = "pointArray", value = "网格点列表")
|
||||
private List<GridPointDTO> pointArray;
|
||||
|
||||
public String getGridId() {
|
||||
return gridId == null ? "" : gridId.trim();
|
||||
}
|
||||
|
||||
public void setGridId(String gridId) {
|
||||
this.gridId = gridId;
|
||||
}
|
||||
|
||||
public String getGridName() {
|
||||
return gridName == null ? "" : gridName.trim();
|
||||
}
|
||||
|
||||
public void setGridName(String gridName) {
|
||||
this.gridName = gridName;
|
||||
}
|
||||
|
||||
public String getGridSummary() {
|
||||
return gridSummary == null ? "" : gridSummary.trim();
|
||||
}
|
||||
|
||||
public void setGridSummary(String gridSummary) {
|
||||
this.gridSummary = gridSummary;
|
||||
}
|
||||
|
||||
public String getGridGroupId() {
|
||||
return gridGroupId == null ? "" : gridGroupId.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupId(String gridGroupId) {
|
||||
this.gridGroupId = gridGroupId;
|
||||
}
|
||||
|
||||
public String getGridDuty() {
|
||||
return gridDuty == null ? "" : gridDuty.trim();
|
||||
}
|
||||
|
||||
public void setGridDuty(String gridDuty) {
|
||||
this.gridDuty = gridDuty;
|
||||
}
|
||||
|
||||
public String getGridCode() {
|
||||
return gridCode == null ? "" : gridCode.trim();
|
||||
}
|
||||
|
||||
public void setGridCode(String gridCode) {
|
||||
this.gridCode = gridCode;
|
||||
}
|
||||
|
||||
public Double getGridSquare() {
|
||||
return gridSquare == null ? 0 : gridSquare;
|
||||
}
|
||||
|
||||
public void setGridSquare(Double gridSquare) {
|
||||
this.gridSquare = gridSquare;
|
||||
}
|
||||
|
||||
public String getAreaCode() {
|
||||
return areaCode == null ? "" : areaCode.trim();
|
||||
}
|
||||
|
||||
public void setAreaCode(String areaCode) {
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName == null ? "" : areaName.trim();
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getFillColor() {
|
||||
return fillColor == null ? "" : fillColor.trim();
|
||||
}
|
||||
|
||||
public void setFillColor(String fillColor) {
|
||||
this.fillColor = fillColor;
|
||||
}
|
||||
|
||||
public String getRelationId() {
|
||||
return relationId == null ? "" : relationId.trim();
|
||||
}
|
||||
|
||||
public void setRelationId(String relationId) {
|
||||
this.relationId = relationId;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public List<String> getRelationIdArray() {
|
||||
if (relationIdArray == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return relationIdArray;
|
||||
}
|
||||
|
||||
public void setRelationIdArray(List<String> relationIdArray) {
|
||||
this.relationIdArray = relationIdArray;
|
||||
}
|
||||
|
||||
public List<GridPointDTO> getPointArray() {
|
||||
if (pointArray == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return pointArray;
|
||||
}
|
||||
|
||||
public void setPointArray(List<GridPointDTO> pointArray) {
|
||||
this.pointArray = pointArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"fillColor\":\"")
|
||||
.append(fillColor).append('\"');
|
||||
sb.append(",\"gridName\":\"")
|
||||
.append(gridName).append('\"');
|
||||
sb.append(",\"relationIdArray\":")
|
||||
.append(relationIdArray);
|
||||
sb.append(",\"pointArray\":")
|
||||
.append(pointArray);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package ink.wgink.module.map.pojo.dtos.grid;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: GridGroupDTO
|
||||
* @Description: 网格组
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/10/19 10:29 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@ApiModel
|
||||
public class GridGroupDTO implements Serializable {
|
||||
|
||||
@ApiModelProperty(name = "gridGroupId", value = "主键")
|
||||
private String gridGroupId;
|
||||
@ApiModelProperty(name = "gridGroupName", value = "名称")
|
||||
private String gridGroupName;
|
||||
@ApiModelProperty(name = "gridGroupCode", value = "编码")
|
||||
private String gridGroupCode;
|
||||
@ApiModelProperty(name = "gridGroupSummary", value = "描述")
|
||||
private String gridGroupSummary;
|
||||
@ApiModelProperty(name = "gridGroupDuty", value = "职责")
|
||||
private String gridGroupDuty;
|
||||
@ApiModelProperty(name = "gmtCreate", value = "创建时间")
|
||||
private String gmtCreate;
|
||||
|
||||
public String getGridGroupId() {
|
||||
return gridGroupId == null ? "" : gridGroupId.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupId(String gridGroupId) {
|
||||
this.gridGroupId = gridGroupId;
|
||||
}
|
||||
|
||||
public String getGridGroupName() {
|
||||
return gridGroupName == null ? "" : gridGroupName.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupName(String gridGroupName) {
|
||||
this.gridGroupName = gridGroupName;
|
||||
}
|
||||
|
||||
public String getGridGroupCode() {
|
||||
return gridGroupCode == null ? "" : gridGroupCode.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupCode(String gridGroupCode) {
|
||||
this.gridGroupCode = gridGroupCode;
|
||||
}
|
||||
|
||||
public String getGridGroupSummary() {
|
||||
return gridGroupSummary == null ? "" : gridGroupSummary.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupSummary(String gridGroupSummary) {
|
||||
this.gridGroupSummary = gridGroupSummary;
|
||||
}
|
||||
|
||||
public String getGridGroupDuty() {
|
||||
return gridGroupDuty == null ? "" : gridGroupDuty.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupDuty(String gridGroupDuty) {
|
||||
this.gridGroupDuty = gridGroupDuty;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package ink.wgink.module.map.pojo.dto.grid;
|
||||
package ink.wgink.module.map.pojo.dtos.grid;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -21,10 +21,10 @@ public class GridPointDTO implements Serializable {
|
||||
private static final long serialVersionUID = -2367199018377785048L;
|
||||
@ApiModelProperty(name = "gridId", value = "网格ID")
|
||||
private String gridId;
|
||||
@ApiModelProperty(name = "lng", value = "经度")
|
||||
private String lng;
|
||||
@ApiModelProperty(name = "lat", value = "纬度")
|
||||
private String lat;
|
||||
@ApiModelProperty(name = "pointLng", value = "点经度")
|
||||
private String pointLng;
|
||||
@ApiModelProperty(name = "pointLat", value = "点纬度")
|
||||
private String pointLat;
|
||||
|
||||
public String getGridId() {
|
||||
return gridId == null ? "" : gridId.trim();
|
||||
@ -34,20 +34,20 @@ public class GridPointDTO implements Serializable {
|
||||
this.gridId = gridId;
|
||||
}
|
||||
|
||||
public String getLng() {
|
||||
return lng == null ? "" : lng.trim();
|
||||
public String getPointLng() {
|
||||
return pointLng == null ? "" : pointLng.trim();
|
||||
}
|
||||
|
||||
public void setLng(String lng) {
|
||||
this.lng = lng;
|
||||
public void setPointLng(String pointLng) {
|
||||
this.pointLng = pointLng;
|
||||
}
|
||||
|
||||
public String getLat() {
|
||||
return lat == null ? "" : lat.trim();
|
||||
public String getPointLat() {
|
||||
return pointLat == null ? "" : pointLat.trim();
|
||||
}
|
||||
|
||||
public void setLat(String lat) {
|
||||
this.lat = lat;
|
||||
public void setPointLat(String pointLat) {
|
||||
this.pointLat = pointLat;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -56,9 +56,9 @@ public class GridPointDTO implements Serializable {
|
||||
sb.append("\"gridId\":\"")
|
||||
.append(gridId).append('\"');
|
||||
sb.append(",\"lng\":\"")
|
||||
.append(lng).append('\"');
|
||||
.append(pointLng).append('\"');
|
||||
sb.append(",\"lat\":\"")
|
||||
.append(lat).append('\"');
|
||||
.append(pointLat).append('\"');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package ink.wgink.module.map.pojo.dto.grid;
|
||||
package ink.wgink.module.map.pojo.dtos.grid;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -23,6 +23,8 @@ public class GridRelationDTO implements Serializable {
|
||||
private String gridId;
|
||||
@ApiModelProperty(name = "relationId", value = "关联ID")
|
||||
private String relationId;
|
||||
@ApiModelProperty(name = "gmtCreate", value = "添加时间")
|
||||
private String gmtCreate;
|
||||
|
||||
public String getGridId() {
|
||||
return gridId == null ? "" : gridId.trim();
|
||||
@ -40,6 +42,14 @@ public class GridRelationDTO implements Serializable {
|
||||
this.relationId = relationId;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
@ -47,6 +57,8 @@ public class GridRelationDTO implements Serializable {
|
||||
.append(gridId).append('\"');
|
||||
sb.append(",\"relationId\":\"")
|
||||
.append(relationId).append('\"');
|
||||
sb.append(",\"gmtCreate\":\"")
|
||||
.append(gmtCreate).append('\"');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package ink.wgink.module.map.pojo.pos.grid;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: GridGroupVO
|
||||
* @Description: 网格组
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/10/19 10:34 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class GridGroupPO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3846496038237663121L;
|
||||
private Long id;
|
||||
private String gridGroupId;
|
||||
private String gridGroupName;
|
||||
private String gridGroupCode;
|
||||
private String gridGroupSummary;
|
||||
private String gridGroupDuty;
|
||||
private String creator;
|
||||
private String gmtCreate;
|
||||
private String modifier;
|
||||
private String gmtModified;
|
||||
private Integer isDelete;
|
||||
|
||||
public Long getId() {
|
||||
return id == null ? 0 : id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getGridGroupId() {
|
||||
return gridGroupId == null ? "" : gridGroupId.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupId(String gridGroupId) {
|
||||
this.gridGroupId = gridGroupId;
|
||||
}
|
||||
|
||||
public String getGridGroupName() {
|
||||
return gridGroupName == null ? "" : gridGroupName.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupName(String gridGroupName) {
|
||||
this.gridGroupName = gridGroupName;
|
||||
}
|
||||
|
||||
public String getGridGroupCode() {
|
||||
return gridGroupCode == null ? "" : gridGroupCode.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupCode(String gridGroupCode) {
|
||||
this.gridGroupCode = gridGroupCode;
|
||||
}
|
||||
|
||||
public String getGridGroupSummary() {
|
||||
return gridGroupSummary == null ? "" : gridGroupSummary.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupSummary(String gridGroupSummary) {
|
||||
this.gridGroupSummary = gridGroupSummary;
|
||||
}
|
||||
|
||||
public String getGridGroupDuty() {
|
||||
return gridGroupDuty == null ? "" : gridGroupDuty.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupDuty(String gridGroupDuty) {
|
||||
this.gridGroupDuty = gridGroupDuty;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator == null ? "" : creator.trim();
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public String getModifier() {
|
||||
return modifier == null ? "" : modifier.trim();
|
||||
}
|
||||
|
||||
public void setModifier(String modifier) {
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public String getGmtModified() {
|
||||
return gmtModified == null ? "" : gmtModified.trim();
|
||||
}
|
||||
|
||||
public void setGmtModified(String gmtModified) {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return isDelete == null ? 0 : isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
}
|
@ -0,0 +1,158 @@
|
||||
package ink.wgink.module.map.pojo.pos.grid;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: GridPO
|
||||
* @Description: 网格
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/10/19 11:33 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class GridPO implements Serializable {
|
||||
private static final long serialVersionUID = -5995673062067526517L;
|
||||
private Long id;
|
||||
private String gridId;
|
||||
private String gridName;
|
||||
private String gridSummary;
|
||||
private String gridGroupId;
|
||||
private String gridDuty;
|
||||
private String gridCode;
|
||||
private Double gridSquare;
|
||||
private String areaCode;
|
||||
private String areaName;
|
||||
private String fillColor;
|
||||
private String creator;
|
||||
private String gmtCreate;
|
||||
private String modifier;
|
||||
private String gmtModified;
|
||||
private Integer isDelete;
|
||||
|
||||
public Long getId() {
|
||||
return id == null ? 0 : id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getGridId() {
|
||||
return gridId == null ? "" : gridId.trim();
|
||||
}
|
||||
|
||||
public void setGridId(String gridId) {
|
||||
this.gridId = gridId;
|
||||
}
|
||||
|
||||
public String getGridName() {
|
||||
return gridName == null ? "" : gridName.trim();
|
||||
}
|
||||
|
||||
public void setGridName(String gridName) {
|
||||
this.gridName = gridName;
|
||||
}
|
||||
|
||||
public String getGridSummary() {
|
||||
return gridSummary == null ? "" : gridSummary.trim();
|
||||
}
|
||||
|
||||
public void setGridSummary(String gridSummary) {
|
||||
this.gridSummary = gridSummary;
|
||||
}
|
||||
|
||||
public String getGridGroupId() {
|
||||
return gridGroupId == null ? "" : gridGroupId.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupId(String gridGroupId) {
|
||||
this.gridGroupId = gridGroupId;
|
||||
}
|
||||
|
||||
public String getGridDuty() {
|
||||
return gridDuty == null ? "" : gridDuty.trim();
|
||||
}
|
||||
|
||||
public void setGridDuty(String gridDuty) {
|
||||
this.gridDuty = gridDuty;
|
||||
}
|
||||
|
||||
public String getGridCode() {
|
||||
return gridCode == null ? "" : gridCode.trim();
|
||||
}
|
||||
|
||||
public void setGridCode(String gridCode) {
|
||||
this.gridCode = gridCode;
|
||||
}
|
||||
|
||||
public Double getGridSquare() {
|
||||
return gridSquare == null ? 0 : gridSquare;
|
||||
}
|
||||
|
||||
public void setGridSquare(Double gridSquare) {
|
||||
this.gridSquare = gridSquare;
|
||||
}
|
||||
|
||||
public String getAreaCode() {
|
||||
return areaCode == null ? "" : areaCode.trim();
|
||||
}
|
||||
|
||||
public void setAreaCode(String areaCode) {
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName == null ? "" : areaName.trim();
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getFillColor() {
|
||||
return fillColor == null ? "" : fillColor.trim();
|
||||
}
|
||||
|
||||
public void setFillColor(String fillColor) {
|
||||
this.fillColor = fillColor;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator == null ? "" : creator.trim();
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public String getModifier() {
|
||||
return modifier == null ? "" : modifier.trim();
|
||||
}
|
||||
|
||||
public void setModifier(String modifier) {
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public String getGmtModified() {
|
||||
return gmtModified == null ? "" : gmtModified.trim();
|
||||
}
|
||||
|
||||
public void setGmtModified(String gmtModified) {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return isDelete == null ? 0 : isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package ink.wgink.module.map.pojo.vos.grid;
|
||||
|
||||
import ink.wgink.annotation.CheckEmptyAnnotation;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @ClassName: GridGroupVO
|
||||
* @Description: 网格组
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/10/19 10:34 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@ApiModel
|
||||
public class GridGroupVO {
|
||||
|
||||
@ApiModelProperty(name = "gridGroupName", value = "名称")
|
||||
@CheckEmptyAnnotation(name = "名称")
|
||||
private String gridGroupName;
|
||||
@ApiModelProperty(name = "gridGroupCode", value = "编码")
|
||||
private String gridGroupCode;
|
||||
@ApiModelProperty(name = "gridGroupSummary", value = "描述")
|
||||
private String gridGroupSummary;
|
||||
@ApiModelProperty(name = "gridGroupDuty", value = "职责")
|
||||
private String gridGroupDuty;
|
||||
|
||||
public String getGridGroupName() {
|
||||
return gridGroupName == null ? "" : gridGroupName.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupName(String gridGroupName) {
|
||||
this.gridGroupName = gridGroupName;
|
||||
}
|
||||
|
||||
public String getGridGroupCode() {
|
||||
return gridGroupCode == null ? "" : gridGroupCode.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupCode(String gridGroupCode) {
|
||||
this.gridGroupCode = gridGroupCode;
|
||||
}
|
||||
|
||||
public String getGridGroupSummary() {
|
||||
return gridGroupSummary == null ? "" : gridGroupSummary.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupSummary(String gridGroupSummary) {
|
||||
this.gridGroupSummary = gridGroupSummary;
|
||||
}
|
||||
|
||||
public String getGridGroupDuty() {
|
||||
return gridGroupDuty == null ? "" : gridGroupDuty.trim();
|
||||
}
|
||||
|
||||
public void setGridGroupDuty(String gridGroupDuty) {
|
||||
this.gridGroupDuty = gridGroupDuty;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package ink.wgink.module.map.pojo.vo.grid;
|
||||
package ink.wgink.module.map.pojo.vos.grid;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -18,10 +18,10 @@ public class GridPointVO {
|
||||
|
||||
@ApiModelProperty(name = "gridId", value = "网格ID")
|
||||
private String gridId;
|
||||
@ApiModelProperty(name = "lng", value = "经度")
|
||||
private String lng;
|
||||
@ApiModelProperty(name = "lat", value = "纬度")
|
||||
private String lat;
|
||||
@ApiModelProperty(name = "pointLng", value = "经度")
|
||||
private String pointLng;
|
||||
@ApiModelProperty(name = "pointLat", value = "纬度")
|
||||
private String pointLat;
|
||||
|
||||
public String getGridId() {
|
||||
return gridId == null ? "" : gridId.trim();
|
||||
@ -31,20 +31,20 @@ public class GridPointVO {
|
||||
this.gridId = gridId;
|
||||
}
|
||||
|
||||
public String getLng() {
|
||||
return lng == null ? "" : lng.trim();
|
||||
public String getPointLng() {
|
||||
return pointLng == null ? "" : pointLng.trim();
|
||||
}
|
||||
|
||||
public void setLng(String lng) {
|
||||
this.lng = lng;
|
||||
public void setPointLng(String pointLng) {
|
||||
this.pointLng = pointLng;
|
||||
}
|
||||
|
||||
public String getLat() {
|
||||
return lat == null ? "" : lat.trim();
|
||||
public String getPointLat() {
|
||||
return pointLat == null ? "" : pointLat.trim();
|
||||
}
|
||||
|
||||
public void setLat(String lat) {
|
||||
this.lat = lat;
|
||||
public void setPointLat(String pointLat) {
|
||||
this.pointLat = pointLat;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,9 +53,9 @@ public class GridPointVO {
|
||||
sb.append("\"gridId\":\"")
|
||||
.append(gridId).append('\"');
|
||||
sb.append(",\"lng\":\"")
|
||||
.append(lng).append('\"');
|
||||
.append(pointLng).append('\"');
|
||||
sb.append(",\"lat\":\"")
|
||||
.append(lat).append('\"');
|
||||
.append(pointLat).append('\"');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package ink.wgink.module.map.pojo.vo.grid;
|
||||
package ink.wgink.module.map.pojo.vos.grid;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
@ -0,0 +1,117 @@
|
||||
package ink.wgink.module.map.service.grid;
|
||||
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridGroupDTO;
|
||||
import ink.wgink.module.map.pojo.pos.grid.GridGroupPO;
|
||||
import ink.wgink.module.map.pojo.vos.grid.GridGroupVO;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: IGridGroupService
|
||||
* @Description: 网格组
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/10/19 10:25 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public interface IGridGroupService {
|
||||
|
||||
/**
|
||||
* 新增网格组
|
||||
*
|
||||
* @param gridGroupVO
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(GridGroupVO gridGroupVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 新增网格组
|
||||
*
|
||||
* @param gridGroupVO
|
||||
* @return 网格组ID
|
||||
* @throws Exception
|
||||
*/
|
||||
String saveAndReturnId(GridGroupVO gridGroupVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除网格组
|
||||
*
|
||||
* @param asList
|
||||
*/
|
||||
void remove(List<String> ids);
|
||||
|
||||
/**
|
||||
* 修改网格组
|
||||
*
|
||||
* @param gridGroupId
|
||||
* @param gridGroupVO
|
||||
* @throws Exception
|
||||
*/
|
||||
void update(String gridGroupId, GridGroupVO gridGroupVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 网格组详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
GridGroupDTO get(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 网格组详情
|
||||
*
|
||||
* @param gridGroupId 网格组ID
|
||||
* @return
|
||||
*/
|
||||
GridGroupDTO get(String gridGroupId);
|
||||
|
||||
/**
|
||||
* 网格组详情
|
||||
*
|
||||
* @param gridGroupCode
|
||||
* @return
|
||||
*/
|
||||
GridGroupDTO getByCode(String gridGroupCode);
|
||||
|
||||
/**
|
||||
* 网格组详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
GridGroupPO getPO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 网格组详情
|
||||
*
|
||||
* @param gridGroupId
|
||||
* @return
|
||||
*/
|
||||
GridGroupPO getPO(String gridGroupId);
|
||||
|
||||
/**
|
||||
* 网格组详情
|
||||
*
|
||||
* @param gridGroupCode
|
||||
* @return
|
||||
*/
|
||||
GridGroupPO getPOByCode(String gridGroupCode);
|
||||
|
||||
/**
|
||||
* 网格组列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<GridGroupDTO> list(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 网格组分页列表
|
||||
*
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<GridGroupDTO>> listPage(ListPage page);
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
package ink.wgink.module.map.service.grid;
|
||||
|
||||
import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.module.map.pojo.dto.grid.GridPointDTO;
|
||||
import ink.wgink.module.map.pojo.vo.grid.GridPointVO;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridPointDTO;
|
||||
import ink.wgink.module.map.pojo.vos.grid.GridPointVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ink.wgink.module.map.service.grid;
|
||||
|
||||
import ink.wgink.module.map.pojo.dto.grid.GridRelationDTO;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridRelationDTO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -1,8 +1,9 @@
|
||||
package ink.wgink.module.map.service.grid;
|
||||
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.module.map.pojo.dto.grid.GridDTO;
|
||||
import ink.wgink.module.map.pojo.vo.grid.GridVO;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridDTO;
|
||||
import ink.wgink.module.map.pojo.pos.grid.GridPO;
|
||||
import ink.wgink.module.map.pojo.vos.grid.GridVO;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
|
||||
@ -39,6 +40,12 @@ public interface IGridService {
|
||||
*/
|
||||
String saveAndReturnId(GridVO gridVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除网格
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
void remove(List<String> ids);
|
||||
|
||||
/**
|
||||
* 删除网格
|
||||
@ -70,6 +77,38 @@ public interface IGridService {
|
||||
*/
|
||||
void update(String gridId, GridVO gridVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 网格详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
GridDTO get(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 网格详情
|
||||
*
|
||||
* @param gridId
|
||||
* @return
|
||||
*/
|
||||
GridDTO get(String gridId);
|
||||
|
||||
/**
|
||||
* 网格详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
GridPO gridPO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 网格详情
|
||||
*
|
||||
* @param gridId
|
||||
* @return
|
||||
*/
|
||||
GridPO gridPO(String gridId);
|
||||
|
||||
/**
|
||||
* 网格列表
|
||||
*
|
||||
@ -119,5 +158,11 @@ public interface IGridService {
|
||||
*/
|
||||
SuccessResultList<List<GridDTO>> listPageByRelationIds(ListPage page, List<String> relationIds);
|
||||
|
||||
|
||||
/**
|
||||
* 网格列表
|
||||
*
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<GridDTO>> listPage(ListPage page);
|
||||
}
|
||||
|
@ -0,0 +1,123 @@
|
||||
package ink.wgink.module.map.service.grid.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.module.map.dao.grid.IGridGroupDao;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridGroupDTO;
|
||||
import ink.wgink.module.map.pojo.pos.grid.GridGroupPO;
|
||||
import ink.wgink.module.map.pojo.vos.grid.GridGroupVO;
|
||||
import ink.wgink.module.map.service.grid.IGridGroupService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: GridGroupServiceImpl
|
||||
* @Description: 网格组业务
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/10/19 10:25 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Service
|
||||
public class GridGroupServiceImpl extends DefaultBaseService implements IGridGroupService {
|
||||
|
||||
@Autowired
|
||||
private IGridGroupDao gridGroupDao;
|
||||
|
||||
@Override
|
||||
public void save(GridGroupVO gridGroupVO) throws Exception {
|
||||
saveAndReturnId(gridGroupVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveAndReturnId(GridGroupVO gridGroupVO) throws Exception {
|
||||
GridGroupPO gridGroupPO = getPOByCode(gridGroupVO.getGridGroupCode());
|
||||
if (gridGroupPO != null) {
|
||||
throw new SearchException("网格组编码存在");
|
||||
}
|
||||
String gridGroupId = UUIDUtil.getUUID();
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(gridGroupVO);
|
||||
params.put("gridGroupId", gridGroupId);
|
||||
setSaveInfo(params);
|
||||
gridGroupDao.save(params);
|
||||
return gridGroupId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(List<String> ids) {
|
||||
if (ids.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("gridGroupIds", ids);
|
||||
setUpdateInfo(params);
|
||||
gridGroupDao.remove(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(String gridGroupId, GridGroupVO gridGroupVO) throws Exception {
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(gridGroupVO);
|
||||
params.put("gridGroupId", gridGroupId);
|
||||
setUpdateInfo(params);
|
||||
gridGroupDao.update(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridGroupDTO get(Map<String, Object> params) {
|
||||
return gridGroupDao.get(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridGroupDTO get(String gridGroupId) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("gridGroupId", gridGroupId);
|
||||
return get(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridGroupDTO getByCode(String gridGroupCode) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("gridGroupCode", gridGroupCode);
|
||||
return get(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridGroupPO getPO(Map<String, Object> params) {
|
||||
return gridGroupDao.getPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridGroupPO getPO(String gridGroupId) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("gridGroupId", gridGroupId);
|
||||
return getPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridGroupPO getPOByCode(String gridGroupCode) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("gridGroupCode", gridGroupCode);
|
||||
return getPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GridGroupDTO> list(Map<String, Object> params) {
|
||||
return gridGroupDao.list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<GridGroupDTO>> listPage(ListPage page) {
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
List<GridGroupDTO> gridGroupDTOs = list(page.getParams());
|
||||
PageInfo<GridGroupDTO> pageInfo = new PageInfo<>(gridGroupDTOs);
|
||||
return new SuccessResultList<>(gridGroupDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
}
|
@ -3,8 +3,8 @@ package ink.wgink.module.map.service.grid.impl;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.module.map.dao.grid.IGridPointDao;
|
||||
import ink.wgink.module.map.pojo.dto.grid.GridPointDTO;
|
||||
import ink.wgink.module.map.pojo.vo.grid.GridPointVO;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridPointDTO;
|
||||
import ink.wgink.module.map.pojo.vos.grid.GridPointVO;
|
||||
import ink.wgink.module.map.service.grid.IGridPointService;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -35,8 +35,8 @@ public class GridPointServiceImpl extends DefaultBaseService implements IGridPoi
|
||||
Map<String, Object> params = getHashMap(4);
|
||||
params.put("gridId", gridId);
|
||||
for (GridPointVO gridPointVO : pointArray) {
|
||||
params.put("lng", gridPointVO.getLng());
|
||||
params.put("lat", gridPointVO.getLat());
|
||||
params.put("lng", gridPointVO.getPointLng());
|
||||
params.put("lat", gridPointVO.getPointLat());
|
||||
gridPointDao.save(params);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package ink.wgink.module.map.service.grid.impl;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.module.map.dao.grid.IGridRelationDao;
|
||||
import ink.wgink.module.map.pojo.dto.grid.GridRelationDTO;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridRelationDTO;
|
||||
import ink.wgink.module.map.service.grid.IGridRelationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -5,11 +5,12 @@ import com.github.pagehelper.PageInfo;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.module.map.dao.grid.IGridDao;
|
||||
import ink.wgink.module.map.pojo.dto.grid.GridDTO;
|
||||
import ink.wgink.module.map.pojo.dto.grid.GridPointDTO;
|
||||
import ink.wgink.module.map.pojo.dto.grid.GridRelationDTO;
|
||||
import ink.wgink.module.map.pojo.vo.grid.GridPointVO;
|
||||
import ink.wgink.module.map.pojo.vo.grid.GridVO;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridDTO;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridPointDTO;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridRelationDTO;
|
||||
import ink.wgink.module.map.pojo.pos.grid.GridPO;
|
||||
import ink.wgink.module.map.pojo.vos.grid.GridPointVO;
|
||||
import ink.wgink.module.map.pojo.vos.grid.GridVO;
|
||||
import ink.wgink.module.map.service.grid.IGridPointService;
|
||||
import ink.wgink.module.map.service.grid.IGridRelationService;
|
||||
import ink.wgink.module.map.service.grid.IGridService;
|
||||
@ -67,6 +68,14 @@ public class GridServiceImpl extends DefaultBaseService implements IGridService
|
||||
return gridId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(List<String> ids) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("gridIds", ids);
|
||||
setUpdateInfo(params);
|
||||
gridDao.remove(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByRelationId(String relationId) {
|
||||
List<String> gridIds = gridRelationService.listGridId(relationId);
|
||||
@ -130,6 +139,30 @@ public class GridServiceImpl extends DefaultBaseService implements IGridService
|
||||
gridDao.update(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridDTO get(Map<String, Object> params) {
|
||||
return gridDao.get(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridDTO get(String gridId) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("gridId", gridId);
|
||||
return get(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridPO gridPO(Map<String, Object> params) {
|
||||
return gridDao.getPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridPO gridPO(String gridId) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("gridId", gridId);
|
||||
return gridPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GridDTO> list(Map<String, Object> params) {
|
||||
List<GridDTO> gridDTOs = gridDao.list(params);
|
||||
@ -230,6 +263,14 @@ public class GridServiceImpl extends DefaultBaseService implements IGridService
|
||||
return new SuccessResultList<>(gridDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<GridDTO>> listPage(ListPage page) {
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
List<GridDTO> gridDTOs = gridDao.list(page.getParams());
|
||||
PageInfo<GridDTO> pageInfo = new PageInfo<>(gridDTOs);
|
||||
return new SuccessResultList<>(gridDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置网格点
|
||||
|
@ -0,0 +1,199 @@
|
||||
<?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="ink.wgink.module.map.dao.grid.IGridGroupDao">
|
||||
|
||||
<cache/>
|
||||
|
||||
<resultMap id="gridGroupDTO" type="ink.wgink.module.map.pojo.dtos.grid.GridGroupDTO">
|
||||
<id column="grid_group_id" property="gridGroupId"/>
|
||||
<result column="grid_group_name" property="gridGroupName"/>
|
||||
<result column="grid_group_code" property="gridGroupCode"/>
|
||||
<result column="grid_group_summary" property="gridGroupSummary"/>
|
||||
<result column="grid_group_duty" property="gridGroupDuty"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="gridGroupPO" type="ink.wgink.module.map.pojo.pos.grid.GridGroupPO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="grid_group_id" property="gridGroupId"/>
|
||||
<result column="grid_group_name" property="gridGroupName"/>
|
||||
<result column="grid_group_code" property="gridGroupCode"/>
|
||||
<result column="grid_group_summary" property="gridGroupSummary"/>
|
||||
<result column="grid_group_duty" property="gridGroupDuty"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="modifier" property="modifier"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 建表 -->
|
||||
<update id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `map_grid_group` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`grid_group_id` char(36) DEFAULT NULL COMMENT '主键',
|
||||
`grid_group_name` varchar(255) DEFAULT NULL COMMENT '名称',
|
||||
`grid_group_code` varchar(255) DEFAULT NULL COMMENT '编码',
|
||||
`grid_group_summary` varchar(255) DEFAULT NULL COMMENT '描述',
|
||||
`grid_group_duty` varchar(255) DEFAULT NULL COMMENT '网格组责任',
|
||||
`creator` char(36) DEFAULT NULL COMMENT '创建人',
|
||||
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`modifier` char(36) DEFAULT NULL COMMENT '修改人',
|
||||
`gmt_modified` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`is_delete` int(1) DEFAULT '0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `grid_type_id` (`grid_group_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='网格组';
|
||||
</update>
|
||||
|
||||
<!-- 新增网格组 -->
|
||||
<insert id="save" parameterType="map" flushCache="true">
|
||||
INSERT INTO map_grid_group(
|
||||
grid_group_id,
|
||||
grid_group_name,
|
||||
grid_group_code,
|
||||
grid_group_summary,
|
||||
grid_group_duty,
|
||||
creator,
|
||||
gmt_create,
|
||||
modifier,
|
||||
gmt_modified,
|
||||
is_delete
|
||||
) VALUES(
|
||||
#{gridGroupId},
|
||||
#{gridGroupName},
|
||||
#{gridGroupCode},
|
||||
#{gridGroupSummary},
|
||||
#{gridGroupDuty},
|
||||
#{creator},
|
||||
#{gmtCreate},
|
||||
#{modifier},
|
||||
#{gmtModified},
|
||||
#{isDelete}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除网格组 -->
|
||||
<update id="remove" parameterType="map" flushCache="true">
|
||||
UPDATE
|
||||
map_grid_group
|
||||
SET
|
||||
is_delete = 1,
|
||||
modifier = #{modifier},
|
||||
gmt_modified = #{gmtModified}
|
||||
WHERE
|
||||
grid_group_id = #{gridGroupId}
|
||||
</update>
|
||||
|
||||
<!-- 修改网格组 -->
|
||||
<update id="update" parameterType="map" flushCache="true">
|
||||
UPDATE
|
||||
map_grid_group
|
||||
SET
|
||||
<if test="gridGroupName != null and gridGroupName != ''">
|
||||
grid_group_name = #{gridGroupName},
|
||||
</if>
|
||||
<if test="gridGroupSummary != null">
|
||||
grid_group_summary = #{gridGroupSummary},
|
||||
</if>
|
||||
<if test="gridGroupDuty != null">
|
||||
grid_group_duty = #{gridGroupDuty},
|
||||
</if>
|
||||
gmt_modified = #{gmtModified},
|
||||
modifier = #{modifier}
|
||||
WHERE
|
||||
grid_group_id = #{gridGroupId}
|
||||
</update>
|
||||
|
||||
<!-- 网格详情 -->
|
||||
<select id="get" parameterType="map" resultMap="gridGroupDTO" useCache="true">
|
||||
SELECT
|
||||
grid_group_id,
|
||||
grid_group_name,
|
||||
grid_group_code,
|
||||
grid_group_summary,
|
||||
grid_group_duty,
|
||||
LEFT(gmt_create, 19) gmt_create
|
||||
FROM
|
||||
map_grid_group
|
||||
WHERE
|
||||
is_delete = 0
|
||||
<if test="gridGroupId != null and gridGroupId != ''">
|
||||
AND
|
||||
grid_group_id = #{gridGroupId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 网格详情 -->
|
||||
<select id="getPO" parameterType="map" resultMap="gridGroupPO" useCache="true">
|
||||
SELECT
|
||||
id,
|
||||
grid_group_id,
|
||||
grid_group_name,
|
||||
grid_group_code,
|
||||
grid_group_summary,
|
||||
grid_group_duty,
|
||||
creator,
|
||||
gmt_create,
|
||||
modifier,
|
||||
gmt_modified,
|
||||
is_delete
|
||||
FROM
|
||||
map_grid_group
|
||||
WHERE
|
||||
is_delete = 0
|
||||
<if test="gridGroupId != null and gridGroupId != ''">
|
||||
AND
|
||||
grid_group_id = #{gridGroupId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 网格组列表 -->
|
||||
<select id="list" parameterType="map" resultMap="gridGroupDTO">
|
||||
SELECT
|
||||
grid_group_id,
|
||||
grid_group_name,
|
||||
grid_group_code,
|
||||
grid_group_summary,
|
||||
grid_group_duty,
|
||||
LEFT(gmt_create, 19) gmt_create
|
||||
FROM
|
||||
map_grid_group
|
||||
WHERE
|
||||
is_delete = 0
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
grid_group_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 网格组列表 -->
|
||||
<select id="listPO" parameterType="map" resultMap="gridGroupPO">
|
||||
SELECT
|
||||
id,
|
||||
grid_group_id,
|
||||
grid_group_name,
|
||||
grid_group_code,
|
||||
grid_group_summary,
|
||||
grid_group_duty,
|
||||
creator,
|
||||
gmt_create,
|
||||
modifier,
|
||||
gmt_modified,
|
||||
is_delete
|
||||
FROM
|
||||
map_grid_group
|
||||
WHERE
|
||||
is_delete = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -4,28 +4,63 @@
|
||||
|
||||
<cache/>
|
||||
|
||||
<resultMap id="gridDTO" type="ink.wgink.module.map.pojo.dto.grid.GridDTO">
|
||||
<resultMap id="gridDTO" type="ink.wgink.module.map.pojo.dtos.grid.GridDTO">
|
||||
<id column="grid_id" property="gridId"/>
|
||||
<result column="grid_id" property="gridId"/>
|
||||
<result column="grid_name" property="gridName"/>
|
||||
<result column="grid_summary" property="gridSummary"/>
|
||||
<result column="grid_group_id" property="gridGroupId"/>
|
||||
<result column="grid_duty" property="gridDuty"/>
|
||||
<result column="grid_code" property="gridCode"/>
|
||||
<result column="grid_square" property="gridSquare"/>
|
||||
<result column="area_code" property="areaCode"/>
|
||||
<result column="area_name" property="areaName"/>
|
||||
<result column="fill_color" property="fillColor"/>
|
||||
<result column="relation_id" property="relationId"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="gridPO" type="ink.wgink.module.map.pojo.pos.grid.GridPO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="grid_id" property="gridId"/>
|
||||
<result column="grid_name" property="gridName"/>
|
||||
<result column="grid_summary" property="gridSummary"/>
|
||||
<result column="grid_group_id" property="gridGroupId"/>
|
||||
<result column="grid_duty" property="gridDuty"/>
|
||||
<result column="grid_code" property="gridCode"/>
|
||||
<result column="grid_square" property="gridSquare"/>
|
||||
<result column="area_code" property="areaCode"/>
|
||||
<result column="area_name" property="areaName"/>
|
||||
<result column="fill_color" property="fillColor"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="modifier" property="modifier"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 建表 -->
|
||||
<update id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `map_grid` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`grid_id` char(36) NOT NULL,
|
||||
`grid_name` varchar(255) NOT NULL,
|
||||
`fill_color` varchar(7) NOT NULL DEFAULT '#000000' COMMENT '颜色',
|
||||
`gmt_create` datetime DEFAULT NULL,
|
||||
`creator` char(36) DEFAULT NULL,
|
||||
`gmt_modified` datetime DEFAULT NULL,
|
||||
`modifier` char(36) DEFAULT NULL,
|
||||
`is_delete` int(1) DEFAULT '0',
|
||||
`id` bigint(36) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`grid_id` char(36) DEFAULT NULL COMMENT '主键',
|
||||
`grid_name` varchar(255) DEFAULT NULL COMMENT '网格名称',
|
||||
`grid_summary` varchar(255) DEFAULT NULL COMMENT '网格描述',
|
||||
`grid_group_id` char(36) DEFAULT NULL COMMENT '网格组ID',
|
||||
`grid_duty` varchar(255) DEFAULT NULL COMMENT '网格责任',
|
||||
`grid_code` varchar(255) DEFAULT NULL COMMENT '网格编码',
|
||||
`grid_square` double(11,2) DEFAULT NULL COMMENT '网格面积',
|
||||
`area_code` varchar(255) DEFAULT NULL COMMENT '区域编码',
|
||||
`area_name` varchar(255) DEFAULT NULL COMMENT '区域名称',
|
||||
`fill_color` varchar(7) DEFAULT NULL COMMENT '填充颜色',
|
||||
`creator` char(36) DEFAULT NULL COMMENT '创建人',
|
||||
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`modifier` char(36) DEFAULT NULL COMMENT '修改人',
|
||||
`gmt_modified` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`is_delete` int(1) DEFAULT '0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `grid_id` (`grid_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='网格';
|
||||
UNIQUE KEY `grid_id` (`grid_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='网格表';
|
||||
</update>
|
||||
|
||||
<!-- 保存网格 -->
|
||||
@ -33,6 +68,13 @@
|
||||
INSERT INTO map_grid(
|
||||
grid_id,
|
||||
grid_name,
|
||||
grid_summary,
|
||||
grid_group_id,
|
||||
grid_duty,
|
||||
grid_code,
|
||||
grid_square,
|
||||
area_code,
|
||||
area_name,
|
||||
fill_color,
|
||||
gmt_create,
|
||||
creator,
|
||||
@ -42,6 +84,13 @@
|
||||
) VALUES(
|
||||
#{gridId},
|
||||
#{gridName},
|
||||
#{gridSummary},
|
||||
#{gridGroupId},
|
||||
#{gridDuty},
|
||||
#{gridCode},
|
||||
#{gridSquare},
|
||||
#{areaCode},
|
||||
#{areaName},
|
||||
#{fillColor},
|
||||
#{gmtCreate},
|
||||
#{creator},
|
||||
@ -51,6 +100,18 @@
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除网格 -->
|
||||
<update id="remove" parameterType="map" flushCache="true">
|
||||
UPDATE
|
||||
map_grid
|
||||
SET
|
||||
is_delete = 1,
|
||||
modifier = #{modifier},
|
||||
gmt_modified = #{gmtModified}
|
||||
WHERE
|
||||
grid_id = #{gridId}
|
||||
</update>
|
||||
|
||||
<!-- 删除网格 -->
|
||||
<delete id="delete" parameterType="map" flushCache="true">
|
||||
DELETE FROM
|
||||
@ -84,12 +145,70 @@
|
||||
grid_id = #{gridId}
|
||||
</delete>
|
||||
|
||||
<!-- 网格详情 -->
|
||||
<select id="get" parameterType="map" resultMap="gridDTO" useCache="true">
|
||||
SELECT
|
||||
t1.grid_id,
|
||||
t1.grid_name,
|
||||
t1.grid_summary,
|
||||
t1.grid_group_id,
|
||||
t1.grid_duty,
|
||||
t1.grid_code,
|
||||
t1.grid_square,
|
||||
t1.area_code,
|
||||
t1.area_name,
|
||||
t1.fill_color
|
||||
FROM
|
||||
map_grid t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="gridId != null and gridId != ''">
|
||||
AND
|
||||
t1.grid_id = #{gridId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 网格详情 -->
|
||||
<select id="getPO" parameterType="map" resultMap="gridPO" useCache="true">
|
||||
SELECT
|
||||
grid_id,
|
||||
grid_name,
|
||||
grid_summary,
|
||||
grid_group_id,
|
||||
grid_duty,
|
||||
grid_code,
|
||||
grid_square,
|
||||
area_code,
|
||||
area_name,
|
||||
fill_color,
|
||||
gmt_create,
|
||||
creator,
|
||||
gmt_modified,
|
||||
modifier,
|
||||
is_delete
|
||||
FROM
|
||||
map_grid
|
||||
WHERE
|
||||
is_delete = 0
|
||||
<if test="gridId != null and gridId != ''">
|
||||
AND
|
||||
grid_id = #{gridId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 网格列表 -->
|
||||
<select id="list" parameterType="map" resultMap="gridDTO" useCache="true">
|
||||
SELECT
|
||||
t1.grid_id,
|
||||
t1.fill_color,
|
||||
t1.grid_name
|
||||
t1.grid_name,
|
||||
t1.grid_summary,
|
||||
t1.grid_group_id,
|
||||
t1.grid_duty,
|
||||
t1.grid_code,
|
||||
t1.grid_square,
|
||||
t1.area_code,
|
||||
t1.area_name,
|
||||
t1.fill_color
|
||||
FROM
|
||||
map_grid t1
|
||||
WHERE
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
<cache/>
|
||||
|
||||
<resultMap id="gridPointDTO" type="ink.wgink.module.map.pojo.dto.grid.GridPointDTO">
|
||||
<resultMap id="gridPointDTO" type="ink.wgink.module.map.pojo.dtos.grid.GridPointDTO">
|
||||
<id column="grid_id" property="gridId"/>
|
||||
<result column="lng" property="lng"/>
|
||||
<result column="lat" property="lat"/>
|
||||
@ -14,11 +14,10 @@
|
||||
<update id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `map_grid_point` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`grid_id` char(36) NOT NULL,
|
||||
`lng` varchar(255) DEFAULT NULL COMMENT '点经度',
|
||||
`lat` varchar(255) DEFAULT NULL COMMENT '点纬度',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `grid_id` (`grid_id`)
|
||||
`grid_id` char(36) DEFAULT NULL COMMENT '网格ID',
|
||||
`point_lng` varchar(255) DEFAULT NULL COMMENT '点经度',
|
||||
`point_lat` varchar(255) DEFAULT NULL COMMENT '点维度',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='网格点';
|
||||
</update>
|
||||
|
||||
@ -26,12 +25,12 @@
|
||||
<insert id="save" parameterType="map" flushCache="true">
|
||||
INSERT INTO map_grid_point(
|
||||
grid_id,
|
||||
lng,
|
||||
lat
|
||||
point_lng,
|
||||
point_lat
|
||||
) VALUES(
|
||||
#{gridId},
|
||||
#{lng},
|
||||
#{lat}
|
||||
#{pointLng},
|
||||
#{pointLat}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@ -55,8 +54,8 @@
|
||||
<select id="list" parameterType="map" resultMap="gridPointDTO" useCache="true">
|
||||
SELECT
|
||||
grid_id,
|
||||
lng,
|
||||
lat
|
||||
point_lng,
|
||||
point_lat
|
||||
FROM
|
||||
map_grid_point
|
||||
<where>
|
||||
|
@ -4,31 +4,33 @@
|
||||
|
||||
<cache/>
|
||||
|
||||
<resultMap id="gridRelationDTO" type="ink.wgink.module.map.pojo.dto.grid.GridRelationDTO">
|
||||
<resultMap id="gridRelationDTO" type="ink.wgink.module.map.pojo.dtos.grid.GridRelationDTO">
|
||||
<id column="relation_id" property="relationId"/>
|
||||
<result column="grid_id" property="gridId"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 建表 -->
|
||||
<update id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `map_grid_relation` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`relation_id` char(36) NOT NULL COMMENT '关联ID',
|
||||
`grid_id` char(36) NOT NULL COMMENT '网格ID',
|
||||
PRIMARY KEY (`id`,`relation_id`),
|
||||
KEY `relation_id` (`relation_id`) USING BTREE,
|
||||
KEY `grid_id` (`grid_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='网格与关联';
|
||||
`grid_id` char(36) DEFAULT NULL COMMENT '网格ID',
|
||||
`relation_id` char(36) DEFAULT NULL COMMENT '关联ID',
|
||||
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='网格关联表';
|
||||
</update>
|
||||
|
||||
<!-- 保存网格关联关系 -->
|
||||
<insert id="save" parameterType="map" flushCache="true">
|
||||
INSERT INTO map_grid_relation(
|
||||
grid_id,
|
||||
relation_id
|
||||
relation_id,
|
||||
gmt_create
|
||||
) VALUES(
|
||||
#{gridId},
|
||||
#{relationId}
|
||||
#{gmtCreate}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@ -58,6 +60,7 @@
|
||||
<select id="list" parameterType="map" resultMap="gridRelationDTO" useCache="true">
|
||||
SELECT
|
||||
relation_id,
|
||||
LEFT(gmt_create, 19) gmt_create
|
||||
grid_id
|
||||
FROM
|
||||
map_grid_relation
|
||||
|
@ -0,0 +1,258 @@
|
||||
<!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">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item search-item-width-100" placeholder="输入关键字">
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
<!-- 表头按钮组 -->
|
||||
<script type="text/html" id="headerToolBar">
|
||||
<div class="layui-btn-group">
|
||||
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
|
||||
<i class="fa fa-lg fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="updateEvent">
|
||||
<i class="fa fa-lg fa-edit"></i> 编辑
|
||||
</button>
|
||||
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="removeEvent">
|
||||
<i class="fa fa-lg fa-trash"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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 laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/grid-group/listpage';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
toolbar: '#headerToolBar',
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'gridGroupName', width: 180, title: '名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gridGroupCode', width: 180, title: '编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gridGroupSummary', width: 180, title: '描述', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gridGroupDuty', width: 180, title: '网格组责任', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gmtCreate', width: 180, title: '创建时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
// 删除
|
||||
function removeData(ids) {
|
||||
top.dialog.msg(top.dataMessage.delete, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function (index) {
|
||||
top.dialog.close(index);
|
||||
var layIndex;
|
||||
top.restAjax.delete(top.restAjax.path('api/grid-group/remove/{ids}', [ids]), {}, null, function (code, data) {
|
||||
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
|
||||
reloadTable();
|
||||
}, function (code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function () {
|
||||
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function () {
|
||||
top.dialog.close(layIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
// 事件 - 增删改
|
||||
table.on('toolbar(dataTable)', function(obj) {
|
||||
var layEvent = obj.event;
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
var checkDatas = checkStatus.data;
|
||||
if(layEvent === 'saveEvent') {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/grid-group/save', []),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(layEvent === 'updateEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/grid-group/update?gridGroupId={gridGroupId}', [checkDatas[0].gridGroupId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(layEvent === 'removeEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectDelete);
|
||||
} else {
|
||||
var ids = '';
|
||||
for(var i = 0, item; item = checkDatas[i++];) {
|
||||
if(i > 1) {
|
||||
ids += '_';
|
||||
}
|
||||
ids += item['gridGroupId'];
|
||||
}
|
||||
removeData(ids);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,119 @@
|
||||
<!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">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
||||
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
|
||||
<a href="javascript:void(0);"><cite>新增内容</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="gridGroupName" name="gridGroupName" class="layui-input" value="" placeholder="请输入名称" maxlength="255" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">编码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="gridGroupCode" name="gridGroupCode" class="layui-input" value="" placeholder="请输入编码" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">描述</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="gridGroupSummary" name="gridGroupSummary" class="layui-input" value="" placeholder="请输入描述" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">网格组责任</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="gridGroupDuty" name="gridGroupDuty" class="layui-input" value="" placeholder="请输入网格组责任" maxlength="255">
|
||||
</div>
|
||||
</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" lay-submit lay-filter="submitForm">提交新增</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
// 初始化内容
|
||||
function initData() {}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.post(top.restAjax.path('api/grid-group/save', []), 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],
|
||||
shade: 0.3,
|
||||
yes: function(index) {
|
||||
top.dialog.close(index);
|
||||
window.location.reload();
|
||||
},
|
||||
btn2: function() {
|
||||
closeBox();
|
||||
}
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,130 @@
|
||||
<!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">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
||||
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
|
||||
<a href="javascript:void(0);"><cite>编辑内容</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="gridGroupName" name="gridGroupName" class="layui-input" value="" placeholder="请输入名称" maxlength="255" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">描述</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="gridGroupSummary" name="gridGroupSummary" class="layui-input" value="" placeholder="请输入描述" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">网格组责任</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="gridGroupDuty" name="gridGroupDuty" class="layui-input" value="" placeholder="请输入网格组责任" maxlength="255">
|
||||
</div>
|
||||
</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" lay-submit lay-filter="submitForm">提交编辑</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var gridGroupId = top.restAjax.params(window.location.href).gridGroupId;
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/grid-group/get/{gridGroupId}', [gridGroupId]), {}, null, function(code, data) {
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
dataFormData[i] = data[i] +'';
|
||||
}
|
||||
form.val('dataForm', dataFormData);
|
||||
form.render(null, 'dataForm');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.put(top.restAjax.path('api/grid-group/update/{gridGroupId}', [gridGroupId]), 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],
|
||||
shade: 0.3,
|
||||
yes: function(index) {
|
||||
top.dialog.close(index);
|
||||
window.location.reload();
|
||||
},
|
||||
btn2: function() {
|
||||
closeBox();
|
||||
}
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user