106 changed files with 3758 additions and 713 deletions
@ -0,0 +1,26 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<parent> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>dk-api</artifactId> |
|||
<version>${revision}</version> |
|||
</parent> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<artifactId>api-business</artifactId> |
|||
|
|||
<description>api-business业务接口模块 |
|||
</description> |
|||
|
|||
<dependencies> |
|||
|
|||
<!-- RuoYi Common Core--> |
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>common-core</artifactId> |
|||
</dependency> |
|||
</dependencies> |
|||
|
|||
</project> |
@ -0,0 +1,19 @@ |
|||
package org.dromara.business.api; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 预警服务 |
|||
* |
|||
* @author Lion Li |
|||
*/ |
|||
public interface RemoteBusinessAlertService { |
|||
|
|||
|
|||
/** |
|||
* 更新此条预警审批时候的状态 |
|||
* @param businessId 业务id(预警、工单) |
|||
* @param flowStatus 流程状态 |
|||
*/ |
|||
void updateAlertStatus(String businessId, String flowStatus); |
|||
} |
@ -0,0 +1,19 @@ |
|||
package org.dromara.workflow.api.domain.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
/** |
|||
* 流程类型,后续有的话可以根据具体业务加,要保证流程定义里面的标识key和这边code保持一致 |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum WorkflowCodeEnum { |
|||
|
|||
ALERT("alert","预警流程"); |
|||
|
|||
final String code; |
|||
|
|||
final String description; |
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
package org.dromara.business.controller; |
|||
|
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.business.domain.BusinessAlert; |
|||
import org.dromara.business.domain.bo.BusinessAlertBo; |
|||
import org.dromara.business.service.IBusinessAlertService; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* 预警服务 |
|||
* |
|||
* @author LionLi |
|||
* @date 2025-02-27 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping |
|||
@Tag(name = "预警服务") |
|||
public class BusinessAlertController extends BaseController { |
|||
|
|||
|
|||
private final IBusinessAlertService businessAlertService; |
|||
|
|||
/** |
|||
* 查询全部预警 |
|||
*/ |
|||
@Operation(summary ="查询全部预警",description = "查询全部预警") |
|||
@GetMapping("/alert/page/all") |
|||
public TableDataInfo<BusinessAlert> pageBusinessAlert(BusinessAlertBo bo, PageQuery pageQuery) { |
|||
return businessAlertService.pageBusinessAlert(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 查询审批的预警 |
|||
*/ |
|||
@Operation(summary ="查询待办的预警",description = "查询待办的预警") |
|||
@GetMapping("/alert/page/todo") |
|||
public TableDataInfo<BusinessAlert> pageBusinessAlertTodo(BusinessAlertBo bo, PageQuery pageQuery) { |
|||
return businessAlertService.pageBusinessAlertTodo(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 查询审批完成的预警 |
|||
* @param bo |
|||
* @param pageQuery |
|||
* @return |
|||
*/ |
|||
@Operation(summary ="查询审批完成的预警",description = "查询审批完成的预警") |
|||
@GetMapping("/alert/page/finish") |
|||
public TableDataInfo<BusinessAlert> pageBusinessAlertFinish(BusinessAlertBo bo, PageQuery pageQuery) { |
|||
return businessAlertService.pageBusinessAlertFinish(bo, pageQuery); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,63 @@ |
|||
package org.dromara.business.controller; |
|||
|
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.business.domain.bo.BusinessAlertBo; |
|||
import org.dromara.business.domain.model.StatObj; |
|||
import org.dromara.business.service.BusinessAlertStatisticsService; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 预警统计相关服务 |
|||
*/ |
|||
@Tag(name = "预警统计相关服务") |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/alert/statistics") |
|||
public class BusinessAlertStatisticsController extends BaseController { |
|||
|
|||
private final BusinessAlertStatisticsService statisticsService; |
|||
|
|||
|
|||
//饼图显示每个月根据部门
|
|||
@Operation(summary="根据月份显示预警个数", description="根据月份显示预警个数") |
|||
@GetMapping(value = "/month/count") |
|||
public R<List<StatObj>> countMonthAlert(BusinessAlertBo businessAlertBo) { |
|||
return R.ok(statisticsService.countMonthAlert(businessAlertBo)); |
|||
} |
|||
|
|||
//饼图部门分类预警个数占比
|
|||
@Operation(summary="根据部门显示预警个数", description="根据部门显示预警个数") |
|||
@GetMapping(value = "/depart/count") |
|||
public R<List<StatObj>> countDepartAlert(BusinessAlertBo businessAlertBo) { |
|||
return R.ok(statisticsService.countDepartAlert(businessAlertBo)); |
|||
} |
|||
|
|||
//折线图处理状态各个月展示个数部门
|
|||
@Operation(summary="根据月份,状态统计显示预警个数", description="根据月份,状态统计显示预警个数") |
|||
@GetMapping(value = "/month/status/count") |
|||
public R<List<StatObj>> countMonthAlertStatus(BusinessAlertBo businessAlertBo) { |
|||
return R.ok(statisticsService.countMonthAlertStatus(businessAlertBo)); |
|||
} |
|||
|
|||
//折线图处理状态预警个数分布部门
|
|||
@Operation(summary="根据部门,状态统计显示预警个数", description="根据部门,状态统计显示预警个数") |
|||
@GetMapping(value = "/depart/status/count") |
|||
public R<List<StatObj>> countDepartAlertStatus(BusinessAlertBo businessAlertBo) { |
|||
return R.ok(statisticsService.countDepartAlertStatus(businessAlertBo)); |
|||
} |
|||
|
|||
//预警对比统计
|
|||
//1、处理状态柱状图,x轴为选中的部门
|
|||
//2、预警类型柱状图,x轴为选中的部门
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,89 @@ |
|||
package org.dromara.business.controller; |
|||
|
|||
|
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.dromara.business.domain.BusinessDepartBoundary; |
|||
import org.dromara.business.service.IBusinessDepartBoundaryService; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
/** |
|||
* 部门区域 |
|||
*/ |
|||
@Tag(name = "部门区域") |
|||
@RestController |
|||
@RequestMapping("/depart/boundary") |
|||
@Slf4j |
|||
@RequiredArgsConstructor |
|||
public class BusinessDepartBoundaryController extends BaseController { |
|||
|
|||
private final IBusinessDepartBoundaryService departBoundaryService; |
|||
|
|||
|
|||
/** |
|||
* 查询部门的地理位置 |
|||
* @param departBoundary |
|||
* @return |
|||
*/ |
|||
@Operation(summary ="查询部门的地理位置",description = "查询部门的地理位置") |
|||
@GetMapping(value = "/listJson") |
|||
public R<String> listJson(BusinessDepartBoundary departBoundary) { |
|||
String listJson = departBoundaryService.listJson(departBoundary); |
|||
return R.ok("查询成功!",listJson); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 分页查询部门区域列表 |
|||
* @return |
|||
*/ |
|||
@Operation(summary ="查询部门区域列表",description = "查询部门区域列表") |
|||
@RequestMapping(value = "/page", method = RequestMethod.GET) |
|||
public TableDataInfo<BusinessDepartBoundary> queryPageList(BusinessDepartBoundary departBoundary, PageQuery pageQuery) { |
|||
return departBoundaryService.listSysDepartBoundary(pageQuery, departBoundary); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 解析shp文件 |
|||
* @return |
|||
*/ |
|||
@Operation(summary ="批量新增部门区域",description = "批量新增部门区域") |
|||
@RequestMapping(value = "/upload", method = RequestMethod.POST) |
|||
public R<Void> uploadShpFile(@RequestParam("file") MultipartFile file, |
|||
@RequestParam(value = "deptId" ,required = false)String deptId) { |
|||
return toAjax(departBoundaryService.uploadShpFile(file,deptId)); |
|||
} |
|||
|
|||
/** |
|||
* 编辑 |
|||
* |
|||
* @param |
|||
* @return |
|||
*/ |
|||
@Operation(summary ="编辑部门区域",description = "编辑部门区域") |
|||
@RequestMapping(value = "/update", method = RequestMethod.POST) |
|||
public R<Void> updateDepartBoundary(@RequestBody BusinessDepartBoundary departBoundary) { |
|||
return toAjax(departBoundaryService.updateDepartBoundary(departBoundary)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 通过id删除 |
|||
* |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@Operation(summary ="删除部门区域",description = "删除部门区域") |
|||
@RequestMapping(value = "/delete", method = RequestMethod.DELETE) |
|||
public R<Void> deleteDepartBoundary(@RequestParam(name = "id") String id) { |
|||
return toAjax(departBoundaryService.deleteDepartBoundary(id)); |
|||
} |
|||
} |
@ -1,99 +0,0 @@ |
|||
package org.dromara.business.controller; |
|||
|
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.NotEmpty; |
|||
import jakarta.validation.constraints.NotNull; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.business.domain.bo.WaylineAlertBo; |
|||
import org.dromara.business.domain.vo.WaylineAlertVo; |
|||
import org.dromara.business.service.IWaylineAlertService; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.excel.utils.ExcelUtil; |
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|||
import org.dromara.common.log.annotation.Log; |
|||
import org.dromara.common.log.enums.BusinessType; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 预警任务 |
|||
* |
|||
* @author LionLi |
|||
* @date 2025-02-27 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/alert/task") |
|||
public class WaylineAlertController extends BaseController { |
|||
|
|||
private final IWaylineAlertService waylineAlertService; |
|||
|
|||
/** |
|||
* 查询预警任务列表 |
|||
*/ |
|||
@GetMapping("/page") |
|||
public TableDataInfo<WaylineAlertVo> pageWaylineAlert(WaylineAlertBo bo, PageQuery pageQuery) { |
|||
return waylineAlertService.pageWaylineAlert(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 获取预警任务详细信息 |
|||
* |
|||
* @param alertId 主键 |
|||
*/ |
|||
@GetMapping("/{alertId}") |
|||
public R<WaylineAlertVo> getWaylineAlert(@NotNull(message = "主键不能为空") |
|||
@PathVariable String alertId) { |
|||
return R.ok(waylineAlertService.getWaylineAlert(alertId)); |
|||
} |
|||
|
|||
/** |
|||
* 新增预警任务 |
|||
*/ |
|||
@Log(title = "预警任务", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping("/add") |
|||
public R<Void> addWaylineAlert(@Validated(AddGroup.class) @RequestBody WaylineAlertBo param) { |
|||
return toAjax(waylineAlertService.addWaylineAlert(param)); |
|||
} |
|||
|
|||
/** |
|||
* 修改预警任务 |
|||
*/ |
|||
@Log(title = "预警任务", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PostMapping("/update") |
|||
public R<Void> updateWaylineAlert(@Validated(EditGroup.class) @RequestBody WaylineAlertBo bo) { |
|||
return toAjax(waylineAlertService.updateWaylineAlert(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除预警任务 |
|||
* |
|||
* @param alertIdList 主键串 |
|||
*/ |
|||
@Log(title = "预警任务", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/delete") |
|||
public R<Void> deleteWaylineAlert(@NotEmpty(message = "主键不能为空") |
|||
@RequestParam List<String> alertIdList) { |
|||
return toAjax(waylineAlertService.deleteWaylineAlert(alertIdList, true)); |
|||
} |
|||
|
|||
/** |
|||
* 导出预警任务列表 |
|||
*/ |
|||
@Log(title = "预警任务", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void exportWaylineAlert(WaylineAlertBo bo, HttpServletResponse response) { |
|||
List<WaylineAlertVo> list = waylineAlertService.listWaylineAlert(bo); |
|||
ExcelUtil.exportExcel(list, "预警任务", WaylineAlertVo.class, response); |
|||
} |
|||
} |
@ -0,0 +1,232 @@ |
|||
package org.dromara.business.domain; |
|||
|
|||
import org.dromara.business.domain.enums.AlertTypeEnum; |
|||
import org.dromara.common.core.enums.BusinessStatusEnum; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import org.dromara.common.translation.annotation.Translation; |
|||
import org.dromara.common.translation.constant.TransConstant; |
|||
|
|||
import java.util.Date; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 预警任务对象 business_alert |
|||
* |
|||
* @author LionLi |
|||
* @date 2025-02-27 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("business_alert") |
|||
public class BusinessAlert extends BaseEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableId(type = IdType.ASSIGN_ID) |
|||
private String id; |
|||
|
|||
|
|||
/** |
|||
* 租户编号 |
|||
*/ |
|||
private String tenantId; |
|||
|
|||
/** |
|||
* 任务轮id |
|||
*/ |
|||
private String wheelId; |
|||
|
|||
/** |
|||
* 媒体id |
|||
*/ |
|||
private String taskId; |
|||
|
|||
/** |
|||
* 图片id |
|||
*/ |
|||
private String taskImageId; |
|||
|
|||
/** |
|||
* 处理原因 |
|||
*/ |
|||
private String reason; |
|||
|
|||
/** |
|||
* 图片文件 |
|||
*/ |
|||
private String images; |
|||
|
|||
/** |
|||
* 预警类型 |
|||
*/ |
|||
private AlertTypeEnum alertType; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private Long lat; |
|||
|
|||
/** |
|||
* 精度 |
|||
*/ |
|||
private Long lng; |
|||
|
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
private String taskHandleType; |
|||
|
|||
|
|||
/** |
|||
* 任务内容 |
|||
*/ |
|||
private String taskContent; |
|||
|
|||
/** |
|||
* 完成时间 |
|||
*/ |
|||
private Date completeDate; |
|||
|
|||
|
|||
/** |
|||
* 删除 0 正常 1已删除 |
|||
*/ |
|||
@TableLogic |
|||
private Long delFlag; |
|||
|
|||
/** |
|||
* 模板图片 |
|||
*/ |
|||
private String mateSourceImgUrl; |
|||
|
|||
/** |
|||
* 放大模板违建区域图片 |
|||
*/ |
|||
private String maxMateSourceImgUrl; |
|||
|
|||
/** |
|||
* 放大违建区域图片 |
|||
*/ |
|||
private String maxImages; |
|||
|
|||
/** |
|||
* 面积 |
|||
*/ |
|||
private Long area; |
|||
|
|||
/** |
|||
* 面积:长 |
|||
*/ |
|||
private Long areaL; |
|||
|
|||
/** |
|||
* 面积:宽 |
|||
*/ |
|||
private Long areaW; |
|||
|
|||
/** |
|||
* 流程处置状态(verify:验证,cancel:已撤销,draft:草稿,waiting:待审核,finish:已完成,invalid:已作废,back:已退回,termination:已终止) |
|||
*/ |
|||
private BusinessStatusEnum handleType; |
|||
|
|||
/** |
|||
* 是否违建 0:否,1:是 |
|||
*/ |
|||
private Long isIllegal; |
|||
|
|||
/** |
|||
* 部门id |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 部门名称 |
|||
*/ |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 预警名称 |
|||
*/ |
|||
private String jobName; |
|||
|
|||
/** |
|||
* 处理时间 |
|||
*/ |
|||
private Date handleTime; |
|||
|
|||
/** |
|||
* 其他:内容 |
|||
*/ |
|||
private String taskHandle; |
|||
|
|||
/** |
|||
* 平台类型 |
|||
*/ |
|||
private String platformType; |
|||
|
|||
/** |
|||
* 像素坐标 |
|||
*/ |
|||
private String pixelCoordinate; |
|||
|
|||
/** |
|||
* 当前位置预警数量 |
|||
*/ |
|||
private Long handleNum; |
|||
|
|||
/** |
|||
* 国土所备注 |
|||
*/ |
|||
private String territoryRemark; |
|||
|
|||
/** |
|||
* 地类信息数据 |
|||
*/ |
|||
private String landCategories; |
|||
|
|||
/** |
|||
* 相关文件 |
|||
*/ |
|||
private String territoryUrl; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
private String territoryPath; |
|||
|
|||
|
|||
/** |
|||
* 忽略原因 |
|||
*/ |
|||
private String ignoringCause; |
|||
|
|||
/** |
|||
* 来源:0:平台 1:小程序 |
|||
*/ |
|||
private Long handleSource; |
|||
|
|||
/** |
|||
* 审批者 |
|||
*/ |
|||
@TableField(exist = false) |
|||
private String approver; |
|||
|
|||
/** |
|||
* 审批者 |
|||
*/ |
|||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "approver") |
|||
@TableField(exist = false) |
|||
private String approveName; |
|||
|
|||
@TableField(exist = false) |
|||
private Long flowTaskId; |
|||
|
|||
} |
@ -0,0 +1,75 @@ |
|||
package org.dromara.business.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.jeecgframework.poi.excel.annotation.Excel; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 部门区域边界表 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("business_depart_boundary") |
|||
public class BusinessDepartBoundary extends BaseEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/**ID*/ |
|||
@TableId(type = IdType.AUTO) |
|||
private String id; |
|||
|
|||
/** |
|||
* 租户Id |
|||
*/ |
|||
private String tenantId; |
|||
|
|||
/**机构ID*/ |
|||
private String deptId; |
|||
/**机构/部门名称*/ |
|||
@Excel(name="机构/部门名称",width=15) |
|||
private String deptName; |
|||
|
|||
/**是否显示0显示,1不显示*/ |
|||
private Integer type; |
|||
/**边界*/ |
|||
|
|||
private String communityName; |
|||
/**边界*/ |
|||
private String boundary; |
|||
|
|||
/** |
|||
* 周长 |
|||
*/ |
|||
private Double perimeter; |
|||
|
|||
/** |
|||
* 面积平方公里 |
|||
*/ |
|||
private Double area; |
|||
|
|||
/** |
|||
* 面积亩 |
|||
*/ |
|||
private Double areaMu; |
|||
|
|||
/** |
|||
* 编号 |
|||
*/ |
|||
private String shpNo; |
|||
|
|||
/** |
|||
* 0不为村级别,1为村级别 |
|||
*/ |
|||
private Integer villageType; |
|||
|
|||
/**删除状态(0,正常,1已删除)*/ |
|||
private String delFlag; |
|||
|
|||
} |
@ -0,0 +1,151 @@ |
|||
package org.dromara.business.domain; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
*存储解析的shp的矢量数据 |
|||
*/ |
|||
@Data |
|||
@TableName("business_geospatial_vectors") |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@Accessors(chain = true) |
|||
public class BusinessGeospatialVectors { |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
@TableId(type = IdType.AUTO) |
|||
private String id; |
|||
|
|||
/** |
|||
* 租户Id |
|||
*/ |
|||
private String tenantId; |
|||
|
|||
// 1. 图形基础属性
|
|||
private String landCategories; // 几何信息
|
|||
|
|||
private String lineColor; // 线颜色
|
|||
|
|||
private String areaColor; // 面颜色
|
|||
|
|||
private String lineTransparency; // 线透明度
|
|||
|
|||
private String lineWidth; // 线宽度
|
|||
|
|||
private String areaTransparency; // 面透明度
|
|||
|
|||
private String shapeLength; // 形状长度
|
|||
|
|||
private String shapeArea; // 形状面积
|
|||
|
|||
// 2. 图斑标识信息
|
|||
private String featureCode; // 标识码
|
|||
|
|||
private String featureTypeCode; // 要素代码
|
|||
|
|||
private String temporaryFeatureId; // 图斑预编号
|
|||
|
|||
private String featureId; // 图斑编号
|
|||
|
|||
private String featureType; // 图斑类型
|
|||
|
|||
private String objectId; // 对象ID
|
|||
|
|||
// 3. 地类信息
|
|||
private String landTypeCode; // 地类编码
|
|||
|
|||
private String landTypeName; // 地类名称
|
|||
|
|||
private String landUseType; // 土地利用类型
|
|||
|
|||
private String landActualUse; // 土地用途
|
|||
|
|||
// 4. 权属与行政区划信息
|
|||
private String ownershipNature; // 权属性质
|
|||
|
|||
private String ownershipUnitCode; // 权属单位代码
|
|||
|
|||
private String ownershipUnitName; // 权属单位名称
|
|||
|
|||
private String landUnitCode; // 坐落单位代码
|
|||
|
|||
private String landUnitName; // 坐落单位名称
|
|||
|
|||
private String adminDivisionCode; // 行政区代码
|
|||
|
|||
private String adminDivisionName; // 行政区名称
|
|||
|
|||
// 5. 面积信息
|
|||
private String featureArea; // 图斑面积
|
|||
|
|||
private String deductionArea; // 扣除面积
|
|||
|
|||
private String featureLandArea; // 图斑地类面积
|
|||
|
|||
private String linearFeatureWidth; // 线状地物宽度
|
|||
|
|||
// 6. 农用地相关信息
|
|||
private String arableLandQuality; // 耕地等别
|
|||
|
|||
private String arableLandQualityCode; // 耕地等别代码
|
|||
|
|||
private String basicFarmlandType; // 基本农田类型
|
|||
|
|||
// 7. 规划信息
|
|||
private String planningPurpose; // 规划用途
|
|||
|
|||
private String planningPurposeCode; // 规划用途代码
|
|||
|
|||
private String planningPeriod; // 规划期限
|
|||
|
|||
// 8. 变更与历史信息
|
|||
private String originalFeatureCode; // 原始代码
|
|||
|
|||
private String originalLandTypeCode; // 原地类编码
|
|||
|
|||
private String changeRecordId; // 变更编号
|
|||
|
|||
private String changeDate; // 变更日期
|
|||
|
|||
// 9. 时间信息
|
|||
private String updateDate; // 更新日期
|
|||
|
|||
private String completionDate; // 建设日期
|
|||
|
|||
private String dataYear; // 数据年份
|
|||
|
|||
// 10. 其他属性
|
|||
private String notes; // 备注
|
|||
|
|||
private String approvalNumber; // 批准文号
|
|||
|
|||
private String urbanVillageCode; // 城镇村属性码
|
|||
|
|||
private String extendedInfo; // 扩展信息
|
|||
|
|||
private String belongingArea; // 所属区域
|
|||
|
|||
private String geographicLocation; // 地理位置
|
|||
|
|||
// 11. 拆转查相关信息
|
|||
private String demolitionType; // 拆查类型
|
|||
|
|||
private String demolitionArea; // 拆查面积
|
|||
|
|||
private String demolitionName; // 拆查名称
|
|||
|
|||
private Integer batchNo; //批次号
|
|||
|
|||
private Date createTime; //创建时间
|
|||
|
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
package org.dromara.business.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.jeecgframework.poi.excel.annotation.Excel; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description: 巡查区域 |
|||
*/ |
|||
@Data |
|||
@TableName("business_patrol_areas") |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@Accessors(chain = true) |
|||
public class BusinessPatrolAreas extends BaseEntity { |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
@TableId(type = IdType.ASSIGN_ID) |
|||
private String id; |
|||
|
|||
/**区域名称*/ |
|||
@Excel(name = "区域名称", width = 15) |
|||
private String name; |
|||
|
|||
/**区域编号*/ |
|||
@Excel(name = "区域编号", width = 15) |
|||
private String number; |
|||
|
|||
/**所属乡镇id*/ |
|||
@Excel(name = "所属乡镇id", width = 15) |
|||
private String deptId; |
|||
|
|||
/**地理数据*/ |
|||
private String landCategories; |
|||
|
|||
/**所属乡镇id*/ |
|||
@Excel(name = "所属乡镇名称", width = 15) |
|||
@TableField(exist = false) |
|||
private String deptName; |
|||
|
|||
@Excel(name = "所属乡镇ids", width = 15) |
|||
private String deptIds; |
|||
|
|||
@Excel(name = "平台类型", width = 15) |
|||
private String platformType; |
|||
|
|||
/**分管领导所属乡镇id**/ |
|||
private String leaderDeptId; |
|||
|
|||
/**用户id**/ |
|||
private String userId; |
|||
|
|||
/**用户姓名**/ |
|||
private String userName; |
|||
|
|||
/**是否禁用:0:禁用 1:启用**/ |
|||
private Integer isDisable; |
|||
|
|||
/**巡查区域平台类型集合**/ |
|||
@TableField(exist = false) |
|||
private List<String> patrolAreasIdList = new ArrayList<>(); |
|||
|
|||
@TableField(exist = false) |
|||
private List<String> areasIdList = new ArrayList<>(); |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
package org.dromara.business.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 矢量数据字段映射主表 |
|||
*/ |
|||
@Data |
|||
@TableName("Business_vector_dict") |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@Accessors(chain = true) |
|||
public class BusinessVectorDict extends BaseEntity { |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableId(type = IdType.ASSIGN_ID) |
|||
private String id; |
|||
|
|||
/** |
|||
* 租户Id |
|||
*/ |
|||
private String tenantId; |
|||
|
|||
/** |
|||
* 字段名称 |
|||
*/ |
|||
private String dictCode; |
|||
|
|||
/** |
|||
* 描述 |
|||
*/ |
|||
private String dictName; |
|||
|
|||
@TableField(exist = false) |
|||
private List<BusinessVectorDictItem> fieldMappingsList; |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
package org.dromara.business.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 矢量数据字段映射关联表 |
|||
*/ |
|||
@Data |
|||
@TableName("Business_vector_dict_item") |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@Accessors(chain = true) |
|||
public class BusinessVectorDictItem extends BaseEntity { |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@TableId(type = IdType.ASSIGN_ID) |
|||
private String id; |
|||
|
|||
/** |
|||
* 租户Id |
|||
*/ |
|||
private String tenantId; |
|||
|
|||
/** |
|||
* 字段名称 |
|||
*/ |
|||
private String itemValue; |
|||
|
|||
/** |
|||
* 关联id |
|||
*/ |
|||
private String dictId; |
|||
|
|||
/** |
|||
* 描述 |
|||
*/ |
|||
private String itemText; |
|||
|
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package org.dromara.business.domain.bo; |
|||
|
|||
|
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import org.dromara.business.domain.BusinessAlert; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = BusinessAlert.class, reverseConvertGenerate = false) |
|||
public class BusinessPatrolAreasBo extends BaseEntity { |
|||
|
|||
/** |
|||
* 所属乡镇id |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 所属乡镇名称 |
|||
*/ |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 预警类型 |
|||
*/ |
|||
private String platformType; |
|||
|
|||
/** |
|||
* 是否禁用:0:禁用 1:启用 |
|||
*/ |
|||
private Integer isDisable; |
|||
|
|||
/** |
|||
* 下级所有部门id |
|||
*/ |
|||
private List<String> deptIds = new ArrayList<>(); |
|||
|
|||
private String name; |
|||
} |
@ -0,0 +1,11 @@ |
|||
package org.dromara.business.domain.bo; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class BusinessPlatformInfoBo { |
|||
|
|||
/**查询条件**/ |
|||
private String search; |
|||
|
|||
} |
@ -1,226 +0,0 @@ |
|||
package org.dromara.business.domain.bo; |
|||
|
|||
import org.dromara.business.domain.WaylineAlert; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import jakarta.validation.constraints.*; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 预警任务业务对象 wayline_alert |
|||
* |
|||
* @author LionLi |
|||
* @date 2025-02-27 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = WaylineAlert.class, reverseConvertGenerate = false) |
|||
public class WaylineAlertBo extends BaseEntity { |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@NotBlank(message = "不能为空", groups = { EditGroup.class }) |
|||
private String id; |
|||
|
|||
/** |
|||
* 任务轮id |
|||
*/ |
|||
@NotBlank(message = "任务轮id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String wheelId; |
|||
|
|||
/** |
|||
* 媒体id |
|||
*/ |
|||
@NotBlank(message = "媒体id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String taskId; |
|||
|
|||
/** |
|||
* 图片id |
|||
*/ |
|||
@NotBlank(message = "图片id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String taskImageId; |
|||
|
|||
/** |
|||
* 处理原因 |
|||
*/ |
|||
@NotBlank(message = "处理原因不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String reason; |
|||
|
|||
/** |
|||
* 图片文件 |
|||
*/ |
|||
@NotBlank(message = "图片文件不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String images; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
@NotNull(message = "纬度不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long lat; |
|||
|
|||
/** |
|||
* 精度 |
|||
*/ |
|||
@NotNull(message = "精度不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long lng; |
|||
|
|||
/** |
|||
* 任务类型 |
|||
*/ |
|||
@NotBlank(message = "任务类型不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String taskHandleType; |
|||
|
|||
|
|||
/** |
|||
* 任务内容 |
|||
*/ |
|||
@NotBlank(message = "任务内容不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String taskContent; |
|||
|
|||
/** |
|||
* 完成时间 |
|||
*/ |
|||
@NotNull(message = "完成时间不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Date completeDate; |
|||
|
|||
|
|||
/** |
|||
* 模板图片 |
|||
*/ |
|||
@NotBlank(message = "模板图片不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String mateSourceImgUrl; |
|||
|
|||
/** |
|||
* 放大模板违建区域图片 |
|||
*/ |
|||
@NotBlank(message = "放大模板违建区域图片不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String maxMateSourceImgUrl; |
|||
|
|||
/** |
|||
* 放大违建区域图片 |
|||
*/ |
|||
@NotBlank(message = "放大违建区域图片不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String maxImages; |
|||
|
|||
/** |
|||
* 面积 |
|||
*/ |
|||
@NotNull(message = "面积不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long area; |
|||
|
|||
/** |
|||
* 面积:长 |
|||
*/ |
|||
@NotNull(message = "面积:长不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long areaL; |
|||
|
|||
/** |
|||
* 面积:宽 |
|||
*/ |
|||
@NotNull(message = "面积:宽不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long areaW; |
|||
|
|||
/** |
|||
* 0:验证 |
|||
*/ |
|||
@NotNull(message = "0:验证", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long handleInType; |
|||
|
|||
/** |
|||
* 是否违建 0:否,1:是 |
|||
*/ |
|||
@NotNull(message = "是否违建 0:否,1:是不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long isIllegal; |
|||
|
|||
/** |
|||
* 部门id |
|||
*/ |
|||
@NotBlank(message = "部门id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 部门名称 |
|||
*/ |
|||
@NotBlank(message = "部门名称不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 预警名称 |
|||
*/ |
|||
@NotBlank(message = "预警名称不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String jobName; |
|||
|
|||
/** |
|||
* 处理时间 |
|||
*/ |
|||
@NotNull(message = "处理时间不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Date handleTime; |
|||
|
|||
/** |
|||
* 其他:内容 |
|||
*/ |
|||
@NotBlank(message = "其他:内容不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String taskHandle; |
|||
|
|||
/** |
|||
* 平台类型 |
|||
*/ |
|||
@NotBlank(message = "平台类型不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String platformType; |
|||
|
|||
/** |
|||
* 像素坐标 |
|||
*/ |
|||
@NotBlank(message = "像素坐标不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String pixelCoordinate; |
|||
|
|||
/** |
|||
* 当前位置预警数量 |
|||
*/ |
|||
@NotNull(message = "当前位置预警数量不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long handleNum; |
|||
|
|||
/** |
|||
* 国土所备注 |
|||
*/ |
|||
@NotBlank(message = "国土所备注不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String territoryRemark; |
|||
|
|||
/** |
|||
* 地类信息数据 |
|||
*/ |
|||
@NotBlank(message = "地类信息数据不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String landCategories; |
|||
|
|||
/** |
|||
* 相关文件 |
|||
*/ |
|||
@NotBlank(message = "相关文件不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String territoryUrl; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
@NotBlank(message = "图片不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String territoryPath; |
|||
|
|||
|
|||
/** |
|||
* 忽略原因 |
|||
*/ |
|||
@NotBlank(message = "忽略原因不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String ignoringCause; |
|||
|
|||
/** |
|||
* 来源:0:平台 1:小程序 |
|||
*/ |
|||
@NotNull(message = "来源:0:平台 1:小程序不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long handleSource; |
|||
|
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
package org.dromara.business.domain.enums; |
|||
|
|||
import cn.hutool.core.util.StrUtil; |
|||
import lombok.Getter; |
|||
|
|||
import java.util.Arrays; |
|||
|
|||
/** |
|||
* 预警类型枚举类 |
|||
*/ |
|||
@Getter |
|||
public enum AlertTypeEnum { |
|||
|
|||
|
|||
|
|||
|
|||
; |
|||
|
|||
|
|||
private String code; |
|||
|
|||
private String description; |
|||
|
|||
|
|||
public static AlertTypeEnum getTypeByCode(String code){ |
|||
if(StrUtil.isNotEmpty(code)){ |
|||
return Arrays.stream(values()).filter(p -> StrUtil.equals(p.name(),code.toUpperCase())).findAny().orElse(null); |
|||
} |
|||
return null; |
|||
} |
|||
} |
@ -0,0 +1,86 @@ |
|||
package org.dromara.business.domain.model; |
|||
|
|||
import cn.hutool.json.JSONObject; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 统计信息返回类 |
|||
*/ |
|||
@Data |
|||
public class StatObj implements Serializable { |
|||
|
|||
/** |
|||
* 统计字段 |
|||
*/ |
|||
private String statKey; |
|||
/** |
|||
* 统计值 |
|||
*/ |
|||
private Object statVal; |
|||
|
|||
private List<Object> statValues; |
|||
/** |
|||
* 子集信息 |
|||
*/ |
|||
List<StatObj> nextStatList; |
|||
|
|||
/** |
|||
* 补充字段 |
|||
*/ |
|||
private JSONObject extra; |
|||
|
|||
/** |
|||
* 跳转链接 |
|||
*/ |
|||
private String url; |
|||
|
|||
|
|||
public StatObj(){ |
|||
|
|||
} |
|||
|
|||
public StatObj(String statKey, Object statVal){ |
|||
this.statKey = statKey; |
|||
this.statVal = statVal; |
|||
} |
|||
|
|||
public StatObj(String statKey, Long statVal, String extraKey, Object extraValue){ |
|||
this.statKey = statKey; |
|||
this.statVal = statVal; |
|||
this.extra = new JSONObject().put(extraKey,extraValue); |
|||
} |
|||
|
|||
public StatObj(String statKey, BigDecimal percentage){ |
|||
this.statKey = statKey; |
|||
this.statVal = percentage; |
|||
} |
|||
|
|||
public StatObj(String statKey, Long statVal, String url){ |
|||
this.statKey = statKey; |
|||
this.statVal = statVal; |
|||
this.url = url; |
|||
} |
|||
|
|||
public StatObj(String statKey, List<StatObj> nextStatList){ |
|||
this.statKey = statKey; |
|||
this.nextStatList = nextStatList; |
|||
} |
|||
|
|||
public StatObj(String statKey, List<StatObj> nextStatList,String extraKey, Object extraValue){ |
|||
this.statKey = statKey; |
|||
this.nextStatList = nextStatList; |
|||
this.extra = new JSONObject().put(extraKey,extraValue); |
|||
} |
|||
|
|||
public void addExtra(String key,Object value){ |
|||
if(this.extra == null){ |
|||
this.extra = new JSONObject(); |
|||
} |
|||
this.extra.set(key,value); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package org.dromara.business.dubbo; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import org.apache.dubbo.config.annotation.DubboService; |
|||
import org.dromara.business.api.RemoteBusinessAlertService; |
|||
import org.dromara.business.service.IBusinessAlertService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 预警相关服务开放 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
@DubboService |
|||
public class RemoteBusinessAlertServiceImpl implements RemoteBusinessAlertService { |
|||
|
|||
private final IBusinessAlertService businessAlertService; |
|||
|
|||
|
|||
/** |
|||
* 更新此条预警审批时候的状态 |
|||
* @param businessId 业务id(预警、工单) |
|||
* @param flowStatus 流程状态 |
|||
*/ |
|||
@Override |
|||
public void updateAlertStatus(String businessId, String flowStatus) { |
|||
businessAlertService.updateAlertStatus(businessId,flowStatus); |
|||
} |
|||
} |
@ -0,0 +1,51 @@ |
|||
package org.dromara.business.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.dromara.business.domain.BusinessAlert; |
|||
import org.dromara.business.domain.bo.BusinessAlertBo; |
|||
import org.dromara.business.domain.vo.BusinessAlertVo; |
|||
import org.dromara.common.mybatis.annotation.DataColumn; |
|||
import org.dromara.common.mybatis.annotation.DataPermission; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 预警任务Mapper接口 |
|||
* |
|||
* @author LionLi |
|||
* @date 2025-02-27 |
|||
*/ |
|||
public interface BusinessAlertMapper extends BaseMapperPlus<BusinessAlert, BusinessAlertVo> { |
|||
|
|||
Page<BusinessAlert> pageBusinessAlert(Page<BusinessAlert> page, QueryWrapper<BusinessAlert> ew); |
|||
|
|||
Page<BusinessAlert> pageAlertFinish(Page<BusinessAlert> page, QueryWrapper<BusinessAlert> ew); |
|||
|
|||
Page<BusinessAlert> pageAlertTodo(Page<BusinessAlert> page, QueryWrapper<BusinessAlert> ew); |
|||
|
|||
@DataPermission( |
|||
@DataColumn(key = "deptName", value = "ba.dept_id") |
|||
) |
|||
List<Map<String, Object>> listMonthAlert(@Param("param") BusinessAlertBo businessAlertBo); |
|||
|
|||
@DataPermission( |
|||
@DataColumn(key = "deptName", value = "ba.dept_id") |
|||
) |
|||
List<Map<String, Object>> listDepartAlert(@Param("param") BusinessAlertBo businessAlertBo); |
|||
|
|||
@DataPermission( |
|||
@DataColumn(key = "deptName", value = "ba.dept_id") |
|||
) |
|||
List<Map<String, Object>> listMonthAlertStatus(@Param("param")BusinessAlertBo businessAlertBo); |
|||
|
|||
@DataPermission( |
|||
@DataColumn(key = "deptName", value = "ba.dept_id") |
|||
) |
|||
List<Map<String, Object>> listDepartAlertStatus(@Param("param") BusinessAlertBo businessAlertBo); |
|||
} |
@ -0,0 +1,30 @@ |
|||
package org.dromara.business.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.dromara.business.domain.BusinessDepartBoundary; |
|||
import org.dromara.common.mybatis.annotation.DataColumn; |
|||
import org.dromara.common.mybatis.annotation.DataPermission; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 部门 Mapper 接口 |
|||
*/ |
|||
public interface BusinessDepartBoundaryMapper extends BaseMapper<BusinessDepartBoundary> { |
|||
Page<BusinessDepartBoundary> listSysDepartBoundary(Page<BusinessDepartBoundary> page,@Param("condition") BusinessDepartBoundary sysDepartBoundary); |
|||
|
|||
List<BusinessDepartBoundary> listSysDepartBoundaryGeomFromText(@Param("condition") BusinessDepartBoundary sysDepartBoundary); |
|||
/** |
|||
* 通过部门编码获取部门边界数据 |
|||
* @param deptId 部门编码 |
|||
* @return String |
|||
*/ |
|||
List<BusinessDepartBoundary> queryByDeptId(@Param("deptId") String deptId); |
|||
|
|||
void saveBatchBoundary(@Param("list") List<BusinessDepartBoundary> boundaryList); |
|||
|
|||
String listJson(@Param("param") BusinessDepartBoundary departBoundary); |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package org.dromara.business.mapper; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.dromara.business.domain.BusinessPatrolAreas; |
|||
import org.dromara.business.domain.bo.BusinessPatrolAreasBo; |
|||
|
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description: 巡查区域 |
|||
*/ |
|||
public interface BusinessPatrolAreasMapper extends BaseMapper<BusinessPatrolAreas> { |
|||
|
|||
IPage<BusinessPatrolAreas> listPatrolAreas(Page<BusinessPatrolAreas> page, @Param("condition") BusinessPatrolAreasBo patrolAreasBo, @Param("deptIds") List<String> deptIds); |
|||
|
|||
List<BusinessPatrolAreas> listPatrolAreas(@Param("condition") BusinessPatrolAreasBo patrolAreasBo, @Param("deptIds") List<String> deptIds); |
|||
} |
@ -0,0 +1,8 @@ |
|||
package org.dromara.business.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.dromara.business.domain.BusinessVectorDictItem; |
|||
|
|||
public interface BusinessVectorDictItemMapper extends BaseMapper<BusinessVectorDictItem> { |
|||
|
|||
} |
@ -0,0 +1,10 @@ |
|||
package org.dromara.business.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.dromara.business.domain.BusinessVectorDict; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface BusinessVectorDictMapper extends BaseMapper<BusinessVectorDict> { |
|||
List<BusinessVectorDict> listVectorField(); |
|||
} |
@ -1,18 +0,0 @@ |
|||
package org.dromara.business.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.dromara.business.domain.WaylineAlert; |
|||
import org.dromara.business.domain.vo.WaylineAlertVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 预警任务Mapper接口 |
|||
* |
|||
* @author LionLi |
|||
* @date 2025-02-27 |
|||
*/ |
|||
public interface WaylineAlertMapper extends BaseMapperPlus<WaylineAlert, WaylineAlertVo> { |
|||
|
|||
Page<WaylineAlertVo> pageAlert(Page<WaylineAlertVo> page, LambdaQueryWrapper<WaylineAlert> lqw); |
|||
} |
@ -0,0 +1,17 @@ |
|||
package org.dromara.business.service; |
|||
|
|||
|
|||
import org.dromara.business.domain.bo.BusinessAlertBo; |
|||
import org.dromara.business.domain.model.StatObj; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface BusinessAlertStatisticsService { |
|||
List<StatObj> countMonthAlert(BusinessAlertBo businessAlertBo); |
|||
|
|||
List<StatObj> countDepartAlert(BusinessAlertBo businessAlertBo); |
|||
|
|||
List<StatObj> countMonthAlertStatus(BusinessAlertBo businessAlertBo); |
|||
|
|||
List<StatObj> countDepartAlertStatus(BusinessAlertBo businessAlertBo); |
|||
} |
@ -0,0 +1,66 @@ |
|||
package org.dromara.business.service; |
|||
|
|||
import org.dromara.business.domain.BusinessAlert; |
|||
import org.dromara.business.domain.bo.BusinessAlertBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 预警任务Service接口 |
|||
* |
|||
* @author LionLi |
|||
* @date 2025-02-27 |
|||
*/ |
|||
public interface IBusinessAlertService { |
|||
|
|||
|
|||
TableDataInfo<BusinessAlert> pageBusinessAlertTodo(BusinessAlertBo bo, PageQuery pageQuery); |
|||
|
|||
TableDataInfo<BusinessAlert> pageBusinessAlertFinish(BusinessAlertBo bo, PageQuery pageQuery); |
|||
|
|||
TableDataInfo<BusinessAlert> pageBusinessAlert(BusinessAlertBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 新增预警任务 |
|||
* |
|||
* @param param 预警任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean addBusinessAlert(BusinessAlertBo param); |
|||
|
|||
|
|||
/** |
|||
* 批量新增预警任务 |
|||
* |
|||
* @param alertList 预警任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean batchAddBusinessAlert(List<BusinessAlert> alertList); |
|||
|
|||
/** |
|||
* 修改预警任务 |
|||
* |
|||
* @param param 预警任务 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean editBusinessAlert(BusinessAlertBo param); |
|||
|
|||
/** |
|||
* 校验并批量删除预警任务信息 |
|||
* |
|||
* @param alertIdList 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteBusinessAlert(List<String> alertIdList, Boolean isValid); |
|||
|
|||
/** |
|||
* 修改预警中处置状态 |
|||
* @param businessId |
|||
* @param flowStatus |
|||
*/ |
|||
void updateAlertStatus(String businessId, String flowStatus); |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package org.dromara.business.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import org.dromara.business.domain.BusinessDepartBoundary; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 部门区域 服务实现类 |
|||
*/ |
|||
public interface IBusinessDepartBoundaryService extends IService<BusinessDepartBoundary>{ |
|||
TableDataInfo<BusinessDepartBoundary> listSysDepartBoundary(PageQuery page, BusinessDepartBoundary departBoundary); |
|||
|
|||
List<BusinessDepartBoundary> listSysDepartBoundaryGeomFromText(BusinessDepartBoundary departBoundary); |
|||
|
|||
List<BusinessDepartBoundary> queryByDeptId(String deptId); |
|||
|
|||
boolean uploadShpFile(MultipartFile file,String deptId); |
|||
|
|||
boolean deleteDepartBoundary(String id); |
|||
|
|||
boolean updateDepartBoundary(BusinessDepartBoundary departBoundary); |
|||
|
|||
boolean addDepartBoundary(BusinessDepartBoundary departBoundary); |
|||
|
|||
String listJson(BusinessDepartBoundary departBoundary); |
|||
} |
@ -0,0 +1,29 @@ |
|||
package org.dromara.business.service; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.dromara.business.domain.BusinessPatrolAreas; |
|||
import org.dromara.business.domain.bo.BusinessPatrolAreasBo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description: 巡查区域 |
|||
*/ |
|||
public interface IBusinessPatrolAreasService extends IService<BusinessPatrolAreas> { |
|||
TableDataInfo<BusinessPatrolAreas> pagePatrolAreas(PageQuery pageQuery, BusinessPatrolAreasBo patrolAreasBo); |
|||
|
|||
List<BusinessPatrolAreas> listPatrolAreas(BusinessPatrolAreasBo patrolAreasBo); |
|||
|
|||
void addPatrolAreas(MultipartFile file); |
|||
|
|||
boolean updatePatrolAreas(BusinessPatrolAreas patrolAreas); |
|||
|
|||
List<BusinessPatrolAreas> exportXls(BusinessPatrolAreas patrolAreas); |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package org.dromara.business.service; |
|||
|
|||
|
|||
import org.dromara.business.domain.BusinessVectorDictItem; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface IBusinessVectorDictItemService { |
|||
|
|||
List<BusinessVectorDictItem> findDictItemByDictId(String dictId); |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package org.dromara.business.service; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.dromara.business.domain.BusinessVectorDict; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface IBusinessVectorDictService { |
|||
|
|||
List<BusinessVectorDict> listVectorField(); |
|||
|
|||
BusinessVectorDict findVectorDictById(String dictId); |
|||
|
|||
|
|||
} |
@ -1,78 +0,0 @@ |
|||
package org.dromara.business.service; |
|||
|
|||
import org.dromara.business.domain.WaylineAlert; |
|||
import org.dromara.business.domain.vo.WaylineAlertVo; |
|||
import org.dromara.business.domain.bo.WaylineAlertBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 预警任务Service接口 |
|||
* |
|||
* @author LionLi |
|||
* @date 2025-02-27 |
|||
*/ |
|||
public interface IWaylineAlertService { |
|||
|
|||
/** |
|||
* 查询预警任务 |
|||
* |
|||
* @param id 主键 |
|||
* @return 预警任务 |
|||
*/ |
|||
WaylineAlertVo getWaylineAlert(String id); |
|||
|
|||
/** |
|||
* 分页查询预警任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 预警任务分页列表 |
|||
*/ |
|||
TableDataInfo<WaylineAlertVo> pageWaylineAlert(WaylineAlertBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的预警任务列表 |
|||
* |
|||
* @param param 查询条件 |
|||
* @return 预警任务列表 |
|||
*/ |
|||
List<WaylineAlertVo> listWaylineAlert(WaylineAlertBo param); |
|||
|
|||
/** |
|||
* 新增预警任务 |
|||
* |
|||
* @param param 预警任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean addWaylineAlert(WaylineAlertBo param); |
|||
|
|||
|
|||
/** |
|||
* 批量新增预警任务 |
|||
* |
|||
* @param alertList 预警任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean saveBatchAlert(List<WaylineAlert> alertList); |
|||
|
|||
/** |
|||
* 修改预警任务 |
|||
* |
|||
* @param param 预警任务 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateWaylineAlert(WaylineAlertBo param); |
|||
|
|||
/** |
|||
* 校验并批量删除预警任务信息 |
|||
* |
|||
* @param alertIdList 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWaylineAlert(List<String> alertIdList, Boolean isValid); |
|||
} |
@ -0,0 +1,214 @@ |
|||
package org.dromara.business.service.impl; |
|||
|
|||
import cn.hutool.core.collection.CollUtil; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.apache.dubbo.config.annotation.DubboReference; |
|||
import org.dromara.business.domain.BusinessAlert; |
|||
import org.dromara.business.domain.bo.BusinessAlertBo; |
|||
import org.dromara.business.mapper.BusinessAlertMapper; |
|||
import org.dromara.business.service.IBusinessAlertService; |
|||
import org.dromara.common.core.enums.BusinessStatusEnum; |
|||
import org.dromara.common.core.exception.ServiceException; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StreamUtils; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.satoken.utils.LoginHelper; |
|||
import org.dromara.system.api.domain.vo.RemoteUserVo; |
|||
import org.dromara.workflow.api.RemoteWorkflowService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 预警任务Service业务层处理 |
|||
* |
|||
* @author LionLi |
|||
* @date 2025-02-27 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|||
|
|||
private final BusinessAlertMapper baseMapper; |
|||
|
|||
@DubboReference |
|||
RemoteWorkflowService remoteWorkflowService; |
|||
|
|||
|
|||
/** |
|||
* 新增预警任务 |
|||
* |
|||
* @param param 预警任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean addBusinessAlert(BusinessAlertBo param) { |
|||
BusinessAlert alert = MapstructUtils.convert(param, BusinessAlert.class); |
|||
validEntityBeforeSave(alert,false); |
|||
return this.baseMapper.insert(alert) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 批量添加 |
|||
* @param alertList 预警任务 |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public Boolean batchAddBusinessAlert(List<BusinessAlert> alertList) { |
|||
return this.baseMapper.insertBatch(alertList); |
|||
} |
|||
|
|||
/** |
|||
* 修改预警任务 |
|||
* |
|||
* @param param 预警任务 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean editBusinessAlert(BusinessAlertBo param) { |
|||
BusinessAlert businessAlert = MapstructUtils.convert(param, BusinessAlert.class); |
|||
validEntityBeforeSave(businessAlert,true); |
|||
return baseMapper.updateById(businessAlert) > 0; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 校验并批量删除预警任务信息 |
|||
* |
|||
* @param alertIdList 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteBusinessAlert(List<String> alertIdList, Boolean isValid) { |
|||
if(isValid){ |
|||
if (ObjectUtil.isEmpty(alertIdList)){ |
|||
throw new ServiceException("预警【Id】为空!"); |
|||
} |
|||
} |
|||
return baseMapper.deleteByIds(alertIdList) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 修改预警中处置状态 |
|||
* @param businessId |
|||
* @param flowStatus |
|||
*/ |
|||
@Override |
|||
public void updateAlertStatus(String businessId, String flowStatus) { |
|||
LambdaUpdateWrapper<BusinessAlert> wrapper = new LambdaUpdateWrapper<>(); |
|||
wrapper.set(BusinessAlert::getHandleType, BusinessStatusEnum.getByStatus(flowStatus)); |
|||
|
|||
wrapper.eq(BusinessAlert::getId, businessId); |
|||
|
|||
this.baseMapper.update(wrapper); |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* 查询全部预警 |
|||
* @param bo |
|||
* @param pageQuery |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<BusinessAlert> pageBusinessAlert(BusinessAlertBo bo, PageQuery pageQuery) { |
|||
QueryWrapper<BusinessAlert> wrapper = buildQueryWrapper(bo); |
|||
|
|||
Page<BusinessAlert> page = this.baseMapper.pageBusinessAlert(pageQuery.build(), wrapper); |
|||
|
|||
return TableDataInfo.build(page); |
|||
} |
|||
|
|||
/** |
|||
* 查询当前用户已完成预警 |
|||
* @param bo |
|||
* @param pageQuery |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<BusinessAlert> pageBusinessAlertFinish(BusinessAlertBo bo, PageQuery pageQuery) { |
|||
QueryWrapper<BusinessAlert> wrapper = buildQueryWrapper(bo); |
|||
buildCommonQueryWrapper(wrapper); |
|||
|
|||
wrapper.in("a.approver", LoginHelper.getUserId()); |
|||
Page<BusinessAlert> page = this.baseMapper.pageAlertFinish(pageQuery.build(), wrapper); |
|||
|
|||
return TableDataInfo.build(page); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 查询当前用户待办预警 |
|||
* @param bo |
|||
* @param pageQuery |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<BusinessAlert> pageBusinessAlertTodo(BusinessAlertBo bo, PageQuery pageQuery) { |
|||
QueryWrapper<BusinessAlert> wrapper = buildQueryWrapper(bo); |
|||
buildCommonQueryWrapper(wrapper); |
|||
|
|||
wrapper.eq("uu.del_flag", 0); |
|||
wrapper.in("uu.type", 1,2,3); |
|||
|
|||
wrapper.in("a.processed_by", remoteWorkflowService.getPermissions()); |
|||
wrapper.in("a.flow_status", BusinessStatusEnum.WAITING.getStatus()); |
|||
|
|||
Page<BusinessAlert> page = this.baseMapper.pageAlertTodo(pageQuery.build(), wrapper); |
|||
List<BusinessAlert> records = page.getRecords(); |
|||
if (CollUtil.isNotEmpty(records)) { |
|||
List<Long> taskIds = StreamUtils.toList(records, BusinessAlert::getFlowTaskId); |
|||
Map<Long, List<RemoteUserVo>> listMap = remoteWorkflowService.currentTaskAllUser(taskIds); |
|||
records.forEach(t -> { |
|||
List<RemoteUserVo> userList = listMap.getOrDefault(t.getId(), Collections.emptyList()); |
|||
if (CollUtil.isNotEmpty(userList)) { |
|||
t.setApprover(StreamUtils.join(userList, e -> String.valueOf(e.getUserId()))); |
|||
t.setApproveName(StreamUtils.join(userList, RemoteUserVo::getNickName)); |
|||
} |
|||
}); |
|||
} |
|||
return TableDataInfo.build(page); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 构建wrapper |
|||
* @param bo |
|||
* @return |
|||
*/ |
|||
private QueryWrapper<BusinessAlert> buildQueryWrapper(BusinessAlertBo bo) { |
|||
QueryWrapper<BusinessAlert> wrapper = new QueryWrapper<>(); |
|||
|
|||
wrapper.orderByAsc("ba.create_time"); |
|||
return wrapper; |
|||
} |
|||
|
|||
/** |
|||
* 构建通用流程wrapper |
|||
* @param wrapper |
|||
*/ |
|||
private void buildCommonQueryWrapper(QueryWrapper<BusinessAlert> wrapper) { |
|||
wrapper.eq("a.del_flag",0); |
|||
wrapper.eq("b.del_flag",0); |
|||
wrapper.eq("c.del_flag",0); |
|||
wrapper.in("a.node_type",1,3,4); |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(BusinessAlert alert, Boolean validId){ |
|||
if (ObjectUtil.isEmpty(alert.getId())){ |
|||
throw new ServiceException("预警【Id】为空!"); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,98 @@ |
|||
package org.dromara.business.service.impl; |
|||
|
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.apache.dubbo.config.annotation.DubboReference; |
|||
import org.dromara.business.domain.bo.BusinessAlertBo; |
|||
import org.dromara.business.domain.model.StatObj; |
|||
import org.dromara.business.mapper.BusinessAlertMapper; |
|||
import org.dromara.business.service.BusinessAlertStatisticsService; |
|||
import org.dromara.common.core.exception.ServiceException; |
|||
import org.dromara.system.api.RemoteDeptService; |
|||
import org.dromara.system.api.domain.vo.RemoteDeptVo; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Objects; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* |
|||
*预警统计Service业务层处理 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class BusinessAlertStatisticsServiceImpl implements BusinessAlertStatisticsService { |
|||
|
|||
private final BusinessAlertMapper baseMapper; |
|||
|
|||
@DubboReference |
|||
RemoteDeptService remoteDeptService; |
|||
|
|||
/** |
|||
* 按照月份分类预警数量(包含权限) |
|||
* @param businessAlertBo |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<StatObj> countMonthAlert(BusinessAlertBo businessAlertBo) { |
|||
if (ObjectUtil.isEmpty(businessAlertBo.getDeptId())){ |
|||
throw new ServiceException("部门【id】为空"); |
|||
} |
|||
|
|||
List<RemoteDeptVo> remoteDeptVoList = remoteDeptService.selectListByParentId(businessAlertBo.getDeptId()); |
|||
List<Long> departIdList = remoteDeptVoList.stream().map(RemoteDeptVo::getDeptId).toList(); |
|||
businessAlertBo.setDeptIdList(departIdList); |
|||
|
|||
List<Map<String, Object>> mapList = baseMapper.listMonthAlert(businessAlertBo); |
|||
|
|||
return mapList.stream().map(data -> new StatObj(data.get("dateMonth") + "", data.get("total"))).collect(Collectors.toList()); |
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public List<StatObj>countDepartAlert(BusinessAlertBo businessAlertBo) { |
|||
List<Map<String, Object>> mapList = baseMapper.listDepartAlert(businessAlertBo); |
|||
|
|||
return mapList.stream().map(data -> new StatObj(data.get("deptName") + "", Long.parseLong(data.get("total") + ""),"deptId",data.get("deptId"))).collect(Collectors.toList()); |
|||
} |
|||
|
|||
@Override |
|||
public List<StatObj> countMonthAlertStatus(BusinessAlertBo businessAlertBo) { |
|||
List<Map<String, Object>> mapList = baseMapper.listMonthAlertStatus(businessAlertBo); |
|||
|
|||
return mapList.stream() |
|||
.map(map -> new StatObj( |
|||
Objects.toString(map.get("dateMonth")), |
|||
List.of( |
|||
new StatObj("total", map.get("total")), |
|||
new StatObj("todoCount", map.get("todoCount")), |
|||
new StatObj("finishCount", map.get("finishCount")) |
|||
) |
|||
)) |
|||
.collect(Collectors.toList()); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<StatObj> countDepartAlertStatus(BusinessAlertBo businessAlertBo) { |
|||
List<Map<String, Object>> mapList = baseMapper.listDepartAlertStatus(businessAlertBo); |
|||
|
|||
return mapList.stream() |
|||
.map(map -> new StatObj( |
|||
Objects.toString(map.get("deptName")), |
|||
List.of( |
|||
new StatObj("total", map.get("total")), |
|||
new StatObj("todoCount", map.get("todoCount")), |
|||
new StatObj("finishCount", map.get("finishCount")) |
|||
),"deptId",map.get("deptId") |
|||
)) |
|||
.collect(Collectors.toList()); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,235 @@ |
|||
package org.dromara.business.service.impl; |
|||
|
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.alibaba.fastjson.JSON; |
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.apache.dubbo.config.annotation.DubboReference; |
|||
import org.dromara.business.domain.BusinessDepartBoundary; |
|||
import org.dromara.business.domain.BusinessGeospatialVectors; |
|||
import org.dromara.business.domain.BusinessPatrolAreas; |
|||
import org.dromara.business.domain.BusinessVectorDict; |
|||
import org.dromara.business.mapper.BusinessDepartBoundaryMapper; |
|||
import org.dromara.business.service.IBusinessDepartBoundaryService; |
|||
import org.dromara.business.service.IBusinessVectorDictService; |
|||
import org.dromara.business.utils.BatchProcessorUtil; |
|||
import org.dromara.business.utils.ShpAnalysisUtil; |
|||
import org.dromara.common.core.exception.ServiceException; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.satoken.utils.LoginHelper; |
|||
import org.dromara.system.api.RemoteDeptService; |
|||
import org.dromara.system.api.model.LoginUser; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.jdbc.datasource.DataSourceUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.sql.DataSource; |
|||
import java.io.InputStream; |
|||
import java.lang.reflect.Method; |
|||
import java.sql.Connection; |
|||
import java.sql.PreparedStatement; |
|||
import java.sql.ResultSet; |
|||
import java.sql.SQLException; |
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 部门区域 |
|||
*/ |
|||
@Service |
|||
@RequiredArgsConstructor |
|||
public class BusinessDepartBoundaryServiceImpl extends ServiceImpl<BusinessDepartBoundaryMapper, BusinessDepartBoundary> implements IBusinessDepartBoundaryService { |
|||
|
|||
|
|||
private final IBusinessVectorDictService vectorDictService; |
|||
|
|||
@DubboReference |
|||
RemoteDeptService remoteDeptService; |
|||
|
|||
private final DataSource dataSource; |
|||
|
|||
@Override |
|||
public TableDataInfo<BusinessDepartBoundary> listSysDepartBoundary(PageQuery pageQuery, BusinessDepartBoundary departBoundary) { |
|||
Page<BusinessDepartBoundary> page = baseMapper.listSysDepartBoundary(pageQuery.build(),departBoundary); |
|||
|
|||
return TableDataInfo.build(page); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<BusinessDepartBoundary> listSysDepartBoundaryGeomFromText(BusinessDepartBoundary departBoundary) { |
|||
return baseMapper.listSysDepartBoundaryGeomFromText(departBoundary); |
|||
} |
|||
|
|||
@Override |
|||
public List<BusinessDepartBoundary> queryByDeptId(String deptId) { |
|||
return baseMapper.queryByDeptId(deptId); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public boolean uploadShpFile(MultipartFile file,String deptId) { |
|||
List<BusinessGeospatialVectors> geospatialVectorsList = new ArrayList<>(); |
|||
try { |
|||
//1、首先调用解析工具拿到解析的字段集合
|
|||
InputStream inputStream = file.getInputStream(); |
|||
List<Map<String, String>> mapList = ShpAnalysisUtil.analysisShpFile(inputStream); |
|||
|
|||
// 3. 构建字典map
|
|||
List<BusinessVectorDict> fieldsInfoList = vectorDictService.listVectorField(); |
|||
|
|||
Map<String, List<String>> dictMap = fieldsInfoList |
|||
.stream() |
|||
.collect(Collectors.toMap( |
|||
BusinessVectorDict::getDictCode, |
|||
v -> v.getFieldMappingsList().stream() |
|||
.map(mapping -> mapping.getItemValue().toLowerCase()) // 转小写
|
|||
.collect(Collectors.toList()) |
|||
)); |
|||
|
|||
// 4. 遍历 mapList,替换映射关系并只保留有效条目
|
|||
List<Map<String, String>> resultList = mapList.stream() |
|||
.map(originalMap -> originalMap.entrySet().stream() |
|||
.filter(entry -> { |
|||
String keyLower = entry.getKey().toLowerCase(); // 将 mapList 中的 key 转换为小写
|
|||
// 遍历 dictMap 的所有 List<String>,检查其中是否包含该 key
|
|||
return dictMap.values().stream() |
|||
.anyMatch(list -> list.contains(keyLower)); // 判断 dictMap 中的 List<String> 是否包含该 key
|
|||
}) |
|||
.collect(Collectors.toMap( |
|||
entry -> { |
|||
// 根据匹配的 key 查找 dictMap 中对应的 key
|
|||
return dictMap.entrySet().stream() |
|||
.filter(mapEntry -> mapEntry.getValue().contains(entry.getKey().toLowerCase())) |
|||
.map(Map.Entry::getKey) |
|||
.findFirst() |
|||
.orElse(""); // 如果没有匹配到,则返回空字符串
|
|||
}, |
|||
Map.Entry::getValue |
|||
)) |
|||
) |
|||
.filter(transformedMap -> !transformedMap.isEmpty()) // 过滤空的 Map
|
|||
.collect(Collectors.toList()); |
|||
|
|||
|
|||
// 5. 通过反射设置 GeospatialVectors 对象的属性
|
|||
for (Map<String, String> transformedMap : resultList) { |
|||
BusinessGeospatialVectors geoVector = new BusinessGeospatialVectors(); |
|||
|
|||
transformedMap.forEach((key, value) -> { |
|||
try { |
|||
// 尝试通过反射找到相应的Setter方法,并调用
|
|||
Method setterMethod = BusinessGeospatialVectors.class.getMethod("set" + capitalizeFirstLetter(key), String.class); |
|||
|
|||
setterMethod.invoke(geoVector, value); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
}); |
|||
|
|||
geoVector.setCreateTime(new Date()); |
|||
geospatialVectorsList.add(geoVector); |
|||
} |
|||
|
|||
//6、生成新的对象集合存储数据表中
|
|||
List<BusinessDepartBoundary> boundaryList = buildBusinessDepartBoundary(geospatialVectorsList,deptId); |
|||
|
|||
// 分批处理
|
|||
int startIndex = 0; // 从第 0 条开始
|
|||
int batchSize = 2000; // 每批处理 2000 条
|
|||
boolean flag = BatchProcessorUtil.processBatches(boundaryList, batchSize, startIndex, batch -> { |
|||
//批量新增部门区域数据
|
|||
// this.baseMapper.saveBatchBoundary(batch);
|
|||
}); |
|||
|
|||
if (flag) { |
|||
System.out.println("所有数据处理完成!"); |
|||
} |
|||
|
|||
return true; |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public boolean updateDepartBoundary(BusinessDepartBoundary departBoundary) { |
|||
if (ObjectUtil.isEmpty(departBoundary.getId())) { |
|||
throw new ServiceException("【id】参数为空"); |
|||
} |
|||
|
|||
return this.updateById(departBoundary); |
|||
} |
|||
|
|||
@Override |
|||
public boolean addDepartBoundary(BusinessDepartBoundary departBoundary) { |
|||
return this.saveOrUpdate(departBoundary); |
|||
} |
|||
|
|||
@Override |
|||
public String listJson(BusinessDepartBoundary departBoundary) { |
|||
if(StringUtils.isBlank(departBoundary.getDeptId())){ |
|||
throw new ServiceException("部门【id】不存在"); |
|||
} |
|||
|
|||
return this.baseMapper.listJson(departBoundary); |
|||
} |
|||
|
|||
@Override |
|||
public boolean deleteDepartBoundary(String id) { |
|||
BusinessDepartBoundary departBoundary = this.baseMapper.selectById(id); |
|||
|
|||
if (ObjectUtil.isEmpty(departBoundary)) { |
|||
throw new ServiceException("实体不存在!"); |
|||
} |
|||
|
|||
return this.baseMapper.deleteById(departBoundary.getId())>0; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 根据解析的shp文件数据,构建部门区域 |
|||
* @param geospatialVectorsList |
|||
* @return |
|||
*/ |
|||
private List<BusinessDepartBoundary> buildBusinessDepartBoundary(List<BusinessGeospatialVectors> geospatialVectorsList,String deptId) { |
|||
List<BusinessDepartBoundary> resultList = new ArrayList<>(); |
|||
|
|||
List<Map<String,Object>> namePathList = remoteDeptService.getNamePathList(); |
|||
|
|||
Map<String, List<Map<String, Object>>> namePathMap = namePathList.stream() |
|||
.filter(item -> item.containsKey("shpNo")) |
|||
.collect(Collectors.groupingBy(item -> item.get("shpNo").toString())); |
|||
|
|||
geospatialVectorsList.forEach(param->{ |
|||
BusinessDepartBoundary businessDepartBoundary = new BusinessDepartBoundary(); |
|||
businessDepartBoundary.setBoundary(param.getLandCategories()); |
|||
businessDepartBoundary.setShpNo(param.getLandUnitCode()); |
|||
if (ObjectUtil.isNotEmpty(namePathMap.get(param.getLandUnitCode()))){ |
|||
businessDepartBoundary.setDeptName(namePathMap.get(param.getLandUnitCode()).get(0).get("deptName") + ""); |
|||
businessDepartBoundary.setDeptId(namePathMap.get(param.getLandUnitCode()).get(0).get("deptId") + ""); |
|||
businessDepartBoundary.setCommunityName(namePathMap.get(param.getLandUnitCode()).get(0).get("namePath") + ""); |
|||
|
|||
resultList.add(businessDepartBoundary); |
|||
} |
|||
}); |
|||
return resultList; |
|||
} |
|||
|
|||
|
|||
private static String capitalizeFirstLetter(String str) { |
|||
if (str == null || str.isEmpty()) { |
|||
return str; |
|||
} |
|||
return str.substring(0, 1).toUpperCase() + str.substring(1); |
|||
} |
|||
} |
@ -0,0 +1,197 @@ |
|||
package org.dromara.business.service.impl; |
|||
|
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.apache.commons.lang.StringUtils; |
|||
import org.apache.dubbo.config.annotation.DubboReference; |
|||
import org.dromara.business.domain.*; |
|||
import org.dromara.business.domain.bo.BusinessPatrolAreasBo; |
|||
import org.dromara.business.mapper.BusinessPatrolAreasMapper; |
|||
import org.dromara.business.service.*; |
|||
import org.dromara.business.utils.ShpAnalysisUtil; |
|||
import org.dromara.common.core.exception.ServiceException; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.satoken.utils.LoginHelper; |
|||
import org.dromara.system.api.RemoteDeptService; |
|||
import org.dromara.system.api.RemoteUserService; |
|||
import org.dromara.system.api.domain.vo.RemoteDeptVo; |
|||
import org.dromara.system.api.model.LoginUser; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.InputStream; |
|||
import java.lang.reflect.Method; |
|||
import java.util.*; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* @Description: 巡查区域 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class BusinessPatrolAreasServiceImpl extends ServiceImpl<BusinessPatrolAreasMapper, BusinessPatrolAreas> implements IBusinessPatrolAreasService { |
|||
|
|||
private final IBusinessVectorDictService vectorDictService; |
|||
|
|||
@DubboReference |
|||
private RemoteUserService remoteUserService; |
|||
@DubboReference |
|||
private RemoteDeptService remoteDeptService; |
|||
|
|||
@Override |
|||
public TableDataInfo<BusinessPatrolAreas> pagePatrolAreas(PageQuery pageQuery, BusinessPatrolAreasBo patrolAreasBo) { |
|||
LoginUser user = LoginHelper.getLoginUser(); |
|||
List<String> deptIds = new ArrayList<>(); |
|||
String departIds = null; |
|||
if(StringUtils.isBlank(patrolAreasBo.getDeptId())){ |
|||
RemoteDeptVo remoteDeptVo = remoteDeptService.selectDeptById(user.getDeptId()); |
|||
if(ObjectUtil.isEmpty(remoteDeptVo)){ |
|||
throw new ServiceException("部门不存在"); |
|||
} |
|||
departIds = user.getDeptId() + ""; |
|||
}else { |
|||
departIds = patrolAreasBo.getDeptId(); |
|||
} |
|||
|
|||
deptIds.add(departIds); |
|||
|
|||
return TableDataInfo.build(this.baseMapper.listPatrolAreas(pageQuery.build(), patrolAreasBo, deptIds)); |
|||
} |
|||
|
|||
@Override |
|||
public List<BusinessPatrolAreas> listPatrolAreas(BusinessPatrolAreasBo patrolAreasBo) { |
|||
return this.baseMapper.listPatrolAreas(patrolAreasBo, patrolAreasBo.getDeptIds()); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public boolean updatePatrolAreas(BusinessPatrolAreas patrolAreas) { |
|||
patrolAreas.setUserName(remoteUserService.selectUserNameById(Long.valueOf(patrolAreas.getUserId()))); |
|||
return this.updateById(patrolAreas); |
|||
} |
|||
|
|||
@Override |
|||
public List<BusinessPatrolAreas> exportXls(BusinessPatrolAreas patrolAreas) { |
|||
LambdaQueryWrapper<BusinessPatrolAreas> wrapper = buildWrapper(patrolAreas); |
|||
|
|||
return this.list(wrapper); |
|||
} |
|||
|
|||
@Override |
|||
public void addPatrolAreas(MultipartFile file) { |
|||
List<BusinessGeospatialVectors> geospatialVectorsList = new ArrayList<>(); |
|||
try { |
|||
//1、首先调用解析工具拿到解析的字段集合
|
|||
InputStream inputStream = file.getInputStream(); |
|||
List<Map<String, String>> mapList = ShpAnalysisUtil.analysisShpFile(inputStream); |
|||
|
|||
// 3. 构建字典map
|
|||
List<BusinessVectorDict> fieldsInfoList = vectorDictService.listVectorField(); |
|||
|
|||
Map<String, List<String>> dictMap = fieldsInfoList |
|||
.stream() |
|||
.collect(Collectors.toMap( |
|||
BusinessVectorDict::getDictCode, |
|||
v -> v.getFieldMappingsList().stream() |
|||
.map(mapping -> mapping.getItemValue().toLowerCase()) // 转小写
|
|||
.collect(Collectors.toList()) |
|||
)); |
|||
|
|||
// 4. 遍历 mapList,替换映射关系并只保留有效条目
|
|||
List<Map<String, String>> resultList = mapList.stream() |
|||
.map(originalMap -> originalMap.entrySet().stream() |
|||
.filter(entry -> { |
|||
String keyLower = entry.getKey().toLowerCase(); // 将 mapList 中的 key 转换为小写
|
|||
// 遍历 dictMap 的所有 List<String>,检查其中是否包含该 key
|
|||
return dictMap.values().stream() |
|||
.anyMatch(list -> list.contains(keyLower)); // 判断 dictMap 中的 List<String> 是否包含该 key
|
|||
}) |
|||
.collect(Collectors.toMap( |
|||
entry -> { |
|||
// 根据匹配的 key 查找 dictMap 中对应的 key
|
|||
return dictMap.entrySet().stream() |
|||
.filter(mapEntry -> mapEntry.getValue().contains(entry.getKey().toLowerCase())) |
|||
.map(Map.Entry::getKey) |
|||
.findFirst() |
|||
.orElse(""); // 如果没有匹配到,则返回空字符串
|
|||
}, |
|||
Map.Entry::getValue |
|||
)) |
|||
) |
|||
.filter(transformedMap -> !transformedMap.isEmpty()) // 过滤空的 Map
|
|||
.collect(Collectors.toList()); |
|||
|
|||
|
|||
// 5. 通过反射设置 GeospatialVectors 对象的属性
|
|||
for (Map<String, String> transformedMap : resultList) { |
|||
BusinessGeospatialVectors geoVector = new BusinessGeospatialVectors(); |
|||
|
|||
transformedMap.forEach((key, value) -> { |
|||
try { |
|||
// 尝试通过反射找到相应的Setter方法,并调用
|
|||
Method setterMethod = BusinessGeospatialVectors.class.getMethod("set" + capitalizeFirstLetter(key), String.class); |
|||
|
|||
setterMethod.invoke(geoVector, value); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
}); |
|||
|
|||
geoVector.setCreateTime(new Date()); |
|||
geospatialVectorsList.add(geoVector); |
|||
} |
|||
|
|||
//6、生成新的对象集合存储数据表中
|
|||
//todo 处理这个集合geospatialVectorsList
|
|||
List<BusinessPatrolAreas> areasList = buildBusinessPatrolAreas(geospatialVectorsList); |
|||
|
|||
|
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 根据解析shp得到的内容封装到BusinessPatrolAreas这个类里面 |
|||
* @param paramList |
|||
* @return |
|||
*/ |
|||
private List<BusinessPatrolAreas> buildBusinessPatrolAreas(List<BusinessGeospatialVectors> paramList) { |
|||
List<BusinessPatrolAreas> resultList = new ArrayList<>(); |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
private static String capitalizeFirstLetter(String str) { |
|||
if (str == null || str.isEmpty()) { |
|||
return str; |
|||
} |
|||
return str.substring(0, 1).toUpperCase() + str.substring(1); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<BusinessPatrolAreas> buildWrapper(BusinessPatrolAreas patrolAreas) { |
|||
LambdaQueryWrapper<BusinessPatrolAreas> wrapper = new LambdaQueryWrapper<>(); |
|||
|
|||
if (ObjectUtil.isNotEmpty(patrolAreas.getName())){ |
|||
wrapper.like(BusinessPatrolAreas::getName, patrolAreas.getName()); |
|||
} |
|||
|
|||
if (ObjectUtil.isNotEmpty(patrolAreas.getDeptId())){ |
|||
wrapper.eq(BusinessPatrolAreas::getDeptId, patrolAreas.getDeptId()); |
|||
} |
|||
|
|||
if (ObjectUtil.isNotEmpty(patrolAreas.getAreasIdList())){ |
|||
wrapper.in(BusinessPatrolAreas::getId, patrolAreas.getAreasIdList()); |
|||
} |
|||
|
|||
return wrapper; |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
package org.dromara.business.service.impl; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import org.dromara.business.domain.BusinessVectorDictItem; |
|||
import org.dromara.business.mapper.BusinessVectorDictItemMapper; |
|||
import org.dromara.business.service.IBusinessVectorDictItemService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 矢量数据字段映射关联服务类 |
|||
*/ |
|||
@Service |
|||
public class BusinessVectorDictItemServiceImpl extends ServiceImpl<BusinessVectorDictItemMapper, BusinessVectorDictItem> implements IBusinessVectorDictItemService { |
|||
|
|||
|
|||
@Override |
|||
public List<BusinessVectorDictItem> findDictItemByDictId(String dictId) { |
|||
LambdaQueryWrapper<BusinessVectorDictItem> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.eq(BusinessVectorDictItem::getDictId, dictId); |
|||
|
|||
return this.baseMapper.selectList(wrapper); |
|||
} |
|||
} |
@ -0,0 +1,37 @@ |
|||
package org.dromara.business.service.impl; |
|||
|
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import org.dromara.business.domain.BusinessVectorDict; |
|||
import org.dromara.business.mapper.BusinessVectorDictMapper; |
|||
import org.dromara.business.service.IBusinessVectorDictService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 矢量数据字段映射主表服务类 |
|||
*/ |
|||
@Service |
|||
public class BusinessVectorDictServiceImpl extends ServiceImpl<BusinessVectorDictMapper, BusinessVectorDict> implements IBusinessVectorDictService { |
|||
|
|||
|
|||
@Override |
|||
public List<BusinessVectorDict> listVectorField() { |
|||
return this.baseMapper.listVectorField(); |
|||
} |
|||
|
|||
@Override |
|||
public BusinessVectorDict findVectorDictById(String dictId) { |
|||
if (ObjectUtil.isEmpty(dictId)){ |
|||
throw new RuntimeException("【dictId】为空,参数为空!"); |
|||
} |
|||
|
|||
LambdaQueryWrapper<BusinessVectorDict> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.eq(BusinessVectorDict::getId, dictId); |
|||
|
|||
return this.baseMapper.selectOne(wrapper); |
|||
} |
|||
} |
@ -1,141 +0,0 @@ |
|||
package org.dromara.business.service.impl; |
|||
|
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.business.domain.WaylineAlert; |
|||
import org.dromara.business.domain.bo.WaylineAlertBo; |
|||
import org.dromara.business.domain.vo.WaylineAlertVo; |
|||
import org.dromara.business.mapper.WaylineAlertMapper; |
|||
import org.dromara.business.service.IWaylineAlertService; |
|||
import org.dromara.common.core.exception.ServiceException; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 预警任务Service业务层处理 |
|||
* |
|||
* @author LionLi |
|||
* @date 2025-02-27 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class WaylineAlertServiceImpl implements IWaylineAlertService { |
|||
|
|||
private final WaylineAlertMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询预警任务 |
|||
* |
|||
* @param id 主键 |
|||
* @return 预警任务 |
|||
*/ |
|||
@Override |
|||
public WaylineAlertVo getWaylineAlert(String id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询预警任务列表 |
|||
* |
|||
* @param param 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 预警任务分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<WaylineAlertVo> pageWaylineAlert(WaylineAlertBo param, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<WaylineAlert> lqw = buildQueryWrapper(param); |
|||
Page<WaylineAlertVo> result = baseMapper.pageAlert(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 查询符合条件的预警任务列表 |
|||
* |
|||
* @param param 查询条件 |
|||
* @return 预警任务列表 |
|||
*/ |
|||
@Override |
|||
public List<WaylineAlertVo> listWaylineAlert(WaylineAlertBo param) { |
|||
LambdaQueryWrapper<WaylineAlert> lqw = buildQueryWrapper(param); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 新增预警任务 |
|||
* |
|||
* @param param 预警任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean addWaylineAlert(WaylineAlertBo param) { |
|||
WaylineAlert alert = MapstructUtils.convert(param, WaylineAlert.class); |
|||
validEntityBeforeSave(alert,false); |
|||
return this.baseMapper.insert(alert) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 批量添加 |
|||
* @param alertList 预警任务 |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public Boolean saveBatchAlert(List<WaylineAlert> alertList) { |
|||
return this.baseMapper.insertBatch(alertList); |
|||
} |
|||
|
|||
/** |
|||
* 修改预警任务 |
|||
* |
|||
* @param param 预警任务 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateWaylineAlert(WaylineAlertBo param) { |
|||
WaylineAlert alert = MapstructUtils.convert(param, WaylineAlert.class); |
|||
validEntityBeforeSave(alert,true); |
|||
return baseMapper.updateById(alert) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(WaylineAlert alert,Boolean validId){ |
|||
if (ObjectUtil.isEmpty(alert.getId())){ |
|||
throw new ServiceException("预警【Id】为空!"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除预警任务信息 |
|||
* |
|||
* @param alertIdList 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWaylineAlert(List<String> alertIdList, Boolean isValid) { |
|||
if(isValid){ |
|||
if (ObjectUtil.isEmpty(alertIdList)){ |
|||
throw new ServiceException("预警Id为空!"); |
|||
} |
|||
} |
|||
return baseMapper.deleteByIds(alertIdList) > 0; |
|||
} |
|||
|
|||
private LambdaQueryWrapper<WaylineAlert> buildQueryWrapper(WaylineAlertBo bo) { |
|||
LambdaQueryWrapper<WaylineAlert> wrapper = Wrappers.lambdaQuery(); |
|||
|
|||
|
|||
wrapper.orderByAsc(WaylineAlert::getCreateTime); |
|||
return wrapper; |
|||
} |
|||
} |
@ -0,0 +1,39 @@ |
|||
package org.dromara.business.utils; |
|||
|
|||
import java.util.List; |
|||
import java.util.function.Consumer; |
|||
|
|||
/** |
|||
* 分批处理工具类 |
|||
*/ |
|||
public class BatchProcessorUtil { |
|||
|
|||
/** |
|||
* 分批处理数据 |
|||
* |
|||
* @param dataList 数据集合 |
|||
* @param batchSize 每批处理的数据量 |
|||
* @param startIndex 起始位置 |
|||
* @param batchHandler 每批数据的处理逻辑 |
|||
* @return 下一次的起始位置 |
|||
*/ |
|||
public static <T> boolean processBatches(List<T> dataList, int batchSize, int startIndex, Consumer<List<T>> batchHandler) { |
|||
if (dataList == null || dataList.isEmpty()) { |
|||
return true; // 数据为空,直接返回当前起始位置
|
|||
} |
|||
|
|||
int totalSize = dataList.size(); |
|||
while (startIndex < totalSize) { |
|||
int endIndex = Math.min(startIndex + batchSize, totalSize); |
|||
List<T> batch = dataList.subList(startIndex, endIndex); |
|||
|
|||
// 处理当前批次的数据
|
|||
batchHandler.accept(batch); |
|||
|
|||
// 更新起始位置
|
|||
startIndex = endIndex; |
|||
} |
|||
|
|||
return startIndex >= totalSize; // 返回下一次的起始位置
|
|||
} |
|||
} |
@ -0,0 +1,368 @@ |
|||
package org.dromara.business.utils; |
|||
|
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import org.geotools.data.FileDataStore; |
|||
import org.geotools.data.FileDataStoreFinder; |
|||
import org.geotools.data.shapefile.ShapefileDataStore; |
|||
import org.geotools.data.simple.SimpleFeatureCollection; |
|||
import org.geotools.data.simple.SimpleFeatureIterator; |
|||
import org.geotools.data.simple.SimpleFeatureSource; |
|||
import org.geotools.geometry.jts.JTS; |
|||
import org.geotools.referencing.CRS; |
|||
import org.locationtech.jts.geom.Coordinate; |
|||
import org.locationtech.jts.geom.Geometry; |
|||
import org.locationtech.jts.geom.MultiPolygon; |
|||
import org.locationtech.jts.geom.Polygon; |
|||
import org.locationtech.jts.operation.union.UnaryUnionOp; |
|||
import org.opengis.feature.Property; |
|||
import org.opengis.feature.simple.SimpleFeature; |
|||
import org.opengis.referencing.crs.CoordinateReferenceSystem; |
|||
import org.opengis.referencing.operation.MathTransform; |
|||
import org.opengis.referencing.operation.TransformException; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
|
|||
import java.io.*; |
|||
import java.nio.charset.Charset; |
|||
import java.nio.file.Files; |
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.zip.ZipEntry; |
|||
import java.util.zip.ZipException; |
|||
import java.util.zip.ZipInputStream; |
|||
|
|||
/** |
|||
* shp文件读取工具类 |
|||
* 支持不同类型的地理要素 |
|||
*/ |
|||
public class ShpAnalysisUtil { |
|||
|
|||
private static final Logger log = LoggerFactory.getLogger(ShpAnalysisUtil.class); |
|||
|
|||
private static final String CHECK_FIELD = "O_Com"; |
|||
|
|||
/** |
|||
* 读取shp文件,返回要素集合 |
|||
* @param shpPath shp文件路径 |
|||
* @return 要素集合,包含地理位置和属性信息 |
|||
*/ |
|||
public static List<Map<String, String>> analysisShpFile(String shpPath) { |
|||
List<Map<String, String>> resultList = new ArrayList<>(); |
|||
|
|||
try { |
|||
resultList=analysisShpFile(shpPath, "GBK"); |
|||
} catch (Exception e) { |
|||
log.error("无法使用支持的字符编码读取shp文件: {}", e.getMessage()); |
|||
} |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* 读取shp文件,返回要素集合 |
|||
* @param shpInputStream shp文件输入流 |
|||
* @return 要素集合,包含地理位置和属性信息 |
|||
*/ |
|||
public static List<Map<String, String>> analysisShpFile(InputStream shpInputStream) { |
|||
List<Map<String, String>> resultList = new ArrayList<>(); |
|||
|
|||
try { |
|||
resultList = analysisShpFile(shpInputStream, "GBK"); |
|||
} catch (Exception e) { |
|||
log.error("无法使用支持的字符编码读取shp文件输入流: {}", e.getMessage()); |
|||
} |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* 读取shp文件的主要方法(仅支持ZIP输入流) |
|||
* |
|||
* @param shpInputStream shp文件ZIP输入流 |
|||
* @param charset 字符编码 |
|||
* @return 要素集合,包含地理位置和属性信息 |
|||
* @throws IllegalArgumentException 如果输入流不是ZIP格式 |
|||
*/ |
|||
public static List<Map<String, String>> analysisShpFile(InputStream shpInputStream, String charset) { |
|||
// 存储解析出的要素集合
|
|||
List<Map<String, String>> resultList = new ArrayList<>(); |
|||
File tempDir = null; |
|||
|
|||
try { |
|||
// 创建临时目录
|
|||
tempDir = Files.createTempDirectory("plough_shp_").toFile(); |
|||
tempDir.deleteOnExit(); // 额外保障
|
|||
|
|||
// 使用指定编码的ZipInputStream处理
|
|||
Charset zipCharset = Charset.forName(charset); |
|||
try (ZipInputStream zipInputStream = new ZipInputStream(new BufferedInputStream(shpInputStream), zipCharset)) { |
|||
ZipEntry entry; |
|||
boolean shpFound = false; |
|||
while ((entry = zipInputStream.getNextEntry()) != null) { |
|||
// 处理文件名编码问题
|
|||
log.info("文件名字:{}",entry.getName()); |
|||
File outputFile = new File(tempDir, entry.getName()); |
|||
|
|||
// 创建父目录
|
|||
if (entry.isDirectory()) { |
|||
outputFile.mkdirs(); |
|||
} else { |
|||
// 确保父目录存在
|
|||
outputFile.getParentFile().mkdirs(); |
|||
|
|||
// 写入文件
|
|||
try (FileOutputStream fos = new FileOutputStream(outputFile)) { |
|||
byte[] buffer = new byte[1024]; |
|||
int len; |
|||
while ((len = zipInputStream.read(buffer)) > 0) { |
|||
fos.write(buffer, 0, len); |
|||
} |
|||
} |
|||
|
|||
// 检查是否为SHP文件
|
|||
if (entry.getName().toLowerCase().endsWith(".shp")) { |
|||
shpFound = true; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// 如果没有找到SHP文件,抛出异常
|
|||
if (!shpFound) { |
|||
throw new FileNotFoundException("ZIP压缩包中未找到SHP文件"); |
|||
} |
|||
} catch (ZipException e) { |
|||
// 非ZIP输入流,抛出异常
|
|||
throw new IllegalArgumentException("输入流不是有效的ZIP格式", e); |
|||
} |
|||
|
|||
// 查找第一个.shp文件
|
|||
File shpFile = findFirstShpFile(tempDir); |
|||
if (shpFile == null) { |
|||
throw new FileNotFoundException("未找到SHP文件"); |
|||
} |
|||
|
|||
// 使用找到的SHP文件路径调用现有方法
|
|||
resultList = analysisShpFile(shpFile.getAbsolutePath(), charset); |
|||
|
|||
} catch (Exception e) { |
|||
log.error("处理SHP文件输入流失败: {}", e.getMessage(), e); |
|||
throw new RuntimeException("处理SHP文件失败", e); |
|||
} finally { |
|||
// 尝试删除临时目录及其内容
|
|||
if (tempDir != null && tempDir.exists()) { |
|||
deleteDirectory(tempDir); |
|||
} |
|||
//关闭流文件
|
|||
try { |
|||
shpInputStream.close(); |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 读取shp文件的主要方法 |
|||
* |
|||
* @param shpPath shp文件路径 |
|||
* @param charset 字符编码 |
|||
* @return 要素集合,包含地理位置和属性信息 |
|||
*/ |
|||
public static List<Map<String, String>> analysisShpFile(String shpPath, String charset) { |
|||
// 存储解析出的要素集合
|
|||
List<Map<String, String>> resultList = new ArrayList<>(); |
|||
|
|||
try { |
|||
// 1、验证文件在路径中是否存在
|
|||
File shpFile = new File(shpPath); |
|||
if (!shpFile.exists()) { |
|||
log.error("shp文件不存在:{} ", shpPath); |
|||
return resultList; |
|||
} |
|||
|
|||
// 2、设置GeoTools坐标的字符编码
|
|||
System.setProperty("org.geotools.referencing.charset", charset); |
|||
System.setProperty("org.geotools.shapefile.charset", charset); |
|||
|
|||
// 3、获取数据存储实例
|
|||
FileDataStore dataStore = FileDataStoreFinder.getDataStore(shpFile); |
|||
if (ObjectUtil.isEmpty(dataStore)) { |
|||
log.error("无法打开shape文件:{} ", shpPath); |
|||
return resultList; |
|||
} |
|||
|
|||
// 4、设置shp文件的DBF文件编码
|
|||
if (dataStore instanceof ShapefileDataStore) { |
|||
((ShapefileDataStore) dataStore).setCharset(Charset.forName(charset)); |
|||
} |
|||
|
|||
try { |
|||
// 5、获取要素源和要素集合
|
|||
SimpleFeatureSource featureSource = dataStore.getFeatureSource(); |
|||
SimpleFeatureCollection featureCollection = featureSource.getFeatures(); |
|||
String typeName = dataStore.getTypeNames()[0]; |
|||
CoordinateReferenceSystem sourceCRS = dataStore.getFeatureSource(typeName).getSchema().getCoordinateReferenceSystem(); |
|||
CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4326"); |
|||
MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, true); |
|||
|
|||
// 遍历处理每个要素
|
|||
try (SimpleFeatureIterator iterator = featureCollection.features()) { |
|||
while (iterator.hasNext()) { |
|||
SimpleFeature feature = iterator.next(); |
|||
Map<String, String> featureMap = new HashMap<>(); |
|||
|
|||
for (Property property : feature.getProperties()) { |
|||
String name = property.getName().toString(); |
|||
Object value = property.getValue(); |
|||
|
|||
// 处理几何数据
|
|||
try { |
|||
if (value instanceof Geometry) { |
|||
// 如果值本身就是Geometry类型,直接使用
|
|||
value = analysisGeometry((Geometry) value, transform); |
|||
} |
|||
} catch (Exception e) { |
|||
log.warn("Error processing geometry for property {}: {}", name, e.getMessage()); |
|||
} |
|||
|
|||
// 处理特殊字段
|
|||
if (name.startsWith(CHECK_FIELD)) { |
|||
Map<String, String> parsedValues = parseOComValue(value); |
|||
featureMap.putAll(parsedValues); |
|||
} else { |
|||
featureMap.put(name, value.toString()); |
|||
} |
|||
} |
|||
|
|||
resultList.add(featureMap); |
|||
} |
|||
} |
|||
} finally { |
|||
// 确保数据存储被正确关闭
|
|||
dataStore.dispose(); |
|||
} |
|||
|
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
log.error("读取shape文件失败: {}", e.getMessage()); |
|||
} |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 解析O_Com字段值 |
|||
* |
|||
* @param oComValue O_Com字段值 |
|||
* @return 解析后的属性Map |
|||
*/ |
|||
private static Map<String, String> parseOComValue(Object oComValue) { |
|||
// 初始化返回结果Map
|
|||
Map<String, String> attributes = new HashMap<>(); |
|||
if (ObjectUtil.isEmpty(oComValue)) return attributes; |
|||
|
|||
// 预处理字符串,去除多余空格
|
|||
String comStr = oComValue.toString().trim(); |
|||
|
|||
try { |
|||
// 按分号分割键值对
|
|||
String[] pairs = comStr.split(";"); |
|||
for (String pair : pairs) { |
|||
pair = pair.trim(); |
|||
if (pair.isEmpty()) continue; |
|||
|
|||
// 解析键值对
|
|||
String[] keyValue = pair.split(":"); |
|||
if (keyValue.length == 2) { |
|||
// 清理键值中的引号
|
|||
String key = keyValue[0].trim().replace("\"", ""); |
|||
String value = keyValue[1].trim().replace("\"", ""); |
|||
|
|||
// 直接存储字符串值,不进行类型转换
|
|||
attributes.put(key, value); |
|||
} |
|||
} |
|||
} catch (Exception e) { |
|||
log.error("解析O_Com字段值失败: {}", e.getMessage()); |
|||
} |
|||
|
|||
return attributes; |
|||
} |
|||
|
|||
|
|||
private static String analysisGeometry(Geometry geometry, MathTransform transform) throws TransformException { |
|||
String resultStr = ""; |
|||
// 对每个 Polygon 进行坐标转换
|
|||
Geometry transformedGeometry = JTS.transform(geometry, transform); |
|||
MultiPolygon multiPolygon = (MultiPolygon) transformedGeometry; |
|||
Geometry unionGeometry = UnaryUnionOp.union(multiPolygon); |
|||
if (unionGeometry instanceof Polygon) { |
|||
Polygon polygon = (Polygon) unionGeometry; |
|||
resultStr = convertPolygonToWKT(polygon); |
|||
} |
|||
|
|||
return resultStr; |
|||
} |
|||
|
|||
|
|||
|
|||
private static String convertPolygonToWKT(Polygon polygon) { |
|||
StringBuffer polygonSb = new StringBuffer("GEOMETRYCOLLECTION(POLYGON(("); |
|||
|
|||
Coordinate[] coordinates = polygon.getCoordinates(); |
|||
for (int i = 0; i < coordinates.length; i++) { |
|||
Coordinate coord = coordinates[i]; |
|||
if (i > 0) polygonSb.append(","); |
|||
polygonSb.append(coord.y + " " + coord.x); |
|||
} |
|||
if(coordinates[0].x !=coordinates[coordinates.length-1].x){ |
|||
polygonSb.append(","+coordinates[0].y + " " + coordinates[0].x); |
|||
} |
|||
polygonSb.append(")))"); |
|||
return polygonSb.toString(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 递归删除目录 |
|||
* @param directory 要删除的目录 |
|||
*/ |
|||
private static void deleteDirectory(File directory) { |
|||
File[] files = directory.listFiles(); |
|||
if (files != null) { |
|||
for (File file : files) { |
|||
if (file.isDirectory()) { |
|||
deleteDirectory(file); |
|||
} else { |
|||
boolean deleted = file.delete(); |
|||
if (!deleted) { |
|||
log.warn("删除文件 {} 失败", file.getAbsolutePath()); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
boolean dirDeleted = directory.delete(); |
|||
if (!dirDeleted) { |
|||
log.warn("删除目录 {} 失败", directory.getAbsolutePath()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 在指定目录中查找第一个.shp文件 |
|||
* @param directory 搜索目录 |
|||
* @return 找到的第一个.shp文件,未找到返回null |
|||
*/ |
|||
private static File findFirstShpFile(File directory) { |
|||
File[] files = directory.listFiles((dir, name) -> name.toLowerCase().endsWith(".shp")); |
|||
return files != null && files.length > 0 ? files[0] : null; |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,205 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.dromara.business.mapper.BusinessAlertMapper"> |
|||
|
|||
<select id="pageBusinessAlert" resultType="org.dromara.business.domain.BusinessAlert"> |
|||
select |
|||
ba.*, |
|||
b.flow_status flowStatus, |
|||
b.business_id businessId, |
|||
from dk_business.business_alert ba |
|||
left join dk_workflow.flow_instance b on ba.id = b.business_id |
|||
${ew.getCustomSqlSegment} |
|||
</select> |
|||
|
|||
<select id="pageAlertFinish" resultType="org.dromara.business.domain.BusinessAlert"> |
|||
select |
|||
ba.*, |
|||
b.flow_status flowStatus, |
|||
b.business_id businessId, |
|||
a.approver, |
|||
a.id flowTaskId |
|||
from dk_business.business_alert ba |
|||
left join dk_workflow.flow_instance b on ba.id = b.business_id |
|||
left join dk_workflow.flow_his_task a on a.instance_id = b.id |
|||
left join dk_workflow.flow_definition c on a.definition_id = c.id |
|||
${ew.getCustomSqlSegment} |
|||
</select> |
|||
|
|||
|
|||
<select id="pageAlertTodo" resultType="org.dromara.business.domain.BusinessAlert"> |
|||
select |
|||
ba.*, |
|||
b.flow_status, |
|||
b.business_id, |
|||
uu.processed_by approver, |
|||
a.id flowTaskId |
|||
from dk_business.business_alert ba |
|||
left join dk_workflow.flow_instance b on ba.id = b.business_id |
|||
left join dk_workflow.flow_task a on a.instance_id = b.id |
|||
left join dk_workflow.flow_user uu on uu.associated = a.id |
|||
left join dk_workflow.flow_definition c on a.definition_id = c.id |
|||
${ew.getCustomSqlSegment} |
|||
</select> |
|||
|
|||
<select id="listMonthAlert" resultType="java.util.Map"> |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 0 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 0 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
union all |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 1 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 1 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
union all |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 2 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 2 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
union all |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 3 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 3 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
union all |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 4 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 4 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
union all |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 5 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 5 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
union all |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 6 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 6 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
union all |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 7 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 7 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
union all |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 8 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 8 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
union all |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 9 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 9 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
union all |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 10 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 10 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
union all |
|||
SELECT DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 11 MONTH), '%Y-%m') AS dateMonth,count(1) total from business_alert ba |
|||
where DATE_FORMAT(ba.create_time, '%Y-%m' ) = DATE_FORMAT(DATE_ADD(DATE_FORMAT(CURDATE(), '%Y-01-01'), INTERVAL 11 MONTH), '%Y-%m') |
|||
<if test="param.deptIdList != null and param.deptIdList.size > 0"> |
|||
and ba.dept_id in |
|||
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=","> |
|||
item |
|||
</foreach> |
|||
</if> |
|||
|
|||
</select> |
|||
|
|||
<select id="listDepartAlert" resultType="java.util.Map"> |
|||
select ba.dept_name deptName, ba.dept_id deptId,count(1) total |
|||
from business_alert ba |
|||
where 1=1 |
|||
<if test="param.createTime != null and param.createTime != ''"> |
|||
and DATE_FORMAT(ba.create_time,'%Y-%m') = DATE_FORMAT(#{param.createTime},'%Y-%m') |
|||
</if> |
|||
GROUP BY ba.dept_name,ba.dept_id |
|||
</select> |
|||
|
|||
<select id="listMonthAlertStatus" resultType="java.util.Map"> |
|||
WITH RECURSIVE months AS ( |
|||
SELECT MAKEDATE(YEAR(NOW()), 1) AS dateMonth |
|||
UNION ALL |
|||
SELECT DATE_ADD(dateMonth, INTERVAL 1 MONTH) |
|||
FROM months |
|||
WHERE <![CDATA[ dateMonth < LAST_DAY(MAKEDATE(YEAR(NOW()), 1) + INTERVAL 10 MONTH) ]]> |
|||
) |
|||
SELECT |
|||
DATE_FORMAT(m.dateMonth, '%Y-%m') AS dateMonth, |
|||
COALESCE(COUNT(ba.id), 0) AS total, |
|||
COALESCE(SUM(ba.handle_type = 'waiting'), 0) AS todoCount, |
|||
COALESCE(SUM(ba.handle_type = 'finish'), 0) AS finishCount |
|||
FROM months m |
|||
LEFT JOIN business_alert ba |
|||
ON DATE_FORMAT(ba.create_time, '%Y-%m') = DATE_FORMAT(m.dateMonth, '%Y-%m') |
|||
GROUP BY m.dateMonth |
|||
ORDER BY m.dateMonth |
|||
</select> |
|||
|
|||
<select id="listDepartAlertStatus" resultType="java.util.Map"> |
|||
SELECT |
|||
ba.dept_name deptName, |
|||
ba.dept_id deptId, |
|||
count( 1 ) total, |
|||
SUM( handle_type = 'waiting' ) AS todoCount, |
|||
SUM( handle_type = 'finish' ) AS finishCount |
|||
FROM |
|||
business_alert ba |
|||
where 1=1 |
|||
<if test="param.createTime != null and param.createTime != ''"> |
|||
and DATE_FORMAT(ba.create_time,'%Y-%m') = DATE_FORMAT(#{param.createTime},'%Y-%m') |
|||
</if> |
|||
GROUP BY |
|||
ba.dept_name,ba.dept_id |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,147 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.dromara.business.mapper.BusinessDepartBoundaryMapper"> |
|||
<select id="listSysDepartBoundary" resultType="org.dromara.business.domain.BusinessDepartBoundary"> |
|||
SELECT |
|||
db.id, |
|||
db.dept_id, |
|||
db.dept_name, |
|||
db.type, |
|||
db.community_name, |
|||
CONCAT( |
|||
REPLACE ( REPLACE ( REPLACE ( REPLACE ( ST_AsText ( db.boundary ), 'GEOMETRYCOLLECTION(POLYGON((', '[[' ), ')))', ']]' ), ',', '],[' ), ' ', ',' ) |
|||
) AS boundary, |
|||
db.create_by, |
|||
db.create_time |
|||
FROM |
|||
business_depart_boundary db |
|||
LEft JOIN dk_cloud.sys_dept d on db.dept_id = d.dept_id |
|||
<where> |
|||
<if test="condition.deptId != null and condition.deptId != ''"> |
|||
and (db.dept_id = #{condition.deptId} or d.parent_id = #{condition.deptId}) |
|||
</if> |
|||
<if test="condition.communityName != null and condition.communityName != ''"> |
|||
and db.community_name like concat(concat('%',#{condition.communityName}),'%') |
|||
</if> |
|||
|
|||
</where> |
|||
</select> |
|||
|
|||
|
|||
<select id="listSysDepartBoundaryGeomFromText" resultType="org.dromara.business.domain.BusinessDepartBoundary"> |
|||
SELECT |
|||
db.id, |
|||
db.dept_id, |
|||
db.dept_name, |
|||
db.type, |
|||
db.community_name, |
|||
CONCAT( |
|||
REPLACE ( REPLACE ( REPLACE ( REPLACE ( ST_AsText ( db.boundary ), 'GEOMETRYCOLLECTION(POLYGON((', '[[' ), ')))', ']]' ), ',', '],[' ), ' ', ',' ) |
|||
) AS boundary, |
|||
db.create_by, |
|||
db.create_time |
|||
FROM |
|||
business_depart_boundary db |
|||
LEft JOIN dk_cloud.sys_dept d on db.dept_id = d.dept_id |
|||
<where> |
|||
<if test="condition.deptId != null and condition.deptId != ''"> |
|||
and (db.dept_id = #{condition.deptId} or d.parent_id = #{condition.deptId}) |
|||
</if> |
|||
<if test="condition.communityName != null and condition.communityName != ''"> |
|||
and db.community_name like concat(concat('%',#{condition.communityName}),'%') |
|||
</if> |
|||
<if test="condition.shpNo != null and condition.shpNo != ''"> |
|||
and db.shp_so like #{condition.shpNo} |
|||
</if> |
|||
</where> |
|||
</select> |
|||
|
|||
|
|||
<select id="queryByDeptId" resultType="org.dromara.business.domain.BusinessDepartBoundary"> |
|||
SELECT |
|||
db.id, |
|||
db.dept_id, |
|||
db.dept_name, |
|||
db.type, |
|||
db.community_name, |
|||
CONCAT( |
|||
REPLACE ( REPLACE ( REPLACE ( REPLACE ( ST_AsText ( db.boundary ), 'GEOMETRYCOLLECTION(POLYGON((', '[[' ), ')))', ']]' ), ',', '],[' ), ' ', ',' ) |
|||
) AS boundary, |
|||
db.create_by, |
|||
db.create_time |
|||
FROM |
|||
business_depart_boundary db |
|||
LEft JOIN dk_cloud.sys_dept d on db.dept_id = d.dept_id |
|||
WHERE d.id = #{deptId} |
|||
</select> |
|||
|
|||
<insert id="saveBatchBoundary"> |
|||
INSERT INTO business_depart_boundary ( |
|||
dept_id, |
|||
dept_name, |
|||
community_name, |
|||
boundary, |
|||
perimeter, |
|||
area, |
|||
area_mu, |
|||
shp_no, |
|||
village_type, |
|||
create_by, |
|||
create_time, |
|||
update_by, |
|||
update_time, |
|||
create_dept |
|||
) |
|||
VALUES |
|||
<foreach collection="list" item="item" separator=","> |
|||
(#{item.deptId}, |
|||
#{item.deptName}, |
|||
#{item.communityName}, |
|||
ST_GeomFromText(#{item.boundary}), |
|||
#{item.perimeter}, |
|||
#{item.area}, |
|||
#{item.areaMu}, |
|||
#{item.shpNo}, |
|||
#{item.villageType}, |
|||
#{item.createBy}, |
|||
#{item.createTime}, |
|||
#{item.updateBy}, |
|||
#{item.updateTime}, |
|||
#{item.createDept}) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
<select id="listJson" resultType="java.lang.String"> |
|||
SELECT |
|||
JSON_OBJECT( |
|||
'type', |
|||
'FeatureCollection', |
|||
'features', |
|||
COALESCE ( |
|||
JSON_ARRAYAGG( |
|||
JSON_OBJECT( |
|||
'type', |
|||
'Feature', |
|||
'properties', |
|||
JSON_OBJECT( |
|||
'deptId', l.dept_id, |
|||
'deptName', l.dept_name, |
|||
'adcode', l.shp_no, |
|||
'name', l.community_name, |
|||
'community_name', l.community_name |
|||
), |
|||
'geometry', |
|||
ST_AsGeoJSON(l.boundary) |
|||
) |
|||
), |
|||
JSON_ARRAY() |
|||
) |
|||
) AS landCategoriesJson |
|||
FROM |
|||
business_depart_boundary l |
|||
LEFT JOIN dk_cloud.sys_dept d ON l.dept_id = d.dept_id |
|||
WHERE |
|||
d.dept_id = #{param.deptId} |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,55 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.dromara.business.mapper.BusinessPatrolAreasMapper"> |
|||
<resultMap id="listPatrolAreasMap" type="org.dromara.business.domain.BusinessPatrolAreas"> |
|||
<result column="id" property="id" jdbcType="VARCHAR"/> |
|||
<result column="name" property="name" jdbcType="VARCHAR"/> |
|||
<result column="number" property="number" jdbcType="VARCHAR"/> |
|||
<result column="dept_id" property="deptId" jdbcType="VARCHAR"/> |
|||
<result column="dept_ids" property="deptIds" jdbcType="VARCHAR"/> |
|||
<result column="platform_type" property="platformType" jdbcType="VARCHAR"/> |
|||
<result column="dept_name" property="deptName" jdbcType="VARCHAR"/> |
|||
<result column="leader_dept_id" property="leaderDeptId" jdbcType="VARCHAR"/> |
|||
<result column="user_id" property="userId" jdbcType="VARCHAR"/> |
|||
<result column="user_name" property="userName" jdbcType="VARCHAR"/> |
|||
<result column="create_by" property="createBy" jdbcType="VARCHAR"/> |
|||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> |
|||
<collection column="{areaId=id}" |
|||
property="patrolAreasUsers" ofType="org.dromara.business.domain.BusinessPatrolAreasUser" |
|||
javaType="java.util.ArrayList" |
|||
select="org.dromara.business.mapper.BusinessPatrolAreasUserMapper.listPatrolAreasUserByAreaId"/> |
|||
<collection column="{areaId=id}" |
|||
property="patrolAreasPoints" ofType="org.dromara.business.domain.BusinessPatrolAreasPoints" |
|||
javaType="java.util.ArrayList" |
|||
select="org.dromara.business.mapper.BusinessPatrolAreasPointsMapper.listPatrolAreasPointByAreaId"/> |
|||
</resultMap> |
|||
<select id="listPatrolAreas" resultMap="listPatrolAreasMap"> |
|||
select pa.*,sd.dept_name as dept_name from business_patrol_areas pa |
|||
LEFT JOIN dk_cloud.sys_dept sd ON pa.dept_id = sd.dept_id |
|||
where |
|||
pa.del_flag = 0 |
|||
<if test="deptIds.size > 0"> |
|||
and pa.dept_id in |
|||
<foreach item="id" collection="deptIds" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</if> |
|||
<if test="condition.name != null and condition.name != ''"> |
|||
and pa.name LIKE concat(concat('%',#{condition.name}),'%') |
|||
</if> |
|||
<if test="condition.platformType != null and condition.platformType != ''"> |
|||
AND pa.id IN ( |
|||
SELECT api.patrol_areas_id |
|||
FROM business_patrol_areas_platform_info api |
|||
|
|||
WHERE api.platform_type = 'plough' |
|||
) |
|||
</if> |
|||
<if test="condition.name != null and condition.name != ''"> |
|||
and pa.name LIKE concat(concat('%',#{condition.name}),'%') |
|||
</if> |
|||
<if test="condition.isDisable != null and condition.isDisable != ''"> |
|||
and pa.is_disable =#{condition.isDisable} |
|||
</if> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,7 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.dromara.business.mapper.BusinessVectorDictItemMapper"> |
|||
|
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.dromara.business.mapper.BusinessVectorDictMapper"> |
|||
|
|||
<resultMap id="fieldResultMap" type="org.dromara.business.domain.BusinessVectorDict"> |
|||
<id property="id" column="id"/> |
|||
<result property="dictCode" column="dictCode"/> |
|||
<collection property="fieldMappingsList" ofType="org.dromara.business.domain.BusinessVectorDictItem"> |
|||
<result property="id" column="dictItemId"/> |
|||
<result property="itemValue" column="mappingValue"/> |
|||
<result property="dictId" column="dictId"/> |
|||
</collection> |
|||
</resultMap> |
|||
|
|||
<select id="listVectorField" resultMap="fieldResultMap"> |
|||
SELECT |
|||
f.id AS id, |
|||
f.dict_code AS dictCode, |
|||
m.dict_id AS dictId, |
|||
m.id AS dictItemId, |
|||
m.item_value AS mappingValue |
|||
FROM |
|||
business_vector_dict f |
|||
LEFT JOIN |
|||
business_vector_dict_item m ON f.id = m.dict_id |
|||
</select> |
|||
|
|||
</mapper> |
@ -1,51 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.dromara.business.mapper.WaylineAlertMapper"> |
|||
|
|||
<select id="pageAlert" resultType="org.dromara.business.domain.vo.WaylineAlertVo"> |
|||
select |
|||
id, |
|||
wheel_id, |
|||
task_id, |
|||
task_image_id, |
|||
reason, |
|||
images, |
|||
lat, |
|||
lng, |
|||
task_handle_type, |
|||
task_content, |
|||
complete_date, |
|||
handle_type, |
|||
del_flag, |
|||
mate_source_img_url, |
|||
max_mate_source_img_url, |
|||
max_images, |
|||
area, |
|||
area_l, |
|||
area_w, |
|||
handle_in_type, |
|||
is_illegal, |
|||
dept_id, |
|||
dept_name, |
|||
job_name, |
|||
handle_time, |
|||
task_handle, |
|||
platform_type, |
|||
pixel_coordinate, |
|||
handle_num, |
|||
territory_remark, |
|||
land_categories, |
|||
territory_url, |
|||
territory_path, |
|||
ignoring_cause, |
|||
handle_source, |
|||
create_by, |
|||
create_time |
|||
from wayline_alert |
|||
${ew.customSqlSegment} |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,34 @@ |
|||
package org.dromara.workflow.common.handler; |
|||
|
|||
import org.dromara.workflow.api.event.ProcessCreateTaskEvent; |
|||
import org.dromara.workflow.api.event.ProcessDeleteEvent; |
|||
import org.dromara.workflow.api.event.ProcessEvent; |
|||
|
|||
public interface FlwCommonHandler { |
|||
|
|||
/** |
|||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等) |
|||
* |
|||
* @param processEvent 参数 |
|||
*/ |
|||
public void processHandler(ProcessEvent processEvent); |
|||
|
|||
/** |
|||
* 执行任务创建监听 |
|||
* 在方法中判断流程节点key |
|||
* if ("xxx".equals(processCreateTaskEvent.getNodeCode())) { |
|||
* //执行业务逻辑
|
|||
* } |
|||
* |
|||
* @param processCreateTaskEvent 参数 |
|||
*/ |
|||
public void processCreateTaskHandler(ProcessCreateTaskEvent processCreateTaskEvent); |
|||
|
|||
/** |
|||
* 监听删除流程事件 |
|||
* 正常使用只需#processDeleteEvent.flowCode=='leave1' |
|||
* |
|||
* @param processDeleteEvent 参数 |
|||
*/ |
|||
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent); |
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue