表单提交
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
package com.njcn.process.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.process.pojo.param.RFlowProcessParm;
|
||||
import com.njcn.process.pojo.param.RFlowProcessQueryParm;
|
||||
import com.njcn.process.pojo.po.RFlowProcessPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
import com.njcn.process.pojo.vo.applyform.RFlowProcessVO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/15 16:24【需求编号】
|
||||
@@ -21,4 +25,8 @@ public interface RFlowProcessPOService extends IService<RFlowProcessPO>{
|
||||
Boolean check(RFlowProcessParm.RFlowProcessCheck rFlowProcessCheck);
|
||||
|
||||
Boolean file(String id);
|
||||
}
|
||||
|
||||
Page<RFlowProcessVO> getFlowProcess(RFlowProcessQueryParm rFlowProcessQueryParm);
|
||||
|
||||
Boolean createCheckflow(String id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.njcn.process.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.process.pojo.param.UserReportParam;
|
||||
import com.njcn.process.pojo.param.UserReportQueryParm;
|
||||
import com.njcn.process.pojo.po.UserReportPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.process.pojo.vo.UserReportVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:07【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface UserReportPOService extends IService<UserReportPO>{
|
||||
|
||||
|
||||
boolean addUserReport(UserReportParam userReportParam);
|
||||
|
||||
boolean auditUserReport(UserReportParam.UserReportUpdate userReportUpdate);
|
||||
|
||||
Page<UserReportVO> getUserReport(UserReportQueryParm userReportQueryParm);
|
||||
|
||||
Boolean removeUserReport(List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.process.service;
|
||||
|
||||
import com.njcn.process.pojo.po.UserReportProjectPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:08【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface UserReportProjectPOService extends IService<UserReportProjectPO>{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.process.service;
|
||||
|
||||
import com.njcn.process.pojo.po.UserReportSensitivePO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:09【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface UserReportSensitivePOService extends IService<UserReportSensitivePO>{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.process.service;
|
||||
|
||||
import com.njcn.process.pojo.po.UserReportSubstationPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:09【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface UserReportSubstationPOService extends IService<UserReportSubstationPO>{
|
||||
|
||||
|
||||
}
|
||||
@@ -1,18 +1,23 @@
|
||||
package com.njcn.process.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.process.enums.ProcessResponseEnum;
|
||||
import com.njcn.process.enums.ThsFlowTypeEnum;
|
||||
import com.njcn.process.mapper.FlowFormAssMapper;
|
||||
import com.njcn.process.mapper.FlowableAssMapper;
|
||||
import com.njcn.process.mapper.RFlowProcessPOMapper;
|
||||
import com.njcn.process.pojo.param.RFlowProcessParm;
|
||||
import com.njcn.process.pojo.param.RFlowProcessQueryParm;
|
||||
import com.njcn.process.pojo.po.FlowFormAss;
|
||||
import com.njcn.process.pojo.po.FlowableAss;
|
||||
import com.njcn.process.pojo.po.RFlowProcessPO;
|
||||
import com.njcn.process.pojo.vo.applyform.RFlowProcessVO;
|
||||
import com.njcn.process.pojo.vo.flowable.FlowTaskVo;
|
||||
import com.njcn.process.service.RFlowProcessPOService;
|
||||
import com.njcn.process.service.flowable.IFlowDefinitionService;
|
||||
@@ -20,16 +25,22 @@ import com.njcn.process.service.flowable.IFlowInstanceService;
|
||||
import com.njcn.process.service.flowable.IFlowTaskService;
|
||||
import com.njcn.process.utils.FlowableUtils;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -48,6 +59,7 @@ public class RFlowProcessPOServiceImpl extends ServiceImpl<RFlowProcessPOMapper,
|
||||
private final FlowFormAssMapper flowFormAssMapper;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
|
||||
private final IFlowDefinitionService iFlowDefinitionService;
|
||||
@@ -68,12 +80,12 @@ public class RFlowProcessPOServiceImpl extends ServiceImpl<RFlowProcessPOMapper,
|
||||
//生成新建工作流
|
||||
createflow(businessId, rFlowProcessParm.getApplyType(), rFlowProcessParm.getType());
|
||||
//生成提交审核工作流
|
||||
if(Objects.equals(rFlowProcessParm.getOperate(),"2")){
|
||||
createCheckflow(businessId);
|
||||
}
|
||||
//修改状态
|
||||
rFlowProcessPO.setProcessStatus(2);
|
||||
this.updateById(rFlowProcessPO);
|
||||
// if(Objects.equals(rFlowProcessParm.getOperate(),"2")){
|
||||
// createCheckflow(businessId);
|
||||
// //修改状态
|
||||
//
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -103,7 +115,7 @@ public class RFlowProcessPOServiceImpl extends ServiceImpl<RFlowProcessPOMapper,
|
||||
updateWrapper.set("process_status",rFlowProcessCheck.getCheckStatus()==1?3:4);
|
||||
result = this.update(updateWrapper);
|
||||
//流程审核
|
||||
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getType, ThsFlowTypeEnum.monitoringReturned.getCode()).eq(FlowableAss::getThsIndex,rFlowProcessCheck.getId()));
|
||||
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getThsIndex,rFlowProcessCheck.getId()));
|
||||
if(Objects.isNull(flowableAss)){
|
||||
throw new BusinessException("当前功能未绑定流程,请联系管理员处理");
|
||||
}
|
||||
@@ -119,7 +131,7 @@ public class RFlowProcessPOServiceImpl extends ServiceImpl<RFlowProcessPOMapper,
|
||||
updateWrapper.set("process_status",5);
|
||||
result = this.update(updateWrapper);
|
||||
//流程审核
|
||||
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getType, ThsFlowTypeEnum.monitoringReturned.getCode()).eq(FlowableAss::getThsIndex,id));
|
||||
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getThsIndex,id));
|
||||
if(Objects.isNull(flowableAss)){
|
||||
throw new BusinessException("当前功能未绑定流程,请联系管理员处理");
|
||||
}
|
||||
@@ -134,6 +146,45 @@ public class RFlowProcessPOServiceImpl extends ServiceImpl<RFlowProcessPOMapper,
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<RFlowProcessVO> getFlowProcess(RFlowProcessQueryParm rFlowProcessQueryParm) {
|
||||
Page<RFlowProcessVO> page = new Page<> (rFlowProcessQueryParm.getPageNum(), rFlowProcessQueryParm.getPageSize());
|
||||
IPage<RFlowProcessPO> tempPage = new Page<> (rFlowProcessQueryParm.getPageNum(), rFlowProcessQueryParm.getPageSize());
|
||||
|
||||
String loginUsrId = RequestUtil.getUserIndex();
|
||||
//部门处理:根据部门code取名称
|
||||
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();
|
||||
Map<String, String> pvTerminalTreeVOMap = dept.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, PvTerminalTreeVO::getName));
|
||||
QueryWrapper<RFlowProcessPO> queryWrapper = new QueryWrapper<> ();
|
||||
/*type=1:新建页面:查看自己负责的计划;type=2:审核页面:审核者==当前用户;结果页面:查看自己负责的计划*/
|
||||
if (Objects.equals(rFlowProcessQueryParm.getPageType(),"1") ) {
|
||||
queryWrapper.lambda().eq(RFlowProcessPO::getCreateBy, loginUsrId);
|
||||
queryWrapper.lambda().in(RFlowProcessPO::getProcessStatus, Stream.of(1,3,4,5).collect(Collectors.toList()));
|
||||
}
|
||||
if (Objects.equals(rFlowProcessQueryParm.getPageType(),"2")) {
|
||||
queryWrapper.lambda().eq(RFlowProcessPO::getChecker, loginUsrId);
|
||||
queryWrapper.lambda().in(RFlowProcessPO::getProcessStatus, Stream.of(2).collect(Collectors.toList()));
|
||||
}
|
||||
queryWrapper.lambda().eq(RFlowProcessPO::getApplyType,rFlowProcessQueryParm.getApplyType())
|
||||
.between(StringUtils.isNotBlank(rFlowProcessQueryParm.getStartTime()) &&
|
||||
StringUtils.isNotBlank(rFlowProcessQueryParm.getEndTime()) ,
|
||||
RFlowProcessPO::getCreateTime,rFlowProcessQueryParm.getStartTime()+" 00:00:00",rFlowProcessQueryParm.getEndTime()+" 23:59:59");
|
||||
|
||||
IPage<RFlowProcessPO> rGeneralSurveyPlanDetailIPage = this.getBaseMapper().selectPage (tempPage, queryWrapper);
|
||||
List<RFlowProcessVO> collect = rGeneralSurveyPlanDetailIPage.getRecords().stream().map(temp->{
|
||||
RFlowProcessVO rFlowProcessVO = new RFlowProcessVO();
|
||||
BeanUtils.copyProperties(temp,rFlowProcessVO);
|
||||
|
||||
Object bean = JSONUtil.toBean(temp.getApplicationFormText(), Object.class);
|
||||
rFlowProcessVO.setApplyForm(bean);
|
||||
rFlowProcessVO.setOrgName(pvTerminalTreeVOMap.get(temp.getOrgNo())); //单位名称
|
||||
return rFlowProcessVO;
|
||||
}).collect(Collectors.toList());
|
||||
page.setRecords(collect);
|
||||
page.setTotal(page.getTotal());
|
||||
return page;
|
||||
}
|
||||
|
||||
//新建流程
|
||||
public Boolean createflow(String businessId ,Integer applyType,Integer type ) {
|
||||
String userId = RequestUtil.getUserIndex();
|
||||
@@ -149,7 +200,7 @@ public class RFlowProcessPOServiceImpl extends ServiceImpl<RFlowProcessPOMapper,
|
||||
}
|
||||
//如何applyType==3 电能质量管理下有3个子流程
|
||||
map.put("type",type);
|
||||
String processId = iFlowDefinitionService.startProcessInstanceById(flowFormAss.getDefinitionId(), businessId, ThsFlowTypeEnum.monitoringReturned.getCode(), map);
|
||||
String processId = iFlowDefinitionService.startProcessInstanceById(flowFormAss.getDefinitionId(), businessId, applyType, map);
|
||||
Task task = iFlowTaskService.getTask(processId);
|
||||
FlowTaskVo flowTaskVo = new FlowTaskVo();
|
||||
flowTaskVo.setTaskId(task.getId());
|
||||
@@ -166,9 +217,10 @@ public class RFlowProcessPOServiceImpl extends ServiceImpl<RFlowProcessPOMapper,
|
||||
}
|
||||
|
||||
//提交审核工作流
|
||||
@Override
|
||||
public Boolean createCheckflow(String businessId ) {
|
||||
//流程审核
|
||||
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getType, ThsFlowTypeEnum.monitoringReturned.getCode()).eq(FlowableAss::getThsIndex,businessId));
|
||||
//流程审核
|
||||
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getThsIndex,businessId));
|
||||
if(Objects.isNull(flowableAss)){
|
||||
throw new BusinessException("当前功能未绑定流程,请联系管理员处理");
|
||||
}
|
||||
@@ -178,7 +230,8 @@ public class RFlowProcessPOServiceImpl extends ServiceImpl<RFlowProcessPOMapper,
|
||||
flowTaskVoNext.setTaskId(taskNext.getId());
|
||||
flowTaskVoNext.setAssignee(byId.getChecker());
|
||||
iFlowTaskService.toNextTaskUser(flowTaskVoNext);
|
||||
|
||||
byId.setProcessStatus(2);
|
||||
this.updateById(byId);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
package com.njcn.process.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.process.mapper.UserReportPOMapper;
|
||||
import com.njcn.process.pojo.param.UserReportParam;
|
||||
import com.njcn.process.pojo.param.UserReportQueryParm;
|
||||
import com.njcn.process.pojo.po.UserReportPO;
|
||||
import com.njcn.process.pojo.po.UserReportProjectPO;
|
||||
import com.njcn.process.pojo.po.UserReportSensitivePO;
|
||||
import com.njcn.process.pojo.po.UserReportSubstationPO;
|
||||
import com.njcn.process.pojo.vo.UserReportVO;
|
||||
import com.njcn.process.service.UserReportPOService;
|
||||
import com.njcn.process.service.UserReportProjectPOService;
|
||||
import com.njcn.process.service.UserReportSensitivePOService;
|
||||
import com.njcn.process.service.UserReportSubstationPOService;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.BeanWrapper;
|
||||
import org.springframework.beans.BeanWrapperImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:07【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, UserReportPO> implements UserReportPOService{
|
||||
|
||||
private final UserReportProjectPOService userReportProjectPOService;
|
||||
private final UserReportSubstationPOService userReportSubstationPOService;
|
||||
private final UserReportSensitivePOService userReportSensitivePOService;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean addUserReport(UserReportParam userReportParam) {
|
||||
UserReportPO userReportPO = new UserReportPO();
|
||||
BeanUtils.copyProperties(userReportParam,userReportPO);
|
||||
userReportPO.setState(1);
|
||||
boolean save = this.save(userReportPO);
|
||||
String id = userReportPO.getId();
|
||||
if(Objects.equals(userReportPO.getUserType(),"1")||
|
||||
Objects.equals(userReportPO.getUserType(),"2")){
|
||||
UserReportProjectPO userReportProjectPO = userReportParam.getUserReportProjectPO();
|
||||
userReportProjectPO.setId(id);
|
||||
userReportProjectPO.setState(1);
|
||||
userReportProjectPOService.saveOrUpdate(userReportProjectPO);
|
||||
}else if(Objects.equals(userReportPO.getUserType(),"3")||
|
||||
Objects.equals(userReportPO.getUserType(),"4")){
|
||||
UserReportSubstationPO userReportSubstationPO = userReportParam.getUserReportSubstationPO();
|
||||
userReportSubstationPO.setId(id);
|
||||
userReportSubstationPO.setState(1);
|
||||
userReportSubstationPOService.saveOrUpdate(userReportSubstationPO);
|
||||
}else if(Objects.equals(userReportPO.getUserType(),"5")){
|
||||
UserReportSensitivePO userReportSensitivePO = userReportParam.getUserReportSensitivePO();
|
||||
userReportSensitivePO.setId(id);
|
||||
userReportSensitivePO.setState(1);
|
||||
userReportSensitivePOService.saveOrUpdate(userReportSensitivePO);
|
||||
}
|
||||
|
||||
return save;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean auditUserReport(UserReportParam.UserReportUpdate userReportUpdate) {
|
||||
String id = userReportUpdate.getId();
|
||||
UserReportPO byId = this.getById(id);
|
||||
BeanUtils.copyProperties(userReportUpdate,byId);
|
||||
this.updateById(byId);
|
||||
if(Objects.equals(userReportUpdate.getUserType(),"1")||
|
||||
Objects.equals(userReportUpdate.getUserType(),"2")){
|
||||
UserReportProjectPO userReportProjectPO = userReportProjectPOService.getById(id);
|
||||
BeanUtils.copyProperties(userReportUpdate.getUserReportProjectPO(),userReportProjectPO,getNullPropertyNames(userReportUpdate.getUserReportProjectPO()));
|
||||
userReportProjectPOService.updateById(userReportProjectPO);
|
||||
}else if(Objects.equals(userReportUpdate.getUserType(),"3")||
|
||||
Objects.equals(userReportUpdate.getUserType(),"4")){
|
||||
UserReportSubstationPO userReportSubstationPO = userReportSubstationPOService.getById(id);
|
||||
BeanUtils.copyProperties(userReportUpdate.getUserReportSubstationPO(),userReportSubstationPO,getNullPropertyNames(userReportUpdate.getUserReportSubstationPO()));
|
||||
userReportSubstationPOService.updateById(userReportSubstationPO);
|
||||
}else if(Objects.equals(userReportUpdate.getUserType(),"5")){
|
||||
UserReportSensitivePO userReportSensitivePO = userReportSensitivePOService.getById(id);
|
||||
BeanUtils.copyProperties(userReportUpdate.getUserReportSensitivePO(),userReportSensitivePO,getNullPropertyNames(userReportUpdate.getUserReportSensitivePO()));
|
||||
userReportSensitivePOService.updateById(userReportSensitivePO);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<UserReportVO> getUserReport(UserReportQueryParm userReportQueryParm) {
|
||||
Page<UserReportVO> page = new Page<> (userReportQueryParm.getPageNum(), userReportQueryParm.getPageSize());
|
||||
IPage<UserReportPO> tempPage = new Page<> (userReportQueryParm.getPageNum(), userReportQueryParm.getPageSize());
|
||||
|
||||
String loginUsrId = RequestUtil.getUserIndex();
|
||||
//部门处理:根据部门code取名称
|
||||
List<PvTerminalTreeVO> dept = deptFeignClient.allDeptList().getData();
|
||||
Map<String, String> pvTerminalTreeVOMap = dept.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, PvTerminalTreeVO::getName));
|
||||
QueryWrapper<UserReportPO> queryWrapper = new QueryWrapper<> ();
|
||||
/*type=1:新建页面:查看自己负责的计划;type=2:审核页面:审核者==当前用户;结果页面:查看自己负责的计划*/
|
||||
// if (Objects.equals(userReportQueryParm.getPageType(),"1") ) {
|
||||
// queryWrapper.lambda().eq(UserReportPO::getCreateBy, loginUsrId);
|
||||
// queryWrapper.lambda().in(UserReportPO::getProcessStatus, Stream.of(1,3,4,5).collect(Collectors.toList()));
|
||||
// }
|
||||
// if (Objects.equals(userReportQueryParm.getPageType(),"2")) {
|
||||
// queryWrapper.lambda().eq(RFlowProcessPO::getChecker, loginUsrId);
|
||||
// queryWrapper.lambda().in(RFlowProcessPO::getProcessStatus, Stream.of(2).collect(Collectors.toList()));
|
||||
// }
|
||||
queryWrapper.lambda().eq(UserReportPO::getUserType,userReportQueryParm.getType())
|
||||
.eq(UserReportPO::getState,1)
|
||||
.between(StringUtils.isNotBlank(userReportQueryParm.getStartTime()) &&
|
||||
StringUtils.isNotBlank(userReportQueryParm.getEndTime()) ,
|
||||
UserReportPO::getCreateTime,userReportQueryParm.getStartTime()+" 00:00:00",userReportQueryParm.getEndTime()+" 23:59:59");
|
||||
|
||||
IPage<UserReportPO> tempPageList = this.getBaseMapper().selectPage (tempPage, queryWrapper);
|
||||
List<UserReportVO> collect = tempPageList.getRecords().stream().map(temp->{
|
||||
UserReportVO userReportVO = new UserReportVO();
|
||||
BeanUtils.copyProperties(temp,userReportVO);
|
||||
if(Objects.equals(userReportVO.getUserType(),"1")||
|
||||
Objects.equals(userReportVO.getUserType(),"2")){
|
||||
UserReportProjectPO userReportProjectPO = userReportProjectPOService.getById(temp.getId());
|
||||
userReportVO.setUserReportProjectPO(userReportProjectPO);
|
||||
}else if(Objects.equals(userReportVO.getUserType(),"3")||
|
||||
Objects.equals(userReportVO.getUserType(),"4")){
|
||||
UserReportSubstationPO userReportSubstationPO = userReportSubstationPOService.getById(temp.getId());
|
||||
|
||||
userReportVO.setUserReportSubstationPO(userReportSubstationPO);
|
||||
}else if(Objects.equals(userReportVO.getUserType(),"5")){
|
||||
UserReportSensitivePO userReportSensitivePO = userReportSensitivePOService.getById(temp.getId());
|
||||
userReportVO.setUserReportSensitivePO(userReportSensitivePO);
|
||||
}
|
||||
|
||||
return userReportVO;
|
||||
}).collect(Collectors.toList());
|
||||
page.setRecords(collect);
|
||||
page.setTotal(page.getTotal());
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeUserReport(List<String> ids) {
|
||||
this.lambdaUpdate().set(UserReportPO::getState,0).in(UserReportPO::getId,ids).update();
|
||||
userReportProjectPOService.lambdaUpdate().set(UserReportProjectPO::getState,0).in(UserReportProjectPO::getId,ids).update();
|
||||
userReportSubstationPOService.lambdaUpdate().set(UserReportSubstationPO::getState,0).in(UserReportSubstationPO::getId,ids).update();
|
||||
userReportSensitivePOService.lambdaUpdate().set(UserReportSensitivePO::getState,0).in(UserReportSensitivePO::getId,ids).update();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有字段为null的属性名
|
||||
* @param source
|
||||
* @return
|
||||
*/
|
||||
public String[] getNullPropertyNames (Object source) {
|
||||
final BeanWrapper src = new BeanWrapperImpl(source);
|
||||
java.beans.PropertyDescriptor[] pds = src.getPropertyDescriptors ( );
|
||||
|
||||
Set<String> emptyNames = new HashSet<String> ( );
|
||||
for (java.beans.PropertyDescriptor pd : pds) {
|
||||
Object srcValue = src.getPropertyValue (pd.getName ( ));
|
||||
if (srcValue == null){
|
||||
emptyNames.add (pd.getName ( ));
|
||||
}
|
||||
}
|
||||
String[] result = new String[emptyNames.size ( )];
|
||||
return emptyNames.toArray (result);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.process.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.process.mapper.UserReportProjectPOMapper;
|
||||
import com.njcn.process.pojo.po.UserReportProjectPO;
|
||||
import com.njcn.process.service.UserReportProjectPOService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:08【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class UserReportProjectPOServiceImpl extends ServiceImpl<UserReportProjectPOMapper, UserReportProjectPO> implements UserReportProjectPOService{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.process.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.process.pojo.po.UserReportSensitivePO;
|
||||
import com.njcn.process.mapper.UserReportSensitivePOMapper;
|
||||
import com.njcn.process.service.UserReportSensitivePOService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:09【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class UserReportSensitivePOServiceImpl extends ServiceImpl<UserReportSensitivePOMapper, UserReportSensitivePO> implements UserReportSensitivePOService{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.process.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.process.mapper.UserReportSubstationPOMapper;
|
||||
import com.njcn.process.pojo.po.UserReportSubstationPO;
|
||||
import com.njcn.process.service.UserReportSubstationPOService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:09【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class UserReportSubstationPOServiceImpl extends ServiceImpl<UserReportSubstationPOMapper, UserReportSubstationPO> implements UserReportSubstationPOService{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user