新增任务管理、任务记录等搜索字段,可重复审核,添加导出任务记录字段
| | |
| | | String userId = JwtTokenUtil.getPrivateClaimFromToken(token, "userId"); |
| | | return taskDetailService.manualAudit(vo, userId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @ApiImplicitParam(value = "列表数据id,多个逗号分隔", name = "ids", dataType = "String"), |
| | | @ApiImplicitParam(value = "状态(1=待执行,2=进行中,3=成功,4=失败)", name = "status", dataType = "int"), |
| | | @ApiImplicitParam(value = "规则编号", name = "code", dataType = "String"), |
| | | @ApiImplicitParam(value = "系统审核状态(1=未执行,2=正常,3=异常)", name = "sysStatus", dataType = "int"), |
| | | }) |
| | | public void downloadTaskRecord(String ids, String code, Integer status, HttpServletResponse response){ |
| | | public void downloadTaskRecord(String ids, String code, Integer status,Integer sysStatus, HttpServletResponse response){ |
| | | List<String> id = null; |
| | | if(ToolUtil.isNotEmpty(ids)){ |
| | | String[] split = ids.split(","); |
| | | id = Arrays.asList(split); |
| | | } |
| | | taskDetailService.downloadTaskRecord(id, code, status, response); |
| | | taskDetailService.downloadTaskRecord(id, code, status,sysStatus, response); |
| | | } |
| | | |
| | | |
| | |
| | | * @param status |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getDownloadTaskRecord(@Param("ids") List<String> ids, @Param("code") String code, @Param("status") Integer status); |
| | | List<Map<String, Object>> getDownloadTaskRecord(@Param("ids") List<String> ids, @Param("code") String code, @Param("status") Integer status,@Param("sysStatus") Integer sysStatus); |
| | | } |
| | |
| | | * 根据任务车船关系数据id获取通道数据 |
| | | * @param pageInfo |
| | | * @param taskDetailVehiclesIdList |
| | | * @param sysStatus |
| | | * @param artificialStatus |
| | | * @param sysStatusList |
| | | * @param artificialStatusList |
| | | * @return |
| | | */ |
| | | List<PictureDetails> getPictureDetails(Page<PictureDetails> pageInfo, @Param("taskDetailVehiclesIdList") List<Integer> taskDetailVehiclesIdList, |
| | | @Param("sysStatus") Integer sysStatus, @Param("artificialStatus") Integer artificialStatus); |
| | | @Param("sysStatusList") List<Integer> sysStatusList, @Param("artificialStatusList") List<Integer> artificialStatusList,@Param("havePic")Integer havePic); |
| | | |
| | | void updateAudit(@Param("entity") TaskDetailVehiclesChannel taskDetailVehiclesChannel); |
| | | } |
| | |
| | | b.`name`, |
| | | b.type, |
| | | a.status, |
| | | ifnull(c.num, 0) as vehicleNum, |
| | | DATE_FORMAT(a.execution_time, '%Y-%m-%d %H:%i:%s') as executionTime |
| | | from t_task_detail a |
| | | left join t_patrol_task b on (a.patrol_task_id = b.id) |
| | | left join (select task_detail_id, count(1) as num from t_task_detail_vehicles group by task_detail_id) c on (a.id = c.task_detail_id) |
| | | where a.del_flag = 0 |
| | | <if test="null != item.code and '' != item.code"> |
| | | and a.code like CONCAT('%', #{item.code}, '%') |
| | | </if> |
| | | <if test="null != item.status"> |
| | | and a.status = #{item.status} |
| | | |
| | | <if test="null != item.status and item.status.size() > 0"> |
| | | and a.status in |
| | | <foreach collection="item.status" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != item.type"> |
| | | and b.type = #{item.type} |
| | | </if> |
| | | <if test="null != item.name and '' != item.name"> |
| | | and b.name like CONCAT('%', #{item.name}, '%') |
| | | </if> |
| | | <if test="null != item.startTime and null != item.endTime"> |
| | | and a.execution_time between #{item.startTime} and #{item.endTime} |
| | | </if> |
| | | order by a.execution_time desc |
| | | </select> |
| | |
| | | <if test="null != item.code and '' != item.code"> |
| | | and a.code like CONCAT('%', #{item.code}, '%') |
| | | </if> |
| | | <if test="null != item.status"> |
| | | and a.status = #{item.status} |
| | | <if test="null != item.status and item.status.size() > 0"> |
| | | and a.status in |
| | | <foreach collection="item.status" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != item.type"> |
| | | and b.type = #{item.type} |
| | | </if> |
| | | <if test="null != item.name and '' != item.name"> |
| | | and b.name like CONCAT('%', #{item.name}, '%') |
| | | </if> |
| | | <if test="null != item.startTime and null != item.endTime"> |
| | | and a.execution_time between #{item.startTime} and #{item.endTime} |
| | | </if> |
| | | order by a.execution_time desc |
| | | </select> |
| | |
| | | <if test="null != status"> |
| | | and b.status = #{status} |
| | | </if> |
| | | <if test="null != sysStatus"> |
| | | and d.sys_status = #{sysStatus} |
| | | </if> |
| | | order by b.execution_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <?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="com.stylefeng.guns.modular.system.dao.TaskDetailVehiclesChannelMapper"> |
| | | <update id="updateAudit"> |
| | | UPDATE t_task_detail_vehicles_channel |
| | | SET |
| | | artificial_status = #{entity.artificialStatus}, |
| | | remark = #{entity.remark}, <!-- 无论是否为 null,都强制更新 --> |
| | | artificial_create_time = #{entity.artificialCreateTime}, |
| | | artificial_user_id = #{entity.artificialUserId} |
| | | WHERE id = #{entity.id} |
| | | </update> |
| | | |
| | | |
| | | |
| | | <select id="getPictureDetails" resultType="com.stylefeng.guns.modular.system.model.vo.PictureDetails"> |
| | | <select id="getPictureDetails" resultType="com.stylefeng.guns.modular.system.model.vo.PictureDetails"> |
| | | select |
| | | a.id, |
| | | a.video_channel as videoChannel, |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != sysStatus"> |
| | | and a.sys_status = #{sysStatus} |
| | | <if test="null != sysStatusList and sysStatusList.size() > 0"> |
| | | and a.sys_status in |
| | | <foreach collection="sysStatusList" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != artificialStatus"> |
| | | and a.artificial_status = #{artificialStatus} |
| | | |
| | | <if test="null != artificialStatusList and artificialStatusList.size() > 0"> |
| | | and a.artificial_status in |
| | | <foreach collection="artificialStatusList" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != havePic"> |
| | | <if test=" havePic==0"> |
| | | and a.image_url IS NULL |
| | | </if> |
| | | <if test=" havePic==1"> |
| | | and a.image_url IS Not NULL |
| | | </if> |
| | | </if> |
| | | |
| | | </where> |
| | | |
| | | </select> |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/12/20 10:32 |
| | |
| | | @ApiModelProperty("车船对象数据[{\"vehicleType\":1,\"vehicleId\":123},{\"vehicleType\":2,\"vehicleId\":456}]") |
| | | private String vehicle; |
| | | @ApiModelProperty("执行状态(1=待执行,2=执行中,3=成功,4=离线,5=失败)") |
| | | private Integer status; |
| | | private List<Integer> status; |
| | | @ApiModelProperty("系统审核(1=未执行,2=正常,3=异常)") |
| | | private Integer sysStatus; |
| | | @ApiModelProperty("系统审核(1=未执行,2=正常,3=异常)") |
| | | private Integer artificialStatus; |
| | | private List<Integer> sysStatus; |
| | | @ApiModelProperty("人工审核(1=未执行,2=正常,3=异常)") |
| | | private List<Integer> artificialStatus; |
| | | |
| | | @ApiModelProperty("是否有图片(0=无,1=有)") |
| | | private Integer havePic; |
| | | |
| | | } |
| | |
| | | private String executionTime; |
| | | @ApiModelProperty("执行状态(1=待执行,2=进行中,3=成功,4=失败)") |
| | | private Integer status; |
| | | @ApiModelProperty("执行车辆") |
| | | private Integer vehicleNum; |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.stylefeng.guns.core.page.PageBT; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | @ApiModelProperty("规则编号") |
| | | private String code; |
| | | @ApiModelProperty("状态(1=待执行,2=进行中,3=成功,4=失败)") |
| | | private Integer status; |
| | | private List<Integer> status; |
| | | @ApiModelProperty("任务类型(1=定时任务,2=实时任务)") |
| | | private Integer type; |
| | | @ApiModelProperty("任务名称") |
| | | private String name; |
| | | @ApiModelProperty("任务执行时间段-开始") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty("任务执行时间段-结束") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endTime; |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.model.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.stylefeng.guns.core.page.PageBT; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | @ApiModelProperty("规则编号") |
| | | private String code; |
| | | @ApiModelProperty("状态(1=待执行,2=进行中,3=成功,4=失败)") |
| | | private Integer status; |
| | | private List<Integer> status; |
| | | @ApiModelProperty("任务类型(1=定时任务,2=实时任务)") |
| | | private Integer type; |
| | | @ApiModelProperty("任务名称") |
| | | private String name; |
| | | @ApiModelProperty("任务执行时间段-开始") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty("任务执行时间段-结束") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endTime; |
| | | } |
| | |
| | | * @param status |
| | | * @param response |
| | | */ |
| | | void downloadTaskRecord(List<String> ids, String code, Integer status, HttpServletResponse response); |
| | | void downloadTaskRecord(List<String> ids, String code, Integer status,Integer sysStatus, HttpServletResponse response); |
| | | |
| | | } |
| | |
| | | * @param taskDetailVehiclesIdList |
| | | * @return |
| | | */ |
| | | List<PictureDetails> getPictureDetails(Page<PictureDetails> pageInfo, List<Integer> taskDetailVehiclesIdList, Integer sysStatus, Integer artificialStatus); |
| | | List<PictureDetails> getPictureDetails(Page<PictureDetails> pageInfo, List<Integer> taskDetailVehiclesIdList, List<Integer> sysStatus, List<Integer> artificialStatus,Integer havePic); |
| | | |
| | | void updateAudit(TaskDetailVehiclesChannel taskDetailVehiclesChannel); |
| | | } |
| | |
| | | } |
| | | wrapper.in("vehicleIdUnique", vehicleIdList); |
| | | } |
| | | if(null != vo.getStatus()){ |
| | | wrapper.eq("status", vo.getStatus()); |
| | | if(null != vo.getStatus() && !vo.getStatus().isEmpty()){ |
| | | wrapper.in("status", vo.getStatus()); |
| | | } |
| | | if(null != vo.getSysStatus()){ |
| | | List<TaskDetailVehiclesChannel> sys_status = taskDetailVehiclesChannelService.selectList(new EntityWrapper<TaskDetailVehiclesChannel>() |
| | | .eq("sys_status", vo.getSysStatus())); |
| | | |
| | | if(null != vo.getSysStatus() && !vo.getSysStatus().isEmpty()){ |
| | | Wrapper<TaskDetailVehiclesChannel> channelWrapper = new EntityWrapper<TaskDetailVehiclesChannel>() |
| | | .in("sys_status", vo.getSysStatus()); |
| | | if (null != vo.getHavePic()){ |
| | | if(vo.getHavePic()==0){ |
| | | channelWrapper.isNull("image_url"); |
| | | }else if(vo.getHavePic()==1){ |
| | | channelWrapper.isNotNull("image_url"); |
| | | } |
| | | } |
| | | List<TaskDetailVehiclesChannel> sys_status = taskDetailVehiclesChannelService.selectList(channelWrapper); |
| | | List<Integer> collect = sys_status.stream().map(TaskDetailVehiclesChannel::getTaskDetailVehiclesId).collect(Collectors.toList()); |
| | | if(collect.size() == 0){ |
| | | collect.add(-1); |
| | | } |
| | | wrapper.in("id", collect); |
| | | } |
| | | if(null != vo.getArtificialStatus()){ |
| | | List<TaskDetailVehiclesChannel> sys_status = taskDetailVehiclesChannelService.selectList(new EntityWrapper<TaskDetailVehiclesChannel>() |
| | | .eq("artificial_status", vo.getArtificialStatus())); |
| | | if(null != vo.getArtificialStatus()&& !vo.getArtificialStatus().isEmpty()){ |
| | | Wrapper<TaskDetailVehiclesChannel> channelWrapper = new EntityWrapper<TaskDetailVehiclesChannel>() |
| | | .in("artificial_status", vo.getArtificialStatus()); |
| | | if (null != vo.getHavePic()){ |
| | | if(vo.getHavePic()==0){ |
| | | channelWrapper.isNull("image_url"); |
| | | }else if(vo.getHavePic()==1){ |
| | | channelWrapper.isNotNull("image_url"); |
| | | } |
| | | } |
| | | List<TaskDetailVehiclesChannel> sys_status = taskDetailVehiclesChannelService.selectList(channelWrapper); |
| | | List<Integer> collect = sys_status.stream().map(TaskDetailVehiclesChannel::getTaskDetailVehiclesId).collect(Collectors.toList()); |
| | | if(collect.size() == 0){ |
| | | collect.add(-1); |
| | |
| | | } |
| | | wrapper.in("vehicleIdUnique", vehicleIdList); |
| | | } |
| | | if(null != vo.getStatus()){ |
| | | wrapper.eq("status", vo.getStatus()); |
| | | if(null != vo.getStatus() && !vo.getStatus().isEmpty()){ |
| | | wrapper.in("status", vo.getStatus()); |
| | | } |
| | | List<TaskDetailVehicles> taskDetailVehiclesList = taskDetailVehiclesService.selectList(wrapper); |
| | | List<Integer> collect = taskDetailVehiclesList.stream().map(TaskDetailVehicles::getId).collect(Collectors.toList()); |
| | | if(collect.size() > 0){ |
| | | collect.add(-1); |
| | | } |
| | | List<PictureDetails> pictureDetails = taskDetailVehiclesChannelService.getPictureDetails(pageInfo, collect, vo.getSysStatus(), vo.getArtificialStatus()); |
| | | List<PictureDetails> pictureDetails = taskDetailVehiclesChannelService.getPictureDetails(pageInfo, collect, vo.getSysStatus(), vo.getArtificialStatus(),vo.getHavePic()); |
| | | List<Icon> icons = iconService.selectList(null); |
| | | for (PictureDetails pictureDetail : pictureDetails) { |
| | | String videoChannel = pictureDetail.getVideoChannel(); |
| | |
| | | public ResultUtil manualAudit(ManualAuditVo vo, String userId) { |
| | | List<TaskDetailVehiclesChannel> taskDetailVehiclesChannels = taskDetailVehiclesChannelService.selectBatchIds(vo.getId()); |
| | | for (TaskDetailVehiclesChannel taskDetailVehiclesChannel : taskDetailVehiclesChannels) { |
| | | if(null != taskDetailVehiclesChannel.getArtificialStatus() && 1 != taskDetailVehiclesChannel.getArtificialStatus()){ |
| | | /*if(null != taskDetailVehiclesChannel.getArtificialStatus() && 1 != taskDetailVehiclesChannel.getArtificialStatus()){ |
| | | return ResultUtil.error("不能重复审核"); |
| | | } |
| | | }*/ |
| | | taskDetailVehiclesChannel.setArtificialStatus(vo.getStatus()); |
| | | taskDetailVehiclesChannel.setRemark(vo.getRemark()); |
| | | taskDetailVehiclesChannel.setArtificialCreateTime(LocalDateTime.now()); |
| | | taskDetailVehiclesChannel.setArtificialUserId(Integer.valueOf(userId)); |
| | | taskDetailVehiclesChannelService.updateById(taskDetailVehiclesChannel); |
| | | // taskDetailVehiclesChannelService.updateById(taskDetailVehiclesChannel); |
| | | taskDetailVehiclesChannelService.updateAudit(taskDetailVehiclesChannel);//需要将Remark字段设置为null |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | * @param response |
| | | */ |
| | | @Override |
| | | public void downloadTaskRecord(List<String> ids, String code, Integer status, HttpServletResponse response) { |
| | | List<Map<String, Object>> mapList = this.baseMapper.getDownloadTaskRecord(ids, code, status); |
| | | public void downloadTaskRecord(List<String> ids, String code, Integer status,Integer sysStatus, HttpServletResponse response) { |
| | | List<Map<String, Object>> mapList = this.baseMapper.getDownloadTaskRecord(ids, code, status,sysStatus); |
| | | try { |
| | | HSSFWorkbook hssfWorkbook = new HSSFWorkbook(); |
| | | HSSFSheet hssfSheet = hssfWorkbook.createSheet(); |
| | |
| | | hssfCell11.setCellValue(""); |
| | | if(null != map.get("sysStatus")){ |
| | | //系统审核状态(1=未执行,2=正常,3=异常) |
| | | Integer sysStatus = Integer.valueOf(map.get("sysStatus").toString()); |
| | | hssfCell11.setCellValue(1 == sysStatus ? "未执行" : 2 == sysStatus ? "正常" : "异常"); |
| | | Integer sysStatus1 = Integer.valueOf(map.get("sysStatus").toString()); |
| | | hssfCell11.setCellValue(1 == sysStatus1 ? "未执行" : 2 == sysStatus1 ? "正常" : "异常"); |
| | | } |
| | | //系统审核时间 |
| | | HSSFCell hssfCell12 = hssfRow.createCell(12); |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<PictureDetails> getPictureDetails(Page<PictureDetails> pageInfo, List<Integer> taskDetailVehiclesIdList, Integer sysStatus, Integer artificialStatus) { |
| | | return this.baseMapper.getPictureDetails(pageInfo, taskDetailVehiclesIdList, sysStatus, artificialStatus); |
| | | public List<PictureDetails> getPictureDetails(Page<PictureDetails> pageInfo, List<Integer> taskDetailVehiclesIdList, List<Integer> sysStatus, List<Integer> artificialStatus,Integer havePic) { |
| | | return this.baseMapper.getPictureDetails(pageInfo, taskDetailVehiclesIdList, sysStatus, artificialStatus,havePic); |
| | | } |
| | | |
| | | @Override |
| | | public void updateAudit(TaskDetailVehiclesChannel taskDetailVehiclesChannel) { |
| | | this.baseMapper.updateAudit(taskDetailVehiclesChannel); |
| | | } |
| | | } |
| | |
| | | if(null == accountLogin){ |
| | | accountLogin(); |
| | | } |
| | | HttpRequest post = HttpUtil.createPost("https://zhyn.cg.gz.gov.cn/map/web/map/queryRuntimeInfoByCache"); |
| | | HttpRequest post = HttpUtil.createPost("https://zhyn.cg.gz.gov.cn/api/muck-core/web/map/queryRuntimeInfoByCache"); |
| | | post.header("operate-terminal", "4"); |
| | | post.header("token", accountLogin.getToken()); |
| | | post.body("{}"); |
| | |
| | | if(null == accountLogin){ |
| | | accountLogin(); |
| | | } |
| | | HttpRequest get = HttpUtil.createGet("https://zhyn.cg.gz.gov.cn/jttweb/api/v1/location/locationRealTimeInfoCache"); |
| | | HttpRequest get = HttpUtil.createGet("https://zhyn.cg.gz.gov.cn/api/jtt-web/jttweb/api/v1/location/locationRealTimeInfoCache"); |
| | | get.header("operate-terminal", "4"); |
| | | get.header("token", accountLogin.getToken()); |
| | | log.info("【2023年协议车辆在线】请求参数:" + get.getUrl()); |
| | |
| | | if(null == accountLogin){ |
| | | accountLogin(); |
| | | } |
| | | HttpRequest post = HttpUtil.createPost("https://zhyn.cg.gz.gov.cn/map/web/vehicleCtrl/" + terminalId + "/cameraShot"); |
| | | HttpRequest post = HttpUtil.createPost("https://zhyn.cg.gz.gov.cn/api/muck-core/web/vehicleCtrl/" + terminalId + "/cameraShot"); |
| | | post.header("operate-terminal", "4"); |
| | | post.header("token", accountLogin.getToken()); |
| | | log.info("【2018年协议发送拍摄指令接口】请求地址:" + post.getUrl()); |
| | |
| | | if(null == accountLogin){ |
| | | accountLogin(); |
| | | } |
| | | HttpRequest get = HttpUtil.createGet("https://zhyn.cg.gz.gov.cn/map/web/vehicleCtrl/getCameraShotById?terminalId=" + terminalId + "&id=" + fileId); |
| | | HttpRequest get = HttpUtil.createGet("https://zhyn.cg.gz.gov.cn/api/muck-core/web/vehicleCtrl/getCameraShotById?terminalId=" + terminalId + "&id=" + fileId); |
| | | get.header("operate-terminal", "4"); |
| | | get.header("token", accountLogin.getToken()); |
| | | log.info("【2018年协议车辆获取拍摄图片】请求参数:" + get.getUrl()); |
| | |
| | | if(null == accountLogin){ |
| | | accountLogin(); |
| | | } |
| | | HttpRequest post = HttpUtil.createPost("https://zhyn.cg.gz.gov.cn/map/web/map/getTrackInfoByVehicleNum"); |
| | | HttpRequest post = HttpUtil.createPost("https://zhyn.cg.gz.gov.cn/api/muck-core/web/map/getTrackInfoByVehicleNum"); |
| | | post.header("operate-terminal", "4"); |
| | | post.header("token", accountLogin.getToken()); |
| | | Map<String, Object> body = new HashMap<>(); |