Merge remote-tracking branch 'origin/master'
44 files modified
9 files added
| | |
| | | String PATROL_TASK_PREFIX = "RW"; |
| | | //线索事件编号前缀 |
| | | String EVENT_NUM_PREFIX = "CE"; |
| | | // 机构前缀 |
| | | String ORG_PREFIX = "JG"; |
| | | |
| | | // 订单号redisKEY |
| | | String ORDER_REDIS_KEY = "wordOrderInfo"; |
| | |
| | | String PATROL_TASK_KEY = "patrolTaskInfo"; |
| | | //线索事件编号key |
| | | String EVENT_NUM_KEY = "eventNum"; |
| | | // 机构编码 |
| | | String ORG_CODE = "orgCode"; |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 订单号生成 |
| | | * 订单号生成 带时分秒 |
| | | * |
| | | * @param prefKey 缓存前缀key |
| | | * @return 订单号生成 |
| | |
| | | return currentTime + lastNum; |
| | | } |
| | | |
| | | /** |
| | | * 订单号生成 带时间 |
| | | * |
| | | * @param prefKey 缓存前缀key |
| | | * @return 订单号生成 |
| | | */ |
| | | public static String initOrderNum2(String prefKey) { |
| | | Integer num = getRedisNumValue(prefKey); |
| | | String lastNum = formatDayOrderNumLast(3, num + 1); |
| | | Date date = new Date(); |
| | | String currentTime = DateUtil.format(date, CommonConstant.yyyyMMdd); |
| | | return currentTime + lastNum; |
| | | } |
| | | |
| | | } |
| | |
| | | @TableField("md5") |
| | | private String md5; |
| | | |
| | | /** |
| | | * 是否生成过ai 图 0 =未生成过 1=已生成过 |
| | | */ |
| | | private Integer isGenerateAiImg; |
| | | @TableField("is_deleted") |
| | | private Integer isDeleted; |
| | | |
| | | //区域 |
| | | @TableField(exist = false) |
| | | private String areaCode; |
| | | |
| | | @TableField(exist = false) |
| | | private List<String> wayLineJobIds; |
| | | |
| | | public String getMd5() { |
| | | String link = this.link; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.annotation.ApiLog; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.annotation.PreAuth; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.DateTimeUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.sxkj.common.constant.CommonConstant; |
| | | import org.sxkj.common.model.ResponseResult; |
| | | import org.sxkj.common.model.TimeRange; |
| | | import org.sxkj.common.utils.HeaderUtils; |
| | | import org.sxkj.common.utils.TimeRangeUtils; |
| | | import org.sxkj.resource.dto.AttachDto; |
| | | import org.sxkj.resource.dto.WaylineJobInfoQueryDto; |
| | | import org.sxkj.resource.dto.WaylineJobInfoQueryParam; |
| | | import org.sxkj.resource.entity.Attach; |
| | | import org.sxkj.resource.feign.IAttachClient; |
| | | import org.sxkj.resource.param.AttachPageParam; |
| | | import org.sxkj.resource.param.AttachParam; |
| | | import org.sxkj.resource.service.IAttachService; |
| | | import org.sxkj.resource.vo.*; |
| | | import org.sxkj.system.vo.TreeVo; |
| | | import org.sxkj.resource.vo.AttachVO; |
| | | import org.sxkj.resource.vo.AttachmentDownloadParam; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE; |
| | | |
| | | /** |
| | | * 附件表 控制器 |
| | |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "附件分页", notes = "传入attach") |
| | | public R<IPage<Attach>> list(Attach attach, Query query) { |
| | | List<String> wayLineJobIds = attach.getWayLineJobIds(); |
| | | QueryWrapper<Attach> queryWrapper1 = Condition.getQueryWrapper(attach); |
| | | QueryWrapper<Attach> queryWrapper = queryWrapper1.in(!CollectionUtils.isEmpty(wayLineJobIds), "wayline_job_id", wayLineJobIds); |
| | | String patrolTaskId = attach.getPatrolTaskId(); |
| | | QueryWrapper<Attach> queryWrapper1 = Condition.getQueryWrapper(attach); |
| | | QueryWrapper<Attach> queryWrapper = queryWrapper1.eq(!StringUtils.isEmpty(patrolTaskId), "patrol_task_id", patrolTaskId); |
| | | queryWrapper.eq("is_deleted", 0); |
| | | IPage<Attach> pages = attachService.page(Condition.getPage(query), queryWrapper); |
| | | return R.data(pages); |
| | |
| | | @ApiModelProperty(value = "附件类型: 1=巡查类文档,2=巡检类文档,3=安保类文档,4=文旅类文档,5=采集数据类文档") |
| | | private Integer resultType; |
| | | |
| | | @ApiModelProperty(value = "附件大小") |
| | | private Long attachSize; |
| | | |
| | | /** |
| | | * 附件域名 |
| | | */ |
| | | @ApiModelProperty(value = "附件域名") |
| | | private String domainUrl; |
| | | |
| | | /** |
| | | * 附件拓展名 |
| | | */ |
| | | @ApiModelProperty(value = "附件拓展名") |
| | | private String extension; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | <if test="attach.resultType!=null"> |
| | | and result_type = #{attach.resultType} |
| | | </if> |
| | | and result_type in (1,2,3,4,5) |
| | | order by create_time desc,id desc |
| | | </select> |
| | | <select id="findAiAttachImages" resultType="org.sxkj.resource.vo.AttachVO"> |
| | |
| | | and info.is_deleted = 0 |
| | | and attach.is_thumbnail = 0 |
| | | and (rela.is_deleted = 0 or rela.is_deleted is null) |
| | | and attach.is_generate_ai_img = 0 |
| | | and wj.`status` in (2, 3, 5, 6, 7) |
| | | <if test="attach.jobName!=null and attach.jobName!=''"> |
| | | and wj.name like concat('%',#{attach.jobName},'%') |
| | |
| | | a.is_thumbnail, |
| | | a.longitude, |
| | | a.latitude, |
| | | a.is_generate_ai_img, |
| | | a.media_category, |
| | | a.media_create_time, |
| | | a.is_deleted |
| | |
| | | @Override |
| | | public Long findResultNumByJobId(String jobId) { |
| | | return baseMapper.selectCount(Wrappers.<Attach>lambdaQuery() |
| | | .eq(Attach::getIsGenerateAiImg, 0) |
| | | .eq(Attach::getIsDeleted, 0) |
| | | .eq(Attach::getPatrolTaskId, jobId).in(Attach::getResultType, AttachResultTypeEnum.getTheAttachmentType())); |
| | | } |
| | |
| | | public Boolean downloadByByte(AttachmentDownloadParam param, OutputStream outputStream) throws IOException { |
| | | // 如果附件id集合并且任务id集合参数都为空,就判断起止时间是否都有为空,如果都为空,则返回错误 |
| | | param.setAreaCode(HeaderUtils.formatAreaCode(param.getAreaCode())); |
| | | if (CollectionUtils.isEmpty(param.getAttachIds()) && CollectionUtils.isEmpty(param.getWayLineJobIds())) { |
| | | if (CollectionUtils.isEmpty(param.getAttachIds())) { |
| | | // 判断起止时间是否为空 |
| | | if (StringUtils.isEmpty(param.getStartTime()) || StringUtils.isEmpty(param.getEndTime())) { |
| | | return false; |
| | |
| | | @ApiModelProperty(value = "下载类型,sjzx:数据中心,aisb:ai识别,htsjzx:后台数据中心") |
| | | String type; |
| | | |
| | | @ApiModelProperty(value = "任务id集合") |
| | | List<String> wayLineJobIds; |
| | | |
| | | // 开始时间 |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | |
| | | |
| | | @ApiModelProperty(value = "区域编码") |
| | | String areaCode; |
| | | // dockSn |
| | | @ApiModelProperty(value = "设备sn") |
| | | String dockSn; |
| | | // 任务名称 |
| | | @ApiModelProperty(value = "任务名称") |
| | | private String jobName; |
| | | // 文件名称 |
| | | @ApiModelProperty(value = "文件名称") |
| | | private String fileName; |
| | | // 文件类型 |
| | | @ApiModelProperty(value = "文件类型 visable:可见光,ir:红外 ") |
| | | private String fileType; |
| | | // 文件格式 成果类型:0图片,1=视频,2=ai,3=三维,4=正射,5=全景, 6=图片压缩小(后缀small),7=图片压缩中(后缀show),8视频一帧图,9视频压缩,10ai压缩小,11ai压缩中,12水印 |
| | | @ApiModelProperty(value = "文件格式 0图片,1=视频 ,2=ai,4=正射,5=全景") |
| | | private String resultType; |
| | | |
| | | @ApiModelProperty(value = "下载结构带不带任务文件夹") |
| | | private boolean withFolder = false; |
| | | |
| | | @ApiModelProperty(value = "照片结果类型") |
| | | private List<Integer> resultTypes; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 实体类 |
| | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "机构编码") |
| | | private String deptCode; |
| | | |
| | | /** |
| | | * 租户ID |
| | |
| | | @ApiModelProperty(value = "状态 0:禁用 1:启用") |
| | | private Integer status; |
| | | |
| | | @DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) |
| | | @JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | @DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) |
| | | @JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) |
| | | @ApiModelProperty(value = "更新时间") |
| | | private Date updateTime; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 行政区划表实体类 |
| | |
| | | @ApiModelProperty(value = "状态 0:禁用 1:启用 ") |
| | | private Integer status; |
| | | |
| | | @DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) |
| | | @JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | @DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) |
| | | @JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss" ) |
| | | @ApiModelProperty(value = "更新时间") |
| | | private Date updateTime; |
| | | |
| | | } |
| | |
| | | package org.sxkj.fw.cockpit.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.springframework.stereotype.Service; |
| | | import org.sxkj.fw.cockpit.service.ICockpitService; |
| | | import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | @Service |
| | | public class CockpitServiceImpl implements ICockpitService { |
| | | |
| | | @Resource |
| | | private IFwDroneAlarmRecordService fwDroneAlarmRecordService; |
| | | private IFwDroneAlarmRecordService fwDroneAlarmRecordService; |
| | | |
| | | @Resource |
| | | private IFwDeviceService fwDeviceService; |
| | | private IFwDeviceService fwDeviceService; |
| | | |
| | | @Resource |
| | | private IFwEffectEvalService fwEffectEvalService; |
| | | private IFwEffectEvalService fwEffectEvalService; |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public boolean interferenceAndExpulsion(FwEffectEvalParam fwEffectEvalParam) { |
| | | // 告警记录 |
| | | FwDroneAlarmRecordEntity alarmRecordEntity = fwDroneAlarmRecordService.getById(fwEffectEvalParam.getAlarmRecordId()); |
| | | // 设备信息 |
| | | FwDeviceEntity device = fwDeviceService.getById(alarmRecordEntity.getDeviceId()); |
| | | FwEffectEvalEntity fwEffectEvalEntity = new FwEffectEvalEntity(); |
| | | // 反制效果 |
| | | FwEffectEvalEntity one = fwEffectEvalService.getOne(Wrappers.<FwEffectEvalEntity>lambdaQuery().eq(FwEffectEvalEntity::getAlarmRecordId, fwEffectEvalParam.getAlarmRecordId())); |
| | | FwEffectEvalEntity fwEffectEvalEntity = Optional.ofNullable(one) |
| | | .orElse(new FwEffectEvalEntity()); |
| | | |
| | | // 告警记录相关字段 |
| | | fwEffectEvalEntity.setAlarmRecordId(fwEffectEvalParam.getAlarmRecordId()); |
| | |
| | | fwEffectEvalEntity.setAreaCode(device.getAreaCode()); |
| | | |
| | | // 反制效果及工作模式(从参数获取,否则使用默认值) |
| | | fwEffectEvalEntity.setCounterEffect( "1"); // 1.success/2.fail |
| | | fwEffectEvalEntity.setCounterEffect("1"); // 1.success/2.fail |
| | | fwEffectEvalEntity.setCoverRadiusM(2500); // 覆盖范围(米) |
| | | fwEffectEvalEntity.setWorkMode( "1"); // 1.机动/2.固定 |
| | | fwEffectEvalEntity.setWorkMode("1"); // 1.机动/2.固定 |
| | | fwDroneAlarmRecordService.updateById(alarmRecordEntity); |
| | | return fwEffectEvalService.saveOrUpdate(fwEffectEvalEntity); |
| | | } |
| | |
| | | // 设备统计 |
| | | AlarmStatisticsVO alarmStatisticsVO = fwDeviceService.statisticalDeviceAtt(); |
| | | // 告警统计 |
| | | AlarmStatisticsVO alarmStatistics = fwDroneAlarmRecordService.alarmTypeStatistics(); |
| | | AlarmStatisticsVO alarmStatistics = fwDroneAlarmRecordService.alarmTypeStatistics(); |
| | | alarmStatisticsVO.setHistoryAlarmCount(alarmStatistics.getHistoryAlarmCount()); |
| | | alarmStatisticsVO.setRealTimeAlarmCount(alarmStatistics.getRealTimeAlarmCount()); |
| | | return alarmStatisticsVO; |
| | |
| | | @ApiOperation(value = "列表", notes = "传入isAreaSelect、areaId、status") |
| | | public R<List<FwDeviceVO>> list(@RequestParam(value = "isAreaSelect", required = false) Integer isAreaSelect, |
| | | @RequestParam(value = "areaId", required = false) Long areaId, |
| | | @RequestParam(value = "status", required = false) Integer status) { |
| | | List<FwDeviceEntity> list = fwDeviceService.selectFwDeviceList(isAreaSelect, areaId, status); |
| | | @RequestParam(value = "status", required = false) Integer status, |
| | | @RequestParam(value = "isTrack", required = false) Integer isTrack) { |
| | | List<FwDeviceEntity> list = fwDeviceService.selectFwDeviceList(isAreaSelect, areaId, status, isTrack); |
| | | FwDeviceWrapper wrapper = FwDeviceWrapper.build(); |
| | | return R.data(list.stream().map(wrapper::entityVO).collect(Collectors.toList())); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<FwDeviceEntity> selectFwDeviceList(@Param("isAreaSelect") Integer isAreaSelect, @Param("areaId") Long areaId, |
| | | @Param("status") Integer status); |
| | | @Param("status") Integer status, @Param("isTrack") Integer isTrack); |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | <select id="selectFwDevicePage" resultMap="fwDeviceResultMap"> |
| | | select |
| | | *, |
| | | ( |
| | | select |
| | | count(*) |
| | | from |
| | | ja_fw_device_track tmp |
| | | where |
| | | ja_fw_device.id = tmp.device_id |
| | | ) out_count |
| | | from |
| | | ja_fw_device |
| | | select * from ja_fw_device |
| | | <where> |
| | | is_deleted = 0 |
| | | <if test="param2.id != null and param2.id != ''"> |
| | |
| | | <if test="status != null"> |
| | | and status = #{status} |
| | | </if> |
| | | <if test="isTrack != null and isTrack == 1"> |
| | | and (SELECT COUNT(*) FROM ja_fw_device_track tmp WHERE ja_fw_device.id = tmp.device_id) > 0 |
| | | </if> |
| | | <if test="isTrack != null and isTrack == 2"> |
| | | and (SELECT COUNT(*) FROM ja_fw_device_track tmp WHERE ja_fw_device.id = tmp.device_id) = 0 |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | * @param status 设备状态 |
| | | * @return |
| | | */ |
| | | List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status); |
| | | List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status, Integer isTrack); |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status) { |
| | | return baseMapper.selectFwDeviceList(isAreaSelect, areaId, status); |
| | | public List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status, Integer isTrack) { |
| | | return baseMapper.selectFwDeviceList(isAreaSelect, areaId, status, isTrack); |
| | | } |
| | | |
| | | |
| | |
| | | and dar.area_name like CONCAT('%', #{param2.areaName}, '%') |
| | | </if> |
| | | </where> |
| | | order by favorited desc |
| | | </select> |
| | | |
| | | |
| | |
| | | */ |
| | | @ApiModelProperty(value = "飞手姓名") |
| | | private String flyerName; |
| | | |
| | | @ApiModelProperty(value = "飞手Id(星图)") |
| | | private String flyerId; |
| | | /** |
| | | * 飞手电话(唯一) |
| | | */ |
| | | @ApiModelProperty(value = "飞手电话(唯一)") |
| | | private String flyerPhone; |
| | | |
| | | @ApiModelProperty(value = "区域cod :1200,1201,120105") |
| | | private String regionCode; |
| | | /** |
| | | * 飞行时长(小时) |
| | | */ |
| | |
| | | <select id="selectGdFlyerPage" resultMap="gdFlyerVOResultMap"> |
| | | select * from ja_gd_flyer |
| | | <where> |
| | | is_deleted = 0 |
| | | <if test="param2.flyerName != null and param2.flyerName != ''"> |
| | | and flyer_name like concat('%',#{param2.flyerName},'%') |
| | | </if> |
| | |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "飞手Id(星图)") |
| | | private String flyerId; |
| | | |
| | | /** |
| | | * 飞手姓名 |
| | | */ |
| | |
| | | */ |
| | | @ApiModelProperty(value = "飞手电话(唯一)") |
| | | private String flyerPhone; |
| | | |
| | | @ApiModelProperty(value = "区域cod :1200,1201,120105") |
| | | private String regionCode; |
| | | /** |
| | | * 飞行时长(小时) |
| | | */ |
| | |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "飞手Id(星图)") |
| | | private String flyerId; |
| | | /** |
| | | * 飞手姓名 |
| | | */ |
| | |
| | | GdSupplyDemandEntity detail = gdSupplyDemandService.detailSupplyDemand(gdSupplyDemand); |
| | | return R.data(GdSupplyDemandWrapper.build().entityVO(detail)); |
| | | } |
| | | // /** |
| | | // * 供需需求信息表 分页 |
| | | // */ |
| | | // @GetMapping("/list") |
| | | // @ApiOperationSupport(order = 2) |
| | | // @ApiOperation(value = "分页", notes = "传入gdSupplyDemand") |
| | | // public R<IPage<GdSupplyDemandVO>> list(GdSupplyDemandDTO gdSupplyDemand, Query query) { |
| | | // IPage<GdSupplyDemandEntity> pages = gdSupplyDemandService.selectGdSupplyDemandList(Condition.getPage(query), gdSupplyDemand); |
| | | // return R.data(GdSupplyDemandWrapper.build().pageVO(pages)); |
| | | // } |
| | | |
| | | /** |
| | | * 供需需求信息表 自定义分页 |
| | |
| | | IPage<GdSupplyDemandVO> pages = gdSupplyDemandService.selectGdSupplyDemandPage(Condition.getPage(query), gdSupplyDemand); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | // /** |
| | | // * 供需需求信息表 新增 |
| | | // */ |
| | | // @PostMapping("/save") |
| | | // @ApiOperationSupport(order = 4) |
| | | // @ApiOperation(value = "新增", notes = "传入gdSupplyDemand") |
| | | // public R save(@Valid @RequestBody GdSupplyDemandEntity gdSupplyDemand) { |
| | | // return R.status(gdSupplyDemandService.save(gdSupplyDemand)); |
| | | // } |
| | | |
| | | // /** |
| | | // * 供需需求信息表 修改 |
| | | // */ |
| | | // @PostMapping("/update") |
| | | // @ApiOperationSupport(order = 5) |
| | | // @ApiOperation(value = "修改", notes = "传入gdSupplyDemand") |
| | | // public R update(@Valid @RequestBody GdSupplyDemandEntity gdSupplyDemand) { |
| | | // return R.status(gdSupplyDemandService.updateById(gdSupplyDemand)); |
| | | // } |
| | | |
| | | /** |
| | | * 供需需求信息表 新增或修改 |
| | |
| | | |
| | | |
| | | <select id="selectGdDataObjectionPage" resultMap="gdDataObjectionResultMap"> |
| | | select do.*, GROUP_CONCAT(da.attach_name SEPARATOR ',') as attach_names |
| | | from ja_gd_data_objection do |
| | | left join ja_gd_data_objection_attachment da on do.id = da.objection_id |
| | | select |
| | | do.*, |
| | | GROUP_CONCAT(da.attach_name SEPARATOR ',') as attach_names, |
| | | bd.dept_name as create_dept_name |
| | | from |
| | | ja_gd_data_objection do |
| | | left join |
| | | ja_gd_data_objection_attachment da |
| | | on do.id = da.objection_id |
| | | left join blade_dept bd on bd.id = do.create_dept |
| | | <where> |
| | | do.is_deleted = 0 |
| | | <if test="param2.title != null and param2.title != ''"> |
| | | and do.title like concat('%',#{param2.title},'%') |
| | | </if> |
| | |
| | | */ |
| | | package org.sxkj.gd.orderdata.service.impl; |
| | | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.sxkj.gd.orderdata.dto.GdDataObjectionDTO; |
| | | import org.sxkj.gd.orderdata.entity.GdDataObjectionAttachmentEntity; |
| | |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.sxkj.gd.orderdata.wrapper.GdDataObjectionWrapper; |
| | | import org.sxkj.gd.orderdata.wrapper.GdSupplyDemandAuditAttachmentWrapper; |
| | | import org.sxkj.system.cache.SysCache; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | @Override |
| | | public boolean saveOrUpdateDataObjection(GdDataObjectionDTO gdDataEvaluationDTO) { |
| | | GdDataObjectionEntity gdDataObjectionEntity = GdDataObjectionWrapper.build().entityDTO(gdDataEvaluationDTO); |
| | | if(gdDataObjectionEntity.getObjectionStatus().equals("2")){ |
| | | String deptName = SysCache.getDeptName(Long.valueOf(AuthUtil.getDeptId())); |
| | | gdDataObjectionEntity.setHandleUnit(deptName); |
| | | } |
| | | boolean result = saveOrUpdate(gdDataObjectionEntity); |
| | | if (result) { |
| | | if (gdDataEvaluationDTO.getAttachmentList() != null) { |
| | |
| | | */ |
| | | @ApiModelProperty(value = "创建部门") |
| | | private Long createDept; |
| | | |
| | | /** |
| | | * 创建部门 |
| | | */ |
| | | @ApiModelProperty(value = "创建部门") |
| | | private String createDeptName; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | |
| | | 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; |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入gdPatrolTask") |
| | | public R<IPage<GdPatrolTaskVO>> page(GdPatrolTaskPageParam gdPatrolTask, Query query) { |
| | | IPage<GdPatrolTaskVO> pages = gdPatrolTaskService.selectGdPatrolTaskPage( |
| | | Condition.getPage(query), |
| | | gdPatrolTask, |
| | | SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())) |
| | | ); |
| | | IPage<GdPatrolTaskVO> pages = gdPatrolTaskService.selectGdPatrolTaskPage(Condition.getPage(query), gdPatrolTask); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | }); |
| | | return R.status(gdPatrolTaskService.savePatrolTask(taskEntityList)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiIgnore |
| | | public void exportGdPatrolTask(@ApiIgnore @RequestParam Map<String, Object> gdPatrolTask, BladeUser bladeUser, HttpServletResponse response) { |
| | | QueryWrapper<GdPatrolTaskEntity> queryWrapper = Condition.getQueryWrapper(gdPatrolTask, GdPatrolTaskEntity.class); |
| | | //if (!AuthUtil.isAdministrator()) { |
| | | // if (!AuthUtil.isAdministrator()) { |
| | | // queryWrapper.lambda().eq(GdPatrolTask::getTenantId, bladeUser.getTenantId()); |
| | | //} |
| | | queryWrapper.lambda().eq(GdPatrolTaskEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
| | |
| | | @ApiOperationSupport(order = 12) |
| | | @ApiOperation(value = "更新单个巡查任务信息", notes = "传入巡查任务信息") |
| | | public R republish(@Valid @RequestBody GdPatrolTaskUpdateParam gdPatrolTask) { |
| | | GdPatrolTaskEntity gdPatrolTaskEntity = Objects.requireNonNull(BeanUtil.copy(gdPatrolTask, GdPatrolTaskEntity.class)); |
| | | GdPatrolTaskEntity gdPatrolTaskEntity = Objects.requireNonNull(BeanUtil.copy(gdPatrolTask, GdPatrolTaskEntity.class)); |
| | | boolean result = gdPatrolTaskService.republishPatrolTask(gdPatrolTaskEntity); |
| | | return R.status(result); |
| | | } |
| | |
| | | /** |
| | | * 设备状态:{0:"在线",1:"离线"} |
| | | */ |
| | | @ApiModelProperty(value = "设备状态:{0:\"在线\",1:\"离线\"}") |
| | | @ApiModelProperty(value = "设备状态:{0:在线,1:离线}") |
| | | private Long modeCode; |
| | | /** |
| | | * 保险过期时间 |
| | |
| | | <mapper namespace="org.sxkj.gd.workorder.mapper.GdManageDeviceMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="gdManageDeviceResultMap" type="org.sxkj.gd.workorder.entity.GdManageDeviceEntity"> |
| | | <resultMap id="gdManageDeviceResultMap" type="org.sxkj.gd.workorder.vo.GdManageDeviceVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="device_sn" property="deviceSn"/> |
| | | <result column="device_name" property="deviceName"/> |
| | | <result column="nickname" property="nickname"/> |
| | | <result column="device_type" property="deviceType"/> |
| | | <result column="device_payload" property="devicePayload"/> |
| | | <result column="longitude" property="longitude"/> |
| | | <result column="latitude" property="latitude"/> |
| | | <result column="firmware_version" property="firmwareVersion"/> |
| | | <result column="child_sn" property="childSn"/> |
| | | <result column="mode_code" property="modeCode"/> |
| | | <result column="insure_expired_time" property="insureExpiredTime"/> |
| | | <result column="traffic_remaining" property="trafficRemaining"/> |
| | | <result column="traffic_expire_time" property="trafficExpireTime"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="device_dept_name" property="deviceDeptName"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectGdManageDevicePage" resultMap="gdManageDeviceResultMap"> |
| | | select |
| | | id, |
| | | device_sn, |
| | | device_name, |
| | | nickname, |
| | | device_payload, |
| | | longitude, |
| | | latitude, |
| | | location |
| | | md.id, |
| | | md.device_sn, |
| | | md.device_name, |
| | | md.nickname, |
| | | md.mode_code, |
| | | md.device_payload, |
| | | md.longitude, |
| | | md.latitude, |
| | | md.location, |
| | | md.device_type, |
| | | bd.dept_name as device_dept_name |
| | | from |
| | | ja_gd_manage_device |
| | | ja_gd_manage_device md |
| | | left join |
| | | blade_dept bd on md.create_dept = bd.id |
| | | <where> |
| | | <if test="deviceName != null and deviceName != ''"> |
| | | and device_name like concat('%',#{deviceName},'%') |
| | | and md.is_deleted = 0 |
| | | <if test="param2.deviceName != null and param2.deviceName != ''"> |
| | | and md.nickname like concat('%',#{param2.deviceName},'%') |
| | | </if> |
| | | <if test="nickname != null and nickname != ''"> |
| | | and nickname like concat('%',#{nickname},'%') |
| | | <if test="param2.deptId != null"> |
| | | and md.create_dept = #{param2.deptId} |
| | | </if> |
| | | <if test="deptId != null"> |
| | | and create_dept = #{deptId} |
| | | <if test="param2.location != null and param2.location != ''"> |
| | | and md.location like concat('%',#{param2.location},'%') |
| | | </if> |
| | | <if test="location != null and location != ''"> |
| | | and location like concat('%',#{location},'%') |
| | | </if> |
| | | and is_deleted = 0 |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="selectGdTaskResultListByPatrolTaskId" resultMap="gdTaskResultResultMap"> |
| | | select tr.*, |
| | | SELECT tr.*, |
| | | IFNULL(bu.real_name, bu.name) as distribute_user_name, |
| | | bd.dept_name as distribute_dept_name |
| | | from ja_gd_task_result tr |
| | | left join ja_gd_clue_event ce on ce.result_id = tr.id and ce.is_deleted = 0 |
| | | left join blade_user bu on bu.id = ce.create_user and bu.is_deleted = 0 |
| | | left join blade_dept bd on bd.id = ce.create_dept and bd.is_deleted = 0 |
| | | where tr.is_deleted = 0 |
| | | and tr.patrol_task_id = #{patrolTaskId} |
| | | bd.dept_name as distribute_dept_name |
| | | FROM ja_gd_task_result tr |
| | | LEFT JOIN (SELECT * |
| | | FROM ja_gd_clue_event ce1 |
| | | WHERE ce1.is_deleted = 0 |
| | | AND ce1.create_time = (SELECT MAX(create_time) |
| | | FROM ja_gd_clue_event ce2 |
| | | WHERE ce2.result_id = ce1.result_id |
| | | AND ce2.is_deleted = 0)) ce ON ce.result_id = tr.id |
| | | LEFT JOIN blade_user bu ON bu.id = ce.create_user AND bu.is_deleted = 0 |
| | | LEFT JOIN blade_dept bd ON bd.id = ce.create_dept AND bd.is_deleted = 0 |
| | | WHERE tr.is_deleted = 0 |
| | | AND tr.patrol_task_id = #{patrolTaskId} |
| | | </select> |
| | | |
| | | |
| | |
| | | @ApiModelProperty(value = "执行时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date executeTime; |
| | | |
| | | @ApiModelProperty(value = "巡查任务航线ID") |
| | | private String airlineId; |
| | | /** |
| | | * 巡查任务航线URL |
| | | */ |
| | |
| | | * @param gdPatrolTask |
| | | * @return |
| | | */ |
| | | IPage<GdPatrolTaskVO> selectGdPatrolTaskPage(IPage<GdPatrolTaskVO> page, GdPatrolTaskPageParam gdPatrolTask, List<Long> deptIdList); |
| | | IPage<GdPatrolTaskVO> selectGdPatrolTaskPage(IPage<GdPatrolTaskVO> page, GdPatrolTaskPageParam gdPatrolTask); |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | package org.sxkj.gd.workorder.service.impl; |
| | | |
| | | import org.sxkj.gd.utils.GdGeoAddressUtil; |
| | | import org.sxkj.gd.utils.GeomUtils; |
| | | import org.sxkj.gd.workorder.entity.GdManageDeviceEntity; |
| | | import org.sxkj.gd.workorder.param.GdManageDevicePageParam; |
| | |
| | | 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.DictCache; |
| | | import org.sxkj.system.enums.DictEnum; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Override |
| | | public IPage<GdManageDeviceVO> selectGdManageDevicePage(IPage<GdManageDeviceVO> page, GdManageDevicePageParam gdManageDevice) { |
| | | return page.setRecords(baseMapper.selectGdManageDevicePage(page, gdManageDevice)); |
| | | List<GdManageDeviceVO> gdManageDeviceVOS = baseMapper.selectGdManageDevicePage(page, gdManageDevice); |
| | | return page.setRecords(gdManageDeviceVOS); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (gdManageDeviceEntity.getLongitude() != null && gdManageDeviceEntity.getLatitude() != null) { |
| | | String bufferAroundPointAsString = GeomUtils.getBufferAroundPointAsString(gdManageDeviceEntity.getLongitude(), gdManageDeviceEntity.getLatitude(), 5 * 1000); |
| | | gdManageDeviceEntity.setGeom(bufferAroundPointAsString); |
| | | String location = GdGeoAddressUtil.getFormattedAddress(gdManageDeviceEntity.getLongitude(), gdManageDeviceEntity.getLatitude()); |
| | | gdManageDeviceEntity.setLocation(location); |
| | | } |
| | | return saveOrUpdate(gdManageDeviceEntity); |
| | | } |
| | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.sxkj.common.constant.WordOrderConstant; |
| | |
| | | import org.sxkj.gd.common.GdMultipartFileUtil; |
| | | import org.sxkj.resource.entity.Attach; |
| | | import org.sxkj.resource.feign.IAttachClient; |
| | | import org.sxkj.system.cache.SysCache; |
| | | import org.sxkj.system.entity.Dept; |
| | | import org.sxkj.system.entity.User; |
| | | import org.sxkj.system.feign.ISysClient; |
| | |
| | | @Autowired |
| | | private IGdTaskResultService gdTaskResultService; |
| | | @Override |
| | | public IPage<GdPatrolTaskVO> selectGdPatrolTaskPage(IPage<GdPatrolTaskVO> page, GdPatrolTaskPageParam gdPatrolTask, List<Long> deptIdList) { |
| | | return page.setRecords(baseMapper.selectGdPatrolTaskPage(page, gdPatrolTask, deptIdList)); |
| | | public IPage<GdPatrolTaskVO> selectGdPatrolTaskPage(IPage<GdPatrolTaskVO> page, GdPatrolTaskPageParam gdPatrolTask) { |
| | | return page.setRecords(baseMapper.selectGdPatrolTaskPage(page, gdPatrolTask, SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())))); |
| | | } |
| | | |
| | | |
| | |
| | | // 这里可以根据allSubTasksAudited的结果执行后续逻辑,比如更新工单状态等 |
| | | if (allSubTasksAudited) { |
| | | // 1.验收通过,生成报告 |
| | | exportPatrolReport(task.getWorkOrderId()); |
| | | asyncExportPatrolReport(task.getId()); |
| | | // 2.执行工单状态更新逻辑 |
| | | return updateWorkOrderStatusAndFlow(task.getWorkOrderId(), |
| | | WorkOrderStatusEnum.ACCEPTED_TO_BE_SETTLED); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 异步生成巡查报告 |
| | | * |
| | | * @param patrolTaskId 巡查任务ID |
| | | */ |
| | | @Async |
| | | public void asyncExportPatrolReport(Long patrolTaskId) { |
| | | try { |
| | | exportPatrolReport(patrolTaskId); |
| | | } catch (Exception e) { |
| | | // 记录异步执行错误日志 |
| | | log.error("异步生成巡查报告失败,任务ID: {}"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 检查拒绝原因是否必填 |
| | |
| | | */ |
| | | package org.sxkj.gd.workorder.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设备编码 |
| | | */ |
| | | @ApiModelProperty(value = "设备编码") |
| | | private String deviceSn; |
| | | |
| | | @ApiModelProperty(value = "设备型号") |
| | | private String deviceName; |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value = "设备名称") |
| | | private String nickname; |
| | | |
| | | /** |
| | | * 设备状态:{0:"在线",1:"离线"} |
| | | */ |
| | | @ApiModelProperty(value = "设备状态:{0:在线,1:离线}") |
| | | private Long modeCode; |
| | | |
| | | /** |
| | | * 设备负载(红外,喇叭,闪光灯) |
| | |
| | | @ApiModelProperty(value = "设备ids") |
| | | private List<String> deviceIds; |
| | | |
| | | @ApiModelProperty(value = "设备位置") |
| | | @ApiModelProperty(value = "设备范围") |
| | | private String geom; |
| | | |
| | | @ApiModelProperty(value = "5公里范围面数据") |
| | | private String fiveKmArea; |
| | | |
| | | @ApiModelProperty(value = "设备位置") |
| | | private String location; |
| | | |
| | | @ApiModelProperty(value = "设备部门") |
| | | private String deviceDeptName; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 设备类型(0机场,1无人机) |
| | | */ |
| | | @ApiModelProperty(value = "设备类型(0机场,1无人机)") |
| | | private Integer deviceType; |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "执行时间") |
| | | private Date executeTime; |
| | | |
| | | @ApiModelProperty(value = "巡查任务航线ID") |
| | | private String airlineId; |
| | | |
| | | /** |
| | | * 巡查任务航线URL |
| | | */ |
| | |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.sxkj.common.constant.WordOrderConstant; |
| | | import org.sxkj.common.node.TreeStringNode; |
| | | import org.sxkj.common.utils.HeaderUtils; |
| | | import org.sxkj.common.utils.OrderNumUtils; |
| | | import org.sxkj.system.cache.DictCache; |
| | | import org.sxkj.system.cache.UserCache; |
| | | import org.sxkj.system.entity.Dept; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
| | |
| | | @ApiLog("组织机构信息新增或修改") |
| | | public R submit(@Valid @RequestBody DeptAddParam dept) { |
| | | Dept deptEntity = Objects.requireNonNull(BeanUtil.copy(dept, Dept.class)); |
| | | String times = OrderNumUtils.initOrderNum2(WordOrderConstant.ORG_CODE); |
| | | String deptCode = WordOrderConstant.ORG_PREFIX + times; |
| | | deptEntity.setDeptCode(deptCode); |
| | | deptEntity.setCreateTime(new Date()); |
| | | deptEntity.setUpdateTime(new Date()); |
| | | if (deptService.submit(deptEntity)) { |
| | | CacheUtil.clear(SYS_CACHE); |
| | | CacheUtil.clear(SYS_CACHE, Boolean.FALSE); |
| | |
| | | @ApiOperation(value = "修改", notes = "传入region") |
| | | @ApiLog("行政区划数据修改") |
| | | public R update(@Valid @RequestBody Region region) { |
| | | region.setUpdateTime(DateUtil.now()); |
| | | return R.status(regionService.updateById(region)); |
| | | } |
| | | |
| | |
| | | @ApiLog("行政区划数据新增或修改") |
| | | public R submit(@Valid @RequestBody RegionAddParam region) { |
| | | Region regionEntity = Objects.requireNonNull(BeanUtil.copy(region, Region.class)); |
| | | regionEntity.setUpdateTime(DateUtil.now()); |
| | | regionEntity.setCreateTime(DateUtil.now()); |
| | | return R.status(regionService.submit(regionEntity)); |
| | | } |
| | | |
| | |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | import org.sxkj.system.util.excel.ExcelDictConverter; |
| | | import org.sxkj.system.util.excel.ExcelDictItem; |
| | | import org.sxkj.system.util.excel.ExcelDictItemLabel; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | |
| | | @ExcelProperty("机构描述") |
| | | @ColumnWidth(20) |
| | | private String deptDesc; |
| | | private String remark; |
| | | |
| | | @ExcelProperty("机构状态") |
| | | @ColumnWidth(20) |
| | | private String deptStatus; |
| | | @ExcelProperty(value = "机构状态", converter = ExcelDictConverter.class) |
| | | @ExcelDictItemLabel(type = "institutionStatus") |
| | | @ExcelDictItem(type = "institutionStatus") |
| | | private String status; |
| | | } |
| | |
| | | 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 io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.sxkj.system.util.excel.ExcelDictConverter; |
| | | import org.sxkj.system.util.excel.ExcelDictItem; |
| | | import org.sxkj.system.util.excel.ExcelDictItemLabel; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | public class RegionExcel implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("区划编号") |
| | | private String code; |
| | | |
| | | @ExcelProperty("父区划编号") |
| | | private String parentCode; |
| | | |
| | | @ExcelProperty("祖区划编号") |
| | | private String ancestors; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("区划名称") |
| | | private String name; |
| | | |
| | | @ExcelProperty("省级区划编号") |
| | | private String provinceCode; |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("上级区划名称") |
| | | private String parentName; |
| | | |
| | | @ExcelProperty("省级名称") |
| | | private String provinceName; |
| | | |
| | | @ExcelProperty("市级区划编号") |
| | | private String cityCode; |
| | | |
| | | @ExcelProperty("市级名称") |
| | | private String cityName; |
| | | |
| | | @ExcelProperty("区级区划编号") |
| | | private String districtCode; |
| | | |
| | | @ExcelProperty("区级名称") |
| | | private String districtName; |
| | | |
| | | @ExcelProperty("镇级区划编号") |
| | | private String townCode; |
| | | |
| | | @ExcelProperty("镇级名称") |
| | | private String townName; |
| | | |
| | | @ExcelProperty("村级区划编号") |
| | | private String villageCode; |
| | | |
| | | @ExcelProperty("村级名称") |
| | | private String villageName; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("层级") |
| | | private Integer regionLevel; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("排序") |
| | | private Integer sort; |
| | | |
| | | @ExcelProperty("备注") |
| | | private String remark; |
| | | @ColumnWidth(20) |
| | | @ExcelProperty(value = "机构状态", converter = ExcelDictConverter.class) |
| | | @ExcelDictItemLabel(type = "institutionStatus") |
| | | @ExcelDictItem(type = "institutionStatus") |
| | | private String status; |
| | | |
| | | } |
| | |
| | | <if test="param2.deptName!=null and param2.deptName!=''"> |
| | | and bd.dept_name like concat(concat('%', #{param2.deptName}),'%') |
| | | </if> |
| | | <if test="param2.fullName!=null and param2.fullName!=''"> |
| | | and bd.full_name like concat(concat('%', #{param2.fullName}),'%') |
| | | </if> |
| | | <if test="param2.areaCode!=null and param2.areaCode!=''"> |
| | | and bd.area_code = #{param2.areaCode} |
| | | and bd.area_code like concat(concat('%', #{param2.areaCode}),'%') |
| | | </if> |
| | | <if test="param2.deptCode!=null and param2.deptCode!=''"> |
| | | and bd.dept_code = #{param2.deptCode} |
| | | </if> |
| | | ORDER BY bd.create_time DESC |
| | | </select> |
| | | |
| | | <select id="exportDept" resultType="org.sxkj.system.excel.DeptExcel"> |
| | |
| | | FROM blade_region |
| | | where length(parent_code) < 12 limit 0,#{size} |
| | | </select> |
| | | |
| | | <select id="selectRegionPage" resultType="org.sxkj.system.vo.RegionVO"> |
| | | SELECT |
| | | id, |
| | |
| | | region_level = '4' THEN district_name |
| | | WHEN |
| | | region_level = '3' THEN city_name |
| | | WHEN |
| | | region_level = '2' THEN province_name |
| | | ELSE NULL |
| | | END AS parent_name |
| | | FROM |
| | | blade_region |
| | | <where> |
| | | city_code = '360800000000' |
| | | <if test="param2.status!=null"> |
| | | and status = #{param1.status} |
| | | </if> |
| | | <if test="param2.cityCode!=null and param2.cityCode!='' "> |
| | | and city_code like concat(concat('%', #{param2.cityCode}),'%') |
| | | and code like concat(concat('%', #{param2.cityCode}),'%') |
| | | </if> |
| | | <if test="param2.districtName!=null and param2.districtName!=''"> |
| | | and district_name like concat(concat('%', #{param2.districtName}),'%') |
| | | </if> |
| | | <if test="param2.parentName!=null and param2.parentName!=''"> |
| | | and parent_name like concat(concat('%', #{param2.parentName}),'%') |
| | | and ( |
| | | (region_level = '5' AND town_name LIKE CONCAT(CONCAT('%', #{param2.parentName}), '%')) |
| | | OR (region_level = '4' AND district_name LIKE CONCAT(CONCAT('%', #{param2.parentName}), '%')) |
| | | OR (region_level = '3' AND city_name LIKE CONCAT(CONCAT('%', #{param2.parentName}), '%')) |
| | | ) |
| | | </if> |
| | | <if test="param2.regionLevel!=null"> |
| | | and region_level = #{param2.regionLevel} |
| | | </if> |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "机构编码") |
| | | private String deptCode; |
| | | |
| | | /** |
| | | * 租户ID |
| | | */ |
| | |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | |
| | | @ApiModelProperty(value = "组织id") |
| | | private Integer bingId; |
| | | |
| | | /** |
| | | * 是否已删除 |
| | |
| | | @ApiModelProperty(value = "部门名称") |
| | | private String deptName; |
| | | |
| | | @ApiModelProperty(value = "部门全称") |
| | | private String fullName; |
| | | @ApiModelProperty(value = "机构编码") |
| | | private String deptCode; |
| | | |
| | | @ApiModelProperty(value = "所属区划") |
| | | private String areaCode; |
| New file |
| | |
| | | package org.sxkj.system.util.excel; |
| | | |
| | | import com.alibaba.excel.write.style.row.AbstractRowHeightStyleStrategy; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | |
| | | import java.util.Iterator; |
| | | |
| | | /** |
| | | * 自适应行高 |
| | | * @author zhongrj |
| | | * @since 2021-10-29 |
| | | */ |
| | | public class CustomCellWriteHeightConfig extends AbstractRowHeightStyleStrategy { |
| | | /** |
| | | * 默认高度 |
| | | */ |
| | | private static final Integer DEFAULT_HEIGHT = 300; |
| | | |
| | | @Override |
| | | protected void setHeadColumnHeight(Row row, int relativeRowIndex) { |
| | | } |
| | | |
| | | @Override |
| | | protected void setContentColumnHeight(Row row, int relativeRowIndex) { |
| | | Iterator<Cell> cellIterator = row.cellIterator(); |
| | | if (!cellIterator.hasNext()) { |
| | | return; |
| | | } |
| | | |
| | | // 默认为 1行高度 |
| | | Integer maxHeight = 1; |
| | | while (cellIterator.hasNext()) { |
| | | Cell cell = cellIterator.next(); |
| | | switch (cell.getCellType()) { |
| | | case STRING: |
| | | if (cell.getStringCellValue().indexOf("\n") != -1) { |
| | | int length = cell.getStringCellValue().split("\n").length; |
| | | maxHeight = Math.max(maxHeight, length); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | row.setHeight((short) (maxHeight * DEFAULT_HEIGHT)); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.sxkj.system.util.excel; |
| | | |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | import com.alibaba.excel.metadata.Head; |
| | | import com.alibaba.excel.metadata.data.CellData; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
| | | import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 自适应行款 |
| | | * @author zhongrj |
| | | * @since 2021-10-29 |
| | | */ |
| | | public class CustomCellWriteWeightConfig extends AbstractColumnWidthStyleStrategy { |
| | | private Map<Integer, Map<Integer, Integer>> CACHE = new HashMap<>(); |
| | | |
| | | @Override |
| | | protected void setColumnWidth(WriteSheetHolder writeSheetHolder, List<WriteCellData<?>> cellDataList, Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) { |
| | | // 在3.0版本中,列宽设置逻辑已改变,使用此方法进行设置 |
| | | Sheet sheet = writeSheetHolder.getSheet(); |
| | | Integer columnWidth = CACHE.get(writeSheetHolder.getSheetNo()) != null ? |
| | | CACHE.get(writeSheetHolder.getSheetNo()).get(cell.getColumnIndex()) : null; |
| | | if (columnWidth != null) { |
| | | sheet.setColumnWidth(cell.getColumnIndex(), columnWidth * 256); |
| | | } |
| | | |
| | | super.setColumnWidth(writeSheetHolder, cellDataList, cell, head, relativeRowIndex, isHead); |
| | | } |
| | | |
| | | /** |
| | | * 计算长度 |
| | | * @param cellDataList |
| | | * @param cell |
| | | * @param isHead |
| | | * @return |
| | | */ |
| | | private Integer dataLength(List<CellData> cellDataList, Cell cell, Boolean isHead) { |
| | | if (isHead) { |
| | | return cell.getStringCellValue().getBytes().length; |
| | | } else { |
| | | CellData cellData = cellDataList.get(0); |
| | | CellDataTypeEnum type = cellData.getType(); |
| | | if (type == null) { |
| | | return -1; |
| | | } else { |
| | | switch (type) { |
| | | case STRING: |
| | | // 换行符(数据需要提前解析好) |
| | | int index = cellData.getStringValue().indexOf("\n"); |
| | | return index != -1 ? |
| | | cellData.getStringValue().substring(0, index).getBytes().length + 1 : cellData.getStringValue().getBytes().length + 1; |
| | | case BOOLEAN: |
| | | return cellData.getBooleanValue().toString().getBytes().length; |
| | | case NUMBER: |
| | | return cellData.getNumberValue().toString().getBytes().length; |
| | | default: |
| | | return -1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package org.sxkj.system.util.excel; |
| | | |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | import com.alibaba.excel.metadata.GlobalConfiguration; |
| | | import com.alibaba.excel.metadata.data.ReadCellData; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | import com.alibaba.excel.metadata.property.ExcelContentProperty; |
| | | import com.github.xiaoymin.knife4j.core.util.StrUtil; |
| | | import org.springframework.stereotype.Component; |
| | | import org.sxkj.system.cache.DictBizCache; |
| | | import org.sxkj.system.entity.DictBiz; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 字典映射 |
| | | * |
| | | * @author zhongrj |
| | | * @date 2023-11-17 |
| | | */ |
| | | @Component |
| | | public class ExcelDictConverter implements Converter<String> { |
| | | |
| | | @Override |
| | | public Class supportJavaTypeKey() { |
| | | return Integer.class; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return CellDataTypeEnum.STRING; |
| | | } |
| | | |
| | | /** |
| | | * 导入excel 解析到java 对象 |
| | | * @param cellData |
| | | * @param contentProperty |
| | | * @param globalConfiguration |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public String convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | // 获取字典类型 |
| | | Field field = contentProperty.getField(); |
| | | ExcelDictItemLabel excel = field.getAnnotation(ExcelDictItemLabel.class); |
| | | String dictType = excel.type(); |
| | | // 为空返回 |
| | | String dictLabel = cellData.getStringValue(); |
| | | if (StrUtil.isBlank(dictLabel)) { |
| | | return dictLabel; |
| | | } |
| | | // 查询字典 |
| | | List<DictBiz> list = DictBizCache.getList(dictType); |
| | | //解析返回 |
| | | String key = ""; |
| | | for (DictBiz dictBiz : list) { |
| | | if (dictBiz.getDictValue().equals(dictLabel)){ |
| | | key = dictBiz.getDictKey(); |
| | | break; |
| | | } |
| | | } |
| | | // 返回key |
| | | return key; |
| | | } |
| | | |
| | | /** |
| | | * java 导出到 excel |
| | | * |
| | | * @param dictValue |
| | | * @param excelContentProperty |
| | | * @param globalConfiguration |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public WriteCellData<?> convertToExcelData(String dictValue, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | // 获取字典类型 |
| | | Field field = excelContentProperty.getField(); |
| | | ExcelDictItem excel = field.getAnnotation(ExcelDictItem.class); |
| | | String dictType = excel.type(); |
| | | List<DictBiz> list = DictBizCache.getList(dictType); |
| | | String value = ""; |
| | | //解析返回 |
| | | for (DictBiz dictBiz : list) { |
| | | if (dictBiz.getDictKey().equals(dictValue)){ |
| | | value = dictBiz.getDictValue(); |
| | | break; |
| | | } |
| | | } |
| | | return new WriteCellData<>(value); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.sxkj.system.util.excel; |
| | | |
| | | import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * excel导出字典转换注解 |
| | | * <p> |
| | | * 将excel导出的字典code自动转换为字典label |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target(ElementType.FIELD) |
| | | @JacksonAnnotationsInside |
| | | public @interface ExcelDictItem { |
| | | |
| | | /** |
| | | * 字典type |
| | | */ |
| | | String type(); |
| | | |
| | | } |
| New file |
| | |
| | | package org.sxkj.system.util.excel; |
| | | |
| | | import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * excel导入字典转换注解 |
| | | * <p> |
| | | * 将excel导入的字典label自动转换为字典code |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target(ElementType.FIELD) |
| | | @JacksonAnnotationsInside |
| | | public @interface ExcelDictItemLabel { |
| | | |
| | | /** |
| | | * 字典type |
| | | */ |
| | | String type(); |
| | | |
| | | } |
| New file |
| | |
| | | package org.sxkj.system.util.excel; |
| | | |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.converters.WriteConverterContext; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | import com.alibaba.excel.metadata.GlobalConfiguration; |
| | | import com.alibaba.excel.metadata.data.ReadCellData; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | import com.alibaba.excel.metadata.property.ExcelContentProperty; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | |
| | | /** |
| | | * LocalDateTime转换器 |
| | | * |
| | | * @author |
| | | * @since 2026-01-08 |
| | | */ |
| | | public class LocalDateTimeConverter implements Converter<LocalDateTime> { |
| | | |
| | | private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | @Override |
| | | public Class<LocalDateTime> supportJavaTypeKey() { |
| | | return LocalDateTime.class; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return CellDataTypeEnum.STRING; |
| | | } |
| | | |
| | | @Override |
| | | public LocalDateTime convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | if (cellData == null || cellData.getStringValue() == null || cellData.getStringValue().trim().isEmpty()) { |
| | | return null; |
| | | } |
| | | try { |
| | | return LocalDateTime.parse(cellData.getStringValue(), TIME_FORMATTER); |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public WriteCellData<?> convertToExcelData(WriteConverterContext<LocalDateTime> context) throws Exception { |
| | | if (context.getValue() == null) { |
| | | return new WriteCellData<>(""); |
| | | } |
| | | return new WriteCellData<>(context.getValue().format(TIME_FORMATTER)); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.sxkj.system.util.excel; |
| | | |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.converters.WriteConverterContext; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | import com.alibaba.excel.metadata.GlobalConfiguration; |
| | | import com.alibaba.excel.metadata.data.ReadCellData; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | import com.alibaba.excel.metadata.property.ExcelContentProperty; |
| | | |
| | | import java.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | |
| | | /** |
| | | * LocalTime转换器 |
| | | * |
| | | * @author |
| | | * @since 2026-01-09 |
| | | */ |
| | | public class LocalTimeConverter implements Converter<LocalTime> { |
| | | |
| | | private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss"); |
| | | |
| | | @Override |
| | | public Class<LocalTime> supportJavaTypeKey() { |
| | | return LocalTime.class; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return CellDataTypeEnum.STRING; |
| | | } |
| | | |
| | | @Override |
| | | public LocalTime convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | if (cellData == null || cellData.getStringValue() == null || cellData.getStringValue().trim().isEmpty()) { |
| | | return null; |
| | | } |
| | | try { |
| | | return LocalTime.parse(cellData.getStringValue(), TIME_FORMATTER); |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public WriteCellData<?> convertToExcelData(WriteConverterContext<LocalTime> context) throws Exception { |
| | | if (context.getValue() == null) { |
| | | return new WriteCellData<>(""); |
| | | } |
| | | return new WriteCellData<>(context.getValue().format(TIME_FORMATTER)); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.sxkj.system.util.excel; |
| | | |
| | | import com.alibaba.excel.write.handler.SheetWriteHandler; |
| | | import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
| | | import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.ss.util.CellRangeAddress; |
| | | |
| | | public class MySheetWriteHandler implements SheetWriteHandler { |
| | | @Override |
| | | public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) { |
| | | Workbook workbook = writeWorkbookHolder.getWorkbook(); |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | Row row1 = sheet.createRow(0); |
| | | row1.setHeight((short) 500); |
| | | Cell cell = row1.createCell(0); |
| | | //设置单元格内容 |
| | | cell.setCellValue("附件2"); |
| | | //设置标题 |
| | | Row row2 = sheet.createRow(1); |
| | | row2.setHeight((short) 800); |
| | | Cell cell1 = row2.createCell(0); |
| | | cell1.setCellValue("存量建筑垃圾堆体治理进度月报表"); |
| | | CellStyle cellStyle = workbook.createCellStyle(); |
| | | cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); |
| | | cellStyle.setAlignment(HorizontalAlignment.CENTER); |
| | | Font font = workbook.createFont(); |
| | | font.setBold(true); |
| | | font.setFontHeight((short) 400); |
| | | cellStyle.setFont(font); |
| | | cell1.setCellStyle(cellStyle); |
| | | sheet.addMergedRegionUnsafe(new CellRangeAddress(1, 1, 0, 17)); |
| | | //设置填表日期,填报人,联系方式 |
| | | Row row3 = sheet.createRow(2); |
| | | row3.setHeight((short) 500); |
| | | row3.createCell(1).setCellValue("填表日期"); |
| | | row3.createCell(11).setCellValue("填表人"); |
| | | row3.createCell(15).setCellValue("联系方式"); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.sxkj.system.util.excel; |
| | | |
| | | import com.alibaba.excel.metadata.Head; |
| | | import com.alibaba.excel.metadata.data.CellData; |
| | | import com.alibaba.excel.write.handler.CellWriteHandler; |
| | | import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
| | | import com.alibaba.excel.write.metadata.holder.WriteTableHolder; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.springblade.core.tool.utils.Func; |
| | | |
| | | /** |
| | | * 修改单元格格式为文本格式 |
| | | * @author zhongrj |
| | | * @since 2021-9-26 |
| | | */ |
| | | public class RowWriteHandler implements CellWriteHandler { |
| | | |
| | | public static CellStyle cellStyle; |
| | | |
| | | /** |
| | | * 设置全局变量,防止 cellStyle 创建过多报错 2021-12-16 zrj |
| | | * The maximum number of cell styles was exceeded. You can define up to 64000styles in a .xlsx workbook |
| | | * @param cellStyle |
| | | */ |
| | | public static void setCellStyle(CellStyle cellStyle) { |
| | | RowWriteHandler.cellStyle = cellStyle; |
| | | } |
| | | |
| | | @Override |
| | | public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Head head, Integer integer, Integer integer1, Boolean aBoolean) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
| | | //设置单元格格式为文本 |
| | | Workbook workbook = writeSheetHolder.getSheet().getWorkbook(); |
| | | //自定义样式不为空时,重复利用 |
| | | if(Func.isEmpty(cellStyle)){ |
| | | cellStyle = workbook.createCellStyle(); |
| | | setCellStyle(cellStyle); |
| | | } |
| | | DataFormat dataFormat = workbook.createDataFormat(); |
| | | cellStyle.setDataFormat(dataFormat.getFormat("@")); |
| | | cell.setCellStyle(cellStyle); |
| | | } |
| | | |
| | | //@Override 加上会报错 |
| | | public void afterCellDataConverted(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, CellData cellData, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
| | | |
| | | } |
| | | |
| | | // @Override |
| | | // public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, List<CellData> list, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
| | | // |
| | | // } |
| | | } |
| | |
| | | attach.setTenantId("000000"); |
| | | // 设置航线任务jobId |
| | | if (!Strings.isBlank(odmTaskInfo.getWaylineJobId())) { |
| | | attach.setWayLineJobId(odmTaskInfo.getWaylineJobId()); |
| | | attach.setPatrolTaskId(odmTaskInfo.getWaylineJobId()); |
| | | } |
| | | // 设置类型-切斜摄影 |
| | | if (odmTaskInfo.getType() == OdmTypeEnum.TILT.getType().intValue()) { |
| | |
| | | attach.setUpdateTime(new Date()); |
| | | if (!Strings.isBlank(odmTaskInfo.getCompletedTime())) { |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | attach.setMediaCreateTime(LocalDateTime.parse(odmTaskInfo.getCompletedTime(), formatter)); |
| | | } |
| | | // 设置设备编号 |
| | | if (!Strings.isBlank(odmTaskInfo.getDeviceSn())) { |
| | |
| | | attach.setNickName(odmTaskInfo.getWaylineJobName()); |
| | | attach.setOriginalName(path); |
| | | attach.setExtension(".tif"); |
| | | attach.setMediaCategory(2); |
| | | // 设置航线对应的机构 |
| | | attach.setAreaCode(odmTaskInfo.getAreaCode()); |
| | | attach.setCreateUser(odmTaskInfo.getCreateUser()); |
| | |
| | | attach.setTenantId("000000"); |
| | | // 设置航线任务jobId |
| | | if (!Strings.isBlank(odmTaskInfo.getWaylineJobId())) { |
| | | attach.setWayLineJobId(odmTaskInfo.getWaylineJobId()); |
| | | attach.setPatrolTaskId(odmTaskInfo.getWaylineJobId()); |
| | | } |
| | | // 设置类型 |
| | | attach.setResultType(AttachResultTypeEnum.ORT.getType()); |
| | |
| | | } |
| | | if (!Strings.isBlank(odmTaskInfo.getCompletedTime())) { |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | attach.setMediaCreateTime(LocalDateTime.parse(odmTaskInfo.getCompletedTime(), formatter)); |
| | | } |
| | | // 图片压缩 |
| | | log.info("开始压缩tif图片,路径:{}", path); |