删除不必要的文件
This commit is contained in:
@@ -1,87 +0,0 @@
|
||||
package com.njcn.process.controller.userreport;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.process.pojo.param.UserReportParam;
|
||||
import com.njcn.process.pojo.param.UserReportQueryParm;
|
||||
import com.njcn.process.pojo.vo.UserReportVO;
|
||||
import com.njcn.process.service.UserReportPOService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 干扰源用户管理
|
||||
*
|
||||
* @author qijian
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/11/11 - 9:20
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/userReport")
|
||||
@Api(tags = "干扰源用户管理(新)")
|
||||
@AllArgsConstructor
|
||||
public class UserReportManageController extends BaseController {
|
||||
|
||||
private final UserReportPOService userReportPOService;
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.ADD)
|
||||
@PostMapping("/addUserReport")
|
||||
@ApiOperation("新增干扰源用户(未建档干扰源用户管理)")
|
||||
@ApiImplicitParam(name = "userReportParam", value = "实体参数", required = true)
|
||||
public HttpResult<Boolean> addUserReport(@RequestBody @Validated UserReportParam userReportParam){
|
||||
String methodDescribe = getMethodDescribe("addUserReport");
|
||||
boolean res = userReportPOService.addUserReport(userReportParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.ADD)
|
||||
@PostMapping("/auditUserReport")
|
||||
@ApiOperation("修改干扰源用户(未建档干扰源用户管理)")
|
||||
@ApiImplicitParam(name = "userReportUpdate", value = "实体参数", required = true)
|
||||
public HttpResult<Boolean> auditUserReport(@RequestBody @Validated UserReportParam.UserReportUpdate userReportUpdate){
|
||||
String methodDescribe = getMethodDescribe("auditUserReport");
|
||||
boolean res = userReportPOService.auditUserReport(userReportUpdate);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getUserReport")
|
||||
@ApiOperation("查询干扰源用户")
|
||||
@ApiImplicitParam(name = "userReportQueryParm", value = "参数", required = true)
|
||||
public HttpResult<IPage<UserReportVO>> getUserReport(@RequestBody @Validated UserReportQueryParm userReportQueryParm){
|
||||
String methodDescribe = getMethodDescribe("getUserReport");
|
||||
Page<UserReportVO> out = userReportPOService.getUserReport(userReportQueryParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/removeUserReport")
|
||||
@ApiOperation("查询干扰源用户")
|
||||
@ApiImplicitParam(name = "userReportQueryParm", value = "参数", required = true)
|
||||
public HttpResult<Boolean> removeUserReport(@RequestParam("ids") List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("removeUserReport");
|
||||
Boolean flag = userReportPOService.removeUserReport(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.njcn.process.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.process.pojo.po.UserReportPO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:07【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface UserReportPOMapper extends BaseMapper<UserReportPO> {
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.njcn.process.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.process.pojo.po.UserReportProjectPO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:08【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface UserReportProjectPOMapper extends BaseMapper<UserReportProjectPO> {
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.njcn.process.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.process.pojo.po.UserReportSensitivePO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:09【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface UserReportSensitivePOMapper extends BaseMapper<UserReportSensitivePO> {
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.njcn.process.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.process.pojo.po.UserReportSubstationPO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/4/25 10:09【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface UserReportSubstationPOMapper extends BaseMapper<UserReportSubstationPO> {
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.process.mapper.UserReportPOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.process.pojo.po.UserReportPO">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table user_report-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="reporter" jdbcType="VARCHAR" property="reporter" />
|
||||
<result column="report_date" jdbcType="DATE" property="reportDate" />
|
||||
<result column="org_id" jdbcType="VARCHAR" property="orgId" />
|
||||
<result column="expected_production_date" jdbcType="DATE" property="expectedProductionDate" />
|
||||
<result column="user_type" jdbcType="VARCHAR" property="userType" />
|
||||
<result column="city" jdbcType="VARCHAR" property="city" />
|
||||
<result column="responsible_department" jdbcType="VARCHAR" property="responsibleDepartment" />
|
||||
<result column="user_status" jdbcType="VARCHAR" property="userStatus" />
|
||||
<result column="substation" jdbcType="VARCHAR" property="substation" />
|
||||
<result column="voltage_level" jdbcType="VARCHAR" property="voltageLevel" />
|
||||
<result column="project_name" jdbcType="VARCHAR" property="projectName" />
|
||||
<result column="evaluation_dept" jdbcType="VARCHAR" property="evaluationDept" />
|
||||
<result column="evaluation_conclusion" jdbcType="VARCHAR" property="evaluationConclusion" />
|
||||
<result column="Create_By" jdbcType="CHAR" property="createBy" />
|
||||
<result column="Create_Time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="Update_By" jdbcType="CHAR" property="updateBy" />
|
||||
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="State" jdbcType="BIT" property="state" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, reporter, report_date, org_id, expected_production_date, user_type, city, responsible_department,
|
||||
user_status, substation, voltage_level, project_name, evaluation_dept, evaluation_conclusion,
|
||||
Create_By, Create_Time, Update_By, Update_Time, `State`
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.process.mapper.UserReportProjectPOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.process.pojo.po.UserReportProjectPO">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table user_report_project-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="agreement_capacity" jdbcType="DOUBLE" property="agreementCapacity" />
|
||||
<result column="nonlinear_device_type" jdbcType="VARCHAR" property="nonlinearDeviceType" />
|
||||
<result column="need_governance" jdbcType="BIT" property="needGovernance" />
|
||||
<result column="background_test_performed" jdbcType="BIT" property="backgroundTestPerformed" />
|
||||
<result column="feasibility_report" jdbcType="VARCHAR" property="feasibilityReport" />
|
||||
<result column="preliminary_design_description" jdbcType="VARCHAR" property="preliminaryDesignDescription" />
|
||||
<result column="prediction_evaluation_report" jdbcType="VARCHAR" property="predictionEvaluationReport" />
|
||||
<result column="prediction_evaluation_review_opinions" jdbcType="VARCHAR" property="predictionEvaluationReviewOpinions" />
|
||||
<result column="additional_attachments" jdbcType="VARCHAR" property="additionalAttachments" />
|
||||
<result column="Create_By" jdbcType="CHAR" property="createBy" />
|
||||
<result column="Create_Time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="Update_By" jdbcType="CHAR" property="updateBy" />
|
||||
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, agreement_capacity, nonlinear_device_type, need_governance, background_test_performed,
|
||||
feasibility_report, preliminary_design_description, prediction_evaluation_report,
|
||||
prediction_evaluation_review_opinions, additional_attachments, Create_By, Create_Time,
|
||||
Update_By, Update_Time
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.process.mapper.UserReportSensitivePOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.process.pojo.po.UserReportSensitivePO">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table user_report_sensitive-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="pcc_point" jdbcType="VARCHAR" property="pccPoint" />
|
||||
<result column="industry" jdbcType="VARCHAR" property="industry" />
|
||||
<result column="device_name" jdbcType="VARCHAR" property="deviceName" />
|
||||
<result column="power_supply_count" jdbcType="INTEGER" property="powerSupplyCount" />
|
||||
<result column="energy_quality_index" jdbcType="VARCHAR" property="energyQualityIndex" />
|
||||
<result column="evaluation_type" jdbcType="VARCHAR" property="evaluationType" />
|
||||
<result column="anti_interference_test" jdbcType="VARCHAR" property="antiInterferenceTest" />
|
||||
<result column="evaluation_chek_dept" jdbcType="VARCHAR" property="evaluationChekDept" />
|
||||
<result column="need_governance" jdbcType="BIT" property="needGovernance" />
|
||||
<result column="background_test_performed" jdbcType="BIT" property="backgroundTestPerformed" />
|
||||
<result column="substation_main_wiring_diagram" jdbcType="VARCHAR" property="substationMainWiringDiagram" />
|
||||
<result column="sensitive_devices" jdbcType="VARCHAR" property="sensitiveDevices" />
|
||||
<result column="anti_interference_report" jdbcType="VARCHAR" property="antiInterferenceReport" />
|
||||
<result column="power_quality_report" jdbcType="VARCHAR" property="powerQualityReport" />
|
||||
<result column="feasibility_report" jdbcType="VARCHAR" property="feasibilityReport" />
|
||||
<result column="preliminary_design_description" jdbcType="VARCHAR" property="preliminaryDesignDescription" />
|
||||
<result column="prediction_evaluation_report" jdbcType="VARCHAR" property="predictionEvaluationReport" />
|
||||
<result column="prediction_evaluation_review_opinions" jdbcType="VARCHAR" property="predictionEvaluationReviewOpinions" />
|
||||
<result column="additional_attachments" jdbcType="VARCHAR" property="additionalAttachments" />
|
||||
<result column="state" jdbcType="BIT" property="state" />
|
||||
<result column="Create_By" jdbcType="CHAR" property="createBy" />
|
||||
<result column="Create_Time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="Update_By" jdbcType="CHAR" property="updateBy" />
|
||||
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, pcc_point, industry, device_name, power_supply_count, energy_quality_index, evaluation_type,
|
||||
anti_interference_test, evaluation_chek_dept, need_governance, background_test_performed,
|
||||
substation_main_wiring_diagram, sensitive_devices, anti_interference_report, power_quality_report,
|
||||
feasibility_report, preliminary_design_description, prediction_evaluation_report,
|
||||
prediction_evaluation_review_opinions, additional_attachments, `state`, Create_By,
|
||||
Create_Time, Update_By, Update_Time
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.process.mapper.UserReportSubstationPOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.process.pojo.po.UserReportSubstationPO">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table user_report_substation-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="pcc_point" jdbcType="VARCHAR" property="pccPoint" />
|
||||
<result column="base_short_circuit_capacity" jdbcType="DECIMAL" property="baseShortCircuitCapacity" />
|
||||
<result column="min_short_circuit_capacity" jdbcType="DECIMAL" property="minShortCircuitCapacity" />
|
||||
<result column="pcc_equipment_capacity" jdbcType="DECIMAL" property="pccEquipmentCapacity" />
|
||||
<result column="user_agreement_capacity" jdbcType="DECIMAL" property="userAgreementCapacity" />
|
||||
<result column="evaluation_type" jdbcType="VARCHAR" property="evaluationType" />
|
||||
<result column="nonlinear_load_type" jdbcType="VARCHAR" property="nonlinearLoadType" />
|
||||
<result column="evaluation_chek_dept" jdbcType="VARCHAR" property="evaluationChekDept" />
|
||||
<result column="need_governance" jdbcType="BIT" property="needGovernance" />
|
||||
<result column="background_test_performed" jdbcType="BIT" property="backgroundTestPerformed" />
|
||||
<result column="substation_main_wiring_diagram" jdbcType="VARCHAR" property="substationMainWiringDiagram" />
|
||||
<result column="feasibility_report" jdbcType="VARCHAR" property="feasibilityReport" />
|
||||
<result column="preliminary_design_description" jdbcType="VARCHAR" property="preliminaryDesignDescription" />
|
||||
<result column="prediction_evaluation_report" jdbcType="VARCHAR" property="predictionEvaluationReport" />
|
||||
<result column="prediction_evaluation_review_opinions" jdbcType="VARCHAR" property="predictionEvaluationReviewOpinions" />
|
||||
<result column="additional_attachments" jdbcType="VARCHAR" property="additionalAttachments" />
|
||||
<result column="state" jdbcType="BIT" property="state" />
|
||||
<result column="Create_By" jdbcType="CHAR" property="createBy" />
|
||||
<result column="Create_Time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="Update_By" jdbcType="CHAR" property="updateBy" />
|
||||
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, pcc_point, base_short_circuit_capacity, min_short_circuit_capacity, pcc_equipment_capacity,
|
||||
user_agreement_capacity, evaluation_type, nonlinear_load_type, evaluation_chek_dept,
|
||||
need_governance, background_test_performed, substation_main_wiring_diagram, feasibility_report,
|
||||
preliminary_design_description, prediction_evaluation_report, prediction_evaluation_review_opinions,
|
||||
additional_attachments, `state`, Create_By, Create_Time, Update_By, Update_Time
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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>{
|
||||
|
||||
|
||||
}
|
||||
@@ -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>{
|
||||
|
||||
|
||||
}
|
||||
@@ -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>{
|
||||
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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{
|
||||
|
||||
}
|
||||
@@ -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{
|
||||
|
||||
}
|
||||
@@ -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{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user