|
@@ -1,14 +1,16 @@
|
|
|
package cn.cslg.pas.service.business;
|
|
|
|
|
|
import cn.cslg.pas.common.dto.business.ReportAffairDTO;
|
|
|
+import cn.cslg.pas.common.dto.invalidDTO.AddAdminProceedDTO;
|
|
|
+import cn.cslg.pas.common.dto.invalidDTO.AddStateOpinionDTO;
|
|
|
import cn.cslg.pas.common.dto.invalidDTO.QueryReportAffairDTO;
|
|
|
+import cn.cslg.pas.common.dto.invalidDTO.UpdateStateOpinionDTO;
|
|
|
import cn.cslg.pas.common.model.cronModel.Personnel;
|
|
|
import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
|
import cn.cslg.pas.common.model.cronModel.SystemFile;
|
|
|
import cn.cslg.pas.common.utils.CacheUtils;
|
|
|
import cn.cslg.pas.common.utils.LoginUtils;
|
|
|
-import cn.cslg.pas.common.vo.invalidVO.InvalidRequestFileVO;
|
|
|
-import cn.cslg.pas.common.vo.invalidVO.ReportAffairVO;
|
|
|
+import cn.cslg.pas.common.vo.invalidVO.*;
|
|
|
import cn.cslg.pas.domain.business.AssoReportAffairFile;
|
|
|
import cn.cslg.pas.domain.business.InvalidRequestFile;
|
|
|
import cn.cslg.pas.domain.business.ReportAffair;
|
|
@@ -22,7 +24,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
@@ -47,9 +51,19 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
|
|
|
@Autowired
|
|
|
private FileManagerService fileManagerService;
|
|
|
@Autowired
|
|
|
+ @Lazy
|
|
|
private InvalidRequestFileService invalidRequestFileService;
|
|
|
@Autowired
|
|
|
private PermissionService permissionService;
|
|
|
+ @Autowired
|
|
|
+ @Lazy
|
|
|
+ private OralTrailService oralTrailService;
|
|
|
+ @Autowired
|
|
|
+ @Lazy
|
|
|
+ private InvalidDecisionFileService invalidDecisionFileService;
|
|
|
+ @Autowired
|
|
|
+ @Lazy
|
|
|
+ private AdminProceedService adminProceedService;
|
|
|
|
|
|
/**
|
|
|
* 创建报告事务
|
|
@@ -119,16 +133,16 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
|
|
|
BeanUtils.copyProperties(item, reportAffairVO);
|
|
|
//根据事务类型选择不同的装载方式
|
|
|
Integer type = reportAffairVO.getAffairType();
|
|
|
- if (type == 0) {
|
|
|
-
|
|
|
- } else if (type == 1) {//无效请求书
|
|
|
+ if (type == 0) {//0 口审记录
|
|
|
+ this.loadOralTrail(reportAffairVO);
|
|
|
+ } else if (type == 1) {//1 无效请求书
|
|
|
this.loadInvalidRequestFile(reportAffairVO);
|
|
|
- } else if (type == 2) {
|
|
|
-
|
|
|
- } else if (type == 3) {
|
|
|
-
|
|
|
- } else if (type == 4) {
|
|
|
-
|
|
|
+ } else if (type == 2) {//2 陈述意见书
|
|
|
+ this.loadStateOpinion(reportAffairVO);
|
|
|
+ } else if (type == 3) {//3 无效决定书
|
|
|
+ this.loadInvalidDecisionFile(reportAffairVO);
|
|
|
+ } else if (type == 4) {//4 行政诉讼书
|
|
|
+ this.loadAdminProceed(reportAffairVO);
|
|
|
}
|
|
|
reportAffairVOS.add(reportAffairVO);
|
|
|
});
|
|
@@ -208,4 +222,141 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载口审记录
|
|
|
+ *
|
|
|
+ * @param reportAffairVO
|
|
|
+ */
|
|
|
+ public void loadOralTrail(ReportAffairVO reportAffairVO) {
|
|
|
+ Integer reportAffairId = reportAffairVO.getId();
|
|
|
+ OralTrailVO oralTrailVO = oralTrailService.getOralTrailVO(reportAffairId);
|
|
|
+ reportAffairVO.setOralTrailVO(oralTrailVO);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载无效决定书
|
|
|
+ *
|
|
|
+ * @param reportAffairVO
|
|
|
+ */
|
|
|
+ public void loadInvalidDecisionFile(ReportAffairVO reportAffairVO) {
|
|
|
+ Integer reportAffairId = reportAffairVO.getId();
|
|
|
+ InvalidDecisionFileVO invalidDecisionFileVO = invalidDecisionFileService.getInvalidDecisionFile(reportAffairId);
|
|
|
+ reportAffairVO.setInvalidDecisionFileVO(invalidDecisionFileVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载行政诉讼书
|
|
|
+ *
|
|
|
+ * @param reportAffairVO
|
|
|
+ */
|
|
|
+ public void loadAdminProceed(ReportAffairVO reportAffairVO) {
|
|
|
+ Integer reportAffairId = reportAffairVO.getId();
|
|
|
+ AdminProceedVO adminProceedVO = adminProceedService.getAdminProceed(reportAffairId);
|
|
|
+ reportAffairVO.setAdminProceedVO(adminProceedVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上传陈述意见书
|
|
|
+ * @param addStateOpinionDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Integer addStateOpinion(AddStateOpinionDTO addStateOpinionDTO){
|
|
|
+ if (addStateOpinionDTO == null) {
|
|
|
+ throw new XiaoShiException("入参为空");
|
|
|
+ }
|
|
|
+ Integer projectId = addStateOpinionDTO.getProjectId();
|
|
|
+ if (projectId == null) {
|
|
|
+ throw new XiaoShiException("报告id为空");
|
|
|
+ }
|
|
|
+ //1. 首先上传报告事务,拿到报告事务id
|
|
|
+ ReportAffairDTO reportAffairDTO = new ReportAffairDTO();
|
|
|
+ reportAffairDTO.setProjectId(projectId);
|
|
|
+ //陈述意见书 2
|
|
|
+ reportAffairDTO.setAffairType(2);
|
|
|
+ //发生时间是无效请求日
|
|
|
+ reportAffairDTO.setOccurredTime(addStateOpinionDTO.getStateReplyTime());
|
|
|
+ //备注
|
|
|
+ reportAffairDTO.setDescription(addStateOpinionDTO.getDescription());
|
|
|
+ Integer reportAffairId = this.addReportAffair(reportAffairDTO);
|
|
|
+
|
|
|
+ if (reportAffairId == null) {
|
|
|
+ throw new XiaoShiException("上传报告事务失败");
|
|
|
+ }
|
|
|
+ //3. 添加报告事务与文件关联
|
|
|
+ List<String> fileGuids = addStateOpinionDTO.getFileGuids();
|
|
|
+ if (fileGuids != null && !fileGuids.isEmpty()) {
|
|
|
+ List<AssoReportAffairFile> assoReportAffairFiles = new ArrayList<>();
|
|
|
+ fileGuids.forEach(item -> {
|
|
|
+ AssoReportAffairFile assoReportAffairFile = new AssoReportAffairFile();
|
|
|
+ assoReportAffairFile.setReportAffairId(reportAffairId);
|
|
|
+ assoReportAffairFile.setFileGuid(item);
|
|
|
+ assoReportAffairFiles.add(assoReportAffairFile);
|
|
|
+ });
|
|
|
+ assoReportAffairFileService.saveBatch(assoReportAffairFiles);
|
|
|
+ }
|
|
|
+ return reportAffairId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新陈述意见
|
|
|
+ * @param updateStateOpinionDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Integer updateStateOpinion(UpdateStateOpinionDTO updateStateOpinionDTO){
|
|
|
+ if (updateStateOpinionDTO == null) {
|
|
|
+ throw new XiaoShiException("入参为空");
|
|
|
+ }
|
|
|
+ Integer projectId = updateStateOpinionDTO.getProjectId();
|
|
|
+ Integer reportAffairId = updateStateOpinionDTO.getStateOpinionId();
|
|
|
+ if (reportAffairId == null) {
|
|
|
+ throw new XiaoShiException("reportAffairId为空");
|
|
|
+ }
|
|
|
+ if (projectId == null) {
|
|
|
+ throw new XiaoShiException("报告id为空");
|
|
|
+ }
|
|
|
+ //2. 拿到报告事务id,获取报告事务
|
|
|
+ ReportAffair reportAffair = this.getById(reportAffairId);
|
|
|
+ reportAffair.setProjectId(projectId);
|
|
|
+ //发生时间是无效请求日
|
|
|
+ reportAffair.setOccurredTime(updateStateOpinionDTO.getStateReplyTime());
|
|
|
+ //备注
|
|
|
+ reportAffair.setDescription(updateStateOpinionDTO.getDescription());
|
|
|
+ reportAffair.updateById();
|
|
|
+ //3. 更新报告事务与文件关联
|
|
|
+ List<String> fileGuids = updateStateOpinionDTO.getFileGuids();
|
|
|
+ if (fileGuids != null && !fileGuids.isEmpty()) {
|
|
|
+ LambdaQueryWrapper<AssoReportAffairFile> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(AssoReportAffairFile::getReportAffairId, reportAffairId);
|
|
|
+ assoReportAffairFileService.remove(queryWrapper);
|
|
|
+
|
|
|
+ List<AssoReportAffairFile> assoReportAffairFiles = new ArrayList<>();
|
|
|
+ fileGuids.forEach(item -> {
|
|
|
+ AssoReportAffairFile assoReportAffairFile = new AssoReportAffairFile();
|
|
|
+ assoReportAffairFile.setReportAffairId(reportAffairId);
|
|
|
+ assoReportAffairFile.setFileGuid(item);
|
|
|
+ assoReportAffairFiles.add(assoReportAffairFile);
|
|
|
+ });
|
|
|
+ assoReportAffairFileService.saveBatch(assoReportAffairFiles);
|
|
|
+ }
|
|
|
+ return reportAffairId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载陈述意见书
|
|
|
+ *
|
|
|
+ * @param reportAffairVO
|
|
|
+ */
|
|
|
+ public void loadStateOpinion(ReportAffairVO reportAffairVO) {
|
|
|
+ Integer reportAffairId = reportAffairVO.getId();
|
|
|
+ StateOpinionVO stateOpinionVO = new StateOpinionVO();
|
|
|
+ ReportAffair reportAffair = this.getById(reportAffairId);
|
|
|
+ stateOpinionVO.setStateOpinionId(reportAffairId);
|
|
|
+ stateOpinionVO.setDescription(reportAffair.getDescription());
|
|
|
+ stateOpinionVO.setStateReplyTime(reportAffair.getOccurredTime());
|
|
|
+ stateOpinionVO.setProjectId(reportAffair.getProjectId());
|
|
|
+ reportAffairVO.setStateOpinionVO(stateOpinionVO);
|
|
|
+ }
|
|
|
}
|