Commit 05dc3146 authored by 高滢's avatar 高滢
parents 4fb3b434 c66648a2
......@@ -21,6 +21,7 @@ public interface ReviewEnterpriseArchiveMapper extends BaseMapper<ReviewEnterpri
List<ReviewEnterpriseArchive> findByTaskId(@Param("taskId") Long taskId);
// 剔除细则被删除而结果保留的数据
List<ReviewEnterpriseArchiveViewItemVO> findViewItemVOByTaskId(@Param("taskId") Long taskId);
Long findFileName(@Param("taskId") Long taskId,@Param("fileName") String fileName);
......
package com.ruoyi.service;
import javax.servlet.http.HttpServletResponse;
/**
* PDF模板管理Service接口
* @author gxk
......
......@@ -2,7 +2,9 @@ package com.ruoyi.service.impl;
import java.util.List;
import cn.hutool.core.util.ObjUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.web.request.AutomobileEnterpriseListRequest;
......@@ -59,6 +61,14 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
@Override
public int insertAutomobileEnterprise(AutomobileEnterprise automobileEnterprise)
{
// 判断企业名称是否重复
if (lambdaQuery()
.eq(AutomobileEnterprise::getEnterpriseName, automobileEnterprise.getEnterpriseName())
.ne(ObjUtil.isNotEmpty(automobileEnterprise.getId()), AutomobileEnterprise::getId, automobileEnterprise.getId())
.exists()
) {
throw new ServiceException("企业名称已存在");
}
automobileEnterprise.setCreateTime(DateUtils.getNowDate());
automobileEnterprise.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
return automobileEnterpriseMapper.insert(automobileEnterprise);
......@@ -73,6 +83,14 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
@Override
public int updateAutomobileEnterprise(AutomobileEnterprise automobileEnterprise)
{
// 判断企业名称是否重复
if (lambdaQuery()
.eq(AutomobileEnterprise::getEnterpriseName, automobileEnterprise.getEnterpriseName())
.ne(ObjUtil.isNotEmpty(automobileEnterprise.getId()), AutomobileEnterprise::getId, automobileEnterprise.getId())
.exists()
) {
throw new ServiceException("企业名称已存在");
}
automobileEnterprise.setUpdateTime(DateUtils.getNowDate());
automobileEnterprise.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
return automobileEnterpriseMapper.updateAutomobileEnterprise(automobileEnterprise);
......
......@@ -17,11 +17,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.util.*;
import java.util.List;
......@@ -62,8 +60,7 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
ByteArrayOutputStream bos = null;
try {
// 模板绝对路径--服务器
// String fileName = "/template/receipt_template_02_27.pdf";
String fileName = "E:/文件/PDF模板/receipt_template_02_27.pdf";
String fileName = "/template/receipt_template_02_27.pdf";
// 读取现有模板内容
reader = new PdfReader(fileName);
// 创建输出流
......@@ -102,40 +99,6 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
return uploadMinio(bos, "检验报告_" + taskId);
}
private InspectionReportPdfVO requireData() {
InspectionReportPdfVO inspectionReportPdfVO = InspectionReportPdfVO.builder()
.reportNumber("报告编号")
.productName("产品名称")
.productModel("产品型号")
.entrustedUnit("委托单位")
.inspectionCenterName("检验中心名称")
.inspectionCenterAddress("检验中心地址")
.inspectionCenterTelephone("检验中心电话")
.inspectionCenterPostcode("检验中心邮编")
.clientAddress("委托单位地址")
.entrustedUnitTelephone("委托单位电话")
.clientPostalCode("委托单位邮编")
.sampleName("样品名称")
.typeSpecification("型号规格")
.productionEnterprise("生产企业")
.sampleSender("送养着")
.sampleDeliveryDate("送样日期")
.sampleQuantity("样品数量")
.productionDate("生产日期")
.inspectionItem("检验项目")
.testConclusion("检验结论")
.issueDate("签发日期")
.remark("备注")
.taskNumber("任务编号")
.sampleSum("样品数量")
.vehicleType("车辆类型")
.vehicleModel("车辆型号")
.vehicleIdentificationNumber("车辆识别码")
.sampleNumberSummary("样品编号汇总")
.build();
return inspectionReportPdfVO;
}
/**
* 企业留档文件PDF下载
* @param taskId
......@@ -232,6 +195,44 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
return StringUtils.format("{}/{}.pdf", DateUtils.datePath(), name);
}
/**
* 模拟数据
* @return
*/
private InspectionReportPdfVO requireData() {
InspectionReportPdfVO inspectionReportPdfVO = InspectionReportPdfVO.builder()
.reportNumber("报告编号")
.productName("产品名称")
.productModel("产品型号")
.entrustedUnit("委托单位")
.inspectionCenterName("检验中心名称")
.inspectionCenterAddress("检验中心地址")
.inspectionCenterTelephone("检验中心电话")
.inspectionCenterPostcode("检验中心邮编")
.clientAddress("委托单位地址")
.entrustedUnitTelephone("委托单位电话")
.clientPostalCode("委托单位邮编")
.sampleName("样品名称")
.typeSpecification("型号规格")
.productionEnterprise("生产企业")
.sampleSender("送养着")
.sampleDeliveryDate("送样日期")
.sampleQuantity("样品数量")
.productionDate("生产日期")
.inspectionItem("检验项目")
.testConclusion("检验结论")
.issueDate("签发日期")
.remark("备注")
.taskNumber("任务编号")
.sampleSum("样品数量")
.vehicleType("车辆类型")
.vehicleModel("车辆型号")
.vehicleIdentificationNumber("车辆识别码")
.sampleNumberSummary("样品编号汇总")
.build();
return inspectionReportPdfVO;
}
/**
* 渲染数据
* @param fields
......
......@@ -66,7 +66,7 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang
reviewDetailsService.removeBatchByIds(reviewDetailsList);
}
// 删除细则对应的结果
// 删除细则对应的结果 (问卷是进行中的结果)
List<ReviewDetailsResult> resultList = reviewDetailsResultMapper.findByDetailsList(reviewDetailsList);
if (resultList != null && resultList.size() != 0) {
reviewDetailsResultMapper.deleteBatchIds(resultList);
......@@ -85,7 +85,7 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang
// 删除细则
reviewDetailsService.removeById(reviewSceneChangeTask.getDetailsId());
// 删除细则对应的结果
// 删除细则对应的结果 (问卷是进行中的结果)
List<ReviewDetailsResult> resultList = reviewDetailsResultMapper.findByDetailsId(reviewSceneChangeTask.getDetailsId());
if (resultList != null && resultList.size() != 0) {
reviewDetailsResultMapper.deleteBatchIds(resultList);
......
......@@ -606,7 +606,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 体系审查
setSystemDataStatistics(standardTree,results,response,systemReviewTask);
return response;
}
if (task.getCarReviewTaskId() != null) {
......@@ -624,11 +623,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 车型审查
setCarDataStatistics(carStandardTree,carResults,response,carReviewTask);
return response;
}
return null;
return response;
}
......
......@@ -39,8 +39,12 @@
WHERE passed = 0 AND task_id = #{taskId}
</select>
<select id="findByDetailsList" resultType="com.ruoyi.domain.ReviewDetailsResult">
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time, catalogue, review_enterprise_archive_id
FROM t_review_details_result WHERE review_details_id IN
SELECT tr.id, tr.passed, tr.comment, tr.images_url, tr.review_details_id, tr.task_id, tr.user_id, tr.user_name, tr.last_modify_time, tr.catalogue, tr.review_enterprise_archive_id
FROM t_review_details_result tr
LEFT JOIN t_system_review_task ts ON ts.id = tr.task_id
LEFT JOIN t_car_review_task tc ON tc.id = tr.task_id
WHERE (ts.task_status = 'PENDING' OR tc.task_status = 'PENDING')
AND tr.review_details_id IN
<foreach collection="reviewDetailsList" item="details" open="(" separator="," close=")">
#{details.id}
</foreach>
......
......@@ -34,7 +34,7 @@
LEFT JOIN t_review_keypoint keypoint ON details.review_keypoint_id = keypoint.id
LEFT JOIN t_review_standard standard ON keypoint.review_standard_id = standard.id
LEFT JOIN t_review_enterprise_archive archive ON result.review_enterprise_archive_id = archive.id
WHERE result.task_id = #{taskId};
WHERE result.task_id = #{taskId} AND details.id IS NOT NULL;
</select>
<select id="findFileName" resultType="java.lang.Long">
select COUNT(*) sum from t_review_enterprise_archive
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment