电能质量问题监测点超标新增需求
This commit is contained in:
@@ -24,9 +24,9 @@ public class SurveyPlanQuestionQueryParm {
|
||||
@NotNull(message="单位ID不能为空!")
|
||||
private String orgNo;
|
||||
|
||||
@ApiModelProperty(value="计划开始时间")
|
||||
@ApiModelProperty(value="普测结果上传时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
@NotNull(message="计划开始时间不能为空!")
|
||||
@NotNull(message="普测结果上传时间不能为空!")
|
||||
private Date planStartTime;
|
||||
|
||||
@ApiModelProperty(value="计划名称")
|
||||
|
||||
@@ -29,6 +29,9 @@ public class RGeneralSurveyPlanDetailOnQuestionVO {
|
||||
*/
|
||||
@ApiModelProperty(value="变电站电压等级")
|
||||
private String voltageLevel;
|
||||
|
||||
@ApiModelProperty(value="变电站电压等级")
|
||||
private String voltageLevelName;
|
||||
/**
|
||||
* 变电站ID
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.njcn.process.pojo.param.SurveyPlanQuestionQueryParm;
|
||||
import com.njcn.process.pojo.po.RGeneralSurveyPlanDetail;
|
||||
import com.njcn.process.pojo.vo.RGeneralSurveyPlanDetailOnQuestionVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -19,23 +18,23 @@ import java.util.List;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface RGeneralSurveyPlanDetailMapper extends MppBaseMapper<RGeneralSurveyPlanDetail> {
|
||||
@Select ({"<script>",
|
||||
"SELECT\n" +
|
||||
"\ta.plan_name as planName,\n" +
|
||||
"\tb.voltage_level as voltageLevel,\n" +
|
||||
"\tb.sub_id as subId,\n" +
|
||||
"\tb.sub_name as subName,\n" +
|
||||
"\tb.busbar_id as busbarId,\n" +
|
||||
"\tb.busbar_name as busbarName, b.measurement_point_id as measurementPointId\n" +
|
||||
"FROM\n" +
|
||||
"\tr_general_survey_plan a\n" +
|
||||
"INNER JOIN r_general_survey_plan_detail b ON a.plan_no = b.plan_no\n" +
|
||||
"WHERE\n" +
|
||||
"\ta.org_no = #{questionQueryParm.orgNo} " +
|
||||
"<when test='questionQueryParm.planName!=null and questionQueryParm.planName!=\"\"'>",
|
||||
"and a.plan_name = #{questionQueryParm.planName}\n" +
|
||||
"</when>",
|
||||
"AND DATE_FORMAT(a.upload_time, '%Y%m') = DATE_FORMAT(#{questionQueryParm.planStartTime}, '%Y%m')",
|
||||
"</script>"})
|
||||
List<RGeneralSurveyPlanDetailOnQuestionVO> querySurveyPlanOnQuestion(@Param("questionQueryParm") SurveyPlanQuestionQueryParm questionQueryParm);
|
||||
// @Select ({"<script>",
|
||||
// "SELECT\n" +
|
||||
// "\ta.plan_name as planName,\n" +
|
||||
// "\tb.voltage_level as voltageLevel,\n" +
|
||||
// "\tb.sub_id as subId,\n" +
|
||||
// "\tb.sub_name as subName,\n" +
|
||||
// "\tb.busbar_id as busbarId,\n" +
|
||||
// "\tb.busbar_name as busbarName, b.measurement_point_id as measurementPointId\n" +
|
||||
// "FROM\n" +
|
||||
// "\tr_general_survey_plan a\n" +
|
||||
// "INNER JOIN r_general_survey_plan_detail b ON a.plan_no = b.plan_no\n" +
|
||||
// "WHERE b.is_problem=1 and\n" +
|
||||
// "\ta.org_no = #{questionQueryParm.orgNo} " +
|
||||
// "<when test='questionQueryParm.planName!=null and questionQueryParm.planName!=\"\"'>",
|
||||
// "and a.plan_name = #{questionQueryParm.planName}\n" +
|
||||
// "</when>",
|
||||
// "AND DATE_FORMAT(a.upload_time, '%Y%m') = DATE_FORMAT(#{questionQueryParm.planStartTime}, '%Y%m')",
|
||||
// "</script>"})
|
||||
List<RGeneralSurveyPlanDetailOnQuestionVO> querySurveyPlanOnQuestion(@Param("questionQueryParm") SurveyPlanQuestionQueryParm questionQueryParm,@Param("deptIdList") List<String> deptIdList);
|
||||
}
|
||||
@@ -23,4 +23,37 @@
|
||||
general_survey_leader, sub_id, sub_name, voltage_level, busbar_id, busbar_name, measurement_point_id,
|
||||
is_problem
|
||||
</sql>
|
||||
|
||||
<select id="querySurveyPlanOnQuestion"
|
||||
resultType="com.njcn.process.pojo.vo.RGeneralSurveyPlanDetailOnQuestionVO">
|
||||
SELECT
|
||||
a.org_no,
|
||||
a.upload_time,
|
||||
a.plan_name AS planName,
|
||||
b.voltage_level AS voltageLevel,
|
||||
b.sub_id AS subId,
|
||||
b.sub_name AS subName,
|
||||
b.busbar_id AS busbarId,
|
||||
b.busbar_name AS busbarName,
|
||||
b.measurement_point_id AS measurementPointId
|
||||
FROM
|
||||
r_general_survey_plan a
|
||||
INNER JOIN r_general_survey_plan_detail b ON a.plan_no = b.plan_no
|
||||
WHERE
|
||||
1=1
|
||||
and b.is_problem = 1
|
||||
<if test="deptIdList!=null and deptIdList.size()>0">
|
||||
AND a.org_no IN
|
||||
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="questionQueryParm.planName != null and questionQueryParm.planName != '' ">
|
||||
AND a.plan_name = #{questionQueryParm.planName}
|
||||
</if>
|
||||
<if test="questionQueryParm.planStartTime != null ">
|
||||
AND DATE_FORMAT(a.upload_time,'%Y%m') >= DATE_FORMAT(#{questionQueryParm.planStartTime}, '%Y%m')
|
||||
</if>
|
||||
order by a.upload_time
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.process.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -18,7 +19,6 @@ import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.enums.OssResponseEnum;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.process.enums.AuditProcessEnum;
|
||||
import com.njcn.process.enums.FlowComment;
|
||||
import com.njcn.process.mapper.*;
|
||||
import com.njcn.process.pojo.param.*;
|
||||
import com.njcn.process.pojo.po.*;
|
||||
@@ -29,16 +29,15 @@ import com.njcn.process.service.RGeneralSurveyPlanPOService;
|
||||
import com.njcn.process.service.flowable.IFlowDefinitionService;
|
||||
import com.njcn.process.service.flowable.IFlowInstanceService;
|
||||
import com.njcn.process.service.flowable.IFlowTaskService;
|
||||
import com.njcn.process.service.impl.flowable.FlowDefinitionServiceImpl;
|
||||
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import liquibase.pro.packaged.S;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -87,6 +86,8 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
|
||||
private final FlowFormAssMapper flowFormAssMapper;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
|
||||
/**
|
||||
* @param rGeneralSurveyPlanAddParm
|
||||
@@ -428,7 +429,18 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
*/
|
||||
@Override
|
||||
public List<RGeneralSurveyPlanDetailOnQuestionVO> querySurveyPlanOnQuestion(SurveyPlanQuestionQueryParm questionQueryParm) {
|
||||
return rGeneralSurveyPlanDetailMapper.querySurveyPlanOnQuestion(questionQueryParm);
|
||||
|
||||
/*获取直接下属子单位*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (questionQueryParm.getOrgNo()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
List<RGeneralSurveyPlanDetailOnQuestionVO> rGeneralSurveyPlanDetailOnQuestionVOS = rGeneralSurveyPlanDetailMapper.querySurveyPlanOnQuestion(questionQueryParm, deptIdList);
|
||||
rGeneralSurveyPlanDetailOnQuestionVOS.forEach(temp->{
|
||||
temp.setVoltageLevelName(dicDataFeignClient.getDicDataById(temp.getVoltageLevel()).getData().getName());
|
||||
});
|
||||
return rGeneralSurveyPlanDetailOnQuestionVOS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user