| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanorama.controller; |
| | | |
| | | import cn.gistack.sm.skPanoramaState.entity.SkPanoramaStateEntity; |
| | | import cn.gistack.sm.skPanoramaState.service.ISkPanoramaStateService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.secure.BladeUser; |
| | | 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.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.gistack.sm.skPanorama.entity.SkPanoramaEntity; |
| | | import cn.gistack.sm.skPanorama.vo.SkPanoramaVO; |
| | | import cn.gistack.sm.skPanorama.wrapper.SkPanoramaWrapper; |
| | | import cn.gistack.sm.skPanorama.service.ISkPanoramaService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 水库全景图 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | //@RestController |
| | | //@AllArgsConstructor |
| | | //@RequestMapping("/skPanorama") |
| | | //@Api(value = "水库全景图", tags = "水库全景图接口") |
| | | |
| | | @Slf4j |
| | | @Api(tags="全景") |
| | | @RestController |
| | | @RequestMapping("/skPanorama") |
| | | @AllArgsConstructor |
| | | public class SkPanoramaController extends BladeController { |
| | | |
| | | private final ISkPanoramaService skPanoramaService; |
| | | |
| | | private final ISkPanoramaStateService skPanoramaStateService; |
| | | |
| | | /** |
| | | * 水库全景图 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "详情", notes = "传入skPanorama") |
| | | public R<SkPanoramaVO> detail(SkPanoramaEntity skPanorama) { |
| | | SkPanoramaEntity detail = skPanoramaService.getOne(Condition.getQueryWrapper(skPanorama)); |
| | | return R.data(SkPanoramaWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * 水库全景图 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "分页", notes = "传入skPanorama") |
| | | public R<IPage<SkPanoramaVO>> list(SkPanoramaEntity skPanorama, Query query) { |
| | | IPage<SkPanoramaEntity> pages = skPanoramaService.page(Condition.getPage(query), Condition.getQueryWrapper(skPanorama)); |
| | | return R.data(SkPanoramaWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 水库全景图 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "传入skPanorama") |
| | | public R<IPage<SkPanoramaVO>> page(SkPanoramaVO skPanorama, Query query) { |
| | | IPage<SkPanoramaVO> pages = skPanoramaService.selectSkPanoramaPage(Condition.getPage(query), skPanorama); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 水库全景图 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "新增", notes = "传入skPanorama") |
| | | public R save(@Valid @RequestBody SkPanoramaEntity skPanorama) { |
| | | return R.status(skPanoramaService.save(skPanorama)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存全景图的测站数据 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/saveList") |
| | | @ApiOperation(value = "新增", notes = "传入skPanoramaState") |
| | | public R saveList(@Valid @RequestBody SkPanoramaEntity skPanorama) { |
| | | List<SkPanoramaStateEntity> stateLsit = skPanorama.getStateLsit(); |
| | | List<SkPanoramaStateEntity> updateList = new ArrayList<>(); |
| | | List<SkPanoramaStateEntity> addList = new ArrayList<>(); |
| | | if (stateLsit != null && stateLsit.size()>0) { |
| | | // for (SkPanoramaStateEntity item :stateLsit) { |
| | | // Long id = item.getId(); |
| | | // if (id != null) { |
| | | // // 更新 |
| | | // updateList.add(item); |
| | | // } else { |
| | | // // 新增 |
| | | // addList.add(item); |
| | | // } |
| | | // } |
| | | // boolean b = true; |
| | | // if (addList != null) { |
| | | // b = skPanoramaStateService.saveBatch(addList); |
| | | // } |
| | | // if (updateList != null) { |
| | | // b = skPanoramaStateService.saveOrUpdateBatch(updateList); |
| | | // } |
| | | boolean b =skPanoramaStateService.saveOrUpdateBatch(stateLsit); |
| | | |
| | | return R.status(b); |
| | | } |
| | | return R.status(false); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 水库全景图 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperation(value = "修改", notes = "传入skPanorama") |
| | | public R update(@Valid @RequestBody SkPanoramaEntity skPanorama) { |
| | | return R.status(skPanoramaService.updateById(skPanorama)); |
| | | } |
| | | |
| | | /** |
| | | * 水库全景图 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperation(value = "新增或修改", notes = "传入skPanorama") |
| | | public R submit(@Valid @RequestBody SkPanoramaEntity skPanorama) { |
| | | return R.status(skPanoramaService.saveOrUpdate(skPanorama)); |
| | | } |
| | | |
| | | /** |
| | | * 水库全景图 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(skPanoramaService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据水库id获取水库全景图片级水库测站 |
| | | */ |
| | | @GetMapping("/getskAllInfo") |
| | | public R getSkPanoramaAllInfo(@RequestParam("resGuid")String resGuid) { |
| | | SkPanoramaEntity skPanoramaEntity = new SkPanoramaEntity(); |
| | | skPanoramaEntity.setResGuid(resGuid); |
| | | List<SkPanoramaEntity> list = skPanoramaService.findList(skPanoramaEntity); |
| | | return R.data(list); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanorama.entity; |
| | | |
| | | import cn.gistack.sm.skPanoramaState.entity.SkPanoramaStateEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 水库全景图 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | @Data |
| | | @TableName("sk_panorama") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "SkPanorama对象", description = "水库全景图") |
| | | public class SkPanoramaEntity extends BaseEntity { |
| | | |
| | | /** |
| | | * 水库id |
| | | */ |
| | | @ApiModelProperty(value = "水库编码") |
| | | private String resGuid; |
| | | @ApiModelProperty(value = "水库名称") |
| | | private String resGuname; |
| | | |
| | | /** |
| | | * 序号 |
| | | */ |
| | | @ApiModelProperty(value = "序号") |
| | | private Integer sort; |
| | | /** |
| | | * 全景名称 |
| | | */ |
| | | @ApiModelProperty(value = "全景名称") |
| | | private String name; |
| | | /** |
| | | * 全景图片上传地址 |
| | | */ |
| | | @ApiModelProperty(value = "全景图片上传地址") |
| | | private String picUrl; |
| | | @ApiModelProperty(value = "全景缩略图片上传地址") |
| | | private String smallPicUrl; |
| | | @ApiModelProperty(value = "全景图片名称") |
| | | private String picName; |
| | | /** |
| | | * 全景图片上传地址 |
| | | */ |
| | | @ApiModelProperty(value = "全景模型地址") |
| | | private String modelUrl; |
| | | |
| | | /** |
| | | * 拍摄时间 |
| | | */ |
| | | @ApiModelProperty(value = "拍摄时间") |
| | | private Date shootingTime; |
| | | /** |
| | | * 全景图拍摄角度 |
| | | */ |
| | | @ApiModelProperty(value = "全景图拍摄角度") |
| | | private String shootingAngle; |
| | | /** |
| | | * 拍摄单位 |
| | | */ |
| | | @ApiModelProperty(value = "拍摄单位") |
| | | private String shootingDept; |
| | | |
| | | @TableField(exist = false) |
| | | private List<SkPanoramaStateEntity> stateLsit; |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanorama.mapper; |
| | | |
| | | import cn.gistack.sm.skPanorama.entity.SkPanoramaEntity; |
| | | import cn.gistack.sm.skPanorama.vo.SkPanoramaVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 水库全景图 Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | public interface SkPanoramaMapper extends BaseMapper<SkPanoramaEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param skPanorama |
| | | * @return |
| | | */ |
| | | List<SkPanoramaVO> selectSkPanoramaPage(IPage page, SkPanoramaVO skPanorama); |
| | | |
| | | List<SkPanoramaEntity> findList(@Param("param") SkPanoramaEntity skPanorama); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.skPanorama.mapper.SkPanoramaMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="skPanoramaResultMap" type="cn.gistack.sm.skPanorama.entity.SkPanoramaEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="res_guid" property="resGuid"/> |
| | | <result column="sort" property="sort"/> |
| | | <result column="name" property="name"/> |
| | | <result column="pic_url" property="picUrl"/> |
| | | <result column="shooting_time" property="shootingTime"/> |
| | | <result column="shooting_angle" property="shootingAngle"/> |
| | | <result column="shooting_dept" property="shootingDept"/> |
| | | <result column="status" property="status"/> |
| | | <result column="create_dept" property="createDept"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="tenant_id" property="tenantId"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectSkPanoramaPage" resultMap="skPanoramaResultMap"> |
| | | select * from sk_panorama where is_deleted = 0 |
| | | </select> |
| | | |
| | | <resultMap id="skResultMap" type="cn.gistack.sm.skPanorama.entity.SkPanoramaEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="res_guid" property="resGuid"/> |
| | | <result column="res_guname" property="resGuname"/> |
| | | <result column="sort" property="sort"/> |
| | | <result column="name" property="name"/> |
| | | <result column="pic_url" property="picUrl"/> |
| | | <result column="small_pic_url" property="smallPicUrl"/> |
| | | <result column="shooting_time" property="shootingTime"/> |
| | | <result column="shooting_angle" property="shootingAngle"/> |
| | | <result column="shooting_dept" property="shootingDept"/> |
| | | <collection property="stateLsit" ofType="cn.gistack.sm.skPanoramaState.entity.SkPanoramaStateEntity"> |
| | | <result column="sps_id" property="id"/> |
| | | <result column="sk_panorama_id" property="skPanoramaId"/> |
| | | <result column="station_id" property="stationId"/> |
| | | <result column="sps_res_guid" property="resGuid"/> |
| | | <result column="STATE_NAME" property="stateName"/> |
| | | <result column="STATE_TYPE" property="stateType"/> |
| | | <result column="longitude" property="longitude"/> |
| | | <result column="latitude" property="latitude"/> |
| | | <result column="yaw" property="yaw"/> |
| | | <result column="pitch" property="pitch"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <select id="findList" resultMap="skResultMap"> |
| | | select |
| | | SP.id , |
| | | SP.res_guid , |
| | | SP.res_guname , |
| | | SP.sort , |
| | | SP.name , |
| | | SP.pic_url , |
| | | SP.small_pic_url , |
| | | SP.shooting_time , |
| | | SP.shooting_angle , |
| | | SP.shooting_dept , |
| | | |
| | | SPS.id AS "sps_id", |
| | | SPS.sk_panorama_id , |
| | | SPS.station_id , |
| | | SPS.res_guid AS "sps_res_guid", |
| | | SPS.STATE_NAME , |
| | | SPS.STATE_TYPE , |
| | | SPS.longitude , |
| | | SPS.latitude, |
| | | SPS.yaw, |
| | | SPS.pitch |
| | | from |
| | | SK_PANORAMA SP |
| | | left join SK_PANORAMA_STATE SPS ON SP.ID = SPS.SK_PANORAMA_ID |
| | | <where> |
| | | SP.IS_DELETED = 0 |
| | | <if test="param.resGuid != null and param.resGuid != ''"> |
| | | AND SP.RES_GUID = #{param.resGuid} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanorama.service; |
| | | |
| | | import cn.gistack.sm.skPanorama.entity.SkPanoramaEntity; |
| | | import cn.gistack.sm.skPanorama.vo.SkPanoramaVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 水库全景图 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | public interface ISkPanoramaService extends BaseService<SkPanoramaEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param skPanorama |
| | | * @return |
| | | */ |
| | | IPage<SkPanoramaVO> selectSkPanoramaPage(IPage<SkPanoramaVO> page, SkPanoramaVO skPanorama); |
| | | |
| | | List<SkPanoramaEntity> findList(SkPanoramaEntity skPanorama); |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanorama.service.impl; |
| | | |
| | | import cn.gistack.sm.skPanorama.entity.SkPanoramaEntity; |
| | | import cn.gistack.sm.skPanorama.vo.SkPanoramaVO; |
| | | import cn.gistack.sm.skPanorama.mapper.SkPanoramaMapper; |
| | | import cn.gistack.sm.skPanorama.service.ISkPanoramaService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 水库全景图 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | @Service |
| | | public class SkPanoramaServiceImpl extends BaseServiceImpl<SkPanoramaMapper, SkPanoramaEntity> implements ISkPanoramaService { |
| | | |
| | | @Override |
| | | public IPage<SkPanoramaVO> selectSkPanoramaPage(IPage<SkPanoramaVO> page, SkPanoramaVO skPanorama) { |
| | | return page.setRecords(baseMapper.selectSkPanoramaPage(page, skPanorama)); |
| | | } |
| | | |
| | | @Override |
| | | public List<SkPanoramaEntity> findList(SkPanoramaEntity skPanorama) { |
| | | return baseMapper.findList(skPanorama); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanorama.vo; |
| | | |
| | | import cn.gistack.sm.skPanorama.entity.SkPanoramaEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 水库全景图 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | @Data |
| | | public class SkPanoramaVO extends SkPanoramaEntity { |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanorama.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import cn.gistack.sm.skPanorama.entity.SkPanoramaEntity; |
| | | import cn.gistack.sm.skPanorama.vo.SkPanoramaVO; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 水库全景图 包装类,返回视图层所需的字段 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | public class SkPanoramaWrapper extends BaseEntityWrapper<SkPanoramaEntity, SkPanoramaVO> { |
| | | |
| | | public static SkPanoramaWrapper build() { |
| | | return new SkPanoramaWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public SkPanoramaVO entityVO(SkPanoramaEntity skPanorama) { |
| | | SkPanoramaVO skPanoramaVO = Objects.requireNonNull(BeanUtil.copy(skPanorama, SkPanoramaVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(skPanorama.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(skPanorama.getUpdateUser()); |
| | | //skPanoramaVO.setCreateUserName(createUser.getName()); |
| | | //skPanoramaVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return skPanoramaVO; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanoramaState.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.gistack.sm.skPanoramaState.entity.SkPanoramaStateEntity; |
| | | import cn.gistack.sm.skPanoramaState.vo.SkPanoramaStateVO; |
| | | import cn.gistack.sm.skPanoramaState.wrapper.SkPanoramaStateWrapper; |
| | | import cn.gistack.sm.skPanoramaState.service.ISkPanoramaStateService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | | * 水库全景测站 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Api(value = "水库全景测站", tags = "水库全景测站接口") |
| | | @RestController |
| | | @RequestMapping("/skPanoramaState") |
| | | @AllArgsConstructor |
| | | public class SkPanoramaStateController extends BladeController { |
| | | |
| | | private ISkPanoramaStateService skPanoramaStateService; |
| | | |
| | | /** |
| | | * 水库全景测站 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "详情", notes = "传入skPanoramaState") |
| | | public R<SkPanoramaStateVO> detail(SkPanoramaStateEntity skPanoramaState) { |
| | | SkPanoramaStateEntity detail = skPanoramaStateService.getOne(Condition.getQueryWrapper(skPanoramaState)); |
| | | return R.data(SkPanoramaStateWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * 水库全景测站 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "分页", notes = "传入skPanoramaState") |
| | | public R<IPage<SkPanoramaStateVO>> list(SkPanoramaStateEntity skPanoramaState, Query query) { |
| | | IPage<SkPanoramaStateEntity> pages = skPanoramaStateService.page(Condition.getPage(query), Condition.getQueryWrapper(skPanoramaState)); |
| | | return R.data(SkPanoramaStateWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 水库全景测站 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "传入skPanoramaState") |
| | | public R<IPage<SkPanoramaStateVO>> page(SkPanoramaStateVO skPanoramaState, Query query) { |
| | | IPage<SkPanoramaStateVO> pages = skPanoramaStateService.selectSkPanoramaStatePage(Condition.getPage(query), skPanoramaState); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 水库全景测站 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "新增", notes = "传入skPanoramaState") |
| | | public R save(@Valid @RequestBody SkPanoramaStateEntity skPanoramaState) { |
| | | return R.status(skPanoramaStateService.save(skPanoramaState)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 水库全景测站 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperation(value = "修改", notes = "传入skPanoramaState") |
| | | public R update(@Valid SkPanoramaStateEntity skPanoramaState) { |
| | | return R.status(skPanoramaStateService.updateById(skPanoramaState)); |
| | | } |
| | | |
| | | /** |
| | | * 水库全景测站 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperation(value = "新增或修改", notes = "传入skPanoramaState") |
| | | public R submit(@Valid @RequestBody SkPanoramaStateEntity skPanoramaState) { |
| | | return R.status(skPanoramaStateService.saveOrUpdate(skPanoramaState)); |
| | | } |
| | | |
| | | /** |
| | | * 水库全景测站 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(skPanoramaStateService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanoramaState.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | /** |
| | | * 水库全景测站 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | @Data |
| | | @TableName("sk_panorama_state") |
| | | @ApiModel(value = "SkPanoramaState对象", description = "水库全景测站") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class SkPanoramaStateEntity extends BaseEntity { |
| | | |
| | | /** |
| | | * 全景图id |
| | | */ |
| | | @ApiModelProperty(value = "全景图id") |
| | | private Long skPanoramaId; |
| | | /** |
| | | * 关联测站 |
| | | */ |
| | | @ApiModelProperty(value = "关联测站") |
| | | private String stationId; |
| | | /** |
| | | * 水库id |
| | | */ |
| | | @ApiModelProperty(value = "水库id") |
| | | private String resGuid; |
| | | /** |
| | | * 测站名称 |
| | | */ |
| | | @ApiModelProperty(value = "测站名称") |
| | | private String stateName; |
| | | /** |
| | | * 测站类型 |
| | | */ |
| | | @ApiModelProperty(value = "测站类型") |
| | | private String stateType; |
| | | /** |
| | | * 测站经度,国家2000坐标系 |
| | | */ |
| | | @ApiModelProperty(value = "测站经度,国家2000坐标系") |
| | | private Double longitude; |
| | | /** |
| | | * 测站纬度,国家2000坐标系 |
| | | */ |
| | | @ApiModelProperty(value = "测站纬度,国家2000坐标系") |
| | | private Double latitude; |
| | | |
| | | |
| | | /** |
| | | * 俯仰 |
| | | */ |
| | | @ApiModelProperty(value = "站点在全景图模型的俯仰数据") |
| | | private Double yaw; |
| | | |
| | | /** |
| | | * 方向 |
| | | */ |
| | | @ApiModelProperty(value = "站点在全景图模型的方向") |
| | | private Double pitch; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanoramaState.mapper; |
| | | |
| | | import cn.gistack.sm.skPanoramaState.entity.SkPanoramaStateEntity; |
| | | import cn.gistack.sm.skPanoramaState.vo.SkPanoramaStateVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 水库全景测站 Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | public interface SkPanoramaStateMapper extends BaseMapper<SkPanoramaStateEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param skPanoramaState |
| | | * @return |
| | | */ |
| | | List<SkPanoramaStateVO> selectSkPanoramaStatePage(IPage page, SkPanoramaStateVO skPanoramaState); |
| | | |
| | | void saveArrayList(@Param("list") List<SkPanoramaStateEntity> list); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.skPanoramaState.mapper.SkPanoramaStateMapper"> |
| | | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="skPanoramaStateResultMap" type="cn.gistack.sm.skPanoramaState.entity.SkPanoramaStateEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="sk_panorama_id" property="skPanoramaId"/> |
| | | <result column="station_id" property="stationId"/> |
| | | <result column="res_guid" property="resGuid"/> |
| | | <result column="stat_name" property="statName"/> |
| | | <result column="stat_tyep" property="statTyep"/> |
| | | <result column="longitude" property="longitude"/> |
| | | <result column="latitude" property="latitude"/> |
| | | <result column="status" property="status"/> |
| | | <result column="create_dept" property="createDept"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="tenant_id" property="tenantId"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectSkPanoramaStatePage" resultMap="skPanoramaStateResultMap"> |
| | | select * from sk_panorama_state where is_deleted = 0 |
| | | </select> |
| | | |
| | | |
| | | <insert id="saveArrayList" > |
| | | INSERT INTO SK_PANORAMA_STATE( |
| | | ID, |
| | | RES_GUID, |
| | | STATING_ID, |
| | | SK_PANORAMA_ID, |
| | | STATE_NAME, |
| | | STATE_TYPE, |
| | | LONGITUDE, |
| | | LATITUDE, |
| | | CREATE_USER, |
| | | CREATE_TIME, |
| | | UPDATE_USER, |
| | | UPDATE_TIME, |
| | | STATUS, |
| | | IS_DELETED, |
| | | CREATE_DEPT |
| | | ) VALUES |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.id}, |
| | | #{item.resGuid}, |
| | | #{item.stationId}, |
| | | #{item.skPanoramaId}, |
| | | #{item.statName}, |
| | | #{item.statTyep}, |
| | | #{item.longitude}, |
| | | #{item.latitude}, |
| | | #{item.createUser}, |
| | | #{item.createTime}, |
| | | #{item.updateUser}, |
| | | #{item.updateTime}, |
| | | #{item.status}, |
| | | #{item.isDeleted}, |
| | | #{item.createDept} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanoramaState.service; |
| | | |
| | | import cn.gistack.sm.skPanoramaState.entity.SkPanoramaStateEntity; |
| | | import cn.gistack.sm.skPanoramaState.vo.SkPanoramaStateVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 水库全景测站 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | public interface ISkPanoramaStateService extends BaseService<SkPanoramaStateEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param skPanoramaState |
| | | * @return |
| | | */ |
| | | IPage<SkPanoramaStateVO> selectSkPanoramaStatePage(IPage<SkPanoramaStateVO> page, SkPanoramaStateVO skPanoramaState); |
| | | |
| | | |
| | | void saveList(List<SkPanoramaStateEntity> list); |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanoramaState.service.impl; |
| | | |
| | | import cn.gistack.sm.skPanoramaState.entity.SkPanoramaStateEntity; |
| | | import cn.gistack.sm.skPanoramaState.vo.SkPanoramaStateVO; |
| | | import cn.gistack.sm.skPanoramaState.mapper.SkPanoramaStateMapper; |
| | | import cn.gistack.sm.skPanoramaState.service.ISkPanoramaStateService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 水库全景测站 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | @Service |
| | | public class SkPanoramaStateServiceImpl extends BaseServiceImpl<SkPanoramaStateMapper, SkPanoramaStateEntity> implements ISkPanoramaStateService { |
| | | |
| | | |
| | | |
| | | @Override |
| | | public IPage<SkPanoramaStateVO> selectSkPanoramaStatePage(IPage<SkPanoramaStateVO> page, SkPanoramaStateVO skPanoramaState) { |
| | | return page.setRecords(baseMapper.selectSkPanoramaStatePage(page, skPanoramaState)); |
| | | } |
| | | |
| | | @Override |
| | | public void saveList(List<SkPanoramaStateEntity> list) { |
| | | if (list != null && list.size()>0) { |
| | | for (SkPanoramaStateEntity item : list) { |
| | | item.setIsDeleted(0); |
| | | item.setStatus(1); |
| | | } |
| | | baseMapper.saveArrayList(list); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanoramaState.vo; |
| | | |
| | | import cn.gistack.sm.skPanoramaState.entity.SkPanoramaStateEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 水库全景测站 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SkPanoramaStateVO extends SkPanoramaStateEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 cn.gistack.sm.skPanoramaState.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import cn.gistack.sm.skPanoramaState.entity.SkPanoramaStateEntity; |
| | | import cn.gistack.sm.skPanoramaState.vo.SkPanoramaStateVO; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 水库全景测站 包装类,返回视图层所需的字段 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-03-29 |
| | | */ |
| | | public class SkPanoramaStateWrapper extends BaseEntityWrapper<SkPanoramaStateEntity, SkPanoramaStateVO> { |
| | | |
| | | public static SkPanoramaStateWrapper build() { |
| | | return new SkPanoramaStateWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public SkPanoramaStateVO entityVO(SkPanoramaStateEntity skPanoramaState) { |
| | | SkPanoramaStateVO skPanoramaStateVO = Objects.requireNonNull(BeanUtil.copy(skPanoramaState, SkPanoramaStateVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(skPanoramaState.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(skPanoramaState.getUpdateUser()); |
| | | //skPanoramaStateVO.setCreateUserName(createUser.getName()); |
| | | //skPanoramaStateVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return skPanoramaStateVO; |
| | | } |
| | | |
| | | |
| | | } |