| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.sxkj.gd.common.GenericConverter; |
| | | import org.sxkj.gd.common.IdParam; |
| | | import org.sxkj.gd.workorder.dto.GdDeviceCallDetailExternalSaveDTO; |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallEntity; |
| | | import org.sxkj.gd.workorder.param.GdDeviceCallPageParam; |
| | | import org.sxkj.gd.workorder.vo.GdDeviceCallVO; |
| | | import org.sxkj.gd.workorder.excel.GdDeviceCallExcel; |
| | | import org.sxkj.gd.workorder.wrapper.GdDeviceCallWrapper; |
| | | import org.sxkj.gd.workorder.service.IGdDeviceCallService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 设备调用表 控制器 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("workorder/gdDeviceCall") |
| | | @Api(value = "设备调用表", tags = "设备调用表接口") |
| | | public class GdDeviceCallController extends BladeController { |
| | | |
| | | private final IGdDeviceCallService gdDeviceCallService; |
| | | |
| | | /** |
| | | * 设备调用表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入gdDeviceCall") |
| | | public R<IPage<GdDeviceCallVO>> page(GdDeviceCallPageParam param, Query query) { |
| | | IPage<GdDeviceCallVO> pages = gdDeviceCallService.selectGdDeviceCallPage(Condition.getPage(query), GenericConverter.convert(param, GdDeviceCallVO.class)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 设备调用表 新增 - 对外接口 |
| | | */ |
| | | @PostMapping("/addDeviceCall") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "新增设备状态数据(星图对接)", notes = "dtos") |
| | | public R<Boolean> addDeviceCallExternal(@RequestBody List<GdDeviceCallDetailExternalSaveDTO> dtos) { |
| | | return R.status(gdDeviceCallService.saveGdDeviceCallExternal(dtos)); |
| | | } |
| | | |
| | | /** |
| | | * 导出数据 |
| | | */ |
| | | @GetMapping("/export-gdDeviceCall") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "导出数据", notes = "传入gdDeviceCall") |
| | | @ApiIgnore |
| | | public void exportGdDeviceCall(@ApiIgnore @RequestParam Map<String, Object> gdDeviceCall, BladeUser bladeUser, HttpServletResponse response) { |
| | | QueryWrapper<GdDeviceCallEntity> queryWrapper = Condition.getQueryWrapper(gdDeviceCall, GdDeviceCallEntity.class); |
| | | //if (!AuthUtil.isAdministrator()) { |
| | | // queryWrapper.lambda().eq(GdDeviceCall::getTenantId, bladeUser.getTenantId()); |
| | | //} |
| | | queryWrapper.lambda().eq(GdDeviceCallEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
| | | List<GdDeviceCallExcel> list = gdDeviceCallService.exportGdDeviceCall(queryWrapper); |
| | | ExcelUtil.export(response, "设备调用表数据" + DateUtil.time(), "设备调用表数据表", list, GdDeviceCallExcel.class); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.sxkj.gd.common.GenericConverter; |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallDetailEntity; |
| | | import org.sxkj.gd.workorder.param.GdDeviceCallDetailPageParam; |
| | | import org.sxkj.gd.workorder.vo.GdDeviceCallDetailVO; |
| | | import org.sxkj.gd.workorder.excel.GdDeviceCallDetailExcel; |
| | | import org.sxkj.gd.workorder.wrapper.GdDeviceCallDetailWrapper; |
| | | import org.sxkj.gd.workorder.service.IGdDeviceCallDetailService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 设备调用详情表 控制器 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("workorder/gdDeviceCallDetail") |
| | | @Api(value = "设备调用详情表", tags = "设备调用详情表接口") |
| | | public class GdDeviceCallDetailController extends BladeController { |
| | | |
| | | private final IGdDeviceCallDetailService gdDeviceCallDetailService; |
| | | |
| | | /** |
| | | * 设备调用详情表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入gdDeviceCallDetail") |
| | | public R<IPage<GdDeviceCallDetailVO>> page(GdDeviceCallDetailPageParam gdDeviceCallDetail, Query query) { |
| | | IPage<GdDeviceCallDetailVO> pages = gdDeviceCallDetailService.selectGdDeviceCallDetailPage(Condition.getPage(query), GenericConverter.convert(gdDeviceCallDetail, GdDeviceCallDetailVO.class)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 导出数据 |
| | | */ |
| | | @GetMapping("/export-gdDeviceCallDetail") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "导出数据", notes = "传入gdDeviceCallDetail") |
| | | @ApiIgnore |
| | | public void exportGdDeviceCallDetail(@ApiIgnore @RequestParam Map<String, Object> gdDeviceCallDetail, BladeUser bladeUser, HttpServletResponse response) { |
| | | QueryWrapper<GdDeviceCallDetailEntity> queryWrapper = Condition.getQueryWrapper(gdDeviceCallDetail, GdDeviceCallDetailEntity.class); |
| | | //if (!AuthUtil.isAdministrator()) { |
| | | // queryWrapper.lambda().eq(GdDeviceCallDetail::getTenantId, bladeUser.getTenantId()); |
| | | //} |
| | | queryWrapper.lambda().eq(GdDeviceCallDetailEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
| | | List<GdDeviceCallDetailExcel> list = gdDeviceCallDetailService.exportGdDeviceCallDetail(queryWrapper); |
| | | ExcelUtil.export(response, "设备调用详情表数据" + DateUtil.time(), "设备调用详情表数据表", list, GdDeviceCallDetailExcel.class); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.dto; |
| | | |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 设备调用表 数据传输对象实体类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class GdDeviceCallDTO extends GdDeviceCallEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.dto; |
| | | |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallDetailEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 设备调用详情表 数据传输对象实体类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class GdDeviceCallDetailDTO extends GdDeviceCallDetailEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | package org.sxkj.gd.workorder.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description 设备调用外部保存参数 |
| | | * @Author AIX |
| | | * @Date 2026/2/26 15:22 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class GdDeviceCallDetailExternalSaveDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 巡查任务id |
| | | */ |
| | | @ApiModelProperty(value = "巡查任务id") |
| | | private Long patrolTaskId; |
| | | |
| | | /** |
| | | * 设备sn |
| | | */ |
| | | @ApiModelProperty(value = "设备sn") |
| | | private String deviceSn; |
| | | |
| | | /** |
| | | * 设备状态 |
| | | */ |
| | | @ApiModelProperty(value = "设备状态") |
| | | private String deviceStatus; |
| | | /** |
| | | * 状态发生时间 |
| | | */ |
| | | @ApiModelProperty(value = "状态发生时间") |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | private Date occurTime; |
| | | /** |
| | | * 飞行里程(米) |
| | | */ |
| | | @ApiModelProperty(value = "飞行里程(米)") |
| | | private Integer flightDistance; |
| | | /** |
| | | * 状态流转顺序 |
| | | */ |
| | | @ApiModelProperty(value = "状态流转顺序") |
| | | private Integer sort; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 设备调用详情表 实体类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @Data |
| | | @TableName("ja_gd_device_call_detail") |
| | | @ApiModel(value = "GdDeviceCallDetail对象", description = "设备调用详情表") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class GdDeviceCallDetailEntity extends BaseEntity { |
| | | |
| | | /** |
| | | * 关联设备调用表id |
| | | */ |
| | | @ApiModelProperty(value = "关联设备调用表id") |
| | | private Long callId; |
| | | /** |
| | | * 设备状态 |
| | | */ |
| | | @ApiModelProperty(value = "设备状态") |
| | | private String deviceStatus; |
| | | /** |
| | | * 状态发生时间 |
| | | */ |
| | | @ApiModelProperty(value = "状态发生时间") |
| | | private Date occurTime; |
| | | /** |
| | | * 飞行里程(米) |
| | | */ |
| | | @ApiModelProperty(value = "飞行里程(米)") |
| | | private Integer flightDistance; |
| | | /** |
| | | * 状态流转顺序 |
| | | */ |
| | | @ApiModelProperty(value = "状态流转顺序") |
| | | private Integer sort; |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 设备调用表 实体类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @Data |
| | | @TableName("ja_gd_device_call") |
| | | @ApiModel(value = "GdDeviceCall对象", description = "设备调用表") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class GdDeviceCallEntity extends BaseEntity { |
| | | |
| | | /** |
| | | * 巡查任务名称 |
| | | */ |
| | | @ApiModelProperty(value = "巡查任务名称") |
| | | private String patrolTaskName; |
| | | /** |
| | | * 发起任务部门 |
| | | */ |
| | | @ApiModelProperty(value = "发起任务部门") |
| | | private String taskDepartment; |
| | | /** |
| | | * 任务发起人 |
| | | */ |
| | | @ApiModelProperty(value = "任务发起人") |
| | | private String taskInitiator; |
| | | /** |
| | | * 飞行时长 |
| | | */ |
| | | @ApiModelProperty(value = "飞行时长") |
| | | private Long flightDuration; |
| | | /** |
| | | * 飞行里程(米) |
| | | */ |
| | | @ApiModelProperty(value = "飞行里程(米)") |
| | | private Double flightDistance; |
| | | /** |
| | | * 执行设备id |
| | | */ |
| | | @ApiModelProperty(value = "执行设备id") |
| | | private Long deviceId; |
| | | /** |
| | | * 执行设备名称 |
| | | */ |
| | | @ApiModelProperty(value = "执行设备名称") |
| | | private String deviceName; |
| | | /** |
| | | * 计划执行时间 |
| | | */ |
| | | @ApiModelProperty(value = "计划执行时间") |
| | | private Date planExecuteTime; |
| | | /** |
| | | * 实际执行时间 |
| | | */ |
| | | @ApiModelProperty(value = "实际执行时间") |
| | | private Date actualExecuteTime; |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.excel; |
| | | |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 设备调用详情表 Excel实体类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class GdDeviceCallDetailExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 关联设备调用表id |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("关联设备调用表id") |
| | | private Long callId; |
| | | /** |
| | | * 设备状态 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("设备状态") |
| | | private String deviceStatus; |
| | | /** |
| | | * 状态发生时间 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("状态发生时间") |
| | | private Date occurTime; |
| | | /** |
| | | * 状态流转顺序 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("状态流转顺序") |
| | | private Integer sort; |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("区域编码") |
| | | private String areaCode; |
| | | /** |
| | | * 删除标志(0存在 1删除) |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("删除标志(0存在 1删除)") |
| | | private Byte isDeleted; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.excel; |
| | | |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 设备调用表 Excel实体类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class GdDeviceCallExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 巡查任务名称 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("巡查任务名称") |
| | | private String patrolTaskName; |
| | | /** |
| | | * 发起任务部门 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("发起任务部门") |
| | | private String taskDepartment; |
| | | /** |
| | | * 任务发起人 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("任务发起人") |
| | | private String taskInitiator; |
| | | /** |
| | | * 飞行时长 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("飞行时长") |
| | | private String flightDuration; |
| | | /** |
| | | * 飞行里程(米) |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("飞行里程(米)") |
| | | private Integer flightDistance; |
| | | /** |
| | | * 执行设备名称 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("执行设备名称") |
| | | private String deviceName; |
| | | /** |
| | | * 计划执行时间 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("计划执行时间") |
| | | private Date planExecuteTime; |
| | | /** |
| | | * 实际执行时间 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("实际执行时间") |
| | | private Date actualExecuteTime; |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("区域编码") |
| | | private String areaCode; |
| | | /** |
| | | * 删除标志(0存在 1删除) |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("删除标志(0存在 1删除)") |
| | | private Byte isDeleted; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.mapper; |
| | | |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallDetailEntity; |
| | | import org.sxkj.gd.workorder.vo.GdDeviceCallDetailVO; |
| | | import org.sxkj.gd.workorder.excel.GdDeviceCallDetailExcel; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 设备调用详情表 Mapper 接口 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | public interface GdDeviceCallDetailMapper extends BaseMapper<GdDeviceCallDetailEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param gdDeviceCallDetail |
| | | * @return |
| | | */ |
| | | List<GdDeviceCallDetailVO> selectGdDeviceCallDetailPage(IPage page, GdDeviceCallDetailVO gdDeviceCallDetail); |
| | | |
| | | |
| | | /** |
| | | * 获取导出数据 |
| | | * |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | | List<GdDeviceCallDetailExcel> exportGdDeviceCallDetail(@Param("ew") Wrapper<GdDeviceCallDetailEntity> queryWrapper); |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.sxkj.gd.workorder.mapper.GdDeviceCallDetailMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="gdDeviceCallDetailResultMap" type="org.sxkj.gd.workorder.entity.GdDeviceCallDetailEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="call_id" property="callId"/> |
| | | <result column="device_status" property="deviceStatus"/> |
| | | <result column="occur_time" property="occurTime"/> |
| | | <result column="sort" property="sort"/> |
| | | <result column="area_code" property="areaCode"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_dept" property="createDept"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="status" property="status"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectGdDeviceCallDetailPage" resultMap="gdDeviceCallDetailResultMap"> |
| | | select * from ja_gd_device_call_detail where is_deleted = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="exportGdDeviceCallDetail" resultType="org.sxkj.gd.workorder.excel.GdDeviceCallDetailExcel"> |
| | | SELECT * FROM ja_gd_device_call_detail ${ew.customSqlSegment} |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.mapper; |
| | | |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallEntity; |
| | | import org.sxkj.gd.workorder.vo.GdDeviceCallVO; |
| | | import org.sxkj.gd.workorder.excel.GdDeviceCallExcel; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 设备调用表 Mapper 接口 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | public interface GdDeviceCallMapper extends BaseMapper<GdDeviceCallEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param gdDeviceCall |
| | | * @return |
| | | */ |
| | | List<GdDeviceCallVO> selectGdDeviceCallPage(IPage page, GdDeviceCallVO gdDeviceCall); |
| | | |
| | | |
| | | /** |
| | | * 获取导出数据 |
| | | * |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | | List<GdDeviceCallExcel> exportGdDeviceCall(@Param("ew") Wrapper<GdDeviceCallEntity> queryWrapper); |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.sxkj.gd.workorder.mapper.GdDeviceCallMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="gdDeviceCallResultMap" type="org.sxkj.gd.workorder.entity.GdDeviceCallEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="patrol_task_name" property="patrolTaskName"/> |
| | | <result column="task_department" property="taskDepartment"/> |
| | | <result column="task_initiator" property="taskInitiator"/> |
| | | <result column="flight_duration" property="flightDuration"/> |
| | | <result column="flight_distance" property="flightDistance"/> |
| | | <result column="device_name" property="deviceName"/> |
| | | <result column="plan_execute_time" property="planExecuteTime"/> |
| | | <result column="actual_execute_time" property="actualExecuteTime"/> |
| | | <result column="area_code" property="areaCode"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_dept" property="createDept"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="status" property="status"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectGdDeviceCallPage" resultMap="gdDeviceCallResultMap"> |
| | | select * from ja_gd_device_call where is_deleted = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="exportGdDeviceCall" resultType="org.sxkj.gd.workorder.excel.GdDeviceCallExcel"> |
| | | SELECT * FROM ja_gd_device_call ${ew.customSqlSegment} |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package org.sxkj.gd.workorder.param; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description 设备调用记录查询参数 |
| | | * @Author AIX |
| | | * @Date 2026/2/26 11:12 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class GdDeviceCallDetailPageParam implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 关联设备调用表id |
| | | */ |
| | | @ApiModelProperty(value = "关联设备调用表id") |
| | | private Long callId; |
| | | |
| | | } |
| New file |
| | |
| | | package org.sxkj.gd.workorder.param; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description 设备调用记录查询参数 |
| | | * @Author AIX |
| | | * @Date 2026/2/26 11:12 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class GdDeviceCallPageParam implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 巡查任务名称 |
| | | */ |
| | | @ApiModelProperty(value = "巡查任务名称") |
| | | private String patrolTaskName; |
| | | |
| | | /** |
| | | * 执行设备id |
| | | */ |
| | | @ApiModelProperty(value = "执行设备id") |
| | | private Long deviceId; |
| | | |
| | | /** |
| | | * 任务发起人 |
| | | */ |
| | | @ApiModelProperty(value = "任务发起人") |
| | | private String taskInitiator; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallDetailEntity; |
| | | import org.sxkj.gd.workorder.vo.GdDeviceCallDetailVO; |
| | | import org.sxkj.gd.workorder.excel.GdDeviceCallDetailExcel; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 设备调用详情表 服务类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | public interface IGdDeviceCallDetailService extends BaseService<GdDeviceCallDetailEntity> { |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param gdDeviceCallDetail |
| | | * @return |
| | | */ |
| | | IPage<GdDeviceCallDetailVO> selectGdDeviceCallDetailPage(IPage<GdDeviceCallDetailVO> page, GdDeviceCallDetailVO gdDeviceCallDetail); |
| | | |
| | | |
| | | /** |
| | | * 导出数据 |
| | | * |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | | List<GdDeviceCallDetailExcel> exportGdDeviceCallDetail(Wrapper<GdDeviceCallDetailEntity> queryWrapper); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import org.sxkj.gd.workorder.dto.GdDeviceCallDetailExternalSaveDTO; |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallEntity; |
| | | import org.sxkj.gd.workorder.vo.GdDeviceCallVO; |
| | | import org.sxkj.gd.workorder.excel.GdDeviceCallExcel; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 设备调用表 服务类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | public interface IGdDeviceCallService extends BaseService<GdDeviceCallEntity> { |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param gdDeviceCall |
| | | * @return |
| | | */ |
| | | IPage<GdDeviceCallVO> selectGdDeviceCallPage(IPage<GdDeviceCallVO> page, GdDeviceCallVO gdDeviceCall); |
| | | |
| | | /** |
| | | * 外部保存 |
| | | * @param dtos 设备调用外部保存参数 |
| | | * @return 保存结果 |
| | | */ |
| | | boolean saveGdDeviceCallExternal(List<GdDeviceCallDetailExternalSaveDTO> dtos); |
| | | |
| | | |
| | | /** |
| | | * 导出数据 |
| | | * |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | | List<GdDeviceCallExcel> exportGdDeviceCall(Wrapper<GdDeviceCallEntity> queryWrapper); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.service.impl; |
| | | |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallDetailEntity; |
| | | import org.sxkj.gd.workorder.vo.GdDeviceCallDetailVO; |
| | | import org.sxkj.gd.workorder.excel.GdDeviceCallDetailExcel; |
| | | import org.sxkj.gd.workorder.mapper.GdDeviceCallDetailMapper; |
| | | import org.sxkj.gd.workorder.service.IGdDeviceCallDetailService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 设备调用详情表 服务实现类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @Service |
| | | public class GdDeviceCallDetailServiceImpl extends BaseServiceImpl<GdDeviceCallDetailMapper, GdDeviceCallDetailEntity> implements IGdDeviceCallDetailService { |
| | | |
| | | @Override |
| | | public IPage<GdDeviceCallDetailVO> selectGdDeviceCallDetailPage(IPage<GdDeviceCallDetailVO> page, GdDeviceCallDetailVO gdDeviceCallDetail) { |
| | | return page.setRecords(baseMapper.selectGdDeviceCallDetailPage(page, gdDeviceCallDetail)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<GdDeviceCallDetailExcel> exportGdDeviceCallDetail(Wrapper<GdDeviceCallDetailEntity> queryWrapper) { |
| | | List<GdDeviceCallDetailExcel> gdDeviceCallDetailList = baseMapper.exportGdDeviceCallDetail(queryWrapper); |
| | | //gdDeviceCallDetailList.forEach(gdDeviceCallDetail -> { |
| | | // gdDeviceCallDetail.setTypeName(DictCache.getValue(DictEnum.YES_NO, GdDeviceCallDetail.getType())); |
| | | //}); |
| | | return gdDeviceCallDetailList; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.sxkj.gd.workorder.dto.GdDeviceCallDetailExternalSaveDTO; |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallDetailEntity; |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallEntity; |
| | | import org.sxkj.gd.workorder.entity.GdManageDeviceEntity; |
| | | import org.sxkj.gd.workorder.entity.GdPatrolTaskEntity; |
| | | import org.sxkj.gd.workorder.service.IGdDeviceCallDetailService; |
| | | import org.sxkj.gd.workorder.service.IGdManageDeviceService; |
| | | import org.sxkj.gd.workorder.service.IGdPatrolTaskService; |
| | | import org.sxkj.gd.workorder.vo.GdDeviceCallVO; |
| | | import org.sxkj.gd.workorder.excel.GdDeviceCallExcel; |
| | | import org.sxkj.gd.workorder.mapper.GdDeviceCallMapper; |
| | | import org.sxkj.gd.workorder.service.IGdDeviceCallService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.sxkj.system.cache.SysCache; |
| | | import org.sxkj.system.cache.UserCache; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 设备调用表 服务实现类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class GdDeviceCallServiceImpl extends BaseServiceImpl<GdDeviceCallMapper, GdDeviceCallEntity> implements IGdDeviceCallService { |
| | | |
| | | private final IGdDeviceCallDetailService gdDeviceCallDetailService; |
| | | private final IGdPatrolTaskService gdPatrolTaskService; |
| | | private final IGdManageDeviceService gdManageDeviceService; |
| | | |
| | | @Override |
| | | public IPage<GdDeviceCallVO> selectGdDeviceCallPage(IPage<GdDeviceCallVO> page, GdDeviceCallVO gdDeviceCall) { |
| | | return page.setRecords(baseMapper.selectGdDeviceCallPage(page, gdDeviceCall)); |
| | | } |
| | | |
| | | @Override |
| | | public boolean saveGdDeviceCallExternal(List<GdDeviceCallDetailExternalSaveDTO> dtos) { |
| | | |
| | | // 保存设备调用 |
| | | GdPatrolTaskEntity patrolTask = gdPatrolTaskService.getById(dtos.get(0).getPatrolTaskId()); |
| | | if (patrolTask == null) { |
| | | return false; |
| | | } |
| | | GdDeviceCallEntity callEntity = new GdDeviceCallEntity(); |
| | | callEntity.setId(patrolTask.getId()); |
| | | callEntity.setPatrolTaskName(patrolTask.getPatrolTaskName()); |
| | | callEntity.setTaskDepartment(SysCache.getDeptName(patrolTask.getCreateDept())); |
| | | callEntity.setTaskInitiator(UserCache.getUser(patrolTask.getCreateUser()).getName()); |
| | | callEntity.setPlanExecuteTime(patrolTask.getExecuteTime()); |
| | | callEntity.setActualExecuteTime(dtos.get(0).getOccurTime());// 第一条数据的发生时间 |
| | | |
| | | // 计算飞行时长(毫秒转分钟) |
| | | // 计算飞行时长(处理可能的空值情况) |
| | | Date startTime = dtos.get(0).getOccurTime(); |
| | | Date endTime = dtos.get(dtos.size() - 1).getOccurTime(); |
| | | |
| | | if (startTime == null || endTime == null) { |
| | | log.warn("时间数据不完整,无法计算飞行时长"); |
| | | callEntity.setFlightDuration(0L); |
| | | } else { |
| | | long flightDurationMs = endTime.getTime() - startTime.getTime(); |
| | | // 可以选择不同的时间单位 |
| | | callEntity.setFlightDuration(flightDurationMs / 1000); // 秒 |
| | | } |
| | | |
| | | |
| | | // 计算总飞行距离 |
| | | double totalDistance = dtos.stream() |
| | | .mapToDouble(GdDeviceCallDetailExternalSaveDTO::getFlightDistance) |
| | | .sum(); |
| | | callEntity.setFlightDistance(totalDistance); |
| | | |
| | | // 设备ID&名称 |
| | | String deviceSn = dtos.get(0).getDeviceSn(); |
| | | Long deviceId = null; |
| | | String deviceName = null; |
| | | |
| | | if (StringUtil.hasText(deviceSn)) { |
| | | GdManageDeviceEntity gdManageDevice = gdManageDeviceService.getOne( |
| | | Wrappers.lambdaQuery(GdManageDeviceEntity.class) |
| | | .eq(GdManageDeviceEntity::getDeviceSn, deviceSn), |
| | | false |
| | | ); |
| | | deviceId = gdManageDevice.getId(); |
| | | deviceName = gdManageDevice.getDeviceName(); |
| | | } |
| | | |
| | | callEntity.setDeviceId(deviceId); |
| | | callEntity.setDeviceName(deviceName); |
| | | |
| | | // 保存设备调用详情 |
| | | if (baseMapper.insert(callEntity) <= 0) { |
| | | return false; |
| | | } |
| | | |
| | | List<GdDeviceCallDetailEntity> detailEntities = dtos.stream().map(dto -> { |
| | | GdDeviceCallDetailEntity entity = new GdDeviceCallDetailEntity(); |
| | | entity.setCallId(dto.getPatrolTaskId()); |
| | | entity.setDeviceStatus(dto.getDeviceStatus()); |
| | | entity.setOccurTime(dto.getOccurTime()); |
| | | entity.setFlightDistance(dto.getFlightDistance()); |
| | | entity.setSort(dto.getSort()); |
| | | return entity; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | return gdDeviceCallDetailService.saveBatch(detailEntities); |
| | | } |
| | | |
| | | @Override |
| | | public List<GdDeviceCallExcel> exportGdDeviceCall(Wrapper<GdDeviceCallEntity> queryWrapper) { |
| | | List<GdDeviceCallExcel> gdDeviceCallList = baseMapper.exportGdDeviceCall(queryWrapper); |
| | | //gdDeviceCallList.forEach(gdDeviceCall -> { |
| | | // gdDeviceCall.setTypeName(DictCache.getValue(DictEnum.YES_NO, GdDeviceCall.getType())); |
| | | //}); |
| | | return gdDeviceCallList; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.vo; |
| | | |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallDetailEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 设备调用详情表 视图实体类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class GdDeviceCallDetailVO extends GdDeviceCallDetailEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.vo; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 设备调用表 视图实体类 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | @Data |
| | | public class GdDeviceCallVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @JsonSerialize( |
| | | using = ToStringSerializer.class |
| | | ) |
| | | @ApiModelProperty("主键id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 巡查任务名称 |
| | | */ |
| | | @ApiModelProperty(value = "巡查任务名称") |
| | | private String patrolTaskName; |
| | | /** |
| | | * 发起任务部门 |
| | | */ |
| | | @ApiModelProperty(value = "发起任务部门") |
| | | private String taskDepartment; |
| | | /** |
| | | * 任务发起人 |
| | | */ |
| | | @ApiModelProperty(value = "任务发起人") |
| | | private String taskInitiator; |
| | | /** |
| | | * 飞行时长 |
| | | */ |
| | | @ApiModelProperty(value = "飞行时长") |
| | | private String flightDuration; |
| | | /** |
| | | * 飞行里程(米) |
| | | */ |
| | | @ApiModelProperty(value = "飞行里程(米)") |
| | | private Integer flightDistance; |
| | | /** |
| | | * 执行设备id |
| | | */ |
| | | @ApiModelProperty(value = "执行设备id") |
| | | private Long deviceId; |
| | | /** |
| | | * 执行设备名称 |
| | | */ |
| | | @ApiModelProperty(value = "执行设备名称") |
| | | private String deviceName; |
| | | /** |
| | | * 计划执行时间 |
| | | */ |
| | | @ApiModelProperty(value = "计划执行时间") |
| | | private Date planExecuteTime; |
| | | /** |
| | | * 实际执行时间 |
| | | */ |
| | | @ApiModelProperty(value = "实际执行时间") |
| | | private Date actualExecuteTime; |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallDetailEntity; |
| | | import org.sxkj.gd.workorder.vo.GdDeviceCallDetailVO; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 设备调用详情表 包装类,返回视图层所需的字段 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | public class GdDeviceCallDetailWrapper extends BaseEntityWrapper<GdDeviceCallDetailEntity, GdDeviceCallDetailVO> { |
| | | |
| | | public static GdDeviceCallDetailWrapper build() { |
| | | return new GdDeviceCallDetailWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public GdDeviceCallDetailVO entityVO(GdDeviceCallDetailEntity gdDeviceCallDetail) { |
| | | GdDeviceCallDetailVO gdDeviceCallDetailVO = Objects.requireNonNull(BeanUtil.copy(gdDeviceCallDetail, GdDeviceCallDetailVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(gdDeviceCallDetail.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(gdDeviceCallDetail.getUpdateUser()); |
| | | //gdDeviceCallDetailVO.setCreateUserName(createUser.getName()); |
| | | //gdDeviceCallDetailVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return gdDeviceCallDetailVO; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.workorder.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.sxkj.gd.workorder.entity.GdDeviceCallEntity; |
| | | import org.sxkj.gd.workorder.vo.GdDeviceCallVO; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 设备调用表 包装类,返回视图层所需的字段 |
| | | * |
| | | * @author Aix |
| | | * @since 2026-02-26 |
| | | */ |
| | | public class GdDeviceCallWrapper extends BaseEntityWrapper<GdDeviceCallEntity, GdDeviceCallVO> { |
| | | |
| | | public static GdDeviceCallWrapper build() { |
| | | return new GdDeviceCallWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public GdDeviceCallVO entityVO(GdDeviceCallEntity gdDeviceCall) { |
| | | GdDeviceCallVO gdDeviceCallVO = Objects.requireNonNull(BeanUtil.copy(gdDeviceCall, GdDeviceCallVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(gdDeviceCall.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(gdDeviceCall.getUpdateUser()); |
| | | //gdDeviceCallVO.setCreateUserName(createUser.getName()); |
| | | //gdDeviceCallVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return gdDeviceCallVO; |
| | | } |
| | | |
| | | |
| | | } |