代码提交普测计划
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.bpm.listener.business;
|
||||||
|
|
||||||
|
import com.njcn.bpm.listener.BpmProcessInstanceStatusEvent;
|
||||||
|
import com.njcn.bpm.listener.BpmProcessInstanceStatusEventListener;
|
||||||
|
import com.njcn.supervision.api.GeneralSurveyFeignClient;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class BpmGeneralSurveyStatusListener extends BpmProcessInstanceStatusEventListener {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private GeneralSurveyFeignClient generalSurveyFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getProcessDefinitionKey() {
|
||||||
|
return "harmonic_survey";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
||||||
|
generalSurveyFeignClient.updateStatus(event.getBusinessKey(), event.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.njcn.supervision.api;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.supervision.api.fallback.GeneralSurveyFeignClientFallbackFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例 Api 接口
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.SUPERVISION, path = "/generalSurvey", fallbackFactory = GeneralSurveyFeignClientFallbackFactory.class)
|
||||||
|
public interface GeneralSurveyFeignClient {
|
||||||
|
|
||||||
|
@GetMapping("/updateStatus")
|
||||||
|
HttpResult<Object> updateStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.njcn.supervision.api.fallback;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.supervision.api.GeneralSurveyFeignClient;
|
||||||
|
import com.njcn.supervision.utils.SupervisionEnumUtil;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author denghuajun
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2022/3/16
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class GeneralSurveyFeignClientFallbackFactory implements FallbackFactory<GeneralSurveyFeignClient> {
|
||||||
|
@Override
|
||||||
|
public GeneralSurveyFeignClient create(Throwable throwable) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (throwable.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||||
|
exceptionEnum = SupervisionEnumUtil.getExceptionEnum(businessException.getResult());
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new GeneralSurveyFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<Object> updateStatus(String businessKey, Integer status) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "更新普测计划流程状态", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package com.njcn.supervision.pojo.param.survey;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/5/13 18:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class SupervisionGeneralSurveyPlanParm {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="单位ID")
|
||||||
|
private String orgNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="普测计划名称")
|
||||||
|
private String planName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划生成时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="计划生成时间")
|
||||||
|
private LocalDate planCreateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划开始时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="计划开始时间")
|
||||||
|
private LocalDate planStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划结束时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="计划结束时间")
|
||||||
|
private LocalDate planEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际完成时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="实际完成时间")
|
||||||
|
private LocalDate planComplateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划负责人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="计划负责人")
|
||||||
|
private String leader;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="选中的电站集合")
|
||||||
|
private List<String> subIds;
|
||||||
|
|
||||||
|
@ApiModelProperty("发起人自选审批人 Map")
|
||||||
|
private Map<String, List<String>> startUserSelectAssignees;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="详情")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件是否上传(0:否 1:是)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="文件是否上传(0:否 1:是)")
|
||||||
|
private Integer isFileUpload;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="上传文件数量")
|
||||||
|
private Integer fileCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件路径
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="文件路径")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SupervisionGeneralSurveyPlanUpdate extends SupervisionGeneralSurveyPlanParm {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="普测计划编号")
|
||||||
|
private String planNo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class GeneralSurveyPlanQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value="所属区域")
|
||||||
|
private String orgNo;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.njcn.supervision.pojo.po.survey;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/5/13 18:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@ApiModel(description="")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "supervision_general_survey_plan_detail")
|
||||||
|
public class SupervisionGeneralSurveyPlanDetailPO extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 普测计划编号
|
||||||
|
*/
|
||||||
|
@MppMultiId(value = "plan_no")
|
||||||
|
@ApiModelProperty(value="普测计划编号")
|
||||||
|
private String planNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站ID
|
||||||
|
*/
|
||||||
|
@MppMultiId(value = "sub_id")
|
||||||
|
@ApiModelProperty(value="变电站ID")
|
||||||
|
private String subId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "sub_name")
|
||||||
|
@ApiModelProperty(value="变电站名称")
|
||||||
|
private String subName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站电压等级
|
||||||
|
*/
|
||||||
|
@TableField(value = "voltage_level")
|
||||||
|
@ApiModelProperty(value="变电站电压等级")
|
||||||
|
private String voltageLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 容量
|
||||||
|
*/
|
||||||
|
@TableField(value = "capacity")
|
||||||
|
@ApiModelProperty(value="容量")
|
||||||
|
private Long capacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线监测点id
|
||||||
|
*/
|
||||||
|
@TableField(value = "measurement_point_id")
|
||||||
|
@ApiModelProperty(value="在线监测点id")
|
||||||
|
private String measurementPointId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否生成问题(0:否 1:是)
|
||||||
|
*/
|
||||||
|
@TableField(value = "is_problem")
|
||||||
|
@ApiModelProperty(value="是否生成问题(0:否 1:是)")
|
||||||
|
private Integer isProblem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否实现监测(0:否 1:是)
|
||||||
|
*/
|
||||||
|
@TableField(value = "is_survey")
|
||||||
|
@ApiModelProperty(value="是否实现监测(0:否 1:是)")
|
||||||
|
private Integer isSurvey;
|
||||||
|
/**
|
||||||
|
* 状态:0-删除 1-正常
|
||||||
|
*/
|
||||||
|
@TableField(value = "`State`")
|
||||||
|
private Integer state;
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.njcn.supervision.pojo.po.survey;
|
||||||
|
|
||||||
|
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.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/5/13 18:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "supervision_general_survey_plan")
|
||||||
|
public class SupervisionGeneralSurveyPlanPO extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 普测计划编号
|
||||||
|
*/
|
||||||
|
@TableId(value = "plan_no", type = IdType.ASSIGN_UUID)
|
||||||
|
private String planNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位ID
|
||||||
|
*/
|
||||||
|
@TableField(value = "org_no")
|
||||||
|
private String orgNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "plan_name")
|
||||||
|
private String planName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划生成时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "plan_create_time")
|
||||||
|
private LocalDate planCreateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划开始时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "plan_start_time")
|
||||||
|
private LocalDate planStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划结束时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "plan_end_time")
|
||||||
|
private LocalDate planEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际完成时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "plan_complate_time")
|
||||||
|
private LocalDate planComplateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划负责人
|
||||||
|
*/
|
||||||
|
@TableField(value = "leader")
|
||||||
|
private String leader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划状态(1:审批中;2:审批通过;3:审批不通过;4:已取消
|
||||||
|
*/
|
||||||
|
@TableField(value = "`status`")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
@TableField(value = "description")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件是否上传(0:否 1:是)
|
||||||
|
*/
|
||||||
|
@TableField(value = "is_file_upload")
|
||||||
|
private Integer isFileUpload;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_count")
|
||||||
|
private Integer fileCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件路径
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_path")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例的编号
|
||||||
|
*/
|
||||||
|
@TableField(value = "process_instance_id")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:0-删除 1-正常
|
||||||
|
*/
|
||||||
|
@TableField(value = "`State`")
|
||||||
|
private Integer state;
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.njcn.supervision.pojo.vo.survey;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/3/9 14:00【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DeptSubstationVO {
|
||||||
|
@ApiModelProperty(name = "id",value = "id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "pid",value = "父级id")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "name",value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "code",value = "单位编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "disabled",value = "是否可以选择,电站不用塞,部门塞disabled: true")
|
||||||
|
private boolean disabled;
|
||||||
|
@ApiModelProperty(name = "flag",value = "前端标志")
|
||||||
|
private boolean flag;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "children",value = "子级")
|
||||||
|
private List<DeptSubstationVO> children = new ArrayList<> ();
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package com.njcn.supervision.pojo.vo.survey;
|
||||||
|
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanDetailPO;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/5/13 18:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class SupervisionGeneralSurveyPlanVO extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="单位ID")
|
||||||
|
private String orgNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="单位名称")
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普测计划名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="普测计划名称")
|
||||||
|
private String planName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划生成时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="计划生成时间")
|
||||||
|
private LocalDate planCreateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划开始时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="计划开始时间")
|
||||||
|
private LocalDate planStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划结束时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="计划结束时间")
|
||||||
|
private LocalDate planEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际完成时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="实际完成时间")
|
||||||
|
private LocalDate planComplateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划负责人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="计划负责人")
|
||||||
|
private String leader;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="选中的电站集合")
|
||||||
|
private List<String> subIds;
|
||||||
|
|
||||||
|
@ApiModelProperty("发起人自选审批人 Map")
|
||||||
|
private Map<String, List<String>> startUserSelectAssignees;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划状态(1:审批中;2:审批通过;3:审批不通过;4:已取消
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="计划状态(1:审批中;2:审批通过;3:审批不通过;4:已取消")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="详情")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件是否上传(0:否 1:是)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="文件是否上传(0:否 1:是)")
|
||||||
|
private Integer isFileUpload;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="上传文件数量")
|
||||||
|
private Integer fileCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件路径
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="文件路径")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例的编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="流程实例的编号")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="流程实例的编号")
|
||||||
|
private List<SupervisionGeneralSurveyPlanDetailPO> supervisionGeneralSurveyPlanDetailPOS ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package com.njcn.supervision.controller.survey;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.DeptSubstationVO;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO;
|
||||||
|
import com.njcn.supervision.service.survey.SupervisionGeneralSurveyPlanPOService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 干扰源用户管理
|
||||||
|
*
|
||||||
|
* @author qijian
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/11 - 9:20
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/generalSurvey")
|
||||||
|
@Api(tags = "谐波普测计划")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class GeneralSurveyController extends BaseController {
|
||||||
|
|
||||||
|
private final SupervisionGeneralSurveyPlanPOService supervisionGeneralSurveyPlanPOService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.ADD)
|
||||||
|
@PostMapping("/addSurvey")
|
||||||
|
@ApiOperation("新增普测计划")
|
||||||
|
@ApiImplicitParam(name = "supervisionGeneralSurveyPlanParm", value = "实体参数", required = true)
|
||||||
|
public HttpResult<String> addSurvey(@RequestBody @Validated SupervisionGeneralSurveyPlanParm supervisionGeneralSurveyPlanParm){
|
||||||
|
String methodDescribe = getMethodDescribe("addSurvey");
|
||||||
|
String planNo = supervisionGeneralSurveyPlanPOService.addDevReport(supervisionGeneralSurveyPlanParm);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, planNo, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.ADD)
|
||||||
|
@PostMapping("/auditSurvey")
|
||||||
|
@ApiOperation("修改普测计划")
|
||||||
|
@ApiImplicitParam(name = "supervisionGeneralSurveyPlanUpdate", value = "实体参数", required = true)
|
||||||
|
public HttpResult<Boolean> auditSurvey(@RequestBody @Validated SupervisionGeneralSurveyPlanParm.SupervisionGeneralSurveyPlanUpdate supervisionGeneralSurveyPlanUpdate){
|
||||||
|
String methodDescribe = getMethodDescribe("auditDevReport");
|
||||||
|
boolean res = supervisionGeneralSurveyPlanPOService.auditSurvey(supervisionGeneralSurveyPlanUpdate);
|
||||||
|
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/removeSurvey")
|
||||||
|
@ApiOperation("移除普测计划")
|
||||||
|
public HttpResult<Boolean> removeSurvey(@RequestParam("ids") List<String> ids){
|
||||||
|
String methodDescribe = getMethodDescribe("removeSurvey");
|
||||||
|
Boolean flag = supervisionGeneralSurveyPlanPOService.removeSurvey(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getSurvey")
|
||||||
|
@ApiOperation("分页查询当前用户能看到的普测计划")
|
||||||
|
@ApiImplicitParam(name = "generalSurveyPlanQueryParam", value = "参数", required = true)
|
||||||
|
public HttpResult<Page<SupervisionGeneralSurveyPlanVO>> getSurvey(@RequestBody @Validated SupervisionGeneralSurveyPlanParm.GeneralSurveyPlanQueryParam generalSurveyPlanQueryParam ){
|
||||||
|
String methodDescribe = getMethodDescribe("getSurvey");
|
||||||
|
Page<SupervisionGeneralSurveyPlanVO> out = supervisionGeneralSurveyPlanPOService.getSurvey(generalSurveyPlanQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/querySurveyDetail")
|
||||||
|
@ApiOperation("查询普测计划详情")
|
||||||
|
public HttpResult<SupervisionGeneralSurveyPlanVO> querySurveyDetail(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("querySurveyDetail");
|
||||||
|
SupervisionGeneralSurveyPlanVO vo = supervisionGeneralSurveyPlanPOService.querySurveyDetail(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/initDetpStataionTree")
|
||||||
|
@ApiOperation("初始化部门")
|
||||||
|
@ApiImplicitParam(name = "orgId", value = "部门号", required = true)
|
||||||
|
public HttpResult<List<DeptSubstationVO>> initDetpStataionTree(@RequestParam("orgId") String orgId) {
|
||||||
|
String methodDescribe = getMethodDescribe("initDetpStataionTree");
|
||||||
|
List<DeptSubstationVO> list = supervisionGeneralSurveyPlanPOService.initDetpStataionTree(orgId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/updateStatus")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@Operation(summary = "更改普测计划状态")
|
||||||
|
public HttpResult<Object> updateStatus(String businessKey,Integer status) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateStatus");
|
||||||
|
supervisionGeneralSurveyPlanPOService.updateStatus(businessKey,status);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.njcn.supervision.mapper.survey;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanDetailPO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/5/13 18:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface SupervisionGeneralSurveyPlanDetailPOMapper extends MppBaseMapper<SupervisionGeneralSurveyPlanDetailPO> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.supervision.mapper.survey;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/5/13 18:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface SupervisionGeneralSurveyPlanPOMapper extends BaseMapper<SupervisionGeneralSurveyPlanPO> {
|
||||||
|
Page<SupervisionGeneralSurveyPlanVO> page(Page<Object> objectPage, @Param("ew") QueryWrapper<SupervisionGeneralSurveyPlanVO> queryWrapper);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.supervision.mapper.survey.SupervisionGeneralSurveyPlanDetailPOMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanDetailPO">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table supervision_general_survey_plan_detail-->
|
||||||
|
<id column="plan_no" jdbcType="VARCHAR" property="planNo" />
|
||||||
|
<id column="sub_id" jdbcType="VARCHAR" property="subId" />
|
||||||
|
<result column="sub_name" jdbcType="VARCHAR" property="subName" />
|
||||||
|
<result column="voltage_level" jdbcType="VARCHAR" property="voltageLevel" />
|
||||||
|
<result column="capacity" jdbcType="DECIMAL" property="capacity" />
|
||||||
|
<result column="measurement_point_id" jdbcType="VARCHAR" property="measurementPointId" />
|
||||||
|
<result column="is_problem" jdbcType="TINYINT" property="isProblem" />
|
||||||
|
<result column="is_survey" jdbcType="TINYINT" property="isSurvey" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
plan_no, sub_id, sub_name, voltage_level, capacity, measurement_point_id, is_problem,
|
||||||
|
is_survey
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?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.njcn.supervision.mapper.survey.SupervisionGeneralSurveyPlanPOMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table supervision_general_survey_plan-->
|
||||||
|
<id column="plan_no" jdbcType="VARCHAR" property="planNo" />
|
||||||
|
<result column="org_no" jdbcType="VARCHAR" property="orgNo" />
|
||||||
|
<result column="plan_name" jdbcType="VARCHAR" property="planName" />
|
||||||
|
<result column="plan_create_time" jdbcType="DATE" property="planCreateTime" />
|
||||||
|
<result column="plan_start_time" jdbcType="DATE" property="planStartTime" />
|
||||||
|
<result column="plan_end_time" jdbcType="DATE" property="planEndTime" />
|
||||||
|
<result column="plan_complate_time" jdbcType="DATE" property="planComplateTime" />
|
||||||
|
<result column="leader" jdbcType="VARCHAR" property="leader" />
|
||||||
|
<result column="status" jdbcType="TINYINT" property="status" />
|
||||||
|
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||||
|
<result column="is_file_upload" jdbcType="TINYINT" property="isFileUpload" />
|
||||||
|
<result column="file_count" jdbcType="INTEGER" property="fileCount" />
|
||||||
|
<result column="file_path" jdbcType="VARCHAR" property="filePath" />
|
||||||
|
<result column="process_instance_id" jdbcType="VARCHAR" property="processInstanceId" />
|
||||||
|
<result column="upload_time" jdbcType="DATE" property="uploadTime" />
|
||||||
|
<result column="Create_By" jdbcType="CHAR" property="createBy" />
|
||||||
|
<result column="Create_Time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="Update_By" jdbcType="CHAR" property="updateBy" />
|
||||||
|
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
<result column="State" jdbcType="BIT" property="state" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
plan_no, org_no, plan_name, plan_create_time, plan_start_time, plan_end_time, plan_complate_time,
|
||||||
|
leader, `status`, description, is_file_upload, file_count, file_path, process_instance_id,
|
||||||
|
upload_time, Create_By, Create_Time, Update_By, Update_Time, `State`
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="page" resultType="com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO">
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM supervision_general_survey_plan supervision_general_survey_plan
|
||||||
|
WHERE ${ew.sqlSegment}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.supervision.service.survey;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanDetailPO;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/5/13 18:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface SupervisionGeneralSurveyPlanDetailPOService extends IMppService<SupervisionGeneralSurveyPlanDetailPO> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.njcn.supervision.service.survey;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.DeptSubstationVO;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/5/13 18:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface SupervisionGeneralSurveyPlanPOService extends IService<SupervisionGeneralSurveyPlanPO>{
|
||||||
|
|
||||||
|
|
||||||
|
String addDevReport(SupervisionGeneralSurveyPlanParm supervisionGeneralSurveyPlanParm);
|
||||||
|
|
||||||
|
boolean auditSurvey(SupervisionGeneralSurveyPlanParm.SupervisionGeneralSurveyPlanUpdate supervisionGeneralSurveyPlanUpdate);
|
||||||
|
|
||||||
|
Boolean removeSurvey(List<String> ids);
|
||||||
|
|
||||||
|
Page<SupervisionGeneralSurveyPlanVO> getSurvey(SupervisionGeneralSurveyPlanParm.GeneralSurveyPlanQueryParam generalSurveyPlanQueryParam);
|
||||||
|
|
||||||
|
SupervisionGeneralSurveyPlanVO querySurveyDetail(String id);
|
||||||
|
|
||||||
|
List<DeptSubstationVO> initDetpStataionTree(String orgId);
|
||||||
|
|
||||||
|
void updateStatus(String businessKey, Integer status);
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.supervision.service.survey.impl;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.supervision.mapper.survey.SupervisionGeneralSurveyPlanDetailPOMapper;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanDetailPO;
|
||||||
|
import com.njcn.supervision.service.survey.SupervisionGeneralSurveyPlanDetailPOService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/5/13 18:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SupervisionGeneralSurveyPlanDetailPOServiceImpl extends MppServiceImpl<SupervisionGeneralSurveyPlanDetailPOMapper, SupervisionGeneralSurveyPlanDetailPO> implements SupervisionGeneralSurveyPlanDetailPOService{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
package com.njcn.supervision.service.survey.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||||
|
import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||||
|
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||||
|
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||||
|
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||||
|
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||||
|
import com.njcn.supervision.mapper.survey.SupervisionGeneralSurveyPlanPOMapper;
|
||||||
|
import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanDetailPO;
|
||||||
|
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.DeptSubstationVO;
|
||||||
|
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO;
|
||||||
|
import com.njcn.supervision.service.survey.SupervisionGeneralSurveyPlanDetailPOService;
|
||||||
|
import com.njcn.supervision.service.survey.SupervisionGeneralSurveyPlanPOService;
|
||||||
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import com.njcn.web.utils.RequestUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/5/13 18:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<SupervisionGeneralSurveyPlanPOMapper, SupervisionGeneralSurveyPlanPO> implements SupervisionGeneralSurveyPlanPOService{
|
||||||
|
/**
|
||||||
|
* 用户信息建档对应的流程定义 KEY todo 修改成普测的key
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "harmonic_survey";
|
||||||
|
|
||||||
|
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
||||||
|
private final SupervisionGeneralSurveyPlanDetailPOService supervisionGeneralSurveyPlanDetailPOService;
|
||||||
|
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||||
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String addDevReport(SupervisionGeneralSurveyPlanParm supervisionGeneralSurveyPlanParm) {
|
||||||
|
//判断工程名称是否有重复的
|
||||||
|
checkPlanName(supervisionGeneralSurveyPlanParm, false);
|
||||||
|
//保存普测计划主表
|
||||||
|
SupervisionGeneralSurveyPlanPO supervisionGeneralSurveyPlanPO = new SupervisionGeneralSurveyPlanPO();
|
||||||
|
BeanUtils.copyProperties(supervisionGeneralSurveyPlanParm, supervisionGeneralSurveyPlanPO);
|
||||||
|
supervisionGeneralSurveyPlanPO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
supervisionGeneralSurveyPlanPO.setPlanCreateTime(LocalDate.now());
|
||||||
|
supervisionGeneralSurveyPlanPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
this.save(supervisionGeneralSurveyPlanPO);
|
||||||
|
String planNo = supervisionGeneralSurveyPlanPO.getPlanNo();
|
||||||
|
//保存普测计划电站表
|
||||||
|
if(CollectionUtil.isNotEmpty(supervisionGeneralSurveyPlanParm.getSubIds())){
|
||||||
|
SubstationParam param = new SubstationParam();
|
||||||
|
param.setPowerIds(supervisionGeneralSurveyPlanParm.getSubIds());
|
||||||
|
List<SubGetBase> stationList = commTerminalGeneralClient.tagOrIdGetSub(param).getData();
|
||||||
|
List<SupervisionGeneralSurveyPlanDetailPO> supervisionGeneralSurveyPlanDetailPOS = new ArrayList<>();
|
||||||
|
for (SubGetBase stat : stationList) {
|
||||||
|
SupervisionGeneralSurveyPlanDetailPO supervisionGeneralSurveyPlanDetailPO = new SupervisionGeneralSurveyPlanDetailPO();
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setPlanNo(planNo);
|
||||||
|
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setSubId(stat.getId());
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setSubName(stat.getName());
|
||||||
|
/*目前时间与计划开始时间,结束时间一致*/
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setVoltageLevel(stat.getVoltageLevel());
|
||||||
|
List<String> unitChildrenList = stat.getUnitChildrenList();
|
||||||
|
if(CollectionUtil.isEmpty(unitChildrenList)){
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId("");
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0);
|
||||||
|
}else {
|
||||||
|
String subList = unitChildrenList.stream().map(String::valueOf).collect(Collectors.joining(","));
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(subList);
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0);
|
||||||
|
}
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
supervisionGeneralSurveyPlanDetailPOS.add(supervisionGeneralSurveyPlanDetailPO);
|
||||||
|
}
|
||||||
|
supervisionGeneralSurveyPlanDetailPOService.saveOrUpdateBatchByMultiId(supervisionGeneralSurveyPlanDetailPOS, 500);
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY);
|
||||||
|
bpmProcessInstanceCreateReqDTO.setBusinessKey(planNo);
|
||||||
|
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(supervisionGeneralSurveyPlanParm.getStartUserSelectAssignees());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||||
|
String processInstanceId = bpmProcessFeignClient.createProcessInstance(supervisionGeneralSurveyPlanPO.getCreateBy(),bpmProcessInstanceCreateReqDTO).getData();
|
||||||
|
// 将工作流的编号,更新到流程单中
|
||||||
|
supervisionGeneralSurveyPlanPO.setProcessInstanceId(processInstanceId);
|
||||||
|
this.baseMapper.updateById(supervisionGeneralSurveyPlanPO);
|
||||||
|
return planNo;
|
||||||
|
}{
|
||||||
|
throw new BusinessException("请选择电站");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean auditSurvey(SupervisionGeneralSurveyPlanParm.SupervisionGeneralSurveyPlanUpdate supervisionGeneralSurveyPlanUpdate) {
|
||||||
|
//判断计划名称是否有重复的
|
||||||
|
checkPlanName(supervisionGeneralSurveyPlanUpdate, true);
|
||||||
|
|
||||||
|
String planNo = supervisionGeneralSurveyPlanUpdate.getPlanNo();
|
||||||
|
SupervisionGeneralSurveyPlanPO byId = this.getById(planNo);
|
||||||
|
BeanUtils.copyProperties(supervisionGeneralSurveyPlanUpdate, byId);
|
||||||
|
|
||||||
|
SubstationParam param = new SubstationParam();
|
||||||
|
param.setPowerIds(supervisionGeneralSurveyPlanUpdate.getSubIds());
|
||||||
|
List<SubGetBase> stationList = commTerminalGeneralClient.tagOrIdGetSub(param).getData();
|
||||||
|
List<SupervisionGeneralSurveyPlanDetailPO> supervisionGeneralSurveyPlanDetailPOS = new ArrayList<>();
|
||||||
|
for (SubGetBase stat : stationList) {
|
||||||
|
SupervisionGeneralSurveyPlanDetailPO supervisionGeneralSurveyPlanDetailPO = new SupervisionGeneralSurveyPlanDetailPO();
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setPlanNo(planNo);
|
||||||
|
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setSubId(stat.getId());
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setSubName(stat.getName());
|
||||||
|
/*目前时间与计划开始时间,结束时间一致*/
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setVoltageLevel(stat.getVoltageLevel());
|
||||||
|
List<String> unitChildrenList = stat.getUnitChildrenList();
|
||||||
|
if(CollectionUtil.isEmpty(unitChildrenList)){
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId("");
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0);
|
||||||
|
}else {
|
||||||
|
String subList = unitChildrenList.stream().map(String::valueOf).collect(Collectors.joining(","));
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(subList);
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setIsSurvey(1);
|
||||||
|
}
|
||||||
|
supervisionGeneralSurveyPlanDetailPO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
supervisionGeneralSurveyPlanDetailPOS.add(supervisionGeneralSurveyPlanDetailPO);
|
||||||
|
}
|
||||||
|
//清除原有的
|
||||||
|
supervisionGeneralSurveyPlanDetailPOService.remove(new QueryWrapper<SupervisionGeneralSurveyPlanDetailPO>().lambda().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo,planNo));
|
||||||
|
supervisionGeneralSurveyPlanDetailPOService.saveOrUpdateBatchByMultiId(supervisionGeneralSurveyPlanDetailPOS, 500);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean removeSurvey(List<String> ids) {
|
||||||
|
this.lambdaUpdate().set(SupervisionGeneralSurveyPlanPO::getState, 0).in(SupervisionGeneralSurveyPlanPO::getPlanNo, ids).update();
|
||||||
|
supervisionGeneralSurveyPlanDetailPOService.remove(new QueryWrapper<SupervisionGeneralSurveyPlanDetailPO>().
|
||||||
|
lambda().in(SupervisionGeneralSurveyPlanDetailPO::getPlanNo,ids));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<SupervisionGeneralSurveyPlanVO> getSurvey(SupervisionGeneralSurveyPlanParm.GeneralSurveyPlanQueryParam generalSurveyPlanQueryParam) {
|
||||||
|
String userIndex = RequestUtil.getUserIndex();
|
||||||
|
QueryWrapper<SupervisionGeneralSurveyPlanVO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.in("supervision_general_survey_plan.create_by", CollectionUtil.newArrayList(userIndex))
|
||||||
|
.eq("supervision_general_survey_plan.state", DataStateEnum.ENABLE.getCode());
|
||||||
|
/*获取直接下属子单位*/
|
||||||
|
List<String> data = deptFeignClient.getDepSonIdtByDeptId(generalSurveyPlanQueryParam.getOrgNo()).getData();
|
||||||
|
|
||||||
|
if (Objects.nonNull(generalSurveyPlanQueryParam)) {
|
||||||
|
if (StrUtil.isNotBlank(generalSurveyPlanQueryParam.getOrgNo())) {
|
||||||
|
//查询所有区域下的数据
|
||||||
|
queryWrapper.in("supervision_general_survey_plan.org_no", data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
queryWrapper.orderByDesc("supervision_general_survey_plan.create_time");
|
||||||
|
Page<SupervisionGeneralSurveyPlanVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(generalSurveyPlanQueryParam), PageFactory.getPageSize(generalSurveyPlanQueryParam)), queryWrapper);
|
||||||
|
|
||||||
|
page.getRecords().stream().forEach(temp->{
|
||||||
|
temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgNo()).getData().getName()));
|
||||||
|
});
|
||||||
|
|
||||||
|
return page;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SupervisionGeneralSurveyPlanVO querySurveyDetail(String id) {
|
||||||
|
SupervisionGeneralSurveyPlanVO supervisionGeneralSurveyPlanVO = new SupervisionGeneralSurveyPlanVO();
|
||||||
|
SupervisionGeneralSurveyPlanPO byId = this.getById(id);
|
||||||
|
BeanUtils.copyProperties(byId,supervisionGeneralSurveyPlanVO);
|
||||||
|
//获取普测下电站详情
|
||||||
|
List<SupervisionGeneralSurveyPlanDetailPO> list = supervisionGeneralSurveyPlanDetailPOService.lambdaQuery().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, id).list();
|
||||||
|
supervisionGeneralSurveyPlanVO.setSupervisionGeneralSurveyPlanDetailPOS(list);
|
||||||
|
return supervisionGeneralSurveyPlanVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeptSubstationVO> initDetpStataionTree(String orgId) {
|
||||||
|
List<PvTerminalTreeVO> data = deptFeignClient.allDeptList().getData();
|
||||||
|
List<DeptSubstationVO> deptSubstationVOList = data.stream().map(temp -> {
|
||||||
|
DeptSubstationVO deptSubstationVO = new DeptSubstationVO();
|
||||||
|
BeanUtils.copyProperties(temp, deptSubstationVO);
|
||||||
|
deptSubstationVO.setDisabled(true);
|
||||||
|
deptSubstationVO.setFlag(true);
|
||||||
|
SubstationParam param = new SubstationParam();
|
||||||
|
param.setOrgIds(Arrays.asList(temp.getCode()));
|
||||||
|
List<SubGetBase> list1 = commTerminalGeneralClient.tagOrIdGetSub(param).getData();
|
||||||
|
List<DeptSubstationVO> children = deptSubstationVO.getChildren();
|
||||||
|
List<DeptSubstationVO> collect = list1.stream().map(statationStat -> {
|
||||||
|
DeptSubstationVO deptSubstationVO1 = new DeptSubstationVO();
|
||||||
|
deptSubstationVO1.setId(statationStat.getId());
|
||||||
|
deptSubstationVO1.setPid(temp.getId());
|
||||||
|
deptSubstationVO1.setName(statationStat.getName());
|
||||||
|
// if (finalSubIds.contains(statationStat.getId())) {
|
||||||
|
// deptSubstationVO1.setDisabled(true);
|
||||||
|
// }
|
||||||
|
deptSubstationVO1.setFlag(true);
|
||||||
|
return deptSubstationVO1;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
children.addAll(collect);
|
||||||
|
|
||||||
|
return deptSubstationVO;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 遍历两次data来组装带有children关联性的对象,如果找到子级就删除result的数据
|
||||||
|
List<DeptSubstationVO> result = new ArrayList<>(deptSubstationVOList);
|
||||||
|
for (DeptSubstationVO pv : deptSubstationVOList) {
|
||||||
|
for (DeptSubstationVO pv2 : deptSubstationVOList) {
|
||||||
|
|
||||||
|
/*如果本级id与数据的父id相同,就说明是子父级关系*/
|
||||||
|
if (pv.getId().equals(pv2.getPid())) {
|
||||||
|
pv.getChildren().add(pv2);
|
||||||
|
result.remove(pv2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result = recursion(result.get(0), orgId);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateStatus(String businessKey, Integer status) {
|
||||||
|
this.lambdaUpdate().set(SupervisionGeneralSurveyPlanPO::getStatus,status).eq(SupervisionGeneralSurveyPlanPO::getPlanNo,businessKey).update();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<DeptSubstationVO> recursion(DeptSubstationVO result, String orgdid) {
|
||||||
|
List<DeptSubstationVO> deptSubstationVOList = new ArrayList<>();
|
||||||
|
if (Objects.equals(result.getId(), orgdid)) {
|
||||||
|
deptSubstationVOList.add(result);
|
||||||
|
return deptSubstationVOList;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
for (DeptSubstationVO deptSubstationVO : result.getChildren()) {
|
||||||
|
|
||||||
|
List<DeptSubstationVO> recursion = recursion(deptSubstationVO, orgdid);
|
||||||
|
if (recursion.size() > 0) {
|
||||||
|
return recursion;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return deptSubstationVOList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 校验计划名称是否存在
|
||||||
|
* @Param: * @param userReportParam 用户申请数据
|
||||||
|
* * @param isExcludeSelf 是否排除自己,一般新增不排除,更新时需要排除自己
|
||||||
|
* @return: void
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2024/5/13
|
||||||
|
*/
|
||||||
|
private void checkPlanName(SupervisionGeneralSurveyPlanParm supervisionGeneralSurveyPlanParm, boolean isExcludeSelf) {
|
||||||
|
LambdaQueryWrapper<SupervisionGeneralSurveyPlanPO> userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
userReportPOLambdaQueryWrapper
|
||||||
|
.eq(SupervisionGeneralSurveyPlanPO::getPlanName, supervisionGeneralSurveyPlanParm.getPlanName())
|
||||||
|
.eq(SupervisionGeneralSurveyPlanPO::getState, DataStateEnum.ENABLE.getCode());
|
||||||
|
//更新的时候,需排除当前记录
|
||||||
|
if (isExcludeSelf) {
|
||||||
|
if (supervisionGeneralSurveyPlanParm instanceof SupervisionGeneralSurveyPlanParm.SupervisionGeneralSurveyPlanUpdate) {
|
||||||
|
userReportPOLambdaQueryWrapper.ne(SupervisionGeneralSurveyPlanPO::getPlanNo, ((SupervisionGeneralSurveyPlanParm.SupervisionGeneralSurveyPlanUpdate) supervisionGeneralSurveyPlanParm).getPlanNo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<SupervisionGeneralSurveyPlanPO> list = this.baseMapper.selectList(userReportPOLambdaQueryWrapper);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
//过滤已取消的申请
|
||||||
|
list = list.stream()
|
||||||
|
.filter(temp -> !temp.getStatus().equals(FlowStatusEnum.CANCEL.getCode()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
//如果还存在,则说明有人申请过了
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
throw new BusinessException(supervisionGeneralSurveyPlanParm.getPlanName().concat(",该计划已被").concat(list.get(0).getCreateBy()).concat("申请"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user