技术监督管理调整
This commit is contained in:
@@ -124,6 +124,9 @@ public class SupvProblem extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String attachmentName;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.process.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
@@ -11,6 +12,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.process.pojo.param.SupvProblemParam;
|
||||
import com.njcn.process.pojo.po.SupvFile;
|
||||
import com.njcn.process.pojo.po.SupvProblem;
|
||||
import com.njcn.process.service.ISupvProblemService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
@@ -30,6 +32,7 @@ import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -52,6 +55,8 @@ public class SupvProblemController extends BaseController {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("addProblem")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||
@ApiOperation("新增技术监督问题")
|
||||
@@ -92,7 +97,6 @@ public class SupvProblemController extends BaseController {
|
||||
throw new BusinessException("监督计划索引不可为空");
|
||||
}
|
||||
Page<SupvProblem> page = iSupvProblemService.pageProblem(supvProblemParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,11 @@ import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.process.enums.ProcessResponseEnum;
|
||||
import com.njcn.process.mapper.SupvFileMapper;
|
||||
import com.njcn.process.mapper.SupvPlanMapper;
|
||||
import com.njcn.process.mapper.SupvProblemMapper;
|
||||
import com.njcn.process.pojo.param.SupvPlanParam;
|
||||
import com.njcn.process.pojo.po.SupvFile;
|
||||
import com.njcn.process.pojo.po.SupvPlan;
|
||||
import com.njcn.process.pojo.po.SupvProblem;
|
||||
import com.njcn.process.pojo.vo.SupvPlanVO;
|
||||
import com.njcn.process.service.ISupvFileService;
|
||||
import com.njcn.process.service.ISupvPlanService;
|
||||
@@ -63,6 +65,8 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
|
||||
private final UserFeignClient userFeignClient;
|
||||
|
||||
private final SupvProblemMapper supvProblemMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean addPlan(SupvPlanParam supvPlanParam) {
|
||||
@@ -102,7 +106,22 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
if (count > 0) {
|
||||
throw new BusinessException("请选择未上送国网的删除");
|
||||
}
|
||||
return this.removeByIds(planIds);
|
||||
this.removeByIds(planIds);
|
||||
//删除问题
|
||||
|
||||
LambdaQueryWrapper<SupvProblem> supvProblemLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
supvProblemLambdaQueryWrapper.in(SupvProblem::getPlanId, planIds);
|
||||
List<SupvProblem> supvProblemList = this.supvProblemMapper.selectList(supvProblemLambdaQueryWrapper);
|
||||
|
||||
this.supvProblemMapper.delete(supvProblemLambdaQueryWrapper);
|
||||
|
||||
List<String> busIds = supvProblemList.stream().map(SupvProblem::getProblemId).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(busIds)) {
|
||||
LambdaQueryWrapper<SupvFile> fileLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
fileLambdaQueryWrapper.in(SupvFile::getBusiId, busIds);
|
||||
supvFileMapper.delete(fileLambdaQueryWrapper);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -171,7 +190,6 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
Page<SupvPlanVO> pageVo = new Page<>();
|
||||
pageVo.setTotal(page.getTotal());
|
||||
@@ -182,8 +200,6 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void checkParam(SupvPlanParam supvPlanParam, Boolean updateFlag) {
|
||||
|
||||
LambdaQueryWrapper<SupvPlan> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -230,7 +246,6 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,14 +2,18 @@ package com.njcn.process.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.process.enums.ProcessResponseEnum;
|
||||
import com.njcn.process.mapper.SupvFileMapper;
|
||||
import com.njcn.process.mapper.SupvProblemMapper;
|
||||
import com.njcn.process.pojo.param.SupvProblemParam;
|
||||
import com.njcn.process.pojo.po.SupvFile;
|
||||
import com.njcn.process.pojo.po.SupvPlan;
|
||||
import com.njcn.process.pojo.po.SupvProblem;
|
||||
import com.njcn.process.pojo.po.SupvProblem;
|
||||
@@ -23,6 +27,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -42,6 +47,10 @@ public class SupvProblemServiceImpl extends ServiceImpl<SupvProblemMapper, SupvP
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
private final SupvFileMapper supvFileMapper;
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
@Override
|
||||
public boolean addProblem(SupvProblemParam supvProblemParam) {
|
||||
SupvProblem supvProblem = new SupvProblem();
|
||||
@@ -71,7 +80,15 @@ public class SupvProblemServiceImpl extends ServiceImpl<SupvProblemMapper, SupvP
|
||||
if (count > 0) {
|
||||
throw new BusinessException("请选择未上送国网的删除");
|
||||
}
|
||||
return this.removeByIds(problemIds);
|
||||
this.removeByIds(problemIds);
|
||||
if (CollUtil.isNotEmpty(problemIds)) {
|
||||
LambdaQueryWrapper<SupvFile> fileLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
fileLambdaQueryWrapper.in(SupvFile::getBusiId, problemIds);
|
||||
List<SupvFile> supvFileList = supvFileMapper.selectList(fileLambdaQueryWrapper);
|
||||
supvFileList.forEach(item-> fileStorageUtil.downloadStream(item.getFileUrl()));
|
||||
supvFileMapper.delete(fileLambdaQueryWrapper);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,10 +104,15 @@ public class SupvProblemServiceImpl extends ServiceImpl<SupvProblemMapper, SupvP
|
||||
if (mapCode.containsKey(item.getDutyOrgId())) {
|
||||
item.setDutyOrgName(mapCode.get(item.getDutyOrgId()).getName());
|
||||
}
|
||||
|
||||
SupvFile supvFile = supvFileMapper.selectOne(new LambdaQueryWrapper<SupvFile>().eq(SupvFile::getBusiId, item.getProblemId()).eq(SupvFile::getType, 1));
|
||||
if (Objects.nonNull(supvFile)) {
|
||||
item.setAttachmentName(supvFile.getAttachmentName());
|
||||
}
|
||||
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
@@ -263,7 +264,8 @@ public class SupvReportMServiceImpl extends MppServiceImpl<SupvReportMMapper, Su
|
||||
public Page<SupvReportM> statisticReportPage(BaseParam baseParam) {
|
||||
List<String> deptCodes = new ArrayList<>();
|
||||
if(StrUtil.isNotBlank(baseParam.getSearchValue())){
|
||||
deptCodes = deptFeignClient.getDepSonSelfCodetByCode(baseParam.getSearchValue()).getData();
|
||||
List<Dept>deptList = deptFeignClient.getDirectSonSelf(baseParam.getSearchValue()).getData();
|
||||
deptCodes = deptList.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
}
|
||||
LambdaQueryWrapper<SupvReportM> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(StrUtil.isNotBlank(baseParam.getSearchValue()),SupvReportM::getStatisticsDept,deptCodes)
|
||||
|
||||
Reference in New Issue
Block a user