|
|
|
|
@ -7,8 +7,6 @@ import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
|
import com.alibaba.excel.ExcelWriter; |
|
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum; |
|
|
|
|
import com.alibaba.excel.write.handler.CellWriteHandler; |
|
|
|
|
import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; |
|
|
|
|
import com.alibaba.excel.write.metadata.WriteSheet; |
|
|
|
|
import com.alibaba.excel.write.metadata.fill.FillConfig; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
@ -17,21 +15,22 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.biutag.supervision.common.UserContextHolder; |
|
|
|
|
import com.biutag.supervision.constants.AppConstants; |
|
|
|
|
import com.biutag.supervision.constants.enums.FlowNodeEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.DeleteStatusEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.RoleCodeEnum; |
|
|
|
|
import com.biutag.supervision.mapper.Recessed.RecessedLogMapper; |
|
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
|
import com.biutag.supervision.pojo.dto.QuerySecondDTO; |
|
|
|
|
import com.biutag.supervision.pojo.entity.InformMessage; |
|
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
|
import com.biutag.supervision.pojo.entity.recessed.RecessedLog; |
|
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportFlow; |
|
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportProject; |
|
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportReview; |
|
|
|
|
import com.biutag.supervision.pojo.enums.FlowEnum; |
|
|
|
|
import com.biutag.supervision.pojo.model.UserAuth; |
|
|
|
|
import com.biutag.supervision.pojo.param.Recessed.RecessedParam; |
|
|
|
|
import com.biutag.supervision.pojo.param.Report.ReportProjectQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.param.entryWindow.EntryWindowQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.param.statement.StatementQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.request.reportProject.ReportProjectDeleteRequest; |
|
|
|
|
import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.excel.ExcelControlPriceVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.report.ReportHomeVo; |
|
|
|
|
@ -40,24 +39,18 @@ import com.biutag.supervision.pojo.vo.statement.ConditionExcelVo;
|
|
|
|
|
import com.biutag.supervision.pojo.vo.statement.ConditionVo; |
|
|
|
|
import com.biutag.supervision.service.InformMessageService; |
|
|
|
|
import com.biutag.supervision.service.Report.ReportProjectService; |
|
|
|
|
import com.biutag.supervision.service.Report.ReportReviewService; |
|
|
|
|
import com.biutag.supervision.service.SupDepartService; |
|
|
|
|
import com.biutag.supervision.util.BigDecimalUtils; |
|
|
|
|
import com.biutag.supervision.util.CustomFontLoader; |
|
|
|
|
import jakarta.servlet.ServletOutputStream; |
|
|
|
|
import jakarta.servlet.http.HttpServletResponse; |
|
|
|
|
import lombok.Getter; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.poi.ss.usermodel.CellStyle; |
|
|
|
|
import org.apache.poi.ss.usermodel.CellType; |
|
|
|
|
import org.apache.poi.ss.usermodel.Workbook; |
|
|
|
|
import org.apache.poi.util.IOUtils; |
|
|
|
|
import org.springframework.core.io.ClassPathResource; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.io.InputStream; |
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
@ -65,7 +58,9 @@ import java.math.RoundingMode;
|
|
|
|
|
import java.net.URLEncoder; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author weipeng |
|
|
|
|
@ -91,7 +86,7 @@ public class ReportProjectController {
|
|
|
|
|
wrapper.eq(StrUtil.isNotBlank(query.getReportType()),"p.report_type",query.getReportType()) |
|
|
|
|
.like(StrUtil.isNotBlank(query.getReportName()),"p.report_name",query.getReportName()) |
|
|
|
|
.eq(StrUtil.isNotBlank(query.getProjectType()),"p.project_type",query.getProjectType()) |
|
|
|
|
.eq(StrUtil.isNotBlank(query.getAuditUnitId()),"p.audit_unit_id",query.getAuditUnitId()) |
|
|
|
|
// .eq(StrUtil.isNotBlank(query.getAuditUnitId()),"p.audit_unit_id",query.getAuditUnitId())
|
|
|
|
|
.like(StrUtil.isNotBlank(query.getProjectPrincipal()),"p.project_principal",query.getProjectPrincipal()) |
|
|
|
|
.like(StrUtil.isNotBlank(query.getProjectPhone()),"p.project_phone",query.getProjectPhone()) |
|
|
|
|
.eq(StrUtil.isNotBlank(query.getPurchaseMethod()),"p.purchase_method",query.getPurchaseMethod()) |
|
|
|
|
@ -132,8 +127,13 @@ public class ReportProjectController {
|
|
|
|
|
if(StrUtil.isNotBlank(query.getCode()) &&!"all".equals(query.getCode()) ){ |
|
|
|
|
wrapper.eq("p.is_recessed",Integer.parseInt(query.getCode())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(query.getAuditUnitId())) { |
|
|
|
|
// 获取选择的审计单位及其所有子部门的ID
|
|
|
|
|
wrapper.in("p.audit_unit_id", departService.getAllNodeIds(query.getAuditUnitId())); |
|
|
|
|
} |
|
|
|
|
if (StrUtil.isNotBlank(query.getProjectUnitId())){ |
|
|
|
|
wrapper.in("p.project_unit_id", departService.getAllNodeIds(query.getProjectUnitId())); |
|
|
|
|
} |
|
|
|
|
//获取登陆人信息
|
|
|
|
|
UserAuth user = UserContextHolder.getCurrentUser(); |
|
|
|
|
log.info("user",user); |
|
|
|
|
@ -149,10 +149,42 @@ public class ReportProjectController {
|
|
|
|
|
orgIds = departService.getAllNodeIds(user.getDepartId()); |
|
|
|
|
wrapper.in("p.project_unit_id", orgIds); |
|
|
|
|
} |
|
|
|
|
wrapper.eq("p.delete_flag", DeleteStatusEnum.NO.getCode()); |
|
|
|
|
} |
|
|
|
|
wrapper.orderByDesc("p.crt_time"); |
|
|
|
|
wrapper.groupBy("p.id"); |
|
|
|
|
return Result.success(reportProjectService.getPage(new Page<>(query.getCurrent(),query.getSize()),wrapper)); |
|
|
|
|
Page<EntryWindowVo> vo = reportProjectService.getPage(new Page<>(query.getCurrent(), query.getSize()), wrapper); |
|
|
|
|
List<EntryWindowVo> entryWindowVos = vo.getRecords(); |
|
|
|
|
entryWindowVos.forEach(s->{ |
|
|
|
|
SupDepart auditById = departService.getById(s.getAuditUnitId()); |
|
|
|
|
SupDepart projectById = departService.getById(s.getProjectUnitId()); |
|
|
|
|
if (3==(auditById.getLevel())){ |
|
|
|
|
SupDepart byPId = departService.getById(auditById.getPid()); |
|
|
|
|
s.setAuditUnitStr(byPId.getShortName() +"/" + auditById.getShortName()); |
|
|
|
|
}else { |
|
|
|
|
s.setAuditUnitStr(auditById.getShortName() +"/"); |
|
|
|
|
} |
|
|
|
|
if (3==projectById.getLevel()){ |
|
|
|
|
SupDepart byPId = departService.getById(projectById.getPid()); |
|
|
|
|
s.setProjectUnitStr(byPId.getShortName() +"/" + projectById.getShortName()); |
|
|
|
|
}else { |
|
|
|
|
s.setProjectUnitStr(projectById.getShortName() +"/"); |
|
|
|
|
} |
|
|
|
|
if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType())){ |
|
|
|
|
QuerySecondDTO querySecondDTO = new QuerySecondDTO(); |
|
|
|
|
querySecondDTO.setDepartId(s.getAuditUnitId()); |
|
|
|
|
// 项目的二级机构
|
|
|
|
|
SupDepart auditUnitSecondSupDepart = departService.getSecondSupDepart(querySecondDTO); |
|
|
|
|
querySecondDTO.setDepartId(UserContextHolder.getCurrentUser().getDepartId()); |
|
|
|
|
// 账号的二级机构
|
|
|
|
|
SupDepart secondSupDepart = departService.getSecondSupDepart(querySecondDTO); |
|
|
|
|
// 是否内审
|
|
|
|
|
s.setIsSelfData(auditUnitSecondSupDepart.getId().equals(secondSupDepart.getId())? "1": "0"); |
|
|
|
|
}else { |
|
|
|
|
s.setIsSelfData("1"); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return Result.success(vo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//审计情况表报表
|
|
|
|
|
@ -163,8 +195,8 @@ public class ReportProjectController {
|
|
|
|
|
wrapper.eq(StrUtil.isNotBlank(queryParam.getNode()),"p.node",queryParam.getNode()) |
|
|
|
|
.like(StrUtil.isNotBlank(queryParam.getReportName()),"p.report_name",queryParam.getReportName()) |
|
|
|
|
.like(StrUtil.isNotBlank(queryParam.getProjectType()),"p.project_type",queryParam.getProjectType()) |
|
|
|
|
.eq(StrUtil.isNotBlank(queryParam.getAuditUnitId()),"p.audit_unit_id",queryParam.getAuditUnitId()) |
|
|
|
|
.eq(StrUtil.isNotBlank(queryParam.getProjectUnitId()),"p.project_unit_id",queryParam.getProjectUnitId()) |
|
|
|
|
// .eq(StrUtil.isNotBlank(queryParam.getAuditUnitId()),"p.audit_unit_id",queryParam.getAuditUnitId())
|
|
|
|
|
// .eq(StrUtil.isNotBlank(queryParam.getProjectUnitId()),"p.project_unit_id",queryParam.getProjectUnitId())
|
|
|
|
|
.eq(StrUtil.isNotBlank(queryParam.getPurchaseMethod()),"p.purchase_method",queryParam.getPurchaseMethod()) |
|
|
|
|
.like(StrUtil.isNotBlank(queryParam.getReferenceNumber()),"p.reference_number",queryParam.getReferenceNumber()); |
|
|
|
|
if(StrUtil.isNotBlank(queryParam.getReportType()) && !"all".equals(queryParam.getReportType())) { |
|
|
|
|
@ -186,10 +218,33 @@ public class ReportProjectController {
|
|
|
|
|
wrapper.ge("p.report_money",new BigDecimal(200000)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(queryParam.getAuditUnitId())) { |
|
|
|
|
// 获取选择的审计单位及其所有子部门的ID
|
|
|
|
|
wrapper.in("p.audit_unit_id", departService.getAllNodeIds(queryParam.getAuditUnitId())); |
|
|
|
|
} |
|
|
|
|
if (StrUtil.isNotBlank(queryParam.getProjectUnitId())){ |
|
|
|
|
wrapper.in("p.project_unit_id", departService.getAllNodeIds(queryParam.getProjectUnitId())); |
|
|
|
|
} |
|
|
|
|
wrapper.groupBy("p.id"); |
|
|
|
|
return Result.success(reportProjectService.getConditionPage(new Page<>(queryParam.getCurrent(),queryParam.getSize()),wrapper)); |
|
|
|
|
wrapper.eq("p.delete_flag", DeleteStatusEnum.NO.getCode()); |
|
|
|
|
Page<ConditionVo> conditionPage = reportProjectService.getConditionPage(new Page<>(queryParam.getCurrent(), queryParam.getSize()), wrapper); |
|
|
|
|
conditionPage.getRecords().forEach(s->{ |
|
|
|
|
SupDepart auditById = departService.getById(s.getAuditUnitId()); |
|
|
|
|
SupDepart projectById = departService.getById(s.getProjectUnitId()); |
|
|
|
|
if (3==(auditById.getLevel())){ |
|
|
|
|
SupDepart byPId = departService.getById(auditById.getPid()); |
|
|
|
|
s.setAuditUnitStr(byPId.getShortName() +"/" + auditById.getShortName()); |
|
|
|
|
}else { |
|
|
|
|
s.setAuditUnitStr(auditById.getShortName() +"/"); |
|
|
|
|
} |
|
|
|
|
if (3==projectById.getLevel()){ |
|
|
|
|
SupDepart byPId = departService.getById(projectById.getPid()); |
|
|
|
|
s.setProjectUnitStr(byPId.getShortName() +"/" + projectById.getShortName()); |
|
|
|
|
}else { |
|
|
|
|
s.setProjectUnitStr(projectById.getShortName() +"/"); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return Result.success(conditionPage); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -327,10 +382,18 @@ public class ReportProjectController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@DeleteMapping("/{id}") |
|
|
|
|
public Result delDetail(@PathVariable("id")String id){ |
|
|
|
|
reportProjectService.removeById(id); |
|
|
|
|
return Result.success(); |
|
|
|
|
// @DeleteMapping("/{id}")
|
|
|
|
|
// public Result<Void> delDetail(@PathVariable("id")String id){
|
|
|
|
|
//// ReportDeleteParam reportDeleteParam = new ReportDeleteParam();
|
|
|
|
|
//// reportDeleteParam.setId(id);
|
|
|
|
|
//// return reportProjectService.delete(reportDeleteParam);
|
|
|
|
|
// reportProjectService.removeById(id);
|
|
|
|
|
// return Result.success();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@PostMapping("/deleteReportProject") |
|
|
|
|
public Result<Void> deleteReportProject(@RequestBody ReportProjectDeleteRequest request){ |
|
|
|
|
return reportProjectService.deleteReportProject(request); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|