洪城义警-正式版后台
tangzy
2022-01-07 b29a50e596cd6b214e31b70bf5dad848ee25a250
1.轨迹
1 files modified
8 files added
457 ■■■■■ changed files
src/main/java/org/springblade/common/config/BladeConfiguration.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/trar/controller/TrarController.java 138 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/trar/dto/TrarDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/trar/entity/Trar.java 83 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/trar/mapper/TrarMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/trar/mapper/TrarMapper.xml 30 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/trar/service/ITrarService.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/trar/service/impl/TrarServiceImpl.java 48 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/trar/vo/TrarVO.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -104,6 +104,7 @@
        secureRegistry.excludePathPatterns("/taskqd/**");
        secureRegistry.excludePathPatterns("/taskfk/**");
        secureRegistry.excludePathPatterns("/sensitiveword/**");
        secureRegistry.excludePathPatterns("/trar/**");
        return secureRegistry;
    }
src/main/java/org/springblade/modules/trar/controller/TrarController.java
New file
@@ -0,0 +1,138 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.trar.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.trar.entity.Trar;
import org.springblade.modules.trar.service.ITrarService;
import org.springblade.modules.trar.vo.TrarVO;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
 * 控制器
 * 轨迹记录
 *
 * @author BladeX
 * @since 2022-01-06
 */
@RestController
@AllArgsConstructor
@RequestMapping("/trar")
@Api(value = "", tags = "接口")
public class TrarController extends BladeController {
    private final ITrarService trarService;
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入trar")
    public R<Trar> detail(Trar trar) {
        Trar detail = trarService.getOne(Condition.getQueryWrapper(trar));
        return R.data(detail);
    }
    /**
     * 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入trar")
    public R<IPage<Trar>> list(Trar trar, Query query) {
        IPage<Trar> pages = trarService.page(Condition.getPage(query), Condition.getQueryWrapper(trar));
        return R.data(pages);
    }
    /**
     * 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入trar")
    public R<IPage<TrarVO>> page(TrarVO trar, Query query) {
        IPage<TrarVO> pages = trarService.selectTrarPage(Condition.getPage(query), trar);
        return R.data(pages);
    }
    /**
     * 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入trar")
    public R save(@Valid @RequestBody Trar trar) {
        return R.status(trarService.save(trar));
    }
    /**
     * 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入trar")
    public R update(@Valid @RequestBody Trar trar) {
        return R.status(trarService.updateById(trar));
    }
    /**
     * 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入trar")
    public R submit(@Valid @RequestBody Trar trar) {
        return R.status(trarService.saveOrUpdate(trar));
    }
    /**
     * 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(trarService.removeByIds(Func.toLongList(ids)));
    }
    /**
     * 轨迹路线查询
     * @param rid
     * @param uid
     * @return
     */
    @PostMapping("/selectList")
    public R selectList(String rid,String uid) {
        return R.data(trarService.selectList(rid,uid));
    }
}
src/main/java/org/springblade/modules/trar/dto/TrarDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.trar.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.trar.entity.Trar;
/**
 * 数据传输对象实体类
 *
 * @author BladeX
 * @since 2022-01-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class TrarDTO extends Trar {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/trar/entity/Trar.java
New file
@@ -0,0 +1,83 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.trar.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
 * 实体类
 *
 * @author BladeX
 * @since 2022-01-06
 */
@Data
@TableName("sys_trar")
@ApiModel(value = "Trar对象", description = "Trar对象")
public class Trar implements Serializable {
    private static final long serialVersionUID = 1L;
    private Integer id;
    /**
     * 任务id
     */
    @ApiModelProperty(value = "任务id")
    private String rid;
    /**
     * 人员id
     */
    @ApiModelProperty(value = "人员id")
    private String uid;
    /**
     * 开始时间
     */
    @ApiModelProperty(value = "开始时间")
    @TableField("startTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date starttime;
    /**
     * 结束时间
     */
    @ApiModelProperty(value = "结束时间")
    @TableField("endTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endtime;
    /**
     * 经度
     */
    @ApiModelProperty(value = "经度")
    private String jd;
    /**
     * 纬度
     */
    @ApiModelProperty(value = "纬度")
    private String wd;
}
src/main/java/org/springblade/modules/trar/mapper/TrarMapper.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.trar.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.trar.entity.Trar;
import org.springblade.modules.trar.vo.TrarVO;
import java.util.List;
/**
 *  Mapper 接口
 *
 * @author BladeX
 * @since 2022-01-06
 */
public interface TrarMapper extends BaseMapper<Trar> {
    /**
     * 自定义分页
     *
     * @param page
     * @param trar
     * @return
     */
    List<TrarVO> selectTrarPage(IPage page, TrarVO trar);
    List selectList(String rid, String uid);
}
src/main/java/org/springblade/modules/trar/mapper/TrarMapper.xml
New file
@@ -0,0 +1,30 @@
<?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="org.springblade.modules.trar.mapper.TrarMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="trarResultMap" type="org.springblade.modules.trar.entity.Trar">
        <id column="id" property="id"/>
        <result column="rid" property="rid"/>
        <result column="uid" property="uid"/>
        <result column="startTime" property="starttime"/>
        <result column="endTime" property="endtime"/>
        <result column="jd" property="jd"/>
        <result column="wd" property="wd"/>
    </resultMap>
    <select id="selectTrarPage" resultMap="trarResultMap">
        select *
        from sys_trar
        where is_deleted = 0
    </select>
    <select id="selectList" resultType="java.util.HashMap">
        select jd, wd
        from sys_trar
        where rid = #{rid}
          and uid = #{uid}
    </select>
</mapper>
src/main/java/org/springblade/modules/trar/service/ITrarService.java
New file
@@ -0,0 +1,44 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.trar.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.trar.entity.Trar;
import org.springblade.modules.trar.vo.TrarVO;
import java.util.List;
/**
 * 服务类
 *
 * @author BladeX
 * @since 2022-01-06
 */
public interface ITrarService extends IService<Trar> {
    /**
     * 自定义分页
     *
     * @param page
     * @param trar
     * @return
     */
    IPage<TrarVO> selectTrarPage(IPage<TrarVO> page, TrarVO trar);
    List selectList(String rid, String uid);
}
src/main/java/org/springblade/modules/trar/service/impl/TrarServiceImpl.java
New file
@@ -0,0 +1,48 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.trar.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.trar.entity.Trar;
import org.springblade.modules.trar.mapper.TrarMapper;
import org.springblade.modules.trar.service.ITrarService;
import org.springblade.modules.trar.vo.TrarVO;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 *  服务实现类
 *
 * @author BladeX
 * @since 2022-01-06
 */
@Service
public class TrarServiceImpl extends ServiceImpl<TrarMapper, Trar> implements ITrarService {
    @Override
    public IPage<TrarVO> selectTrarPage(IPage<TrarVO> page, TrarVO trar) {
        return page.setRecords(baseMapper.selectTrarPage(page, trar));
    }
    @Override
    public List selectList(String rid, String uid) {
        return baseMapper.selectList(rid,uid);
    }
}
src/main/java/org/springblade/modules/trar/vo/TrarVO.java
New file
@@ -0,0 +1,36 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.trar.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.trar.entity.Trar;
/**
 * 视图实体类
 *
 * @author BladeX
 * @since 2022-01-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "TrarVO对象", description = "TrarVO对象")
public class TrarVO extends Trar {
    private static final long serialVersionUID = 1L;
}