diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/controller/CementMixPileExtApiController.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/controller/CementMixPileExtApiController.java new file mode 100644 index 000000000..c559d5813 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/controller/CementMixPileExtApiController.java @@ -0,0 +1,70 @@ +package com.zhgd.xmgl.modules.bigdevice.controller; + +import com.zhgd.annotation.OperLog; +import com.zhgd.jeecg.common.api.vo.Result; +import com.zhgd.xmgl.modules.bigdevice.entity.dto.UploadAlarmDto; +import com.zhgd.xmgl.modules.bigdevice.entity.dto.UploadPilDto; +import com.zhgd.xmgl.modules.bigdevice.entity.dto.UploadRealtimeDto; +import com.zhgd.xmgl.modules.bigdevice.entity.dto.UploadTaskAndPointDto; +import com.zhgd.xmgl.modules.bigdevice.service.impl.CementMixPileExtApiService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * @Title: Controller + * @Description: 水泥搅拌桩/旋挖沉桩外部API + * @author: pds + * @date: 2025-12-12 + * @version: V1.0 + */ +@RestController +@RequestMapping("/xmgl/cementMixPileExtApi") +@Slf4j +@Api(tags = "水泥搅拌桩/旋挖沉桩外部API") +public class CementMixPileExtApiController { + @Lazy + @Autowired + private CementMixPileExtApiService cementMixPileExtApiService; + + @OperLog(operModul = "水泥搅拌桩/旋挖沉桩外部API管理", operType = "", operDesc = "上传水泥搅拌桩/旋挖沉桩任务和点位数据") + @ApiOperation(value = "上传水泥搅拌桩/旋挖沉桩任务和点位数据", notes = "上传水泥搅拌桩/旋挖沉桩任务和点位数据", httpMethod = "POST") + @PostMapping(value = "/uploadTaskAndPoint") + public Result uploadTaskAndPoint(@RequestBody UploadTaskAndPointDto dto) { + cementMixPileExtApiService.uploadTaskAndPoint(dto); + return Result.ok(); + } + + @OperLog(operModul = "水泥搅拌桩/旋挖沉桩外部API管理", operType = "", operDesc = "上传水泥搅拌桩/旋挖沉桩数据") + @ApiOperation(value = "上传水泥搅拌桩/旋挖沉桩数据", notes = "上传水泥搅拌桩/旋挖沉桩数据", httpMethod = "POST") + @PostMapping(value = "/uploadPil") + public Result uploadPil(@RequestBody UploadPilDto dto) { + cementMixPileExtApiService.uploadPil(dto); + return Result.ok(); + } + + @OperLog(operModul = "水泥搅拌桩/旋挖沉桩外部API管理", operType = "", operDesc = "上传水泥搅拌桩/旋挖实时数据") + @ApiOperation(value = "上传水泥搅拌桩/旋挖实时数据", notes = "上传水泥搅拌桩/旋挖实时数据", httpMethod = "POST") + @PostMapping(value = "/uploadRealtime") + public Result uploadRealtime(@RequestBody UploadRealtimeDto dto) { + cementMixPileExtApiService.uploadRealtime(dto); + return Result.ok(); + } + + @OperLog(operModul = "水泥搅拌桩/旋挖沉桩外部API管理", operType = "", operDesc = "上传水泥搅拌桩/旋挖报警数据") + @ApiOperation(value = "上传水泥搅拌桩/旋挖报警数据", notes = "上传水泥搅拌桩/旋挖报警数据", httpMethod = "POST") + @PostMapping(value = "/uploadAlarm") + public Result uploadAlarm(@RequestBody UploadAlarmDto dto) { + cementMixPileExtApiService.uploadAlarm(dto); + return Result.ok(); + } + + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/CementMixPilePoint.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/CementMixPilePoint.java index 884b49772..451758961 100644 --- a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/CementMixPilePoint.java +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/CementMixPilePoint.java @@ -80,4 +80,9 @@ public class CementMixPilePoint implements Serializable { */ @ApiModelProperty("1水泥搅拌桩2旋挖") private Integer devType; + /** + * 点位自定义唯一id + */ + @ApiModelProperty(value = "点位自定义唯一id") + private String pointUid; } diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/CementMixPileTask.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/CementMixPileTask.java index d2e1c195b..9ee8aa00b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/CementMixPileTask.java +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/CementMixPileTask.java @@ -69,4 +69,9 @@ public class CementMixPileTask implements Serializable { */ @ApiModelProperty("1水泥搅拌桩2旋挖") private Integer devType; + /** + * 任务自定义唯一id + */ + @ApiModelProperty(value = "任务自定义唯一id") + private String taskUid; } diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadAlarmDto.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadAlarmDto.java new file mode 100644 index 000000000..13b0140bd --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadAlarmDto.java @@ -0,0 +1,62 @@ +package com.zhgd.xmgl.modules.bigdevice.entity.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +@Data +@ApiModel(value = "报警数据") +public class UploadAlarmDto { + /** + * 项目sn + */ + @ApiModelProperty(value = "项目sn") + private String projectSn; + /** + * 报警数据列表 + */ + @ApiModelProperty("报警数据列表") + private List alarmList; + + @Data + public static class Alarm { + /** + * 报警时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "报警时间") + private Date alarmTime; + /** + * 点位自定义唯一id + */ + @ApiModelProperty(value = "点位自定义唯一id") + private String pointUid; + /** + * 设计桩深(m) + */ + @ApiModelProperty(value = "设计桩深(m)") + private java.math.BigDecimal designPileDepth; + /** + * 实时桩深 + */ + @ApiModelProperty(value = "实时桩深") + private java.math.BigDecimal realPileDepth; + /** + * 设备编号 + */ + @ApiModelProperty(value = "设备编号") + private String devSn; + /** + * 1水泥搅拌桩2旋挖 + */ + @ApiModelProperty("1水泥搅拌桩2旋挖") + private Integer devType; + + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadPilDto.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadPilDto.java new file mode 100644 index 000000000..3abbce8c1 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadPilDto.java @@ -0,0 +1,180 @@ +package com.zhgd.xmgl.modules.bigdevice.entity.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +@Data +@ApiModel(value = "成桩数据") +public class UploadPilDto { + /** + * 项目sn + */ + @ApiModelProperty(value = "项目sn") + private String projectSn; + /** + * 沉桩数据列表 + */ + @ApiModelProperty("沉桩数据列表") + private List pilList; + + @Data + public static class Pil { + /** + * 点位自定义唯一id + */ + @ApiModelProperty(value = "点位自定义唯一id") + private String pointUid; + /** + * 任务自定义唯一id + */ + @ApiModelProperty(value = "任务自定义唯一id") + private String taskUid; + /** + * 设备编号 + */ + @ApiModelProperty(value = "设备编号") + private String devSn; + /** + * 上传时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "上传时间") + private Date uploadTime; + /** + * 桩点名称 + */ + @ApiModelProperty(value = "桩点名称") + private String pilePointName; + /** + * 任务名称 + */ + @ApiModelProperty(value = "任务名称") + private String taskName; + /** + * 沉桩开始时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "沉桩开始时间") + private Date pileDrivingStartTime; + /** + * 沉桩结束时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "沉桩结束时间") + private Date pileDrivingEndTime; + /** + * 拔桩开始时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "拔桩开始时间") + private Date pileExtractionStartTime; + /** + * 拔桩结束时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "拔桩结束时间") + private Date pileExtractionEndTime; + /** + * 施工高程 + */ + @ApiModelProperty(value = "施工高程") + private String constructionElevation; + /** + * 施工X坐标 + */ + @ApiModelProperty(value = "施工X坐标") + private java.math.BigDecimal constructionXCoordinate; + /** + * 施工Y坐标 + */ + @ApiModelProperty(value = "施工Y坐标") + private java.math.BigDecimal constructionYCoordinate; + /** + * 施工经度 + */ + @ApiModelProperty(value = "施工经度") + private java.math.BigDecimal constructionLongitude; + /** + * 施工纬度 + */ + @ApiModelProperty(value = "施工纬度") + private java.math.BigDecimal constructionLatitude; + /** + * 持力层(比值) + */ + @ApiModelProperty(value = "持力层(比值)") + private String bearingLayer; + /** + * 拔桩电流(A) + */ + @ApiModelProperty(value = "拔桩电流(A)") + private java.math.BigDecimal pileExtractionCurrent; + /** + * 沉桩深度(m) + */ + @ApiModelProperty(value = "沉桩深度(m)") + private java.math.BigDecimal pileDrivingDepth; + /** + * 持力层电流(A) + */ + @ApiModelProperty(value = "持力层电流(A)") + private java.math.BigDecimal bearingLayerCurrent; + /** + * 垂直度(%) + */ + @ApiModelProperty(value = "垂直度(%)") + private java.math.BigDecimal verticality; + /** + * 沉桩平均电流(A) + */ + @ApiModelProperty(value = "沉桩平均电流(A)") + private java.math.BigDecimal averagePileDrivingCurrent; + /** + * 拔桩平均电流(A) + */ + @ApiModelProperty(value = "拔桩平均电流(A)") + private java.math.BigDecimal averagePileExtractionCurrent; + /** + * 沉桩平均速率(m/min) + */ + @ApiModelProperty(value = "沉桩平均速率(m/min)") + private String averagePileDrivingRate; + /** + * 拔桩平均速率(m/min) + */ + @ApiModelProperty(value = "拔桩平均速率(m/min)") + private String averagePileExtractionRate; + /** + * 实际灌入量(m) + */ + @ApiModelProperty(value = "实际灌入量(m)") + private java.math.BigDecimal actualGroutingVolume; + /** + * 桩点水平偏差距离(m) + */ + @ApiModelProperty(value = "桩点水平偏差距离(m)") + private java.math.BigDecimal horizontalDeviationDistanceOfPilePoint; + /** + * 状态0:未施工 1:已完成 2:进行中 + */ + @ApiModelProperty(value = "状态0:未施工 1:已完成 2:进行中") + private Integer status; + /** + * 1水泥搅拌桩2旋挖 + */ + @ApiModelProperty("1水泥搅拌桩2旋挖") + private Integer devType; + } + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadRealtimeDto.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadRealtimeDto.java new file mode 100644 index 000000000..4205876a9 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadRealtimeDto.java @@ -0,0 +1,83 @@ +package com.zhgd.xmgl.modules.bigdevice.entity.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +@Data +@ApiModel(value = "实时数据") +public class UploadRealtimeDto { + /** + * 项目sn + */ + @ApiModelProperty(value = "项目sn") + private String projectSn; + /** + * 实时数据列表 + */ + @ApiModelProperty("实时数据列表") + private List realtimeList; + + @Data + public static class Realtime { + /** + * 点位自定义唯一id + */ + @ApiModelProperty(value = "点位自定义唯一id") + private String pointUid; + /**设备编号*/ + @ApiModelProperty(value="设备编号") + private String devSn ; + /**桩点名称*/ + @ApiModelProperty(value="桩点名称") + private String pilePointName ; + /**车辆名称*/ + @ApiModelProperty(value="车辆名称") + private String vehicleName ; + /**航向*/ + @ApiModelProperty(value="航向") + private String heading ; + /**定位时间*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value="定位时间") + private Date positioningTime ; + /**经度*/ + @ApiModelProperty(value="经度") + private java.math.BigDecimal longitude ; + /**纬度*/ + @ApiModelProperty(value="纬度") + private java.math.BigDecimal latitude ; + /**速度*/ + @ApiModelProperty(value="速度") + private String speed ; + /**实时深度(m)*/ + @ApiModelProperty(value="实时深度(m)") + private java.math.BigDecimal realtimeDepth ; + /**实时电流*/ + @ApiModelProperty(value="实时电流") + private String realtimeCurrent ; + /**实时灌入量(m°)*/ + @ApiModelProperty(value="实时灌入量(m°)") + private java.math.BigDecimal realtimeInjectionVolume ; + /**实时垂直度*/ + @ApiModelProperty(value="实时垂直度") + private String realtimeVerticality ; + /**实时速率*/ + @ApiModelProperty(value="实时速率") + private String realtimeRate ; + /**桩点水平偏差距离(m)*/ + @ApiModelProperty(value="桩点水平偏差距离(m)") + private java.math.BigDecimal pointHorizontalDeviationDistance ; + /** + *1水泥搅拌桩2旋挖 + */ + @ApiModelProperty("1水泥搅拌桩2旋挖") + private Integer devType; + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadTaskAndPointDto.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadTaskAndPointDto.java new file mode 100644 index 000000000..638c896fe --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/dto/UploadTaskAndPointDto.java @@ -0,0 +1,172 @@ +package com.zhgd.xmgl.modules.bigdevice.entity.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +@ApiModel(value = "任务和点位数据") +public class UploadTaskAndPointDto { + /** + * 项目sn + */ + @ApiModelProperty(value = "项目sn") + private String projectSn; + + /** + * 任务列表 + */ + @ApiModelProperty("任务列表") + private List taskList; + /** + * 点位列表 + */ + @ApiModelProperty("点位列表") + private List pointList; + /** + * 任务和点位绑定关系 + */ + @ApiModelProperty("任务和点位绑定关系") + private List bindList; + + @Data + public static class Bind { + /** + * 任务自定义唯一id + */ + @ApiModelProperty(value = "任务自定义唯一id") + private String taskUid; + /** + * 点位自定义唯一id + */ + @ApiModelProperty(value = "点位自定义唯一id") + private String pointUid; + /** + * 1绑定2解绑 + */ + @ApiModelProperty(value = "1绑定2解绑") + private Integer bindType; + + } + + @Data + public static class Task { + /** + * 设备编号 + */ + @ApiModelProperty(value = "设备编号") + private String devSn; + /** + * 任务自定义唯一id + */ + @ApiModelProperty(value = "任务自定义唯一id") + private String taskUid; + /** + * 任务名称 + */ + @ApiModelProperty(value = "任务名称") + private String taskName; + /** + * 任务进度 + */ + @ApiModelProperty(value = "任务进度") + private String taskProgress; + /** + * 任务状态0:未施工 1:已完成 2:进行中 + */ + @ApiModelProperty(value = "任务状态0:未施工 1:已完成 2:进行中") + private Integer taskStatus; + /** + * 点位半径 + */ + @ApiModelProperty(value = "点位半径") + private String pointRadius; + /** + * 纵向桩距 + */ + @ApiModelProperty(value = "纵向桩距") + private String longitudinalStakeSpace; + /** + * 横向桩距 + */ + @ApiModelProperty(value = "横向桩距") + private String lateralStakeSpace; + /** + * 1水泥搅拌桩2旋挖 + */ + @ApiModelProperty("1水泥搅拌桩2旋挖") + private Integer devType; + /** + * 操作:1保存2删除 + */ + @ApiModelProperty(value = "操作:1保存2删除") + private Integer optType; + } + + @Data + public static class Point { + /** + * 点位自定义唯一id + */ + @ApiModelProperty(value = "点位自定义唯一id") + private String pointUid; + /** + * 任务名称 + */ + @ApiModelProperty(value = "任务名称") + private String taskName; + /** + * 桩点名称 + */ + @ApiModelProperty(value = "桩点名称") + private String pilePointName; + /** + * X坐标 + */ + @ApiModelProperty(value = "X坐标") + private java.math.BigDecimal coordinateX; + /** + * Y坐标 + */ + @ApiModelProperty(value = "Y坐标") + private java.math.BigDecimal coordinateY; + /** + * 高程 + */ + @ApiModelProperty(value = "高程") + private String elevation; + /** + * 设计桩深(m) + */ + @ApiModelProperty(value = "设计桩深(m)") + private java.math.BigDecimal designPileDepth; + /** + * 设计灌入量(m) + */ + @ApiModelProperty(value = "设计灌入量(m)") + private java.math.BigDecimal designGroutingVolume; + /** + * 点位状态0:未施工 1:已完成 2:进行中 + */ + @ApiModelProperty(value = "点位状态0:未施工 1:已完成 2:进行中") + private Integer pointStatus; + /** + * 状态汉字注释 + */ + @ApiModelProperty(value = "状态汉字注释") + private String statusChineseCharacterAnnotation; + /** + * 1水泥搅拌桩2旋挖 + */ + @ApiModelProperty("1水泥搅拌桩2旋挖") + private Integer devType; + /** + * 操作:1保存2删除 + */ + @ApiModelProperty(value = "操作:1保存2删除") + private Integer optType; + } + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/ICementMixPileTaskService.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/ICementMixPileTaskService.java index 64c900e8d..43197d438 100644 --- a/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/ICementMixPileTaskService.java +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/ICementMixPileTaskService.java @@ -59,4 +59,6 @@ public interface ICementMixPileTaskService extends IService { void delPointsByTaskId(CementMixPileTaskSavePoint point); void saveHbyjTaskAndPoint(String projectSn, List tasks, List points); + + void insertIgnoreBatch(List adds); } diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/CementMixPileExtApiService.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/CementMixPileExtApiService.java new file mode 100644 index 000000000..bd7040cb5 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/CementMixPileExtApiService.java @@ -0,0 +1,197 @@ +package com.zhgd.xmgl.modules.bigdevice.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zhgd.jeecg.common.execption.OpenAlertException; +import com.zhgd.xmgl.modules.bigdevice.entity.CementMixPileDev; +import com.zhgd.xmgl.modules.bigdevice.entity.CementMixPilePoint; +import com.zhgd.xmgl.modules.bigdevice.entity.CementMixPileTask; +import com.zhgd.xmgl.modules.bigdevice.entity.CementMixPileTaskPoint; +import com.zhgd.xmgl.modules.bigdevice.entity.dto.*; +import com.zhgd.xmgl.modules.bigdevice.service.*; +import com.zhgd.xmgl.modules.project.entity.Project; +import com.zhgd.xmgl.modules.project.service.IProjectService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +@Service +@Transactional(rollbackFor = Exception.class) +@Slf4j +public class CementMixPileExtApiService { + @Lazy + @Autowired + private ICementMixPileDevService cementMixPileDevService; + @Lazy + @Autowired + private ICementMixPilePointService cementMixPilePointService; + @Lazy + @Autowired + private ICementMixPileTaskService cementMixPileTaskService; + @Lazy + @Autowired + private ICementMixPileTaskPointService cementMixPileTaskPointService; + @Lazy + @Autowired + private ICementMixPilePilService cementMixPilePilService; + @Lazy + @Autowired + private ICementMixPileRealtimeService cementMixPileRealtimeService; + @Lazy + @Autowired + private ICementMixPileAlarmService cementMixPileAlarmService; + @Lazy + @Autowired + IProjectService projectService; + + public void uploadTaskAndPoint(UploadTaskAndPointDto dto) { + checkExist(dto.getProjectSn()); + saveTasks(dto); + savePoints(dto); + saveTaskPoints(dto); + } + + private void saveTaskPoints(UploadTaskAndPointDto dto) { + Map puid2IdMap = cementMixPilePointService.list(new LambdaQueryWrapper() + .eq(CementMixPilePoint::getProjectSn, dto.getProjectSn())).stream().collect(Collectors.toMap(CementMixPilePoint::getPointUid, CementMixPilePoint::getId, (o1, o2) -> o1)); + Map tuid2IdMap = cementMixPileTaskService.list(new LambdaQueryWrapper() + .eq(CementMixPileTask::getProjectSn, dto.getProjectSn())).stream().collect(Collectors.toMap(CementMixPileTask::getTaskUid, CementMixPileTask::getId, (o1, o2) -> o1)); + if (CollUtil.isNotEmpty(dto.getBindList())) { + List taskPoints = dto.getBindList().stream() + .filter(bind -> Objects.equals(bind.getBindType(), 1) && puid2IdMap.containsKey(bind.getPointUid()) && tuid2IdMap.containsKey(bind.getTaskUid())) + .map(bind -> { + CementMixPileTaskPoint taskPoint = new CementMixPileTaskPoint(); + taskPoint.setTaskId(tuid2IdMap.get(bind.getTaskUid())); + taskPoint.setPointId(puid2IdMap.get(bind.getPointUid())); + return taskPoint; + }).collect(Collectors.toList()); + cementMixPileTaskPointService.insertIgnoreBatch(taskPoints); + List dels = dto.getBindList().stream() + .filter(bind -> Objects.equals(bind.getBindType(), 2) && puid2IdMap.containsKey(bind.getPointUid()) && tuid2IdMap.containsKey(bind.getTaskUid())).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(dels)) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + for (UploadTaskAndPointDto.Bind del : dels) { + wrapper.or(w -> w.eq(CementMixPileTaskPoint::getTaskId, tuid2IdMap.get(del.getTaskUid())) + .eq(CementMixPileTaskPoint::getPointId, puid2IdMap.get(del.getPointUid()))); + } + cementMixPileTaskPointService.remove(wrapper); + } + } + } + + private void saveTasks(UploadTaskAndPointDto dto) { + if (CollUtil.isNotEmpty(dto.getTaskList())) { + List adds = dto.getTaskList().stream().filter(t -> Objects.equals(t.getOptType(), 1)).map(t -> { + CementMixPileTask task = BeanUtil.toBean(t, CementMixPileTask.class); + task.setProjectSn(dto.getProjectSn()); + return task; + }).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(adds)) { + cementMixPileTaskService.insertIgnoreBatch(adds); + } + List dels = dto.getTaskList().stream().filter(t -> Objects.equals(t.getOptType(), 2)) + .map(UploadTaskAndPointDto.Task::getTaskUid).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(dels)) { + List tids = cementMixPileTaskService.list(new LambdaQueryWrapper() + .in(CementMixPileTask::getTaskUid, dels)).stream().map(CementMixPileTask::getId).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(tids)) { + cementMixPileTaskPointService.remove(new LambdaQueryWrapper() + .in(CementMixPileTaskPoint::getTaskId, tids)); + cementMixPileTaskService.remove(new LambdaQueryWrapper() + .in(CementMixPileTask::getId, tids)); + } + } + } + } + + private void savePoints(UploadTaskAndPointDto dto) { + String projectSn = dto.getProjectSn(); + if (CollUtil.isNotEmpty(dto.getPointList())) { + List addPoints = dto.getPointList().stream().filter(point -> Objects.equals(point.getOptType(), 1)).map(point -> { + CementMixPilePoint point1 = BeanUtil.toBean(point, CementMixPilePoint.class); + point1.setProjectSn(projectSn); + return point1; + }).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(addPoints)) { + cementMixPilePointService.insertIgnoreBatch(projectSn, addPoints); + } + List dels = dto.getPointList().stream().filter(point -> Objects.equals(point.getOptType(), 2)) + .map(UploadTaskAndPointDto.Point::getPointUid).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(dels)) { + List pids = cementMixPilePointService.list(new LambdaQueryWrapper() + .in(CementMixPilePoint::getPointUid, dels)).stream().map(CementMixPilePoint::getId).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(pids)) { + cementMixPileTaskPointService.remove(new LambdaQueryWrapper() + .in(CementMixPileTaskPoint::getPointId, pids)); + cementMixPilePointService.remove(new LambdaQueryWrapper() + .in(CementMixPilePoint::getId, pids)); + } + } + } + } + + public void uploadPil(UploadPilDto dto) { + checkExist(dto.getProjectSn()); + Map devSn2NameMap = cementMixPileDevService.list(new LambdaQueryWrapper() + .eq(CementMixPileDev::getProjectSn, dto.getProjectSn())).stream().collect(Collectors.toMap(CementMixPileDev::getDevSn, CementMixPileDev::getDevName, (o1, o2) -> o1)); + Map taskUid2NameMap = cementMixPileTaskService.list(new LambdaQueryWrapper() + .eq(CementMixPileTask::getProjectSn, dto.getProjectSn())).stream().collect(Collectors.toMap(CementMixPileTask::getTaskUid, CementMixPileTask::getTaskName, (o1, o2) -> o1)); + Map pointUid2NameMap = cementMixPilePointService.list(new LambdaQueryWrapper() + .eq(CementMixPilePoint::getProjectSn, dto.getProjectSn())).stream().collect(Collectors.toMap(CementMixPilePoint::getPointUid, CementMixPilePoint::getPilePointName, (o1, o2) -> o1)); + if (CollUtil.isNotEmpty(dto.getPilList())) { + for (UploadPilDto.Pil pil : dto.getPilList()) { + String devName = devSn2NameMap.get(pil.getDevSn()); + if (devName == null) { + continue; + } + CementMixPilePilDto pilePil = BeanUtil.toBean(pil, CementMixPilePilDto.class); + pilePil.setProjectSn(dto.getProjectSn()); + pilePil.setDevName(devName); + pilePil.setTaskName(taskUid2NameMap.get(pil.getTaskUid())); + pilePil.setPilePointName(pointUid2NameMap.get(pil.getPointUid())); + cementMixPilePilService.add(pilePil); + } + } + } + + public void uploadRealtime(UploadRealtimeDto dto) { + checkExist(dto.getProjectSn()); + if (CollUtil.isNotEmpty(dto.getRealtimeList())) { + for (UploadRealtimeDto.Realtime realtime : dto.getRealtimeList()) { + CementMixPileRealtimeDto realtimeDto = BeanUtil.toBean(realtime, CementMixPileRealtimeDto.class); + realtimeDto.setProjectSn(dto.getProjectSn()); + cementMixPileRealtimeService.add(realtimeDto); + } + } + } + + public void uploadAlarm(UploadAlarmDto dto) { + checkExist(dto.getProjectSn()); + Map pointUid2NameMap = cementMixPilePointService.list(new LambdaQueryWrapper() + .eq(CementMixPilePoint::getProjectSn, dto.getProjectSn())).stream().collect(Collectors.toMap(CementMixPilePoint::getPointUid, CementMixPilePoint::getPilePointName, (o1, o2) -> o1)); + if (CollUtil.isNotEmpty(dto.getAlarmList())) { + for (UploadAlarmDto.Alarm alarm : dto.getAlarmList()) { + CementMixPileAlarmDto alarmDto = BeanUtil.toBean(alarm, CementMixPileAlarmDto.class); + alarmDto.setProjectSn(dto.getProjectSn()); + alarmDto.setPilePointName(pointUid2NameMap.get(alarm.getPointUid())); + cementMixPileAlarmService.add(alarmDto); + } + } + } + + private void checkExist(String projectSn) { + Project project = projectService.getOne(new LambdaQueryWrapper() + .eq(Project::getProjectSn, projectSn)); + if (project == null) { + throw new OpenAlertException("项目sn不存在"); + } + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/CementMixPileTaskServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/CementMixPileTaskServiceImpl.java index ddb34c01b..91b52a05a 100644 --- a/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/CementMixPileTaskServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/CementMixPileTaskServiceImpl.java @@ -174,6 +174,11 @@ public class CementMixPileTaskServiceImpl extends ServiceImpl adds) { + baseMapper.insertIgnoreBatch(adds); + } + private void setTaskId(List tasks) { List taskList = this.list(new LambdaQueryWrapper() .in(CementMixPileTask::getHbyjTaskId, tasks.stream().map(CementMixPileTask::getHbyjTaskId).collect(Collectors.toList()))); diff --git a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java index 3b7fb4928..570f4b1f5 100644 --- a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java +++ b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java @@ -78,6 +78,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { http.authorizeRequests() //请求路径允许访问 + .antMatchers("/xmgl/cementMixPileExtApi/**").permitAll() .antMatchers("/notice/push").permitAll() .antMatchers("/xmgl/electricalData/addByJj").permitAll() .antMatchers("/xmgl/cache/clearAll").permitAll() diff --git a/src/main/resources/static/document/智慧工地对外接口.md b/src/main/resources/static/document/智慧工地对外接口.md index c53132a23..c919dfdf8 100644 --- a/src/main/resources/static/document/智慧工地对外接口.md +++ b/src/main/resources/static/document/智慧工地对外接口.md @@ -7581,6 +7581,378 @@ https://www.yuque.com/u27244850/zuklv1/qil21b?#M2jFz } ``` +### 水泥搅拌桩/旋挖钻桩对接 + +#### 1、上传水泥搅拌桩/旋挖沉桩任务和点位数据 + +| 接口描述: | 上传水泥搅拌桩/旋挖沉桩任务和点位数据 | +| ------------------ | -------------------------------------------- | +| **请求URL:** | /xmgl/cementMixPileExtApi/uploadTaskAndPoint | +| **请求方式:** | POST | +| **Content-Type:** | application/json | + +**请求参数:** + +**任务和点位数据** + +| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | +| --------- | ------------------ | -------- | -------- | -------- | ------ | +| projectSn | 项目sn | body | true | string | | +| taskList | 任务列表 | body | false | array | Task | +| pointList | 点位列表 | body | false | array | Point | +| bindList | 任务和点位绑定关系 | body | false | array | Bind | + +**Task** + +| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | +| ---------------------- | -------------------------------------- | -------- | -------- | -------------- | ------ | +| devSn | 设备编号 | body | true | string | | +| devType | 1水泥搅拌桩2旋挖 | body | true | integer(int32) | | +| optType | 操作:1保存2删除 | body | true | integer(int32) | | +| taskUid | 任务自定义唯一id | body | true | string | | +| taskName | 任务名称 | body | true | string | | +| lateralStakeSpace | 横向桩距 | body | false | string | | +| longitudinalStakeSpace | 纵向桩距 | body | false | string | | +| pointRadius | 点位半径 | body | false | string | | +| taskProgress | 任务进度 | body | false | string | | +| taskStatus | 任务状态0:未施工 1:已完成 2:进行中 | body | false | integer(int32) | | + +**Point** + +| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | +| -------------------------------- | -------------------------------------- | -------- | -------- | -------------- | ------ | +| pointUid | 点位自定义唯一id | body | true | string | | +| pilePointName | 桩点名称 | body | true | string | | +| devType | 1水泥搅拌桩2旋挖 | body | true | integer(int32) | | +| optType | 操作:1保存2删除 | body | true | integer(int32) | | +| coordinateX | X坐标 | body | false | number | | +| coordinateY | Y坐标 | body | false | number | | +| designGroutingVolume | 设计灌入量(m) | body | false | number | | +| designPileDepth | 设计桩深(m) | body | false | number | | +| elevation | 高程 | body | false | string | | +| pointStatus | 点位状态0:未施工 1:已完成 2:进行中 | body | false | integer(int32) | | +| statusChineseCharacterAnnotation | 状态汉字注释 | body | false | string | | +| taskName | 任务名称 | body | false | string | | + +**Bind** + +| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | +| -------- | ---------------- | -------- | -------- | -------------- | ------ | +| bindType | 1绑定2解绑 | body | true | integer(int32) | | +| pointUid | 点位自定义唯一id | body | true | string | | +| taskUid | 任务自定义唯一id | body | true | string | | + + + +**请求示例:** + +``` +{ + "bindList": [ + { + "bindType": 1, + "pointUid": "100", + "taskUid": "200" + } + ], + "devSn": "123456", + "pointList": [ + { + "coordinateX": 0, + "coordinateY": 0, + "designGroutingVolume": 0, + "designPileDepth": 0, + "devType": 1, + "elevation": "1", + "optType": 1, + "pilePointName": "点位1", + "pointStatus": 0, + "pointUid": "100", + "statusChineseCharacterAnnotation": "未施工", + "taskName": "任务1" + } + ], + "projectSn": "BD3137498CB84BF0969979E0342CDBCA", + "taskList": [ + { + "devType": 1, + "lateralStakeSpace": "", + "longitudinalStakeSpace": "", + "optType": 1, + "pointRadius": "", + "taskName": "任务1", + "taskProgress": "", + "taskStatus": 0, + "taskUid": "200" + } + ] +} +``` + +**响应示例:** + +失败: + +``` +{ + "success": false, + "message": "项目sn不存在", + "code": 5000, + "result": null, + "timestamp": "1677809107994" +} +``` + +成功: + +``` +{ + "success": true, + "message": "操作成功!", + "code": 200, + "result": null, + "timestamp": "1677809789150" +} +``` + +#### 2、上传水泥搅拌桩/旋挖沉桩数据 + +| 接口描述: | 上传水泥搅拌桩/旋挖沉桩数据 | +| ------------------ | ----------------------------------- | +| **请求URL:** | /xmgl/cementMixPileExtApi/uploadPil | +| **请求方式:** | POST | +| **Content-Type:** | application/json | + +**请求参数:** + +**成桩数据** + +| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | +| --------- | ------------ | -------- | -------- | -------- | ------ | +| projectSn | 项目sn | body | true | string | | +| pilList | 沉桩数据列表 | body | true | array | Pil | + +**Pil** + +| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | +| -------------------------------------- | --------------------------------------- | -------- | -------- | ----------------- | ------ | +| devSn | 设备编号 | body | true | string | | +| pointUid | 点位自定义唯一id | body | true | string | | +| taskUid | 任务自定义唯一id | body | true | string | | +| devType | 1水泥搅拌桩2旋挖 | body | true | integer(int32) | | +| uploadTime | 上传时间(格式:2025-12-25 14:08:27) | body | true | string(date-time) | | +| actualGroutingVolume | 实际灌入量(m) | body | false | number | | +| averagePileDrivingCurrent | 沉桩平均电流(A) | body | false | number | | +| averagePileDrivingRate | 沉桩平均速率(m/min) | body | false | string | | +| averagePileExtractionCurrent | 拔桩平均电流(A) | body | false | number | | +| averagePileExtractionRate | 拔桩平均速率(m/min) | body | false | string | | +| bearingLayer | 持力层(比值) | body | false | string | | +| bearingLayerCurrent | 持力层电流(A) | body | false | number | | +| constructionElevation | 施工高程 | body | false | string | | +| constructionLatitude | 施工纬度 | body | false | number | | +| constructionLongitude | 施工经度 | body | false | number | | +| constructionXCoordinate | 施工X坐标 | body | false | number | | +| constructionYCoordinate | 施工Y坐标 | body | false | number | | +| horizontalDeviationDistanceOfPilePoint | 桩点水平偏差距离(m) | body | false | number | | +| pileDrivingDepth | 沉桩深度(m) | body | false | number | | +| pileDrivingEndTime | 沉桩结束时间(格式:2025-12-25 14:08:27) | body | false | string(date-time) | | +| pileDrivingStartTime | 沉桩开始时间(格式:2025-12-25 14:08:27) | body | false | string(date-time) | | +| pileExtractionCurrent | 拔桩电流(A) | body | false | number | | +| pileExtractionEndTime | 拔桩结束时间(格式:2025-12-25 14:08:27) | body | false | string(date-time) | | +| pileExtractionStartTime | 拔桩开始时间(格式:2025-12-25 14:08:27) | body | false | string(date-time) | | +| status | 状态0:未施工 1:已完成 2:进行中 | body | false | integer(int32) | | +| verticality | 垂直度(%) | body | false | number | | + +**请求示例:** + +``` +{ + "pilList": [ + { + "actualGroutingVolume": 0, + "averagePileDrivingCurrent": 0, + "averagePileDrivingRate": "", + "averagePileExtractionCurrent": 0, + "averagePileExtractionRate": "", + "bearingLayer": "", + "bearingLayerCurrent": 0, + "constructionElevation": "", + "constructionLatitude": 0, + "constructionLongitude": 0, + "constructionXCoordinate": 0, + "constructionYCoordinate": 0, + "devSn": "123456", + "devType": 1, + "horizontalDeviationDistanceOfPilePoint": 0, + "pileDrivingDepth": 0, + "pileDrivingEndTime": "", + "pileDrivingStartTime": "", + "pileExtractionCurrent": 0, + "pileExtractionEndTime": "", + "pileExtractionStartTime": "", + "pointUid": "100", + "status": 0, + "taskUid": "200", + "uploadTime": "2025-12-25 14:08:27", + "verticality": 0 + } + ], + "projectSn": "BD3137498CB84BF0969979E0342CDBCA" +} +``` + +**响应示例:** + +成功: + +``` +{ + "success": true, + "message": "操作成功!", + "code": 200, + "result": null, + "timestamp": "1677809789150" +} +``` + +#### 3、上传水泥搅拌桩/旋挖实时数据 + +| 接口描述: | 上传水泥搅拌桩/旋挖实时数据 | +| ------------------ | ---------------------------------------- | +| **请求URL:** | /xmgl/cementMixPileExtApi/uploadRealtime | +| **请求方式:** | POST | +| **Content-Type:** | application/json | + +**请求参数:** + +**实时数据** + +| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | +| ------------ | ------------ | -------- | -------- | -------- | -------- | +| projectSn | 项目sn | body | true | string | | +| realtimeList | 实时数据列表 | body | true | array | Realtime | + +**Realtime** + +| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | +| -------------------------------- | ----------------------------------- | -------- | -------- | ----------------- | ------ | +| devSn | 设备编号 | body | true | string | | +| devType | 1水泥搅拌桩2旋挖 | body | true | integer(int32) | | +| pointUid | 点位自定义唯一id | body | true | string | | +| positioningTime | 定位时间(格式:2025-12-25 14:08:27) | body | true | string(date-time) | | +| heading | 航向 | body | false | string | | +| latitude | 纬度 | body | false | number | | +| longitude | 经度 | body | false | number | | +| pilePointName | 桩点名称 | body | false | string | | +| pointHorizontalDeviationDistance | 桩点水平偏差距离(m) | body | false | number | | +| realtimeCurrent | 实时电流 | body | false | string | | +| realtimeDepth | 实时深度(m) | body | false | number | | +| realtimeInjectionVolume | 实时灌入量(m°) | body | false | number | | +| realtimeRate | 实时速率 | body | false | string | | +| realtimeVerticality | 实时垂直度 | body | false | string | | +| speed | 速度 | body | false | string | | + +**请求示例:** + +``` +{ + "projectSn": "BD3137498CB84BF0969979E0342CDBCA", + "realtimeList": [ + { + "devSn": "123456", + "devType": 1, + "heading": "", + "latitude": 0, + "longitude": 0, + "pilePointName": "", + "pointHorizontalDeviationDistance": 0, + "pointUid": "100", + "positioningTime": "2025-12-25 14:08:27", + "realtimeCurrent": "", + "realtimeDepth": 0, + "realtimeInjectionVolume": 0, + "realtimeRate": "", + "realtimeVerticality": "", + "speed": "" + } + ] +} +``` + +**响应示例:** + +成功: + +``` +{ + "success": true, + "message": "操作成功!", + "code": 200, + "result": null, + "timestamp": "1677809789150" +} +``` + +#### 4、上传水泥搅拌桩/旋挖报警数据 + +| 接口描述: | 上传水泥搅拌桩/旋挖报警数据 | +| ------------------ | ------------------------------------- | +| **请求URL:** | /xmgl/cementMixPileExtApi/uploadAlarm | +| **请求方式:** | POST | +| **Content-Type:** | application/json | + +**请求参数:** + +**报警数据** + +| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | +| --------- | ------------ | -------- | -------- | -------- | ------ | +| projectSn | 项目sn | body | true | string | | +| alarmList | 报警数据列表 | body | true | array | Alarm | + +**Alarm** + +| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | +| --------------- | ----------------------------------- | -------- | -------- | ----------------- | ------ | +| pointUid | 点位自定义唯一id | body | true | integer(int64) | | +| alarmTime | 报警时间(格式:2025-12-25 14:08:27) | body | true | string(date-time) | | +| designPileDepth | 设计桩深(m) | body | true | number | | +| devSn | 设备编号 | body | true | string | | +| devType | 1水泥搅拌桩2旋挖 | body | true | integer(int32) | | +| realPileDepth | 实时桩深 | body | true | number | | + +**请求示例:** + +``` +{ + "projectSn": "BD3137498CB84BF0969979E0342CDBCA", + "realtimeList": [ + { + "pointUid": "100", + "devSn": "123456", + "alarmTime": "2025-12-25 14:08:27", + "designPileDepth": 10, + "realPileDepth": 11, + "devType": 1 + } + ] +} +``` + +**响应示例:** + +成功: + +``` +{ + "success": true, + "message": "操作成功!", + "code": 200, + "result": null, + "timestamp": "1677809789150" +} +``` + ## 平台--->第三方系统接口 ### 塔吊(HTTP主动推送)