删除不必要的文件

This commit is contained in:
2024-05-09 18:32:14 +08:00
parent 1b85acaa74
commit 928af53cc9
24 changed files with 163 additions and 235 deletions

View File

@@ -1,30 +0,0 @@
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);
}

View File

@@ -1,16 +0,0 @@
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>{
}

View File

@@ -1,16 +0,0 @@
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>{
}

View File

@@ -1,16 +0,0 @@
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>{
}

View File

@@ -1,186 +0,0 @@
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);
}
}

View File

@@ -1,21 +0,0 @@
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{
}

View File

@@ -1,21 +0,0 @@
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{
}

View File

@@ -1,21 +0,0 @@
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{
}