zhangbin 4 yıl önce
ebeveyn
işleme
db1d985338

+ 116 - 0
hzgzpt-admin/src/main/java/com/miaxis/app/controller/area/AreaCodeController.java

@@ -0,0 +1,116 @@
+package com.miaxis.app.controller.area;
+
+import com.miaxis.common.constant.Constants;
+import java.util.List;
+import io.swagger.annotations.*;
+import com.miaxis.common.core.domain.Response;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.app.area.domain.AreaCode;
+import com.miaxis.app.area.service.IAreaCodeService;
+import com.miaxis.common.utils.poi.ExcelUtil;
+import com.miaxis.common.core.page.ResponsePageInfo;
+
+/**
+ * 【区域编码】Controller
+ *
+ * @author zhangbin
+ * @date 2020-12-28
+ */
+@RestController
+@RequestMapping("/area/code")
+@Api(tags={"【app-区域编码】"})
+public class AreaCodeController extends BaseController{
+    @Autowired
+    private IAreaCodeService areaCodeService;
+
+    /**
+     * 查询区域编码列表
+     */
+    //@PreAuthorize("@ss.hasPermi('area:code:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询区域编码列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<AreaCode> list(@ModelAttribute AreaCode areaCode){
+        startPage();
+        List<AreaCode> list = areaCodeService.selectAreaCodeList(areaCode);
+        return toResponsePageInfo(list);
+    }
+
+    /**
+     * 导出区域编码列表
+     */
+   // @PreAuthorize("@ss.hasPermi('area:code:export')")
+    @Log(title = "区域编码", businessType = BusinessTypeEnum.EXPORT)
+    @GetMapping("/export")
+    @ApiOperation("导出区域编码列表Excel")
+    public Response<String> export(@ModelAttribute AreaCode areaCode){
+        List<AreaCode> list = areaCodeService.selectAreaCodeList(areaCode);
+        ExcelUtil<AreaCode> util = new ExcelUtil<AreaCode>(AreaCode.class);
+        return util.exportExcel(list, "code");
+    }
+
+    /**
+     * 获取区域编码详细信息
+     */
+    //@PreAuthorize("@ss.hasPermi('area:code:query')")
+    @GetMapping(value = "/{code}")
+    @ApiOperation("获取区域编码详细信息")
+    public Response<AreaCode> getInfo(
+            @ApiParam(name = "code", value = "区域编码参数", required = true)
+            @PathVariable("code") String code
+    ){
+        return Response.success(areaCodeService.selectAreaCodeById(code));
+    }
+
+    /**
+     * 新增区域编码
+     */
+    //@PreAuthorize("@ss.hasPermi('area:code:add')")
+    @Log(title = "区域编码", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增区域编码")
+    public Response<Integer> add(@RequestBody AreaCode areaCode){
+        return toResponse(areaCodeService.insertAreaCode(areaCode));
+    }
+
+    /**
+     * 修改区域编码
+     */
+    //@PreAuthorize("@ss.hasPermi('area:code:edit')")
+    @Log(title = "区域编码", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改区域编码")
+    public Response<Integer> edit(@RequestBody AreaCode areaCode){
+        return toResponse(areaCodeService.updateAreaCode(areaCode));
+    }
+
+    /**
+     * 删除区域编码
+     */
+    //@PreAuthorize("@ss.hasPermi('area:code:remove')")
+    @Log(title = "区域编码", businessType = BusinessTypeEnum.DELETE)
+	@DeleteMapping("/{codes}")
+    @ApiOperation("删除区域编码")
+    public  Response<Integer> remove(
+            @ApiParam(name = "codes", value = "区域编码ids参数", required = true)
+            @PathVariable String[] codes
+    ){
+        return toResponse(areaCodeService.deleteAreaCodeByIds(codes));
+    }
+}

+ 2 - 1
hzgzpt-admin/src/main/java/com/miaxis/app/controller/school/SchoolInfoController.java

@@ -7,6 +7,7 @@ import com.miaxis.app.school.dto.SchoolInfoEvalVO;
 import com.miaxis.app.school.dto.SchoolInfoVO;
 import com.miaxis.app.school.service.ISchoolInfoService;
 import com.miaxis.common.annotation.Log;
+import com.miaxis.common.constant.Constants;
 import com.miaxis.common.core.controller.BaseController;
 import com.miaxis.common.core.domain.Response;
 import com.miaxis.common.core.page.ResponsePageInfo;
@@ -25,7 +26,7 @@ import java.util.List;
  * @date 2020-12-24
  */
 @RestController
-@RequestMapping("/school/info")
+@RequestMapping(Constants.OPEN_PREFIX+"/school/info")
 @Api(tags={"【app-驾校】"})
 public class SchoolInfoController extends BaseController{
     @Autowired

+ 103 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/area/domain/AreaCode.java

@@ -0,0 +1,103 @@
+package com.miaxis.app.area.domain;
+
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+/**
+ * 区域编码对象 area_code
+ *
+ * @author zhangbin
+ * @date 2020-12-28
+ */
+@Data
+@TableName("area_code")
+@ApiModel(value = "AreaCode", description = "区域编码对象 area_code")
+public class AreaCode extends BaseBusinessEntity {
+    private static final long serialVersionUID = 1L;
+
+    /** 区域编码 */
+    @Excel(name = "区域编码")
+    @TableField("code")
+    @ApiModelProperty(value = "区域编码")
+    private String code;
+
+    /** 区域名称 */
+    @Excel(name = "区域名称")
+    @TableField("name")
+    @ApiModelProperty(value = "区域名称")
+    private String name;
+
+    /** 类型 */
+    @Excel(name = "类型")
+    @TableField("type")
+    @ApiModelProperty(value = "类型")
+    private String type;
+
+    /** $column.columnComment */
+    @Excel(name = "类型")
+    @TableField("leaf")
+    @ApiModelProperty(value = "$column.columnComment")
+    private String leaf;
+
+    /** 父编码 */
+    @Excel(name = "父编码")
+    @TableField("parent_code")
+    @ApiModelProperty(value = "父编码")
+    private String parentCode;
+
+    public void setCode(String code){
+        this.code = code;
+    }
+
+    public String getCode(){
+        return code;
+    }
+    public void setName(String name){
+        this.name = name;
+    }
+
+    public String getName(){
+        return name;
+    }
+    public void setType(String type){
+        this.type = type;
+    }
+
+    public String getType(){
+        return type;
+    }
+    public void setLeaf(String leaf){
+        this.leaf = leaf;
+    }
+
+    public String getLeaf(){
+        return leaf;
+    }
+    public void setParentCode(String parentCode){
+        this.parentCode = parentCode;
+    }
+
+    public String getParentCode(){
+        return parentCode;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("code", getCode())
+            .append("name", getName())
+            .append("type", getType())
+            .append("leaf", getLeaf())
+            .append("parentCode", getParentCode())
+            .toString();
+    }
+}

+ 61 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/area/mapper/AreaCodeMapper.java

@@ -0,0 +1,61 @@
+package com.miaxis.app.area.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.app.area.domain.AreaCode;
+
+/**
+ * 区域编码Mapper接口
+ *
+ * @author zhangbin
+ * @date 2020-12-28
+ */
+public interface AreaCodeMapper extends BaseMapper<AreaCode> {
+    /**
+     * 查询区域编码
+     *
+     * @param code 区域编码ID
+     * @return 区域编码
+     */
+    public AreaCode selectAreaCodeById(String code);
+
+    /**
+     * 查询区域编码列表
+     *
+     * @param areaCode 区域编码
+     * @return 区域编码集合
+     */
+    public List<AreaCode> selectAreaCodeList(AreaCode areaCode);
+
+    /**
+     * 新增区域编码
+     *
+     * @param areaCode 区域编码
+     * @return 结果
+     */
+    public int insertAreaCode(AreaCode areaCode);
+
+    /**
+     * 修改区域编码
+     *
+     * @param areaCode 区域编码
+     * @return 结果
+     */
+    public int updateAreaCode(AreaCode areaCode);
+
+    /**
+     * 删除区域编码
+     *
+     * @param code 区域编码ID
+     * @return 结果
+     */
+    public int deleteAreaCodeById(String code);
+
+    /**
+     * 批量删除区域编码
+     *
+     * @param codes 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteAreaCodeByIds(String[] codes);
+}

+ 61 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/area/service/IAreaCodeService.java

@@ -0,0 +1,61 @@
+package com.miaxis.app.area.service;
+
+import java.util.List;
+import com.miaxis.app.area.domain.AreaCode;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 区域编码Service接口
+ * 
+ * @author zhangbin
+ * @date 2020-12-28
+ */
+public interface IAreaCodeService extends IService<AreaCode>{
+    /**
+     * 查询区域编码
+     * 
+     * @param code 区域编码ID
+     * @return 区域编码
+     */
+    public AreaCode selectAreaCodeById(String code);
+
+    /**
+     * 查询区域编码列表
+     * 
+     * @param areaCode 区域编码
+     * @return 区域编码集合
+     */
+    public List<AreaCode> selectAreaCodeList(AreaCode areaCode);
+
+    /**
+     * 新增区域编码
+     * 
+     * @param areaCode 区域编码
+     * @return 结果
+     */
+    public int insertAreaCode(AreaCode areaCode);
+
+    /**
+     * 修改区域编码
+     * 
+     * @param areaCode 区域编码
+     * @return 结果
+     */
+    public int updateAreaCode(AreaCode areaCode);
+
+    /**
+     * 批量删除区域编码
+     * 
+     * @param codes 需要删除的区域编码ID
+     * @return 结果
+     */
+    public int deleteAreaCodeByIds(String[] codes);
+
+    /**
+     * 删除区域编码信息
+     * 
+     * @param code 区域编码ID
+     * @return 结果
+     */
+    public int deleteAreaCodeById(String code);
+}

+ 87 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/area/service/impl/AreaCodeServiceImpl.java

@@ -0,0 +1,87 @@
+package com.miaxis.app.area.service.impl;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.miaxis.app.area.mapper.AreaCodeMapper;
+import com.miaxis.app.area.domain.AreaCode;
+import com.miaxis.app.area.service.IAreaCodeService;
+
+/**
+ * 区域编码Service业务层处理
+ *
+ * @author zhangbin
+ * @date 2020-12-28
+ */
+@Service
+public class AreaCodeServiceImpl extends ServiceImpl<AreaCodeMapper, AreaCode> implements IAreaCodeService {
+    @Autowired
+    private AreaCodeMapper areaCodeMapper;
+
+    /**
+     * 查询区域编码
+     *
+     * @param code 区域编码ID
+     * @return 区域编码
+     */
+    @Override
+    public AreaCode selectAreaCodeById(String code){
+        return areaCodeMapper.selectAreaCodeById(code);
+    }
+
+    /**
+     * 查询区域编码列表
+     *
+     * @param areaCode 区域编码
+     * @return 区域编码
+     */
+    @Override
+    public List<AreaCode> selectAreaCodeList(AreaCode areaCode){
+        return areaCodeMapper.selectAreaCodeList(areaCode);
+    }
+
+    /**
+     * 新增区域编码
+     *
+     * @param areaCode 区域编码
+     * @return 结果
+     */
+    @Override
+    public int insertAreaCode(AreaCode areaCode){
+        return areaCodeMapper.insertAreaCode(areaCode);
+    }
+
+    /**
+     * 修改区域编码
+     *
+     * @param areaCode 区域编码
+     * @return 结果
+     */
+    @Override
+    public int updateAreaCode(AreaCode areaCode){
+        return areaCodeMapper.updateAreaCode(areaCode);
+    }
+
+    /**
+     * 批量删除区域编码
+     *
+     * @param codes 需要删除的区域编码ID
+     * @return 结果
+     */
+    @Override
+    public int deleteAreaCodeByIds(String[] codes){
+        return areaCodeMapper.deleteAreaCodeByIds(codes);
+    }
+
+    /**
+     * 删除区域编码信息
+     *
+     * @param code 区域编码ID
+     * @return 结果
+     */
+    @Override
+    public int deleteAreaCodeById(String code){
+        return areaCodeMapper.deleteAreaCodeById(code);
+    }
+}

+ 16 - 7
hzgzpt-service-app/src/main/java/com/miaxis/app/school/dto/SchoolRegionVO.java

@@ -64,19 +64,28 @@ public class SchoolRegionVO extends BaseBusinessEntity {
     @ApiModelProperty(value = "已投放车辆数")
     private Long curvehnum;
 
+    /** 创建时间 */
+    @ApiModelProperty(value = "创建时间")
+    private Date  createTime;
 
-    /** lon经度 */
-    @ApiModelProperty(value = "已投放车辆数")
-    private Double lon;
-
-    /** lat纬度 */
-    @ApiModelProperty(value = "已投放车辆数")
-    private Double  lat;
+    /** 创建时间 */
+    @ApiModelProperty(value = "创建时间")
+    private Date  updateTime;
 
+    /** 创建时间 */
+    @ApiModelProperty(value = "经度")
+    private Double  lon;
 
+    /** 创建时间 */
+    @ApiModelProperty(value = "纬度")
+    private Double  lat;
 
     /** 图片url */
     @ApiModelProperty(value = "图片url")
     private String url;
 
+    /** 当前距离 */
+    @ApiModelProperty(value = "当前距离")
+    private String distance;
+
 }

+ 75 - 0
hzgzpt-service-app/src/main/resources/mapper/area/AreaCodeMapper.xml

@@ -0,0 +1,75 @@
+<?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="com.miaxis.app.area.mapper.AreaCodeMapper">
+    
+    <resultMap type="AreaCode" id="AreaCodeResult">
+        <result property="code"    column="code"    />
+        <result property="name"    column="name"    />
+        <result property="type"    column="type"    />
+        <result property="leaf"    column="leaf"    />
+        <result property="parentCode"    column="parent_code"    />
+    </resultMap>
+
+    <sql id="selectAreaCodeVo">
+        select code, name, type, leaf, parent_code from area_code
+    </sql>
+
+    <select id="selectAreaCodeList" parameterType="AreaCode" resultMap="AreaCodeResult">
+        <include refid="selectAreaCodeVo"/>
+        <where>  
+            <if test="code != null  and code != ''"> and code = #{code}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="leaf != null  and leaf != ''"> and leaf = #{leaf}</if>
+            <if test="parentCode != null  and parentCode != ''"> and parent_code = #{parentCode}</if>
+        </where>
+    </select>
+    
+    <select id="selectAreaCodeById" parameterType="String" resultMap="AreaCodeResult">
+        <include refid="selectAreaCodeVo"/>
+        where code = #{code}
+    </select>
+        
+    <insert id="insertAreaCode" parameterType="AreaCode">
+        insert into area_code
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="code != null and code != ''">code,</if>
+            <if test="name != null">name,</if>
+            <if test="type != null">type,</if>
+            <if test="leaf != null">leaf,</if>
+            <if test="parentCode != null">parent_code,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="code != null and code != ''">#{code},</if>
+            <if test="name != null">#{name},</if>
+            <if test="type != null">#{type},</if>
+            <if test="leaf != null">#{leaf},</if>
+            <if test="parentCode != null">#{parentCode},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAreaCode" parameterType="AreaCode">
+        update area_code
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null">name = #{name},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="leaf != null">leaf = #{leaf},</if>
+            <if test="parentCode != null">parent_code = #{parentCode},</if>
+        </trim>
+        where code = #{code}
+    </update>
+
+    <delete id="deleteAreaCodeById" parameterType="String">
+        delete from area_code where code = #{code}
+    </delete>
+
+    <delete id="deleteAreaCodeByIds" parameterType="String">
+        delete from area_code where code in 
+        <foreach item="code" collection="array" open="(" separator="," close=")">
+            #{code}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 2 - 2
hzgzpt-service-app/src/main/resources/mapper/school/SchoolRegionMapper.xml

@@ -26,9 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <select id="selectSchoolRegionUrlList" parameterType="com.miaxis.app.school.dto.SchoolRegionDTO" resultType="com.miaxis.app.school.dto.SchoolRegionVO">
-        SELECT sr.id,sr.NAME region_name,s.NAME school_name,sr.address,
+        SELECT sr.id,sr.NAME region_name,s.NAME school_name,sr.address,sr.create_time,sr.update_time,sr.poi_lon lon,sr.poi_lat lat,
         sr.area,sr.type,sr.vehicletype,sr.totalvehnum,sr.curvehnum,sr.poi_lon,sr.poi_lat,sri.url,
-        (2 * 6378.137 * ASIN(SQRT(POW( SIN( PI( ) * ( 120.211162- s.poi_lon ) / 360 ), 2 ) + COS( PI( ) * 30.186584 / 180 ) * COS( sr.poi_lat * PI( ) / 180 ) * POW( SIN( PI( ) * ( 30.186584- s.poi_lat ) / 360 ), 2 )) ) ) AS distance
+        (2 * 6378.137 * ASIN(SQRT(POW( SIN( PI( ) * ( #{lon}- s.poi_lon ) / 360 ), 2 ) + COS( PI( ) * 30.186584 / 180 ) * COS( #{lat} * PI( ) / 180 ) * POW( SIN( PI( ) * ( #{lat}- s.poi_lat ) / 360 ), 2 )) ) ) AS distance
         FROM school_region sr
         left JOIN school_info s ON sr.inscode = s.inscode
         left join school_region_images sri on sr.id = sri. region_id