Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
1 文件已重命名
12个文件已修改
12个文件已添加
3个文件已删除
| | |
| | | * 如果是开关阀:更改虚拟卡状态:是否使用中、最后操作、最后操作时间 |
| | | * 更新执行结果、返回结果时间、结果内容 |
| | | * 返回回调内容 |
| | | * ***************************** 虚拟卡使用状态不依赖开关阀意愿,依赖开关阀成功与否 |
| | | */ |
| | | if (comType != null) { |
| | | SeVirtualCard virtualCard = new SeVirtualCard(); |
| | | virtualCard.setId(vcId); |
| | | if (comType == 1) { |
| | | virtualCard.setInUse((byte) 1); |
| | | } else { |
| | | virtualCard.setInUse((byte) 0); |
| | | } |
| | | virtualCard.setLastOperate(LastOperateENUM.OPEN_VALVE.getCode()); |
| | | virtualCard.setLastOperateTime(new Date()); |
| | | seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard); |
| | | } |
| | | //if (comType != null) { |
| | | // SeVirtualCard virtualCard = new SeVirtualCard(); |
| | | // virtualCard.setId(vcId); |
| | | // if (comType == 1) { |
| | | // virtualCard.setInUse((byte) 1); |
| | | // } else { |
| | | // virtualCard.setInUse((byte) 0); |
| | | // } |
| | | // virtualCard.setLastOperate(LastOperateENUM.OPEN_VALVE.getCode()); |
| | | // virtualCard.setLastOperateTime(new Date()); |
| | | // seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard); |
| | | //} |
| | | |
| | | // 如果是开发命令(92-平台开阀,91-小程序开阀),返回结果中添加阀控器地址、虚拟卡编号、订单号 |
| | | //if(commandCode.equals("92") || commandCode.equals("97")) { |
| | |
| | | JSONObject job_data = job_response.getJSONObject("content").getJSONObject("data"); |
| | | if(!job_data.getBoolean("success")) { |
| | | // 开关阀失败 |
| | | |
| | | // 开阀失败则解除占用,关阀失败则占用 |
| | | if (comType != null) { |
| | | SeVirtualCard virtualCard = new SeVirtualCard(); |
| | | virtualCard.setId(vcId); |
| | | if (comType == 1) { |
| | | virtualCard.setInUse((byte) 0); |
| | | virtualCard.setIntakeId(null); |
| | | } else { |
| | | virtualCard.setInUse((byte) 1); |
| | | virtualCard.setIntakeId(intakeId); |
| | | } |
| | | virtualCard.setLastOperate(LastOperateENUM.OPEN_VALVE.getCode()); |
| | | virtualCard.setLastOperateTime(new Date()); |
| | | seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard); |
| | | } |
| | | |
| | | response_CallBack.setCode("10003"); |
| | | response_CallBack.setMsg(CommandResultCode.OPEN_CLOSE_FAIL.getMessage()); |
| | | response_CallBack.setSuccess(false); |
| | | }else { |
| | | // 开关阀成功 |
| | | |
| | | // 开阀成功则占用,关阀成功不占用 |
| | | if (comType != null) { |
| | | SeVirtualCard virtualCard = new SeVirtualCard(); |
| | | virtualCard.setId(vcId); |
| | | if (comType == 1) { |
| | | virtualCard.setInUse((byte) 1); |
| | | virtualCard.setIntakeId(intakeId); |
| | | } else { |
| | | virtualCard.setInUse((byte) 0); |
| | | virtualCard.setIntakeId(null); |
| | | } |
| | | virtualCard.setLastOperate(LastOperateENUM.OPEN_VALVE.getCode()); |
| | | virtualCard.setLastOperateTime(new Date()); |
| | | seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard); |
| | | } |
| | | |
| | | job_data.remove("success"); |
| | | job_data.put("intakeId", intakeId); |
| | | job_data.put("rtuAddr", rtuAddr); |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoOp; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeApproveResult; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-06 11:49 |
| | | * @LastEditTime 2024-11-06 11:49 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface OpeApproveResultMapper extends BaseMapper<OpeApproveResult> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(OpeApproveResult record); |
| | | |
| | | int insertSelective(OpeApproveResult record); |
| | | |
| | | OpeApproveResult selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(OpeApproveResult record); |
| | | |
| | | int updateByPrimaryKey(OpeApproveResult record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoOp; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-06 11:39 |
| | | * @LastEditTime 2024-11-06 11:39 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface OpeProcessingResultMapper extends BaseMapper<OpeProcessingResult> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(OpeProcessingResult record); |
| | | |
| | | int insertSelective(OpeProcessingResult record); |
| | | |
| | | OpeProcessingResult selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(OpeProcessingResult record); |
| | | |
| | | int updateByPrimaryKey(OpeProcessingResult record); |
| | | |
| | | /** |
| | | * 根据workOrderId获取未删除的处理结果数量,添加结果上报前判断使用 |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | Integer getValidResultCount(Long workOrderId); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoOp; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeTaskType; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-06 11:25 |
| | | * @LastEditTime 2024-11-06 11:25 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface OpeTaskTypeMapper extends BaseMapper<OpeTaskType> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(OpeTaskType record); |
| | | |
| | | int insertSelective(OpeTaskType record); |
| | | |
| | | OpeTaskType selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(OpeTaskType record); |
| | | |
| | | int updateByPrimaryKey(OpeTaskType record); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder; |
| | | import com.dy.pipIrrGlobal.voOp.VoWorkOrder; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/8/6 8:47 |
| | | * @LastEditTime :2024/8/6 8:47 |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-07 15:38 |
| | | * @LastEditTime 2024-11-07 15:38 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface OpeWorkOrderMapper extends BaseMapper<OpeWorkOrder> { |
| | | int deleteByPrimaryKey(Long id); |
| | |
| | | int updateByPrimaryKeySelective(OpeWorkOrder record); |
| | | |
| | | int updateByPrimaryKey(OpeWorkOrder record); |
| | | |
| | | /** |
| | | * 根据主键获取工单视图对象 |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | VoWorkOrder getWorkOrderById(Long workOrderId); |
| | | |
| | | /** |
| | | * 获取指定派单人的指定未删除工单,删除工单前判断使用使用 |
| | | * @param dispatcherId |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | OpeWorkOrder getWorkOrder(@Param("dispatcherId")Long dispatcherId, @Param("workOrderId")Long workOrderId); |
| | | |
| | | /** |
| | | * 逻辑删除一个未删除的工单 |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | Integer deleteWorkOrder(Long workOrderId); |
| | | |
| | | /** |
| | | * 根据指定条件获取工单数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getWorkOrdersCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取工单 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoWorkOrder> getWorkOrders(Map<?, ?> params); |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoOp; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-06 11:49 |
| | | * @LastEditTime 2024-11-06 11:49 |
| | | * @Description 处理结果审核实体类 |
| | | */ |
| | | |
| | | @TableName(value="ope_approve_result", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class OpeApproveResult implements BaseEntity { |
| | | public static final long serialVersionUID = 202411061152001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工单ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long workOrderId; |
| | | |
| | | /** |
| | | * 处理结果ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long processingResultId; |
| | | |
| | | /** |
| | | * 审核人ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long approverId; |
| | | |
| | | /** |
| | | * 审核时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date approveTime; |
| | | |
| | | /** |
| | | * 审核结果;1-通过,2-驳回 |
| | | */ |
| | | private Byte approveResult; |
| | | |
| | | /** |
| | | * 逻辑删除标识;未删除为0,已删除为删除时间 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long deleted; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoOp; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-06 11:39 |
| | | * @LastEditTime 2024-11-06 11:39 |
| | | * @Description 处理结果实体类 |
| | | */ |
| | | |
| | | @TableName(value="ope_processing_result", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class OpeProcessingResult implements BaseEntity { |
| | | public static final long serialVersionUID = 202411061146001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工单ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @NotNull(message = "必须选择一个工单") |
| | | private Long workOrderId; |
| | | |
| | | /** |
| | | * 巡检员ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @NotNull(message = "巡检员不能为空") |
| | | private Long inspectorId; |
| | | |
| | | /** |
| | | * 结果内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 照片列表 |
| | | */ |
| | | @TableField(typeHandler = JacksonTypeHandler.class) |
| | | private JSONArray images; |
| | | |
| | | /** |
| | | * 音频列表 |
| | | */ |
| | | @TableField(typeHandler = JacksonTypeHandler.class) |
| | | private JSONArray audios; |
| | | |
| | | /** |
| | | * 视频列表 |
| | | */ |
| | | @TableField(typeHandler = JacksonTypeHandler.class) |
| | | private JSONArray videos; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private BigDecimal lng; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private BigDecimal lat; |
| | | |
| | | /** |
| | | * 任务完成时间;精确到分 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | @NotNull(message = "任务完成时间不能为空") |
| | | private Date completeTime; |
| | | |
| | | /** |
| | | * 上报时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date reportTime; |
| | | |
| | | /** |
| | | * 状态;1-已上报,2-已通过,3-已驳回 |
| | | */ |
| | | private Byte state; |
| | | |
| | | /** |
| | | * 逻辑删除标识;未删除为0,已删除为删除时间 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long deleted; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoOp; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-06 11:25 |
| | | * @LastEditTime 2024-11-06 11:25 |
| | | * @Description 任务类型实体类 |
| | | */ |
| | | |
| | | @TableName(value = "ope_task_type", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class OpeTaskType implements BaseEntity { |
| | | public static final long serialVersionUID = 202411061128001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | private String taskType; |
| | | |
| | | /** |
| | | * 逻辑删除标识;未删除为0,已删除为删除时间 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long deleted; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/8/6 8:47 |
| | | * @LastEditTime :2024/8/6 8:47 |
| | | * @Description |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-06 11:33 |
| | | * @LastEditTime 2024-11-06 11:33 |
| | | * @Description 工单实体类 |
| | | */ |
| | | /** |
| | | * 工单表 |
| | | */ |
| | | @TableName(value="ope_feedback", autoResultMap = true) |
| | | |
| | | @TableName(value = "ope_work_order", autoResultMap = true) |
| | | @Data |
| | | @ToString |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "工单表") |
| | | public class OpeWorkOrder implements BaseEntity { |
| | | public static final long serialVersionUID = 202411061136001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 派单人ID |
| | | */ |
| | | * 派单人ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @NotNull |
| | | private Long dispatcher; |
| | | private Long dispatcherId; |
| | | |
| | | /** |
| | | * 巡检员ID |
| | | */ |
| | | * 巡检员ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @NotNull |
| | | private Long inspector; |
| | | private Long inspectorId; |
| | | |
| | | /** |
| | | * 任务类型;1-漏损处理,2-报警处理,3-反馈处理,4-其他 |
| | | */ |
| | | private Byte taskType; |
| | | * 任务类型ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long taskTypeId; |
| | | |
| | | /** |
| | | * 任务内容 |
| | | */ |
| | | @NotBlank |
| | | * 任务内容 |
| | | */ |
| | | private String taskContent; |
| | | |
| | | /** |
| | | * 完成标准 |
| | | */ |
| | | * 完成标准 |
| | | */ |
| | | private String completeCriteria; |
| | | |
| | | /** |
| | | * 要求完成时间;精确到分 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | * 要求完成时间;精确到分 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | private Date deadLine; |
| | | |
| | | /** |
| | | * 派单时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date dispatchTime; |
| | | |
| | | /** |
| | | * 处理结果;1-完成,2-未完成 |
| | | */ |
| | | private Byte taskResult; |
| | | |
| | | /** |
| | | * 结果照片 |
| | | */ |
| | | private String photos; |
| | | |
| | | /** |
| | | * 完工时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | * 任务完成时间;精确到分 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | private Date completeTime; |
| | | |
| | | /** |
| | | * 逻辑删除标识;未删除为0,已删除为删除时间 |
| | | */ |
| | | * 派单时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date dispatchTime; |
| | | |
| | | /** |
| | | * 农户问题上报ID |
| | | */ |
| | | private Long clientReportId; |
| | | |
| | | /** |
| | | * 巡检员问题上报ID |
| | | */ |
| | | private Long inspectorReportId; |
| | | |
| | | /** |
| | | * 状态;1-未完成,2-已完成 |
| | | */ |
| | | private Byte state; |
| | | |
| | | /** |
| | | * 驳回次数 |
| | | */ |
| | | private Integer rejectTimes; |
| | | |
| | | /** |
| | | * 逻辑删除标识;未删除为0,已删除为删除时间 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long deleted; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voOp; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-06 15:46 |
| | | * @LastEditTime 2024-11-06 15:46 |
| | | * @Description 工单视图对象 |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({"workOrderId", "dispatcherId", "dispatcher", "inspectorId", "inspector", "taskTypeId", "taskType", "taskContent", "completeCriteria", "deadLine", "clientReportId", "inspectorReportId", "completeTime", "dispatchTime", "rejectTimes", "state", "processingState"}) |
| | | public class VoWorkOrder implements BaseEntity { |
| | | public static final long serialVersionUID = 202411061524001L; |
| | | |
| | | /** |
| | | * 工单ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long workOrderId; |
| | | |
| | | /** |
| | | * 派单人ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long dispatcherId; |
| | | |
| | | /** |
| | | * 派单人姓名 |
| | | */ |
| | | private String dispatcher; |
| | | |
| | | /** |
| | | * 巡检员ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long inspectorId; |
| | | |
| | | /** |
| | | * 巡检员姓名 |
| | | */ |
| | | private String inspector; |
| | | |
| | | /** |
| | | * 任务类型ID |
| | | */ |
| | | //@JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | //private Long taskTypeId; |
| | | |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | private String taskType; |
| | | |
| | | /** |
| | | * 任务内容 |
| | | */ |
| | | private String taskContent; |
| | | |
| | | /** |
| | | * 完成标准 |
| | | */ |
| | | private String completeCriteria; |
| | | |
| | | /** |
| | | * 要求完成时间;精确到分 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | private Date deadLine; |
| | | |
| | | /** |
| | | * 农户问题上报ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long clientReportId; |
| | | |
| | | /** |
| | | * 巡检员问题上报ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long inspectorReportId; |
| | | |
| | | /** |
| | | * 任务完成时间;精确到分 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | private Date completeTime; |
| | | |
| | | /** |
| | | * 派单时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date dispatchTime; |
| | | |
| | | /** |
| | | * 驳回次数 |
| | | */ |
| | | private Integer rejectTimes; |
| | | |
| | | /** |
| | | * 工单状态 |
| | | */ |
| | | private String state; |
| | | |
| | | /** |
| | | * 处理状态 |
| | | */ |
| | | private String processingState; |
| | | } |
| | |
| | | /** |
| | | * 充值金额 |
| | | */ |
| | | private Integer rechargeAmount; |
| | | private Double rechargeAmount; |
| | | } |
| | |
| | | /** |
| | | * 充值金额 |
| | | */ |
| | | private Integer rechargeAmount; |
| | | private Double rechargeAmount; |
| | | |
| | | /** |
| | | * 充值后余额 |
| | |
| | | <item8 defaultValue = "80" unit = "3" sort = "4" type = "2"/> |
| | | </irrigateProfile> |
| | | <rechargeProfile> |
| | | <item1 rechargeAmount = "5000" sort = "1"/> |
| | | <item2 rechargeAmount = "10000" sort = "2" /> |
| | | <item3 rechargeAmount = "20000" sort = "3"/> |
| | | <item4 rechargeAmount = "30000" sort = "4"/> |
| | | <item5 rechargeAmount = "50000" sort = "5"/> |
| | | <item6 rechargeAmount = "100000" sort = "6"/> |
| | | <item1 rechargeAmount = "50" sort = "1"/> |
| | | <item2 rechargeAmount = "100" sort = "2" /> |
| | | <item3 rechargeAmount = "200" sort = "3"/> |
| | | <item4 rechargeAmount = "300" sort = "4"/> |
| | | <item5 rechargeAmount = "500" sort = "5"/> |
| | | <item6 rechargeAmount = "1000" sort = "6"/> |
| | | </rechargeProfile> |
| | | </org1> |
| | | <org2 tag="sp" name="沙盘" enable="true"> |
| | |
| | | <item8 defaultValue = "80" unit = "3" sort = "4" type = "2"/> |
| | | </irrigateProfile> |
| | | <rechargeProfile> |
| | | <item1 rechargeAmount = "5000" sort = "1"/> |
| | | <item2 rechargeAmount = "10000" sort = "2" /> |
| | | <item3 rechargeAmount = "20000" sort = "3"/> |
| | | <item4 rechargeAmount = "30000" sort = "4"/> |
| | | <item5 rechargeAmount = "50000" sort = "5"/> |
| | | <item6 rechargeAmount = "100000" sort = "6"/> |
| | | <item1 rechargeAmount = "50" sort = "1"/> |
| | | <item2 rechargeAmount = "100" sort = "2" /> |
| | | <item3 rechargeAmount = "200" sort = "3"/> |
| | | <item4 rechargeAmount = "300" sort = "4"/> |
| | | <item5 rechargeAmount = "500" sort = "5"/> |
| | | <item6 rechargeAmount = "1000" sort = "6"/> |
| | | </rechargeProfile> |
| | | </org2> |
| | | <org3 tag="test" name="测试" enable="true"> |
| | |
| | | <item8 defaultValue = "80" unit = "3" sort = "4" type = "2"/> |
| | | </irrigateProfile> |
| | | <rechargeProfile> |
| | | <item1 rechargeAmount = "5000" sort = "1"/> |
| | | <item2 rechargeAmount = "10000" sort = "2" /> |
| | | <item3 rechargeAmount = "20000" sort = "3"/> |
| | | <item4 rechargeAmount = "30000" sort = "4"/> |
| | | <item5 rechargeAmount = "50000" sort = "5"/> |
| | | <item6 rechargeAmount = "100000" sort = "6"/> |
| | | <item1 rechargeAmount = "50" sort = "1"/> |
| | | <item2 rechargeAmount = "100" sort = "2" /> |
| | | <item3 rechargeAmount = "200" sort = "3"/> |
| | | <item4 rechargeAmount = "300" sort = "4"/> |
| | | <item5 rechargeAmount = "500" sort = "5"/> |
| | | <item6 rechargeAmount = "1000" sort = "6"/> |
| | | </rechargeProfile> |
| | | </org3> |
| | | </orgs> |
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="com.dy.pipIrrGlobal.daoOp.OpeApproveResultMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoOp.OpeApproveResult"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ope_approve_result--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="work_order_id" jdbcType="BIGINT" property="workOrderId" /> |
| | | <result column="processing_result_id" jdbcType="BIGINT" property="processingResultId" /> |
| | | <result column="approver_id" jdbcType="BIGINT" property="approverId" /> |
| | | <result column="approve_time" jdbcType="TIMESTAMP" property="approveTime" /> |
| | | <result column="approve_result" jdbcType="TINYINT" property="approveResult" /> |
| | | <result column="deleted" jdbcType="BIGINT" property="deleted" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, work_order_id, processing_result_id, approver_id, approve_time, approve_result, |
| | | deleted |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from ope_approve_result |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from ope_approve_result |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeApproveResult"> |
| | | <!--@mbg.generated--> |
| | | insert into ope_approve_result (id, work_order_id, processing_result_id, |
| | | approver_id, approve_time, approve_result, |
| | | deleted) |
| | | values (#{id,jdbcType=BIGINT}, #{workOrderId,jdbcType=BIGINT}, #{processingResultId,jdbcType=BIGINT}, |
| | | #{approverId,jdbcType=BIGINT}, #{approveTime,jdbcType=TIMESTAMP}, #{approveResult,jdbcType=TINYINT}, |
| | | #{deleted,jdbcType=BIGINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeApproveResult"> |
| | | <!--@mbg.generated--> |
| | | insert into ope_approve_result |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="workOrderId != null"> |
| | | work_order_id, |
| | | </if> |
| | | <if test="processingResultId != null"> |
| | | processing_result_id, |
| | | </if> |
| | | <if test="approverId != null"> |
| | | approver_id, |
| | | </if> |
| | | <if test="approveTime != null"> |
| | | approve_time, |
| | | </if> |
| | | <if test="approveResult != null"> |
| | | approve_result, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="workOrderId != null"> |
| | | #{workOrderId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="processingResultId != null"> |
| | | #{processingResultId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="approverId != null"> |
| | | #{approverId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="approveTime != null"> |
| | | #{approveTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="approveResult != null"> |
| | | #{approveResult,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | #{deleted,jdbcType=BIGINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeApproveResult"> |
| | | <!--@mbg.generated--> |
| | | update ope_approve_result |
| | | <set> |
| | | <if test="workOrderId != null"> |
| | | work_order_id = #{workOrderId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="processingResultId != null"> |
| | | processing_result_id = #{processingResultId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="approverId != null"> |
| | | approver_id = #{approverId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="approveTime != null"> |
| | | approve_time = #{approveTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="approveResult != null"> |
| | | approve_result = #{approveResult,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=BIGINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeApproveResult"> |
| | | <!--@mbg.generated--> |
| | | update ope_approve_result |
| | | set work_order_id = #{workOrderId,jdbcType=BIGINT}, |
| | | processing_result_id = #{processingResultId,jdbcType=BIGINT}, |
| | | approver_id = #{approverId,jdbcType=BIGINT}, |
| | | approve_time = #{approveTime,jdbcType=TIMESTAMP}, |
| | | approve_result = #{approveResult,jdbcType=TINYINT}, |
| | | deleted = #{deleted,jdbcType=BIGINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
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="com.dy.pipIrrGlobal.daoOp.OpeProcessingResultMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ope_processing_result--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="work_order_id" jdbcType="BIGINT" property="workOrderId" /> |
| | | <result column="inspector_id" jdbcType="BIGINT" property="inspectorId" /> |
| | | <result column="content" jdbcType="VARCHAR" property="content" /> |
| | | <result column="images" jdbcType="JAVA_OBJECT" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" property="images" /> |
| | | <result column="audios" jdbcType="JAVA_OBJECT" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" property="audios" /> |
| | | <result column="videos" jdbcType="JAVA_OBJECT" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" property="videos" /> |
| | | <result column="lng" jdbcType="DECIMAL" property="lng" /> |
| | | <result column="lat" jdbcType="DECIMAL" property="lat" /> |
| | | <result column="complete_time" jdbcType="TIMESTAMP" property="completeTime" /> |
| | | <result column="report_time" jdbcType="TIMESTAMP" property="reportTime" /> |
| | | <result column="state" jdbcType="TINYINT" property="state" /> |
| | | <result column="deleted" jdbcType="BIGINT" property="deleted" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, work_order_id, inspector_id, content, images, audios, videos, lng, lat, complete_time, |
| | | report_time, `state`, deleted |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from ope_processing_result |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from ope_processing_result |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult"> |
| | | <!--@mbg.generated--> |
| | | insert into ope_processing_result (id, work_order_id, inspector_id, |
| | | content, images, audios, |
| | | videos, lng, lat, complete_time, |
| | | report_time, `state`, deleted |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{workOrderId,jdbcType=BIGINT}, #{inspectorId,jdbcType=BIGINT}, |
| | | #{content,jdbcType=VARCHAR}, #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, #{lng,jdbcType=DECIMAL}, #{lat,jdbcType=DECIMAL}, #{completeTime,jdbcType=TIMESTAMP}, |
| | | #{reportTime,jdbcType=TIMESTAMP}, #{state,jdbcType=TINYINT}, #{deleted,jdbcType=BIGINT} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult"> |
| | | <!--@mbg.generated--> |
| | | insert into ope_processing_result |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="workOrderId != null"> |
| | | work_order_id, |
| | | </if> |
| | | <if test="inspectorId != null"> |
| | | inspector_id, |
| | | </if> |
| | | <if test="content != null"> |
| | | content, |
| | | </if> |
| | | <if test="images != null"> |
| | | images, |
| | | </if> |
| | | <if test="audios != null"> |
| | | audios, |
| | | </if> |
| | | <if test="videos != null"> |
| | | videos, |
| | | </if> |
| | | <if test="lng != null"> |
| | | lng, |
| | | </if> |
| | | <if test="lat != null"> |
| | | lat, |
| | | </if> |
| | | <if test="completeTime != null"> |
| | | complete_time, |
| | | </if> |
| | | <if test="reportTime != null"> |
| | | report_time, |
| | | </if> |
| | | <if test="state != null"> |
| | | `state`, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="workOrderId != null"> |
| | | #{workOrderId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="inspectorId != null"> |
| | | #{inspectorId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="content != null"> |
| | | #{content,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="images != null"> |
| | | #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="audios != null"> |
| | | #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="videos != null"> |
| | | #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="lng != null"> |
| | | #{lng,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="lat != null"> |
| | | #{lat,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="completeTime != null"> |
| | | #{completeTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="reportTime != null"> |
| | | #{reportTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="state != null"> |
| | | #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | #{deleted,jdbcType=BIGINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult"> |
| | | <!--@mbg.generated--> |
| | | update ope_processing_result |
| | | <set> |
| | | <if test="workOrderId != null"> |
| | | work_order_id = #{workOrderId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="inspectorId != null"> |
| | | inspector_id = #{inspectorId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="content != null"> |
| | | content = #{content,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="images != null"> |
| | | images = #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="audios != null"> |
| | | audios = #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="videos != null"> |
| | | videos = #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | </if> |
| | | <if test="lng != null"> |
| | | lng = #{lng,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="lat != null"> |
| | | lat = #{lat,jdbcType=DECIMAL}, |
| | | </if> |
| | | <if test="completeTime != null"> |
| | | complete_time = #{completeTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="reportTime != null"> |
| | | report_time = #{reportTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="state != null"> |
| | | `state` = #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=BIGINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult"> |
| | | <!--@mbg.generated--> |
| | | update ope_processing_result |
| | | set work_order_id = #{workOrderId,jdbcType=BIGINT}, |
| | | inspector_id = #{inspectorId,jdbcType=BIGINT}, |
| | | content = #{content,jdbcType=VARCHAR}, |
| | | images = #{images,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | audios = #{audios,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | videos = #{videos,jdbcType=JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, |
| | | lng = #{lng,jdbcType=DECIMAL}, |
| | | lat = #{lat,jdbcType=DECIMAL}, |
| | | complete_time = #{completeTime,jdbcType=TIMESTAMP}, |
| | | report_time = #{reportTime,jdbcType=TIMESTAMP}, |
| | | `state` = #{state,jdbcType=TINYINT}, |
| | | deleted = #{deleted,jdbcType=BIGINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据workOrderId获取未删除的处理结果数量,添加结果上报前判断使用--> |
| | | <select id="getValidResultCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) FROM ope_processing_result WHERE deleted = 0 AND work_order_id = #{workOrderId} |
| | | </select> |
| | | </mapper> |
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="com.dy.pipIrrGlobal.daoOp.OpeTaskTypeMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoOp.OpeTaskType"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ope_task_type--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="task_type" jdbcType="VARCHAR" property="taskType" /> |
| | | <result column="deleted" jdbcType="BIGINT" property="deleted" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, task_type, deleted |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from ope_task_type |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from ope_task_type |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeTaskType"> |
| | | <!--@mbg.generated--> |
| | | insert into ope_task_type (id, task_type, deleted |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{taskType,jdbcType=VARCHAR}, #{deleted,jdbcType=BIGINT} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeTaskType"> |
| | | <!--@mbg.generated--> |
| | | insert into ope_task_type |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="taskType != null"> |
| | | task_type, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="taskType != null"> |
| | | #{taskType,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | #{deleted,jdbcType=BIGINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeTaskType"> |
| | | <!--@mbg.generated--> |
| | | update ope_task_type |
| | | <set> |
| | | <if test="taskType != null"> |
| | | task_type = #{taskType,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=BIGINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeTaskType"> |
| | | <!--@mbg.generated--> |
| | | update ope_task_type |
| | | set task_type = #{taskType,jdbcType=VARCHAR}, |
| | | deleted = #{deleted,jdbcType=BIGINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | <!--@mbg.generated--> |
| | | <!--@Table ope_work_order--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="dispatcher" jdbcType="BIGINT" property="dispatcher" /> |
| | | <result column="inspector" jdbcType="BIGINT" property="inspector" /> |
| | | <result column="task_type" jdbcType="TINYINT" property="taskType" /> |
| | | <result column="dispatcher_id" jdbcType="BIGINT" property="dispatcherId" /> |
| | | <result column="inspector_id" jdbcType="BIGINT" property="inspectorId" /> |
| | | <result column="task_type_id" jdbcType="BIGINT" property="taskTypeId" /> |
| | | <result column="task_content" jdbcType="VARCHAR" property="taskContent" /> |
| | | <result column="complete_criteria" jdbcType="VARCHAR" property="completeCriteria" /> |
| | | <result column="dead_line" jdbcType="TIMESTAMP" property="deadLine" /> |
| | | <result column="dispatch_time" jdbcType="TIMESTAMP" property="dispatchTime" /> |
| | | <result column="task_result" jdbcType="TINYINT" property="taskResult" /> |
| | | <result column="photos" jdbcType="VARCHAR" property="photos" /> |
| | | <result column="complete_time" jdbcType="TIMESTAMP" property="completeTime" /> |
| | | <result column="dispatch_time" jdbcType="TIMESTAMP" property="dispatchTime" /> |
| | | <result column="client_report_id" jdbcType="BIGINT" property="clientReportId" /> |
| | | <result column="inspector_report_id" jdbcType="BIGINT" property="inspectorReportId" /> |
| | | <result column="state" jdbcType="TINYINT" property="state" /> |
| | | <result column="reject_times" jdbcType="INTEGER" property="rejectTimes" /> |
| | | <result column="deleted" jdbcType="BIGINT" property="deleted" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, dispatcher, inspector, task_type, task_content, complete_criteria, dead_line, |
| | | dispatch_time, task_result, photos, complete_time, deleted |
| | | id, dispatcher_id, inspector_id, task_type_id, task_content, complete_criteria, dead_line, |
| | | complete_time, dispatch_time, client_report_id, inspector_report_id, `state`, reject_times, |
| | | deleted |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder"> |
| | | <!--@mbg.generated--> |
| | | insert into ope_work_order (id, dispatcher, inspector, |
| | | task_type, task_content, complete_criteria, |
| | | dead_line, dispatch_time, task_result, |
| | | photos, complete_time, deleted |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{dispatcher,jdbcType=BIGINT}, #{inspector,jdbcType=BIGINT}, |
| | | #{taskType,jdbcType=TINYINT}, #{taskContent,jdbcType=VARCHAR}, #{completeCriteria,jdbcType=VARCHAR}, |
| | | #{deadLine,jdbcType=TIMESTAMP}, #{dispatchTime,jdbcType=TIMESTAMP}, #{taskResult,jdbcType=TINYINT}, |
| | | #{photos,jdbcType=VARCHAR}, #{completeTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIGINT} |
| | | ) |
| | | insert into ope_work_order (id, dispatcher_id, inspector_id, |
| | | task_type_id, task_content, complete_criteria, |
| | | dead_line, complete_time, dispatch_time, |
| | | client_report_id, inspector_report_id, `state`, |
| | | reject_times, deleted) |
| | | values (#{id,jdbcType=BIGINT}, #{dispatcherId,jdbcType=BIGINT}, #{inspectorId,jdbcType=BIGINT}, |
| | | #{taskTypeId,jdbcType=BIGINT}, #{taskContent,jdbcType=VARCHAR}, #{completeCriteria,jdbcType=VARCHAR}, |
| | | #{deadLine,jdbcType=TIMESTAMP}, #{completeTime,jdbcType=TIMESTAMP}, #{dispatchTime,jdbcType=TIMESTAMP}, |
| | | #{clientReportId,jdbcType=BIGINT}, #{inspectorReportId,jdbcType=BIGINT}, #{state,jdbcType=TINYINT}, |
| | | #{rejectTimes,jdbcType=INTEGER}, #{deleted,jdbcType=BIGINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder"> |
| | | <!--@mbg.generated--> |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="dispatcher != null"> |
| | | dispatcher, |
| | | <if test="dispatcherId != null"> |
| | | dispatcher_id, |
| | | </if> |
| | | <if test="inspector != null"> |
| | | inspector, |
| | | <if test="inspectorId != null"> |
| | | inspector_id, |
| | | </if> |
| | | <if test="taskType != null"> |
| | | task_type, |
| | | <if test="taskTypeId != null"> |
| | | task_type_id, |
| | | </if> |
| | | <if test="taskContent != null"> |
| | | task_content, |
| | |
| | | <if test="deadLine != null"> |
| | | dead_line, |
| | | </if> |
| | | <if test="completeTime != null"> |
| | | complete_time, |
| | | </if> |
| | | <if test="dispatchTime != null"> |
| | | dispatch_time, |
| | | </if> |
| | | <if test="taskResult != null"> |
| | | task_result, |
| | | <if test="clientReportId != null"> |
| | | client_report_id, |
| | | </if> |
| | | <if test="photos != null"> |
| | | photos, |
| | | <if test="inspectorReportId != null"> |
| | | inspector_report_id, |
| | | </if> |
| | | <if test="completeTime != null"> |
| | | complete_time, |
| | | <if test="state != null"> |
| | | `state`, |
| | | </if> |
| | | <if test="rejectTimes != null"> |
| | | reject_times, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted, |
| | |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dispatcher != null"> |
| | | #{dispatcher,jdbcType=BIGINT}, |
| | | <if test="dispatcherId != null"> |
| | | #{dispatcherId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="inspector != null"> |
| | | #{inspector,jdbcType=BIGINT}, |
| | | <if test="inspectorId != null"> |
| | | #{inspectorId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="taskType != null"> |
| | | #{taskType,jdbcType=TINYINT}, |
| | | <if test="taskTypeId != null"> |
| | | #{taskTypeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="taskContent != null"> |
| | | #{taskContent,jdbcType=VARCHAR}, |
| | |
| | | <if test="deadLine != null"> |
| | | #{deadLine,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="completeTime != null"> |
| | | #{completeTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="dispatchTime != null"> |
| | | #{dispatchTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="taskResult != null"> |
| | | #{taskResult,jdbcType=TINYINT}, |
| | | <if test="clientReportId != null"> |
| | | #{clientReportId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="photos != null"> |
| | | #{photos,jdbcType=VARCHAR}, |
| | | <if test="inspectorReportId != null"> |
| | | #{inspectorReportId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="completeTime != null"> |
| | | #{completeTime,jdbcType=TIMESTAMP}, |
| | | <if test="state != null"> |
| | | #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="rejectTimes != null"> |
| | | #{rejectTimes,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | #{deleted,jdbcType=BIGINT}, |
| | |
| | | <!--@mbg.generated--> |
| | | update ope_work_order |
| | | <set> |
| | | <if test="dispatcher != null"> |
| | | dispatcher = #{dispatcher,jdbcType=BIGINT}, |
| | | <if test="dispatcherId != null"> |
| | | dispatcher_id = #{dispatcherId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="inspector != null"> |
| | | inspector = #{inspector,jdbcType=BIGINT}, |
| | | <if test="inspectorId != null"> |
| | | inspector_id = #{inspectorId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="taskType != null"> |
| | | task_type = #{taskType,jdbcType=TINYINT}, |
| | | <if test="taskTypeId != null"> |
| | | task_type_id = #{taskTypeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="taskContent != null"> |
| | | task_content = #{taskContent,jdbcType=VARCHAR}, |
| | |
| | | <if test="deadLine != null"> |
| | | dead_line = #{deadLine,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="completeTime != null"> |
| | | complete_time = #{completeTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="dispatchTime != null"> |
| | | dispatch_time = #{dispatchTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="taskResult != null"> |
| | | task_result = #{taskResult,jdbcType=TINYINT}, |
| | | <if test="clientReportId != null"> |
| | | client_report_id = #{clientReportId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="photos != null"> |
| | | photos = #{photos,jdbcType=VARCHAR}, |
| | | <if test="inspectorReportId != null"> |
| | | inspector_report_id = #{inspectorReportId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="completeTime != null"> |
| | | complete_time = #{completeTime,jdbcType=TIMESTAMP}, |
| | | <if test="state != null"> |
| | | `state` = #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="rejectTimes != null"> |
| | | reject_times = #{rejectTimes,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=BIGINT}, |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder"> |
| | | <!--@mbg.generated--> |
| | | update ope_work_order |
| | | set dispatcher = #{dispatcher,jdbcType=BIGINT}, |
| | | inspector = #{inspector,jdbcType=BIGINT}, |
| | | task_type = #{taskType,jdbcType=TINYINT}, |
| | | set dispatcher_id = #{dispatcherId,jdbcType=BIGINT}, |
| | | inspector_id = #{inspectorId,jdbcType=BIGINT}, |
| | | task_type_id = #{taskTypeId,jdbcType=BIGINT}, |
| | | task_content = #{taskContent,jdbcType=VARCHAR}, |
| | | complete_criteria = #{completeCriteria,jdbcType=VARCHAR}, |
| | | dead_line = #{deadLine,jdbcType=TIMESTAMP}, |
| | | dispatch_time = #{dispatchTime,jdbcType=TIMESTAMP}, |
| | | task_result = #{taskResult,jdbcType=TINYINT}, |
| | | photos = #{photos,jdbcType=VARCHAR}, |
| | | complete_time = #{completeTime,jdbcType=TIMESTAMP}, |
| | | dispatch_time = #{dispatchTime,jdbcType=TIMESTAMP}, |
| | | client_report_id = #{clientReportId,jdbcType=BIGINT}, |
| | | inspector_report_id = #{inspectorReportId,jdbcType=BIGINT}, |
| | | `state` = #{state,jdbcType=TINYINT}, |
| | | reject_times = #{rejectTimes,jdbcType=INTEGER}, |
| | | deleted = #{deleted,jdbcType=BIGINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据主键获取工单视图对象--> |
| | | <select id="getWorkOrderById" resultType="com.dy.pipIrrGlobal.voOp.VoWorkOrder"> |
| | | SELECT |
| | | ord.id AS workOrderId, |
| | | ord.dispatcher_id AS dispatcherId, |
| | | us1.name AS dispatcher, |
| | | ord.inspector_id AS inspectorId, |
| | | us2.name AS inspector, |
| | | typ.task_type AS taskType, |
| | | ord.task_content AS taskContent, |
| | | ord.complete_criteria AS completeCriteria, |
| | | ord.dead_line AS deadLine, |
| | | ord.client_report_id AS clientReportId, |
| | | ord.inspector_report_id AS inspectorReportId, |
| | | ord.complete_time AS completeTime, |
| | | ord.dispatch_time AS dispatchTime, |
| | | ord.reject_times AS rejectTimes, |
| | | CASE |
| | | WHEN ord.state = 1 THEN '未完成' |
| | | WHEN ord.state = 2 THEN '已完成' |
| | | END AS state, |
| | | CASE |
| | | WHEN res.state = 1 THEN '已上报' |
| | | WHEN res.state = 2 THEN '已通过' |
| | | WHEN res.state = 3 THEN '已驳回' |
| | | ELSE '未上报' |
| | | END AS processingState |
| | | FROM ope_work_order ord |
| | | INNER JOIN ba_user us1 ON us1.id = ord.dispatcher_id |
| | | INNER JOIN ba_user us2 ON us2.id = ord.inspector_id |
| | | INNER JOIN ope_task_type typ ON typ.id = ord.task_type_id |
| | | LEFT JOIN ope_processing_result res ON res.work_order_id = ord.id |
| | | WHERE ord.deleted = 0 AND ord.id = #{workOrderId} |
| | | </select> |
| | | |
| | | <!--获取指定派单人的指定未删除工单,删除工单前判断使用使用--> |
| | | <select id="getWorkOrder" resultType="com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder"> |
| | | SELECT * FROM ope_work_order |
| | | WHERE deleted = 0 AND id = #{workOrderId} AND dispatcher_id = #{dispatcherId} LIMIT 1 |
| | | </select> |
| | | |
| | | <!--逻辑删除一个未删除的工单--> |
| | | <update id="deleteWorkOrder"> |
| | | UPDATE ope_work_order SET deleted = UNIX_TIMESTAMP() WHERE deleted = 0 AND id = #{workOrderId} |
| | | </update> |
| | | |
| | | <!-- 根据指定条件获取工单数量--> |
| | | <select id="getWorkOrdersCount" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(*) AS recordCount |
| | | FROM ope_work_order ord |
| | | INNER JOIN ba_user us1 ON us1.id = ord.dispatcher_id |
| | | INNER JOIN ba_user us2 ON us2.id = ord.inspector_id |
| | | INNER JOIN ope_task_type typ ON typ.id = ord.task_type_id |
| | | LEFT JOIN ope_processing_result res ON res.work_order_id = ord.id |
| | | <where> |
| | | AND ord.deleted = 0 |
| | | |
| | | <if test = "dispatcher != null and dispatcher !=''"> |
| | | AND us1.name like CONCAT('%',#{dispatcher},'%') |
| | | </if> |
| | | |
| | | <if test = "inspector != null and inspector !=''"> |
| | | AND us2.name like CONCAT('%',#{inspector},'%') |
| | | </if> |
| | | |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND ord.dispatch_time BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getWorkOrders" resultType="com.dy.pipIrrGlobal.voOp.VoWorkOrder"> |
| | | SELECT |
| | | ord.id AS workOrderId, |
| | | ord.dispatcher_id AS dispatcherId, |
| | | us1.name AS dispatcher, |
| | | ord.inspector_id AS inspectorId, |
| | | us2.name AS inspector, |
| | | typ.task_type AS taskType, |
| | | ord.task_content AS taskContent, |
| | | ord.complete_criteria AS completeCriteria, |
| | | ord.dead_line AS deadLine, |
| | | ord.client_report_id AS clientReportId, |
| | | ord.inspector_report_id AS inspectorReportId, |
| | | ord.complete_time AS completeTime, |
| | | ord.dispatch_time AS dispatchTime, |
| | | ord.reject_times AS rejectTimes, |
| | | CASE |
| | | WHEN ord.state = 1 THEN '未完成' |
| | | WHEN ord.state = 2 THEN '已完成' |
| | | END AS state, |
| | | CASE |
| | | WHEN res.state = 1 THEN '已上报' |
| | | WHEN res.state = 2 THEN '已通过' |
| | | WHEN res.state = 3 THEN '已驳回' |
| | | ELSE '未上报' |
| | | END AS processingState |
| | | FROM ope_work_order ord |
| | | INNER JOIN ba_user us1 ON us1.id = ord.dispatcher_id |
| | | INNER JOIN ba_user us2 ON us2.id = ord.inspector_id |
| | | INNER JOIN ope_task_type typ ON typ.id = ord.task_type_id |
| | | LEFT JOIN ope_processing_result res ON res.work_order_id = ord.id |
| | | <where> |
| | | AND ord.deleted = 0 |
| | | |
| | | <if test = "dispatcher != null and dispatcher !=''"> |
| | | AND us1.name like CONCAT('%',#{dispatcher},'%') |
| | | </if> |
| | | |
| | | <if test = "inspector != null and inspector !=''"> |
| | | AND us2.name like CONCAT('%',#{inspector},'%') |
| | | </if> |
| | | |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND ord.dispatch_time BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY ord.dispatch_time DESC |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | </mapper> |
| | |
| | | SELECT |
| | | id, |
| | | vc_num AS vcNum, |
| | | ROUND(money / 100, 2) AS money, |
| | | <!-- ROUND(money / 100, 2) AS money,--> |
| | | money, |
| | | in_use AS inUse, |
| | | (CASE |
| | | WHEN money <= #{alarmValue} THEN true |
| | |
| | | package com.dy.pipIrrApp.workOrder; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrApp.workOrder.dto.DtoDeleteWorkOrder; |
| | | import com.dy.pipIrrApp.workOrder.qo.QoWorkOrder; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder; |
| | | import com.dy.pipIrrGlobal.voOp.VoWorkOrder; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.client.exception.MQBrokerException; |
| | |
| | | import org.apache.rocketmq.remoting.exception.RemotingException; |
| | | import org.apache.rocketmq.spring.core.RocketMQTemplate; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | @Autowired |
| | | private RocketMQTemplate rocketMQTemplate; |
| | | |
| | | @Value("${rocketmq.name-server}") |
| | | protected String nameServer; |
| | | |
| | | @GetMapping("/sendWorkOrder") |
| | | @Value("${rocketmq.producer.group}") |
| | | protected String producerGroup; |
| | | |
| | | @Value("${rocketmq.topic}") |
| | | protected String topic; |
| | | |
| | | /** |
| | | * 创建工单 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "addWorkOrder", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public void sendWorkOrder() throws MQClientException, MQBrokerException, RemotingException, InterruptedException { |
| | | ConsumerListener_push ConsumerListener_push = new ConsumerListener_push(); |
| | | ConsumerListener_push.receiveMessage(); |
| | | public BaseResponse<Boolean> addWorkOrder(@RequestBody @Valid OpeWorkOrder po, BindingResult bindingResult) throws MQBrokerException, RemotingException, InterruptedException, MQClientException { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | String topic = "workOrder"; |
| | | String tag = "王五"; |
| | | String key = "11"; |
| | | String message = "Hello World"; |
| | | //SendResult sendResult = rocketMQTemplate.syncSend(topic + ":" + tag, message); |
| | | //System.out.println("send result:" + sendResult.toString()); |
| | | if(po.getClientReportId() != null && po.getInspectorReportId() != null) { |
| | | return BaseResponseUtils.buildErrorMsg("工单仅能关联一个问题上报"); |
| | | } |
| | | |
| | | DefaultMQProducer producer = new DefaultMQProducer("producer_group"); |
| | | producer.setNamesrvAddr("127.0.0.1:9876"); |
| | | producer.start(); |
| | | Message msg = new Message(topic,tag,"11",message.getBytes(StandardCharsets.UTF_8)); |
| | | SendResult approveSendResult = producer.send(msg); |
| | | System.out.println("send result:" + approveSendResult.toString()); |
| | | Long workOrderId = workOrderSv.insertWorkOrder(po); |
| | | if(workOrderId == null || workOrderId == 0) { |
| | | return BaseResponseUtils.buildErrorMsg("创建工单失败"); |
| | | } |
| | | |
| | | VoWorkOrder voWorkOrder = workOrderSv.getWorkOrderById(workOrderId); |
| | | if(voWorkOrder == null) { |
| | | return BaseResponseUtils.buildErrorMsg("获取工单失败"); |
| | | } |
| | | |
| | | if(!sendWorkOrder(voWorkOrder, workOrderId)) { |
| | | return BaseResponseUtils.buildErrorMsg("工单推送失败"); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(); |
| | | } |
| | | |
| | | /** |
| | | * 通过RocketMQ推送工单主键 |
| | | * @param voWorkOrder 工单视图对象 |
| | | * @param workOrderId 工单ID |
| | | * @return |
| | | * @throws MQClientException |
| | | * @throws MQBrokerException |
| | | * @throws RemotingException |
| | | * @throws InterruptedException |
| | | */ |
| | | private Boolean sendWorkOrder(VoWorkOrder voWorkOrder, Long workOrderId) throws MQClientException, MQBrokerException, RemotingException, InterruptedException { |
| | | String tag = voWorkOrder.getInspector(); |
| | | String key = voWorkOrder.getInspectorId().toString(); |
| | | //String message = JSON.toJSONString(voWorkOrder); |
| | | String message = workOrderId.toString(); |
| | | |
| | | DefaultMQProducer producer = new DefaultMQProducer(producerGroup); |
| | | producer.setNamesrvAddr(nameServer); |
| | | producer.start(); |
| | | Message msg = new Message(topic, tag, key, message.getBytes(StandardCharsets.UTF_8)); |
| | | SendResult approveSendResult = producer.send(msg); |
| | | if(!approveSendResult.getSendStatus().toString().equals("SEND_OK")) { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 逻辑删除指定派单人的指定未删除工单 |
| | | * 先判断指定派单人、未删除的指定工单是否存在 |
| | | * @param deleteWorkOrder 删除工单传输类 |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "deleteWorkOrder") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> deleteWorkOrder(@RequestBody @Valid DtoDeleteWorkOrder deleteWorkOrder, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | OpeWorkOrder workOrder = workOrderSv.getWorkOrder(deleteWorkOrder.getDispatcherId(), deleteWorkOrder.getWorkOrderId()); |
| | | if(workOrder == null) { |
| | | return BaseResponseUtils.buildErrorMsg("您要删除的工单不存在"); |
| | | } |
| | | |
| | | if(workOrderSv.deleteWorkOrder(deleteWorkOrder.getWorkOrderId()) == 0) { |
| | | return BaseResponseUtils.buildErrorMsg("工单删除失败"); |
| | | } |
| | | |
| | | |
| | | return BaseResponseUtils.buildSuccess(); |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取未删除的工单列表 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getWorkOrders") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoWorkOrder>>> getWorkOrders(QoWorkOrder qo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(workOrderSv.getWorkOrders(qo)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取工单详情 |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getOneWorkOrder") |
| | | public BaseResponse<VoWorkOrder> getOneWorkOrder(@RequestParam("workOrderId") Long workOrderId) { |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(workOrderSv.getWorkOrderById(workOrderId)); |
| | | } catch (Exception e) { |
| | | log.error("获取工单详情异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 上报工单处理结果 |
| | | * 判断该工单是否存在有效的处理结果,如果存在则提示用户该工单已存在处理结果 |
| | | * 添加处理结果回复 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "addProcessingResult") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public BaseResponse<Boolean> addProcessingResult(@RequestBody @Valid OpeProcessingResult po, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | if(workOrderSv.hasValidProcessingResult(po.getWorkOrderId())) { |
| | | return BaseResponseUtils.buildErrorMsg("该工单存在有效的处理结果"); |
| | | } |
| | | |
| | | Long processingResultId = workOrderSv.insertProcessingResult(po); |
| | | if(processingResultId == null) { |
| | | return BaseResponseUtils.buildErrorMsg("上报工单处理结果失败"); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.pipIrrApp.workOrder; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrApp.workOrder.qo.QoWorkOrder; |
| | | import com.dy.pipIrrGlobal.daoOp.OpeProcessingResultMapper; |
| | | import com.dy.pipIrrGlobal.daoOp.OpeWorkOrderMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeProcessingResult; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder; |
| | | import com.dy.pipIrrGlobal.voOp.VoWorkOrder; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class WorkOrderSv { |
| | | @Autowired |
| | | private OpeWorkOrderMapper opeWorkOrderMapper; |
| | | |
| | | @Autowired |
| | | private OpeProcessingResultMapper opeProcessingResultMapper; |
| | | |
| | | /** |
| | | * 添加工单记录 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Long insertWorkOrder(OpeWorkOrder po) { |
| | | po.setDispatchTime(new Date()); |
| | | po.setState((byte) 1); |
| | | po.setRejectTimes(0); |
| | | po.setDeleted(0L); |
| | | |
| | | opeWorkOrderMapper.insert(po); |
| | | return po.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 获取指定派单人的指定未删除工单,删除工单前判断使用使用 |
| | | * @param dispatcherId |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | public OpeWorkOrder getWorkOrder(Long dispatcherId, Long workOrderId) { |
| | | return opeWorkOrderMapper.getWorkOrder(dispatcherId, workOrderId); |
| | | } |
| | | |
| | | /** |
| | | * 逻辑删除一个未删除的工单 |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | public Integer deleteWorkOrder(Long workOrderId) { |
| | | return opeWorkOrderMapper.deleteWorkOrder(workOrderId); |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取工单 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoWorkOrder>> getWorkOrders(QoWorkOrder qo) { |
| | | qo.completionTime() ; |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = opeWorkOrderMapper.getWorkOrdersCount(params); |
| | | |
| | | QueryResultVo<List<VoWorkOrder>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = opeWorkOrderMapper.getWorkOrders(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据工单主键获取工单视图对象 |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | public VoWorkOrder getWorkOrderById(Long workOrderId) { |
| | | return opeWorkOrderMapper.getWorkOrderById(workOrderId); |
| | | } |
| | | |
| | | /** |
| | | * 根据workOrderId获取未删除的处理结果数量,添加结果上报前判断使用 |
| | | * @param workOrderId |
| | | * @return |
| | | */ |
| | | public Boolean hasValidProcessingResult(Long workOrderId) { |
| | | if (opeProcessingResultMapper.getValidResultCount(workOrderId) == 0) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 上报工单处理结果 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Long insertProcessingResult(OpeProcessingResult po) { |
| | | po.setReportTime(new Date()); |
| | | po.setState((byte)1); |
| | | po.setDeleted(0L); |
| | | opeProcessingResultMapper.insert(po); |
| | | return po.getId(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrApp.workOrder.dto; |
| | | |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-07 13:43 |
| | | * @LastEditTime 2024-11-07 13:43 |
| | | * @Description 删除工单传输类 |
| | | */ |
| | | |
| | | @Data |
| | | public class DtoDeleteWorkOrder { |
| | | public static final long serialVersionUID = 202411071344001L; |
| | | |
| | | /** |
| | | * 派单人ID |
| | | */ |
| | | @NotNull(message = "派单人不能为空") |
| | | private Long dispatcherId; |
| | | |
| | | /** |
| | | * 工单ID |
| | | */ |
| | | @NotNull(message = "工单不能为空") |
| | | private Long workOrderId; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrApp.workOrder.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-11-07 17:07 |
| | | * @LastEditTime 2024-11-07 17:07 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | public class QoWorkOrder extends QueryConditionVo { |
| | | /** |
| | | * 派单人姓名 |
| | | */ |
| | | private String dispatcher; |
| | | |
| | | /** |
| | | * 巡检员姓名 |
| | | */ |
| | | private String inspector; |
| | | |
| | | /** |
| | | * 查询开始时间 |
| | | */ |
| | | private String timeStart; |
| | | |
| | | /** |
| | | * 查询结束时间 |
| | | */ |
| | | private String timeStop; |
| | | |
| | | public void completionTime(){ |
| | | if(this.timeStart != null && !this.timeStart.trim().equals("")) { |
| | | this.timeStart = timeStart + " 00:00:00"; |
| | | } |
| | | if(this.timeStop != null && !this.timeStart.trim().equals("")) { |
| | | this.timeStop = timeStop + " 23:59:59"; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | context-parameters: |
| | | #GenerateIdSetSuffixListener中应用,取值范围是0-99 |
| | | idSuffix: ${pipIrr.app.idSuffix} |
| | | |
| | | rocketmq: |
| | | topic: "workOrder" |
| | | consumer: |
| | | group: consumer_group |
| | | # 一次拉取消息最大值,注意是拉取消息的最大值而非消费最大值 |
| | | pull-batch-size: 10 |
| | | name-server: 127.0.0.1:9876 |
| | | producer: |
| | | # 发送同一类消息的设置为同一个group,保证唯一 |
| | | group: producer_group |
| | | # 发送消息超时时间,默认3000 |
| | | sendMessageTimeout: 10000 |
| | | # 发送消息失败重试次数,默认2 |
| | | retryTimesWhenSendFailed: 2 |
| | | # 异步消息重试次数,默认2 |
| | | retryTimesWhenSendAsyncFailed: 2 |
| | | # 消息最大长度,默认1024 * 1024 * 4(默认4M) |
| | | maxMessageSize: 4096 |
| | | # 压缩消息阈值,默认4k(1024 * 4) |
| | | compressMessageBodyThreshold: 4096 |
| | | # 是否在内部发送失败时重试另一个broker,默认false |
| | | retryNextServer: false |
| | |
| | | */ |
| | | Param myParam = new Param(); |
| | | myParam.setComId(comId); |
| | | myParam.setComType((byte)2); |
| | | myParam.setComType((byte)1); |
| | | myParam.setCommandCode(commandCode); |
| | | myParam.setCommandName(CodeV1.getCodeName(commandCode)); |
| | | myParam.setIntakeId(intakeId); |
| | |
| | | */ |
| | | Param myParam = new Param(); |
| | | myParam.setComId(comId); |
| | | myParam.setComType((byte)2); |
| | | myParam.setComType((byte)1); |
| | | myParam.setCommandCode(commandCode); |
| | | myParam.setCommandName(CodeV1.getCodeName(commandCode)); |
| | | myParam.setIntakeId(intakeId); |
| | |
| | | */ |
| | | Param myParam = new Param(); |
| | | myParam.setComId(comId); |
| | | myParam.setComType((byte)2); |
| | | myParam.setComType((byte)1); |
| | | myParam.setCommandCode(commandCode); |
| | | myParam.setCommandName(CodeV1.getCodeName(commandCode)); |
| | | myParam.setIntakeId(intakeId); |
| | |
| | | */ |
| | | Param myParam = new Param(); |
| | | myParam.setComId(comId); |
| | | myParam.setComType((byte)2); |
| | | myParam.setComType((byte)1); |
| | | myParam.setCommandCode(commandCode); |
| | | myParam.setCommandName(CodeV1.getCodeName(commandCode)); |
| | | myParam.setIntakeId(intakeId); |