Commit 228f24c9 by lijingjing

修改报告发放时间为空问题;

parent 2ad7a194
...@@ -141,8 +141,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe ...@@ -141,8 +141,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
public void downloadExcel(Long id, HttpServletResponse response) { public void downloadExcel(Long id, HttpServletResponse response) {
RestAssert.fail(null == id, "报告编号为空"); RestAssert.fail(null == id, "报告编号为空");
EntrustReport report = getById(id); EntrustReport report = getById(id);
RestAssert.fail(StringUtils.isEmpty(report.getObjectKey()), "报告objectKey为空"); RestAssert.fail(StringUtils.isEmpty(report.getOtherObjectKey()), "报告objectKey为空");
ossClient.download(report.getObjectKey(), report.getSampleName() + ".xlsx", response); ossClient.download(report.getOtherObjectKey(), report.getSampleName() + ".xlsx", response);
} }
...@@ -437,23 +437,20 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe ...@@ -437,23 +437,20 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
// 若从批准往后提交,则生成报告 // 若从批准往后提交,则生成报告
// 转化PDF // 转化PDF
executor1.execute(() -> changeExcelReportToPdf(ids)); executor1.execute(() -> changeExcelReportToPdf(ids));
// 若为发放 // 若为发放 记录相关信息
if (toFlowStatus == EntrustFlowEnum.REPORT_SEND) { if (toFlowStatus == EntrustFlowEnum.REPORT_SEND) {
generateNewReportFlow(entrust.getId()); generateNewReportFlow(entrust.getId());
} }
// 记录 签发人、发放人、质检审核人
recordReportHandler(fromFlowStatus, account, entrustReport);
} else if (toFlowStatus == EntrustFlowEnum.QUALITY_JUDGE || toFlowStatus == EntrustFlowEnum.ARCHIVES) { } else if (toFlowStatus == EntrustFlowEnum.QUALITY_JUDGE || toFlowStatus == EntrustFlowEnum.ARCHIVES) {
// 归档前置条件为已判定 // 归档前置条件为已判定
entrust.setStatus(EntrustStatusEnum.QUALITY_CHECK); entrust.setStatus(EntrustStatusEnum.QUALITY_CHECK);
// 更改样品编码显示形式,由三级变为一级 // 更改样品编码显示形式,由三级变为一级
entrustSampleService.updateSampleCodeByEntrustId(entrust.getId(), 1); entrustSampleService.updateSampleCodeByEntrustId(entrust.getId(), 1);
// // 记录 签发人、发放人、质检审核人
if (fromFlowStatus == EntrustFlowEnum.REPORT_ISSUE) { recordReportHandler(fromFlowStatus, account, entrustReport);
entrustReport.setReportIssuer(account.getUserName()).setReportIssuerId(account.getUserId()).setReportIssueTime(new Date());
} else if (fromFlowStatus == EntrustFlowEnum.REPORT_SEND) {
entrustReport.setReportSender(account.getUserName()).setReportSenderId(account.getUserId()).setReportSendTime(new Date());
} else if (fromFlowStatus == EntrustFlowEnum.QUALITY_INSPECT) {
entrustReport.setQualityInspector(account.getUserName()).setQualityInspectorId(account.getUserId()).setQualityInspectTime(new Date());
}
// 若提交至 -> 质量判定,那么需要更改委托状态 // 若提交至 -> 质量判定,那么需要更改委托状态
if (toFlowStatus == EntrustFlowEnum.QUALITY_JUDGE) { if (toFlowStatus == EntrustFlowEnum.QUALITY_JUDGE) {
// 若不需要质量判定,直接进入电子档案流程 // 若不需要质量判定,直接进入电子档案流程
...@@ -495,6 +492,22 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe ...@@ -495,6 +492,22 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
return entrustSampleItemService.updateQualityJudgeFlow(sampleIds.toArray(new Long[sampleIds.size()]), account); return entrustSampleItemService.updateQualityJudgeFlow(sampleIds.toArray(new Long[sampleIds.size()]), account);
} }
/**
* 记录签发人、发放人、记录审核人
* @param fromFlowStatus
* @param account
* @param entrustReport
*/
private void recordReportHandler(EntrustFlowEnum fromFlowStatus, Account account, EntrustReport entrustReport) {
if (fromFlowStatus == EntrustFlowEnum.REPORT_ISSUE) {
entrustReport.setReportIssuer(account.getUserName()).setReportIssuerId(account.getUserId()).setReportIssueTime(new Date());
} else if (fromFlowStatus == EntrustFlowEnum.REPORT_SEND) {
entrustReport.setReportSender(account.getUserName()).setReportSenderId(account.getUserId()).setReportSendTime(new Date());
} else if (fromFlowStatus == EntrustFlowEnum.QUALITY_INSPECT) {
entrustReport.setQualityInspector(account.getUserName()).setQualityInspectorId(account.getUserId()).setQualityInspectTime(new Date());
}
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
protected void generateNewReportFlow(Long entrustId) { protected void generateNewReportFlow(Long entrustId) {
...@@ -864,7 +877,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe ...@@ -864,7 +877,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
// 若从签收或批准往前驳回,则删除的PDF文件 // 若从签收或批准往前驳回,则删除的PDF文件
if (fromFlowStatus == EntrustFlowEnum.REPORT_ISSUE || fromFlowStatus == EntrustFlowEnum.REPORT_SEND || fromFlowStatus == EntrustFlowEnum.QUALITY_INSPECT) { if (fromFlowStatus == EntrustFlowEnum.REPORT_ISSUE || fromFlowStatus == EntrustFlowEnum.REPORT_SEND || fromFlowStatus == EntrustFlowEnum.QUALITY_INSPECT) {
// 删除生成的批样记录 // 删除生成的批样记录
entrustSampleService.remove(Condition.create().eq("entrust_id",entrust.getId()).eq("type",2)); entrustSampleService.remove(Condition.create().eq("entrust_id", entrust.getId()).eq("type", 2));
// 文件删除 // 文件删除
executor1.execute(() -> deleteReportPdf(ids)); executor1.execute(() -> deleteReportPdf(ids));
} }
......
...@@ -50,7 +50,7 @@ spring: ...@@ -50,7 +50,7 @@ spring:
data: data:
mongodb: mongodb:
# uri: mongodb://hmuser:hj564Aq@meazty.fun:27017/lims # uri: mongodb://hmuser:hj564Aq@meazty.fun:27017/lims
uri: mongodb://mongo:Mong$6358#@meazty.fun:27017/lims uri: mongodb://mongo:Mong$6358#@meazty.fun:27154/lims
grid-fs-database: lims grid-fs-database: lims
# Mongodb GridFS 存储 # Mongodb GridFS 存储
......
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