42 changed files with 1969 additions and 13 deletions
@ -0,0 +1,36 @@ |
|||||
|
package org.dromara.common.core.constant; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/22 |
||||
|
*/ |
||||
|
public interface AiCompareStatusConstants { |
||||
|
/** |
||||
|
* "是否比对" |
||||
|
* */ |
||||
|
String COMPARE_STATUS_0="0"; |
||||
|
|
||||
|
/** |
||||
|
* "算法比对中" |
||||
|
* */ |
||||
|
String COMPARE_STATUS_1="1"; |
||||
|
/** |
||||
|
* "人工查看" |
||||
|
* */ |
||||
|
String COMPARE_STATUS_2="2"; |
||||
|
/** |
||||
|
* "可提交预警" |
||||
|
* */ |
||||
|
String COMPARE_STATUS_3="3"; |
||||
|
/** |
||||
|
* "完成对比" |
||||
|
* */ |
||||
|
String COMPARE_STATUS_4="4"; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 队列类型 0:未比对 1:比对*/ |
||||
|
String QUEUW_TYPE_0="0"; |
||||
|
|
||||
|
String QUEUW_TYPE_1="1"; |
||||
|
} |
@ -0,0 +1,113 @@ |
|||||
|
package org.dromara.sample.manage.controller; |
||||
|
|
||||
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
|
import jakarta.validation.constraints.NotEmpty; |
||||
|
import jakarta.validation.constraints.NotNull; |
||||
|
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.idempotent.annotation.RepeatSubmit; |
||||
|
import org.dromara.common.log.annotation.Log; |
||||
|
import org.dromara.common.log.enums.BusinessType; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.web.core.BaseController; |
||||
|
import org.dromara.sample.manage.model.dto.DeviceQrtzDTO; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzEntity; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzFileEntity; |
||||
|
import org.dromara.sample.manage.service.IDeviceQrtzService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("/devict/qrtz") |
||||
|
@Validated |
||||
|
@Tag(name = "自动飞行设备模块") |
||||
|
public class DeviceQrtzController extends BaseController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IDeviceQrtzService deviceQrtzService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
*自动飞行设备列表 |
||||
|
* */ |
||||
|
@SaCheckPermission("devict:qrtz:list") |
||||
|
@GetMapping(value = "/page") |
||||
|
public TableDataInfo<DeviceQrtzEntity> queryPageDept(@RequestParam(name="pageNum", defaultValue="1") Integer pageNum, |
||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, DeviceQrtzDTO deviceQrtzDTO) { |
||||
|
Page<DeviceQrtzEntity> page = new Page(pageNum,pageSize); |
||||
|
return deviceQrtzService.listManageDeviceQrtz(page, deviceQrtzDTO); |
||||
|
} |
||||
|
/** |
||||
|
*自动飞行日历列表 |
||||
|
* |
||||
|
* */ |
||||
|
@SaCheckPermission("devict:qrtz:list") |
||||
|
@GetMapping(value = "/listFileExecDate") |
||||
|
public R<Map<Date, List<DeviceQrtzFileEntity>>> listFileExecDate(Long qrtzId) { |
||||
|
List<DeviceQrtzFileEntity> waylineDeviceQrtzFiles = deviceQrtzService.manageDeviceQrtzFileByQrtzId(qrtzId); |
||||
|
Map<Date, List<DeviceQrtzFileEntity>> listMap = waylineDeviceQrtzFiles.stream().filter(f-> ObjectUtil.isNotEmpty(f.getExecDate())).collect(Collectors.groupingBy(DeviceQrtzFileEntity::getExecDate)); |
||||
|
return R.ok(listMap); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 设备定时飞行详情 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
*/ |
||||
|
@SaCheckPermission("devict:qrtz:query") |
||||
|
@GetMapping("/{id}") |
||||
|
public R<DeviceQrtzEntity> getInfo(@NotNull(message = "主键不能为空") |
||||
|
@PathVariable Long id) { |
||||
|
DeviceQrtzEntity deviceQrtzEntity = deviceQrtzService.queryById(id); |
||||
|
return R.ok(deviceQrtzEntity); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 自动飞行编辑 |
||||
|
*/ |
||||
|
@SaCheckPermission("devict:qrtz:edit") |
||||
|
@Log(title = "自动飞行编辑", businessType = BusinessType.UPDATE) |
||||
|
@RepeatSubmit() |
||||
|
@PutMapping() |
||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DeviceQrtzEntity entity) { |
||||
|
return toAjax(deviceQrtzService.updateByBo(entity)); |
||||
|
} |
||||
|
/** |
||||
|
* 自动飞行新增 |
||||
|
*/ |
||||
|
@SaCheckPermission("devict:qrtz:add") |
||||
|
@Log(title = "自动飞行新增", businessType = BusinessType.INSERT) |
||||
|
@RepeatSubmit() |
||||
|
@PostMapping() |
||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody DeviceQrtzDTO deviceQrtzDTO) { |
||||
|
return toAjax(deviceQrtzService.add(deviceQrtzDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 自动飞行删除 |
||||
|
* |
||||
|
* @param ids 主键串 |
||||
|
*/ |
||||
|
@SaCheckPermission("system:client:remove") |
||||
|
@Log(title = "自动飞行删除", businessType = BusinessType.DELETE) |
||||
|
@DeleteMapping("/{ids}") |
||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
||||
|
@PathVariable Long[] ids) { |
||||
|
return toAjax(deviceQrtzService.deleteIds(List.of(ids))); |
||||
|
} |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package org.dromara.sample.manage.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzDateEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
public interface IDeviceQrtzDateMapper extends BaseMapper<DeviceQrtzDateEntity> { |
||||
|
List<DeviceQrtzDateEntity> listDeviceQrtzDateByQrtzIdAndDate(@Param("condition") DeviceQrtzDateEntity deviceQrtzDateEntity); |
||||
|
|
||||
|
List<DeviceQrtzDateEntity> listDeviceQrtzDateByQrtzAndDate(@Param("qrtzId") Long qrtzId); |
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package org.dromara.sample.manage.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.dromara.sample.manage.model.entity.DevicePayloadEntity; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzFileEntity; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
public interface IDeviceQrtzFileMapper extends BaseMapper<DeviceQrtzFileEntity> { |
||||
|
} |
@ -0,0 +1,39 @@ |
|||||
|
package org.dromara.sample.manage.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.sample.manage.model.dto.DeviceQrtzDTO; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzEntity; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzFileEntity; |
||||
|
|
||||
|
import java.text.ParseException; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
public interface IDeviceQrtzMapper extends BaseMapper<DeviceQrtzEntity> { |
||||
|
|
||||
|
|
||||
|
IPage<DeviceQrtzEntity> listManageDeviceQrtz(Page page, @Param("condition") DeviceQrtzDTO deviceQrtzDTO); |
||||
|
|
||||
|
List<DeviceQrtzEntity> listManageDeviceQrtz( @Param("condition") DeviceQrtzDTO deviceQrtzDTO); |
||||
|
List<DeviceQrtzFileEntity> manageDeviceQrtzFileByQrtzId(@Param("qrtzId") Long qrtzId); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,99 @@ |
|||||
|
package org.dromara.sample.manage.model.dto; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import jakarta.validation.constraints.NotNull; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzDateEntity; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzFileEntity; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Builder |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
public class DeviceQrtzDTO { |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
|
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* sn |
||||
|
*/ |
||||
|
|
||||
|
private String deviceSn; |
||||
|
|
||||
|
/** |
||||
|
* 飞行计划名称 |
||||
|
*/ |
||||
|
|
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
状态(1-使用,2-暂停,0-异常暂停) |
||||
|
*/ |
||||
|
private Integer status; |
||||
|
|
||||
|
/** |
||||
|
计划时间 |
||||
|
*/ |
||||
|
private List<DeviceQrtzDateEntity> deviceQrtzDates = new ArrayList<>(); |
||||
|
|
||||
|
/** |
||||
|
计划航线 |
||||
|
*/ |
||||
|
private List<DeviceQrtzFileEntity> deviceQrtzFiles = new ArrayList<>(); |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
|
||||
|
private String createBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
|
||||
|
private Date createTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updateTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除 0 正常 1已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
private String startDate; |
||||
|
|
||||
|
private String endDate; |
||||
|
|
||||
|
private String deptName; |
||||
|
|
||||
|
private List<Long>deptIds; |
||||
|
} |
@ -0,0 +1,76 @@ |
|||||
|
package org.dromara.sample.manage.model.dto; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Builder |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
public class DeviceQrtzDateDTO { |
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
|
||||
|
private String id; |
||||
|
|
||||
|
/**任务id*/ |
||||
|
private String qrtzId; |
||||
|
|
||||
|
/** |
||||
|
* 开始时间 |
||||
|
*/ |
||||
|
private String startDate; |
||||
|
|
||||
|
/** |
||||
|
* 结束时间 |
||||
|
*/ |
||||
|
private String endDate; |
||||
|
|
||||
|
|
||||
|
@TableField(exist = false) |
||||
|
private String currentDate; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
|
||||
|
|
||||
|
private String createBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
|
||||
|
private String updateBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
|
||||
|
private Date updateTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除 0 正常 1已删除 |
||||
|
*/ |
||||
|
|
||||
|
private Integer delFlag; |
||||
|
|
||||
|
} |
@ -0,0 +1,90 @@ |
|||||
|
package org.dromara.sample.manage.model.dto; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Builder |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
public class DeviceQrtzFileDTO { |
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
|
||||
|
private String id; |
||||
|
private String qrtzId; |
||||
|
|
||||
|
|
||||
|
private String fileId; |
||||
|
|
||||
|
|
||||
|
private String waylineName; |
||||
|
|
||||
|
|
||||
|
private String sort; |
||||
|
|
||||
|
|
||||
|
private Integer status; |
||||
|
|
||||
|
@TableField(exist = false) |
||||
|
private Integer fileNumber; |
||||
|
|
||||
|
@TableField(exist = false) |
||||
|
private String fileStr; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 飞行时间 |
||||
|
*/ |
||||
|
|
||||
|
private Date flightDate; |
||||
|
|
||||
|
/** |
||||
|
* 执行时间 |
||||
|
*/ |
||||
|
|
||||
|
private Date execDate; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
|
||||
|
|
||||
|
private String createBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
|
||||
|
private String updateBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
|
||||
|
private Date updateTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除 0 正常 1已删除 |
||||
|
*/ |
||||
|
|
||||
|
private Integer delFlag; |
||||
|
|
||||
|
} |
@ -0,0 +1,86 @@ |
|||||
|
package org.dromara.sample.manage.model.entity; |
||||
|
|
||||
|
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 com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import jakarta.validation.constraints.NotNull; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
@TableName("manage_device_qrtz_date") |
||||
|
@Data |
||||
|
@Builder |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class DeviceQrtzDateEntity implements Serializable { |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/**任务id*/ |
||||
|
private Long qrtzId; |
||||
|
|
||||
|
/** |
||||
|
* 开始时间 |
||||
|
*/ |
||||
|
@NotNull(message = "开始时间", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String startDate; |
||||
|
|
||||
|
/** |
||||
|
* 结束时间 |
||||
|
*/ |
||||
|
@NotNull(message = "结束时间", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String endDate; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
|
||||
|
|
||||
|
private String createBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
|
||||
|
private String updateBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
|
||||
|
private Date updateTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除 0 正常 1已删除 |
||||
|
*/ |
||||
|
|
||||
|
private Integer delFlag; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,70 @@ |
|||||
|
package org.dromara.sample.manage.model.entity; |
||||
|
|
||||
|
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.*; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
|
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @Description: |
||||
|
* @Author: wy |
||||
|
* @Date: 2023-03-07 |
||||
|
* @Version: V1.0 |
||||
|
*/ |
||||
|
|
||||
|
@TableName("manage_device_qrtz") |
||||
|
@Data |
||||
|
@Builder |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class DeviceQrtzEntity extends BaseEntity { |
||||
|
|
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
|
||||
|
|
||||
|
private String name; |
||||
|
|
||||
|
private Integer status; |
||||
|
|
||||
|
private String deviceSn; |
||||
|
/** |
||||
|
计划时间 |
||||
|
*/ |
||||
|
@TableField(exist = false) |
||||
|
private List<DeviceQrtzDateEntity> deviceQrtzDates = new ArrayList<>(); |
||||
|
|
||||
|
/** |
||||
|
计划航线 |
||||
|
*/ |
||||
|
@TableField(exist = false) |
||||
|
private List<DeviceQrtzFileEntity> deviceQrtzFiles = new ArrayList<>(); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 部门名称 */ |
||||
|
|
||||
|
private String deptName; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 用户名称 */ |
||||
|
|
||||
|
private String nickName; |
||||
|
/** |
||||
|
* 删除 0 正常 1已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,92 @@ |
|||||
|
package org.dromara.sample.manage.model.entity; |
||||
|
|
||||
|
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 com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
@TableName("manage_device_qrtz_file") |
||||
|
@Data |
||||
|
@Builder |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class DeviceQrtzFileEntity implements Serializable { |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
private Long qrtzId; |
||||
|
|
||||
|
|
||||
|
private String fileId; |
||||
|
|
||||
|
|
||||
|
private String waylineName; |
||||
|
|
||||
|
|
||||
|
private String sort; |
||||
|
|
||||
|
|
||||
|
private Integer status; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 飞行时间 |
||||
|
*/ |
||||
|
|
||||
|
private Date flightDate; |
||||
|
|
||||
|
/** |
||||
|
* 执行时间 |
||||
|
*/ |
||||
|
|
||||
|
private Date execDate; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
|
||||
|
|
||||
|
private String createBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
|
||||
|
private String updateBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
|
||||
|
private Date updateTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除 0 正常 1已删除 |
||||
|
*/ |
||||
|
|
||||
|
private Integer delFlag; |
||||
|
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package org.dromara.sample.manage.service; |
||||
|
|
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzDateEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
public interface IDeviceQrtzDateService { |
||||
|
|
||||
|
List<DeviceQrtzDateEntity> listManageDeviceQrtzDate(Long qrtzId); |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
package org.dromara.sample.manage.service; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
public interface IDeviceQrtzFileService { |
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
package org.dromara.sample.manage.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.sample.manage.model.dto.DeviceDTO; |
||||
|
import org.dromara.sample.manage.model.dto.DeviceQrtzDTO; |
||||
|
import org.dromara.sample.manage.model.dto.DeviceQrtzFileDTO; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzEntity; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzFileEntity; |
||||
|
|
||||
|
import java.text.ParseException; |
||||
|
import java.util.Collection; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
public interface IDeviceQrtzService { |
||||
|
|
||||
|
TableDataInfo<DeviceQrtzEntity> listManageDeviceQrtz(Page page, DeviceQrtzDTO deviceQrtzDTO); |
||||
|
|
||||
|
|
||||
|
DeviceQrtzEntity queryById(Long id); |
||||
|
|
||||
|
List<DeviceQrtzEntity> listManageDeviceQrtz(DeviceQrtzDTO deviceQrtzDTO); |
||||
|
Map<String, Object> calendarList(String time) throws ParseException; |
||||
|
|
||||
|
boolean addAndUpdateManageDeviceQrtz(DeviceQrtzDTO deviceQrtzDTO); |
||||
|
|
||||
|
boolean addManageDeviceQrtzFile(DeviceQrtzFileDTO deviceQrtzFileDTO); |
||||
|
|
||||
|
boolean updateManageDeviceQrtzFile(DeviceQrtzFileDTO deviceQrtzFileDTO); |
||||
|
|
||||
|
boolean deleteManageDeviceQrtz(DeviceQrtzDTO deviceQrtzDTO); |
||||
|
|
||||
|
List<DeviceQrtzFileEntity> manageDeviceQrtzFileByQrtzId(Long qrtzId); |
||||
|
boolean copy(String deviceSn,String starDate,String endDate); |
||||
|
boolean deleteManageDeviceQrtzFile(Long id); |
||||
|
|
||||
|
void jobWayline(DeviceDTO deviceDTO); |
||||
|
|
||||
|
Boolean updateByBo(DeviceQrtzEntity entity); |
||||
|
Boolean add( DeviceQrtzDTO deviceQrtzDTO); |
||||
|
Boolean deleteIds(Collection<Long> ids); |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package org.dromara.sample.manage.service.impl; |
||||
|
|
||||
|
import org.dromara.sample.manage.mapper.IDeviceQrtzDateMapper; |
||||
|
import org.dromara.sample.manage.mapper.IDeviceQrtzMapper; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzDateEntity; |
||||
|
import org.dromara.sample.manage.service.IDeviceQrtzDateService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class DeviceQrtzDateServiceImpl implements IDeviceQrtzDateService { |
||||
|
@Autowired |
||||
|
private IDeviceQrtzDateMapper deviceQrtzDateMapper; |
||||
|
@Override |
||||
|
public List<DeviceQrtzDateEntity> listManageDeviceQrtzDate(Long qrtzId) { |
||||
|
return deviceQrtzDateMapper.listDeviceQrtzDateByQrtzAndDate(qrtzId); |
||||
|
} |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package org.dromara.sample.manage.service.impl; |
||||
|
|
||||
|
import org.dromara.sample.manage.service.IDeviceQrtzFileService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class DeviceQrtzFileServiceImpl implements IDeviceQrtzFileService { |
||||
|
|
||||
|
} |
@ -0,0 +1,155 @@ |
|||||
|
package org.dromara.sample.manage.service.impl; |
||||
|
|
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
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.common.core.utils.MapstructUtils; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.satoken.utils.LoginHelper; |
||||
|
import org.dromara.sample.manage.mapper.IDeviceMapper; |
||||
|
import org.dromara.sample.manage.mapper.IDeviceQrtzDateMapper; |
||||
|
import org.dromara.sample.manage.mapper.IDeviceQrtzFileMapper; |
||||
|
import org.dromara.sample.manage.mapper.IDeviceQrtzMapper; |
||||
|
import org.dromara.sample.manage.model.dto.DeviceDTO; |
||||
|
import org.dromara.sample.manage.model.dto.DeviceQrtzDTO; |
||||
|
import org.dromara.sample.manage.model.dto.DeviceQrtzFileDTO; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzDateEntity; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzEntity; |
||||
|
import org.dromara.sample.manage.model.entity.DeviceQrtzFileEntity; |
||||
|
import org.dromara.sample.manage.service.IDeviceQrtzDateService; |
||||
|
import org.dromara.sample.manage.service.IDeviceQrtzFileService; |
||||
|
import org.dromara.sample.manage.service.IDeviceQrtzService; |
||||
|
import org.dromara.sample.manage.service.IDeviceService; |
||||
|
import org.dromara.system.api.model.LoginUser; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import java.text.ParseException; |
||||
|
import java.util.Collection; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/20 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class DeviceQrtzServiceImpl implements IDeviceQrtzService { |
||||
|
@Autowired |
||||
|
private IDeviceQrtzMapper deviceQrtzMapper; |
||||
|
@Autowired |
||||
|
private IDeviceQrtzDateMapper deviceQrtzDateMapper; |
||||
|
@Autowired |
||||
|
private IDeviceQrtzFileMapper deviceQrtzFileMapper; |
||||
|
@Autowired |
||||
|
private IDeviceQrtzDateService deviceQrtzDateService; |
||||
|
|
||||
|
@Override |
||||
|
public TableDataInfo<DeviceQrtzEntity> listManageDeviceQrtz(Page page, DeviceQrtzDTO deviceQrtzDTO) { |
||||
|
return TableDataInfo.build(deviceQrtzMapper.listManageDeviceQrtz(page, deviceQrtzDTO)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public DeviceQrtzEntity queryById(Long id) { |
||||
|
DeviceQrtzEntity deviceQrtzEntity = deviceQrtzMapper.selectById(id); |
||||
|
List<DeviceQrtzDateEntity> qrtzDateEntityList = deviceQrtzDateService.listManageDeviceQrtzDate(id); |
||||
|
deviceQrtzEntity.setDeviceQrtzDates(qrtzDateEntityList); |
||||
|
return deviceQrtzEntity; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<DeviceQrtzEntity> listManageDeviceQrtz(DeviceQrtzDTO deviceQrtzDTO) { |
||||
|
return deviceQrtzMapper.listManageDeviceQrtz(deviceQrtzDTO); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Map<String, Object> calendarList(String time) throws ParseException { |
||||
|
LoginUser loginUser = LoginHelper.getLoginUser(); |
||||
|
|
||||
|
return Map.of(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public boolean addAndUpdateManageDeviceQrtz(DeviceQrtzDTO deviceQrtzDTO) { |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public boolean addManageDeviceQrtzFile(DeviceQrtzFileDTO deviceQrtzFileDTO) { |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public boolean updateManageDeviceQrtzFile(DeviceQrtzFileDTO deviceQrtzFileDTO) { |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public boolean deleteManageDeviceQrtz(DeviceQrtzDTO deviceQrtzDTO) { |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<DeviceQrtzFileEntity> manageDeviceQrtzFileByQrtzId(Long qrtzId) { |
||||
|
return deviceQrtzFileMapper.selectList(new QueryWrapper<DeviceQrtzFileEntity>().eq("qrtz_id", qrtzId)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public boolean copy(String deviceSn, String starDate, String endDate) { |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public boolean deleteManageDeviceQrtzFile(Long id) { |
||||
|
return deviceQrtzMapper.deleteById(id)>0; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void jobWayline(DeviceDTO deviceDTO) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Boolean updateByBo(DeviceQrtzEntity entity) { |
||||
|
deviceQrtzDateMapper.delete(new QueryWrapper<DeviceQrtzDateEntity>().eq("qrtz_id", entity.getId())); |
||||
|
if(!CollectionUtils.isEmpty(entity.getDeviceQrtzDates())){ |
||||
|
entity.getDeviceQrtzDates().forEach(e->{ |
||||
|
e.setQrtzId(entity.getId()); |
||||
|
deviceQrtzDateMapper.insert(e); |
||||
|
}); |
||||
|
} |
||||
|
return deviceQrtzMapper.updateById(entity)>0; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Boolean add( DeviceQrtzDTO deviceQrtzDTO) { |
||||
|
|
||||
|
if(!CollectionUtils.isEmpty(deviceQrtzDTO.getDeviceQrtzDates())){ |
||||
|
deviceQrtzDTO.getDeviceQrtzDates().forEach(e->{ |
||||
|
e.setQrtzId(deviceQrtzDTO.getId()); |
||||
|
deviceQrtzDateMapper.insert(e); |
||||
|
}); |
||||
|
} |
||||
|
DeviceQrtzEntity entity = new DeviceQrtzEntity(); |
||||
|
entity.setDeviceSn(deviceQrtzDTO.getDeviceSn()); |
||||
|
entity.setName(deviceQrtzDTO.getName()); |
||||
|
LoginUser loginUser = LoginHelper.getLoginUser(); |
||||
|
entity.setCreateBy(loginUser.getUserId()); |
||||
|
entity.setCreateTime(new Date()); |
||||
|
entity.setNickName(loginUser.getNickname()); |
||||
|
entity.setCreateDept(loginUser.getDeptId()); |
||||
|
entity.setDeptName(loginUser.getDeptName()); |
||||
|
return deviceQrtzMapper.insert(entity)>0; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Boolean deleteIds(Collection<Long> ids) { |
||||
|
for (Long qrtzId : ids) { |
||||
|
deviceQrtzDateMapper.delete(new QueryWrapper<DeviceQrtzDateEntity>().eq("qrtz_id",qrtzId)); |
||||
|
} |
||||
|
return deviceQrtzMapper.deleteBatchIds(ids)>0; |
||||
|
} |
||||
|
} |
@ -0,0 +1,121 @@ |
|||||
|
package org.dromara.sample.wayline.controller; |
||||
|
|
||||
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
|
import jakarta.validation.constraints.NotNull; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
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.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.dromara.sample.wayline.model.dto.AiCompareDTO; |
||||
|
import org.dromara.sample.wayline.model.dto.AiCompareMediaFileDTO; |
||||
|
import org.dromara.sample.wayline.model.dto.AiCompareQueueDTO; |
||||
|
import org.dromara.sample.wayline.model.entity.AiCompareEntity; |
||||
|
import org.dromara.sample.wayline.model.entity.AiCompareQueueEntity; |
||||
|
import org.dromara.sample.wayline.model.entity.WaylineJobEntity; |
||||
|
import org.dromara.sample.wayline.service.IAiCompareQueueService; |
||||
|
import org.dromara.sample.wayline.service.IAiCompareService; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequiredArgsConstructor |
||||
|
@RequestMapping("/compare") |
||||
|
@Validated |
||||
|
@Tag(name="算法比对模块") |
||||
|
public class AiCompareController extends BaseController { |
||||
|
|
||||
|
|
||||
|
private final IAiCompareQueueService aiCompareQueueService; |
||||
|
|
||||
|
private final IAiCompareService aiCompareService; |
||||
|
|
||||
|
/** |
||||
|
* 图片对比列表 |
||||
|
*/ |
||||
|
@SaCheckPermission("sample:compare:list") |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo<AiCompareEntity> list(AiCompareDTO bo, PageQuery pageQuery) { |
||||
|
return aiCompareService.queryPageList(bo, pageQuery); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 提交对比列表 |
||||
|
*/ |
||||
|
@SaCheckPermission("sample:compare:list") |
||||
|
@GetMapping("/queueList") |
||||
|
public TableDataInfo<AiCompareQueueEntity> queueList(AiCompareQueueDTO bo, PageQuery pageQuery) { |
||||
|
return aiCompareQueueService.queueList(bo, pageQuery); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 模板列表 |
||||
|
* @param waylineId |
||||
|
* param createTime 当前记录的时间 |
||||
|
*/ |
||||
|
@SaCheckPermission("sample:compare:list") |
||||
|
@GetMapping("/templateList") |
||||
|
public List<WaylineJobEntity> templateList(String waylineId, Date createTime) { |
||||
|
return aiCompareQueueService.templateList(waylineId,createTime); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 对比编辑 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
*/ |
||||
|
@SaCheckPermission("sample:compare:query") |
||||
|
@GetMapping("/{id}") |
||||
|
public R<List<AiCompareMediaFileDTO>> queryById(@NotNull(message = "主键不能为空") |
||||
|
@PathVariable Long id) { |
||||
|
return R.ok(aiCompareService.queryById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 模板回显 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
*/ |
||||
|
@SaCheckPermission("sample:compare:query") |
||||
|
@GetMapping("/getInfo/{id}") |
||||
|
public R<AiCompareEntity> getInfo(@NotNull(message = "主键不能为空") |
||||
|
@PathVariable Long id) { |
||||
|
return R.ok(aiCompareService.getInfo(id)); |
||||
|
} |
||||
|
/** |
||||
|
* 新增比对 |
||||
|
*/ |
||||
|
@SaCheckPermission("sample:compare:add") |
||||
|
@Log(title = "算法比对", businessType = BusinessType.INSERT) |
||||
|
@RepeatSubmit() |
||||
|
@PostMapping() |
||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody List<Map<String,Object>> compareDTOList) { |
||||
|
return toAjax(aiCompareService.insertByBo(compareDTOList)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 重新比对 |
||||
|
*/ |
||||
|
@SaCheckPermission("sample:compare:edit") |
||||
|
@Log(title = "算法重新比对", businessType = BusinessType.UPDATE) |
||||
|
@RepeatSubmit() |
||||
|
@PutMapping() |
||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody Map<String,Object> bo) { |
||||
|
return toAjax(aiCompareService.update(bo)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package org.dromara.sample.wayline.mapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.dromara.sample.wayline.model.dto.AiCompareMediaFileDTO; |
||||
|
import org.dromara.sample.wayline.model.entity.AiCompareEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
public interface IAiCompareMapper extends BaseMapper<AiCompareEntity> { |
||||
|
|
||||
|
List<AiCompareMediaFileDTO>listMediaFile(AiCompareEntity aiCompareEntity); |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package org.dromara.sample.wayline.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.sample.wayline.model.dto.AiCompareQueueDTO; |
||||
|
import org.dromara.sample.wayline.model.entity.AiCompareQueueEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
public interface IAiCompareQueueMapper extends BaseMapper<AiCompareQueueEntity> { |
||||
|
IPage<AiCompareQueueEntity> queueList(@Param("bo") AiCompareQueueDTO bo, @Param("page") Page<?> page); |
||||
|
|
||||
|
Boolean updateStatus(@Param("ids") List<Long> ids, @Param("queueType") String queueType); |
||||
|
} |
@ -0,0 +1,120 @@ |
|||||
|
package org.dromara.sample.wayline.model.dto; |
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.FieldFill; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import jakarta.validation.constraints.NotNull; |
||||
|
import lombok.*; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import org.dromara.sample.wayline.model.entity.AiCompareEntity; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode() |
||||
|
@AutoMapper(target = AiCompareEntity.class, reverseConvertGenerate = false) |
||||
|
public class AiCompareDTO implements Serializable { |
||||
|
|
||||
|
|
||||
|
|
||||
|
@NotNull(message = "主键id", groups = {EditGroup.class }) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 0:是否比对 1:算法比对中 2:人工查看 3:可提交预警 4:完成对比 |
||||
|
* */ |
||||
|
private String status; |
||||
|
@JsonIgnore |
||||
|
@NotNull(message = "未比对列表主键id", groups = { AddGroup.class}) |
||||
|
private Long queueId; |
||||
|
/**航线名称*/ |
||||
|
private String waylineName; |
||||
|
|
||||
|
/** |
||||
|
* 模板id 对应模板的jobId |
||||
|
* */ |
||||
|
private String templateId; |
||||
|
|
||||
|
/** |
||||
|
* 算法数量 |
||||
|
* */ |
||||
|
|
||||
|
private Integer illegalNum; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 总数量 |
||||
|
* */ |
||||
|
|
||||
|
private Integer totalNum; |
||||
|
|
||||
|
/** |
||||
|
*部门名称 |
||||
|
* */ |
||||
|
private String deptName; |
||||
|
/** |
||||
|
* 任务名称 |
||||
|
* */ |
||||
|
private String jobName; |
||||
|
|
||||
|
/** |
||||
|
* 任务id |
||||
|
* */ |
||||
|
private String jobId; |
||||
|
|
||||
|
/** |
||||
|
* 搜索值 |
||||
|
*/ |
||||
|
@JsonIgnore |
||||
|
private String searchValue; |
||||
|
|
||||
|
/** |
||||
|
* 创建部门 |
||||
|
*/ |
||||
|
|
||||
|
private Long createDept; |
||||
|
|
||||
|
/** |
||||
|
* 创建者 |
||||
|
*/ |
||||
|
|
||||
|
private Long createBy; |
||||
|
/** |
||||
|
*用户昵称 |
||||
|
* */ |
||||
|
private String nickName; |
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新者 |
||||
|
*/ |
||||
|
|
||||
|
private Long updateBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updateTime; |
||||
|
|
||||
|
/** |
||||
|
* 请求参数 |
||||
|
*/ |
||||
|
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
|
private Map<String, Object> params = new HashMap<>(); |
||||
|
|
||||
|
} |
@ -0,0 +1,75 @@ |
|||||
|
package org.dromara.sample.wayline.model.dto; |
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Builder |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
public class AiCompareMediaFileDTO { |
||||
|
|
||||
|
|
||||
|
private String id; |
||||
|
|
||||
|
/**上云文件id*/ |
||||
|
private String fileId; |
||||
|
|
||||
|
@Schema(description = "文件名") |
||||
|
private String fileName; |
||||
|
|
||||
|
@Schema(description = "文件的路径") |
||||
|
private String filePath; |
||||
|
|
||||
|
@Schema(description = "文件所属的工作区") |
||||
|
private String workspaceId; |
||||
|
@Schema(description = "桶中文件的关链字") |
||||
|
private String objectKey; |
||||
|
|
||||
|
@Schema(description = "此属性仅适用于由Pilot上传的图像文件。0:正常图片;1:全景。") |
||||
|
private String subFileType; |
||||
|
|
||||
|
@Schema(description = "是否原始图像") |
||||
|
private Boolean isOriginal; |
||||
|
|
||||
|
@Schema(description = "创建文件的无人机的sn。") |
||||
|
private String drone; |
||||
|
|
||||
|
@Schema(description = "创建文件的无人机有效载荷的名称。") |
||||
|
private String payload; |
||||
|
|
||||
|
@Schema(description = "文件的小指纹。此属性仅适用于由Pilot上传的媒体文件") |
||||
|
private String tinnyFingerprint; |
||||
|
|
||||
|
@Schema(description = "文件的指纹。此属性仅适用于由Pilot上传的媒体文件。") |
||||
|
private String fingerprint; |
||||
|
|
||||
|
private Date createTime; |
||||
|
|
||||
|
private String jobId; |
||||
|
|
||||
|
@Schema(description = "模板图片名称") |
||||
|
private String mateFileName; |
||||
|
|
||||
|
@Schema(description = "模板图url") |
||||
|
private String mateFilePath; |
||||
|
|
||||
|
@Schema(description = "模板拍照时间") |
||||
|
private Date mateFileDate; |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,79 @@ |
|||||
|
package org.dromara.sample.wayline.model.dto; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
|
import jakarta.validation.constraints.NotNull; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Builder; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Builder |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
public class AiCompareQueueDTO { |
||||
|
|
||||
|
|
||||
|
|
||||
|
private Long id; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 航线id 对应wayline_id 字段 |
||||
|
* */ |
||||
|
private String waylineId; |
||||
|
|
||||
|
/** |
||||
|
* 航线名称 |
||||
|
* */ |
||||
|
private String waylineName; |
||||
|
/** |
||||
|
* 任务id |
||||
|
* */ |
||||
|
private String jobId; |
||||
|
|
||||
|
/** |
||||
|
*任务名称 |
||||
|
* */ |
||||
|
private String jobName; |
||||
|
|
||||
|
/** |
||||
|
*图片数量 |
||||
|
* */ |
||||
|
private Integer pictureNumber; |
||||
|
|
||||
|
/** |
||||
|
*创建时间 |
||||
|
* */ |
||||
|
private Date createTime; |
||||
|
|
||||
|
/** |
||||
|
*队列类型 0:未比对 1:比对 |
||||
|
* */ |
||||
|
@NotNull(message = "队列类型 0:未比对 1:比对") |
||||
|
private String queueType; |
||||
|
|
||||
|
/** |
||||
|
* 搜索值 |
||||
|
*/ |
||||
|
@JsonIgnore |
||||
|
private String searchValue; |
||||
|
/** |
||||
|
* 请求参数 |
||||
|
*/ |
||||
|
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
|
private Map<String, Object> params = new HashMap<>(); |
||||
|
|
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
package org.dromara.sample.wayline.model.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.*; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@TableName("ai_compare") |
||||
|
public class AiCompareEntity extends BaseEntity { |
||||
|
|
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 0:是否比对 1:算法比对中 2:人工查看 3:可提交预警 4:完成对比 |
||||
|
* */ |
||||
|
private String status; |
||||
|
|
||||
|
|
||||
|
/**航线名称*/ |
||||
|
private String waylineName; |
||||
|
/** |
||||
|
* 模板id |
||||
|
* */ |
||||
|
private String templateId; |
||||
|
|
||||
|
/** |
||||
|
* 算法数量 |
||||
|
* */ |
||||
|
private Integer illegalNum; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 总数量 |
||||
|
* */ |
||||
|
private Integer totalNum; |
||||
|
/** |
||||
|
*用户昵称 |
||||
|
* */ |
||||
|
private String nickName; |
||||
|
|
||||
|
/** |
||||
|
*部门名称 |
||||
|
* */ |
||||
|
private String deptName; |
||||
|
/** |
||||
|
* 任务名称 |
||||
|
* */ |
||||
|
private String jobName; |
||||
|
|
||||
|
/** |
||||
|
* 任务id |
||||
|
* */ |
||||
|
private String jobId; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,64 @@ |
|||||
|
package org.dromara.sample.wayline.model.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.Builder; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("ai_compare_queue") |
||||
|
@Builder |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
public class AiCompareQueueEntity implements Serializable { |
||||
|
|
||||
|
|
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 航线id 对应wayline_id 字段 |
||||
|
* */ |
||||
|
private String waylineId; |
||||
|
|
||||
|
/** |
||||
|
* 航线名称 |
||||
|
* */ |
||||
|
private String waylineName; |
||||
|
|
||||
|
/** |
||||
|
* 任务id |
||||
|
* */ |
||||
|
private String jobId; |
||||
|
|
||||
|
/** |
||||
|
*任务名称 |
||||
|
* */ |
||||
|
private String jobName; |
||||
|
|
||||
|
/** |
||||
|
*图片数量 |
||||
|
* */ |
||||
|
private Integer pictureNumber; |
||||
|
|
||||
|
/** |
||||
|
*创建时间 |
||||
|
* */ |
||||
|
private Date createTime; |
||||
|
|
||||
|
/** |
||||
|
*队列类型 0:未比对 1:比对 |
||||
|
* */ |
||||
|
private String queueType; |
||||
|
|
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package org.dromara.sample.wayline.service; |
||||
|
|
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.sample.wayline.model.dto.AiCompareQueueDTO; |
||||
|
import org.dromara.sample.wayline.model.entity.AiCompareQueueEntity; |
||||
|
import org.dromara.sample.wayline.model.entity.WaylineJobEntity; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
public interface IAiCompareQueueService { |
||||
|
TableDataInfo<AiCompareQueueEntity> queueList(AiCompareQueueDTO bo, PageQuery pageQuery); |
||||
|
List<WaylineJobEntity>templateList(String waylineId, Date createTime); |
||||
|
AiCompareQueueEntity getInfo(Long queueId); |
||||
|
Boolean updateStatus(List<Long> ids,String queueType); |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
package org.dromara.sample.wayline.service; |
||||
|
|
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.sample.wayline.model.dto.AiCompareDTO; |
||||
|
import org.dromara.sample.wayline.model.dto.AiCompareMediaFileDTO; |
||||
|
import org.dromara.sample.wayline.model.entity.AiCompareEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
public interface IAiCompareService { |
||||
|
|
||||
|
TableDataInfo<AiCompareEntity> queryPageList(AiCompareDTO bo, PageQuery pageQuery); |
||||
|
|
||||
|
Boolean insertByBo(List<Map<String,Object>>compareDTOList); |
||||
|
|
||||
|
Boolean update(Map<String,Object> compareDTO); |
||||
|
|
||||
|
AiCompareEntity getInfo(Long id); |
||||
|
List<AiCompareMediaFileDTO> queryById(Long id); |
||||
|
} |
@ -0,0 +1,84 @@ |
|||||
|
package org.dromara.sample.wayline.service.impl; |
||||
|
|
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
|
import com.tdunning.math.stats.Sort; |
||||
|
import lombok.Data; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.poi.ss.formula.functions.T; |
||||
|
import org.dromara.common.core.utils.MapstructUtils; |
||||
|
import org.dromara.common.core.utils.StringUtils; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.sample.wayline.mapper.IAiCompareQueueMapper; |
||||
|
import org.dromara.sample.wayline.mapper.IWaylineJobMapper; |
||||
|
import org.dromara.sample.wayline.model.dto.AiCompareDTO; |
||||
|
import org.dromara.sample.wayline.model.dto.AiCompareQueueDTO; |
||||
|
import org.dromara.sample.wayline.model.entity.AiCompareEntity; |
||||
|
import org.dromara.sample.wayline.model.entity.AiCompareQueueEntity; |
||||
|
import org.dromara.sample.wayline.model.entity.WaylineJobEntity; |
||||
|
import org.dromara.sample.wayline.service.IAiCompareQueueService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
import java.time.ZoneId; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class AiCompareQueueServiceImpl implements IAiCompareQueueService { |
||||
|
|
||||
|
private final IAiCompareQueueMapper aiCompareQueueMapper; |
||||
|
private final IWaylineJobMapper waylineJobMapper; |
||||
|
@Override |
||||
|
public TableDataInfo<AiCompareQueueEntity> queueList(AiCompareQueueDTO bo, PageQuery pageQuery) { |
||||
|
return TableDataInfo.build(aiCompareQueueMapper.selectPage(pageQuery.build(),this.buildAiCompareDTOQueryWrapper(bo))); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<WaylineJobEntity> templateList(String waylineId, Date createTime) { |
||||
|
QueryWrapper<WaylineJobEntity> wrapper = Wrappers.query(); |
||||
|
// 如果 createTime 为空,使用当前时间
|
||||
|
if (createTime == null) { |
||||
|
createTime = Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant()); |
||||
|
} |
||||
|
//获取最新的10条数据
|
||||
|
wrapper |
||||
|
.eq(StringUtils.isNotBlank(waylineId),"wayline_id", waylineId) |
||||
|
.lt(ObjectUtil.isNotEmpty(createTime),"create_time",createTime) // 增加创建时间小于指定时间的条件
|
||||
|
.orderByDesc("create_time") |
||||
|
.last("limit 10"); |
||||
|
List<WaylineJobEntity> jobEntityList = waylineJobMapper.selectList(wrapper); |
||||
|
return jobEntityList; |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<AiCompareQueueEntity> buildAiCompareDTOQueryWrapper(AiCompareQueueDTO bo) { |
||||
|
QueryWrapper<AiCompareQueueEntity> wrapper = Wrappers.query(); |
||||
|
wrapper |
||||
|
.eq(ObjectUtil.isNotEmpty(bo.getQueueType()), "queue_type",bo.getQueueType()) |
||||
|
.like(StringUtils.isNotBlank(bo.getWaylineName()), "lower(wayline_name)", StringUtils.lowerCase(bo.getWaylineName())) |
||||
|
.like(StringUtils.isNotBlank(bo.getJobName()), "lower(job_name)", StringUtils.lowerCase(bo.getJobName())) |
||||
|
.orderByDesc("create_time"); |
||||
|
return wrapper; |
||||
|
} |
||||
|
@Override |
||||
|
public AiCompareQueueEntity getInfo(Long queueId) { |
||||
|
return aiCompareQueueMapper.selectById(queueId); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Boolean updateStatus(List<Long> ids,String queueType) { |
||||
|
return aiCompareQueueMapper.updateStatus(ids,queueType); |
||||
|
} |
||||
|
} |
@ -0,0 +1,140 @@ |
|||||
|
package org.dromara.sample.wayline.service.impl; |
||||
|
|
||||
|
import cn.hutool.core.convert.Convert; |
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.ibatis.executor.BatchResult; |
||||
|
import org.dromara.common.core.constant.AiCompareStatusConstants; |
||||
|
import org.dromara.common.core.utils.MapstructUtils; |
||||
|
import org.dromara.common.core.utils.StreamUtils; |
||||
|
import org.dromara.common.core.utils.StringUtils; |
||||
|
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.common.translation.annotation.Translation; |
||||
|
import org.dromara.sample.wayline.mapper.IAiCompareMapper; |
||||
|
import org.dromara.sample.wayline.mapper.IWaylineJobMapper; |
||||
|
import org.dromara.sample.wayline.model.dto.AiCompareDTO; |
||||
|
import org.dromara.sample.wayline.model.dto.AiCompareMediaFileDTO; |
||||
|
import org.dromara.sample.wayline.model.entity.AiCompareEntity; |
||||
|
import org.dromara.sample.wayline.model.entity.AiCompareQueueEntity; |
||||
|
import org.dromara.sample.wayline.model.entity.WaylineJobEntity; |
||||
|
import org.dromara.sample.wayline.service.IAiCompareQueueService; |
||||
|
import org.dromara.sample.wayline.service.IAiCompareService; |
||||
|
import org.dromara.system.api.model.LoginUser; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @auther yq |
||||
|
* @data 2025/3/21 |
||||
|
*/ |
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class AiCompareServiceImpl implements IAiCompareService { |
||||
|
|
||||
|
private final IAiCompareQueueService aiCompareQueueService; |
||||
|
private final IAiCompareMapper aiCompareMapper; |
||||
|
private final IWaylineJobMapper waylineJobMapper; |
||||
|
|
||||
|
@Override |
||||
|
public TableDataInfo<AiCompareEntity> queryPageList(AiCompareDTO bo, PageQuery pageQuery) { |
||||
|
return TableDataInfo.build(aiCompareMapper.selectPage(pageQuery.build(),this.buildAiCompareDTOQueryWrapper(bo))); |
||||
|
} |
||||
|
private QueryWrapper<AiCompareEntity> buildAiCompareDTOQueryWrapper(AiCompareDTO bo) { |
||||
|
Map<String, Object> params = bo.getParams(); |
||||
|
QueryWrapper<AiCompareEntity> wrapper = Wrappers.query(); |
||||
|
wrapper |
||||
|
.eq(StringUtils.isNotEmpty(bo.getStatus()), "status",bo.getStatus()) |
||||
|
.eq(ObjectUtil.isNotEmpty(bo.getCreateBy()), "create_by",bo.getCreateBy()) |
||||
|
.like(StringUtils.isNotBlank(bo.getDeptName()), "lower(dept_name)", StringUtils.lowerCase(bo.getDeptName())) |
||||
|
.like(StringUtils.isNotBlank(bo.getJobName()), "lower(job_name)", StringUtils.lowerCase(bo.getJobName())) |
||||
|
.between(params.get("beginTime") != null && params.get("endTime") != null, |
||||
|
"create_time", params.get("beginTime"), params.get("endTime")); |
||||
|
return wrapper; |
||||
|
} |
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public Boolean insertByBo(List<Map<String,Object>> compareDTOList) { |
||||
|
if(compareDTOList.isEmpty()){ |
||||
|
throw new RuntimeException("未选择比对数据"); |
||||
|
} |
||||
|
List<AiCompareEntity> insertList =new ArrayList<>(); |
||||
|
for (Map<String,Object> bo : compareDTOList) { |
||||
|
Long queueId = Convert.toLong(bo.get("queueId")); |
||||
|
AiCompareQueueEntity serviceInfo = aiCompareQueueService.getInfo(queueId); |
||||
|
AiCompareEntity aiCompareEntity = new AiCompareEntity(); |
||||
|
LoginUser loginUser = LoginHelper.getLoginUser(); |
||||
|
aiCompareEntity.setWaylineName(serviceInfo.getWaylineName()); |
||||
|
aiCompareEntity.setJobId(serviceInfo.getJobId()); |
||||
|
aiCompareEntity.setJobName(serviceInfo.getJobName()); |
||||
|
aiCompareEntity.setTotalNum(serviceInfo.getPictureNumber()); |
||||
|
aiCompareEntity.setCreateBy(loginUser.getUserId()); |
||||
|
aiCompareEntity.setNickName(loginUser.getNickname()); |
||||
|
aiCompareEntity.setDeptName(loginUser.getDeptName()); |
||||
|
aiCompareEntity.setCreateDept(loginUser.getDeptId()); |
||||
|
aiCompareEntity.setStatus(AiCompareStatusConstants.COMPARE_STATUS_1); |
||||
|
aiCompareEntity.setCreateTime(new Date()); |
||||
|
String templateId = Convert.toStr(bo.get("templateId")); |
||||
|
if(ObjectUtil.isNotEmpty(templateId)){ |
||||
|
aiCompareEntity.setTemplateId(templateId); |
||||
|
}else { |
||||
|
//获取最新一条的模板进行比对
|
||||
|
LambdaQueryWrapper<WaylineJobEntity> lasted = Wrappers.<WaylineJobEntity>lambdaQuery() |
||||
|
.eq(WaylineJobEntity::getFileId, serviceInfo.getWaylineId()) |
||||
|
.lt(WaylineJobEntity::getCreateTime, serviceInfo.getCreateTime()) // 增加创建时间小于指定时间的条件
|
||||
|
.orderByDesc(WaylineJobEntity::getCreateTime) |
||||
|
.last("limit 1"); |
||||
|
List<WaylineJobEntity> jobEntityList = waylineJobMapper.selectList(lasted); |
||||
|
if(jobEntityList.isEmpty()){ |
||||
|
throw new RuntimeException("("+serviceInfo.getWaylineName()+")未找到对应的模板"); |
||||
|
}else { |
||||
|
aiCompareEntity.setTemplateId(jobEntityList.get(0).getJobId()); |
||||
|
} |
||||
|
} |
||||
|
insertList.add(aiCompareEntity); |
||||
|
} |
||||
|
List<BatchResult> resultList = aiCompareMapper.insertOrUpdate(insertList, 10); |
||||
|
System.out.println(resultList); |
||||
|
List<Long> list =compareDTOList.stream().map(e->Convert.toLong(e.get("queueId"))).collect(Collectors.toList()); |
||||
|
; |
||||
|
return aiCompareQueueService.updateStatus(list,AiCompareStatusConstants.QUEUW_TYPE_1); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Boolean update(Map<String,Object> compareDTO) { |
||||
|
AiCompareEntity aiCompareEntity =new AiCompareEntity(); |
||||
|
Long id = Convert.toLong(compareDTO.get("id")); |
||||
|
aiCompareEntity.setId(id); |
||||
|
String templateId = Convert.toStr(compareDTO.get("templateId")); |
||||
|
if(StrUtil.isNotEmpty(templateId)){ |
||||
|
aiCompareEntity.setTemplateId(templateId); |
||||
|
} |
||||
|
|
||||
|
return aiCompareMapper.updateById(aiCompareEntity)>0; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public AiCompareEntity getInfo(Long id) { |
||||
|
return aiCompareMapper.selectById(id); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<AiCompareMediaFileDTO> queryById(Long id) { |
||||
|
AiCompareEntity aiCompareEntity = aiCompareMapper.selectById(id); |
||||
|
List<AiCompareMediaFileDTO> mediaFileDTOList = aiCompareMapper.listMediaFile(aiCompareEntity); |
||||
|
return mediaFileDTOList; |
||||
|
} |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
<?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.sample.wayline.mapper.IAiCompareMapper"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<select id="listMediaFile" resultType="org.dromara.sample.wayline.model.dto.AiCompareMediaFileDTO"> |
||||
|
SELECT mf.*, |
||||
|
mfi.file_name as mateFileName, |
||||
|
mfi.file_path as mateFilePath, |
||||
|
mfi.create_time as mateFileDate |
||||
|
FROM |
||||
|
media_file mf |
||||
|
LEFT JOIN ai_compare ai ON ai.job_id = mf.job_id |
||||
|
LEFT JOIN media_file mfi ON mfi.job_id = ai.template_id |
||||
|
WHERE mfi.job_id=#{jobId} |
||||
|
ORDER BY mf.create_time asc |
||||
|
|
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,21 @@ |
|||||
|
<?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.sample.wayline.mapper.IAiCompareQueueMapper"> |
||||
|
<update id="updateStatus"> |
||||
|
update ai_compare_queue |
||||
|
<set> |
||||
|
queue_type = #{queueType} |
||||
|
</set> |
||||
|
where id in |
||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</update> |
||||
|
|
||||
|
|
||||
|
<select id="queueList" resultType="org.dromara.sample.wayline.model.entity.AiCompareQueueEntity"> |
||||
|
|
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,22 @@ |
|||||
|
<?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.sample.manage.mapper.IDeviceQrtzDateMapper"> |
||||
|
|
||||
|
|
||||
|
<select id="listDeviceQrtzDateByQrtzIdAndDate" |
||||
|
resultType="org.dromara.sample.manage.model.entity.DeviceQrtzDateEntity"> |
||||
|
SELECT * from manage_device_qrtz_date wqd |
||||
|
WHERE wqd.del_flag = 0 |
||||
|
AND wqd.qrtz_id = #{condition.qrtzId} |
||||
|
and wqd.start_date <= #{condition.currentDate} |
||||
|
AND wqd.end_date >= #{condition.currentDate} |
||||
|
</select> |
||||
|
<select id="listDeviceQrtzDateByQrtzAndDate" |
||||
|
resultType="org.dromara.sample.manage.model.entity.DeviceQrtzDateEntity"> |
||||
|
SELECT * from manage_device_qrtz_date wqd |
||||
|
WHERE wqd.del_flag = 0 |
||||
|
AND wqd.qrtz_id = #{qrtzId} |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,9 @@ |
|||||
|
<?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.sample.manage.mapper.IDeviceQrtzFileMapper"> |
||||
|
|
||||
|
<select id="manageDeviceQrtzFileByQrtzId" |
||||
|
resultType="org.dromara.sample.manage.model.entity.DeviceQrtzFileEntity"></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.sample.manage.mapper.IDeviceQrtzMapper"> |
||||
|
<resultMap id="listManageFilePlatformInfoMap" type="org.dromara.sample.manage.model.entity.DeviceQrtzEntity"> |
||||
|
<result column="id" property="id" jdbcType="VARCHAR"/> |
||||
|
<result column="device_sn" property="deviceSn" jdbcType="VARCHAR"/> |
||||
|
<result column="device_id" property="deviceId" jdbcType="VARCHAR"/> |
||||
|
<result column="name" property="name" jdbcType="VARCHAR"/> |
||||
|
<result column="status" property="status" jdbcType="VARCHAR"/> |
||||
|
<collection column="{qrtzId=id}" |
||||
|
property="deviceQrtzDates" ofType="org.dromara.sample.manage.model.entity.DeviceQrtzDateEntity" |
||||
|
javaType="java.util.ArrayList" |
||||
|
select="org.dromara.sample.manage.mapper.IDeviceQrtzDateMapper.listWaylineDeviceQrtzDateByQrtzAndDate"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
<select id="listManageDeviceQrtz" resultType="org.dromara.sample.manage.model.entity.DeviceQrtzEntity"> |
||||
|
SELECT wdq.* FROM manage_device_qrtz wdq |
||||
|
LEFT JOIN manage_device wd ON wdq.device_sn = wd.device_sn |
||||
|
WHERE wdq.del_flag = 0 |
||||
|
<if test="condition.name != null and condition.name != ''"> |
||||
|
AND wdq.name like concat(concat('%',#{condition.name}),'%') |
||||
|
</if> |
||||
|
<if test="condition.status != null"> |
||||
|
AND wdq.status = #{condition.status} |
||||
|
</if> |
||||
|
<if test="condition.startDate != null"> |
||||
|
AND DATE_FORMAT(wdq.`start_date`,'%H:%i:%s') >= DATE_FORMAT(#{condition.startDate},'%H:%i:%s') |
||||
|
</if> |
||||
|
<if test="condition.endDate != null"> |
||||
|
AND DATE_FORMAT(wdq.end_date,'%H:%i:%s') <= DATE_FORMAT(#{endDate},'%H:%i:%s') |
||||
|
</if> |
||||
|
<if test="condition.deviceSn != null and condition.deviceSn != ''"> |
||||
|
AND wd.device_sn like concat(concat('%',#{condition.deviceSn}),'%') |
||||
|
</if> |
||||
|
<if test="condition.deptName != null and condition.deptName != ''"> |
||||
|
AND wd.dept_name like concat(concat('%',#{condition.deptName}),'%') |
||||
|
</if> |
||||
|
<if test="condition.deptIds.size > 0"> |
||||
|
AND wd.dept_id in |
||||
|
<foreach item="id" collection="condition.deptIds" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
order by wdq.status asc, wdq.create_time desc |
||||
|
</select> |
||||
|
<select id="calendarList" resultType="java.util.Map"></select> |
||||
|
<select id="manageDeviceQrtzFileByQrtzId" |
||||
|
resultType="org.dromara.sample.manage.model.entity.DeviceQrtzFileEntity"> |
||||
|
select dqf.* from manage_device_qrtz_file dqf where dqf.qrtz_id=#{qrtzId} |
||||
|
ORDER BY dqf.sort |
||||
|
</select> |
||||
|
</mapper> |
Loading…
Reference in new issue