1.技术监督代码调整

2.国网对象类型统计
3.国网新能源场站代码提交
This commit is contained in:
wr
2024-03-26 16:11:29 +08:00
parent 522b0b48dd
commit c5b427d8a3
31 changed files with 858 additions and 37 deletions

View File

@@ -125,7 +125,7 @@ public class PmsTerminalDetectionController extends BaseController {
@ApiOperation("检测报告下载")
@GetMapping(value = "/reportDownload")
public InputStreamResource reportDownload( TerminalParam.DownloadParam param) throws IOException {
public InputStreamResource reportDownload( TerminalParam.DownloadParam param){
InputStreamResource minIoUploadResDTO = pmsTerminalDetectionService.reportDownload(param);
return minIoUploadResDTO;
}

View File

@@ -26,7 +26,6 @@ import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -98,33 +97,23 @@ public class RGeneralSurveyPlanController extends BaseController {
@PostMapping("/addPlanConfig")
@ApiOperation("增加普测计划参数")
@ApiImplicitParam(name = "rSurveyPlanConfigVOList", value = "", required = true)
public HttpResult<Boolean> addPlanConfig(@Validated @RequestBody List<RSurveyPlanConfigVO> rSurveyPlanConfigVOList) {
String methodDescribe = getMethodDescribe("querySubStatation");
double sum = rSurveyPlanConfigVOList.stream().mapToDouble(RSurveyPlanConfigVO::getProportion).sum();
public HttpResult<Boolean> addPlanConfig(@Validated @RequestBody List<RSurveyPlanConfigPO> rSurveyPlanConfigVOList) {
String methodDescribe = getMethodDescribe("addPlanConfig");
double sum = rSurveyPlanConfigVOList.stream().mapToDouble(RSurveyPlanConfigPO::getProportion).sum();
if (sum > 1) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.MATH_ERROR, false, methodDescribe);
}
List<RSurveyPlanConfigPO> collect = rSurveyPlanConfigVOList.stream().map(temp -> {
RSurveyPlanConfigPO rs = new RSurveyPlanConfigPO();
BeanUtils.copyProperties(temp, rs);
return rs;
}).collect(Collectors.toList());
boolean b = rSurveyPlanConfigService.saveOrUpdateBatchByMultiId(collect, 500);
boolean b = rSurveyPlanConfigService.saveOrUpdateBatchByMultiId(rSurveyPlanConfigVOList, 500);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPlanConfig")
@ApiOperation("查询普测计划参数")
public HttpResult<List<RSurveyPlanConfigVO>> queryPlanConfig() {
public HttpResult<List<RSurveyPlanConfigPO>> queryPlanConfig() {
String methodDescribe = getMethodDescribe("queryPlanConfig");
List<RSurveyPlanConfigPO> list = rSurveyPlanConfigService.list();
List<RSurveyPlanConfigVO> collect = list.stream().map(temp -> {
RSurveyPlanConfigVO rs = new RSurveyPlanConfigVO();
BeanUtils.copyProperties(temp, rs);
return rs;
}).collect(Collectors.toList());
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, collect, methodDescribe);
List<RSurveyPlanConfigPO> list = rSurveyPlanConfigService.getOrgIds();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}

View File

@@ -28,7 +28,8 @@ public interface LoadTypeUserManageMapper extends BaseMapper<RLoadTypeUserManage
*/
Page<RLoadTypeUserManageVO> getLoadTypeUserPage(IPage<RLoadTypeUserManageVO> page,
@Param("param") LoadTypeUserSearchParam loadTypeUserSearchParam,
@Param("ids") List<String> ids
@Param("ids") List<String> ids,
@Param("aStatus") String aStatus
);
/**
@@ -38,6 +39,8 @@ public interface LoadTypeUserManageMapper extends BaseMapper<RLoadTypeUserManage
* @return 结果
*/
Page<RLoadTypeUserManageVO> getLoadTypeRelationPage(IPage<RLoadTypeUserManageVO> page,
@Param("param") LoadTypeUserSearchParam loadTypeUserSearchParam
@Param("param") LoadTypeUserSearchParam loadTypeUserSearchParam,
@Param("ids") List<String> ids,
@Param("aStatus") String aStatus
);
}

View File

@@ -15,7 +15,7 @@
</foreach>
</if>
<if test="param.checkType != null and param.checkType == 1">
and r.i_check_person is null and r.i_check_person !=""
AND ( r.i_check_person IS not NULL or r.i_check_person != "")
</if>
<if test="param.loadType != null and param.loadType != ''">
and r.load_type = #{param.loadType}
@@ -26,6 +26,9 @@
<if test="param.fileUploadflag != null and param.fileUploadflag != ''">
and r.i_is_file_upload = #{param.fileUploadflag}
</if>
<if test="aStatus!= null and aStatus != ''">
and r.a_status != #{aStatus}
</if>
</where>
order by record_time desc
</select>
@@ -39,8 +42,14 @@
AND ISNULL( relation_user_id )= 0
AND LENGTH(
trim( relation_user_id ))> 0
<if test="param.orgNo != null and param.orgNo != ''">
and r.org_no = #{param.orgNo}
<if test="ids != null and ids.size > 0">
AND r.org_no IN
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
#{item}
</foreach>
</if>
<if test="param.checkType != null and param.checkType == 1">
AND ( r.i_check_person IS not NULL or r.i_check_person != "")
</if>
<if test="param.loadType != null and param.loadType != ''">
and r.load_type = #{param.loadType}
@@ -53,6 +62,9 @@
</if>
<if test="param.aIsFileUpload != null and param.aIsFileUpload != ''">
and r.a_is_file_upload = #{param.aIsFileUpload}
</if>
<if test="aStatus!= null and aStatus != ''">
and r.a_status != #{aStatus}
</if>
order by record_time desc
</select>

View File

@@ -92,7 +92,7 @@ public interface PmsTerminalDetectionService extends IService<PmsTerminalDetecti
* @param param
* @return MinIoUploadResDTO
*/
InputStreamResource reportDownload(TerminalParam.DownloadParam param) throws IOException;
InputStreamResource reportDownload(TerminalParam.DownloadParam param);
/***
* 终端入网检测台账统计

View File

@@ -1,10 +1,19 @@
package com.njcn.process.service;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.process.mapper.RSurveyPlanConfigMapper;
import com.njcn.process.pojo.po.RSurveyPlanConfigPO;
import com.njcn.process.service.impl.RSurveyPlanConfigService;
import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.po.Dept;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
*
* Description:
@@ -15,6 +24,14 @@ import org.springframework.stereotype.Service;
* @version V1.0.0
*/
@Service
@RequiredArgsConstructor
public class RSurveyPlanConfigServiceImpl extends MppServiceImpl<RSurveyPlanConfigMapper, RSurveyPlanConfigPO> implements RSurveyPlanConfigService{
private final DeptFeignClient deptFeignClient;
@Override
public List<RSurveyPlanConfigPO> getOrgIds() {
List<Dept> data = deptFeignClient.getAllDept().getData();
List<String> orgIds = data.stream().map(Dept::getCode).collect(Collectors.toList());
return this.list(new LambdaQueryWrapper<RSurveyPlanConfigPO>().in(CollUtil.isNotEmpty(orgIds),RSurveyPlanConfigPO::getOrgId,orgIds ));
}
}

View File

@@ -29,6 +29,7 @@ import com.njcn.user.pojo.po.Dept;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import com.njcn.web.utils.RequestUtil;
import com.njcn.web.utils.WebUtil;
import liquibase.pro.packaged.S;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.jdbc.Null;
@@ -72,13 +73,14 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
Page<RLoadTypeUserManageVO> page = new Page<>(loadTypeUserSearchParam.getPageNum(), loadTypeUserSearchParam.getPageSize());
List<String> ids=deptFeignClient.getDepSonIdtByDeptId (loadTypeUserSearchParam.getOrgNo()).getData ( );
Integer checkType = loadTypeUserSearchParam.getCheckType();
String aStatus = null;
//0表示不是审核信息 1标识审核信息
List<String> data = deptFeignClient.getDepSonIdtByDeptId (loadTypeUserSearchParam.getOrgNo()).getData ( );
if(checkType==1){
ids=data.stream().filter(x->!x.contains(loadTypeUserSearchParam.getOrgNo())).collect(Collectors.toList());
ids=ids.stream().filter(x->!x.contains(loadTypeUserSearchParam.getOrgNo())).collect(Collectors.toList());
aStatus = dicDataFeignClient.getDicDataByCode(DicDataEnum.FINISH.getCode()).getData().getId();
}
//干扰源用户信息录入
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeUserPage(page, loadTypeUserSearchParam,ids);
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeUserPage(page, loadTypeUserSearchParam,ids,aStatus);
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();
Map<String, PvTerminalTreeVO> pvTerminalTreeVOMap = dept.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, pvTerminalTreeVO -> pvTerminalTreeVO));
//部门处理根据部门code取名称
@@ -202,8 +204,15 @@ public class LoadTypeUserManageServiceImpl implements LoadTypeUserManageService
@Override
public Page<RLoadTypeUserManageVO> getLoadTypeRelationList(LoadTypeUserSearchParam loadTypeUserSearchParam) {
Page<RLoadTypeUserManageVO> page = new Page<>(loadTypeUserSearchParam.getPageNum(), loadTypeUserSearchParam.getPageSize());
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeRelationPage(page, loadTypeUserSearchParam);
List<String> ids=deptFeignClient.getDepSonIdtByDeptId (loadTypeUserSearchParam.getOrgNo()).getData ( );
Integer checkType = loadTypeUserSearchParam.getCheckType();
String aStatus = null;
//0表示不是审核信息 1标识审核信息
if(checkType==1){
ids=ids.stream().filter(x->!x.contains(loadTypeUserSearchParam.getOrgNo())).collect(Collectors.toList());
aStatus = dicDataFeignClient.getDicDataByCode(DicDataEnum.FINISH.getCode()).getData().getId();
}
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeRelationPage(page, loadTypeUserSearchParam,ids,aStatus);
//部门处理根据部门code取名称
List<RLoadTypeUserManageVO> list = loadTypeUserPage.getRecords();
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();

View File

@@ -306,7 +306,7 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
}
@Override
public InputStreamResource reportDownload(TerminalParam.DownloadParam param) throws IOException {
public InputStreamResource reportDownload(TerminalParam.DownloadParam param) {
PmsTerminalDetection terminal = this.getById(param.getId());
if (ObjectUtil.isNull(terminal)) {
if (StringUtils.isEmpty(terminal)) {

View File

@@ -1,5 +1,6 @@
package com.njcn.process.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -34,6 +35,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.text.SimpleDateFormat;
@@ -198,6 +200,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
map(RGeneralSurveyPlanDetail::getSubId).collect(Collectors.toList());
rGeneralSurveyPlanVO.setSubCount(collect1.size());
rGeneralSurveyPlanVO.setSubIds(collect1);
rGeneralSurveyPlanVO.setIsFileUpload(ObjectUtil.isNull(temp.getIsFileUpload()) ? 0 : temp.getIsFileUpload());
/*
long Subcount = rGeneralSurveyPlanDetails.stream ( ).
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).

View File

@@ -2,7 +2,10 @@ package com.njcn.process.service.impl;
import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.process.pojo.po.RSurveyPlanConfigPO;
/**
import java.util.List;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
@@ -14,4 +17,6 @@ import com.njcn.process.pojo.po.RSurveyPlanConfigPO;
public interface RSurveyPlanConfigService extends IMppService<RSurveyPlanConfigPO> {
List<RSurveyPlanConfigPO> getOrgIds();
}