河流,水库站点基本信息管理,bug修复等

This commit is contained in:
mi9688 2024-10-23 18:49:12 +08:00
parent 226370792b
commit 9912eb5671
35 changed files with 1235 additions and 351 deletions

View File

@ -6,6 +6,8 @@ import javax.validation.constraints.*;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.fastbee.common.annotation.Excel; import com.fastbee.common.annotation.Excel;
@ -20,7 +22,9 @@ import com.fastbee.common.xss.Xss;
* *
* @author ruoyi * @author ruoyi
*/ */
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "SysUser", description = "用户对象 sys_user") @ApiModel(value = "SysUser", description = "用户对象 sys_user")
@Data
public class SysUser extends BaseEntity public class SysUser extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -25,7 +25,7 @@ import java.util.*;
@RestController @RestController
@RequestMapping("/gis/groups") @RequestMapping("/gis/groups")
@Api(tags = "") @Api(tags = "")
@PreAuthorize("@ss.hasPermi('ggroup:groups')") //@PreAuthorize("@ss.hasPermi('ggroup:groups')")
public class GGroupsController extends BaseController public class GGroupsController extends BaseController
{ {
private final IGGroupsService gGroupsService; private final IGGroupsService gGroupsService;

View File

@ -35,7 +35,7 @@ import javax.servlet.http.HttpServletResponse;
@RestController @RestController
@RequestMapping("/gis/legend") @RequestMapping("/gis/legend")
@Api(tags = "图例") @Api(tags = "图例")
@PreAuthorize("@ss.hasPermi('ggroup:legend')") //@PreAuthorize("@ss.hasPermi('ggroup:legend')")
public class GLegendController extends BaseController public class GLegendController extends BaseController
{ {

View File

@ -16,8 +16,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.fastbee.common.core.controller.BaseController; import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult; import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.ggroup.domain.GSiteInfo; import com.fastbee.ggroup.domain.GSiteMonitorInfo;
import com.fastbee.ggroup.service.IGSiteInfoService; import com.fastbee.ggroup.service.IGSiteMonitorInfoService;
import com.fastbee.common.utils.poi.ExcelUtil; import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.common.core.page.TableDataInfo; import com.fastbee.common.core.page.TableDataInfo;
@ -28,15 +28,15 @@ import com.fastbee.common.core.page.TableDataInfo;
* @date 2024-10-10 * @date 2024-10-10
*/ */
@RestController @RestController
@RequestMapping("/gis/site/info") @RequestMapping("/gis/site/monitor/info")
@PreAuthorize("@ss.hasPermi('ggroup:groups')") //@PreAuthorize("@ss.hasPermi('ggroup:groups')")
@Api(tags = "站点基础信息") @Api(tags = "站点基础信息")
public class GSiteInfoController extends BaseController public class GSiteMonitorInfoController extends BaseController
{ {
private final IGSiteInfoService gSiteInfoService; private final IGSiteMonitorInfoService gSiteInfoService;
public GSiteInfoController(IGSiteInfoService gSiteInfoService) { public GSiteMonitorInfoController(IGSiteMonitorInfoService gSiteInfoService) {
this.gSiteInfoService = gSiteInfoService; this.gSiteInfoService = gSiteInfoService;
} }
@ -45,10 +45,10 @@ public class GSiteInfoController extends BaseController
*/ */
@GetMapping("/list") @GetMapping("/list")
@ApiOperation("查询站点基础信息列表") @ApiOperation("查询站点基础信息列表")
public TableDataInfo list(GSiteInfo gSiteInfo) public TableDataInfo list(GSiteMonitorInfo gSiteMonitorInfo)
{ {
startPage(); startPage();
List<GSiteInfo> list = gSiteInfoService.selectGSiteInfoList(gSiteInfo); List<GSiteMonitorInfo> list = gSiteInfoService.selectGSiteInfoList(gSiteMonitorInfo);
return getDataTable(list); return getDataTable(list);
} }
@ -57,10 +57,10 @@ public class GSiteInfoController extends BaseController
*/ */
@ApiOperation("导出站点基础信息列表") @ApiOperation("导出站点基础信息列表")
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, GSiteInfo gSiteInfo) public void export(HttpServletResponse response, GSiteMonitorInfo gSiteMonitorInfo)
{ {
List<GSiteInfo> list = gSiteInfoService.selectGSiteInfoList(gSiteInfo); List<GSiteMonitorInfo> list = gSiteInfoService.selectGSiteInfoList(gSiteMonitorInfo);
ExcelUtil<GSiteInfo> util = new ExcelUtil<>(GSiteInfo.class); ExcelUtil<GSiteMonitorInfo> util = new ExcelUtil<>(GSiteMonitorInfo.class);
util.exportExcel(response, list, "站点基础信息数据"); util.exportExcel(response, list, "站点基础信息数据");
} }
@ -79,9 +79,9 @@ public class GSiteInfoController extends BaseController
*/ */
@PostMapping @PostMapping
@ApiOperation("新增站点基础信息") @ApiOperation("新增站点基础信息")
public AjaxResult add(@RequestBody GSiteInfo gSiteInfo) public AjaxResult add(@RequestBody GSiteMonitorInfo gSiteMonitorInfo)
{ {
return toAjax(gSiteInfoService.insertGSiteInfo(gSiteInfo)); return toAjax(gSiteInfoService.insertGSiteInfo(gSiteMonitorInfo));
} }
/** /**
@ -89,9 +89,9 @@ public class GSiteInfoController extends BaseController
*/ */
@PutMapping @PutMapping
@ApiOperation("修改站点基础信息") @ApiOperation("修改站点基础信息")
public AjaxResult edit(@RequestBody GSiteInfo gSiteInfo) public AjaxResult edit(@RequestBody GSiteMonitorInfo gSiteMonitorInfo)
{ {
return toAjax(gSiteInfoService.updateGSiteInfo(gSiteInfo)); return toAjax(gSiteInfoService.updateGSiteInfo(gSiteMonitorInfo));
} }
/** /**

View File

@ -0,0 +1,110 @@
package com.fastbee.data.controller.gis;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 com.fastbee.common.annotation.Log;
import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.common.enums.BusinessType;
import com.fastbee.ggroup.domain.GSiteReservoirInfo;
import com.fastbee.ggroup.service.IGSiteReservoirInfoService;
import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.common.core.page.TableDataInfo;
/**
* 水库站点基础信息Controller
*
* @author kerwincui
* &#064;date 2024-10-23
*/
@RestController
@RequestMapping("/gis/site/reservoir/info")
@Api(tags = "水库站点基础信息")
public class GSiteReservoirInfoController extends BaseController
{
@Autowired
private IGSiteReservoirInfoService gSiteReservoirInfoService;
/**
* 查询水库站点基础信息列表
*/
@PreAuthorize("@ss.hasPermi('ggroup:info:list')")
@GetMapping("/list")
@ApiOperation("查询水库站点基础信息列表")
public TableDataInfo list(GSiteReservoirInfo gSiteReservoirInfo)
{
startPage();
List<GSiteReservoirInfo> list = gSiteReservoirInfoService.selectGSiteReservoirInfoList(gSiteReservoirInfo);
return getDataTable(list);
}
/**
* 导出水库站点基础信息列表
*/
@ApiOperation("导出水库站点基础信息列表")
@PreAuthorize("@ss.hasPermi('ggroup:info:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, GSiteReservoirInfo gSiteReservoirInfo)
{
List<GSiteReservoirInfo> list = gSiteReservoirInfoService.selectGSiteReservoirInfoList(gSiteReservoirInfo);
ExcelUtil<GSiteReservoirInfo> util = new ExcelUtil<GSiteReservoirInfo>(GSiteReservoirInfo.class);
util.exportExcel(response, list, "水库站点基础信息数据");
}
/**
* 获取根据站点id获取水库站点基础信息详细信息
*/
// @PreAuthorize("@ss.hasPermi('ggroup:info:query')")
@GetMapping(value = "/{siteId}")
@ApiOperation("获取水库站点基础信息详细信息")
public AjaxResult getInfo(@PathVariable("siteId") Long siteId)
{
return success(gSiteReservoirInfoService.selectGSiteReservoirInfoById(siteId));
}
/**
* 新增水库站点基础信息
*/
@PreAuthorize("@ss.hasPermi('ggroup:info:add')")
@PostMapping
@ApiOperation("新增水库站点基础信息")
public AjaxResult add(@RequestBody GSiteReservoirInfo gSiteReservoirInfo)
{
return toAjax(gSiteReservoirInfoService.insertGSiteReservoirInfo(gSiteReservoirInfo));
}
/**
* 修改水库站点基础信息
*/
@PreAuthorize("@ss.hasPermi('ggroup:info:edit')")
@PutMapping
@ApiOperation("修改水库站点基础信息")
public AjaxResult edit(@RequestBody GSiteReservoirInfo gSiteReservoirInfo)
{
return toAjax(gSiteReservoirInfoService.updateGSiteReservoirInfo(gSiteReservoirInfo));
}
/**
* 删除水库站点基础信息
*/
@PreAuthorize("@ss.hasPermi('ggroup:info:remove')")
@DeleteMapping("/{ids}")
@ApiOperation("删除水库站点基础信息")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(gSiteReservoirInfoService.deleteGSiteReservoirInfoByIds(ids));
}
}

View File

@ -15,12 +15,10 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.fastbee.common.annotation.Log;
import com.fastbee.common.core.controller.BaseController; import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult; import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.common.enums.BusinessType; import com.fastbee.ggroup.domain.GSiteRiverInfo;
import com.fastbee.ggroup.domain.GRiverInfo; import com.fastbee.ggroup.service.IGSiteRiverInfoService;
import com.fastbee.ggroup.service.IGRiverInfoService;
import com.fastbee.common.utils.poi.ExcelUtil; import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.common.core.page.TableDataInfo; import com.fastbee.common.core.page.TableDataInfo;
@ -31,12 +29,12 @@ import com.fastbee.common.core.page.TableDataInfo;
* @date 2024-10-22 * @date 2024-10-22
*/ */
@RestController @RestController
@RequestMapping("/gis/river/info") @RequestMapping("/gis/site/river/info")
@Api(tags = "河流基础信息") @Api(tags = "河流基础信息")
public class GRiverInfoController extends BaseController public class GSiteRiverInfoController extends BaseController
{ {
@Autowired @Autowired
private IGRiverInfoService gRiverInfoService; private IGSiteRiverInfoService gRiverInfoService;
/** /**
* 查询河流基础信息列表 * 查询河流基础信息列表
@ -44,22 +42,22 @@ public class GRiverInfoController extends BaseController
@PreAuthorize("@ss.hasPermi('ggroup:info:list')") @PreAuthorize("@ss.hasPermi('ggroup:info:list')")
@GetMapping("/list") @GetMapping("/list")
@ApiOperation("查询河流基础信息列表") @ApiOperation("查询河流基础信息列表")
public TableDataInfo list(GRiverInfo gRiverInfo) public TableDataInfo list(GSiteRiverInfo gSiteRiverInfo)
{ {
startPage(); startPage();
List<GRiverInfo> list = gRiverInfoService.selectGRiverInfoList(gRiverInfo); List<GSiteRiverInfo> list = gRiverInfoService.selectGRiverInfoList(gSiteRiverInfo);
return getDataTable(list); return getDataTable(list);
} }
/** /**
* 根据站点id获取河流基本信息 * 根据站点id获取河流基本信息
*/ */
@PreAuthorize("@ss.hasPermi('ggroup:info:list')") // @PreAuthorize("@ss.hasPermi('ggroup:info:list')")
@GetMapping("/byStationId/{stationId}") @GetMapping("/byStationId/{stationId}")
@ApiOperation("根据站点id获取河流基本信息") @ApiOperation("根据站点id获取河流基本信息")
public AjaxResult listByStationId(@PathVariable("stationId") Long stationId){ public AjaxResult listByStationId(@PathVariable("stationId") Long stationId){
GRiverInfo gRiverInfo = new GRiverInfo(); GSiteRiverInfo gSiteRiverInfo = new GSiteRiverInfo();
gRiverInfo.setSiteId(stationId); gSiteRiverInfo.setSiteId(stationId);
List<GRiverInfo> list = gRiverInfoService.selectGRiverInfoList(gRiverInfo); List<GSiteRiverInfo> list = gRiverInfoService.selectGRiverInfoList(gSiteRiverInfo);
return success(!list.isEmpty()?list.get(0):null); return success(!list.isEmpty()?list.get(0):null);
} }
@ -69,10 +67,10 @@ public class GRiverInfoController extends BaseController
@ApiOperation("导出河流基础信息列表") @ApiOperation("导出河流基础信息列表")
@PreAuthorize("@ss.hasPermi('ggroup:info:export')") @PreAuthorize("@ss.hasPermi('ggroup:info:export')")
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, GRiverInfo gRiverInfo) public void export(HttpServletResponse response, GSiteRiverInfo gSiteRiverInfo)
{ {
List<GRiverInfo> list = gRiverInfoService.selectGRiverInfoList(gRiverInfo); List<GSiteRiverInfo> list = gRiverInfoService.selectGRiverInfoList(gSiteRiverInfo);
ExcelUtil<GRiverInfo> util = new ExcelUtil<GRiverInfo>(GRiverInfo.class); ExcelUtil<GSiteRiverInfo> util = new ExcelUtil<GSiteRiverInfo>(GSiteRiverInfo.class);
util.exportExcel(response, list, "河流基础信息数据"); util.exportExcel(response, list, "河流基础信息数据");
} }
@ -93,9 +91,9 @@ public class GRiverInfoController extends BaseController
@PreAuthorize("@ss.hasPermi('ggroup:info:add')") @PreAuthorize("@ss.hasPermi('ggroup:info:add')")
@PostMapping @PostMapping
@ApiOperation("新增河流基础信息") @ApiOperation("新增河流基础信息")
public AjaxResult add(@RequestBody GRiverInfo gRiverInfo) public AjaxResult add(@RequestBody GSiteRiverInfo gSiteRiverInfo)
{ {
return toAjax(gRiverInfoService.insertGRiverInfo(gRiverInfo)); return toAjax(gRiverInfoService.insertGRiverInfo(gSiteRiverInfo));
} }
/** /**
@ -104,9 +102,9 @@ public class GRiverInfoController extends BaseController
@PreAuthorize("@ss.hasPermi('ggroup:info:edit')") @PreAuthorize("@ss.hasPermi('ggroup:info:edit')")
@PutMapping @PutMapping
@ApiOperation("修改河流基础信息") @ApiOperation("修改河流基础信息")
public AjaxResult edit(@RequestBody GRiverInfo gRiverInfo) public AjaxResult edit(@RequestBody GSiteRiverInfo gSiteRiverInfo)
{ {
return toAjax(gRiverInfoService.updateGRiverInfo(gRiverInfo)); return toAjax(gRiverInfoService.updateGRiverInfo(gSiteRiverInfo));
} }
/** /**

View File

@ -126,7 +126,7 @@ public class ProjectController extends BaseController
@PreAuthorize("@ss.hasPermi('iot:project:remove')") @PreAuthorize("@ss.hasPermi('iot:project:remove')")
@DeleteMapping("/{projectIds}") @DeleteMapping("/{projectIds}")
@ApiOperation("删除项目") @ApiOperation("删除项目")
public AjaxResult remove(@PathVariable Long[] projectIds) public AjaxResult remove(@PathVariable Long projectIds)
{ {
return toAjax(projectService.deleteProjectByProjectIds(projectIds)); return toAjax(projectService.deleteProjectByProjectIds(projectIds));
} }

View File

@ -72,12 +72,9 @@ private static final long serialVersionUID = 1L;
/** 显示顺序 */ /** 显示顺序 */
private Integer orderNum; private Integer orderNum;
/** 子组 */ /** 子组 */
private List<GGroups> children = new ArrayList<>(); private List<GGroups> children = new ArrayList<>();
/**节点类型0组1站点 */ /**节点类型0组1站点 */
private Integer nodeType= 0; private Integer nodeType= 0;
@ -87,4 +84,5 @@ private static final long serialVersionUID = 1L;
/**站点类型 */ /**站点类型 */
private String siteType; private String siteType;
} }

View File

@ -4,9 +4,6 @@ import java.math.BigDecimal;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.*; import lombok.*;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fastbee.common.annotation.Excel; import com.fastbee.common.annotation.Excel;
import com.fastbee.common.core.domain.BaseEntity; import com.fastbee.common.core.domain.BaseEntity;
@ -21,7 +18,7 @@ import com.fastbee.common.core.domain.BaseEntity;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class GSiteInfo extends BaseEntity public class GSiteMonitorInfo extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -0,0 +1,217 @@
package com.fastbee.ggroup.domain;
import java.math.BigDecimal;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fastbee.common.annotation.Excel;
import com.fastbee.common.core.domain.BaseEntity;
/**
* 水库站点基础信息对象 g_site_reservoir_info
*
* @author kerwincui
* @date 2024-10-23
*/
@ApiModel(value = "GSiteReservoirInfo",description = "水库站点基础信息 g_site_reservoir_info")
@Data
@EqualsAndHashCode(callSuper = true)
public class GSiteReservoirInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 工程名称 */
@Excel(name = "工程名称")
@ApiModelProperty("工程名称")
private String projectName;
/** 地理坐标 */
@Excel(name = "地理坐标")
@ApiModelProperty("地理坐标")
private String geoCoordinates;
/** 工程位置 */
@Excel(name = "工程位置")
@ApiModelProperty("工程位置")
private String projectLocation;
/** 所在流域 */
@Excel(name = "所在流域")
@ApiModelProperty("所在流域")
private String drainageBasin;
/** 所在水系 */
@Excel(name = "所在水系")
@ApiModelProperty("所在水系")
private String drainageSystem;
/** 所在河流 */
@Excel(name = "所在河流")
@ApiModelProperty("所在河流")
private String river;
/** 所在乡镇/村 */
@Excel(name = "所在乡镇/村")
@ApiModelProperty("所在乡镇/村")
private String townVillage;
/** 水库类型 */
@Excel(name = "水库类型")
@ApiModelProperty("水库类型")
private String reservoirType;
/** 水库功能 */
@Excel(name = "水库功能")
@ApiModelProperty("水库功能")
private String reservoirFunction;
/** 工程建设情况 */
@Excel(name = "工程建设情况")
@ApiModelProperty("工程建设情况")
private String constructionStatus;
/** 水库级别 */
@Excel(name = "水库级别")
@ApiModelProperty("水库级别")
private String reservoirLevel;
/** 主坝级别 */
@Excel(name = "主坝级别")
@ApiModelProperty("主坝级别")
private String mainDamLevel;
/** 主坝尺寸坝高 */
@Excel(name = "主坝尺寸坝高")
@ApiModelProperty("主坝尺寸坝高")
private BigDecimal mainDamHeight;
/** 主坝尺寸坝长 */
@Excel(name = "主坝尺寸坝长")
@ApiModelProperty("主坝尺寸坝长")
private BigDecimal mainDamLength;
/** 坝顶高程 */
@Excel(name = "坝顶高程")
@ApiModelProperty("坝顶高程")
private BigDecimal damCrestElevation;
/** 正常蓄水位 */
@Excel(name = "正常蓄水位")
@ApiModelProperty("正常蓄水位")
private BigDecimal normalStorageLevel;
/** 死水位 */
@Excel(name = "死水位")
@ApiModelProperty("死水位")
private BigDecimal deadWaterLevel;
/** 总库容 */
@Excel(name = "总库容")
@ApiModelProperty("总库容")
private Long totalCapacity;
/** 兴利库容 */
@Excel(name = "兴利库容")
@ApiModelProperty("兴利库容")
private Long beneficialCapacity;
/** 死库容 */
@Excel(name = "死库容")
@ApiModelProperty("死库容")
private Long deadStorage;
/** 正常蓄水位相应水面面积 */
@Excel(name = "正常蓄水位相应水面面积")
@ApiModelProperty("正常蓄水位相应水面面积")
private Integer normalStorageArea;
/** 设计年供水量 */
@Excel(name = "设计年供水量")
@ApiModelProperty("设计年供水量")
private Long annualSupplyCapacity;
/** 行政责任人 */
@Excel(name = "行政责任人")
@ApiModelProperty("行政责任人")
private String administrativeResponsible;
/** 行政责任人单位名称 */
@Excel(name = "行政责任人单位名称")
@ApiModelProperty("行政责任人单位名称")
private String administrativeUnitName;
/** 行政责任人职务 */
@Excel(name = "行政责任人职务")
@ApiModelProperty("行政责任人职务")
private String administrativePosition;
/** 行政责任人电话 */
@Excel(name = "行政责任人电话")
@ApiModelProperty("行政责任人电话")
private String administrativePhone;
/** 技术责任人 */
@Excel(name = "技术责任人")
@ApiModelProperty("技术责任人")
private String technicalResponsible;
/** 技术责任人单位名称 */
@Excel(name = "技术责任人单位名称")
@ApiModelProperty("技术责任人单位名称")
private String technicalUnitName;
/** 技术责任人职务 */
@Excel(name = "技术责任人职务")
@ApiModelProperty("技术责任人职务")
private String technicalPosition;
/** 技术责任人电话 */
@Excel(name = "技术责任人电话")
@ApiModelProperty("技术责任人电话")
private String technicalPhone;
/** 巡查责任人 */
@Excel(name = "巡查责任人")
@ApiModelProperty("巡查责任人")
private String inspectionResponsible;
/** 巡查责任人单位名称 */
@Excel(name = "巡查责任人单位名称")
@ApiModelProperty("巡查责任人单位名称")
private String inspectionUnitName;
/** 巡查责任人职务 */
@Excel(name = "巡查责任人职务")
@ApiModelProperty("巡查责任人职务")
private String inspectionPosition;
/** 巡查责任人电话 */
@Excel(name = "巡查责任人电话")
@ApiModelProperty("巡查责任人电话")
private String inspectionPhone;
/** 创建人 */
@Excel(name = "创建人")
@ApiModelProperty("创建人")
private String createdBy;
/** 更新人 */
@Excel(name = "更新人")
@ApiModelProperty("更新人")
private String updatedBy;
/** 删除标志0:正常,2:删除) */
private Integer delFlag;
/** 所属站点ID */
@Excel(name = "所属站点ID")
@ApiModelProperty("所属站点ID")
private Long siteId;
}

View File

@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fastbee.common.annotation.Excel; import com.fastbee.common.annotation.Excel;
import com.fastbee.common.core.domain.BaseEntity; import com.fastbee.common.core.domain.BaseEntity;
@ -18,7 +16,7 @@ import com.fastbee.common.core.domain.BaseEntity;
@ApiModel(value = "GRiverInfo",description = "河流基础信息 g_river_info") @ApiModel(value = "GRiverInfo",description = "河流基础信息 g_river_info")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class GRiverInfo extends BaseEntity public class GSiteRiverInfo extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -12,7 +12,7 @@ public enum SiteTypeCategoryEnum {
//水利设施与管理 //水利设施与管理
WATER_MANAGEMENT("水利设施与管理"), WATER_MANAGEMENT("水利设施与管理"),
//检测站 //检测站
DETECTION_STATION("测站"), DETECTION_STATION("测站"),
//公共设施 //公共设施
PUBLIC_FACILITIES("公共设施"), PUBLIC_FACILITIES("公共设施"),
//报警事件 //报警事件
@ -20,7 +20,6 @@ public enum SiteTypeCategoryEnum {
//其他 //其他
OTHER("其他"); OTHER("其他");
private final String name; private final String name;
SiteTypeCategoryEnum(String name){this.name = name;} SiteTypeCategoryEnum(String name){this.name = name;}
@ -32,4 +31,16 @@ public enum SiteTypeCategoryEnum {
} }
return null; return null;
} }
/**
* 判断变量值是否包含在枚举值里面
*/
public static boolean contains(String value) {
for (SiteTypeCategoryEnum siteTypeCategoryEnum : SiteTypeCategoryEnum.values()) {
if (siteTypeCategoryEnum.getName().equals(value)) {
return true;
}
}
return false;
}
} }

View File

@ -3,7 +3,7 @@ package com.fastbee.ggroup.mapper;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fastbee.ggroup.domain.GSiteInfo; import com.fastbee.ggroup.domain.GSiteMonitorInfo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/** /**
@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
* &#064;date 2024-10-10 * &#064;date 2024-10-10
*/ */
@Mapper @Mapper
public interface GSiteInfoMapper extends BaseMapper<GSiteInfo> public interface GSiteMonitorInfoMapper extends BaseMapper<GSiteMonitorInfo>
{ {
/** /**
* 查询站点基础信息 * 查询站点基础信息
@ -21,31 +21,31 @@ public interface GSiteInfoMapper extends BaseMapper<GSiteInfo>
* @param id 站点基础信息主键 * @param id 站点基础信息主键
* @return 站点基础信息 * @return 站点基础信息
*/ */
GSiteInfo selectGSiteInfoById(Long id); GSiteMonitorInfo selectGSiteInfoBySiteId(Long id);
/** /**
* 查询站点基础信息列表 * 查询站点基础信息列表
* *
* @param gSiteInfo 站点基础信息 * @param gSiteMonitorInfo 站点基础信息
* @return 站点基础信息集合 * @return 站点基础信息集合
*/ */
List<GSiteInfo> selectGSiteInfoList(GSiteInfo gSiteInfo); List<GSiteMonitorInfo> selectGSiteInfoList(GSiteMonitorInfo gSiteMonitorInfo);
/** /**
* 新增站点基础信息 * 新增站点基础信息
* *
* @param gSiteInfo 站点基础信息 * @param gSiteMonitorInfo 站点基础信息
* @return 结果 * @return 结果
*/ */
int insertGSiteInfo(GSiteInfo gSiteInfo); int insertGSiteInfo(GSiteMonitorInfo gSiteMonitorInfo);
/** /**
* 修改站点基础信息 * 修改站点基础信息
* *
* @param gSiteInfo 站点基础信息 * @param gSiteMonitorInfo 站点基础信息
* @return 结果 * @return 结果
*/ */
int updateGSiteInfo(GSiteInfo gSiteInfo); int updateGSiteInfo(GSiteMonitorInfo gSiteMonitorInfo);
/** /**
* 删除站点基础信息 * 删除站点基础信息

View File

@ -0,0 +1,63 @@
package com.fastbee.ggroup.mapper;
import java.util.List;
import com.fastbee.ggroup.domain.GSiteReservoirInfo;
import org.apache.ibatis.annotations.Mapper;
/**
* 水库站点基础信息Mapper接口
*
* @author kerwincui
* @date 2024-10-23
*/
@Mapper
public interface GSiteReservoirInfoMapper
{
/**
* 查询水库站点基础信息
*
* @param siteId 水库基础信息所属站点id
* @return 水库站点基础信息
*/
public GSiteReservoirInfo selectGSiteReservoirInfoBySiteId(Long siteId);
/**
* 查询水库站点基础信息列表
*
* @param gSiteReservoirInfo 水库站点基础信息
* @return 水库站点基础信息集合
*/
public List<GSiteReservoirInfo> selectGSiteReservoirInfoList(GSiteReservoirInfo gSiteReservoirInfo);
/**
* 新增水库站点基础信息
*
* @param gSiteReservoirInfo 水库站点基础信息
* @return 结果
*/
public int insertGSiteReservoirInfo(GSiteReservoirInfo gSiteReservoirInfo);
/**
* 修改水库站点基础信息
*
* @param gSiteReservoirInfo 水库站点基础信息
* @return 结果
*/
public int updateGSiteReservoirInfo(GSiteReservoirInfo gSiteReservoirInfo);
/**
* 删除水库站点基础信息
*
* @param id 水库站点基础信息主键
* @return 结果
*/
public int deleteGSiteReservoirInfoById(Long id);
/**
* 批量删除水库站点基础信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteGSiteReservoirInfoByIds(Long[] ids);
}

View File

@ -1,7 +1,9 @@
package com.fastbee.ggroup.mapper; package com.fastbee.ggroup.mapper;
import java.util.List; import java.util.List;
import com.fastbee.ggroup.domain.GRiverInfo; import com.fastbee.ggroup.domain.GSiteRiverInfo;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/** /**
* 河流基础信息Mapper接口 * 河流基础信息Mapper接口
@ -9,7 +11,8 @@ import com.fastbee.ggroup.domain.GRiverInfo;
* @author kerwincui * @author kerwincui
* @date 2024-10-22 * @date 2024-10-22
*/ */
public interface GRiverInfoMapper @Mapper
public interface GSiteRiverInfoMapper extends MPJBaseMapper<GSiteRiverInfo>
{ {
/** /**
* 查询河流基础信息 * 查询河流基础信息
@ -17,31 +20,31 @@ public interface GRiverInfoMapper
* @param id 河流基础信息主键 * @param id 河流基础信息主键
* @return 河流基础信息 * @return 河流基础信息
*/ */
public GRiverInfo selectGRiverInfoById(Long id); public GSiteRiverInfo selectGRiverInfoBySiteId(Long id);
/** /**
* 查询河流基础信息列表 * 查询河流基础信息列表
* *
* @param gRiverInfo 河流基础信息 * @param gSiteRiverInfo 河流基础信息
* @return 河流基础信息集合 * @return 河流基础信息集合
*/ */
public List<GRiverInfo> selectGRiverInfoList(GRiverInfo gRiverInfo); public List<GSiteRiverInfo> selectGRiverInfoList(GSiteRiverInfo gSiteRiverInfo);
/** /**
* 新增河流基础信息 * 新增河流基础信息
* *
* @param gRiverInfo 河流基础信息 * @param gSiteRiverInfo 河流基础信息
* @return 结果 * @return 结果
*/ */
public int insertGRiverInfo(GRiverInfo gRiverInfo); public int insertGRiverInfo(GSiteRiverInfo gSiteRiverInfo);
/** /**
* 修改河流基础信息 * 修改河流基础信息
* *
* @param gRiverInfo 河流基础信息 * @param gSiteRiverInfo 河流基础信息
* @return 结果 * @return 结果
*/ */
public int updateGRiverInfo(GRiverInfo gRiverInfo); public int updateGRiverInfo(GSiteRiverInfo gSiteRiverInfo);
/** /**
* 删除河流基础信息 * 删除河流基础信息

View File

@ -1,7 +1,7 @@
package com.fastbee.ggroup.service; package com.fastbee.ggroup.service;
import java.util.List; import java.util.List;
import com.fastbee.ggroup.domain.GSiteInfo; import com.fastbee.ggroup.domain.GSiteMonitorInfo;
/** /**
* 站点基础信息Service接口 * 站点基础信息Service接口
@ -9,7 +9,7 @@ import com.fastbee.ggroup.domain.GSiteInfo;
* @author kerwincui * @author kerwincui
* &#064;date 2024-10-10 * &#064;date 2024-10-10
*/ */
public interface IGSiteInfoService public interface IGSiteMonitorInfoService
{ {
/** /**
* 查询站点基础信息 * 查询站点基础信息
@ -17,31 +17,31 @@ public interface IGSiteInfoService
* @param id 站点基础信息主键 * @param id 站点基础信息主键
* @return 站点基础信息 * @return 站点基础信息
*/ */
GSiteInfo selectGSiteInfoById(Long id); GSiteMonitorInfo selectGSiteInfoById(Long id);
/** /**
* 查询站点基础信息列表 * 查询站点基础信息列表
* *
* @param gSiteInfo 站点基础信息 * @param gSiteMonitorInfo 站点基础信息
* @return 站点基础信息集合 * @return 站点基础信息集合
*/ */
List<GSiteInfo> selectGSiteInfoList(GSiteInfo gSiteInfo); List<GSiteMonitorInfo> selectGSiteInfoList(GSiteMonitorInfo gSiteMonitorInfo);
/** /**
* 新增站点基础信息 * 新增站点基础信息
* *
* @param gSiteInfo 站点基础信息 * @param gSiteMonitorInfo 站点基础信息
* @return 结果 * @return 结果
*/ */
int insertGSiteInfo(GSiteInfo gSiteInfo); int insertGSiteInfo(GSiteMonitorInfo gSiteMonitorInfo);
/** /**
* 修改站点基础信息 * 修改站点基础信息
* *
* @param gSiteInfo 站点基础信息 * @param gSiteMonitorInfo 站点基础信息
* @return 结果 * @return 结果
*/ */
int updateGSiteInfo(GSiteInfo gSiteInfo); int updateGSiteInfo(GSiteMonitorInfo gSiteMonitorInfo);
/** /**
* 批量删除站点基础信息 * 批量删除站点基础信息

View File

@ -0,0 +1,61 @@
package com.fastbee.ggroup.service;
import java.util.List;
import com.fastbee.ggroup.domain.GSiteReservoirInfo;
/**
* 水库站点基础信息Service接口
*
* @author kerwincui
* @date 2024-10-23
*/
public interface IGSiteReservoirInfoService
{
/**
* 查询水库站点基础信息
*
* @param id 水库站点基础信息主键
* @return 水库站点基础信息
*/
public GSiteReservoirInfo selectGSiteReservoirInfoById(Long id);
/**
* 查询水库站点基础信息列表
*
* @param gSiteReservoirInfo 水库站点基础信息
* @return 水库站点基础信息集合
*/
public List<GSiteReservoirInfo> selectGSiteReservoirInfoList(GSiteReservoirInfo gSiteReservoirInfo);
/**
* 新增水库站点基础信息
*
* @param gSiteReservoirInfo 水库站点基础信息
* @return 结果
*/
public int insertGSiteReservoirInfo(GSiteReservoirInfo gSiteReservoirInfo);
/**
* 修改水库站点基础信息
*
* @param gSiteReservoirInfo 水库站点基础信息
* @return 结果
*/
public int updateGSiteReservoirInfo(GSiteReservoirInfo gSiteReservoirInfo);
/**
* 批量删除水库站点基础信息
*
* @param ids 需要删除的水库站点基础信息主键集合
* @return 结果
*/
public int deleteGSiteReservoirInfoByIds(Long[] ids);
/**
* 删除水库站点基础信息信息
*
* @param id 水库站点基础信息主键
* @return 结果
*/
public int deleteGSiteReservoirInfoById(Long id);
}

View File

@ -1,7 +1,7 @@
package com.fastbee.ggroup.service; package com.fastbee.ggroup.service;
import java.util.List; import java.util.List;
import com.fastbee.ggroup.domain.GRiverInfo; import com.fastbee.ggroup.domain.GSiteRiverInfo;
/** /**
* 河流基础信息Service接口 * 河流基础信息Service接口
@ -9,7 +9,7 @@ import com.fastbee.ggroup.domain.GRiverInfo;
* @author kerwincui * @author kerwincui
* @date 2024-10-22 * @date 2024-10-22
*/ */
public interface IGRiverInfoService public interface IGSiteRiverInfoService
{ {
/** /**
* 查询河流基础信息 * 查询河流基础信息
@ -17,31 +17,31 @@ public interface IGRiverInfoService
* @param id 河流基础信息主键 * @param id 河流基础信息主键
* @return 河流基础信息 * @return 河流基础信息
*/ */
public GRiverInfo selectGRiverInfoById(Long id); public GSiteRiverInfo selectGRiverInfoById(Long id);
/** /**
* 查询河流基础信息列表 * 查询河流基础信息列表
* *
* @param gRiverInfo 河流基础信息 * @param gSiteRiverInfo 河流基础信息
* @return 河流基础信息集合 * @return 河流基础信息集合
*/ */
public List<GRiverInfo> selectGRiverInfoList(GRiverInfo gRiverInfo); public List<GSiteRiverInfo> selectGRiverInfoList(GSiteRiverInfo gSiteRiverInfo);
/** /**
* 新增河流基础信息 * 新增河流基础信息
* *
* @param gRiverInfo 河流基础信息 * @param gSiteRiverInfo 河流基础信息
* @return 结果 * @return 结果
*/ */
public int insertGRiverInfo(GRiverInfo gRiverInfo); public int insertGRiverInfo(GSiteRiverInfo gSiteRiverInfo);
/** /**
* 修改河流基础信息 * 修改河流基础信息
* *
* @param gRiverInfo 河流基础信息 * @param gSiteRiverInfo 河流基础信息
* @return 结果 * @return 结果
*/ */
public int updateGRiverInfo(GRiverInfo gRiverInfo); public int updateGRiverInfo(GSiteRiverInfo gSiteRiverInfo);
/** /**
* 批量删除河流基础信息 * 批量删除河流基础信息

View File

@ -131,8 +131,8 @@ public class GGroupsServiceImpl implements IGGroupsService
//根组列表 //根组列表
List<GGroups> roots = new ArrayList<>(); List<GGroups> roots = new ArrayList<>();
//所有站点列表 //所有站点列表
List<GGroupSiteVo> gGroupSiteAllList = selectGGroupsAllListSites(new GGroups()); List<GGroupSiteVo> gGroupSiteAllList = selectGGroupsAllListSites(new GGroups());
System.err.println("当前项目下所有站点:");
gGroupSiteAllList.forEach(System.err::println); gGroupSiteAllList.forEach(System.err::println);
for (GGroups group : groupsList) { for (GGroups group : groupsList) {
@ -163,7 +163,6 @@ public class GGroupsServiceImpl implements IGGroupsService
/** /**
* 查询项目下全部站点 * 查询项目下全部站点
*/ */
public List<GGroupSiteVo> selectGGroupsAllListSites(GGroups gGroups) { public List<GGroupSiteVo> selectGGroupsAllListSites(GGroups gGroups) {
MPJLambdaWrapper<GSiteGroups> gSiteGroupsMPJLambdaWrapper = new MPJLambdaWrapper<GSiteGroups>() MPJLambdaWrapper<GSiteGroups> gSiteGroupsMPJLambdaWrapper = new MPJLambdaWrapper<GSiteGroups>()
.select(GSiteGroups::getId, GSiteGroups::getParentId, GSiteGroups::getSiteId) .select(GSiteGroups::getId, GSiteGroups::getParentId, GSiteGroups::getSiteId)

View File

@ -8,6 +8,7 @@ import java.util.stream.Collectors;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.fastbee.common.exception.ServiceException; import com.fastbee.common.exception.ServiceException;
import com.fastbee.common.utils.DateUtils; import com.fastbee.common.utils.DateUtils;
import com.fastbee.ggroup.enums.SiteTypeCategoryEnum;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -78,6 +79,12 @@ public class GLegendServiceImpl implements IGLegendService
if(!duplicateNameList.isEmpty()){ if(!duplicateNameList.isEmpty()){
throw new ServiceException("图例名称重复!"); throw new ServiceException("图例名称重复!");
} }
gLegend.setCategory(gLegend.getCategory().trim());
//图例类别校验
if(!SiteTypeCategoryEnum.contains(gLegend.getCategory())){
throw new ServiceException("图例类别不存在!");
}
gLegend.setCreateTime(DateUtils.getNowDate());
return gLegendMapper.insertGLegend(gLegend); return gLegendMapper.insertGLegend(gLegend);
} }

View File

@ -1,96 +0,0 @@
package com.fastbee.ggroup.service.impl;
import java.util.List;
import com.fastbee.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.ggroup.mapper.GRiverInfoMapper;
import com.fastbee.ggroup.domain.GRiverInfo;
import com.fastbee.ggroup.service.IGRiverInfoService;
/**
* 河流基础信息Service业务层处理
*
* @author kerwincui
* @date 2024-10-22
*/
@Service
public class GRiverInfoServiceImpl implements IGRiverInfoService
{
@Autowired
private GRiverInfoMapper gRiverInfoMapper;
/**
* 查询河流基础信息
*
* @param id 河流基础信息主键
* @return 河流基础信息
*/
@Override
public GRiverInfo selectGRiverInfoById(Long id)
{
return gRiverInfoMapper.selectGRiverInfoById(id);
}
/**
* 查询河流基础信息列表
*
* @param gRiverInfo 河流基础信息
* @return 河流基础信息
*/
@Override
public List<GRiverInfo> selectGRiverInfoList(GRiverInfo gRiverInfo)
{
return gRiverInfoMapper.selectGRiverInfoList(gRiverInfo);
}
/**
* 新增河流基础信息
*
* @param gRiverInfo 河流基础信息
* @return 结果
*/
@Override
public int insertGRiverInfo(GRiverInfo gRiverInfo)
{
gRiverInfo.setCreateTime(DateUtils.getNowDate());
return gRiverInfoMapper.insertGRiverInfo(gRiverInfo);
}
/**
* 修改河流基础信息
*
* @param gRiverInfo 河流基础信息
* @return 结果
*/
@Override
public int updateGRiverInfo(GRiverInfo gRiverInfo)
{
gRiverInfo.setUpdateTime(DateUtils.getNowDate());
return gRiverInfoMapper.updateGRiverInfo(gRiverInfo);
}
/**
* 批量删除河流基础信息
*
* @param ids 需要删除的河流基础信息主键
* @return 结果
*/
@Override
public int deleteGRiverInfoByIds(Long[] ids)
{
return gRiverInfoMapper.deleteGRiverInfoByIds(ids);
}
/**
* 删除河流基础信息信息
*
* @param id 河流基础信息主键
* @return 结果
*/
@Override
public int deleteGRiverInfoById(Long id)
{
return gRiverInfoMapper.deleteGRiverInfoById(id);
}
}

View File

@ -1,106 +0,0 @@
package com.fastbee.ggroup.service.impl;
import java.util.List;
import java.util.Objects;
import com.fastbee.common.exception.ServiceException;
import com.fastbee.common.utils.DateUtils;
import com.fastbee.common.utils.ValidationUtils;
import org.springframework.stereotype.Service;
import com.fastbee.ggroup.mapper.GSiteInfoMapper;
import com.fastbee.ggroup.domain.GSiteInfo;
import com.fastbee.ggroup.service.IGSiteInfoService;
/**
* 站点基础信息Service业务层处理
*
* @author kerwincui
* &#064;date 2024-10-10
*/
@Service
public class GSiteInfoServiceImpl implements IGSiteInfoService
{
private final GSiteInfoMapper gSiteInfoMapper;
public GSiteInfoServiceImpl(GSiteInfoMapper gSiteInfoMapper) {
this.gSiteInfoMapper = gSiteInfoMapper;
}
/**
* 查询站点基础信息
*
* @param id 站点基础信息主键
* @return 站点基础信息
*/
@Override
public GSiteInfo selectGSiteInfoById(Long id)
{
return gSiteInfoMapper.selectGSiteInfoById(id);
}
/**
* 查询站点基础信息列表
*
* @param gSiteInfo 站点基础信息
* @return 站点基础信息
*/
@Override
public List<GSiteInfo> selectGSiteInfoList(GSiteInfo gSiteInfo)
{
return gSiteInfoMapper.selectGSiteInfoList(gSiteInfo);
}
/**
* 新增站点基础信息
*
* @param gSiteInfo 站点基础信息
* @return 结果
*/
@Override
public int insertGSiteInfo(GSiteInfo gSiteInfo)
{
gSiteInfo.setCreateTime(DateUtils.getNowDate());
return gSiteInfoMapper.insertGSiteInfo(gSiteInfo);
}
/**
* 修改站点基础信息
*
* @param gSiteInfo 站点基础信息
* @return 结果
*/
@Override
public int updateGSiteInfo(GSiteInfo gSiteInfo)
{
//参数校验
if(Objects.isNull(gSiteInfo.getSiteId())){
throw new ServiceException("站点ID(siteId)字段不能为空!");
}
if(!ValidationUtils.isMobile(gSiteInfo.getManagerPhone())){
throw new ServiceException("站点管理员手机号(managerPhone)格式不正确!");
}
//检查是否有该条数据
if(Objects.isNull(gSiteInfoMapper.selectGSiteInfoById(gSiteInfo.getSiteId()))){
//没有该条数据则新增
gSiteInfo.setCreateTime(DateUtils.getNowDate());
return insertGSiteInfo(gSiteInfo);
}
gSiteInfo.setUpdateTime(DateUtils.getNowDate());
return gSiteInfoMapper.updateGSiteInfo(gSiteInfo);
}
/**
* 批量删除站点基础信息
*
* @param ids 需要删除的站点基础信息主键
* @return 结果
*/
@Override
public int deleteGSiteInfoByIds(Long[] ids)
{
return gSiteInfoMapper.deleteGSiteInfoByIds(ids);
}
}

View File

@ -0,0 +1,106 @@
package com.fastbee.ggroup.service.impl;
import java.util.List;
import java.util.Objects;
import com.fastbee.common.exception.ServiceException;
import com.fastbee.common.utils.DateUtils;
import com.fastbee.common.utils.ValidationUtils;
import org.springframework.stereotype.Service;
import com.fastbee.ggroup.mapper.GSiteMonitorInfoMapper;
import com.fastbee.ggroup.domain.GSiteMonitorInfo;
import com.fastbee.ggroup.service.IGSiteMonitorInfoService;
/**
* 站点基础信息Service业务层处理
*
* @author kerwincui
* &#064;date 2024-10-10
*/
@Service
public class GSiteMonitorInfoServiceImpl implements IGSiteMonitorInfoService
{
private final GSiteMonitorInfoMapper gSiteMonitorInfoMapper;
public GSiteMonitorInfoServiceImpl(GSiteMonitorInfoMapper gSiteMonitorInfoMapper) {
this.gSiteMonitorInfoMapper = gSiteMonitorInfoMapper;
}
/**
* 查询站点基础信息
*
* @param id 站点基础信息主键
* @return 站点基础信息
*/
@Override
public GSiteMonitorInfo selectGSiteInfoById(Long id)
{
return gSiteMonitorInfoMapper.selectGSiteInfoBySiteId(id);
}
/**
* 查询站点基础信息列表
*
* @param gSiteMonitorInfo 站点基础信息
* @return 站点基础信息
*/
@Override
public List<GSiteMonitorInfo> selectGSiteInfoList(GSiteMonitorInfo gSiteMonitorInfo)
{
return gSiteMonitorInfoMapper.selectGSiteInfoList(gSiteMonitorInfo);
}
/**
* 新增站点基础信息
*
* @param gSiteMonitorInfo 站点基础信息
* @return 结果
*/
@Override
public int insertGSiteInfo(GSiteMonitorInfo gSiteMonitorInfo)
{
gSiteMonitorInfo.setCreateTime(DateUtils.getNowDate());
return gSiteMonitorInfoMapper.insertGSiteInfo(gSiteMonitorInfo);
}
/**
* 修改站点基础信息
*
* @param gSiteMonitorInfo 站点基础信息
* @return 结果
*/
@Override
public int updateGSiteInfo(GSiteMonitorInfo gSiteMonitorInfo)
{
//参数校验
if(Objects.isNull(gSiteMonitorInfo.getSiteId())){
throw new ServiceException("站点ID(siteId)字段不能为空!");
}
if(!ValidationUtils.isMobile(gSiteMonitorInfo.getManagerPhone())){
throw new ServiceException("站点管理员手机号(managerPhone)格式不正确!");
}
//检查是否有该条数据
if(Objects.isNull(gSiteMonitorInfoMapper.selectGSiteInfoBySiteId(gSiteMonitorInfo.getSiteId()))){
//没有该条数据则新增
gSiteMonitorInfo.setCreateTime(DateUtils.getNowDate());
return insertGSiteInfo(gSiteMonitorInfo);
}
gSiteMonitorInfo.setUpdateTime(DateUtils.getNowDate());
return gSiteMonitorInfoMapper.updateGSiteInfo(gSiteMonitorInfo);
}
/**
* 批量删除站点基础信息
*
* @param ids 需要删除的站点基础信息主键
* @return 结果
*/
@Override
public int deleteGSiteInfoByIds(Long[] ids)
{
return gSiteMonitorInfoMapper.deleteGSiteInfoByIds(ids);
}
}

View File

@ -0,0 +1,109 @@
package com.fastbee.ggroup.service.impl;
import java.util.List;
import java.util.Objects;
import com.fastbee.common.exception.ServiceException;
import com.fastbee.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.ggroup.mapper.GSiteReservoirInfoMapper;
import com.fastbee.ggroup.domain.GSiteReservoirInfo;
import com.fastbee.ggroup.service.IGSiteReservoirInfoService;
/**
* 水库站点基础信息Service业务层处理
*
* @author kerwincui
* @date 2024-10-23
*/
@Service
public class GSiteReservoirInfoServiceImpl implements IGSiteReservoirInfoService
{
@Autowired
private GSiteReservoirInfoMapper gSiteReservoirInfoMapper;
/**
* 查询水库站点基础信息
*
* @param siteId 水库站点id
* @return 水库站点基础信息
*/
@Override
public GSiteReservoirInfo selectGSiteReservoirInfoById(Long siteId)
{
return gSiteReservoirInfoMapper.selectGSiteReservoirInfoBySiteId(siteId);
}
/**
* 查询水库站点基础信息列表
*
* @param gSiteReservoirInfo 水库站点基础信息
* @return 水库站点基础信息
*/
@Override
public List<GSiteReservoirInfo> selectGSiteReservoirInfoList(GSiteReservoirInfo gSiteReservoirInfo)
{
return gSiteReservoirInfoMapper.selectGSiteReservoirInfoList(gSiteReservoirInfo);
}
/**
* 新增水库站点基础信息
*
* @param gSiteReservoirInfo 水库站点基础信息
* @return 结果
*/
@Override
public int insertGSiteReservoirInfo(GSiteReservoirInfo gSiteReservoirInfo)
{
gSiteReservoirInfo.setCreateTime(DateUtils.getNowDate());
return gSiteReservoirInfoMapper.insertGSiteReservoirInfo(gSiteReservoirInfo);
}
/**
* 修改水库站点基础信息
*
* @param gSiteReservoirInfo 水库站点基础信息
* @return 结果
*/
@Override
public int updateGSiteReservoirInfo(GSiteReservoirInfo gSiteReservoirInfo)
{
//必要参数校验
if(Objects.isNull(gSiteReservoirInfo.getSiteId())){
throw new ServiceException("站点ID(siteId)字段不能为空!");
}
//检查是否有该条数据
if(Objects.isNull(gSiteReservoirInfoMapper.selectGSiteReservoirInfoBySiteId(gSiteReservoirInfo.getSiteId()))){
//没有该条数据则新增
gSiteReservoirInfo.setCreateTime(DateUtils.getNowDate());
return insertGSiteReservoirInfo(gSiteReservoirInfo);
}
gSiteReservoirInfo.setUpdateTime(DateUtils.getNowDate());
return gSiteReservoirInfoMapper.updateGSiteReservoirInfo(gSiteReservoirInfo);
}
/**
* 批量删除水库站点基础信息
*
* @param ids 需要删除的水库站点基础信息主键
* @return 结果
*/
@Override
public int deleteGSiteReservoirInfoByIds(Long[] ids)
{
return gSiteReservoirInfoMapper.deleteGSiteReservoirInfoByIds(ids);
}
/**
* 删除水库站点基础信息信息
*
* @param id 水库站点基础信息主键
* @return 结果
*/
@Override
public int deleteGSiteReservoirInfoById(Long id)
{
return gSiteReservoirInfoMapper.deleteGSiteReservoirInfoById(id);
}
}

View File

@ -0,0 +1,111 @@
package com.fastbee.ggroup.service.impl;
import java.util.List;
import java.util.Objects;
import com.fastbee.common.exception.ServiceException;
import com.fastbee.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.fastbee.ggroup.mapper.GSiteRiverInfoMapper;
import com.fastbee.ggroup.domain.GSiteRiverInfo;
import com.fastbee.ggroup.service.IGSiteRiverInfoService;
/**
* 河流基础信息Service业务层处理
*
* @author kerwincui
* &#064;date 2024-10-22
*/
@Service
public class GSiteRiverInfoServiceImpl implements IGSiteRiverInfoService
{
private final GSiteRiverInfoMapper gSiteRiverInfoMapper;
public GSiteRiverInfoServiceImpl(GSiteRiverInfoMapper gSiteRiverInfoMapper) {
this.gSiteRiverInfoMapper = gSiteRiverInfoMapper;
}
/**
* 查询河流基础信息
*
* @param id 河流基础信息主键
* @return 河流基础信息
*/
@Override
public GSiteRiverInfo selectGRiverInfoById(Long id)
{
return gSiteRiverInfoMapper.selectGRiverInfoBySiteId(id);
}
/**
* 查询河流基础信息列表
*
* @param gSiteRiverInfo 河流基础信息
* @return 河流基础信息
*/
@Override
public List<GSiteRiverInfo> selectGRiverInfoList(GSiteRiverInfo gSiteRiverInfo)
{
return gSiteRiverInfoMapper.selectGRiverInfoList(gSiteRiverInfo);
}
/**
* 新增河流基础信息
*
* @param gSiteRiverInfo 河流基础信息
* @return 结果
*/
@Override
public int insertGRiverInfo(GSiteRiverInfo gSiteRiverInfo)
{
gSiteRiverInfo.setCreateTime(DateUtils.getNowDate());
return gSiteRiverInfoMapper.insertGRiverInfo(gSiteRiverInfo);
}
/**
* 修改河流基础信息
*
* @param gSiteRiverInfo 河流基础信息
* @return 结果
*/
@Override
public int updateGRiverInfo(GSiteRiverInfo gSiteRiverInfo)
{
//必要参数校验
if(Objects.isNull(gSiteRiverInfo.getSiteId())){
throw new ServiceException("站点ID(siteId)字段不能为空!");
}
//检查是否有该条数据
if(Objects.isNull(gSiteRiverInfoMapper.selectGRiverInfoBySiteId(gSiteRiverInfo.getSiteId()))){
//没有该条数据则新增
gSiteRiverInfo.setCreateTime(DateUtils.getNowDate());
return insertGRiverInfo(gSiteRiverInfo);
}
gSiteRiverInfo.setUpdateTime(DateUtils.getNowDate());
return gSiteRiverInfoMapper.updateGRiverInfo(gSiteRiverInfo);
}
/**
* 批量删除河流基础信息
*
* @param ids 需要删除的河流基础信息主键
* @return 结果
*/
@Override
public int deleteGRiverInfoByIds(Long[] ids)
{
return gSiteRiverInfoMapper.deleteGRiverInfoByIds(ids);
}
/**
* 删除河流基础信息信息
*
* @param id 河流基础信息主键
* @return 结果
*/
@Override
public int deleteGRiverInfoById(Long id)
{
return gSiteRiverInfoMapper.deleteGRiverInfoById(id);
}
}

View File

@ -7,7 +7,9 @@ import java.util.stream.Collectors;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONException; import cn.hutool.json.JSONException;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
@ -117,10 +119,29 @@ public class GSitesServiceImpl extends ServiceImpl<GSiteGroupsMapper,GSiteGroups
if (Objects.isNull(jsonData)) { if (Objects.isNull(jsonData)) {
throw new ServiceException("上传站点地图json数据为空"); throw new ServiceException("上传站点地图json数据为空");
} }
//校验json格式是否正确 //校验文件内容是否是json格式
if (!isValidJson(jsonData)) { if (!isValidJson(jsonData)) {
throw new ServiceException("json格式不正确"); throw new ServiceException("json格式不正确");
} }
//校验json对象是否合法
JSONObject jsonObject = JSONUtil.parseObj(jsonData);
if (!jsonObject.containsKey("coordinates")) {
throw new ServiceException("json缺少coordinates属性");
}
//判断coordinates的值必须为点线面的一种
Object coordinates = jsonObject.get("coordinates");
//解析为数组
if (!(coordinates instanceof JSONArray)) {
throw new ServiceException("coordinates的值必须为数组类型");
}
JSONArray jsonArray = JSONUtil.parseArray(coordinates);
//判断数组每个元素必须为经度或纬度
// for (Object o : jsonArray) {
// if (!(o instanceof Double)) {
// throw new ServiceException("coordinates必须只包含经纬度数据");
// }
// }
int startIndex = space.indexOf("/profile/upload/"); int startIndex = space.indexOf("/profile/upload/");
String relativeUrl = space.substring(startIndex); String relativeUrl = space.substring(startIndex);
gSites.setSpace(relativeUrl); gSites.setSpace(relativeUrl);
@ -161,6 +182,20 @@ public class GSitesServiceImpl extends ServiceImpl<GSiteGroupsMapper,GSiteGroups
} }
return true; return true;
} }
/**
* 验证json对象是否是数组
*/
public boolean isValidJsonArray(String jsonStr) {
try {
JSONUtil.parseArray(jsonStr);
} catch (JSONException e) {
return false;
}
return true;
}
/** /**
* 批量删除站点 * 批量删除站点
*/ */

View File

@ -97,7 +97,7 @@
<if test="icon != null">icon = #{icon},</if> <if test="icon != null">icon = #{icon},</if>
<if test="tag != null">tag = #{tag},</if> <if test="tag != null">tag = #{tag},</if>
<if test="parentId != null">parent_id = #{parentId},</if> <if test="parentId != null">parent_id = #{parentId},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="projectName != null">project_name = #{projectName},</if> <if test="projectName != null">project_name = #{projectName},</if>
<if test="orderNum != null">order_num = #{orderNum},</if> <if test="orderNum != null">order_num = #{orderNum},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>

View File

@ -2,9 +2,9 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fastbee.ggroup.mapper.GSiteInfoMapper"> <mapper namespace="com.fastbee.ggroup.mapper.GSiteMonitorInfoMapper">
<resultMap type="GSiteInfo" id="GSiteInfoResult"> <resultMap type="GSiteMonitorInfo" id="GSiteInfoResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="monitoringStation" column="monitoring_station" /> <result property="monitoringStation" column="monitoring_station" />
<result property="pileNumber" column="pile_number" /> <result property="pileNumber" column="pile_number" />
@ -33,10 +33,10 @@
</resultMap> </resultMap>
<sql id="selectGSiteInfoVo"> <sql id="selectGSiteInfoVo">
select id, monitoring_station, pile_number, project_name, construction_year, equipment_brand, equipment_model, site_location, site_coordinates, longitude, latitude, protection_scope, protection_scope_remarks, fault_report, manager, manager_phone, pictures, code, remarks, del_flag, create_time, create_by, update_time, update_by, site_id from g_site_info select id, monitoring_station, pile_number, project_name, construction_year, equipment_brand, equipment_model, site_location, site_coordinates, longitude, latitude, protection_scope, protection_scope_remarks, fault_report, manager, manager_phone, pictures, code, remarks, del_flag, create_time, create_by, update_time, update_by, site_id from g_site_monitor_info
</sql> </sql>
<select id="selectGSiteInfoList" parameterType="GSiteInfo" resultMap="GSiteInfoResult"> <select id="selectGSiteInfoList" parameterType="GSiteMonitorInfo" resultMap="GSiteInfoResult">
<include refid="selectGSiteInfoVo"/> <include refid="selectGSiteInfoVo"/>
<where> <where>
<if test="monitoringStation != null and monitoringStation != ''"> and monitoring_station = #{monitoringStation}</if> <if test="monitoringStation != null and monitoringStation != ''"> and monitoring_station = #{monitoringStation}</if>
@ -61,13 +61,13 @@
</where> </where>
</select> </select>
<select id="selectGSiteInfoById" parameterType="Long" resultMap="GSiteInfoResult"> <select id="selectGSiteInfoBySiteId" parameterType="Long" resultMap="GSiteInfoResult">
<include refid="selectGSiteInfoVo"/> <include refid="selectGSiteInfoVo"/>
where site_id = #{siteId} where site_id = #{siteId}
</select> </select>
<insert id="insertGSiteInfo" parameterType="GSiteInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertGSiteInfo" parameterType="GSiteMonitorInfo" useGeneratedKeys="true" keyProperty="id">
insert into g_site_info insert into g_site_monitor_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="monitoringStation != null and monitoringStation != ''">monitoring_station,</if> <if test="monitoringStation != null and monitoringStation != ''">monitoring_station,</if>
<if test="pileNumber != null">pile_number,</if> <if test="pileNumber != null">pile_number,</if>
@ -122,8 +122,8 @@
</trim> </trim>
</insert> </insert>
<update id="updateGSiteInfo" parameterType="GSiteInfo"> <update id="updateGSiteInfo" parameterType="GSiteMonitorInfo">
update g_site_info update g_site_monitor_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="monitoringStation != null and monitoringStation != ''">monitoring_station = #{monitoringStation},</if> <if test="monitoringStation != null and monitoringStation != ''">monitoring_station = #{monitoringStation},</if>
<if test="pileNumber != null">pile_number = #{pileNumber},</if> <if test="pileNumber != null">pile_number = #{pileNumber},</if>
@ -154,11 +154,11 @@
</update> </update>
<delete id="deleteGSiteInfoById" parameterType="Long"> <delete id="deleteGSiteInfoById" parameterType="Long">
delete from g_site_info where id = #{id} delete from g_site_monitor_info where id = #{id}
</delete> </delete>
<delete id="deleteGSiteInfoByIds" parameterType="String"> <delete id="deleteGSiteInfoByIds" parameterType="String">
delete from g_site_info where id in delete from g_site_monitor_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

View File

@ -0,0 +1,248 @@
<?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.fastbee.ggroup.mapper.GSiteReservoirInfoMapper">
<resultMap type="GSiteReservoirInfo" id="GSiteReservoirInfoResult">
<result property="id" column="id" />
<result property="projectName" column="project_name" />
<result property="geoCoordinates" column="geo_coordinates" />
<result property="projectLocation" column="project_location" />
<result property="drainageBasin" column="drainage_basin" />
<result property="drainageSystem" column="drainage_system" />
<result property="river" column="river" />
<result property="townVillage" column="town_village" />
<result property="reservoirType" column="reservoir_type" />
<result property="reservoirFunction" column="reservoir_function" />
<result property="constructionStatus" column="construction_status" />
<result property="reservoirLevel" column="reservoir_level" />
<result property="mainDamLevel" column="main_dam_level" />
<result property="mainDamHeight" column="main_dam_height" />
<result property="mainDamLength" column="main_dam_length" />
<result property="damCrestElevation" column="dam_crest_elevation" />
<result property="normalStorageLevel" column="normal_storage_level" />
<result property="deadWaterLevel" column="dead_water_level" />
<result property="totalCapacity" column="total_capacity" />
<result property="beneficialCapacity" column="beneficial_capacity" />
<result property="deadStorage" column="dead_storage" />
<result property="normalStorageArea" column="normal_storage_area" />
<result property="annualSupplyCapacity" column="annual_supply_capacity" />
<result property="administrativeResponsible" column="administrative_responsible" />
<result property="administrativeUnitName" column="administrative_unit_name" />
<result property="administrativePosition" column="administrative_position" />
<result property="administrativePhone" column="administrative_phone" />
<result property="technicalResponsible" column="technical_responsible" />
<result property="technicalUnitName" column="technical_unit_name" />
<result property="technicalPosition" column="technical_position" />
<result property="technicalPhone" column="technical_phone" />
<result property="inspectionResponsible" column="inspection_responsible" />
<result property="inspectionUnitName" column="inspection_unit_name" />
<result property="inspectionPosition" column="inspection_position" />
<result property="inspectionPhone" column="inspection_phone" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createdBy" column="created_by" />
<result property="updatedBy" column="updated_by" />
<result property="delFlag" column="del_flag" />
<result property="siteId" column="site_id" />
</resultMap>
<sql id="selectGSiteReservoirInfoVo">
select id, project_name, geo_coordinates, project_location, drainage_basin, drainage_system, river, town_village, reservoir_type, reservoir_function, construction_status, reservoir_level, main_dam_level, main_dam_height, main_dam_length, dam_crest_elevation, normal_storage_level, dead_water_level, total_capacity, beneficial_capacity, dead_storage, normal_storage_area, annual_supply_capacity, administrative_responsible, administrative_unit_name, administrative_position, administrative_phone, technical_responsible, technical_unit_name, technical_position, technical_phone, inspection_responsible, inspection_unit_name, inspection_position, inspection_phone, create_time, update_time, created_by, updated_by, del_flag, site_id from g_site_reservoir_info
</sql>
<select id="selectGSiteReservoirInfoList" parameterType="GSiteReservoirInfo" resultMap="GSiteReservoirInfoResult">
<include refid="selectGSiteReservoirInfoVo"/>
<where>
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
<if test="geoCoordinates != null and geoCoordinates != ''"> and geo_coordinates = #{geoCoordinates}</if>
<if test="projectLocation != null and projectLocation != ''"> and project_location = #{projectLocation}</if>
<if test="drainageBasin != null and drainageBasin != ''"> and drainage_basin = #{drainageBasin}</if>
<if test="drainageSystem != null and drainageSystem != ''"> and drainage_system = #{drainageSystem}</if>
<if test="river != null and river != ''"> and river = #{river}</if>
<if test="townVillage != null and townVillage != ''"> and town_village = #{townVillage}</if>
<if test="reservoirType != null and reservoirType != ''"> and reservoir_type = #{reservoirType}</if>
<if test="reservoirFunction != null and reservoirFunction != ''"> and reservoir_function = #{reservoirFunction}</if>
<if test="constructionStatus != null and constructionStatus != ''"> and construction_status = #{constructionStatus}</if>
<if test="reservoirLevel != null and reservoirLevel != ''"> and reservoir_level = #{reservoirLevel}</if>
<if test="mainDamLevel != null and mainDamLevel != ''"> and main_dam_level = #{mainDamLevel}</if>
<if test="mainDamHeight != null "> and main_dam_height = #{mainDamHeight}</if>
<if test="mainDamLength != null "> and main_dam_length = #{mainDamLength}</if>
<if test="damCrestElevation != null "> and dam_crest_elevation = #{damCrestElevation}</if>
<if test="normalStorageLevel != null "> and normal_storage_level = #{normalStorageLevel}</if>
<if test="deadWaterLevel != null "> and dead_water_level = #{deadWaterLevel}</if>
<if test="totalCapacity != null "> and total_capacity = #{totalCapacity}</if>
<if test="beneficialCapacity != null "> and beneficial_capacity = #{beneficialCapacity}</if>
<if test="deadStorage != null "> and dead_storage = #{deadStorage}</if>
<if test="normalStorageArea != null "> and normal_storage_area = #{normalStorageArea}</if>
<if test="annualSupplyCapacity != null "> and annual_supply_capacity = #{annualSupplyCapacity}</if>
<if test="administrativeResponsible != null and administrativeResponsible != ''"> and administrative_responsible = #{administrativeResponsible}</if>
<if test="administrativeUnitName != null and administrativeUnitName != ''"> and administrative_unit_name like concat('%', #{administrativeUnitName}, '%')</if>
<if test="administrativePosition != null and administrativePosition != ''"> and administrative_position = #{administrativePosition}</if>
<if test="administrativePhone != null and administrativePhone != ''"> and administrative_phone = #{administrativePhone}</if>
<if test="technicalResponsible != null and technicalResponsible != ''"> and technical_responsible = #{technicalResponsible}</if>
<if test="technicalUnitName != null and technicalUnitName != ''"> and technical_unit_name like concat('%', #{technicalUnitName}, '%')</if>
<if test="technicalPosition != null and technicalPosition != ''"> and technical_position = #{technicalPosition}</if>
<if test="technicalPhone != null and technicalPhone != ''"> and technical_phone = #{technicalPhone}</if>
<if test="inspectionResponsible != null and inspectionResponsible != ''"> and inspection_responsible = #{inspectionResponsible}</if>
<if test="inspectionUnitName != null and inspectionUnitName != ''"> and inspection_unit_name like concat('%', #{inspectionUnitName}, '%')</if>
<if test="inspectionPosition != null and inspectionPosition != ''"> and inspection_position = #{inspectionPosition}</if>
<if test="inspectionPhone != null and inspectionPhone != ''"> and inspection_phone = #{inspectionPhone}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
<if test="siteId != null "> and site_id = #{siteId}</if>
</where>
</select>
<select id="selectGSiteReservoirInfoBySiteId" parameterType="Long" resultMap="GSiteReservoirInfoResult">
<include refid="selectGSiteReservoirInfoVo"/>
where site_id = #{siteId}
</select>
<insert id="insertGSiteReservoirInfo" parameterType="GSiteReservoirInfo" useGeneratedKeys="true" keyProperty="id">
insert into g_site_reservoir_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectName != null">project_name,</if>
<if test="geoCoordinates != null">geo_coordinates,</if>
<if test="projectLocation != null">project_location,</if>
<if test="drainageBasin != null">drainage_basin,</if>
<if test="drainageSystem != null">drainage_system,</if>
<if test="river != null">river,</if>
<if test="townVillage != null">town_village,</if>
<if test="reservoirType != null">reservoir_type,</if>
<if test="reservoirFunction != null">reservoir_function,</if>
<if test="constructionStatus != null">construction_status,</if>
<if test="reservoirLevel != null">reservoir_level,</if>
<if test="mainDamLevel != null">main_dam_level,</if>
<if test="mainDamHeight != null">main_dam_height,</if>
<if test="mainDamLength != null">main_dam_length,</if>
<if test="damCrestElevation != null">dam_crest_elevation,</if>
<if test="normalStorageLevel != null">normal_storage_level,</if>
<if test="deadWaterLevel != null">dead_water_level,</if>
<if test="totalCapacity != null">total_capacity,</if>
<if test="beneficialCapacity != null">beneficial_capacity,</if>
<if test="deadStorage != null">dead_storage,</if>
<if test="normalStorageArea != null">normal_storage_area,</if>
<if test="annualSupplyCapacity != null">annual_supply_capacity,</if>
<if test="administrativeResponsible != null">administrative_responsible,</if>
<if test="administrativeUnitName != null">administrative_unit_name,</if>
<if test="administrativePosition != null">administrative_position,</if>
<if test="administrativePhone != null">administrative_phone,</if>
<if test="technicalResponsible != null">technical_responsible,</if>
<if test="technicalUnitName != null">technical_unit_name,</if>
<if test="technicalPosition != null">technical_position,</if>
<if test="technicalPhone != null">technical_phone,</if>
<if test="inspectionResponsible != null">inspection_responsible,</if>
<if test="inspectionUnitName != null">inspection_unit_name,</if>
<if test="inspectionPosition != null">inspection_position,</if>
<if test="inspectionPhone != null">inspection_phone,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createdBy != null">created_by,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="delFlag != null">del_flag,</if>
<if test="siteId != null">site_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectName != null">#{projectName},</if>
<if test="geoCoordinates != null">#{geoCoordinates},</if>
<if test="projectLocation != null">#{projectLocation},</if>
<if test="drainageBasin != null">#{drainageBasin},</if>
<if test="drainageSystem != null">#{drainageSystem},</if>
<if test="river != null">#{river},</if>
<if test="townVillage != null">#{townVillage},</if>
<if test="reservoirType != null">#{reservoirType},</if>
<if test="reservoirFunction != null">#{reservoirFunction},</if>
<if test="constructionStatus != null">#{constructionStatus},</if>
<if test="reservoirLevel != null">#{reservoirLevel},</if>
<if test="mainDamLevel != null">#{mainDamLevel},</if>
<if test="mainDamHeight != null">#{mainDamHeight},</if>
<if test="mainDamLength != null">#{mainDamLength},</if>
<if test="damCrestElevation != null">#{damCrestElevation},</if>
<if test="normalStorageLevel != null">#{normalStorageLevel},</if>
<if test="deadWaterLevel != null">#{deadWaterLevel},</if>
<if test="totalCapacity != null">#{totalCapacity},</if>
<if test="beneficialCapacity != null">#{beneficialCapacity},</if>
<if test="deadStorage != null">#{deadStorage},</if>
<if test="normalStorageArea != null">#{normalStorageArea},</if>
<if test="annualSupplyCapacity != null">#{annualSupplyCapacity},</if>
<if test="administrativeResponsible != null">#{administrativeResponsible},</if>
<if test="administrativeUnitName != null">#{administrativeUnitName},</if>
<if test="administrativePosition != null">#{administrativePosition},</if>
<if test="administrativePhone != null">#{administrativePhone},</if>
<if test="technicalResponsible != null">#{technicalResponsible},</if>
<if test="technicalUnitName != null">#{technicalUnitName},</if>
<if test="technicalPosition != null">#{technicalPosition},</if>
<if test="technicalPhone != null">#{technicalPhone},</if>
<if test="inspectionResponsible != null">#{inspectionResponsible},</if>
<if test="inspectionUnitName != null">#{inspectionUnitName},</if>
<if test="inspectionPosition != null">#{inspectionPosition},</if>
<if test="inspectionPhone != null">#{inspectionPhone},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="siteId != null">#{siteId},</if>
</trim>
</insert>
<update id="updateGSiteReservoirInfo" parameterType="GSiteReservoirInfo">
update g_site_reservoir_info
<trim prefix="SET" suffixOverrides=",">
<if test="projectName != null">project_name = #{projectName},</if>
<if test="geoCoordinates != null">geo_coordinates = #{geoCoordinates},</if>
<if test="projectLocation != null">project_location = #{projectLocation},</if>
<if test="drainageBasin != null">drainage_basin = #{drainageBasin},</if>
<if test="drainageSystem != null">drainage_system = #{drainageSystem},</if>
<if test="river != null">river = #{river},</if>
<if test="townVillage != null">town_village = #{townVillage},</if>
<if test="reservoirType != null">reservoir_type = #{reservoirType},</if>
<if test="reservoirFunction != null">reservoir_function = #{reservoirFunction},</if>
<if test="constructionStatus != null">construction_status = #{constructionStatus},</if>
<if test="reservoirLevel != null">reservoir_level = #{reservoirLevel},</if>
<if test="mainDamLevel != null">main_dam_level = #{mainDamLevel},</if>
<if test="mainDamHeight != null">main_dam_height = #{mainDamHeight},</if>
<if test="mainDamLength != null">main_dam_length = #{mainDamLength},</if>
<if test="damCrestElevation != null">dam_crest_elevation = #{damCrestElevation},</if>
<if test="normalStorageLevel != null">normal_storage_level = #{normalStorageLevel},</if>
<if test="deadWaterLevel != null">dead_water_level = #{deadWaterLevel},</if>
<if test="totalCapacity != null">total_capacity = #{totalCapacity},</if>
<if test="beneficialCapacity != null">beneficial_capacity = #{beneficialCapacity},</if>
<if test="deadStorage != null">dead_storage = #{deadStorage},</if>
<if test="normalStorageArea != null">normal_storage_area = #{normalStorageArea},</if>
<if test="annualSupplyCapacity != null">annual_supply_capacity = #{annualSupplyCapacity},</if>
<if test="administrativeResponsible != null">administrative_responsible = #{administrativeResponsible},</if>
<if test="administrativeUnitName != null">administrative_unit_name = #{administrativeUnitName},</if>
<if test="administrativePosition != null">administrative_position = #{administrativePosition},</if>
<if test="administrativePhone != null">administrative_phone = #{administrativePhone},</if>
<if test="technicalResponsible != null">technical_responsible = #{technicalResponsible},</if>
<if test="technicalUnitName != null">technical_unit_name = #{technicalUnitName},</if>
<if test="technicalPosition != null">technical_position = #{technicalPosition},</if>
<if test="technicalPhone != null">technical_phone = #{technicalPhone},</if>
<if test="inspectionResponsible != null">inspection_responsible = #{inspectionResponsible},</if>
<if test="inspectionUnitName != null">inspection_unit_name = #{inspectionUnitName},</if>
<if test="inspectionPosition != null">inspection_position = #{inspectionPosition},</if>
<if test="inspectionPhone != null">inspection_phone = #{inspectionPhone},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="siteId != null">site_id = #{siteId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteGSiteReservoirInfoById" parameterType="Long">
delete from g_site_reservoir_info where id = #{id}
</delete>
<delete id="deleteGSiteReservoirInfoByIds" parameterType="String">
delete from g_site_reservoir_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -2,9 +2,9 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fastbee.ggroup.mapper.GRiverInfoMapper"> <mapper namespace="com.fastbee.ggroup.mapper.GSiteRiverInfoMapper">
<resultMap type="GRiverInfo" id="GRiverInfoResult"> <resultMap type="GSiteRiverInfo" id="GRiverInfoResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="name" column="name" /> <result property="name" column="name" />
<result property="code" column="code" /> <result property="code" column="code" />
@ -45,10 +45,10 @@
</resultMap> </resultMap>
<sql id="selectGRiverInfoVo"> <sql id="selectGRiverInfoVo">
select id, name, code, length, area, towns, start_latitude, start_longitude, start_location, end_latitude, end_longitude, end_location, pollution_drainage_number, water_related_projects_and_facilities_number, spanned_crossed_nearby_buildings_number, design_standard_recurrence_period, river_supervisor_name, river_supervisor_position, river_supervisor_phone, contact_unit, unit_contact_person_name, unit_contact_person_phone, contact_person_name, contact_person_phone, flood_prevention_materials, admin_person_name, admin_person_position, admin_person_phone, tech_person_name, tech_person_position, tech_person_phone, create_time, update_time, created_by, updated_by, del_flag, site_id from g_river_info select id, name, code, length, area, towns, start_latitude, start_longitude, start_location, end_latitude, end_longitude, end_location, pollution_drainage_number, water_related_projects_and_facilities_number, spanned_crossed_nearby_buildings_number, design_standard_recurrence_period, river_supervisor_name, river_supervisor_position, river_supervisor_phone, contact_unit, unit_contact_person_name, unit_contact_person_phone, contact_person_name, contact_person_phone, flood_prevention_materials, admin_person_name, admin_person_position, admin_person_phone, tech_person_name, tech_person_position, tech_person_phone, create_time, update_time, created_by, updated_by, del_flag, site_id from g_site_river_info
</sql> </sql>
<select id="selectGRiverInfoList" parameterType="GRiverInfo" resultMap="GRiverInfoResult"> <select id="selectGRiverInfoList" parameterType="GSiteRiverInfo" resultMap="GRiverInfoResult">
<include refid="selectGRiverInfoVo"/> <include refid="selectGRiverInfoVo"/>
<where> <where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
@ -87,13 +87,13 @@
</where> </where>
</select> </select>
<select id="selectGRiverInfoById" parameterType="Long" resultMap="GRiverInfoResult"> <select id="selectGRiverInfoBySiteId" parameterType="Long" resultMap="GRiverInfoResult">
<include refid="selectGRiverInfoVo"/> <include refid="selectGRiverInfoVo"/>
where id = #{id} where site_id = #{siteId}
</select> </select>
<insert id="insertGRiverInfo" parameterType="GRiverInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertGRiverInfo" parameterType="GSiteRiverInfo" useGeneratedKeys="true" keyProperty="id">
insert into g_river_info insert into g_site_river_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if> <if test="name != null">name,</if>
<if test="code != null">code,</if> <if test="code != null">code,</if>
@ -172,8 +172,8 @@
</trim> </trim>
</insert> </insert>
<update id="updateGRiverInfo" parameterType="GRiverInfo"> <update id="updateGRiverInfo" parameterType="GSiteRiverInfo">
update g_river_info update g_site_river_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if> <if test="name != null">name = #{name},</if>
<if test="code != null">code = #{code},</if> <if test="code != null">code = #{code},</if>
@ -216,11 +216,11 @@
</update> </update>
<delete id="deleteGRiverInfoById" parameterType="Long"> <delete id="deleteGRiverInfoById" parameterType="Long">
delete from g_river_info where id = #{id} delete from g_site_river_info where id = #{id}
</delete> </delete>
<delete id="deleteGRiverInfoByIds" parameterType="String"> <delete id="deleteGRiverInfoByIds" parameterType="String">
delete from g_river_info where id in delete from g_site_river_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

View File

@ -21,7 +21,7 @@ public class Project extends BaseEntity
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 项目id */ /** 项目id */
private Long projectId; private Long id;
/** 项目名称 */ /** 项目名称 */
@Excel(name = "项目名称") @Excel(name = "项目名称")

View File

@ -52,7 +52,7 @@ public interface IProjectService
* @param projectIds 需要删除的项目主键集合 * @param projectIds 需要删除的项目主键集合
* @return 结果 * @return 结果
*/ */
int deleteProjectByProjectIds(Long[] projectIds); int deleteProjectByProjectIds(Long projectId);

View File

@ -4,6 +4,7 @@ import cn.hutool.core.codec.Base64;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.fastbee.common.constant.ProjectLevelConstant; import com.fastbee.common.constant.ProjectLevelConstant;
import com.fastbee.common.core.domain.entity.SysDept; import com.fastbee.common.core.domain.entity.SysDept;
import com.fastbee.common.core.domain.entity.SysUser;
import com.fastbee.common.exception.ServiceException; import com.fastbee.common.exception.ServiceException;
import com.fastbee.common.holder.ProjectHolder; import com.fastbee.common.holder.ProjectHolder;
import com.fastbee.common.utils.DateUtils; import com.fastbee.common.utils.DateUtils;
@ -12,6 +13,7 @@ import com.fastbee.project.mapper.ProjectMapper;
import com.fastbee.project.service.IProjectService; import com.fastbee.project.service.IProjectService;
import com.fastbee.system.mapper.SysDeptMapper; import com.fastbee.system.mapper.SysDeptMapper;
import com.fastbee.system.mapper.SysUserMapper;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -28,13 +30,13 @@ public class ProjectServiceImpl implements IProjectService
{ {
private final ProjectMapper projectMapper; private final ProjectMapper projectMapper;
private final SysDeptMapper sysDeptMapper; private final SysDeptMapper sysDeptMapper;
private final SysUserMapper sysUserMapper;
public ProjectServiceImpl(ProjectMapper projectMapper, SysDeptMapper sysDeptMapper) { public ProjectServiceImpl(ProjectMapper projectMapper, SysDeptMapper sysDeptMapper, SysUserMapper sysUserMapper) {
this.projectMapper = projectMapper; this.projectMapper = projectMapper;
this.sysDeptMapper = sysDeptMapper; this.sysDeptMapper = sysDeptMapper;
this.sysUserMapper = sysUserMapper;
} }
/** /**
@ -56,7 +58,7 @@ public class ProjectServiceImpl implements IProjectService
public List<Project> selectProjectList(Project project) public List<Project> selectProjectList(Project project)
{ {
return new LambdaQueryChainWrapper<>(projectMapper) return new LambdaQueryChainWrapper<>(projectMapper)
.select(Project::getProjectId, Project::getProjectName, Project::getScope, .select(Project::getId, Project::getProjectName, Project::getScope,
Project::getAdministrativeArea, Project::getDeptId,Project::getAdministrativeAreaCode, Project::getAdministrativeArea, Project::getDeptId,Project::getAdministrativeAreaCode,
Project::getLogo, Project::getImage, Project::getLevel, Project::getDeptName, Project::getLogo, Project::getImage, Project::getLevel, Project::getDeptName,
Project::getCreateTime) Project::getCreateTime)
@ -71,7 +73,7 @@ public class ProjectServiceImpl implements IProjectService
public int insertProject(Project project) public int insertProject(Project project)
{ //判断选择的机构下是否已经绑定项目 { //判断选择的机构下是否已经绑定项目
List<Project> projectList = new LambdaQueryChainWrapper<>(projectMapper) List<Project> projectList = new LambdaQueryChainWrapper<>(projectMapper)
.select(Project::getProjectId, Project::getProjectName) .select(Project::getId, Project::getProjectName)
.eq(Project::getDeptId, project.getDeptId()).list(); .eq(Project::getDeptId, project.getDeptId()).list();
if(!projectList.isEmpty()){ if(!projectList.isEmpty()){
throw new ServiceException("该机构下已经存在项目"); throw new ServiceException("该机构下已经存在项目");
@ -82,15 +84,16 @@ public class ProjectServiceImpl implements IProjectService
/** /**
* 修改项目 * 修改项目
* @return 结果
*/ */
@Override @Override
public int updateProject(Project project) public int updateProject(Project project)
{ {
//判断选择的机构下是否已经绑定项目 //判断选择的机构下是否已经绑定项目
Project one = new LambdaQueryChainWrapper<>(projectMapper) Project one = new LambdaQueryChainWrapper<>(projectMapper)
.select(Project::getProjectId, Project::getProjectName,Project::getDeptId) .select(Project::getId, Project::getProjectName,Project::getDeptId)
.eq(Project::getDeptId, project.getDeptId()).one(); .eq(Project::getDeptId, project.getDeptId())
// .ne(Project::getId,project.getId())
.one();
if(Objects.isNull(one)){ if(Objects.isNull(one)){
throw new ServiceException("项目不存在!"); throw new ServiceException("项目不存在!");
} }
@ -102,12 +105,12 @@ public class ProjectServiceImpl implements IProjectService
} }
/** /**
* 批量删除项目 * 删除项目
*/ */
@Override @Override
public int deleteProjectByProjectIds(Long[] projectIds) public int deleteProjectByProjectIds(Long projectId)
{ {
return projectMapper.deleteProjectByProjectIds(projectIds); return projectMapper.deleteById(projectId);
} }
@ -116,20 +119,27 @@ public class ProjectServiceImpl implements IProjectService
*/ */
@Override @Override
public Map<String, Object> selectProjectByUserId(Long userId) { public Map<String, Object> selectProjectByUserId(Long userId) {
//查询用户所属机构
SysUser sysUser = new LambdaQueryChainWrapper<>(sysUserMapper)
.select(SysUser::getUserId, SysUser::getDeptId)
.eq(SysUser::getUserId, userId)
.one();
//查询该管理员所管理的项目id以及子项目id列表 //查询该管理员所管理的项目id以及子项目id列表
Project project = new LambdaQueryChainWrapper<>(projectMapper) Project project = new LambdaQueryChainWrapper<>(projectMapper)
.select(Project::getProjectId, Project::getProjectName,Project::getLevel,Project::getDeptId) .select(Project::getId, Project::getProjectName,Project::getLevel,Project::getDeptId)
.eq(Project::getOwnerId, userId) .eq(Project::getDeptId, sysUser.getDeptId())
.one(); .one();
if(Objects.isNull(project)){ if(Objects.isNull(project)){
return null; return null;
} }
List<Long> projects = getAllProjects(project.getProjectId()); List<Long> projects = getAllProjects(project.getId());
//把列表进行Base64编码 //把列表进行Base64编码
String projectsBase64 = Base64.encode(projects.toString()); String projectsBase64 = Base64.encode(projects.toString());
HashMap<String , Object> map = new HashMap<>(); HashMap<String , Object> map = new HashMap<>();
map.put("projectIds",projectsBase64); map.put("projectIds",projectsBase64);
map.put("projectId",project.getProjectId()); map.put("projectId",project.getId());
map.put("projectName", project.getProjectName()); map.put("projectName", project.getProjectName());
map.put("projectLevel",project.getLevel().equals("市级")? ProjectLevelConstant.LEVEL_CITY :ProjectLevelConstant.LEVEL_COUNTY); map.put("projectLevel",project.getLevel().equals("市级")? ProjectLevelConstant.LEVEL_CITY :ProjectLevelConstant.LEVEL_COUNTY);
return map; return map;
@ -146,7 +156,7 @@ public class ProjectServiceImpl implements IProjectService
.list(); .list();
//查询所有项目 //查询所有项目
List<Project> projectList = new LambdaQueryChainWrapper<>(projectMapper) List<Project> projectList = new LambdaQueryChainWrapper<>(projectMapper)
.select(Project::getProjectId, Project::getDeptId) .select(Project::getId, Project::getDeptId)
.list(); .list();
//遍历项目把已绑定项目的机构从机构列表中移除 //遍历项目把已绑定项目的机构从机构列表中移除
for (Project project : projectList) { for (Project project : projectList) {
@ -167,7 +177,7 @@ public class ProjectServiceImpl implements IProjectService
if(Objects.isNull(ProjectHolder.getProjectInfo().getProjectIdList())){ if(Objects.isNull(ProjectHolder.getProjectInfo().getProjectIdList())){
//查询所有一级项目列表 //查询所有一级项目列表
projectList = new LambdaQueryChainWrapper<>(projectMapper) projectList = new LambdaQueryChainWrapper<>(projectMapper)
.select(Project::getProjectId, Project::getProjectName) .select(Project::getId, Project::getProjectName)
.isNull(Project::getParentId) .isNull(Project::getParentId)
.list(); .list();
} }
@ -175,7 +185,7 @@ public class ProjectServiceImpl implements IProjectService
else if(Objects.nonNull(ProjectHolder.getProjectInfo().getProjectIdList())){ else if(Objects.nonNull(ProjectHolder.getProjectInfo().getProjectIdList())){
//查询所有子一级项目列表 //查询所有子一级项目列表
projectList = new LambdaQueryChainWrapper<>(projectMapper) projectList = new LambdaQueryChainWrapper<>(projectMapper)
.select(Project::getProjectId, Project::getProjectName) .select(Project::getId, Project::getProjectName)
.in(!ProjectHolder.getProjectInfo().getProjectIdList().isEmpty(),Project::getParentId, ProjectHolder.getProjectInfo().getProjectIdList()) .in(!ProjectHolder.getProjectInfo().getProjectIdList().isEmpty(),Project::getParentId, ProjectHolder.getProjectInfo().getProjectIdList())
.list(); .list();
} }
@ -187,22 +197,22 @@ public class ProjectServiceImpl implements IProjectService
// 查询当前项目 // 查询当前项目
Project currentProject = new LambdaQueryChainWrapper<>(projectMapper) Project currentProject = new LambdaQueryChainWrapper<>(projectMapper)
.select(Project::getProjectId, Project::getProjectName) .select(Project::getId, Project::getProjectName)
.eq(Project::getProjectId, projectId) .eq(Project::getId, projectId)
.one(); .one();
if (currentProject != null) { if (currentProject != null) {
allProjects.add(currentProject.getProjectId()); allProjects.add(currentProject.getId());
// 查询当前项目的子项目 // 查询当前项目的子项目
List<Project> children = new LambdaQueryChainWrapper<>(projectMapper) List<Project> children = new LambdaQueryChainWrapper<>(projectMapper)
.select(Project::getProjectId, Project::getProjectName) .select(Project::getId, Project::getProjectName)
.eq(Project::getParentId, projectId) .eq(Project::getParentId, projectId)
.list(); .list();
// 递归查询子项目 // 递归查询子项目
for (Project child : children) { for (Project child : children) {
allProjects.addAll(getAllProjects(child.getProjectId())); allProjects.addAll(getAllProjects(child.getId()));
} }
} }

View File

@ -5,7 +5,7 @@
<mapper namespace="com.fastbee.project.mapper.ProjectMapper"> <mapper namespace="com.fastbee.project.mapper.ProjectMapper">
<resultMap type="Project" id="ProjectResult"> <resultMap type="Project" id="ProjectResult">
<result property="projectId" column="project_id" /> <result property="id" column="id" />
<result property="projectName" column="project_name" /> <result property="projectName" column="project_name" />
<result property="sysShowName" column="sys_show_name" /> <result property="sysShowName" column="sys_show_name" />
<result property="centralCoordinates" column="central_coordinates" /> <result property="centralCoordinates" column="central_coordinates" />
@ -34,7 +34,7 @@
</resultMap> </resultMap>
<sql id="selectProjectVo"> <sql id="selectProjectVo">
select project_id, project_name, sys_show_name, central_coordinates, scope, administrative_area, owner, logo, image, video_introduction, remark, p_params, introduce, del_flag, create_time, create_by, update_time, remarks, tenant_id, tenant_name, owner_id, parent_id, dept_id, administrative_area_code, dept_name, level from project select id, project_name, sys_show_name, central_coordinates, scope, administrative_area, owner, logo, image, video_introduction, remark, p_params, introduce, del_flag, create_time, create_by, update_time, remarks, tenant_id, tenant_name, owner_id, parent_id, dept_id, administrative_area_code, dept_name, level from project
</sql> </sql>
<select id="selectProjectList" parameterType="Project" resultMap="ProjectResult"> <select id="selectProjectList" parameterType="Project" resultMap="ProjectResult">
@ -65,13 +65,13 @@
<select id="selectProjectByProjectId" parameterType="Long" resultMap="ProjectResult"> <select id="selectProjectByProjectId" parameterType="Long" resultMap="ProjectResult">
<include refid="selectProjectVo"/> <include refid="selectProjectVo"/>
where project_id = #{projectId} where id = #{id}
</select> </select>
<insert id="insertProject" parameterType="Project"> <insert id="insertProject" parameterType="Project">
insert into project insert into project
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectId != null">project_id,</if> <if test="id != null">id,</if>
<if test="projectName != null and projectName != ''">project_name,</if> <if test="projectName != null and projectName != ''">project_name,</if>
<if test="sysShowName != null and sysShowName != ''">sys_show_name,</if> <if test="sysShowName != null and sysShowName != ''">sys_show_name,</if>
<if test="centralCoordinates != null and centralCoordinates != ''">central_coordinates,</if> <if test="centralCoordinates != null and centralCoordinates != ''">central_coordinates,</if>
@ -99,7 +99,7 @@
<if test="level != null">level,</if> <if test="level != null">level,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectId != null">#{projectId},</if> <if test="id != null">#{id},</if>
<if test="projectName != null and projectName != ''">#{projectName},</if> <if test="projectName != null and projectName != ''">#{projectName},</if>
<if test="sysShowName != null and sysShowName != ''">#{sysShowName},</if> <if test="sysShowName != null and sysShowName != ''">#{sysShowName},</if>
<if test="centralCoordinates != null and centralCoordinates != ''">#{centralCoordinates},</if> <if test="centralCoordinates != null and centralCoordinates != ''">#{centralCoordinates},</if>
@ -157,17 +157,17 @@
<if test="deptName != null">dept_name = #{deptName},</if> <if test="deptName != null">dept_name = #{deptName},</if>
<if test="level != null">level = #{level},</if> <if test="level != null">level = #{level},</if>
</trim> </trim>
where project_id = #{projectId} where id = #{id}
</update> </update>
<delete id="deleteProjectByProjectId" parameterType="Long"> <delete id="deleteProjectByProjectId" parameterType="Long">
delete from project where project_id = #{projectId} delete from project where id = #{id}
</delete> </delete>
<delete id="deleteProjectByProjectIds" parameterType="String"> <delete id="deleteProjectByProjectIds" parameterType="String">
delete from project where project_id in delete from project where id in
<foreach item="projectId" collection="array" open="(" separator="," close=")"> <foreach item="projectId" collection="array" open="(" separator="," close=")">
#{projectId} #{id}
</foreach> </foreach>
</delete> </delete>
</mapper> </mapper>

View File

@ -1,6 +1,7 @@
package com.fastbee.system.mapper; package com.fastbee.system.mapper;
import com.fastbee.common.core.domain.entity.SysUser; import com.fastbee.common.core.domain.entity.SysUser;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -10,7 +11,7 @@ import java.util.List;
* *
* @author ruoyi * @author ruoyi
*/ */
public interface SysUserMapper public interface SysUserMapper extends MPJBaseMapper<SysUser>
{ {
/** /**
* 根据条件分页查询用户列表 * 根据条件分页查询用户列表