5.16
This commit is contained in:
+1164
-698
File diff suppressed because it is too large
Load Diff
@@ -118,6 +118,12 @@
|
||||
<version>1.12.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- for MockMultipartFile-->
|
||||
<dependency>
|
||||
|
||||
+88
-23
@@ -1,18 +1,27 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormDTO;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm;
|
||||
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
|
||||
import digital.laboratory.platform.reagent.service.AcceptanceRecordFormService;
|
||||
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
|
||||
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
|
||||
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
|
||||
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -24,6 +33,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.Principal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -47,6 +57,10 @@ public class AcceptanceRecordFormController {
|
||||
|
||||
private final AcceptanceRecordFormService acceptanceRecordFormService;
|
||||
|
||||
private final ReagentConsumablesService reagentConsumablesService;
|
||||
|
||||
private final OssFile ossFile;
|
||||
|
||||
/**
|
||||
* 通过id查询(验收记录表)
|
||||
*
|
||||
@@ -56,7 +70,7 @@ public class AcceptanceRecordFormController {
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping()
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_get')" )
|
||||
public R<AcceptanceRecordFormVO> getById( String acceptanceRecordFormId, HttpServletRequest theHttpServletRequest) {
|
||||
public R<AcceptanceRecordFormVO> getById(String acceptanceRecordFormId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
@@ -68,18 +82,21 @@ public class AcceptanceRecordFormController {
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param acceptanceRecordForm (验收记录表)
|
||||
* @param page 分页对象
|
||||
* @param reagentConsumableName (验收记录表)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询验收任务", notes = "分页查询验收任务")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_page')" )
|
||||
public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormPage(Page<AcceptanceRecordForm> page, AcceptanceRecordForm acceptanceRecordForm, HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormPage(Page<AcceptanceRecordForm> page, String reagentConsumableName, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = acceptanceRecordFormService.getAcceptanceRecordFormVOPage(page
|
||||
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = acceptanceRecordFormService.getAcceptanceRecordFormVOPage(page, Wrappers.<AcceptanceRecordForm>query()
|
||||
.eq(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
|
||||
.ge(startTime != null, "create_time", startTime)
|
||||
.le(endTime != null, "create_time", endTime)
|
||||
);
|
||||
return R.ok(acceptanceRecordFormVOPage);
|
||||
// return R.ok(acceptanceRecordFormService.page(page, Wrappers.query(acceptanceRecordForm)));
|
||||
@@ -88,18 +105,23 @@ public class AcceptanceRecordFormController {
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param acceptanceRecordForm (验收记录表)
|
||||
* @param page 分页对象
|
||||
* @param reagentConsumableName (验收记录表)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询验收记录", notes = "分页查询验收记录")
|
||||
@GetMapping("/recordPage")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_recordPage')" )
|
||||
public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormRecordPage(Page<AcceptanceRecordForm> page, AcceptanceRecordForm acceptanceRecordForm, HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormRecordPage(Page<AcceptanceRecordForm> page, String reagentConsumableName, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = acceptanceRecordFormService.getAcceptanceRecordFormVORecordPage(page);
|
||||
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = acceptanceRecordFormService.getAcceptanceRecordFormVOPage(page, Wrappers.<AcceptanceRecordForm>query()
|
||||
.eq(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
|
||||
.eq("status",4)
|
||||
.ge(startTime != null, "create_time", startTime)
|
||||
.le(endTime != null, "create_time", endTime)
|
||||
);
|
||||
|
||||
|
||||
return R.ok(acceptanceRecordFormVOPage);
|
||||
@@ -121,7 +143,7 @@ public class AcceptanceRecordFormController {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.commitForm(acceptanceRecordFormDTO,dlpUser);
|
||||
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.commitForm(acceptanceRecordFormDTO, dlpUser);
|
||||
|
||||
if (acceptanceRecordForm != null) {
|
||||
return R.ok(acceptanceRecordForm, "保存成功");
|
||||
@@ -174,11 +196,11 @@ public class AcceptanceRecordFormController {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.primaryAudit(auditAndApproveDTO,dlpUser);
|
||||
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.primaryAudit(auditAndApproveDTO, dlpUser);
|
||||
|
||||
if (acceptanceRecordForm!=null){
|
||||
return R.ok(acceptanceRecordForm,"审核成功");
|
||||
}else return R.failed("审核失败");
|
||||
if (acceptanceRecordForm != null) {
|
||||
return R.ok(acceptanceRecordForm, "审核成功");
|
||||
} else return R.failed("审核失败");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,11 +217,11 @@ public class AcceptanceRecordFormController {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.secondaryAudit(auditAndApproveDTO,dlpUser);
|
||||
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.secondaryAudit(auditAndApproveDTO, dlpUser);
|
||||
|
||||
if (acceptanceRecordForm!=null){
|
||||
return R.ok(acceptanceRecordForm,"审核成功");
|
||||
}else return R.failed("审核失败");
|
||||
if (acceptanceRecordForm != null) {
|
||||
return R.ok(acceptanceRecordForm, "审核成功");
|
||||
} else return R.failed("审核失败");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,17 +232,60 @@ public class AcceptanceRecordFormController {
|
||||
*/
|
||||
@ApiOperation(value = "三级审核(验收记录表)", notes = "三级审核(验收记录表)")
|
||||
@SysLog("三级审核(验收记录表)")
|
||||
@PutMapping("/threeLevel")
|
||||
@PutMapping("/three_level")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_threeLevel')")
|
||||
public R<AcceptanceRecordForm> threeLevelAudit(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.threeLevelAudit(auditAndApproveDTO,dlpUser);
|
||||
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.threeLevelAudit(auditAndApproveDTO, dlpUser);
|
||||
|
||||
if (acceptanceRecordForm!=null){
|
||||
return R.ok(acceptanceRecordForm,"审核成功");
|
||||
}else return R.failed("审核失败");
|
||||
if (acceptanceRecordForm != null) {
|
||||
return R.ok(acceptanceRecordForm, "审核成功");
|
||||
} else return R.failed("审核失败");
|
||||
}
|
||||
|
||||
/**-------验收记录打印*/
|
||||
/**
|
||||
* 验收记录打印
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "验收记录打印", notes = "验收记录打印")
|
||||
@SysLog("验收记录打印")
|
||||
@PostMapping("/print")
|
||||
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
|
||||
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
System.out.println("bizApplyWord.................");
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(id);
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(acceptanceRecordFormVO.getReagentConsumableId());
|
||||
|
||||
String applyFileName = null;
|
||||
|
||||
|
||||
if (byId.getCategory().equals("试剂") | byId.getCategory().equals("耗材")) {
|
||||
|
||||
applyFileName = "试剂耗材验收记录表" + id;
|
||||
} else {
|
||||
|
||||
applyFileName = "标准物质验收记录表" + id;
|
||||
}
|
||||
|
||||
|
||||
String pdfFilePath = "document" + "/" + "acceptanceRecordForm" + "/" + id + "/" + applyFileName + ".pdf";
|
||||
try {
|
||||
//直接调用pdf方法
|
||||
acceptanceRecordFormService.acceptanceRecordFormTablePDF(acceptanceRecordFormVO, theHttpServletRequest, httpServletResponse);
|
||||
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
|
||||
httpServletResponse.setContentType(applyFileName);
|
||||
} catch (Exception e) {
|
||||
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+7
-14
@@ -1,5 +1,7 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@@ -16,6 +18,7 @@ import digital.laboratory.platform.reagent.service.CentralizedRequestService;
|
||||
import digital.laboratory.platform.reagent.service.DetailsOfCentralizedService;
|
||||
import digital.laboratory.platform.reagent.vo.CentralizedRequestVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -80,32 +83,22 @@ public class CentralizedRequestController {
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param centralizedRequest 集中采购申请
|
||||
* @param page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('CentralizedPurchaseRequestList')")
|
||||
public R<IPage<CentralizedRequestVO>> getCentralizedRequestPage(Page<CentralizedRequest> page, String orgName, CentralizedRequest centralizedRequest, HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<CentralizedRequestVO>> getCentralizedRequestPage(Page<CentralizedRequest> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
if (orgName != null) {
|
||||
|
||||
IPage<CentralizedRequestVO> centralizedRequestVOPage = centralizedRequestService.getCentralizedRequestVOPage(page, Wrappers.<CentralizedRequest>query()
|
||||
.eq("create_by", dlpUser.getId()).orderByDesc("create_time")
|
||||
.eq("orgName", orgName));
|
||||
|
||||
return R.ok(centralizedRequestVOPage);
|
||||
}
|
||||
|
||||
IPage<CentralizedRequestVO> centralizedRequestVOPage = centralizedRequestService.getCentralizedRequestVOPage(page, Wrappers.<CentralizedRequest>query()
|
||||
.ge(startTime != null, "create_time", startTime)
|
||||
.le(endTime != null, "create_time", endTime)
|
||||
.eq("create_by", dlpUser.getId()).orderByDesc("create_time"));
|
||||
|
||||
|
||||
return R.ok(centralizedRequestVOPage);
|
||||
|
||||
}
|
||||
|
||||
+50
-11
@@ -1,20 +1,27 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.dto.PeriodVerificationPlanDTO;
|
||||
import digital.laboratory.platform.reagent.entity.CheckSchedule;
|
||||
import digital.laboratory.platform.reagent.entity.PeriodVerificationPlan;
|
||||
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
|
||||
import digital.laboratory.platform.reagent.service.CheckScheduleService;
|
||||
import digital.laboratory.platform.reagent.service.InstructionBookService;
|
||||
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
|
||||
import digital.laboratory.platform.reagent.vo.CheckScheduleVO;
|
||||
import org.joda.time.DateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -26,6 +33,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.Principal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -47,6 +55,7 @@ public class CheckScheduleController {
|
||||
|
||||
private final CheckScheduleService checkScheduleService;
|
||||
|
||||
private final OssFile ossFile;
|
||||
|
||||
|
||||
/**
|
||||
@@ -71,29 +80,26 @@ public class CheckScheduleController {
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param checkSchedule
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询新增标准物质期间核查计划和确认表", notes = "分页查询新增标准物质期间核查计划和确认表")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_page)" )
|
||||
public R<IPage<CheckScheduleVO>> getCheckSchedulePage(Page<CheckSchedule> page, CheckSchedule checkSchedule,String status, String number,HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<CheckScheduleVO>> getCheckSchedulePage(Page<CheckSchedule> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") Date startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") Date endTime, String status, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
QueryWrapper<CheckSchedule> checkScheduleQueryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (!status.equals("")){
|
||||
checkScheduleQueryWrapper.eq("status",status);
|
||||
}
|
||||
if (!number.equals("")){
|
||||
checkScheduleQueryWrapper.eq("number",number);
|
||||
}
|
||||
IPage<CheckScheduleVO> checkScheduleVOPage = checkScheduleService.getCheckScheduleVOPage(page, checkScheduleQueryWrapper
|
||||
IPage<CheckScheduleVO> checkScheduleVOPage = checkScheduleService.getCheckScheduleVOPage(page, Wrappers.<CheckSchedule>query()
|
||||
.ge(startTime!=null,"create_time", startTime)
|
||||
.le(endTime!=null,"create_time", endTime)
|
||||
.eq(StrUtil.isNotBlank(status), "status", status)
|
||||
.orderByDesc("create_time"));
|
||||
|
||||
return R.ok(checkScheduleVOPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
@@ -169,7 +175,7 @@ public class CheckScheduleController {
|
||||
@ApiOperation(value = "审核标准物质期间核查计划和确认表", notes = "审核标准物质期间核查计划和确认表")
|
||||
@SysLog("修改")
|
||||
@PutMapping("/audit")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_check_schedule_audit')" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_check_schedule_audit')")
|
||||
public R<CheckSchedule> auditPlan(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
@@ -181,6 +187,39 @@ public class CheckScheduleController {
|
||||
} else return R.failed("审核失败");
|
||||
}
|
||||
|
||||
/**-------验收记录打印*/
|
||||
/**
|
||||
* 验收记录打印
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "期间核查计划打印", notes = "期间核查计划打印")
|
||||
@SysLog("期间核查计划打印")
|
||||
@PostMapping("/print")
|
||||
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
|
||||
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
System.out.println("bizApplyWord.................");
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
CheckScheduleVO checkScheduleVO = checkScheduleService.getCheckScheduleVO(id);
|
||||
|
||||
String applyFileName = "标准物质期间核查计划和确认表" + id;
|
||||
;
|
||||
|
||||
|
||||
String pdfFilePath = "document" + "/" + "checkSchedule" + "/" + id + "/" + applyFileName + ".pdf";
|
||||
try {
|
||||
//直接调用pdf方法
|
||||
checkScheduleService.checkScheduleTablePDF(checkScheduleVO, theHttpServletRequest, httpServletResponse);
|
||||
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
|
||||
httpServletResponse.setContentType(applyFileName);
|
||||
} catch (Exception e) {
|
||||
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+169
-7
@@ -1,17 +1,36 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.dto.ComplianceCheckDTO;
|
||||
import digital.laboratory.platform.reagent.entity.ComplianceCheck;
|
||||
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
|
||||
import digital.laboratory.platform.reagent.service.ComplianceCheckService;
|
||||
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
|
||||
import digital.laboratory.platform.reagent.vo.ComplianceCheckVO;
|
||||
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
|
||||
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.joda.time.DateTime;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -21,8 +40,12 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.security.Principal;
|
||||
import java.sql.Date;
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -47,6 +70,13 @@ public class ComplianceCheckController {
|
||||
|
||||
private final ComplianceCheckService complianceCheckService;
|
||||
|
||||
private final OssFile ossFile;
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
@Autowired
|
||||
private ReagentConsumablesService reagentConsumablesService;
|
||||
|
||||
/**
|
||||
* 通过id查询(符合性检查记录表)
|
||||
*
|
||||
@@ -56,7 +86,7 @@ public class ComplianceCheckController {
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping()
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_get')" )
|
||||
public R<ComplianceCheckVO> getById( String complianceCheckId, HttpServletRequest theHttpServletRequest) {
|
||||
public R<ComplianceCheckVO> getById(String complianceCheckId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
@@ -75,11 +105,14 @@ public class ComplianceCheckController {
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_page)")
|
||||
public R<IPage<ComplianceCheckVO>> getComplianceCheckPage(Page<ComplianceCheck> page, ComplianceCheck complianceCheck, HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<ComplianceCheckVO>> getComplianceCheckPage(Page<ComplianceCheck> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<ComplianceCheckVO> complianceCheckSList = complianceCheckService.getComplianceCheckVOPage(page, Wrappers.<ComplianceCheck>query()
|
||||
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
|
||||
.ge(startTime != null, "create_time", startTime)
|
||||
.le(endTime != null, "create_time", endTime)
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(complianceCheckSList);
|
||||
@@ -109,6 +142,7 @@ public class ComplianceCheckController {
|
||||
// return R.failed(complianceCheck, "保存失败");
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 手动新增符合性检查记录表(试剂耗材)
|
||||
*
|
||||
@@ -143,7 +177,7 @@ public class ComplianceCheckController {
|
||||
@SysLog("通过id删除(符合性检查记录表)")
|
||||
@DeleteMapping()
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_del')" )
|
||||
public R<String> deleteById( String complianceCheckId, HttpServletRequest theHttpServletRequest) {
|
||||
public R<String> deleteById(String complianceCheckId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
@@ -195,7 +229,7 @@ public class ComplianceCheckController {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
ComplianceCheck complianceCheck = complianceCheckService.addScheme(complianceCheckDTO,dlpUser);
|
||||
ComplianceCheck complianceCheck = complianceCheckService.addScheme(complianceCheckDTO, dlpUser);
|
||||
|
||||
if (complianceCheck != null) {
|
||||
return R.ok("保存成功");
|
||||
@@ -219,7 +253,7 @@ public class ComplianceCheckController {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
ComplianceCheck complianceCheck = complianceCheckService.commitCheck(complianceCheckDTO,dlpUser);
|
||||
ComplianceCheck complianceCheck = complianceCheckService.commitCheck(complianceCheckDTO, dlpUser);
|
||||
|
||||
if (complianceCheck != null) {
|
||||
return R.ok("提交成功");
|
||||
@@ -238,7 +272,7 @@ public class ComplianceCheckController {
|
||||
@ApiOperation(value = "一级审核符合性检查记录表", notes = "一级审核符合性检查记录表")
|
||||
@SysLog("一级审核符合性检查记录表")
|
||||
@PutMapping("/primaryAudit")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_compliance_check_primaryAudit')" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_compliance_check_primaryAudit')")
|
||||
public R<String> primaryAuditCheck(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
@@ -261,7 +295,7 @@ public class ComplianceCheckController {
|
||||
@ApiOperation(value = "二级审核符合性检查记录表", notes = "二级审核符合性检查记录表")
|
||||
@SysLog("二级审核符合性检查记录表")
|
||||
@PutMapping("/secondaryAudit")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_compliance_check_secondaryAudit')" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_compliance_check_secondaryAudit')")
|
||||
public R<String> secondaryAuditCheck(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
@@ -274,4 +308,132 @@ public class ComplianceCheckController {
|
||||
|
||||
}
|
||||
|
||||
/**-------采购计划打印*/
|
||||
/**
|
||||
* 采购计划打印
|
||||
*
|
||||
* @param purchasingPlanId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "试剂耗材符合性检查打印", notes = "试剂耗材符合性检查打印")
|
||||
@SysLog("试剂耗材符合性检查打印")
|
||||
@PostMapping("/print")
|
||||
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
|
||||
public void bizGetPDFInventory(String complianceCheckId, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
System.out.println("bizApplyWord.................");
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
ComplianceCheckVO complianceCheckVO = complianceCheckService.getComplianceCheckVO(complianceCheckId);
|
||||
|
||||
String id = complianceCheckVO.getId();
|
||||
|
||||
String applyFileName = null;
|
||||
|
||||
if (reagentConsumablesService.getById(complianceCheckVO.getReagentConsumableId()).getCategory().equals("标准物质") |
|
||||
reagentConsumablesService.getById(complianceCheckVO.getReagentConsumableId()).getCategory().equals("标准储备溶液")) {
|
||||
applyFileName = "标准物质符合性检查" + id;
|
||||
} else {
|
||||
applyFileName = "试剂耗材符合性检查-" + id;
|
||||
}
|
||||
|
||||
String pdfFilePath = "document" + "/" + "complianceCheck" + "/" + id + "/" + applyFileName + ".pdf";
|
||||
try {
|
||||
//直接调用pdf方法
|
||||
complianceCheckTablePDF(complianceCheckVO, id, theHttpServletRequest, httpServletResponse);
|
||||
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
|
||||
httpServletResponse.setContentType(applyFileName);
|
||||
} catch (Exception e) {
|
||||
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void complianceCheckTablePDF(ComplianceCheckVO complianceCheckVO, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
|
||||
System.out.println("ComplianceCheckTablePDF.................");
|
||||
|
||||
String applyFileName = null;
|
||||
//-----------------------------
|
||||
// 生成 word 版本的 采购目录
|
||||
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(complianceCheckVO.getReagentConsumableId());
|
||||
|
||||
if (byId.getCategory().equals("标准物质") |
|
||||
byId.getCategory().equals("标准储备溶液")) {
|
||||
ossFile.fileGet("template" + "/" + "标准物质符合性检查记录表模板.docx", bos);
|
||||
applyFileName = "标准物质符合性检查" + id;
|
||||
} else {
|
||||
ossFile.fileGet("template" + "/" + "试剂耗材符合性检查记录表模板.docx", bos);
|
||||
applyFileName = "试剂耗材符合性检查-" + id;
|
||||
}
|
||||
|
||||
|
||||
byte[] templateArray = bos.toByteArray();
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
bos.close();
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
Configure config = Configure.builder().
|
||||
bind("voList", policy).build();
|
||||
/**
|
||||
* 循环表格
|
||||
*/
|
||||
XWPFTemplate template = XWPFTemplate.compile(bis, config).render(
|
||||
new HashMap<String, Object>() {{
|
||||
put("dateOfInspection", LocalDateTimeUtil.format(complianceCheckVO.getDateOfInspection(), "yyyy年MM月dd日"));
|
||||
put("id", id);
|
||||
put("size", 1);
|
||||
put("reagentConsumableName", complianceCheckVO.getReagentConsumableName());
|
||||
put("brand", complianceCheckVO.getBrand());
|
||||
put("specificationAndModel", complianceCheckVO.getSpecificationAndModel());
|
||||
put("inspectionScheme", complianceCheckVO.getInspectionScheme());
|
||||
put("examinationConclusion", complianceCheckVO.getExaminationConclusion());
|
||||
put("nonconformingItem", complianceCheckVO.getNonconformingItem());
|
||||
put("primaryAuditorName", complianceCheckVO.getPrimaryAuditorName());
|
||||
put("secondaryAuditorName", complianceCheckVO.getSecondaryAuditorName());
|
||||
put("auditTimeOfPrimary", LocalDateTimeUtil.format(complianceCheckVO.getAuditTimeOfPrimary(), "yyyy年MM月dd日"));
|
||||
put("auditTimeOfSecondary", LocalDateTimeUtil.format(complianceCheckVO.getAuditTimeOfSecondary(), "yyyy年MM月dd日"));
|
||||
|
||||
if (byId.getCategory().equals("标准物质") |
|
||||
byId.getCategory().equals("标准储备溶液")) {
|
||||
put("executorName", complianceCheckVO.getExecutorName());
|
||||
put("reagentConsumableNumber", complianceCheckVO.getReagentConsumableNumber());
|
||||
put("commitTime", LocalDateTimeUtil.format(complianceCheckVO.getCommitTime(), "yyyy年MM月dd日"));
|
||||
}
|
||||
}}
|
||||
);
|
||||
bis.close();
|
||||
|
||||
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
template.write(fosWord);
|
||||
template.close();
|
||||
|
||||
//------------
|
||||
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
fosWord.close();
|
||||
|
||||
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
fisWord.close();
|
||||
|
||||
|
||||
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave("document" + "/" + "complianceCheck" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println(String.format("转换为 PDF 结束"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+7
-2
@@ -1,11 +1,13 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
@@ -23,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -80,18 +83,20 @@ public class DecentralizedRequestController {
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param decentralizedRequest (分散采购申请)
|
||||
* @param page (分散采购申请)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')")
|
||||
public R<IPage<DecentralizedRequestVO>> getDecentralizedRequestPage(Page<DecentralizedRequest> page, DecentralizedRequest decentralizedRequest, HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<DecentralizedRequestVO>> getDecentralizedRequestPage(Page<DecentralizedRequest> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime , @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<DecentralizedRequestVO> decentralizedRequestSList = decentralizedRequestService.getDecentralizedRequestVOPage(page, Wrappers.<DecentralizedRequest>query()
|
||||
.eq("create_by", dlpUser.getId())
|
||||
.ge(startTime!=null,"create_time",startTime)
|
||||
.le(endTime!=null,"create_time",endTime)
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(decentralizedRequestSList);
|
||||
|
||||
+29
-11
@@ -81,22 +81,40 @@ public class FixedValueReportController {
|
||||
Map<String, String> ResultData = new HashMap<>();
|
||||
ResultData.put("fileName", fileName);
|
||||
ResultData.put("path", path);
|
||||
FixedValueReport fixedValueReport = new FixedValueReport();
|
||||
|
||||
if (b) {
|
||||
fixedValueReport.setFixedValueReportId(IdWorker.get32UUID().toUpperCase());
|
||||
fixedValueReport.setFixedValueReport(fileName);
|
||||
fixedValueReport.setFixedResult(fixedResult);
|
||||
fixedValueReport.setReferenceSubstanceId(byId.getId());
|
||||
|
||||
String fileNames = path + "/" + fileName;
|
||||
FixedValueReport fixedValueReport1 = fixedValueReportService.getOne(Wrappers.<FixedValueReport>query().eq("reference_substance_id", id));
|
||||
|
||||
ossFile.fileGet(fileNames, httpServletResponse.getOutputStream());
|
||||
if (fixedValueReport1 == null) {
|
||||
|
||||
fixedValueReportService.save(fixedValueReport);
|
||||
FixedValueReport fixedValueReport = new FixedValueReport();
|
||||
if (b) {
|
||||
fixedValueReport.setFixedValueReport(fileName);
|
||||
fixedValueReport.setFixedValueReportId(IdWorker.get32UUID().toUpperCase());
|
||||
fixedValueReport.setFixedResult(fixedResult);
|
||||
fixedValueReport.setReferenceSubstanceId(id);
|
||||
String fileNames = path + "/" + fileName;
|
||||
|
||||
return R.ok(fixedValueReport, "上传成功");
|
||||
} else return R.failed("上传失败");
|
||||
ossFile.fileGet(fileNames, httpServletResponse.getOutputStream());
|
||||
|
||||
fixedValueReportService.save(fixedValueReport);
|
||||
|
||||
return R.ok(fixedValueReport, "上传成功");
|
||||
} else return R.failed("上传失败");
|
||||
} else {
|
||||
if (b) {
|
||||
fixedValueReport1.setFixedValueReport(fileName);
|
||||
fixedValueReport1.setFixedResult(fixedResult);
|
||||
String fileNames = path + "/" + fileName;
|
||||
|
||||
ossFile.fileGet(fileNames, httpServletResponse.getOutputStream());
|
||||
|
||||
fixedValueReportService.updateById(fixedValueReport1);
|
||||
|
||||
return R.ok(fixedValueReport1, "上传成功");
|
||||
} else return R.failed("上传失败");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+35
-15
@@ -79,25 +79,45 @@ public class InstructionBookController {
|
||||
Map<String, String> ResultData = new HashMap<>();
|
||||
ResultData.put("fileName", fileName);
|
||||
ResultData.put("path", path);
|
||||
InstructionBook instructionBook = new InstructionBook();
|
||||
|
||||
if (b) {
|
||||
instructionBook.setId(IdWorker.get32UUID().toUpperCase());
|
||||
instructionBook.setCommitTime(LocalDateTime.now());
|
||||
instructionBook.setMakerId(dlpUser.getId());
|
||||
instructionBook.setReferenceMaterialTypeId(byId.getReagentConsumableId());
|
||||
instructionBook.setInstructionBook(fileName);
|
||||
instructionBook.setCommitStatus(1);
|
||||
InstructionBook instructionBook1 = instructionBookService.getOne(Wrappers.<InstructionBook>query().eq("reference_material_type_id", id));
|
||||
|
||||
String fileNames = path + "/" + fileName;
|
||||
if (instructionBook1 == null) {
|
||||
|
||||
ossFile.fileGet(fileNames, httpServletResponse.getOutputStream());
|
||||
InstructionBook instructionBook = new InstructionBook();
|
||||
if (b) {
|
||||
instructionBook.setId(IdWorker.get32UUID().toUpperCase());
|
||||
instructionBook.setCommitTime(LocalDateTime.now());
|
||||
instructionBook.setMakerId(dlpUser.getId());
|
||||
instructionBook.setReferenceMaterialTypeId(byId.getReagentConsumableId());
|
||||
instructionBook.setInstructionBook(fileName);
|
||||
instructionBook.setCommitStatus(1);
|
||||
|
||||
instructionBookService.save(instructionBook);
|
||||
String fileNames = path + "/" + fileName;
|
||||
|
||||
return R.ok(instructionBook, "上传成功");
|
||||
} else return R.failed("上传失败");
|
||||
ossFile.fileGet(fileNames, httpServletResponse.getOutputStream());
|
||||
|
||||
instructionBookService.save(instructionBook);
|
||||
|
||||
return R.ok(instructionBook, "上传成功");
|
||||
} else return R.failed("上传失败");
|
||||
} else {
|
||||
if (b) {
|
||||
instructionBook1.setCommitTime(LocalDateTime.now());
|
||||
instructionBook1.setMakerId(dlpUser.getId());
|
||||
instructionBook1.setInstructionBook(fileName);
|
||||
instructionBook1.setCommitStatus(1);
|
||||
|
||||
String fileNames = path + "/" + fileName;
|
||||
|
||||
ossFile.fileGet(fileNames, httpServletResponse.getOutputStream());
|
||||
|
||||
instructionBookService.save(instructionBook1);
|
||||
|
||||
return R.ok(instructionBook1, "上传成功");
|
||||
} else return R.failed("上传失败");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -167,8 +187,8 @@ public class InstructionBookController {
|
||||
@ApiOperation(value = "审核(标准物质期间核查指导书)", notes = "审核(标准物质期间核查指导书)(标准物质期间核查指导书)")
|
||||
@SysLog("审核(标准物质期间核查指导书)(标准物质期间核查指导书)")
|
||||
@PostMapping("/audit")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_instruction_book_audit')" )
|
||||
public R<InstructionBookVO> auditById(AuditAndApproveDTO auditAndApproveDTO , HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
@PreAuthorize("@pms.hasPermission('reagent_instruction_book_audit')")
|
||||
public R<InstructionBookVO> auditById(AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
|
||||
+125
-86
@@ -1,17 +1,23 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.dto.PeriodVerificationImplementationDTO;
|
||||
import digital.laboratory.platform.reagent.entity.PeriodVerificationImplementation;
|
||||
import digital.laboratory.platform.reagent.service.PeriodVerificationImplementationService;
|
||||
import digital.laboratory.platform.reagent.vo.CheckScheduleVO;
|
||||
import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO;
|
||||
import org.joda.time.DateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -30,89 +36,88 @@ import java.util.List;
|
||||
*
|
||||
* @author Zhang Xiaolong created at 2023-03-10
|
||||
* @describe (标准物质期间核查实施情况及结果记录表) 前端控制器
|
||||
*
|
||||
* <p>
|
||||
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
|
||||
* 这里写什么:
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/period_verification_implementation" )
|
||||
@RequestMapping("/period_verification_implementation")
|
||||
@Api(value = "period_verification_implementation", tags = "(标准物质期间核查实施情况及结果记录表)管理")
|
||||
public class PeriodVerificationImplementationController {
|
||||
|
||||
private final PeriodVerificationImplementationService periodVerificationImplementationService;
|
||||
private final PeriodVerificationImplementationService periodVerificationImplementationService;
|
||||
|
||||
/**
|
||||
* 通过id查询(标准物质期间核查实施情况及结果记录表)
|
||||
* @param periodVerificationImplementationId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping( )
|
||||
private final OssFile ossFile;
|
||||
|
||||
/**
|
||||
* 通过id查询(标准物质期间核查实施情况及结果记录表)
|
||||
*
|
||||
* @param periodVerificationImplementationId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping()
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_get')" )
|
||||
public R<PeriodVerificationImplementation> getById( String periodVerificationImplementationId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
public R<PeriodVerificationImplementation> getById(String periodVerificationImplementationId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PeriodVerificationImplementation periodVerificationImplementation = periodVerificationImplementationService.getPeriodVerificationImplementationVO(periodVerificationImplementationId);
|
||||
return R.ok(periodVerificationImplementation);
|
||||
//return R.ok(periodVerificationImplementationService.getById(periodVerificationImplementationId));
|
||||
}
|
||||
return R.ok(periodVerificationImplementation);
|
||||
//return R.ok(periodVerificationImplementationService.getById(periodVerificationImplementationId));
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param periodVerificationImplementation (标准物质期间核查实施情况及结果记录表)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_page')" )
|
||||
public R<IPage<PeriodVerificationImplementationVO>> getPeriodVerificationImplementationPage(Page<PeriodVerificationImplementation> page, String name,PeriodVerificationImplementation periodVerificationImplementation, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
public R<IPage<PeriodVerificationImplementationVO>> getPeriodVerificationImplementationPage(Page<PeriodVerificationImplementation> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, String referenceMaterialName, PeriodVerificationImplementation periodVerificationImplementation, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
if (name!=null){
|
||||
|
||||
IPage<PeriodVerificationImplementationVO> periodVerificationImplementationSList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.<PeriodVerificationImplementation>query()
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(periodVerificationImplementationSList);
|
||||
}
|
||||
|
||||
IPage<PeriodVerificationImplementationVO> periodVerificationImplementationSList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.<PeriodVerificationImplementation>query()
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(periodVerificationImplementationSList);
|
||||
IPage<PeriodVerificationImplementationVO> periodVerificationImplementationSList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.<PeriodVerificationImplementation>query()
|
||||
.like(StrUtil.isNotBlank(referenceMaterialName), "reference_material_name", referenceMaterialName)
|
||||
.ge("create_time", startTime)
|
||||
.le("create_time", endTime)
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(periodVerificationImplementationSList);
|
||||
// return R.ok(periodVerificationImplementationService.page(page, Wrappers.query(periodVerificationImplementation)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改(标准物质期间核查实施情况及结果记录表)
|
||||
*
|
||||
* @param periodVerificationImplementationDTO (标准物质期间核查实施情况及结果记录表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "录入(标准物质期间核查实施情况及结果记录表)", notes = "录入((标准物质期间核查实施情况及结果记录表)")
|
||||
@SysLog("录入((标准物质期间核查实施情况及结果记录表)" )
|
||||
@SysLog("录入((标准物质期间核查实施情况及结果记录表)")
|
||||
@PostMapping
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_edit')" )
|
||||
public R<PeriodVerificationImplementation> putUpdateById(@RequestBody PeriodVerificationImplementationDTO periodVerificationImplementationDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PeriodVerificationImplementation periodVerificationImplementation = periodVerificationImplementationService.editById(periodVerificationImplementationDTO,dlpUser);
|
||||
PeriodVerificationImplementation periodVerificationImplementation = periodVerificationImplementationService.editById(periodVerificationImplementationDTO, dlpUser);
|
||||
|
||||
if (periodVerificationImplementation!=null) {
|
||||
return R.ok(periodVerificationImplementation, "保存成功");
|
||||
}
|
||||
else {
|
||||
return R.failed("保存对象失败");
|
||||
}
|
||||
if (periodVerificationImplementation != null) {
|
||||
return R.ok(periodVerificationImplementation, "保存成功");
|
||||
} else {
|
||||
return R.failed("保存对象失败");
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
@@ -139,53 +144,87 @@ public class PeriodVerificationImplementationController {
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* 提交(标准物质期间核查实施情况及结果记录表)
|
||||
* @param periodVerificationImplementationDTO (标准物质期间核查实施情况及结果记录表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "提交(标准物质期间核查实施情况及结果记录表)", notes = "提交(标准物质期间核查实施情况及结果记录表)")
|
||||
@SysLog("提交(标准物质期间核查实施情况及结果记录表)" )
|
||||
@PostMapping("/commit")
|
||||
/**
|
||||
* 提交(标准物质期间核查实施情况及结果记录表)
|
||||
*
|
||||
* @param periodVerificationImplementationDTO (标准物质期间核查实施情况及结果记录表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "提交(标准物质期间核查实施情况及结果记录表)", notes = "提交(标准物质期间核查实施情况及结果记录表)")
|
||||
@SysLog("提交(标准物质期间核查实施情况及结果记录表)")
|
||||
@PostMapping("/commit")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_commit')" )
|
||||
public R<PeriodVerificationImplementation> commitById(@RequestBody PeriodVerificationImplementationDTO periodVerificationImplementationDTO, HttpServletRequest theHttpServletRequest) {
|
||||
public R<PeriodVerificationImplementation> commitById(@RequestBody PeriodVerificationImplementationDTO periodVerificationImplementationDTO, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PeriodVerificationImplementation periodVerificationImplementation = periodVerificationImplementationService.commitById(periodVerificationImplementationDTO,dlpUser);
|
||||
PeriodVerificationImplementation periodVerificationImplementation = periodVerificationImplementationService.commitById(periodVerificationImplementationDTO, dlpUser);
|
||||
|
||||
if (periodVerificationImplementation!=null) {
|
||||
return R.ok(periodVerificationImplementation, "提交成功");
|
||||
}
|
||||
else {
|
||||
return R.failed("提交失败");
|
||||
}
|
||||
}
|
||||
if (periodVerificationImplementation != null) {
|
||||
return R.ok(periodVerificationImplementation, "提交成功");
|
||||
} else {
|
||||
return R.failed("提交失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核(标准物质期间核查实施情况及结果记录表)
|
||||
* @param auditAndApproveDTO (标准物质期间核查实施情况及结果记录表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审核(标准物质期间核查实施情况及结果记录表)", notes = "审核(标准物质期间核查实施情况及结果记录表)")
|
||||
@SysLog("审核(标准物质期间核查实施情况及结果记录表)" )
|
||||
@PutMapping("/audit")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_audit')" )
|
||||
public R<PeriodVerificationImplementation> auditById(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
/**
|
||||
* 审核(标准物质期间核查实施情况及结果记录表)
|
||||
*
|
||||
* @param auditAndApproveDTO (标准物质期间核查实施情况及结果记录表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审核(标准物质期间核查实施情况及结果记录表)", notes = "审核(标准物质期间核查实施情况及结果记录表)")
|
||||
@SysLog("审核(标准物质期间核查实施情况及结果记录表)")
|
||||
@PutMapping("/audit")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_audit')")
|
||||
public R<PeriodVerificationImplementation> auditById(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PeriodVerificationImplementation periodVerificationImplementation = periodVerificationImplementationService.auditById(auditAndApproveDTO,dlpUser);
|
||||
PeriodVerificationImplementation periodVerificationImplementation = periodVerificationImplementationService.auditById(auditAndApproveDTO, dlpUser);
|
||||
|
||||
if (periodVerificationImplementation!=null) {
|
||||
return R.ok(periodVerificationImplementation, "审核成功");
|
||||
}
|
||||
else {
|
||||
return R.failed("审核失败");
|
||||
}
|
||||
}
|
||||
if (periodVerificationImplementation != null) {
|
||||
return R.ok(periodVerificationImplementation, "审核成功");
|
||||
} else {
|
||||
return R.failed("审核失败");
|
||||
}
|
||||
}
|
||||
/**-------标准物质期间核查计划和确认表打印*/
|
||||
/**
|
||||
* 标准物质期间核查计划和确认表打印
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "标准物质期间核查计划和确认表打印", notes = "标准物质期间核查计划和确认表打印")
|
||||
@SysLog("期间核查计划打印")
|
||||
@PostMapping("/print")
|
||||
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
|
||||
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
System.out.println("bizApplyWord.................");
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PeriodVerificationImplementationVO periodVerificationImplementationVO = periodVerificationImplementationService.getPeriodVerificationImplementationVO(id);
|
||||
if (periodVerificationImplementationVO == null) {
|
||||
throw new RuntimeException("未查询到相关信息");
|
||||
}
|
||||
String applyFileName = "标准物质期间核查实施情况及结果记录表" + id;
|
||||
;
|
||||
|
||||
|
||||
String pdfFilePath = "document" + "/" + "periodVerificationImplementation" + "/" + id + "/" + applyFileName + ".pdf";
|
||||
try {
|
||||
//直接调用pdf方法
|
||||
periodVerificationImplementationService.periodVerificationImplementationTablePDF(periodVerificationImplementationVO, theHttpServletRequest, httpServletResponse);
|
||||
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
|
||||
httpServletResponse.setContentType(applyFileName);
|
||||
} catch (Exception e) {
|
||||
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+6
-6
@@ -92,15 +92,15 @@ public class PurchaseCatalogueController {
|
||||
@ApiOperation(value = "分页查询已发布的采购目录明细", notes = "分页查询已发布的采购目录明细")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_getPage')")
|
||||
public R<Page<CatalogueDetailsVO>> getPurchaseCataloguePage(String name,HttpServletRequest theHttpServletRequest) {
|
||||
public R<List<CatalogueDetails>> getPurchaseCataloguePage(String name,HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
Page vOpage = purchaseCatalogueService.getVOpage(name);
|
||||
List<CatalogueDetails> list = purchaseCatalogueService.getList(name);
|
||||
|
||||
return R.ok(vOpage);
|
||||
return R.ok(list);
|
||||
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ public class PurchaseCatalogueController {
|
||||
Boolean aBoolean = purchaseCatalogueService.delCatalogue(purchaseCatalogueId);
|
||||
|
||||
if (aBoolean) {
|
||||
return R.ok("删除采购");
|
||||
return R.ok("删除成功");
|
||||
} else return R.failed("删除失败");
|
||||
}
|
||||
|
||||
@@ -397,9 +397,9 @@ public class PurchaseCatalogueController {
|
||||
return R.ok(anImport);
|
||||
}
|
||||
|
||||
/**-------出库清单*/
|
||||
/**-------采购目录打印*/
|
||||
/**
|
||||
* 出库清单
|
||||
* 采购目录打印
|
||||
*
|
||||
* @param purchaseCatalogueId
|
||||
*
|
||||
|
||||
+12
-6
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
@@ -14,6 +15,8 @@ import digital.laboratory.platform.reagent.service.PurchaseListService;
|
||||
import digital.laboratory.platform.reagent.vo.PurchaseListDetailsVO;
|
||||
import digital.laboratory.platform.reagent.vo.PurchaseListPageVO;
|
||||
import digital.laboratory.platform.reagent.vo.PurchaseListVO;
|
||||
import org.joda.time.DateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -25,6 +28,9 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.Principal;
|
||||
import java.sql.Date;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -70,17 +76,18 @@ public class PurchaseListController {
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param purchaseList (采购清单)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_page')" )
|
||||
public R<IPage<PurchaseListPageVO>> getPurchaseListPage(Page<PurchaseList> page, PurchaseList purchaseList, HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<PurchaseListPageVO>> getPurchaseListPage(Page<PurchaseList> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime , @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<PurchaseListPageVO> purchaseListSList = purchaseListService.getPurchaseListVOPage(page, Wrappers.<PurchaseList>query()
|
||||
.ge(startTime!=null,"create_time",startTime)
|
||||
.le(endTime!=null,"create_time",endTime)
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(purchaseListSList);
|
||||
@@ -105,24 +112,23 @@ public class PurchaseListController {
|
||||
purchaseListService.editById(purchaseListDTO);
|
||||
|
||||
return R.ok("添加成功");
|
||||
|
||||
}
|
||||
/**
|
||||
* 新增(采购清单)
|
||||
* @param purchaseListDTOList (采购清单)
|
||||
* @param id (采购清单)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "提交采购清单明细", notes = "提交采购清单明细")
|
||||
@SysLog("提交采购清单明细" )
|
||||
@PutMapping("/commit")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_commit)" )
|
||||
public R<PurchaseList> commitById(List<PurchaseListDTO> purchaseListDTOList, HttpServletRequest theHttpServletRequest) {
|
||||
public R<PurchaseList> commitById(String id, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchaseList purchaseList = purchaseListService.commitById(purchaseListDTOList);
|
||||
PurchaseList purchaseList = purchaseListService.commitById(id);
|
||||
|
||||
if (purchaseList!=null) {
|
||||
return R.ok(purchaseList, "提交成功");
|
||||
|
||||
+147
-3
@@ -1,35 +1,51 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.dto.PurchasingPlanDTO;
|
||||
import digital.laboratory.platform.reagent.entity.ProcurementContent;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaseCatalogue;
|
||||
import digital.laboratory.platform.reagent.entity.PurchasingPlan;
|
||||
import digital.laboratory.platform.reagent.entity.*;
|
||||
import digital.laboratory.platform.reagent.service.PurchasingPlanService;
|
||||
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
|
||||
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
|
||||
import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO;
|
||||
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
|
||||
import digital.laboratory.platform.reagent.vo.ReplacementVO;
|
||||
import feign.Response;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.security.Principal;
|
||||
import java.sql.Date;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -54,6 +70,12 @@ public class PurchasingPlanController {
|
||||
@Autowired
|
||||
private final PurchasingPlanService purchasingPlanService;
|
||||
|
||||
private final OssFile ossFile;
|
||||
|
||||
private final RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
private final ReagentConsumablesService reagentConsumablesService;
|
||||
|
||||
/**
|
||||
* 通过id查询(采购计划)
|
||||
*
|
||||
@@ -321,7 +343,129 @@ public class PurchasingPlanController {
|
||||
return R.failed("审批失败");
|
||||
}
|
||||
}
|
||||
/**-------采购计划打印*/
|
||||
/**
|
||||
* 采购计划打印
|
||||
*
|
||||
* @param purchasingPlanId
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "采购计划打印", notes = "采购计划打印")
|
||||
@SysLog("采购计划打印")
|
||||
@PostMapping("/print")
|
||||
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
|
||||
public void bizGetPDFInventory(String purchasingPlanId, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
System.out.println("bizApplyWord.................");
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchasingPlanVO purchasingPlanVO = purchasingPlanService.getPurchasingPlanVO(purchasingPlanId);
|
||||
|
||||
List<ProcurementContentVO> voList = purchasingPlanVO.getProcurementContentVOList();
|
||||
|
||||
if (voList.isEmpty()) {
|
||||
throw new RuntimeException("未查询到相关信息");
|
||||
}
|
||||
|
||||
String id = purchasingPlanVO.getPurchasingPlanId();
|
||||
|
||||
String applyFileName = "采购计划-"+id;
|
||||
|
||||
String pdfFilePath = "document" + "/"+"purchasingPlan" + "/" + id + "/" + applyFileName + ".pdf";
|
||||
try {
|
||||
//直接调用pdf方法
|
||||
purchasingPlanTablePDF(purchasingPlanVO,id,theHttpServletRequest,httpServletResponse);
|
||||
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
|
||||
httpServletResponse.setContentType(applyFileName);
|
||||
} catch (Exception e) {
|
||||
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void purchasingPlanTablePDF(PurchasingPlanVO purchasingPlanVO, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
System.out.println("PurchasingPlanTablePDF.................");
|
||||
|
||||
List<ProcurementContentVO> procurementContentVOList = purchasingPlanVO.getProcurementContentVOList();
|
||||
|
||||
ArrayList<ProcurementContentVO> voList = new ArrayList<>();
|
||||
|
||||
for (ProcurementContentVO procurementContentVO : procurementContentVOList) {
|
||||
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(procurementContentVO.getReagentConsumableId());
|
||||
|
||||
if (byId.getCategory().equals("试剂")|byId.getCategory().equals("耗材")){
|
||||
|
||||
voList.add(procurementContentVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------
|
||||
// 生成 word 版本的 采购目录
|
||||
|
||||
String applyFileName = "采购计划-"+id;
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
ossFile.fileGet("template" + "/" + "试剂耗材采购计划表模板.docx", bos);
|
||||
|
||||
byte[] templateArray = bos.toByteArray();
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
bos.close();
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
Configure config = Configure.builder().
|
||||
bind("voList", policy).build();
|
||||
/**
|
||||
* 循环表格
|
||||
*/
|
||||
XWPFTemplate template = XWPFTemplate.compile(bis, config).render(
|
||||
new HashMap<String, Object>() {{
|
||||
put("voList", voList);
|
||||
put("appropriationBudget",purchasingPlanVO.getAppropriationBudget());
|
||||
put("id",id);
|
||||
put("size",1);
|
||||
put("createName", purchasingPlanVO.getCreateName());
|
||||
put("primaryAuditorName", purchasingPlanVO.getPrimaryAuditorName());
|
||||
put("approverName", purchasingPlanVO.getApproverName());
|
||||
put("createTime",LocalDateTimeUtil.format(purchasingPlanVO.getCommitTime(),"yyyy年MM月dd日"));
|
||||
put("auditTimeOfPrimary",LocalDateTimeUtil.format(purchasingPlanVO.getAuditTimeOfPrimary(),"yyyy年MM月dd日"));
|
||||
put("approvalTime",LocalDateTimeUtil.format(purchasingPlanVO.getApprovalTime(),"yyyy年MM月dd日"));
|
||||
}}
|
||||
);
|
||||
bis.close();
|
||||
|
||||
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
template.write(fosWord);
|
||||
template.close();
|
||||
|
||||
//------------
|
||||
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
fosWord.close();
|
||||
|
||||
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
fisWord.close();
|
||||
|
||||
|
||||
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave("document" + "/" + "purchasingPlan" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println(String.format("转换为 PDF 结束"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+11
-5
@@ -101,10 +101,13 @@ public class ReagentConsumableInventoryController {
|
||||
@ApiOperation(value = "标准物质管理列表", notes = "标准物质管理列表")
|
||||
@GetMapping("/standardList")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
|
||||
public R<Page<ReagentConsumableInventoryVO>> getReagentConsumableInventoryList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<ReagentConsumableInventoryVO>> getReagentConsumableInventoryList(Page<ReagentConsumableInventory> page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
Page<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, reagentConsumableName);
|
||||
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, Wrappers.<ReagentConsumableInventory>query()
|
||||
.like(StrUtil.isNotBlank(reagentConsumableName),"reagent_consumable_name",reagentConsumableName)
|
||||
.eq("category", "标准物质").or()
|
||||
.eq("category", "标准储备溶液"));
|
||||
return R.ok(reagentConsumableInventoryRMVOList);
|
||||
// return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory)));
|
||||
}
|
||||
@@ -112,11 +115,14 @@ public class ReagentConsumableInventoryController {
|
||||
@ApiOperation(value = "试剂耗材管理列表", notes = "试剂耗材管理列表")
|
||||
@GetMapping("/List")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
|
||||
public R<Page<ReagentConsumableInventoryVO>> getList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<ReagentConsumableInventoryVO>> getList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
Page<ReagentConsumableInventoryVO> reagentConsumableInventoryVOList = reagentConsumableInventoryService.getReagentConsumableInventoryVOList(page, reagentConsumableName);
|
||||
return R.ok(reagentConsumableInventoryVOList);
|
||||
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, Wrappers.<ReagentConsumableInventory>query()
|
||||
.like(StrUtil.isNotBlank(reagentConsumableName),"reagent_consumable_name",reagentConsumableName)
|
||||
.eq("category", "试剂").or()
|
||||
.eq("category", "耗材"));
|
||||
return R.ok(reagentConsumableInventoryRMVOList);
|
||||
// return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory)));
|
||||
}
|
||||
|
||||
|
||||
+27
-4
@@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.Principal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (试剂耗材类)
|
||||
@@ -54,18 +55,40 @@ public class ReagentConsumablesController {
|
||||
@ApiOperation(value = "分页查询试剂耗材类(包括标准物质)", notes = "分页查询试剂耗材类(包括标准物质)")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumables_get')" )
|
||||
public R<IPage<ReagentConsumables>> getReagentConsumablesPage(Page<ReagentConsumables> page, String name, HttpServletRequest theHttpServletRequest) {
|
||||
public R<List<ReagentConsumables>> getReagentConsumablesPage(Page<ReagentConsumables> page, String name, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<ReagentConsumables> reagentConsumablesSList = reagentConsumablesService.page(page, Wrappers.<ReagentConsumables>query()
|
||||
List<ReagentConsumables> list = reagentConsumablesService.list(Wrappers.<ReagentConsumables>query()
|
||||
.eq("category", "试剂").or()
|
||||
.eq("category", "耗材").or()
|
||||
.eq("category", "标准物质")
|
||||
.eq(StrUtil.isNotBlank(name),"reagent_consumable_name",name)
|
||||
.like(StrUtil.isNotBlank(name), "reagent_consumable_name", name)
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(reagentConsumablesSList);
|
||||
|
||||
|
||||
return R.ok(list);
|
||||
// return R.ok(reagentConsumablesService.page(page, Wrappers.query(reagentConsumables)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param id 分页对象
|
||||
* @param id (试剂耗材类)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过ID查询试剂耗材类(包括标准物质)", notes = "通过ID查询试剂耗材类")
|
||||
@GetMapping()
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumables_get')" )
|
||||
public R<ReagentConsumables> getReagentConsumables(String id, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(id);
|
||||
|
||||
return R.ok(byId);
|
||||
// return R.ok(reagentConsumablesService.page(page, Wrappers.query(reagentConsumables)));
|
||||
}
|
||||
}
|
||||
|
||||
+34
@@ -7,8 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.entity.RequisitionRecord;
|
||||
import digital.laboratory.platform.reagent.service.RequisitionRecordService;
|
||||
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
|
||||
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
|
||||
import digital.laboratory.platform.reagent.vo.RequisitionRecordVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -21,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.Principal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (试剂耗材领用记录表)
|
||||
@@ -43,7 +47,37 @@ public class RequisitionRecordController {
|
||||
|
||||
private final RequisitionRecordService requisitionRecordService;
|
||||
|
||||
private final OssFile ossFile;
|
||||
|
||||
@ApiOperation(value = "试剂耗材领用记录表打印", notes = "试剂耗材领用记录表打印")
|
||||
@SysLog("试剂耗材领用申请表打印")
|
||||
@PostMapping("/print")
|
||||
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
|
||||
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
System.out.println("bizApplyWord.................");
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
List<RequisitionRecordVO> voList = requisitionRecordService.getRequisitionRecordVO(id);
|
||||
|
||||
|
||||
if (voList.isEmpty()) {
|
||||
throw new RuntimeException("未查询到相关信息");
|
||||
}
|
||||
|
||||
String applyFileName = "试剂耗材领用记录表-"+id;
|
||||
|
||||
String pdfFilePath = "document" + "/"+"requisitionRecord" + "/" + id + "/" + applyFileName + ".pdf";
|
||||
try {
|
||||
//直接调用pdf方法
|
||||
requisitionRecordService.rquisitionRecordTablePDF(voList,id,theHttpServletRequest,httpServletResponse);
|
||||
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
|
||||
httpServletResponse.setContentType(applyFileName);
|
||||
} catch (Exception e) {
|
||||
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
|
||||
+154
-83
@@ -1,17 +1,23 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.StandardMaterialApplicationDTO;
|
||||
import digital.laboratory.platform.reagent.entity.CatalogueDetails;
|
||||
import digital.laboratory.platform.reagent.entity.StandardMaterialApplication;
|
||||
import digital.laboratory.platform.reagent.service.StandardMaterialApplicationService;
|
||||
import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -23,151 +29,216 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.Principal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (标准物质领用/归还登记表)
|
||||
*
|
||||
* @author Zhang Xiaolong created at 2023-03-10
|
||||
* @describe (标准物质领用/归还登记表) 前端控制器
|
||||
*
|
||||
* @describe (标准物质领用 / 归还登记表) 前端控制器
|
||||
* <p>
|
||||
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
|
||||
* 这里写什么:
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/standard_material_application" )
|
||||
@RequestMapping("/standard_material_application")
|
||||
@Api(value = "standard_material_application", tags = "(标准物质领用/归还登记表)管理")
|
||||
public class StandardMaterialApplicationController {
|
||||
|
||||
private final StandardMaterialApplicationService standardMaterialApplicationService;
|
||||
private final StandardMaterialApplicationService standardMaterialApplicationService;
|
||||
|
||||
/**
|
||||
* 通过id查询(标准物质领用/归还登记表)
|
||||
* @param standardMaterialApplicationId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping( )
|
||||
private final OssFile ossFile;
|
||||
|
||||
/**
|
||||
* 通过id查询(标准物质领用/归还登记表)
|
||||
*
|
||||
* @param id, id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping()
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_get')" )
|
||||
public R<StandardMaterialApplication> getById( String standardMaterialApplicationId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
public R<StandardMaterialApplicationVO> getById(String id, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
StandardMaterialApplication standardMaterialApplication = standardMaterialApplicationService.getById(standardMaterialApplicationId);
|
||||
return R.ok(standardMaterialApplication);
|
||||
//return R.ok(standardMaterialApplicationService.getById(standardMaterialApplicationId));
|
||||
}
|
||||
StandardMaterialApplicationVO standardMaterialApplicationVO = standardMaterialApplicationService.getStandardMaterialApplicationVO(id);
|
||||
|
||||
/**
|
||||
return R.ok(standardMaterialApplicationVO);
|
||||
//return R.ok(standardMaterialApplicationService.getById(standardMaterialApplicationId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param standardMaterialApplication (标准物质领用/归还登记表)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "领用分页查询", notes = "领用分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_get')" )
|
||||
public R<IPage<StandardMaterialApplicationVO>> getStandardMaterialApplicationPage(Page<StandardMaterialApplication> page, StandardMaterialApplication standardMaterialApplication, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getPage(page, Wrappers.<StandardMaterialApplication>query()
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(standardMaterialApplicationSList);
|
||||
IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getPage(page, Wrappers.<StandardMaterialApplication>query()
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(standardMaterialApplicationSList);
|
||||
// return R.ok(standardMaterialApplicationService.page(page, Wrappers.query(standardMaterialApplication)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param standardMaterialApplication (标准物质领用/归还登记表)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "归还任务分页查询", notes = "归还任务分页查询")
|
||||
@GetMapping("/return/page" )
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param standardMaterialApplication (标准物质领用/归还登记表)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "归还任务分页查询", notes = "归还任务分页查询")
|
||||
@GetMapping("/return/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_get')" )
|
||||
public R<IPage<StandardMaterialApplicationVO>> getList(Page<StandardMaterialApplication> page, StandardMaterialApplication standardMaterialApplication, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
public R<IPage<StandardMaterialApplicationVO>> getList(Page<StandardMaterialApplication> page, String name, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getList(page, Wrappers.<StandardMaterialApplication>query()
|
||||
.orderByDesc("create_time")
|
||||
.eq("status",0)
|
||||
);
|
||||
return R.ok(standardMaterialApplicationSList);
|
||||
IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getList(page, Wrappers.<StandardMaterialApplication>query()
|
||||
.eq("status", 0)
|
||||
.like(StrUtil.isNotBlank(name),"reference_substance_name", name)
|
||||
.ge(startTime != null, "create_time", startTime)
|
||||
.le(endTime != null, "create_time", endTime)
|
||||
.orderByDesc("create_time")
|
||||
|
||||
);
|
||||
return R.ok(standardMaterialApplicationSList);
|
||||
// return R.ok(standardMaterialApplicationService.page(page, Wrappers.query(standardMaterialApplication)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param standardMaterialApplication (标准物质领用/归还登记表)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "归还记录分页查询", notes = "归还记录分页查询")
|
||||
@GetMapping("/return" )
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "归还记录分页查询", notes = "归还记录分页查询")
|
||||
@GetMapping("/return")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_get')" )
|
||||
public R<IPage<StandardMaterialApplicationVO>> getPage(Page<StandardMaterialApplication> page, StandardMaterialApplication standardMaterialApplication, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
public R<IPage<StandardMaterialApplicationVO>> getPage(Page<StandardMaterialApplication> page, String name,@DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime,@DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getList(page, Wrappers.<StandardMaterialApplication>query()
|
||||
.orderByDesc("create_time")
|
||||
.eq("status",1)
|
||||
);
|
||||
return R.ok(standardMaterialApplicationSList);
|
||||
IPage<StandardMaterialApplicationVO> standardMaterialApplicationSList = standardMaterialApplicationService.getList(page, Wrappers.<StandardMaterialApplication>query()
|
||||
.eq("status", 1)
|
||||
.like(StrUtil.isNotBlank(name),"reference_substance_name", name)
|
||||
.ge(startTime != null, "create_time", startTime)
|
||||
.le(endTime != null, "create_time", endTime)
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(standardMaterialApplicationSList);
|
||||
// return R.ok(standardMaterialApplicationService.page(page, Wrappers.query(standardMaterialApplication)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 归还(标准物质领用/归还登记表)
|
||||
*
|
||||
* @param standardMaterialApplicationDTO (标准物质领用/归还登记表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "归还(标准物质领用/归还登记表)", notes = "归还(标准物质领用/归还登记表)")
|
||||
@SysLog("修改(标准物质领用/归还登记表)" )
|
||||
@SysLog("修改(标准物质领用/归还登记表)")
|
||||
@PutMapping
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_edit')" )
|
||||
public R<StandardMaterialApplication> putUpdateById(@RequestBody StandardMaterialApplicationDTO standardMaterialApplicationDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
StandardMaterialApplication standardMaterialApplication = standardMaterialApplicationService.returnById(standardMaterialApplicationDTO);
|
||||
StandardMaterialApplication standardMaterialApplication = standardMaterialApplicationService.returnById(standardMaterialApplicationDTO);
|
||||
|
||||
if (standardMaterialApplication!=null){
|
||||
return R.ok(standardMaterialApplication,"归还成功");
|
||||
}else return R.failed("归还失败");
|
||||
}
|
||||
if (standardMaterialApplication != null) {
|
||||
return R.ok(standardMaterialApplication, "归还成功");
|
||||
} else return R.failed("归还失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除(标准物质领用/归还登记表)
|
||||
*
|
||||
* @param standardMaterialApplicationId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除(标准物质领用/归还登记表)", notes = "通过id删除(标准物质领用/归还登记表)")
|
||||
@SysLog("通过id删除(标准物质领用/归还登记表)" )
|
||||
@DeleteMapping("/{standardMaterialApplicationId}" )
|
||||
@SysLog("通过id删除(标准物质领用/归还登记表)")
|
||||
@DeleteMapping("/{standardMaterialApplicationId}")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_application_del')" )
|
||||
public R<StandardMaterialApplication> deleteById( String standardMaterialApplicationId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
public R<StandardMaterialApplication> deleteById(String standardMaterialApplicationId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
StandardMaterialApplication oldStandardMaterialApplication = standardMaterialApplicationService.getById(standardMaterialApplicationId);
|
||||
|
||||
if (standardMaterialApplicationService.removeById(standardMaterialApplicationId)) {
|
||||
return R.ok(oldStandardMaterialApplication, "对象删除成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(oldStandardMaterialApplication, "对象删除失败");
|
||||
}
|
||||
if (standardMaterialApplicationService.removeById(standardMaterialApplicationId)) {
|
||||
return R.ok(oldStandardMaterialApplication, "对象删除成功");
|
||||
} else {
|
||||
return R.failed(oldStandardMaterialApplication, "对象删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**-------采购目录打印*/
|
||||
/**
|
||||
* 采购目录打印
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "标准物质领用归还登记表打印", notes = "标准物质领用归还登记表打印")
|
||||
@SysLog("标准物质领用归还登记表打印")
|
||||
@PostMapping("/print")
|
||||
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
|
||||
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
System.out.println("bizApplyWord.................");
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
String ids = IdWorker.get32UUID().toUpperCase();
|
||||
|
||||
String[] split = id.split(",");
|
||||
|
||||
List<StandardMaterialApplicationVO> voList = new ArrayList<>();
|
||||
|
||||
for (String s : split) {
|
||||
|
||||
StandardMaterialApplicationVO standardMaterialApplicationVO = standardMaterialApplicationService.getStandardMaterialApplicationVO(s);
|
||||
|
||||
voList.add(standardMaterialApplicationVO);
|
||||
}
|
||||
|
||||
if (voList.isEmpty()) {
|
||||
throw new RuntimeException("未查询到相关信息");
|
||||
}
|
||||
|
||||
|
||||
String applyFileName = "标准物质领用归还登记表-" + ids;
|
||||
|
||||
String pdfFilePath = "document" + "/" + "standardMaterialApplication" + "/" + ids + "/" + applyFileName + ".pdf";
|
||||
try {
|
||||
//直接调用pdf方法
|
||||
standardMaterialApplicationService.standardMaterialApplicationTablePDF(voList, ids, theHttpServletRequest, httpServletResponse);
|
||||
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
|
||||
httpServletResponse.setContentType(applyFileName);
|
||||
} catch (Exception e) {
|
||||
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+164
-129
@@ -1,6 +1,7 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
@@ -10,12 +11,14 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO;
|
||||
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
|
||||
import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm;
|
||||
import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
|
||||
import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService;
|
||||
import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -29,190 +32,222 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.Principal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* (标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
*
|
||||
* @author Zhang Xiaolong created at 2023-03-10
|
||||
* @describe (标准物质停用/报废销毁/恢复/降级使用审批表) 前端控制器
|
||||
*
|
||||
* @describe (标准物质停用 / 报废销毁 / 恢复 / 降级使用审批表) 前端控制器
|
||||
* <p>
|
||||
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
|
||||
* 这里写什么:
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/standard_material_approval_form" )
|
||||
@RequestMapping("/standard_material_approval_form")
|
||||
@Api(value = "standard_material_approval_form", tags = "(标准物质停用/报废销毁/恢复/降级使用审批表)管理")
|
||||
public class StandardMaterialApprovalFormController {
|
||||
|
||||
private final StandardMaterialApprovalFormService standardMaterialApprovalFormService;
|
||||
private final StandardMaterialApprovalFormService standardMaterialApprovalFormService;
|
||||
|
||||
private final ReferenceMaterialService referenceMaterialService;
|
||||
private final ReferenceMaterialService referenceMaterialService;
|
||||
|
||||
/**
|
||||
* 通过id查询(标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @param id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping( )
|
||||
private final OssFile ossFile;
|
||||
|
||||
/**
|
||||
* 通过id查询(标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
*
|
||||
* @param id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping()
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" )
|
||||
public R<StandardMaterialApprovalFormVO> getById(String id, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
public R<StandardMaterialApprovalFormVO> getById(String id, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
StandardMaterialApprovalFormVO standardMaterialApprovalForm = standardMaterialApprovalFormService.getVO(id);
|
||||
return R.ok(standardMaterialApprovalForm);
|
||||
//return R.ok(standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId));
|
||||
}
|
||||
return R.ok(standardMaterialApprovalForm);
|
||||
//return R.ok(standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId));
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param referenceMaterialName (标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param referenceMaterialName (标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_page)" )
|
||||
public R<IPage<StandardMaterialApprovalFormVO>> getStandardMaterialApprovalFormPage(Page<StandardMaterialApprovalForm> page, String referenceMaterialName, @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") DateTime startTime,
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime,HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
public R<IPage<StandardMaterialApprovalFormVO>> getStandardMaterialApprovalFormPage(Page<StandardMaterialApprovalForm> page, String referenceMaterialName, @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startTime,
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
QueryWrapper<StandardMaterialApprovalForm> standardMaterialApprovalFormQueryWrapper = new QueryWrapper<>();
|
||||
IPage<StandardMaterialApprovalFormVO> standardMaterialApprovalFormSList = standardMaterialApprovalFormService.getVOPage(page, Wrappers.<StandardMaterialApprovalForm>query()
|
||||
.like(StrUtil.isNotBlank(referenceMaterialName), "reference_material_name", referenceMaterialName)
|
||||
.ge(startTime != null, "create_time", startTime)
|
||||
.le(endTime != null, "create_time", endTime)
|
||||
|
||||
if (referenceMaterialName!=null){
|
||||
|
||||
standardMaterialApprovalFormQueryWrapper.eq("reference_material_name",referenceMaterialName);
|
||||
}
|
||||
|
||||
if (startTime!=null&&endTime!=null){
|
||||
|
||||
standardMaterialApprovalFormQueryWrapper.ge("create_time",startTime).le("create_time",endTime);
|
||||
}
|
||||
|
||||
IPage<StandardMaterialApprovalFormVO> standardMaterialApprovalFormSList = standardMaterialApprovalFormService.getVOPage(page, standardMaterialApprovalFormQueryWrapper
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(standardMaterialApprovalFormSList);
|
||||
);
|
||||
return R.ok(standardMaterialApprovalFormSList);
|
||||
// return R.ok(standardMaterialApprovalFormService.page(page, Wrappers.query(standardMaterialApprovalForm)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增(标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
*
|
||||
* @param standardMaterialApprovalFormDTO (标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)")
|
||||
@SysLog("新增(标准物质停用/报废销毁/恢复/降级使用审批表)" )
|
||||
@SysLog("新增(标准物质停用/报废销毁/恢复/降级使用审批表)")
|
||||
@PostMapping
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_add')" )
|
||||
public R<StandardMaterialApprovalForm> postAddObject(@RequestBody StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.commitById(standardMaterialApprovalFormDTO, dlpUser);
|
||||
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.commitById(standardMaterialApprovalFormDTO, dlpUser);
|
||||
|
||||
if (standardMaterialApprovalForm!=null) {
|
||||
return R.ok(standardMaterialApprovalForm, "保存成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(standardMaterialApprovalForm, "保存失败");
|
||||
}
|
||||
if (standardMaterialApprovalForm != null) {
|
||||
return R.ok(standardMaterialApprovalForm, "保存成功");
|
||||
} else {
|
||||
return R.failed(standardMaterialApprovalForm, "保存失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)")
|
||||
@SysLog("一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)" )
|
||||
@PutMapping("/auditPrimary")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_auditPrimary')" )
|
||||
public R<StandardMaterialApprovalForm> auditPrimary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
/**
|
||||
* 一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
*
|
||||
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)")
|
||||
@SysLog("一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)")
|
||||
@PutMapping("/auditPrimary")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_auditPrimary')")
|
||||
public R<StandardMaterialApprovalForm> auditPrimary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.auditPrimary(auditAndApproveDTO,dlpUser);
|
||||
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.auditPrimary(auditAndApproveDTO, dlpUser);
|
||||
|
||||
if (standardMaterialApprovalForm!=null) {
|
||||
return R.ok(standardMaterialApprovalForm, "审核成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(standardMaterialApprovalForm, "审核失败");
|
||||
}
|
||||
}
|
||||
if (standardMaterialApprovalForm != null) {
|
||||
return R.ok(standardMaterialApprovalForm, "审核成功");
|
||||
} else {
|
||||
return R.failed(standardMaterialApprovalForm, "审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)")
|
||||
@SysLog("一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)" )
|
||||
@PutMapping("/auditSecondary")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_auditSecondary')" )
|
||||
public R<StandardMaterialApprovalForm> auditSecondary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
/**
|
||||
* 二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
*
|
||||
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)")
|
||||
@SysLog("一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)")
|
||||
@PutMapping("/auditSecondary")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_auditSecondary')")
|
||||
public R<StandardMaterialApprovalForm> auditSecondary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.auditSecondary(auditAndApproveDTO,dlpUser);
|
||||
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.auditSecondary(auditAndApproveDTO, dlpUser);
|
||||
|
||||
if (standardMaterialApprovalForm!=null) {
|
||||
return R.ok(standardMaterialApprovalForm, "审核成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(standardMaterialApprovalForm, "审核失败");
|
||||
}
|
||||
}
|
||||
if (standardMaterialApprovalForm != null) {
|
||||
return R.ok(standardMaterialApprovalForm, "审核成功");
|
||||
} else {
|
||||
return R.failed(standardMaterialApprovalForm, "审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批(标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审批(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "审批(标准物质停用/报废销毁/恢复/降级使用审批表)")
|
||||
@SysLog("审批(标准物质停用/报废销毁/恢复/降级使用审批表)" )
|
||||
@PutMapping("/approve")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_approve')" )
|
||||
public R<StandardMaterialApprovalForm> approveById(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
/**
|
||||
* 审批(标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
*
|
||||
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审批(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "审批(标准物质停用/报废销毁/恢复/降级使用审批表)")
|
||||
@SysLog("审批(标准物质停用/报废销毁/恢复/降级使用审批表)")
|
||||
@PutMapping("/approve")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_approve')")
|
||||
public R<StandardMaterialApprovalForm> approveById(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.approveById(auditAndApproveDTO,dlpUser);
|
||||
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.approveById(auditAndApproveDTO, dlpUser);
|
||||
|
||||
if (standardMaterialApprovalForm!=null) {
|
||||
return R.ok(standardMaterialApprovalForm, "审批成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(standardMaterialApprovalForm, "审批失败");
|
||||
}
|
||||
}
|
||||
if (standardMaterialApprovalForm != null) {
|
||||
return R.ok(standardMaterialApprovalForm, "审批成功");
|
||||
} else {
|
||||
return R.failed(standardMaterialApprovalForm, "审批失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "标准物质停用", notes = "标准物质停用")
|
||||
@SysLog("标准物质停用" )
|
||||
@PostMapping("/deactivate")
|
||||
@ApiOperation(value = "标准物质停用", notes = "标准物质停用")
|
||||
@SysLog("标准物质停用")
|
||||
@PostMapping("/deactivate")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_deactivate')" )
|
||||
public R<String > editById(String id, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
public R<String> editById(String id, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
ReferenceMaterial byId = referenceMaterialService.getById(id);
|
||||
ReferenceMaterial byId = referenceMaterialService.getById(id);
|
||||
|
||||
byId.setStatus(-1);
|
||||
byId.setStatus(-1);
|
||||
|
||||
if (referenceMaterialService.updateById(byId)) {
|
||||
return R.ok("停用成功");
|
||||
}
|
||||
else {
|
||||
return R.failed( "停用失败");
|
||||
}
|
||||
}
|
||||
if (referenceMaterialService.updateById(byId)) {
|
||||
return R.ok("停用成功");
|
||||
} else {
|
||||
return R.failed("停用失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**-------标准物质停用报废销毁恢复降级使用审批表打印*/
|
||||
/**
|
||||
* 标准物质停用报废销毁恢复降级使用审批表打印
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "标准物质停用报废销毁恢复降级使用审批表打印", notes = "标准物质停用报废销毁恢复降级使用审批表打印")
|
||||
@SysLog("标准物质停用报废销毁恢复降级使用审批表打印")
|
||||
@PostMapping("/print")
|
||||
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
|
||||
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
System.out.println("bizApplyWord.................");
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
StandardMaterialApprovalFormVO standardMaterialApprovalFormVO = standardMaterialApprovalFormService.getVO(id);
|
||||
|
||||
if (standardMaterialApprovalFormVO == null) {
|
||||
throw new RuntimeException("未查询到相关信息");
|
||||
}
|
||||
String applyFileName = "标准物质停用报废销毁恢复降级使用审批表" + id;
|
||||
;
|
||||
|
||||
|
||||
String pdfFilePath = "document" + "/" + "standardMaterialApprovalForm" + "/" + id + "/" + applyFileName + ".pdf";
|
||||
try {
|
||||
//直接调用pdf方法
|
||||
standardMaterialApprovalFormService.standardMaterialApprovalFormTablePDF(standardMaterialApprovalFormVO, theHttpServletRequest, httpServletResponse);
|
||||
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
|
||||
httpServletResponse.setContentType(applyFileName);
|
||||
} catch (Exception e) {
|
||||
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+52
-15
@@ -1,6 +1,7 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
@@ -10,11 +11,14 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.StandardReserveSolutionDTO;
|
||||
import digital.laboratory.platform.reagent.dto.StandardReserveSolutionFullDTO;
|
||||
import digital.laboratory.platform.reagent.entity.StandardReserveSolution;
|
||||
import digital.laboratory.platform.reagent.service.StandardReserveSolutionService;
|
||||
import digital.laboratory.platform.reagent.utils.String2DateConverter;
|
||||
import digital.laboratory.platform.reagent.vo.SolutionUseFormVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -31,6 +35,7 @@ import java.io.IOException;
|
||||
import java.security.Principal;
|
||||
import java.sql.Date;
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (标准储备溶液配制及使用记录表)
|
||||
@@ -53,6 +58,8 @@ public class StandardReserveSolutionController {
|
||||
|
||||
private final StandardReserveSolutionService standardReserveSolutionService;
|
||||
|
||||
private final OssFile ossFile;
|
||||
|
||||
/**
|
||||
* 通过id查询(标准储备溶液配制及使用记录表)
|
||||
* @param id id
|
||||
@@ -79,24 +86,15 @@ public class StandardReserveSolutionController {
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_get')" )
|
||||
public R<IPage<StandardReserveSolutionVO>> getStandardReserveSolutionPage(Page<StandardReserveSolution> page, String solutionName, @DateTimeFormat(pattern = "yyyy-MM-dd")@JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd")@JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime , HttpServletRequest theHttpServletRequest) throws ParseException {
|
||||
public R<IPage<StandardReserveSolutionVO>> getStandardReserveSolutionPage(Page<StandardReserveSolution> page, String solutionName, @DateTimeFormat(pattern = "yyyy-MM-dd")@JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd")@JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime , HttpServletRequest theHttpServletRequest) throws ParseException {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
QueryWrapper<StandardReserveSolution> standardReserveSolutionQueryWrapper = new QueryWrapper<>();
|
||||
//通过名称查询
|
||||
if (solutionName!=null){
|
||||
|
||||
standardReserveSolutionQueryWrapper.like("solution_name",solutionName);
|
||||
}
|
||||
if (startTime != null && endTime != null) {
|
||||
|
||||
standardReserveSolutionQueryWrapper.ge("create_time",startTime).le("create_time",endTime);
|
||||
}
|
||||
|
||||
IPage<StandardReserveSolutionVO> standardReserveSolutionSList = standardReserveSolutionService.getStandardReserveSolutionVOList(page,standardReserveSolutionQueryWrapper
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
IPage<StandardReserveSolutionVO> standardReserveSolutionSList = standardReserveSolutionService.getStandardReserveSolutionVOList(page,Wrappers.<StandardReserveSolution>query()
|
||||
.like(StrUtil.isNotBlank(solutionName),"solution_name",solutionName)
|
||||
.ge(startTime!=null,"create_time",startTime)
|
||||
.le(endTime!=null,"create_time",endTime)
|
||||
.orderByDesc("create_time"));
|
||||
return R.ok(standardReserveSolutionSList);
|
||||
// return R.ok(standardReserveSolutionService.page(page, Wrappers.query(standardReserveSolution)));
|
||||
}
|
||||
@@ -159,4 +157,43 @@ public class StandardReserveSolutionController {
|
||||
//return R.ok(standardReserveSolutionService.getById(standardReserveSolutionId));
|
||||
}
|
||||
|
||||
/**-------标准储备溶液配制及使用记录表打印*/
|
||||
/**
|
||||
* 标准储备溶液配制及使用记录表打印
|
||||
*
|
||||
* @param id
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "标准储备溶液配制及使用记录表打印", notes = "标准储备溶液配制及使用记录表打印")
|
||||
@SysLog("标准储备溶液配制及使用记录表打印")
|
||||
@PostMapping("/print")
|
||||
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
|
||||
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
System.out.println("bizApplyWord.................");
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
StandardReserveSolutionVO standardReserveSolutionVOById = standardReserveSolutionService.getStandardReserveSolutionVOById(id);
|
||||
|
||||
List<SolutionUseFormVO> voList = standardReserveSolutionVOById.getSolutionUseFormVOList();
|
||||
|
||||
if (voList.isEmpty()){
|
||||
|
||||
throw new RuntimeException(String.format("未查询到使用记录,无法打印"));
|
||||
}
|
||||
|
||||
String applyFileName = "标准储备溶液配制及使用记录表-"+id;
|
||||
|
||||
String pdfFilePath = "document" + "/"+"standardReserveSolution" + "/" + id + "/" + applyFileName + ".pdf";
|
||||
try {
|
||||
//直接调用pdf方法
|
||||
standardReserveSolutionService.standardReserveSolutionTablePDF(standardReserveSolutionVOById,theHttpServletRequest,httpServletResponse);
|
||||
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
|
||||
httpServletResponse.setContentType(applyFileName);
|
||||
} catch (Exception e) {
|
||||
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+92
-36
@@ -1,6 +1,7 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
@@ -10,10 +11,14 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.StandardSolutionCurveDTO;
|
||||
import digital.laboratory.platform.reagent.entity.StandardSolutionCurve;
|
||||
import digital.laboratory.platform.reagent.service.StandardSolutionCurveService;
|
||||
import digital.laboratory.platform.reagent.vo.SolutionUseFormVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
|
||||
import nonapi.io.github.classgraph.json.Id;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -26,84 +31,135 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.Principal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (标准工作曲线溶液配置记录表)
|
||||
*
|
||||
* @author Zhang Xiaolong created at 2023-03-10
|
||||
* @describe (标准工作曲线溶液配置记录表) 前端控制器
|
||||
*
|
||||
* <p>
|
||||
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
|
||||
* 这里写什么:
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/standard_solution_curve" )
|
||||
@RequestMapping("/standard_solution_curve")
|
||||
@Api(value = "standard_solution_curve", tags = "(标准工作曲线溶液配置记录表)管理")
|
||||
public class StandardSolutionCurveController {
|
||||
|
||||
private final StandardSolutionCurveService standardSolutionCurveService;
|
||||
private final StandardSolutionCurveService standardSolutionCurveService;
|
||||
|
||||
/**
|
||||
private final OssFile ossFile;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_get')" )
|
||||
public R<IPage<StandardSolutionCurveVO>> getStandardSolutionCurvePage(Page<StandardSolutionCurve> page, String solutionName, @JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")DateTime startTime,@DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
QueryWrapper<StandardSolutionCurve> standardSolutionCurveQueryWrapper = new QueryWrapper<>();
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
if (solutionName!=null){
|
||||
|
||||
standardSolutionCurveQueryWrapper.like("solution_name",solutionName);
|
||||
}
|
||||
|
||||
if (startTime!=null&&endTime!=null){
|
||||
|
||||
standardSolutionCurveQueryWrapper.ge("create_time",startTime).le("create_time",endTime);
|
||||
}
|
||||
|
||||
IPage<StandardSolutionCurveVO> standardSolutionCurveVOPage = standardSolutionCurveService.getStandardSolutionCurveVOPage(page, standardSolutionCurveQueryWrapper
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(standardSolutionCurveVOPage);
|
||||
IPage<StandardSolutionCurveVO> standardSolutionCurveVOPage = standardSolutionCurveService.getStandardSolutionCurveVOPage(page, Wrappers.<StandardSolutionCurve>query()
|
||||
.like(StrUtil.isNotBlank(solutionName), "solution_name", solutionName)
|
||||
.ge(startTime != null, "create_time", startTime)
|
||||
.le(endTime != null, "create_time", endTime)
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(standardSolutionCurveVOPage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增(标准工作曲线溶液配置记录表)
|
||||
*
|
||||
* @param standardSolutionCurveDTO (标准工作曲线溶液配置记录表)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增(标准工作曲线溶液配置记录表)", notes = "新增(标准工作曲线溶液配置记录表)")
|
||||
@SysLog("新增(标准工作曲线溶液配置记录表)" )
|
||||
@SysLog("新增(标准工作曲线溶液配置记录表)")
|
||||
@PostMapping
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_add')" )
|
||||
public R<StandardSolutionCurve> postAddObject(@RequestBody StandardSolutionCurveDTO standardSolutionCurveDTO, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
StandardSolutionCurve standardSolutionCurve = standardSolutionCurveService.addById(standardSolutionCurveDTO, dlpUser);
|
||||
StandardSolutionCurve standardSolutionCurve = standardSolutionCurveService.addById(standardSolutionCurveDTO, dlpUser);
|
||||
|
||||
if (standardSolutionCurve!=null){
|
||||
return R.ok(standardSolutionCurve);
|
||||
}else return R.failed("配置失败");
|
||||
}
|
||||
if (standardSolutionCurve != null) {
|
||||
return R.ok(standardSolutionCurve);
|
||||
} else return R.failed("配置失败");
|
||||
}
|
||||
|
||||
/**-------标准工作曲线溶液配置记录表打印*/
|
||||
/**
|
||||
* 标准工作曲线溶液配置记录表打印
|
||||
*
|
||||
* @param idList
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "标准工作曲线溶液配置记录表打印", notes = "标准工作曲线溶液配置记录表打印")
|
||||
@SysLog("标准工作曲线溶液配置记录表打印")
|
||||
@PostMapping("/print")
|
||||
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
|
||||
public void bizGetPDFInventory(String idList, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
|
||||
String[] ids = idList.split(",");
|
||||
|
||||
System.out.println("bizApplyWord.................");
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
List<StandardSolutionCurveVO> voList = new ArrayList<>();
|
||||
|
||||
for (String id : ids) {
|
||||
|
||||
StandardSolutionCurveVO standardSolutionCurveVO = standardSolutionCurveService.getStandardSolutionCurveVO(id);
|
||||
|
||||
voList.add(standardSolutionCurveVO);
|
||||
}
|
||||
|
||||
|
||||
if (ids.length == 0 & ids == null) {
|
||||
|
||||
throw new RuntimeException(String.format("未查询到相关信息"));
|
||||
}
|
||||
|
||||
|
||||
if (voList.isEmpty()) {
|
||||
throw new RuntimeException("未查询到相关信息");
|
||||
}
|
||||
|
||||
String id = IdWorker.get32UUID().toUpperCase();
|
||||
|
||||
String applyFileName = "标准工作曲线溶液配制记录表-" + id;
|
||||
|
||||
String pdfFilePath = "document" + "/" + "standardSolutionCurve" + "/" + id + "/" + applyFileName + ".pdf";
|
||||
try {
|
||||
//直接调用pdf方法
|
||||
standardSolutionCurveService.standardSolutionCurveTablePDF(voList, id, theHttpServletRequest, httpServletResponse);
|
||||
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream());
|
||||
httpServletResponse.setContentType(applyFileName);
|
||||
} catch (Exception e) {
|
||||
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-9
@@ -86,24 +86,19 @@ public class SupplierInformationController {
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param type (服务商/供应商信息)
|
||||
* @param supplierName (服务商/供应商信息)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_page')" )
|
||||
public R<IPage<SupplierInformation>> getSupplierInformationPage(Page<SupplierInformation> page, String type, HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<SupplierInformation>> getSupplierInformationPage(Page<SupplierInformation> page, String supplierName, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
QueryWrapper<SupplierInformation> supplierInformationQueryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (type!=null) {
|
||||
|
||||
supplierInformationQueryWrapper.eq("acceptable_condition","合格");
|
||||
}
|
||||
|
||||
IPage<SupplierInformation> supplierInformationSList = supplierInformationService.page(page, supplierInformationQueryWrapper
|
||||
IPage<SupplierInformation> supplierInformationSList = supplierInformationService.page(page, Wrappers.<SupplierInformation>query()
|
||||
.like(StrUtil.isNotBlank(supplierName),"supplier_name",supplierName)
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(supplierInformationSList);
|
||||
|
||||
+20
-13
@@ -1,10 +1,12 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
@@ -18,6 +20,8 @@ import digital.laboratory.platform.reagent.service.WarehousingContentService;
|
||||
import digital.laboratory.platform.reagent.service.WarehousingRecordFormService;
|
||||
import digital.laboratory.platform.reagent.vo.WarehousingContentVO;
|
||||
import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO;
|
||||
import org.joda.time.DateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -27,6 +31,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.security.Principal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -62,7 +67,7 @@ public class WarehousingRecordFormController {
|
||||
@ApiOperation(value = "通过id查询入库信息", notes = "通过id查询入库信息")
|
||||
@GetMapping()
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_get')" )
|
||||
public R<WarehousingRecordFormVO> getById( String warehousingRecordFormId, HttpServletRequest theHttpServletRequest) {
|
||||
public R<WarehousingRecordFormVO> getById(String warehousingRecordFormId, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
@@ -75,18 +80,21 @@ public class WarehousingRecordFormController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')")
|
||||
public R<Page<WarehousingRecordFormVO>> getWarehousingRecordFormVOPage( Page page,HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<WarehousingRecordFormVO>> getWarehousingRecordFormVOPage(Page <WarehousingRecordForm>page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
Page<WarehousingRecordFormVO> warehousingRecordFormVOList = warehousingRecordFormService.getWarehousingRecordFormVOList(page);
|
||||
IPage<WarehousingRecordFormVO> warehousingRecordFormVOList = warehousingRecordFormService.getWarehousingRecordFormVOPage(page,Wrappers.<WarehousingRecordForm>query()
|
||||
.ge(startTime != null, "create_time", startTime)
|
||||
.le(endTime != null, "create_time", endTime));
|
||||
|
||||
return R.ok(warehousingRecordFormVOList);
|
||||
|
||||
@@ -95,30 +103,29 @@ public class WarehousingRecordFormController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/pageWC")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')")
|
||||
public R<IPage<WarehousingContentVO>> getWarehousingContentVOPage( Page page,String name,HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<WarehousingContentVO>> getWarehousingContentVOPage(Page page, String name, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
QueryWrapper<WarehousingContent> warehousingContentQueryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (name!=null){
|
||||
|
||||
warehousingContentQueryWrapper.like("reagent_consumable_name",name);
|
||||
|
||||
}
|
||||
|
||||
IPage<WarehousingContentVO> warehousingContentVOPage = warehousingContentService.getWarehousingContentVOPage(page, warehousingContentQueryWrapper);
|
||||
IPage<WarehousingContentVO> warehousingContentVOPage = warehousingContentService.getWarehousingContentVOPage(page, Wrappers.<WarehousingContent>query()
|
||||
.like(StrUtil.isNotBlank(name), "reagent_consumable_name", name)
|
||||
.ge(startTime != null, "create_time", startTime)
|
||||
.le(endTime != null, "create_time", endTime)
|
||||
.eq("status", 1)
|
||||
.orderByDesc("create_time"));
|
||||
|
||||
return R.ok(warehousingContentVOPage);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增签收记录表
|
||||
*
|
||||
|
||||
@@ -32,7 +32,7 @@ public class AcceptanceRecordFormDTO {
|
||||
private String packingInGoodCondition;
|
||||
|
||||
@ApiModelProperty(value = "(包装完好备注)")
|
||||
private String pcg_remarks;
|
||||
private String pgc_remarks;
|
||||
|
||||
@ApiModelProperty(value = "(有效期)")
|
||||
private String validityPeriod;
|
||||
|
||||
@@ -32,4 +32,7 @@ public class CentralizedRequestDTO {
|
||||
@ApiModelProperty(value="集中采购申请明细Id")
|
||||
private String detailsOfCentralizedId;
|
||||
|
||||
@ApiModelProperty(value="用途/购买理由")
|
||||
private String purpose;
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ public class DecentralizedRequestDTO {
|
||||
|
||||
private String standardValueOrPurity;
|
||||
@ApiModelProperty(value="(用途)")
|
||||
|
||||
private String purpose;
|
||||
@ApiModelProperty(value="(分散采购申请ID)")
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@ public class OutgoingContentsDTO {
|
||||
@ApiModelProperty(value = "(出库用途)")
|
||||
private Integer outboundUse;
|
||||
|
||||
@ApiModelProperty(value = "(出库明细ID)")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "(出库数量)")
|
||||
private Integer quantity;
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ public class PurchasingPlanDTO {
|
||||
@ApiModelProperty(value = "集中采购申请明细ID")
|
||||
private String detailsOfCentralizedId;
|
||||
|
||||
private double unitPrice;
|
||||
|
||||
@ApiModelProperty(value = "采购计划id")
|
||||
private String purchasingPlanId;
|
||||
|
||||
|
||||
+3
@@ -14,6 +14,9 @@ public class StandardMaterialApplicationDTO {
|
||||
@ApiModelProperty(value = "格子id")
|
||||
private String latticeId;
|
||||
|
||||
@ApiModelProperty(value = "位置信息")
|
||||
private String location;
|
||||
|
||||
@ApiModelProperty(value = "是否用完")
|
||||
private Boolean outOfUse;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import lombok.Data;
|
||||
public class StandardSolutionCurveDTO {
|
||||
|
||||
|
||||
@ApiModelProperty(value="(标准储备溶液编号)")
|
||||
private String solutionNumbering;
|
||||
@ApiModelProperty(value="(标准储备溶液Id)")
|
||||
private String solutionId;
|
||||
|
||||
@ApiModelProperty(value="(逐级溶液浓度)")
|
||||
private String stepSolutionConcentration;
|
||||
|
||||
@@ -55,7 +55,10 @@ public class WarehousingRecordFormDTO {
|
||||
private Integer warningValue;
|
||||
|
||||
@ApiModelProperty(value = "(位置信息)")
|
||||
private String location;
|
||||
private String location;
|
||||
|
||||
@ApiModelProperty(value = "(保管人名称)")
|
||||
private String custodianName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@ import lombok.EqualsAndHashCode;
|
||||
@ApiModel(value = "(验收记录表)")
|
||||
public class AcceptanceRecordForm extends BaseEntity {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "(试剂耗材名称)")
|
||||
private String reagentConsumableName;
|
||||
/**
|
||||
* (供应商ID)
|
||||
*/
|
||||
|
||||
@@ -36,6 +36,8 @@ public class CentralizedRequest extends BaseEntity {
|
||||
@ApiModelProperty(value="申请人ID")
|
||||
private String applicantId;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* (申请日期)
|
||||
*/
|
||||
@@ -69,7 +71,6 @@ public class CentralizedRequest extends BaseEntity {
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* centralizedRequestId
|
||||
*/
|
||||
|
||||
@@ -38,6 +38,8 @@ public class ComplianceCheck extends BaseEntity {
|
||||
@ApiModelProperty(value = "(编号)")
|
||||
private String number;
|
||||
|
||||
@ApiModelProperty(value="(试剂耗材名称)")
|
||||
private String reagentConsumableName;
|
||||
/**
|
||||
* (二级审核意见)
|
||||
*/
|
||||
|
||||
@@ -146,4 +146,11 @@ public class DecentralizeDetails extends BaseEntity {
|
||||
private String purpose;
|
||||
|
||||
|
||||
/**
|
||||
* (采购清单明细ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(采购清单明细ID)")
|
||||
private String purchaseListDetailsId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -59,6 +59,9 @@ public class DetailsOfCentralized extends BaseEntity {
|
||||
@ApiModelProperty(value="备注")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value="用途/购买理由")
|
||||
private String purpose;
|
||||
|
||||
/**
|
||||
* (换货试剂耗材ID)
|
||||
*/
|
||||
|
||||
@@ -119,4 +119,5 @@ public class PeriodVerificationPlan extends BaseEntity {
|
||||
private String id;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class PurchasingPlan extends BaseEntity {
|
||||
* (经费预算)
|
||||
*/
|
||||
@ApiModelProperty(value = "经费预算")
|
||||
private double appropriationBudget;
|
||||
private double appropriationBudget;
|
||||
|
||||
/**
|
||||
* (制定人)
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ public class ReagentConsumableInventory extends BaseEntity {
|
||||
* (包装份数)
|
||||
*/
|
||||
@ApiModelProperty(value = "(包装份数)")
|
||||
private Integer packagedCopies;
|
||||
private String packagedCopies;
|
||||
|
||||
/**
|
||||
* reagentConsumableInventoryId
|
||||
|
||||
@@ -69,7 +69,7 @@ public class ReagentConsumables extends BaseEntity {
|
||||
* 包装份数
|
||||
*/
|
||||
@ApiModelProperty(value="包装份数")
|
||||
private Integer packagedCopies;
|
||||
private String packagedCopies;
|
||||
/**
|
||||
* (标准值/纯度)
|
||||
*/
|
||||
|
||||
@@ -35,12 +35,21 @@ public class ReagentConsumablesSet extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "(标准物质编号)")
|
||||
private String referenceMaterialNumber;
|
||||
|
||||
@ApiModelProperty(value = "(出库明细ID)")
|
||||
private String outgoingContentId;
|
||||
/**
|
||||
* (数量)
|
||||
*/
|
||||
@ApiModelProperty(value = "(数量)")
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* (出库数量)
|
||||
*/
|
||||
@ApiModelProperty(value = "(出库数量)")
|
||||
private Integer quantityDelivered;
|
||||
|
||||
/**
|
||||
* (用途)
|
||||
*/
|
||||
|
||||
@@ -63,4 +63,7 @@ public class ReferenceMaterial extends BaseEntity {
|
||||
@ApiModelProperty(value="试剂耗材(含标准物质)仓库表ID")
|
||||
private String reagentConsumableInventoryId;
|
||||
|
||||
@ApiModelProperty(value="试剂耗材(含标准物质)仓库表ID")
|
||||
private String custodianName;
|
||||
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ public class RequisitionRecord extends BaseEntity {
|
||||
@ApiModelProperty(value="编号")
|
||||
private String number;
|
||||
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package digital.laboratory.platform.reagent.entity;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import digital.laboratory.platform.common.mybatis.base.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -12,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
@TableName(value = "solution_use_form", autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "(标准溶液使用记录表)")
|
||||
public class SolutionUseForm {
|
||||
public class SolutionUseForm extends BaseEntity {
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
@ApiModelProperty(value="标准溶液使用记录表ID")
|
||||
|
||||
+2
-1
@@ -26,6 +26,8 @@ import lombok.EqualsAndHashCode;
|
||||
@ApiModel(value = "(标准物质领用归还登记表)")
|
||||
public class StandardMaterialApplication extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "(标准物质名称)")
|
||||
private String referenceSubstanceName;
|
||||
/**
|
||||
* (标准物质管理员ID)
|
||||
*/
|
||||
@@ -149,5 +151,4 @@ public class StandardMaterialApplication extends BaseEntity {
|
||||
@ApiModelProperty(value="领取码")
|
||||
private String claimCode;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -55,6 +55,9 @@ public class StandardReserveSolution extends BaseEntity {
|
||||
@ApiModelProperty(value="(标准物质ID)")
|
||||
private String referenceMaterialId;
|
||||
|
||||
@ApiModelProperty(value="(标准溶液ID)")
|
||||
private String referenceId;
|
||||
|
||||
/**
|
||||
* (标准物质编号)
|
||||
*/
|
||||
|
||||
@@ -84,6 +84,11 @@ public class WarehousingBatchList extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value="入库人ID")
|
||||
private String depositorId;
|
||||
/**
|
||||
* 签收人ID
|
||||
*/
|
||||
@ApiModelProperty(value = "入库位置")
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 签收内容表ID
|
||||
@@ -105,4 +110,6 @@ public class WarehousingBatchList extends BaseEntity {
|
||||
private String id;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,12 @@ public class WarehousingContent extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value = "(试剂耗材ID)")
|
||||
private String reagentConsumableId;
|
||||
|
||||
/**
|
||||
* (签收状态 0 未完成 1 已完成)
|
||||
*/
|
||||
@ApiModelProperty(value = "(状态)")
|
||||
private Integer status;
|
||||
/**
|
||||
* (试剂耗材ID)
|
||||
*/
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ package digital.laboratory.platform.reagent.mapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm;
|
||||
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -17,7 +18,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface AcceptanceRecordFormMapper extends BaseMapper<AcceptanceRecordForm> {
|
||||
|
||||
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page);
|
||||
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, @Param(Constants.WRAPPER)QueryWrapper<AcceptanceRecordForm> qw);
|
||||
AcceptanceRecordFormVO getAcceptanceRecordFormVO(String acceptanceRecordFormId);
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,7 +1,10 @@
|
||||
package digital.laboratory.platform.reagent.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import digital.laboratory.platform.reagent.entity.CatalogueDetails;
|
||||
import digital.laboratory.platform.reagent.vo.CatalogueDetailsVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -18,5 +21,4 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface CatalogueDetailsMapper extends BaseMapper<CatalogueDetails> {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ public interface CentralizedRequestMapper extends BaseMapper<CentralizedRequest>
|
||||
|
||||
IPage<CentralizedRequestVO> getCentralizedRequestVOPage(@Param("page") IPage<CentralizedRequest> page, @Param(Constants.WRAPPER) QueryWrapper<CentralizedRequest> qw);
|
||||
List<CentralizedRequestVO> getCentralizedRequestVOList(@Param(Constants.WRAPPER) QueryWrapper<CentralizedRequest> qw);
|
||||
List<CentralizedRequestVO> getVOList(@Param(Constants.WRAPPER) QueryWrapper<CentralizedRequest> qw);
|
||||
|
||||
CentralizedRequestVO getCentralizedRequestVO(String id);
|
||||
|
||||
|
||||
+6
@@ -1,7 +1,11 @@
|
||||
package digital.laboratory.platform.reagent.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
|
||||
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -14,4 +18,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface ReagentConsumableInventoryMapper extends BaseMapper<ReagentConsumableInventory> {
|
||||
|
||||
IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryVOPage (IPage<ReagentConsumableInventory>page, @Param(Constants.WRAPPER) QueryWrapper<ReagentConsumableInventory> qw);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import digital.laboratory.platform.reagent.vo.RequisitionRecordVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (试剂耗材领用记录表) Mapper 接口
|
||||
*
|
||||
@@ -19,4 +21,6 @@ public interface RequisitionRecordMapper extends BaseMapper<RequisitionRecord> {
|
||||
|
||||
IPage<RequisitionRecordVO> getRequisitionRecordVOPage (IPage<RequisitionRecord> page, QueryWrapper<RequisitionRecord> qw);
|
||||
|
||||
List<RequisitionRecordVO> getRequisitionRecordVO (String id);
|
||||
|
||||
}
|
||||
|
||||
+8
-3
@@ -11,18 +11,23 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (标准物质领用/归还登记表) Mapper 接口
|
||||
*
|
||||
* @author Zhang Xiaolong created at 2023-03-10
|
||||
* @describe (标准物质领用/归还登记表) Mapper 类
|
||||
* @describe (标准物质领用 / 归还登记表) Mapper 类
|
||||
*/
|
||||
@Mapper
|
||||
public interface StandardMaterialApplicationMapper extends BaseMapper<StandardMaterialApplication> {
|
||||
|
||||
IPage<StandardMaterialApplicationVO> getStandardMaterialApplicationVOPage (IPage<StandardMaterialApplication> page ,@Param(Constants.WRAPPER) QueryWrapper<StandardMaterialApplication> qw);
|
||||
IPage<StandardMaterialApplicationVO> getStandardMaterialApplicationVOPage(IPage<StandardMaterialApplication> page, @Param(Constants.WRAPPER) QueryWrapper<StandardMaterialApplication> qw);
|
||||
|
||||
IPage<StandardMaterialApplicationVO> getStandardMaterialApplicationVOList (IPage<StandardMaterialApplication> page , @Param(Constants.WRAPPER)QueryWrapper<StandardMaterialApplication> qw);
|
||||
IPage<StandardMaterialApplicationVO> getStandardMaterialApplicationVOList(IPage<StandardMaterialApplication> page, @Param(Constants.WRAPPER) QueryWrapper<StandardMaterialApplication> qw);
|
||||
|
||||
|
||||
StandardMaterialApplicationVO getStandardMaterialApplicationVO(String id
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ package digital.laboratory.platform.reagent.mapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm;
|
||||
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -17,7 +18,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface StandardMaterialApprovalFormMapper extends BaseMapper<StandardMaterialApprovalForm> {
|
||||
|
||||
IPage<StandardMaterialApprovalFormVO> getVOPage(IPage<StandardMaterialApprovalForm> page, QueryWrapper<StandardMaterialApprovalForm> qw);
|
||||
IPage<StandardMaterialApprovalFormVO> getVOPage(IPage<StandardMaterialApprovalForm> page, @Param(Constants.WRAPPER) QueryWrapper<StandardMaterialApprovalForm> qw);
|
||||
|
||||
StandardMaterialApprovalFormVO getVO (String id);
|
||||
|
||||
|
||||
+5
-1
@@ -3,11 +3,14 @@ package digital.laboratory.platform.reagent.mapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import digital.laboratory.platform.reagent.entity.StandardSolutionCurve;
|
||||
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (标准工作曲线溶液配置记录表) Mapper 接口
|
||||
*
|
||||
@@ -17,6 +20,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface StandardSolutionCurveMapper extends BaseMapper<StandardSolutionCurve> {
|
||||
|
||||
IPage<StandardSolutionCurveVO> getStandardSolutionCurveVOPage(IPage<StandardSolutionCurve> page, QueryWrapper<StandardSolutionCurve> qw);
|
||||
IPage<StandardSolutionCurveVO> getStandardSolutionCurveVOPage(IPage<StandardSolutionCurve> page, @Param(Constants.WRAPPER) QueryWrapper<StandardSolutionCurve> qw);
|
||||
|
||||
StandardSolutionCurveVO getStandardSolutionCurveVO (String id);
|
||||
}
|
||||
|
||||
+5
-1
@@ -3,9 +3,11 @@ package digital.laboratory.platform.reagent.mapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import digital.laboratory.platform.reagent.entity.WarehousingRecordForm;
|
||||
import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -17,5 +19,7 @@ import java.util.List;
|
||||
*/
|
||||
@Mapper
|
||||
public interface WarehousingRecordFormMapper extends BaseMapper<WarehousingRecordForm> {
|
||||
List <WarehousingRecordFormVO> getWarehousingRecordFormVOList ();
|
||||
IPage <WarehousingRecordFormVO> getWarehousingRecordFormVOPage (IPage<WarehousingRecordForm> page,@Param(Constants.WRAPPER)QueryWrapper <WarehousingRecordForm>qw);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+6
-1
@@ -9,6 +9,9 @@ import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm;
|
||||
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* (验收记录表)服务类
|
||||
*
|
||||
@@ -21,7 +24,7 @@ public interface AcceptanceRecordFormService extends IService<AcceptanceRecordFo
|
||||
|
||||
AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId);
|
||||
|
||||
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page);
|
||||
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, QueryWrapper<AcceptanceRecordForm>qw);
|
||||
|
||||
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVORecordPage(IPage<AcceptanceRecordForm> page);
|
||||
|
||||
@@ -32,4 +35,6 @@ public interface AcceptanceRecordFormService extends IService<AcceptanceRecordFo
|
||||
AcceptanceRecordForm secondaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
|
||||
|
||||
AcceptanceRecordForm threeLevelAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
|
||||
|
||||
void acceptanceRecordFormTablePDF(AcceptanceRecordFormVO acceptanceRecordFormVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import digital.laboratory.platform.reagent.dto.PeriodVerificationPlanDTO;
|
||||
import digital.laboratory.platform.reagent.entity.CheckSchedule;
|
||||
import digital.laboratory.platform.reagent.vo.CheckScheduleVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -30,4 +32,6 @@ public interface CheckScheduleService extends IService<CheckSchedule> {
|
||||
IPage<CheckScheduleVO> getCheckScheduleVOPage (IPage<CheckSchedule> page, QueryWrapper<CheckSchedule> qw);
|
||||
|
||||
CheckScheduleVO getCheckScheduleVO (String checkScheduleId);
|
||||
|
||||
void checkScheduleTablePDF(CheckScheduleVO checkScheduleVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import digital.laboratory.platform.reagent.entity.ComplianceCheck;
|
||||
import digital.laboratory.platform.reagent.vo.ComplianceCheckVO;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -44,4 +46,5 @@ public interface ComplianceCheckService extends IService<ComplianceCheck> {
|
||||
|
||||
//二级审核
|
||||
ComplianceCheck secondaryAuditCheck(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -10,6 +10,9 @@ import digital.laboratory.platform.reagent.entity.PeriodVerificationImplementati
|
||||
import digital.laboratory.platform.reagent.entity.PeriodVerificationPlan;
|
||||
import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* (标准物质期间核查实施情况及结果记录表)服务类
|
||||
*
|
||||
@@ -29,4 +32,6 @@ public interface PeriodVerificationImplementationService extends IService<Period
|
||||
PeriodVerificationImplementation commitById(PeriodVerificationImplementationDTO periodVerificationImplementationDTO, DLPUser dlpUser);
|
||||
|
||||
PeriodVerificationImplementation auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
|
||||
|
||||
void periodVerificationImplementationTablePDF(PeriodVerificationImplementationVO periodVerificationImplementationVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
|
||||
}
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public interface PurchaseCatalogueService extends IService<PurchaseCatalogue> {
|
||||
|
||||
PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId);
|
||||
|
||||
Page getVOpage(String name);
|
||||
List<CatalogueDetails> getList(String name);
|
||||
|
||||
PurchaseCatalogueVO getImport(List<PurchaseCatalogueDTO> purchaseCatalogueDTOList);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public interface PurchaseListService extends IService<PurchaseList> {
|
||||
void editById(List<PurchaseListDTO> purchaseListDTOList);
|
||||
|
||||
//
|
||||
PurchaseList commitById(List<PurchaseListDTO> purchaseListDTOList);
|
||||
PurchaseList commitById(String id);
|
||||
|
||||
PurchaseListDetailsVO addDetails(PurchaseListDTO purchaseListDTO);
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
|
||||
//分页查询试剂耗材
|
||||
Page<ReagentConsumableInventoryFullVO> getAllRM(Integer current, Integer size,String reagentConsumableName);
|
||||
|
||||
Page<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(Page page,String reagentConsumableName);
|
||||
IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(IPage<ReagentConsumableInventory> page,QueryWrapper<ReagentConsumableInventory>qw);
|
||||
|
||||
List<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFull(QueryWrapper<ReagentConsumableInventory> qw);
|
||||
}
|
||||
|
||||
+5
@@ -3,7 +3,10 @@ package digital.laboratory.platform.reagent.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
|
||||
import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -15,4 +18,6 @@ import java.util.List;
|
||||
public interface ReferenceMaterialService extends IService<ReferenceMaterial> {
|
||||
|
||||
List<ReferenceMaterialVO> getReferenceMaterialVOList(String batchDetailsId);
|
||||
|
||||
void standardSolutionCurveTablePDF(List<StandardSolutionCurveVO> voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
|
||||
}
|
||||
|
||||
+8
@@ -7,6 +7,10 @@ import digital.laboratory.platform.reagent.entity.OutgoingContents;
|
||||
import digital.laboratory.platform.reagent.entity.RequisitionRecord;
|
||||
import digital.laboratory.platform.reagent.vo.RequisitionRecordVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (试剂耗材领用记录表)服务类
|
||||
*
|
||||
@@ -18,4 +22,8 @@ public interface RequisitionRecordService extends IService<RequisitionRecord> {
|
||||
RequisitionRecord addRecord(OutgoingContents outgoingContents);
|
||||
|
||||
IPage<RequisitionRecordVO> getRequisitionRecordVOPage(IPage<RequisitionRecord> page, QueryWrapper<RequisitionRecord> qw);
|
||||
|
||||
List<RequisitionRecordVO> getRequisitionRecordVO(String id);
|
||||
|
||||
void rquisitionRecordTablePDF(List<RequisitionRecordVO> voList,String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
|
||||
}
|
||||
|
||||
+12
@@ -2,11 +2,17 @@ package digital.laboratory.platform.reagent.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.reagent.dto.StandardMaterialApplicationDTO;
|
||||
import digital.laboratory.platform.reagent.entity.StandardMaterialApplication;
|
||||
import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (标准物质领用/归还登记表)服务类
|
||||
@@ -22,4 +28,10 @@ public interface StandardMaterialApplicationService extends IService<StandardMat
|
||||
|
||||
//归还记录
|
||||
IPage <StandardMaterialApplicationVO> getList(IPage<StandardMaterialApplication> page, QueryWrapper<StandardMaterialApplication> qw);
|
||||
|
||||
|
||||
abstract void standardMaterialApplicationTablePDF(List<StandardMaterialApplicationVO> voList,String ids, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
|
||||
|
||||
StandardMaterialApplicationVO getStandardMaterialApplicationVO(String id
|
||||
);
|
||||
}
|
||||
|
||||
+5
@@ -9,6 +9,9 @@ import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO;
|
||||
import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm;
|
||||
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* (标准物质停用/报废销毁/恢复/降级使用审批表)服务类
|
||||
*
|
||||
@@ -29,4 +32,6 @@ public interface StandardMaterialApprovalFormService extends IService<StandardMa
|
||||
|
||||
//审批
|
||||
StandardMaterialApprovalForm approveById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
|
||||
|
||||
void standardMaterialApprovalFormTablePDF(StandardMaterialApprovalFormVO standardMaterialApprovalFormVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
|
||||
}
|
||||
|
||||
+3
@@ -10,6 +10,8 @@ import digital.laboratory.platform.reagent.entity.StandardReserveSolution;
|
||||
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -30,4 +32,5 @@ public interface StandardReserveSolutionService extends IService<StandardReserve
|
||||
|
||||
StandardReserveSolutionFullVO getByFullVOId(String id);
|
||||
|
||||
void standardReserveSolutionTablePDF(StandardReserveSolutionVO standardReserveSolutionVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
|
||||
}
|
||||
|
||||
+10
@@ -6,8 +6,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.reagent.dto.StandardSolutionCurveDTO;
|
||||
import digital.laboratory.platform.reagent.entity.StandardSolutionCurve;
|
||||
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (标准工作曲线溶液配置记录表)服务类
|
||||
*
|
||||
@@ -19,4 +24,9 @@ public interface StandardSolutionCurveService extends IService<StandardSolutionC
|
||||
IPage<StandardSolutionCurveVO> getStandardSolutionCurveVOPage(IPage<StandardSolutionCurve> page, QueryWrapper<StandardSolutionCurve> qw);
|
||||
|
||||
StandardSolutionCurve addById(StandardSolutionCurveDTO standardSolutionCurveDTO, DLPUser dlpUser);
|
||||
|
||||
|
||||
void standardSolutionCurveTablePDF(List<StandardSolutionCurveVO> voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
|
||||
|
||||
StandardSolutionCurveVO getStandardSolutionCurveVO(String id);
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
package digital.laboratory.platform.reagent.service;
|
||||
|
||||
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.IService;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
@@ -25,5 +27,5 @@ public interface WarehousingRecordFormService extends IService<WarehousingRecord
|
||||
WarehousingRecordFormVO getWarehousingRecordFormVO (String warehousingFormId);
|
||||
@Transactional
|
||||
WarehousingRecordFormVO addFormById(List<WarehousingRecordFormDTO> warehousingRecordFormDTOList, DLPUser dlpUser);
|
||||
Page<WarehousingRecordFormVO> getWarehousingRecordFormVOList(Page page);
|
||||
IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm>qw);
|
||||
}
|
||||
|
||||
+178
-21
@@ -1,11 +1,20 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.config.ConfigureBuilder;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.config.PageUtils;
|
||||
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormDTO;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
@@ -16,12 +25,19 @@ import digital.laboratory.platform.reagent.service.AcceptanceRecordFormService;
|
||||
import digital.laboratory.platform.reagent.service.BlacklistService;
|
||||
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
|
||||
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -43,12 +59,18 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
|
||||
@Autowired
|
||||
private ReagentConsumablesService reagentConsumablesService;
|
||||
|
||||
@Autowired
|
||||
private OssFile ossFile;
|
||||
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
@Override
|
||||
public AcceptanceRecordForm commitForm(AcceptanceRecordFormDTO acceptanceRecordFormDTO,DLPUser dlpUser) {
|
||||
public AcceptanceRecordForm commitForm(AcceptanceRecordFormDTO acceptanceRecordFormDTO, DLPUser dlpUser) {
|
||||
|
||||
AcceptanceRecordForm byId = acceptanceRecordFormService.getById(acceptanceRecordFormDTO.getAcceptanceRecordFormId());
|
||||
|
||||
if (byId.getStatus()!=0){
|
||||
if (byId.getStatus() != 0) {
|
||||
throw new RuntimeException(String.format("当前状态不能提交"));
|
||||
}
|
||||
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId);
|
||||
@@ -58,6 +80,8 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
|
||||
byId.setCommitTime(LocalDateTime.now());
|
||||
|
||||
byId.setStatus(1);
|
||||
|
||||
byId.setDateOfAcceptance(LocalDateTime.now());
|
||||
if (acceptanceRecordFormService.updateById(byId)) {
|
||||
return byId;
|
||||
} else {
|
||||
@@ -76,6 +100,10 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
|
||||
|
||||
acceptanceRecordForm.setReagentConsumableId(reagentConsumableId);
|
||||
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(reagentConsumableId);
|
||||
//将物品名称赋值给验收记录表
|
||||
acceptanceRecordForm.setReagentConsumableName(byId.getReagentConsumableName());
|
||||
|
||||
acceptanceRecordForm.setStatus(0);
|
||||
|
||||
if ((acceptanceRecordFormService.save(acceptanceRecordForm))) {
|
||||
@@ -86,9 +114,9 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page) {
|
||||
public IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, QueryWrapper<AcceptanceRecordForm>qw) {
|
||||
|
||||
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = baseMapper.getAcceptanceRecordFormVOPage(page);
|
||||
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = baseMapper.getAcceptanceRecordFormVOPage(page,qw);
|
||||
|
||||
List<AcceptanceRecordFormVO> records = acceptanceRecordFormVOPage.getRecords();
|
||||
|
||||
@@ -107,20 +135,21 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
|
||||
|
||||
LambdaQueryWrapper<AcceptanceRecordForm> acceptanceRecordFormLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
acceptanceRecordFormLambdaQueryWrapper.eq(AcceptanceRecordForm::getStatus,4);
|
||||
acceptanceRecordFormLambdaQueryWrapper.eq(AcceptanceRecordForm::getStatus, 4);
|
||||
|
||||
List<AcceptanceRecordForm> list = acceptanceRecordFormService.list(acceptanceRecordFormLambdaQueryWrapper);
|
||||
|
||||
ArrayList<AcceptanceRecordFormVO> acceptanceRecordFormVOS = new ArrayList<>();
|
||||
|
||||
if (list.size()!=0){
|
||||
if (list.size() != 0) {
|
||||
|
||||
for (AcceptanceRecordForm acceptanceRecordForm : list) {
|
||||
for (AcceptanceRecordForm acceptanceRecordForm : list) {
|
||||
|
||||
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
|
||||
AcceptanceRecordFormVO acceptanceRecordFormVO = acceptanceRecordFormService.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
|
||||
|
||||
acceptanceRecordFormVOS.add(acceptanceRecordFormVO);
|
||||
}}
|
||||
acceptanceRecordFormVOS.add(acceptanceRecordFormVO);
|
||||
}
|
||||
}
|
||||
PageUtils pageUtils = new PageUtils();
|
||||
|
||||
Page pages = pageUtils.getPages((int) page.getPages(), (int) page.getSize(), acceptanceRecordFormVOS);
|
||||
@@ -145,7 +174,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
|
||||
|
||||
AcceptanceRecordForm byId = acceptanceRecordFormService.getById(auditAndApproveDTO.getUuId());
|
||||
|
||||
if (byId.getStatus()!=1){
|
||||
if (byId.getStatus() != 1) {
|
||||
throw new RuntimeException(String.format("当前状态不能审核"));
|
||||
}
|
||||
byId.setPrimaryAuditorId(dlpUser.getId());
|
||||
@@ -153,21 +182,22 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
|
||||
byId.setAuditTimeOfPrimary(LocalDateTime.now());
|
||||
byId.setAuditResultOfPrimary(auditAndApproveDTO.getAuditResult());
|
||||
|
||||
if (auditAndApproveDTO.getAuditResult()==true){
|
||||
if (auditAndApproveDTO.getAuditResult() == true) {
|
||||
byId.setStatus(2);
|
||||
}else byId.setStatus(-2);
|
||||
} else byId.setStatus(-2);
|
||||
|
||||
|
||||
if (acceptanceRecordFormService.updateById(byId)) {
|
||||
return byId;
|
||||
} else throw new RuntimeException(String.format("审核失败"));
|
||||
}
|
||||
|
||||
@Override//二级审核
|
||||
public AcceptanceRecordForm secondaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
|
||||
|
||||
AcceptanceRecordForm byId = acceptanceRecordFormService.getById(auditAndApproveDTO.getUuId());
|
||||
|
||||
if (byId.getStatus()!=2){
|
||||
if (byId.getStatus() != 2) {
|
||||
throw new RuntimeException(String.format("当前状态不能审核"));
|
||||
}
|
||||
byId.setSecondaryAuditorId(dlpUser.getId());
|
||||
@@ -175,20 +205,21 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
|
||||
byId.setAuditTimeOfSecondary(LocalDateTime.now());
|
||||
byId.setAuditResultOfSecondary(auditAndApproveDTO.getAuditResult());
|
||||
|
||||
if (auditAndApproveDTO.getAuditResult()==true){
|
||||
if (auditAndApproveDTO.getAuditResult() == true) {
|
||||
byId.setStatus(3);
|
||||
}else byId.setStatus(-3);
|
||||
} else byId.setStatus(-3);
|
||||
|
||||
if (acceptanceRecordFormService.updateById(byId)) {
|
||||
return byId;
|
||||
} else throw new RuntimeException(String.format("审核失败"));
|
||||
}
|
||||
|
||||
@Override//三级审核
|
||||
public AcceptanceRecordForm threeLevelAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
|
||||
|
||||
AcceptanceRecordForm byId = acceptanceRecordFormService.getById(auditAndApproveDTO.getUuId());
|
||||
|
||||
if (byId.getStatus()!=3){
|
||||
if (byId.getStatus() != 3) {
|
||||
throw new RuntimeException(String.format("当前状态不能审核"));
|
||||
}
|
||||
byId.setThreeLevelAuditorId(dlpUser.getId());
|
||||
@@ -196,19 +227,145 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
|
||||
byId.setAuditTimeOfThreeLevel(LocalDateTime.now());
|
||||
byId.setAuditResultOfThreeLevel(auditAndApproveDTO.getAuditResult());
|
||||
|
||||
if (auditAndApproveDTO.getAuditResult()==true){
|
||||
if (auditAndApproveDTO.getAuditResult() == true) {
|
||||
|
||||
if (byId.getNonconformingItem()!=null){
|
||||
if (byId.getNonconformingItem() != null) {
|
||||
|
||||
blacklistService.addListById2(byId.getReagentConsumableId(),byId.getSupplierId());
|
||||
blacklistService.addListById2(byId.getReagentConsumableId(), byId.getSupplierId());
|
||||
}
|
||||
byId.setStatus(4);
|
||||
}else byId.setStatus(-4);
|
||||
} else byId.setStatus(-4);
|
||||
|
||||
if (acceptanceRecordFormService.updateById(byId)) {
|
||||
return byId;
|
||||
} else throw new RuntimeException(String.format("审核失败"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acceptanceRecordFormTablePDF(AcceptanceRecordFormVO acceptanceRecordFormVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
System.out.println("acceptanceRecordFormTablePDF.................");
|
||||
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(acceptanceRecordFormVO.getReagentConsumableId());
|
||||
|
||||
if (acceptanceRecordFormVO.getTheSameBrandAndModel().equals("合格")) {
|
||||
acceptanceRecordFormVO.setTheSameBrandAndModelPrint(true);
|
||||
} else {
|
||||
acceptanceRecordFormVO.setTheSameBrandAndModelPrint(false);
|
||||
|
||||
}
|
||||
if (acceptanceRecordFormVO.getConsistentQuantity().equals("合格")) {
|
||||
acceptanceRecordFormVO.setConsistentQuantityPrint(true);
|
||||
} else {
|
||||
acceptanceRecordFormVO.setConsistentQuantityPrint(false);
|
||||
|
||||
}
|
||||
if (acceptanceRecordFormVO.getPackingInGoodCondition().equals("合格")) {
|
||||
acceptanceRecordFormVO.setPackingInGoodConditionPrint(true);
|
||||
} else {
|
||||
acceptanceRecordFormVO.setPackingInGoodConditionPrint(false);
|
||||
}
|
||||
if (acceptanceRecordFormVO.getValidityPeriod().equals("合格")) {
|
||||
acceptanceRecordFormVO.setValidityPeriodPrint(true);
|
||||
} else {
|
||||
acceptanceRecordFormVO.setValidityPeriodPrint(false);
|
||||
}
|
||||
if (acceptanceRecordFormVO.getDeliveryCycle().equals("合格")) {
|
||||
acceptanceRecordFormVO.setDeliveryCyclePrint(true);
|
||||
} else {
|
||||
acceptanceRecordFormVO.setDeliveryCyclePrint(false);
|
||||
}
|
||||
|
||||
String id = acceptanceRecordFormVO.getId();
|
||||
|
||||
String applyFileName = null;
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
if (byId.getCategory().equals("试剂") | byId.getCategory().equals("耗材")) {
|
||||
|
||||
ossFile.fileGet("template" + "/" + "试剂耗材验收记录表模板.docx", bos);
|
||||
|
||||
applyFileName = "试剂耗材验收记录表" + id;
|
||||
} else {
|
||||
|
||||
ossFile.fileGet("template" + "/" + "标准物质验收记录表模板.docx", bos);
|
||||
|
||||
applyFileName = "标准物质验收记录表" + id;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------
|
||||
// 生成 word 版本的 验收记录表
|
||||
|
||||
byte[] templateArray = bos.toByteArray();
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
bos.close();
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
|
||||
/**
|
||||
* 循环表格
|
||||
*/
|
||||
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
|
||||
new HashMap<String, Object>() {{
|
||||
put("theSameBrandAndModelPrint", acceptanceRecordFormVO.getTheSameBrandAndModelPrint());
|
||||
put("reagentConsumableName", acceptanceRecordFormVO.getReagentConsumableName());
|
||||
put("dateOfAcceptance", LocalDateTimeUtil.format(acceptanceRecordFormVO.getDateOfAcceptance(),"yyyy年MM月dd日"));
|
||||
put("supplierName",acceptanceRecordFormVO.getSupplierName());
|
||||
put("consistentQuantityPrint",acceptanceRecordFormVO.getConsistentQuantityPrint());
|
||||
put("packingInGoodConditionPrint",acceptanceRecordFormVO.getPackingInGoodConditionPrint());
|
||||
put("validityPeriodPrint",acceptanceRecordFormVO.getValidityPeriodPrint());
|
||||
put("deliveryCyclePrint",acceptanceRecordFormVO.getDeliveryCyclePrint());
|
||||
put("nonconformingItem",acceptanceRecordFormVO.getNonconformingItem());
|
||||
put("followUpTreatment",acceptanceRecordFormVO.getFollowUpTreatment());
|
||||
put("acceptanceConclusion",acceptanceRecordFormVO.getAcceptanceConclusion());
|
||||
put("secondaryAuditorName",acceptanceRecordFormVO.getSecondaryAuditorName());
|
||||
put("auditOpinionOfSecondary",acceptanceRecordFormVO.getAuditOpinionOfSecondary());
|
||||
put("auditTimeOfSecondary",LocalDateTimeUtil.format(acceptanceRecordFormVO.getAuditTimeOfSecondary(),"yyyy年MM月dd日"));
|
||||
put("threeLevelAuditorName",acceptanceRecordFormVO.getThreeLevelAuditorName());
|
||||
put("auditOpinionOfThreeLevel",acceptanceRecordFormVO.getAuditOpinionOfThreeLevel());
|
||||
put("auditTimeOfThreeLevel",LocalDateTimeUtil.format(acceptanceRecordFormVO.getAuditTimeOfThreeLevel(),"yyyy年MM月dd日"));
|
||||
put("id",acceptanceRecordFormVO.getId());
|
||||
put("size",1);
|
||||
put("bam_remarks",acceptanceRecordFormVO.getBam_remarks());
|
||||
put("cq_remarks",acceptanceRecordFormVO.getCq_remarks());
|
||||
put("pgc_remarks",acceptanceRecordFormVO.getPgc_remarks());
|
||||
put("vp_remarks",acceptanceRecordFormVO.getVp_remarks());
|
||||
put("dc_remarks",acceptanceRecordFormVO.getDc_remarks());
|
||||
put("primaryAuditorName",acceptanceRecordFormVO.getPrimaryAuditorName());
|
||||
put("auditOpinionOfPrimary",acceptanceRecordFormVO.getAuditOpinionOfPrimary());
|
||||
put("auditTimeOfPrimary",LocalDateTimeUtil.format(acceptanceRecordFormVO.getAuditTimeOfPrimary(),"yyyy年MM月dd日"));
|
||||
}}
|
||||
);
|
||||
bis.close();
|
||||
|
||||
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
template.write(fosWord);
|
||||
template.close();
|
||||
|
||||
//------------
|
||||
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
fosWord.close();
|
||||
|
||||
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
fisWord.close();
|
||||
|
||||
|
||||
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave("document" + "/" + "acceptanceRecordForm" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println(String.format("转换为 PDF 结束"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+8
-12
@@ -194,20 +194,15 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
|
||||
@Override
|
||||
public List<CentralizedRequestVO> getVOList(QueryWrapper<CentralizedRequest> qw) {
|
||||
|
||||
LambdaQueryWrapper<CentralizedRequest> centralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
//查询状态为1的采购申请:已提交
|
||||
centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus,2);
|
||||
List<CentralizedRequestVO> centralizedRequestVOArrayList = baseMapper.getVOList(qw);
|
||||
|
||||
List<CentralizedRequest> list = centralizedRequestService.list(centralizedRequestLambdaQueryWrapper);
|
||||
for (CentralizedRequestVO centralizedRequestVO : centralizedRequestVOArrayList) {
|
||||
|
||||
ArrayList<CentralizedRequestVO> centralizedRequestVOArrayList = new ArrayList<>();
|
||||
List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId());
|
||||
|
||||
for (CentralizedRequest centralizedRequest : list) {
|
||||
CentralizedRequestVO centralizedRequestVO = new CentralizedRequestVO();
|
||||
BeanUtils.copyProperties(centralizedRequest,centralizedRequestVO);
|
||||
centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId()));
|
||||
centralizedRequestVOArrayList.add(centralizedRequestVO);
|
||||
centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedVOList);
|
||||
}
|
||||
|
||||
return centralizedRequestVOArrayList;
|
||||
}
|
||||
|
||||
@@ -221,9 +216,10 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
|
||||
byId.setAuditOpinion(auditAndApproveDTO.getAuditOpinion());
|
||||
byId.setAuditResult(auditAndApproveDTO.getAuditResult());
|
||||
|
||||
if (auditAndApproveDTO.getApproveResult()==true){
|
||||
if (auditAndApproveDTO.getAuditResult()==true){
|
||||
byId.setStatus(2);
|
||||
}byId.setStatus(-2);
|
||||
}
|
||||
else {byId.setStatus(-2);}
|
||||
if (centralizedRequestService.updateById(byId)){
|
||||
return byId;
|
||||
}else throw new RuntimeException(String.format("审核失败"));
|
||||
|
||||
+104
-1
@@ -1,11 +1,19 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.config.ConfigureBuilder;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.dto.PeriodVerificationPlanDTO;
|
||||
import digital.laboratory.platform.reagent.entity.CheckSchedule;
|
||||
@@ -16,14 +24,20 @@ import digital.laboratory.platform.reagent.service.PeriodVerificationImplementat
|
||||
import digital.laboratory.platform.reagent.service.PeriodVerificationPlanService;
|
||||
import digital.laboratory.platform.reagent.vo.CheckScheduleVO;
|
||||
import digital.laboratory.platform.reagent.vo.PeriodVerificationPlanVO;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -33,6 +47,7 @@ import java.util.List;
|
||||
* @describe 服务实现类
|
||||
*/
|
||||
@Service
|
||||
@SuppressWarnings("all")
|
||||
public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, CheckSchedule> implements CheckScheduleService {
|
||||
|
||||
@Autowired
|
||||
@@ -40,6 +55,12 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
|
||||
|
||||
@Autowired
|
||||
private CheckScheduleService checkScheduleService;
|
||||
|
||||
@Autowired
|
||||
private OssFile ossFile;
|
||||
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
@Autowired
|
||||
private PeriodVerificationPlanService periodVerificationPlanService;
|
||||
|
||||
@@ -195,7 +216,89 @@ public class CheckScheduleServiceImpl extends ServiceImpl<CheckScheduleMapper, C
|
||||
|
||||
return checkScheduleVO;
|
||||
}
|
||||
@Override
|
||||
public void checkScheduleTablePDF(CheckScheduleVO checkScheduleVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
System.out.println("checkScheduleTablePDF.................");
|
||||
|
||||
String id = checkScheduleVO.getId();
|
||||
|
||||
List<PeriodVerificationPlanVO> voList = checkScheduleVO.getPeriodVerificationPlanVOS();
|
||||
int x= 1;
|
||||
for (PeriodVerificationPlanVO periodVerificationPlanVO : voList) {
|
||||
|
||||
periodVerificationPlanVO.setI(x);
|
||||
|
||||
if (periodVerificationPlanVO.getVerificationResult().equals("P")){
|
||||
periodVerificationPlanVO.setP("P");
|
||||
}else if (periodVerificationPlanVO.getVerificationResult().equals("D")){
|
||||
periodVerificationPlanVO.setD("D");
|
||||
}else if (periodVerificationPlanVO.getVerificationResult().equals("F")){
|
||||
periodVerificationPlanVO.setF("F");
|
||||
}
|
||||
x++;
|
||||
}
|
||||
|
||||
String applyFileName = "标准物质期间核查计划和确认表" + id;
|
||||
//-----------------------------
|
||||
// 生成 word 版本的 验收记录表
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
|
||||
ossFile.fileGet("template" + "/" + "标准物质期间核查计划和确认表模板.docx", bos);
|
||||
|
||||
byte[] templateArray = bos.toByteArray();
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
|
||||
bos.close();
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
|
||||
|
||||
builder.bind("voList",policy).build();
|
||||
|
||||
/**
|
||||
* 循环表格
|
||||
*/
|
||||
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
|
||||
new HashMap<String, Object>() {{
|
||||
put("voList",voList);
|
||||
put("id",id);
|
||||
put("size",1);
|
||||
put("managerName",checkScheduleVO.getManagerName());
|
||||
put("technicalDirectorName",checkScheduleVO.getTechnicalDirectorName());
|
||||
put("auditTimeOfTechnical", LocalDateTimeUtil.format(checkScheduleVO.getAuditTimeOfTechnical(),"yyyy年MM月dd日"));
|
||||
|
||||
}}
|
||||
);
|
||||
bis.close();
|
||||
|
||||
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
template.write(fosWord);
|
||||
template.close();
|
||||
|
||||
//------------
|
||||
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
fosWord.close();
|
||||
|
||||
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
fisWord.close();
|
||||
|
||||
|
||||
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave("document" + "/" + "checkSchedule" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println(String.format("转换为 PDF 结束"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+26
-1
@@ -1,24 +1,38 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.dto.ComplianceCheckDTO;
|
||||
import digital.laboratory.platform.reagent.entity.*;
|
||||
import digital.laboratory.platform.reagent.mapper.ComplianceCheckMapper;
|
||||
import digital.laboratory.platform.reagent.service.*;
|
||||
import digital.laboratory.platform.reagent.vo.ComplianceCheckVO;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -40,6 +54,10 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
|
||||
|
||||
@Autowired
|
||||
private BlacklistService blacklistService;
|
||||
@Autowired
|
||||
|
||||
private OssFile ossFile;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ReagentConsumablesService reagentConsumablesService;
|
||||
@@ -100,6 +118,8 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
|
||||
|
||||
BeanUtils.copyProperties(complianceCheckDTO, complianceCheck);
|
||||
|
||||
complianceCheck.setReagentConsumableName(reagentConsumablesService.getById(complianceCheckDTO.getReagentConsumableId()).getReagentConsumableName());
|
||||
|
||||
complianceCheck.setStatus(-1);
|
||||
|
||||
if (complianceCheckService.save(complianceCheck)) {
|
||||
@@ -118,6 +138,8 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
|
||||
|
||||
ComplianceCheck complianceCheck = complianceCheckService.addCheck(complianceCheckDTO, dlpUser);
|
||||
|
||||
complianceCheck.setReagentConsumableName(reagentConsumablesService.getById(complianceCheckDTO.getReagentConsumableId()).getReagentConsumableName());
|
||||
|
||||
complianceChecks.add(complianceCheck);
|
||||
}
|
||||
if (complianceChecks != null) {
|
||||
@@ -181,9 +203,10 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
|
||||
|
||||
String nonconformingItem = complianceCheckDTO.getNonconformingItem();
|
||||
|
||||
byId.setInspectionScheme(complianceCheckDTO.getInspectionScheme());
|
||||
byId.setExaminationConclusion(complianceCheckDTO.getExaminationConclusion());
|
||||
byId.setNonconformingItem(nonconformingItem);
|
||||
|
||||
byId.setDateOfInspection(LocalDateTime.now());
|
||||
byId.setCommitTime(LocalDateTime.now());
|
||||
|
||||
if (nonconformingItem != null) {
|
||||
@@ -261,4 +284,6 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+22
-19
@@ -46,6 +46,9 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
|
||||
@Autowired
|
||||
private PurchaseListService purchaseListService;
|
||||
|
||||
@Autowired
|
||||
private PurchaseListDetailsService purchaseListDetailsService;
|
||||
|
||||
@Override//分散采购申请分页
|
||||
public IPage<DecentralizedRequestVO> getDecentralizedRequestVOPage
|
||||
(@Param("page") IPage<DecentralizedRequest> page, @Param(Constants.WRAPPER) QueryWrapper<DecentralizedRequest> qw) {
|
||||
@@ -85,8 +88,6 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
|
||||
|
||||
decentralizedRequest.setApplicantId(dlpUser.getId());
|
||||
|
||||
decentralizedRequest.setDateOfApplication(LocalDateTime.now());
|
||||
|
||||
decentralizedRequest.setStatus(0);
|
||||
|
||||
List<DecentralizeDetails> list = new ArrayList<>();
|
||||
@@ -162,6 +163,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
|
||||
decentralizedRequest.setStatus(1);
|
||||
|
||||
decentralizedRequest.setCommitTime(LocalDateTime.now());
|
||||
decentralizedRequest.setDateOfApplication(LocalDateTime.now());
|
||||
|
||||
if (decentralizedRequestService.updateById(decentralizedRequest)) {
|
||||
return decentralizedRequest;
|
||||
@@ -186,8 +188,8 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
|
||||
|
||||
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
if (byId.getStatus()!=1){
|
||||
throw new RuntimeException(String.format("当前状态不能审核"));
|
||||
if (byId.getStatus() != 1) {
|
||||
throw new RuntimeException(String.format("当前状态不能审核"));
|
||||
}
|
||||
|
||||
byId.setPrimaryAuditorId(dlpUser.getId());
|
||||
@@ -216,7 +218,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
|
||||
|
||||
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
if (byId.getStatus()!=2){
|
||||
if (byId.getStatus() != 2) {
|
||||
throw new RuntimeException(String.format("当前状态不能审核"));
|
||||
}
|
||||
|
||||
@@ -245,7 +247,7 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
|
||||
|
||||
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDTO.getUuId());
|
||||
|
||||
if (byId.getStatus()!=3){
|
||||
if (byId.getStatus() != 3) {
|
||||
throw new RuntimeException(String.format("当前状态不能审核"));
|
||||
}
|
||||
|
||||
@@ -274,16 +276,16 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
|
||||
|
||||
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
if (byId.getStatus()!=4){
|
||||
if (byId.getStatus() != 4) {
|
||||
throw new RuntimeException(String.format("当前状态不能审批"));
|
||||
}
|
||||
byId.setApproverId(dlpUser.getId());
|
||||
byId.setApproverId(dlpUser.getId());
|
||||
|
||||
byId.setResultOfApproval(auditAndApproveDto.getApproveResult());
|
||||
byId.setResultOfApproval(auditAndApproveDto.getApproveResult());
|
||||
|
||||
byId.setOpinionOfApproval(auditAndApproveDto.getApproveOpinion());
|
||||
byId.setOpinionOfApproval(auditAndApproveDto.getApproveOpinion());
|
||||
|
||||
byId.setApprovalOfTime(LocalDateTime.now());
|
||||
byId.setApprovalOfTime(LocalDateTime.now());
|
||||
|
||||
if (auditAndApproveDto.getApproveResult() == true) {
|
||||
//创建采购清单
|
||||
@@ -293,8 +295,6 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
|
||||
|
||||
List<DecentralizeDetails> list = decentralizeDetailsService.list(decentralizeDetailsLambdaQueryWrapper1);
|
||||
|
||||
PurchaseListDTO purchaseListDTO = new PurchaseListDTO();
|
||||
|
||||
PurchaseList purchaseList = new PurchaseList();
|
||||
purchaseList.setId(IdWorker.get32UUID().toUpperCase());
|
||||
purchaseList.setName(DateTime.now() + "采购清单");
|
||||
@@ -305,14 +305,17 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRe
|
||||
|
||||
for (DecentralizeDetails decentralizeDetails : list) {
|
||||
|
||||
purchaseListDTO.setReagentConsumableId(decentralizeDetails.getReagentConsumableId());
|
||||
purchaseListDTO.setPurchaseQuantity(decentralizeDetails.getQuantity());
|
||||
purchaseListDTO.setPurchaseListId(purchaseList.getId());
|
||||
PurchaseListDetails purchaseListDetails = new PurchaseListDetails();
|
||||
purchaseListDetails.setId(IdWorker.get32UUID().toUpperCase());
|
||||
purchaseListDetails.setReagentConsumableId(decentralizeDetails.getReagentConsumableId());
|
||||
purchaseListDetails.setPurchaseListId(purchaseList.getId());
|
||||
purchaseListDetails.setPurchaseQuantity(decentralizeDetails.getQuantity());
|
||||
|
||||
purchaseListDetailsService.save(purchaseListDetails);
|
||||
decentralizeDetails.setPurchaseListDetailsId(purchaseListDetails.getId());
|
||||
decentralizeDetailsService.updateById(decentralizeDetails);
|
||||
|
||||
purchaseListService.addDetails(purchaseListDTO);
|
||||
}
|
||||
|
||||
|
||||
if (byId.getResultOfApproval() == true) {
|
||||
//如果未购入过该物品,则将该物品信息更新至试剂耗材类
|
||||
LambdaQueryWrapper<DecentralizeDetails> decentralizeDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
+36
-1
@@ -15,6 +15,7 @@ import digital.laboratory.platform.reagent.mapper.DeliveryRegistrationFormMapper
|
||||
import digital.laboratory.platform.reagent.service.*;
|
||||
import digital.laboratory.platform.reagent.vo.DeliveryRegistrationFormVO;
|
||||
import digital.laboratory.platform.reagent.vo.OutgoingContentsVO;
|
||||
import digital.laboratory.platform.reagent.vo.ReagentConsumablesSetVO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -70,6 +71,9 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
@Autowired
|
||||
private BatchDetailsService batchDetailsService;
|
||||
|
||||
@Autowired
|
||||
private StandardReserveSolutionService standardReserveSolutionService;
|
||||
|
||||
@Override
|
||||
@Transactional//创建出库任务
|
||||
public DeliveryRegistrationForm addFrom(String applicationForUseId) {
|
||||
@@ -136,6 +140,10 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
outgoingContents.setLatticeId(byId1.getLatticeId());
|
||||
outgoingContentsList.add(outgoingContents);
|
||||
}
|
||||
reagentConsumablesSet.setOutgoingContentId(outgoingContents.getId());
|
||||
|
||||
reagentConsumablesSetService.updateById(reagentConsumablesSet);
|
||||
|
||||
|
||||
}
|
||||
if (deliveryRegistrationFormService.save(deliveryRegistrationForm) && outgoingContentsService.saveBatch(outgoingContentsList) &
|
||||
@@ -178,6 +186,13 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
applicationForUseService.updateById(one);
|
||||
|
||||
for (OutgoingContentsDTO outgoingContentsDTO : outgoingContentsDTOS) {
|
||||
//传入出库数量,区分出库数量与领用数量
|
||||
ReagentConsumablesSet reagentConsumablesSet = reagentConsumablesSetService.getOne(Wrappers.<ReagentConsumablesSet>query().
|
||||
eq("outgoing_content_id", outgoingContentsDTO.getId()));
|
||||
|
||||
reagentConsumablesSet.setQuantityDelivered(outgoingContentsDTO.getQuantity());
|
||||
|
||||
reagentConsumablesSetService.updateById(reagentConsumablesSet);
|
||||
|
||||
OutgoingContents outgoingContents = new OutgoingContents();
|
||||
|
||||
@@ -211,6 +226,8 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber());
|
||||
standardMaterialApplications.add(standardMaterialApplication);
|
||||
standardMaterialApplication.setIsReturn(outgoingContentsDTO.getOutboundUse());
|
||||
standardMaterialApplication.setDeliveryRegistrationFormId(byId.getId());
|
||||
standardMaterialApplication.setReferenceSubstanceName(reagentConsumables.getReagentConsumableName());
|
||||
if (outgoingContentsDTO.getOutboundUse() == 2) {
|
||||
standardMaterialApplication.setStatus(-1);
|
||||
standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString());
|
||||
@@ -221,6 +238,8 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
|
||||
byId1.setStatus(-3);
|
||||
|
||||
referenceMaterialService.updateById(byId1);
|
||||
|
||||
BatchDetails batchDetails = batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId());
|
||||
|
||||
if (batchDetails!=null){
|
||||
@@ -244,6 +263,9 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
}
|
||||
|
||||
} else if (reagentConsumables.getCategory().equals("标准储备溶液") ) {
|
||||
|
||||
StandardReserveSolution reference_id = standardReserveSolutionService.getOne(Wrappers.<StandardReserveSolution>query().eq("reference_id", outgoingContentsDTO.getReferenceMaterialId()));
|
||||
|
||||
//创建标准物质领用/归还登记表
|
||||
StandardMaterialApplication standardMaterialApplication = new StandardMaterialApplication();
|
||||
standardMaterialApplication.setReferenceMaterialNumber(outgoingContentsDTO.getNumber());
|
||||
@@ -256,6 +278,10 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
standardMaterialApplication.setRequisitionedQuantity(outgoingContents.getQuantity());
|
||||
standardMaterialApplication.setSpecification(reagentConsumables.getSpecificationAndModel());
|
||||
standardMaterialApplication.setApplicationForUseId(one.getId());
|
||||
standardMaterialApplication.setDeliveryRegistrationFormId(byId.getId());
|
||||
standardMaterialApplication.setReferenceSubstanceName(reference_id.getSolutionName());
|
||||
|
||||
|
||||
if (outgoingContentsDTO.getOutboundUse() == 2) {
|
||||
standardMaterialApplication.setPurposeAndQuantity(outgoingContents.getQuantity().toString());
|
||||
standardMaterialApplication.setStatus(1);
|
||||
@@ -265,8 +291,12 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
standardMaterialApplication.setAdministratorId(dlpUser.getId());
|
||||
standardMaterialApplication.setReferenceMaterialId(outgoingContentsDTO.getReferenceMaterialId());
|
||||
standardMaterialApplications.add(standardMaterialApplication);
|
||||
//录入标准储备溶液使用记录
|
||||
SolutionUseForm solutionUseForm = solutionUseFormService.useById(outgoingContentsDTO.getNumber(), dlpUser);
|
||||
|
||||
solutionUseFormService.useById(outgoingContentsDTO.getNumber(), dlpUser);
|
||||
solutionUseForm.setStandardMaterialApplicationId(standardMaterialApplication.getStandardMaterialApplicationId());
|
||||
|
||||
solutionUseFormService.updateById(solutionUseForm);
|
||||
//通过标准物质ID,查找出对应的仓库信息,将库存量减少
|
||||
String referenceMaterialId = outgoingContentsDTO.getReferenceMaterialId();
|
||||
|
||||
@@ -274,6 +304,8 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
|
||||
referenceMaterial.setStatus(-3);
|
||||
|
||||
referenceMaterialService.updateById(referenceMaterial);
|
||||
|
||||
ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId());
|
||||
|
||||
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() - outgoingContentsDTO.getQuantity());
|
||||
@@ -312,6 +344,8 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
|
||||
requisitionRecord.setDateOfClaim(LocalDateTime.now());
|
||||
requisitionRecord.setRecipientId(one.getRecipientId());
|
||||
requisitionRecord.setId(byId.getId());
|
||||
|
||||
|
||||
requisitionRecordService.updateById(requisitionRecord);
|
||||
//查找出对应的仓库信息,将库存量减少
|
||||
@@ -329,6 +363,7 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl<DeliveryReg
|
||||
complianceCheckDTO.setSpecificationAndModel(reagentConsumables.getSpecificationAndModel());
|
||||
complianceCheckDTO.setComplianceCheckId(IdWorker.get32UUID().toUpperCase());
|
||||
complianceCheckDTO.setReagentConsumableNumber(outgoingContentsDTO.getNumber());
|
||||
complianceCheckDTO.setBatchDetailsId(batchDetailsService.getById(outgoingContentsDTO.getBatchDetailsId()).getBatchDetailsId());
|
||||
complianceCheckService.addCheck(complianceCheckDTO, dlpUser);
|
||||
}
|
||||
outgoingContentsList.add(outgoingContents);
|
||||
|
||||
+11
-2
@@ -6,9 +6,11 @@ import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.entity.InstructionBook;
|
||||
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
|
||||
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
|
||||
import digital.laboratory.platform.reagent.mapper.InstructionBookMapper;
|
||||
import digital.laboratory.platform.reagent.service.InstructionBookService;
|
||||
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
|
||||
import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
|
||||
import digital.laboratory.platform.reagent.vo.InstructionBookVO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -30,6 +32,9 @@ public class InstructionBookServiceImpl extends ServiceImpl<InstructionBookMappe
|
||||
|
||||
@Autowired
|
||||
private ReagentConsumablesService reagentConsumablesService;
|
||||
|
||||
@Autowired
|
||||
private ReferenceMaterialService referenceMaterialService;
|
||||
@Override
|
||||
public InstructionBook auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser){
|
||||
|
||||
@@ -64,9 +69,13 @@ public class InstructionBookServiceImpl extends ServiceImpl<InstructionBookMappe
|
||||
|
||||
InstructionBookVO instructionBookVO = new InstructionBookVO();
|
||||
|
||||
BeanUtils.copyProperties(one,instructionBookVO);
|
||||
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(instructionBookVO.getReferenceMaterialTypeId());
|
||||
if (one!=null){
|
||||
|
||||
BeanUtils.copyProperties(one,instructionBookVO);
|
||||
|
||||
}
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(id);
|
||||
|
||||
instructionBookVO.setReagentConsumables(byId);
|
||||
|
||||
|
||||
+120
-13
@@ -1,11 +1,19 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.config.ConfigureBuilder;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.dto.PeriodVerificationImplementationDTO;
|
||||
import digital.laboratory.platform.reagent.entity.PeriodVerificationImplementation;
|
||||
@@ -18,12 +26,19 @@ import digital.laboratory.platform.reagent.service.PeriodVerificationPlanService
|
||||
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
|
||||
import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
|
||||
import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* (标准物质期间核查实施情况及结果记录表)服务实现类
|
||||
@@ -45,6 +60,12 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
|
||||
|
||||
private ReferenceMaterialService referenceMaterialService;
|
||||
|
||||
@Autowired
|
||||
private OssFile ossFile;
|
||||
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
@Override//分页查询
|
||||
public IPage<PeriodVerificationImplementationVO> getPeriodVerificationImplementationVOPage(IPage<PeriodVerificationImplementation> page, QueryWrapper<PeriodVerificationImplementation> qw) {
|
||||
|
||||
@@ -73,6 +94,7 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
|
||||
periodVerificationImplementation.setReferenceMaterialId(periodVerificationPlan.getReferenceMaterialId());
|
||||
periodVerificationImplementation.setReferenceMaterialNumber(periodVerificationPlan.getReferenceMaterialNumber());
|
||||
periodVerificationImplementation.setPeriodVerificationPlanId(periodVerificationPlan.getId());
|
||||
periodVerificationImplementation.setCauseOfDissatisfactionResult(false);
|
||||
|
||||
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getId, periodVerificationPlan.getReferenceMaterialId());
|
||||
@@ -114,20 +136,9 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
|
||||
|
||||
reagentConsumablesService.updateById(byId2);
|
||||
|
||||
String result = periodVerificationImplementationDTO.getResult();
|
||||
|
||||
byId.setCheckingTime(LocalDate.now());
|
||||
|
||||
PeriodVerificationPlan periodVerificationPlan = periodVerificationPlanService.getById(periodVerificationImplementationDTO.getPeriodVerificationPlanId());
|
||||
|
||||
periodVerificationPlan.setVerificationResult(result);
|
||||
|
||||
periodVerificationPlan.setImplementationDate(byId.getCheckingTime());
|
||||
|
||||
periodVerificationPlan.setInspectorId(dlpUser.getId());
|
||||
|
||||
if (periodVerificationImplementationService.updateById(byId) && periodVerificationPlanService
|
||||
.updateById(periodVerificationPlan)) {
|
||||
if (periodVerificationImplementationService.updateById(byId) ) {
|
||||
|
||||
return byId;
|
||||
} else throw new RuntimeException(String.format("保存失败"));
|
||||
@@ -143,7 +154,22 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
|
||||
|
||||
periodVerificationImplementation.setCommitTime(LocalDateTime.now());
|
||||
|
||||
if (periodVerificationImplementationService.updateById(periodVerificationImplementation)) {
|
||||
String result = periodVerificationImplementationDTO.getResult();
|
||||
|
||||
periodVerificationImplementation.setCheckingTime(LocalDate.now());
|
||||
|
||||
PeriodVerificationPlan periodVerificationPlan = periodVerificationPlanService.getById(periodVerificationImplementationDTO.getPeriodVerificationPlanId());
|
||||
|
||||
periodVerificationPlan.setVerificationResult(result);
|
||||
|
||||
periodVerificationPlan.setImplementationDate(periodVerificationImplementation.getCheckingTime());
|
||||
|
||||
periodVerificationPlan.setInspectorId(dlpUser.getId());
|
||||
|
||||
periodVerificationPlan.setDateOfNextCheck(periodVerificationImplementation.getCheckingTime().plusMonths(periodVerificationPlan.getPlannedVerificationCycle()));
|
||||
|
||||
if (periodVerificationImplementationService.updateById(periodVerificationImplementation)&& periodVerificationPlanService
|
||||
.updateById(periodVerificationPlan)) {
|
||||
|
||||
return periodVerificationImplementation;
|
||||
|
||||
@@ -169,4 +195,85 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl<Per
|
||||
return byId;
|
||||
} else throw new RuntimeException(String.format("审核失败"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void periodVerificationImplementationTablePDF(PeriodVerificationImplementationVO periodVerificationImplementationVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
System.out.println("periodVerificationImplementationTablePDF.................");
|
||||
|
||||
String id = periodVerificationImplementationVO.getId();
|
||||
|
||||
|
||||
String applyFileName = "标准物质期间核查实施情况及结果记录表" + id;
|
||||
//-----------------------------
|
||||
// 生成 word 版本的 验收记录表
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
|
||||
ossFile.fileGet("template" + "/" + "标准物质期间核查实施情况及结果记录表模板.docx", bos);
|
||||
|
||||
byte[] templateArray = bos.toByteArray();
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
|
||||
bos.close();
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
|
||||
|
||||
builder.bind("voList",policy).build();
|
||||
|
||||
/**
|
||||
* 循环表格
|
||||
*/
|
||||
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
|
||||
new HashMap<String, Object>() {{
|
||||
put("id",id);
|
||||
put("size",1);
|
||||
put("referenceMaterialName",periodVerificationImplementationVO.getReferenceMaterialName());
|
||||
put("referenceMaterialNumber",periodVerificationImplementationVO.getReferenceMaterialNumber());
|
||||
put("standardValueOrPurity",periodVerificationImplementationVO.getStandardValueOrPurity());
|
||||
put("deviationAndUncertainty",periodVerificationImplementationVO.getDeviationAndUncertainty());
|
||||
put("inspectorName",periodVerificationImplementationVO.getInspectorName());
|
||||
put("verificationMethod",periodVerificationImplementationVO.getVerificationMethod());
|
||||
put("implementationAndResults",periodVerificationImplementationVO.getImplementationAndResults());
|
||||
put("causeOfDissatisfactionResult",periodVerificationImplementationVO.isCauseOfDissatisfactionResult());
|
||||
put("causeOfDissatisfaction",periodVerificationImplementationVO.getCauseOfDissatisfaction());
|
||||
put("auditOpinionOfTechnical",periodVerificationImplementationVO.getAuditTimeOfTechnical());
|
||||
put("technicalDirectorName",periodVerificationImplementationVO.getTechnicalDirectorName());
|
||||
put("remarks",periodVerificationImplementationVO.getRemarks());
|
||||
put("checkingTime", LocalDateTimeUtil.format(periodVerificationImplementationVO.getCheckingTime(),"yyyy年MM月dd日"));
|
||||
put("auditTimeOfTechnical", LocalDateTimeUtil.format(periodVerificationImplementationVO.getAuditTimeOfTechnical(),"yyyy年MM月dd日"));
|
||||
|
||||
}}
|
||||
);
|
||||
bis.close();
|
||||
|
||||
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
template.write(fosWord);
|
||||
template.close();
|
||||
|
||||
//------------
|
||||
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
fosWord.close();
|
||||
|
||||
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
fisWord.close();
|
||||
|
||||
|
||||
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave("document" + "/" + "periodVerificationImplementation" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println(String.format("转换为 PDF 结束"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -45,8 +45,6 @@ public class ProcurementContentServiceImpl extends ServiceImpl<ProcurementConten
|
||||
|
||||
List<ProcurementContentVO> procurementContentVOList = baseMapper.getProcurementContentVOList(purchasingPlanId);
|
||||
|
||||
|
||||
|
||||
for (ProcurementContentVO procurementContentVO : procurementContentVOList) {
|
||||
|
||||
QueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryQueryWrapper = new QueryWrapper<>();
|
||||
|
||||
+16
-10
@@ -1,5 +1,6 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -61,6 +62,8 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
|
||||
|
||||
List<CatalogueDetails> catalogueDetailsList = new ArrayList<>();
|
||||
|
||||
Integer i = 1;
|
||||
|
||||
for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) {
|
||||
|
||||
CatalogueDetails catalogueDetails = new CatalogueDetails();
|
||||
@@ -71,6 +74,12 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
|
||||
|
||||
catalogueDetails.setPurchaseCatalogueId(purchaseCatalogue.getPurchaseCatalogueId());
|
||||
|
||||
String yyyy = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy");
|
||||
|
||||
catalogueDetails.setPurchaseCatalogueNumber( yyyy+"-"+ i.toString());
|
||||
|
||||
i++;
|
||||
|
||||
catalogueDetailsList.add(catalogueDetails);
|
||||
|
||||
typeTableService.addSpecies(catalogueDetails.getCategory(), catalogueDetails.getSpecies());
|
||||
@@ -101,9 +110,10 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
|
||||
|
||||
catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId);
|
||||
|
||||
return catalogueDetailsService.removeBatchByIds(catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper)) &&
|
||||
purchaseCatalogueService.removeById(purchaseCatalogueId);
|
||||
List<CatalogueDetails> list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper);
|
||||
|
||||
return catalogueDetailsService.removeBatchByIds(list) &&
|
||||
purchaseCatalogueService.removeById(purchaseCatalogueId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -278,7 +288,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
|
||||
}
|
||||
|
||||
@Override//查询已发布的采购目录
|
||||
public Page getVOpage(String name) {
|
||||
public List<CatalogueDetails> getList(String name) {
|
||||
|
||||
QueryWrapper<PurchaseCatalogue> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
@@ -304,15 +314,11 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
|
||||
|
||||
List<CatalogueDetails> catalogueDetailsList = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper);
|
||||
|
||||
PageUtils pageUtils = new PageUtils();
|
||||
|
||||
Page pages = pageUtils.getPages(1, 10, catalogueDetailsList);
|
||||
|
||||
if (pages == null) {
|
||||
if (list == null&list.size()==0) {
|
||||
|
||||
throw new RuntimeException(String.format("未存在已发布的采购目录"));
|
||||
}
|
||||
return pages;
|
||||
return catalogueDetailsList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -337,7 +343,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
|
||||
StrUtil.isNotBlank(purchaseCatalogueDTO.getAlias()) &
|
||||
StrUtil.isNotBlank(purchaseCatalogueDTO.getStorageCondition()) &
|
||||
StrUtil.isNotBlank(purchaseCatalogueDTO.getRemark()) &
|
||||
StrUtil.isNotBlank(purchaseCatalogueDTO.getMinimumUnit())&
|
||||
StrUtil.isNotBlank(purchaseCatalogueDTO.getMinimumUnit()) &
|
||||
StrUtil.isNotBlank(purchaseCatalogueDTO.getCasNumber())
|
||||
|
||||
) {
|
||||
|
||||
+2
-11
@@ -101,18 +101,9 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
|
||||
|
||||
@Transactional
|
||||
@Override//提交采购清单
|
||||
public PurchaseList commitById(List<PurchaseListDTO> purchaseListDTOList) {
|
||||
public PurchaseList commitById(String id) {
|
||||
|
||||
for (PurchaseListDTO purchaseListDTO : purchaseListDTOList) {
|
||||
|
||||
PurchaseListDetails byId = purchaseListDetailsService.getById(purchaseListDTO.getId());
|
||||
|
||||
byId.setSupplierId(purchaseListDTO.getSupplierId());
|
||||
|
||||
purchaseListDetailsService.updateById(byId);
|
||||
}
|
||||
|
||||
PurchaseList purchaseList = purchaseListService.getById(purchaseListDTOList.get(0).getPurchaseListId());
|
||||
PurchaseList purchaseList = purchaseListService.getById(id);
|
||||
|
||||
purchaseList.setStatus(1);
|
||||
|
||||
|
||||
+3
@@ -269,6 +269,9 @@ public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper,
|
||||
|
||||
ProcurementContent byId = procurementContentService.getById(purchasingPlanDTO.getProcurementContentId());
|
||||
|
||||
byId.setUnitPrice(purchasingPlanDTO.getUnitPrice());
|
||||
byId.setQuantityPurchased(purchasingPlanDTO.getQuantityPurchased());
|
||||
|
||||
PurchasingPlan purchasingPlan = purchasingPlanService.getById(byId.getPurchasingPlanId());
|
||||
|
||||
DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(purchasingPlanDTO.getDetailsOfCentralizedId());
|
||||
|
||||
+9
-34
@@ -3,6 +3,7 @@ package digital.laboratory.platform.reagent.service.impl;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -82,11 +83,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
|
||||
BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryVO);
|
||||
//赋值试剂耗材批次明细
|
||||
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsVOList);
|
||||
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(reagentConsumableInventory.getReagentConsumableId());
|
||||
//赋值试剂耗材名称
|
||||
reagentConsumableInventoryVO.setReagentConsumablesName(byId.getReagentConsumableName());
|
||||
|
||||
|
||||
reagentConsumableInventoryVOS.add(reagentConsumableInventoryVO);
|
||||
}
|
||||
if (reagentConsumableInventoryVOS != null) {
|
||||
@@ -100,39 +97,19 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
|
||||
}
|
||||
|
||||
@Override//标准物质管理列表
|
||||
public Page<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(Page page, String reagentConsumableName) {
|
||||
public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw) {
|
||||
|
||||
List<ReagentConsumableInventory> list = reagentConsumableInventoryService.list( Wrappers.<ReagentConsumableInventory>query()
|
||||
.eq("category", "标准物质").or()
|
||||
.eq("category", "标准储备溶液")
|
||||
.like(StrUtil.isNotBlank(reagentConsumableName),"reagent_consumable_name",reagentConsumableName));
|
||||
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, qw);
|
||||
|
||||
List<ReagentConsumableInventoryVO> records = reagentConsumableInventoryVOPage.getRecords();
|
||||
|
||||
ArrayList<ReagentConsumableInventoryVO> reagentConsumableInventoryVOS = new ArrayList<>();
|
||||
for (ReagentConsumableInventoryVO reagentConsumableInventoryVO : records) {
|
||||
|
||||
for (ReagentConsumableInventory reagentConsumableInventory : list) {
|
||||
|
||||
List<BatchDetailsVO> batchDetailsVOList = batchDetailsService.getBatchDetailsList(reagentConsumableInventory.getReagentConsumableInventoryId());
|
||||
|
||||
ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO();
|
||||
|
||||
BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryVO);
|
||||
List<BatchDetailsVO> batchDetailsVOList = batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId());
|
||||
//赋值试剂耗材批次明细
|
||||
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsVOList);
|
||||
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(reagentConsumableInventory.getReagentConsumableId());
|
||||
//赋值试剂耗材名称
|
||||
reagentConsumableInventoryVO.setReagentConsumablesName(byId.getReagentConsumableName());
|
||||
|
||||
reagentConsumableInventoryVOS.add(reagentConsumableInventoryVO);
|
||||
}
|
||||
if (reagentConsumableInventoryVOS != null) {
|
||||
PageUtils pageUtils = new PageUtils();
|
||||
|
||||
Page pages = pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), reagentConsumableInventoryVOS);
|
||||
|
||||
return pages;
|
||||
} else return null;
|
||||
return reagentConsumableInventoryVOPage;
|
||||
}
|
||||
|
||||
|
||||
@@ -164,10 +141,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
|
||||
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper);
|
||||
|
||||
one.setTotalQuantity(one.getTotalQuantity() - quantity);
|
||||
if (one.getTotalQuantity() == 0) {
|
||||
|
||||
one.setStatus(-1);
|
||||
}
|
||||
if (reagentConsumableInventoryService.updateById(one)) {
|
||||
|
||||
return one;
|
||||
@@ -246,6 +220,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
|
||||
reagentConsumableInventoryFullVO.setPurchaseTime(batchDetails.getPurchaseTime());
|
||||
reagentConsumableInventoryFullVO.setReferenceMaterialId(referenceMaterial.getId());
|
||||
reagentConsumableInventoryFullVO.setReferenceMaterialStatus(referenceMaterial.getStatus());
|
||||
reagentConsumableInventoryFullVO.setStorageLife(Integer.valueOf(batchDetails.getLimitDate()));
|
||||
if (one1 != null) {
|
||||
|
||||
reagentConsumableInventoryFullVO.setConfigurationConcentration(one1.getConfigurationConcentration());
|
||||
|
||||
+97
@@ -1,18 +1,33 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.config.ConfigureBuilder;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
|
||||
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
|
||||
import digital.laboratory.platform.reagent.mapper.ReferenceMaterialMapper;
|
||||
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
|
||||
import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
|
||||
import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -21,7 +36,9 @@ import java.util.List;
|
||||
* @author Zhang Xiaolong created at 2023-03-23
|
||||
* @describe 服务实现类
|
||||
*/
|
||||
|
||||
@Service
|
||||
@SuppressWarnings("all")
|
||||
public class ReferenceMaterialServiceImpl extends ServiceImpl<ReferenceMaterialMapper, ReferenceMaterial> implements ReferenceMaterialService {
|
||||
|
||||
@Autowired
|
||||
@@ -30,6 +47,12 @@ public class ReferenceMaterialServiceImpl extends ServiceImpl<ReferenceMaterialM
|
||||
@Autowired
|
||||
private ReagentConsumablesService reagentConsumablesService;
|
||||
|
||||
@Autowired
|
||||
private OssFile ossFile;
|
||||
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
@Override
|
||||
public List<ReferenceMaterialVO> getReferenceMaterialVOList(String batchDetailsId){
|
||||
|
||||
@@ -57,4 +80,78 @@ public class ReferenceMaterialServiceImpl extends ServiceImpl<ReferenceMaterialM
|
||||
return referenceMaterialVOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void standardSolutionCurveTablePDF(List<StandardSolutionCurveVO> voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
System.out.println("standardSolutionCurveTablePDF.................");
|
||||
|
||||
Integer x = 1;
|
||||
for (StandardSolutionCurveVO standardSolutionCurveVO : voList) {
|
||||
|
||||
standardSolutionCurveVO.setSerialnNumber(x.toString());
|
||||
|
||||
x++;
|
||||
}
|
||||
|
||||
String applyFileName = "标准工作曲线溶液配制记录表-" + id;
|
||||
//-----------------------------
|
||||
// 生成 word 版本的 验收记录表
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
|
||||
ossFile.fileGet("template" + "/" + "标准工作曲线溶液配制记录表模板.docx", bos);
|
||||
|
||||
byte[] templateArray = bos.toByteArray();
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
|
||||
bos.close();
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
|
||||
|
||||
builder.bind("voList", policy).build();
|
||||
|
||||
/**
|
||||
* 循环表格
|
||||
*/
|
||||
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
|
||||
new HashMap<String, Object>() {{
|
||||
put("voList",voList);
|
||||
put("id",id);
|
||||
put("size",1);
|
||||
|
||||
|
||||
}}
|
||||
);
|
||||
bis.close();
|
||||
|
||||
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
template.write(fosWord);
|
||||
template.close();
|
||||
|
||||
//------------
|
||||
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
fosWord.close();
|
||||
|
||||
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
fisWord.close();
|
||||
|
||||
|
||||
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave("document" + "/" + "standardSolutionCurve" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println(String.format("转换为 PDF 结束"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+121
@@ -1,19 +1,39 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.entity.ApplicationForUse;
|
||||
import digital.laboratory.platform.reagent.entity.OutgoingContents;
|
||||
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
|
||||
import digital.laboratory.platform.reagent.entity.RequisitionRecord;
|
||||
import digital.laboratory.platform.reagent.mapper.RequisitionRecordMapper;
|
||||
import digital.laboratory.platform.reagent.service.ApplicationForUseService;
|
||||
import digital.laboratory.platform.reagent.service.DeliveryRegistrationFormService;
|
||||
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
|
||||
import digital.laboratory.platform.reagent.service.RequisitionRecordService;
|
||||
import digital.laboratory.platform.reagent.vo.RequisitionRecordVO;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (试剂耗材领用记录表)服务实现类
|
||||
*
|
||||
@@ -21,6 +41,7 @@ import org.springframework.stereotype.Service;
|
||||
* @describe (试剂耗材领用记录表) 服务实现类
|
||||
*/
|
||||
@Service
|
||||
@SuppressWarnings("all")
|
||||
public class RequisitionRecordServiceImpl extends ServiceImpl<RequisitionRecordMapper, RequisitionRecord> implements RequisitionRecordService {
|
||||
|
||||
@Autowired
|
||||
@@ -28,9 +49,21 @@ public class RequisitionRecordServiceImpl extends ServiceImpl<RequisitionRecordM
|
||||
|
||||
@Autowired
|
||||
private RequisitionRecordService requisitionRecordService;
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
@Autowired
|
||||
private ApplicationForUseService applicationForUseService;
|
||||
|
||||
@Autowired
|
||||
private DeliveryRegistrationFormService deliveryRegistrationFormService;
|
||||
|
||||
@Autowired
|
||||
private OssFile ossFile;
|
||||
@Override
|
||||
public RequisitionRecord addRecord(OutgoingContents outgoingContents){
|
||||
|
||||
|
||||
RequisitionRecord requisitionRecord = new RequisitionRecord();
|
||||
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(outgoingContents.getReagentConsumableId());
|
||||
@@ -57,4 +90,92 @@ public class RequisitionRecordServiceImpl extends ServiceImpl<RequisitionRecordM
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequisitionRecordVO> getRequisitionRecordVO(String id){
|
||||
|
||||
ApplicationForUse byId = applicationForUseService.getById(id);
|
||||
|
||||
String deliveryRegistrationFormId = byId.getDeliveryRegistrationFormId();
|
||||
|
||||
List<RequisitionRecordVO> requisitionRecordVO = baseMapper.getRequisitionRecordVO(deliveryRegistrationFormId);
|
||||
|
||||
return requisitionRecordVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rquisitionRecordTablePDF(List<RequisitionRecordVO> voList,String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
|
||||
System.out.println("RequisitionRecordTablePDF.................");
|
||||
|
||||
|
||||
//-----------------------------
|
||||
// 生成 word 版本的 采购目录
|
||||
|
||||
String applyFileName = "试剂耗材领用记录表-"+id;
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
ossFile.fileGet("template" + "/" + "试剂耗材领用记录表模板.docx", bos);
|
||||
|
||||
byte[] templateArray = bos.toByteArray();
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
bos.close();
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
int x = 1;
|
||||
for (RequisitionRecordVO requisitionRecordVO : voList) {
|
||||
|
||||
LocalDateTime dateOfClaim = requisitionRecordVO.getDateOfClaim();
|
||||
|
||||
requisitionRecordVO.setDateOfClaims(LocalDateTimeUtil.format(dateOfClaim,"yyyy年MM月dd日"));
|
||||
|
||||
requisitionRecordVO.setI(x);
|
||||
|
||||
x++;
|
||||
}
|
||||
|
||||
Configure config = Configure.builder().
|
||||
bind("voList", policy).build();
|
||||
/**
|
||||
* 循环表格
|
||||
*/
|
||||
XWPFTemplate template = XWPFTemplate.compile(bis, config).render(
|
||||
new HashMap<String, Object>() {{
|
||||
put("voList", voList);
|
||||
put("id",id);
|
||||
put("size",1);
|
||||
|
||||
}}
|
||||
);
|
||||
bis.close();
|
||||
|
||||
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
template.write(fosWord);
|
||||
template.close();
|
||||
|
||||
//------------
|
||||
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
fosWord.close();
|
||||
|
||||
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
fisWord.close();
|
||||
|
||||
|
||||
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave("document" + "/" + "requisitionRecord" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println(String.format("转换为 PDF 结束"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -61,4 +61,5 @@ public class SolutionUseFormServiceImpl extends ServiceImpl<SolutionUseFormMappe
|
||||
return solutionUseForm;
|
||||
}else throw new RuntimeException(String.format("标准储备溶液使用记录保存失败"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+143
-14
@@ -1,19 +1,37 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.StandardMaterialApplicationDTO;
|
||||
import digital.laboratory.platform.reagent.entity.*;
|
||||
import digital.laboratory.platform.reagent.mapper.StandardMaterialApplicationMapper;
|
||||
import digital.laboratory.platform.reagent.service.*;
|
||||
import digital.laboratory.platform.reagent.vo.StandardMaterialApplicationVO;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -47,6 +65,12 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
|
||||
@Autowired
|
||||
private StandardReserveSolutionService standardReserveSolutionService;
|
||||
|
||||
@Autowired
|
||||
private OssFile ossFile;
|
||||
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
@Override//归还标准物质
|
||||
@Transactional
|
||||
public StandardMaterialApplication returnById(StandardMaterialApplicationDTO standardMaterialApplicationDTO) {
|
||||
@@ -59,18 +83,36 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
|
||||
|
||||
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(byId.getReferenceMaterialId());
|
||||
|
||||
BatchDetails batchDetails = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
|
||||
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(referenceMaterial.getReagentConsumableId());
|
||||
|
||||
batchDetails.setLatticeId(standardMaterialApplicationDTO.getLatticeId());
|
||||
|
||||
batchDetailsService.updateById(batchDetails);
|
||||
referenceMaterial.setLocation(standardMaterialApplicationDTO.getLocation());
|
||||
referenceMaterial.setLocation(standardMaterialApplicationDTO.getLocation());
|
||||
//若无需归还,则证明标准物质/标准储备溶液已经使用完毕,删除记录即可
|
||||
if (!standardMaterialApplicationDTO.getOutOfUse()){
|
||||
|
||||
if (standardMaterialApplicationDTO.getOutOfUse()) {
|
||||
|
||||
referenceMaterial.setStatus(-4);
|
||||
referenceMaterialService.updateById(referenceMaterial);
|
||||
|
||||
if (reagentConsumables.getCategory().equals("标准储备溶液")) {
|
||||
|
||||
StandardReserveSolution solution_numbering = standardReserveSolutionService.getOne(Wrappers.<StandardReserveSolution>query().eq("solution_numbering", referenceMaterial.getNumber()));
|
||||
|
||||
solution_numbering.setStatus(-1);
|
||||
|
||||
standardReserveSolutionService.updateById(solution_numbering);
|
||||
}
|
||||
|
||||
} else {
|
||||
referenceMaterial.setStatus(0);
|
||||
BatchDetails byId2 = batchDetailsService.getById(referenceMaterial.getBatchDetailsId());
|
||||
byId2.setQuantity(byId2.getQuantity() + 1);
|
||||
ReagentConsumableInventory byId1 = reagentConsumableInventoryService.getById(referenceMaterial.getReagentConsumableInventoryId());
|
||||
byId1.setTotalQuantity(byId1.getTotalQuantity() + 1);
|
||||
|
||||
batchDetailsService.updateById(byId2);
|
||||
reagentConsumableInventoryService.updateById(byId1);
|
||||
|
||||
}
|
||||
referenceMaterialService.updateById(referenceMaterial);
|
||||
|
||||
LambdaQueryWrapper<SolutionUseForm> solutionUseFormLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
@@ -101,9 +143,9 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
|
||||
@Override//归还记录
|
||||
public IPage<StandardMaterialApplicationVO> getList(IPage<StandardMaterialApplication> page, QueryWrapper<StandardMaterialApplication> qw) {
|
||||
|
||||
IPage<StandardMaterialApplicationVO> standardMaterialApplicationVOList = baseMapper.getStandardMaterialApplicationVOList(page, qw);
|
||||
IPage<StandardMaterialApplicationVO> standardMaterialApplicationVOIPage = baseMapper.getStandardMaterialApplicationVOList(page, qw);
|
||||
|
||||
List<StandardMaterialApplicationVO> records = standardMaterialApplicationVOList.getRecords();
|
||||
List<StandardMaterialApplicationVO> records = standardMaterialApplicationVOIPage.getRecords();
|
||||
|
||||
for (StandardMaterialApplicationVO record : records) {
|
||||
|
||||
@@ -113,22 +155,109 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard
|
||||
|
||||
LambdaQueryWrapper<StandardReserveSolution> standardReserveSolutionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
standardReserveSolutionLambdaQueryWrapper.eq(StandardReserveSolution::getSolutionNumbering,record.getReferenceMaterialNumber());
|
||||
standardReserveSolutionLambdaQueryWrapper.eq(StandardReserveSolution::getSolutionNumbering, record.getReferenceMaterialNumber());
|
||||
|
||||
StandardReserveSolution one = standardReserveSolutionService.getOne(standardReserveSolutionLambdaQueryWrapper);
|
||||
|
||||
record.setReagentConsumables(byId);
|
||||
|
||||
if (one!=null){
|
||||
if (one != null) {
|
||||
String configurationConcentration = one.getConfigurationConcentration();
|
||||
record.setConfigurationConcentration(configurationConcentration);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
return standardMaterialApplicationVOList;
|
||||
return standardMaterialApplicationVOIPage;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void standardMaterialApplicationTablePDF(List<StandardMaterialApplicationVO> voList, String ids,HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
System.out.println("standardMaterialApplicationTablePDF.................");
|
||||
|
||||
int x = 1;
|
||||
for (StandardMaterialApplicationVO standardMaterialApplicationVO : voList) {
|
||||
|
||||
standardMaterialApplicationVO.setDateOfClaims(LocalDateTimeUtil.format(standardMaterialApplicationVO.getDateOfClaim(), "yyyy年MM月dd日"));
|
||||
standardMaterialApplicationVO.setDateOfReturns(LocalDateTimeUtil.format(standardMaterialApplicationVO.getDateOfReturn(), "yyyy年MM月dd日"));
|
||||
standardMaterialApplicationVO.setX(x);
|
||||
if (standardMaterialApplicationVO.getPurpose() == 0) {
|
||||
standardMaterialApplicationVO.setPurposeAndQuantity("案件," + standardMaterialApplicationVO.getPurposeAndQuantity());
|
||||
|
||||
} else {
|
||||
standardMaterialApplicationVO.setPurposeAndQuantity("科研," + standardMaterialApplicationVO.getPurposeAndQuantity());
|
||||
}
|
||||
x++;
|
||||
}
|
||||
|
||||
//-----------------------------
|
||||
// 生成 word 版本的 采购目录
|
||||
|
||||
|
||||
String applyFileName = "标准物质领用归还登记表-" + ids;
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
ossFile.fileGet("template" + "/" + "标准物质领用归还登记表模板.docx", bos);
|
||||
|
||||
byte[] templateArray = bos.toByteArray();
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
bos.close();
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
|
||||
Configure config = Configure.builder().
|
||||
bind("voList", policy).build();
|
||||
/**
|
||||
* 循环表格
|
||||
*/
|
||||
XWPFTemplate template = XWPFTemplate.compile(bis, config).render(
|
||||
new HashMap<String, Object>() {{
|
||||
put("voList", voList);
|
||||
put("ids", ids);
|
||||
put("size", 1);
|
||||
}}
|
||||
);
|
||||
bis.close();
|
||||
|
||||
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
template.write(fosWord);
|
||||
template.close();
|
||||
|
||||
//------------
|
||||
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
fosWord.close();
|
||||
|
||||
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
fisWord.close();
|
||||
|
||||
|
||||
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave("document" + "/" + "standardMaterialApplication" + "/" + ids + "/" + applyFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println(String.format("转换为 PDF 结束"));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public StandardMaterialApplicationVO getStandardMaterialApplicationVO(String id) {
|
||||
|
||||
StandardMaterialApplicationVO standardMaterialApplicationVO = baseMapper.getStandardMaterialApplicationVO(id);
|
||||
|
||||
return standardMaterialApplicationVO;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+140
-2
@@ -1,10 +1,18 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.config.ConfigureBuilder;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
|
||||
import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO;
|
||||
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
|
||||
@@ -15,11 +23,18 @@ import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
|
||||
import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService;
|
||||
import digital.laboratory.platform.reagent.service.SupplierInformationService;
|
||||
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* (标准物质停用/报废销毁/恢复/降级使用审批表)服务实现类
|
||||
@@ -28,6 +43,7 @@ import java.time.LocalDateTime;
|
||||
* @describe (标准物质停用 / 报废销毁 / 恢复 / 降级使用审批表) 服务实现类
|
||||
*/
|
||||
@Service
|
||||
@SuppressWarnings("all")
|
||||
public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<StandardMaterialApprovalFormMapper, StandardMaterialApprovalForm> implements StandardMaterialApprovalFormService {
|
||||
|
||||
@Autowired
|
||||
@@ -39,6 +55,12 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
|
||||
@Autowired
|
||||
private ReferenceMaterialService referenceMaterialService;
|
||||
|
||||
@Autowired
|
||||
private OssFile ossFile;
|
||||
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
@Override
|
||||
public StandardMaterialApprovalForm commitById(StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, DLPUser dlpUser) {
|
||||
|
||||
@@ -54,8 +76,6 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
|
||||
|
||||
standardMaterialApprovalForm.setId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
standardMaterialApprovalForm.setApprovalOfTime(LocalDateTime.now());
|
||||
|
||||
standardMaterialApprovalForm.setCommitTime(LocalDateTime.now());
|
||||
|
||||
if (standardMaterialApprovalFormDTO.getApplicationContent() == 1 | standardMaterialApprovalFormDTO.getApplicationContent() == 2) {
|
||||
@@ -170,4 +190,122 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar
|
||||
return byId;
|
||||
} else throw new RuntimeException(String.format("审批失败"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void standardMaterialApprovalFormTablePDF(StandardMaterialApprovalFormVO standardMaterialApprovalFormVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
System.out.println("standardMaterialApprovalFormTablePDF.................");
|
||||
|
||||
String id = standardMaterialApprovalFormVO.getId();
|
||||
|
||||
String reasonForApplication = standardMaterialApprovalFormVO.getReasonForApplication();
|
||||
|
||||
Integer reasonForApplicationPrint = standardMaterialApprovalFormVO.getReasonForApplicationPrint();
|
||||
|
||||
if (reasonForApplication.equals("发现质变或有异常,暂停使用")) {
|
||||
standardMaterialApprovalFormVO.setReasonForApplicationPrint(0);
|
||||
}
|
||||
if (reasonForApplication.equals("超过有效期或保质期,暂停使用")) {
|
||||
standardMaterialApprovalFormVO.setReasonForApplicationPrint(1);
|
||||
|
||||
}
|
||||
if (reasonForApplication.equals("定值合格恢复使用")) {
|
||||
standardMaterialApprovalFormVO.setReasonForApplicationPrint(2);
|
||||
|
||||
}
|
||||
if (reasonForApplication.equals("定值未达原等级要求,降级使用")) {
|
||||
standardMaterialApprovalFormVO.setReasonForApplicationPrint(3);
|
||||
|
||||
}
|
||||
if (reasonForApplication.equals("定值未达使用要求,报废销毁")) {
|
||||
standardMaterialApprovalFormVO.setReasonForApplicationPrint(4);
|
||||
|
||||
}
|
||||
if (reasonForApplication.equals("其他")) {
|
||||
standardMaterialApprovalFormVO.setReasonForApplicationPrint(5);
|
||||
|
||||
}
|
||||
|
||||
|
||||
String applyFileName = "标准物质停用报废销毁恢复降级使用审批表" + id;
|
||||
//-----------------------------
|
||||
// 生成 word 版本的 验收记录表
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
|
||||
ossFile.fileGet("template" + "/" + "标准物质停用报废销毁恢复降级使用审批表模板.docx", bos);
|
||||
|
||||
byte[] templateArray = bos.toByteArray();
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
|
||||
bos.close();
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
|
||||
|
||||
builder.bind("voList", policy).build();
|
||||
|
||||
/**
|
||||
* 循环表格
|
||||
*/
|
||||
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
|
||||
new HashMap<String, Object>() {{
|
||||
put("id", id);
|
||||
put("size", 1);
|
||||
put("referenceMaterialName",standardMaterialApprovalFormVO.getReferenceMaterialName());
|
||||
put("referenceMaterialNumber",standardMaterialApprovalFormVO.getReferenceMaterialNumber());
|
||||
put("batchNumber",standardMaterialApprovalFormVO.getBatchNumber());
|
||||
put("specification",standardMaterialApprovalFormVO.getSpecification());
|
||||
put("manufacturerName",standardMaterialApprovalFormVO.getManufacturerName());
|
||||
put("purchaseTime", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getProcessingTime(),"yyyy年MM月dd日"));
|
||||
put("commitTime", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getCommitTime(),"yyyy年MM月dd日"));
|
||||
put("processingTime", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getProcessingTime(),"yyyy年MM月dd日"));
|
||||
put("auditTimeOfPrimary", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getAuditTimeOfPrimary(),"yyyy年MM月dd日"));
|
||||
put("auditTimeOfSecondary", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getAuditTimeOfSecondary(),"yyyy年MM月dd日"));
|
||||
put("approvalOfTime", LocalDateTimeUtil.format(standardMaterialApprovalFormVO.getApprovalOfTime(),"yyyy年MM月dd日"));
|
||||
put("quantity", standardMaterialApprovalFormVO.getQuantity());
|
||||
put("fixedResult", standardMaterialApprovalFormVO.getFixedResult());
|
||||
put("createName", standardMaterialApprovalFormVO.getCreateName());
|
||||
put("applicationContent", standardMaterialApprovalFormVO.getApplicationContent());
|
||||
put("agentName", standardMaterialApprovalFormVO.getAgentName());
|
||||
put("reasonForApplicationPrint",standardMaterialApprovalFormVO.getReasonForApplicationPrint());
|
||||
put("auditOpinionOfPrimary",standardMaterialApprovalFormVO.getAuditOpinionOfPrimary());
|
||||
put("primaryAuditorName",standardMaterialApprovalFormVO.getPrimaryAuditorName());
|
||||
put("auditOpinionOfSecondary",standardMaterialApprovalFormVO.getAuditOpinionOfSecondary());
|
||||
put("secondaryAuditorName",standardMaterialApprovalFormVO.getSecondaryAuditorName());
|
||||
put("opinionOfApproval",standardMaterialApprovalFormVO.getOpinionOfApproval());
|
||||
put("approverName",standardMaterialApprovalFormVO.getApproverName());
|
||||
put("remarks",standardMaterialApprovalFormVO.getRemarks());
|
||||
}}
|
||||
);
|
||||
bis.close();
|
||||
|
||||
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
template.write(fosWord);
|
||||
template.close();
|
||||
|
||||
//------------
|
||||
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
fosWord.close();
|
||||
|
||||
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
fisWord.close();
|
||||
|
||||
|
||||
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave("document" + "/" + "standardMaterialApprovalForm" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println(String.format("转换为 PDF 结束"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+124
-10
@@ -1,29 +1,41 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.config.ConfigureBuilder;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.StandardReserveSolutionDTO;
|
||||
import digital.laboratory.platform.reagent.dto.StandardReserveSolutionFullDTO;
|
||||
import digital.laboratory.platform.reagent.entity.*;
|
||||
import digital.laboratory.platform.reagent.mapper.StandardReserveSolutionMapper;
|
||||
import digital.laboratory.platform.reagent.service.*;
|
||||
import digital.laboratory.platform.reagent.vo.LocationVO;
|
||||
import digital.laboratory.platform.reagent.vo.SolutionUseFormVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO;
|
||||
import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO;
|
||||
import digital.laboratory.platform.reagent.vo.*;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -51,6 +63,12 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
|
||||
@Autowired
|
||||
private CabinetFormService cabinetFormService;
|
||||
|
||||
@Autowired
|
||||
private OssFile ossFile;
|
||||
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
@Autowired
|
||||
private ReagentConsumablesService reagentConsumablesService;
|
||||
@Autowired
|
||||
@@ -139,6 +157,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
|
||||
|
||||
String id = standardReserveSolutionFullDTO.getId();
|
||||
|
||||
String location = standardReserveSolutionFullDTO.getLocation();
|
||||
String latticeId = standardReserveSolutionFullDTO.getLatticeId();
|
||||
|
||||
String warehousingRemarks = standardReserveSolutionFullDTO.getWarehousingRemarks();
|
||||
@@ -194,6 +213,8 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
|
||||
referenceMaterial.setLatticeId(latticeId);
|
||||
referenceMaterial.setLocation(standardReserveSolutionFullDTO.getLocation());
|
||||
|
||||
byId.setReferenceId(referenceMaterial.getId());
|
||||
|
||||
referenceMaterialService.save(referenceMaterial);
|
||||
|
||||
reagentConsumableInventory.setTotalQuantity(1);
|
||||
@@ -235,6 +256,8 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
|
||||
referenceMaterial.setLatticeId(latticeId);
|
||||
referenceMaterial.setLocation(standardReserveSolutionFullDTO.getLocation());
|
||||
|
||||
byId.setReferenceId(referenceMaterial.getId());
|
||||
|
||||
referenceMaterialService.save(referenceMaterial);
|
||||
//将存储信息录入仓库表
|
||||
|
||||
@@ -263,16 +286,107 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
|
||||
|
||||
StandardReserveSolutionFullVO standardReserveSolutionFullVO = new StandardReserveSolutionFullVO();
|
||||
|
||||
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
BeanUtils.copyProperties(standardReserveSolutionVOById,standardReserveSolutionFullVO);
|
||||
|
||||
ReferenceMaterial byId = referenceMaterialService.getById(standardReserveSolutionVOById.getReferenceMaterialId());
|
||||
ReferenceMaterial byId = referenceMaterialService.getById(standardReserveSolutionVOById.getReferenceId());
|
||||
|
||||
if (byId!=null) {
|
||||
standardReserveSolutionFullVO.setLocation(byId.getLocation());
|
||||
standardReserveSolutionFullVO.setLatticeId(byId.getLatticeId());
|
||||
|
||||
}
|
||||
|
||||
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableName, standardReserveSolutionVOById.getSolutionName());
|
||||
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getConfigurationConcentration, standardReserveSolutionVOById.getConfigurationConcentration());
|
||||
|
||||
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper);
|
||||
|
||||
return standardReserveSolutionFullVO;
|
||||
}
|
||||
@Override
|
||||
public void standardReserveSolutionTablePDF(StandardReserveSolutionVO standardReserveSolutionVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
System.out.println("standardReserveSolutionTablePDF.................");
|
||||
|
||||
String id = standardReserveSolutionVO.getId();
|
||||
|
||||
List<SolutionUseFormVO> voList = standardReserveSolutionVO.getSolutionUseFormVOList();
|
||||
|
||||
for (SolutionUseFormVO solutionUseFormVO : voList) {
|
||||
|
||||
LocalDateTime createTime = solutionUseFormVO.getCreateTime();
|
||||
|
||||
String format = LocalDateTimeUtil.format(createTime, "yyyy年MM月dd日");
|
||||
|
||||
solutionUseFormVO.setFormat(format);
|
||||
}
|
||||
|
||||
String applyFileName = "标准储备溶液配制及使用记录表-" + id;
|
||||
//-----------------------------
|
||||
// 生成 word 版本的 验收记录表
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
|
||||
ossFile.fileGet("template" + "/" + "标准储备溶液配制及使用记录表模板.docx", bos);
|
||||
|
||||
byte[] templateArray = bos.toByteArray();
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
|
||||
bos.close();
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
|
||||
|
||||
builder.bind("voList", policy).build();
|
||||
|
||||
/**
|
||||
* 循环表格
|
||||
*/
|
||||
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
|
||||
new HashMap<String, Object>() {{
|
||||
put("voList",voList);
|
||||
put("id", id);
|
||||
put("size", 1);
|
||||
put("solutionName",standardReserveSolutionVO.getSolutionName());
|
||||
put("solutionNumbering",standardReserveSolutionVO.getSolutionNumbering());
|
||||
put("referenceMaterialNumber",standardReserveSolutionVO.getReferenceMaterialNumber());
|
||||
put("referenceMaterialScale",standardReserveSolutionVO.getReferenceMaterialScale());
|
||||
put("useOfSolvent",standardReserveSolutionVO.getUseOfSolvent());
|
||||
put("constantVolume",standardReserveSolutionVO.getConstantVolume());
|
||||
put("configurationConcentration",standardReserveSolutionVO.getConfigurationConcentration());
|
||||
put("dispenserName",standardReserveSolutionVO.getDispenserName());
|
||||
put("validityPeriod",standardReserveSolutionVO.getValidityPeriod());
|
||||
put("remarks",standardReserveSolutionVO.getRemarks());
|
||||
put("configurationDate", LocalDateTimeUtil.format(standardReserveSolutionVO.getConfigurationDate(),"yyyy年MM月dd日"));
|
||||
|
||||
|
||||
}}
|
||||
);
|
||||
bis.close();
|
||||
|
||||
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
template.write(fosWord);
|
||||
template.close();
|
||||
|
||||
//------------
|
||||
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
fosWord.close();
|
||||
|
||||
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
fisWord.close();
|
||||
|
||||
|
||||
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave("document" + "/" + "standardReserveSolution" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println(String.format("转换为 PDF 结束"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+114
-6
@@ -1,24 +1,42 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.config.ConfigureBuilder;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.common.oss.service.OssFile;
|
||||
import digital.laboratory.platform.reagent.dto.StandardSolutionCurveDTO;
|
||||
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
|
||||
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
|
||||
import digital.laboratory.platform.reagent.entity.StandardReserveSolution;
|
||||
import digital.laboratory.platform.reagent.entity.StandardSolutionCurve;
|
||||
import digital.laboratory.platform.reagent.mapper.StandardSolutionCurveMapper;
|
||||
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
|
||||
import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
|
||||
import digital.laboratory.platform.reagent.service.StandardReserveSolutionService;
|
||||
import digital.laboratory.platform.reagent.service.StandardSolutionCurveService;
|
||||
import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (标准工作曲线溶液配置记录表)服务实现类
|
||||
@@ -27,11 +45,21 @@ import java.time.LocalDateTime;
|
||||
* @describe (标准工作曲线溶液配置记录表) 服务实现类
|
||||
*/
|
||||
@Service
|
||||
@SuppressWarnings("all")
|
||||
public class StandardSolutionCurveServiceImpl extends ServiceImpl<StandardSolutionCurveMapper, StandardSolutionCurve> implements StandardSolutionCurveService {
|
||||
|
||||
@Autowired
|
||||
private StandardSolutionCurveService standardSolutionCurveService;
|
||||
|
||||
@Autowired
|
||||
private StandardReserveSolutionService standardReserveSolutionService;
|
||||
|
||||
@Autowired
|
||||
private OssFile ossFile;
|
||||
|
||||
@Autowired
|
||||
private RemoteWord2PDFService remoteWord2PDFService;
|
||||
|
||||
@Autowired
|
||||
private ReferenceMaterialService referenceMaterialService;
|
||||
|
||||
@@ -51,13 +79,9 @@ public class StandardSolutionCurveServiceImpl extends ServiceImpl<StandardSoluti
|
||||
|
||||
StandardSolutionCurve standardSolutionCurve = new StandardSolutionCurve();
|
||||
|
||||
String solutionNumbering = standardSolutionCurveDTO.getSolutionNumbering();
|
||||
StandardReserveSolution byId = standardReserveSolutionService.getById(standardSolutionCurveDTO.getSolutionId());
|
||||
|
||||
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getNumber,solutionNumbering);
|
||||
|
||||
ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(referenceMaterialLambdaQueryWrapper);
|
||||
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(byId.getReferenceId());
|
||||
|
||||
standardSolutionCurve.setId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
@@ -76,4 +100,88 @@ public class StandardSolutionCurveServiceImpl extends ServiceImpl<StandardSoluti
|
||||
}else throw new RuntimeException(String.format("配置失败"));
|
||||
|
||||
}
|
||||
@Override
|
||||
public void standardSolutionCurveTablePDF(List<StandardSolutionCurveVO> voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
System.out.println("standardSolutionCurveTablePDF.................");
|
||||
|
||||
Integer x = 1;
|
||||
for (StandardSolutionCurveVO standardSolutionCurveVO : voList) {
|
||||
|
||||
standardSolutionCurveVO.setSerialnNumber(x.toString());
|
||||
|
||||
standardSolutionCurveVO.setConfigurationDatePrint(LocalDateTimeUtil.format(standardSolutionCurveVO.getConfigurationDate(),"yyyy年MM月dd日"));
|
||||
|
||||
x++;
|
||||
}
|
||||
|
||||
String applyFileName = "标准工作曲线溶液配制记录表-" + id;
|
||||
//-----------------------------
|
||||
// 生成 word 版本的 验收记录表
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
|
||||
ossFile.fileGet("template" + "/" + "标准工作曲线溶液配制记录表模板.docx", bos);
|
||||
|
||||
byte[] templateArray = bos.toByteArray();
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
|
||||
bos.close();
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
|
||||
|
||||
builder.bind("voList", policy).build();
|
||||
|
||||
/**
|
||||
* 循环表格
|
||||
*/
|
||||
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
|
||||
new HashMap<String, Object>() {{
|
||||
put("voList",voList);
|
||||
put("id",id);
|
||||
put("size",1);
|
||||
|
||||
|
||||
}}
|
||||
);
|
||||
bis.close();
|
||||
|
||||
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
template.write(fosWord);
|
||||
template.close();
|
||||
|
||||
//------------
|
||||
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
fosWord.close();
|
||||
|
||||
//MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
fisWord.close();
|
||||
|
||||
|
||||
ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave("document" + "/" + "standardSolutionCurve" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println(String.format("转换为 PDF 结束"));
|
||||
|
||||
}
|
||||
@Override
|
||||
|
||||
public StandardSolutionCurveVO getStandardSolutionCurveVO(String id){
|
||||
|
||||
StandardSolutionCurveVO standardSolutionCurveVO = baseMapper.getStandardSolutionCurveVO(id);
|
||||
|
||||
return standardSolutionCurveVO;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-11
@@ -55,19 +55,11 @@ public class WarehousingContentServiceImpl extends ServiceImpl<WarehousingConten
|
||||
|
||||
List<WarehousingContentVO> records = warehousingContentVOPage.getRecords();
|
||||
|
||||
for (WarehousingContentVO warehousingContentVO : records) {
|
||||
for (WarehousingContentVO record : records) {
|
||||
|
||||
List<WarehousingBatchListVO> warehousingBatchListVOList = warehousingBatchListService.getWarehousingBatchListVOList(warehousingContentVO.getId());
|
||||
|
||||
warehousingContentVO.setWarehousingBatchListVOList(warehousingBatchListVOList);
|
||||
|
||||
ReagentConsumables byId = reagentConsumablesService.getById(warehousingContentVO.getReagentConsumableId());
|
||||
|
||||
warehousingContentVO.setCategory(byId.getCategory());
|
||||
warehousingContentVO.setBrand(byId.getBrand());
|
||||
warehousingContentVO.setSpecificationAndModel(byId.getSpecificationAndModel());
|
||||
warehousingContentVO.setStandardValueOrPurity(byId.getStandardValueOrPurity());
|
||||
List<WarehousingBatchListVO> warehousingBatchListVOList = warehousingBatchListService.getWarehousingBatchListVOList(record.getId());
|
||||
|
||||
record.setWarehousingBatchListVOList(warehousingBatchListVOList);
|
||||
}
|
||||
return warehousingContentVOPage;
|
||||
}
|
||||
|
||||
+216
-49
@@ -1,28 +1,40 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.PageUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.reagent.config.PageUtils;
|
||||
import digital.laboratory.platform.reagent.dto.WarehousingRecordFormDTO;
|
||||
import digital.laboratory.platform.reagent.entity.*;
|
||||
import digital.laboratory.platform.reagent.mapper.WarehousingRecordFormMapper;
|
||||
import digital.laboratory.platform.reagent.service.*;
|
||||
import digital.laboratory.platform.reagent.vo.WarehousingContentVO;
|
||||
import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO;
|
||||
import digital.laboratory.platform.reagent.vo.*;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -76,6 +88,30 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
@Autowired
|
||||
private SupplierInformationService supplierInformationService;
|
||||
|
||||
@Autowired
|
||||
private PurchaseListDetailsService purchaseListDetailsService;
|
||||
|
||||
@Autowired
|
||||
private ProcurementContentService procurementContentService;
|
||||
@Autowired
|
||||
|
||||
private DetailsOfCentralizedService detailsOfCentralizedService;
|
||||
|
||||
@Autowired
|
||||
private DecentralizeDetailsService decentralizeDetailsService;
|
||||
|
||||
@Autowired
|
||||
private PurchasingPlanService purchasingPlanService;
|
||||
|
||||
@Autowired
|
||||
private CentralizedRequestService centralizedRequestService;
|
||||
|
||||
@Autowired
|
||||
private DecentralizedRequestService decentralizedRequestService;
|
||||
|
||||
@Autowired
|
||||
private PurchaseListService purchaseListService;
|
||||
|
||||
@Override//查看采购入库
|
||||
public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) {
|
||||
|
||||
@@ -97,6 +133,14 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
@Override//录入入库明细
|
||||
public WarehousingRecordFormVO addFormById(List<WarehousingRecordFormDTO> warehousingRecordFormDTOList, DLPUser dlpUser) {
|
||||
|
||||
for (WarehousingRecordFormDTO warehousingRecordFormDTO : warehousingRecordFormDTOList) {
|
||||
|
||||
if (warehousingRecordFormDTO.getLatticeId().isEmpty()&warehousingRecordFormDTO.getLocation().isEmpty()){
|
||||
|
||||
throw new RuntimeException(String.format("请选择存放位置后再进行提交"));
|
||||
}
|
||||
}
|
||||
|
||||
boolean flag = true;
|
||||
|
||||
int i = 0;
|
||||
@@ -181,7 +225,11 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
batchDetails.setSupplierId(byId.getSupplierId());
|
||||
batchDetails.setBatch(1);
|
||||
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate());
|
||||
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*reagentConsumables.getPackagedCopies());
|
||||
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*Integer.valueOf(reagentConsumables.getPackagedCopies()));
|
||||
|
||||
if (batchDetails.getQuantity()==null){
|
||||
batchDetails.setQuantity(0);
|
||||
}
|
||||
|
||||
|
||||
if (reagentConsumables.getCategory().equals("试剂")|reagentConsumables.getCategory().equals("耗材")){
|
||||
@@ -193,9 +241,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
|
||||
reagentConsumableInventory.setTotalQuantity(0);
|
||||
}
|
||||
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + batchDetails.getQuantity() * Integer.valueOf(reagentConsumableInventory.getPackagedCopies()));
|
||||
|
||||
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + batchDetails.getQuantity());
|
||||
|
||||
//如果是标准物质,则赋值编号
|
||||
if (reagentConsumables.getCategory().equals("标准物质")) {
|
||||
|
||||
@@ -209,18 +257,15 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
referenceMaterial.setStatus(0);
|
||||
referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation());
|
||||
referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId());
|
||||
referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName());
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
||||
int year = calendar.get(Calendar.YEAR);
|
||||
|
||||
LatticeForm latticeForm = latticeFormService.getById(warehousingRecordFormDTO.getLatticeId());
|
||||
String location = warehousingRecordFormDTO.getLocation();
|
||||
|
||||
CabinetForm cabinetForm = cabinetFormService.getById(latticeForm.getCabinetFormId());
|
||||
|
||||
StorageRoomForm storageRoomForm = storageRoomFormService.getById(cabinetForm.getStorageRoomFormId());
|
||||
|
||||
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + storageRoomForm.getFloor() + "-";
|
||||
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(2) + "-";
|
||||
|
||||
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
|
||||
.likeRight("number", prefix)
|
||||
@@ -268,7 +313,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
batchDetails.setSupplierId(byId.getSupplierId());
|
||||
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate());
|
||||
batchDetails.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId());
|
||||
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*one.getPackagedCopies());
|
||||
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*Integer.valueOf(one.getPackagedCopies()));
|
||||
|
||||
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId())
|
||||
.eq("supplier_id",byId.getSupplierId()));
|
||||
@@ -298,18 +343,15 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
referenceMaterial.setStatus(0);
|
||||
referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation());
|
||||
referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId());
|
||||
referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName());
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
||||
int year = calendar.get(Calendar.YEAR);
|
||||
|
||||
LatticeForm latticeForm = latticeFormService.getById(warehousingRecordFormDTO.getLatticeId());
|
||||
String location = warehousingRecordFormDTO.getLocation();
|
||||
|
||||
CabinetForm cabinetForm = cabinetFormService.getById(latticeForm.getCabinetFormId());
|
||||
|
||||
StorageRoomForm storageRoomForm = storageRoomFormService.getById(cabinetForm.getStorageRoomFormId());
|
||||
|
||||
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + storageRoomForm.getFloor() + "-";
|
||||
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(2) + "-";
|
||||
|
||||
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
|
||||
.likeRight("number", prefix)
|
||||
@@ -355,12 +397,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
|
||||
if (warehousingContent.getWarehousingQuantity() == warehousingContent.getTotalQuantity()) {
|
||||
|
||||
LambdaQueryWrapper<WarehousingBatchList> warehousingBatchListLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
warehousingBatchListLambdaQueryWrapper.eq(WarehousingBatchList::getWarehousingContentId, warehousingContent.getId());
|
||||
|
||||
List<WarehousingBatchList> list1 = warehousingBatchListService.list(warehousingBatchListLambdaQueryWrapper);
|
||||
warehousingContent.setStatus(1);
|
||||
|
||||
warehousingContentService.updateById(warehousingContent);
|
||||
if (warehousingContent.getAcceptanceRecordFormId() == null) {
|
||||
|
||||
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.addForm(warehousingContent.getReagentConsumableId(), warehousingContent.getSupplierId());
|
||||
@@ -419,45 +458,173 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<WarehousingRecordFormVO> getWarehousingRecordFormVOList(Page page) {
|
||||
public IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm> qw) {
|
||||
|
||||
List<WarehousingRecordFormVO> warehousingRecordFormVOList = baseMapper.getWarehousingRecordFormVOList();
|
||||
IPage<WarehousingRecordFormVO> warehousingRecordFormVOPage = baseMapper.getWarehousingRecordFormVOPage(page,qw);
|
||||
|
||||
for (WarehousingRecordFormVO warehousingRecordFormVO : warehousingRecordFormVOList) {
|
||||
List<WarehousingRecordFormVO> records = warehousingRecordFormVOPage.getRecords();
|
||||
|
||||
LambdaQueryWrapper<WarehousingContent> warehousingContentLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
for (WarehousingRecordFormVO record : records) {
|
||||
|
||||
warehousingContentLambdaQueryWrapper.eq(WarehousingContent::getWarehousingRecordFormId, warehousingRecordFormVO.getId());
|
||||
List<WarehousingContent> warehousingContents = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", record.getId()));
|
||||
|
||||
List<WarehousingContent> list = warehousingContentService.list(warehousingContentLambdaQueryWrapper);
|
||||
|
||||
Integer x = 0;
|
||||
Integer y = 0;
|
||||
for (WarehousingContent warehousingContent : list) {
|
||||
Integer totalQuantity = warehousingContent.getTotalQuantity();
|
||||
|
||||
if (totalQuantity != null) {
|
||||
x = x + totalQuantity;
|
||||
}
|
||||
for (WarehousingContent warehousingContent : warehousingContents) {
|
||||
|
||||
Integer warehousingQuantity = warehousingContent.getWarehousingQuantity();
|
||||
if (warehousingQuantity != null) {
|
||||
y = y + warehousingContent.getWarehousingQuantity();
|
||||
Integer totalQuantity = warehousingContent.getTotalQuantity();
|
||||
if (record.getWarehousingQuantity()==null&record.getQuantityPurchased()==null){
|
||||
record.setWarehousingQuantity(0);
|
||||
record.setQuantityPurchased(0);
|
||||
}
|
||||
record.setWarehousingQuantity(record.getWarehousingQuantity()+warehousingQuantity);
|
||||
record.setQuantityPurchased(record.getQuantityPurchased()+totalQuantity);
|
||||
}
|
||||
warehousingRecordFormVO.setWarehousingQuantity(y);
|
||||
warehousingRecordFormVO.setQuantityPurchased(x);
|
||||
|
||||
}
|
||||
if (warehousingRecordFormVOList.size() != 0) {
|
||||
|
||||
PageUtils pageUtils = new PageUtils();
|
||||
|
||||
Page pages = pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), warehousingRecordFormVOList);
|
||||
|
||||
return pages;
|
||||
} else return null;
|
||||
return warehousingRecordFormVOPage;
|
||||
}
|
||||
|
||||
public List<PurchaseRequestPrintVO> getPurchaseRequestPrint(String id){
|
||||
|
||||
WarehousingRecordForm byId = warehousingRecordFormService.getById(id);
|
||||
|
||||
List<WarehousingContent> warehousingContentList = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", id));
|
||||
|
||||
PurchaseListDetails purchaseListDetails1 = purchaseListDetailsService.getById(warehousingContentList.get(0).getPurchaseListDetailsId());
|
||||
|
||||
DecentralizedRequest request = decentralizedRequestService.getOne(Wrappers.<DecentralizedRequest>query().eq("purchase_list_id", purchaseListDetails1.getPurchaseListId()));
|
||||
|
||||
if (request!=null){
|
||||
|
||||
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(request.getId());
|
||||
|
||||
List<DecentralizeDetails> decentralizeDetailsVOList = requestById.getDecentralizeDetailsVOList();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (WarehousingContent warehousingContent : warehousingContentList) {
|
||||
|
||||
PurchaseListDetails purchaseListDetails = purchaseListDetailsService.getById(warehousingContent.getPurchaseListDetailsId());
|
||||
|
||||
String purchaseListId = purchaseListDetails.getPurchaseListId();
|
||||
|
||||
List<WarehousingBatchList> batchListList = warehousingBatchListService.list(Wrappers.<WarehousingBatchList>query().eq("warehousing_content_id", warehousingContent.getId()));
|
||||
|
||||
// DecentralizedRequest request = decentralizedRequestService.getOne(Wrappers.<DecentralizedRequest>query().eq("purchase_list_id", purchaseListId));
|
||||
|
||||
if (request!=null){
|
||||
|
||||
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(request.getId());
|
||||
|
||||
List<DecentralizeDetails> decentralizeDetailsVOList = requestById.getDecentralizeDetailsVOList();
|
||||
|
||||
for (DecentralizeDetails decentralizeDetail : decentralizeDetailsVOList) {
|
||||
|
||||
PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO();
|
||||
|
||||
if (decentralizeDetail.getCategory().equals("标准物质")){
|
||||
|
||||
purchaseRequestPrintVO.setRemarks(decentralizeDetail.getRemarks());
|
||||
purchaseRequestPrintVO.setQuantity(decentralizeDetail.getQuantity());
|
||||
purchaseRequestPrintVO.setPurpose(decentralizeDetail.getPurpose());
|
||||
purchaseRequestPrintVO.setSubtotal(decentralizeDetail.getUnitPrice()*decentralizeDetail.getQuantity());
|
||||
purchaseRequestPrintVO.setApplicantName(requestById.getApplicantName());
|
||||
purchaseRequestPrintVO.setReagentConsumableName(decentralizeDetail.getReagentConsumableName());
|
||||
// purchaseRequestPrintVO.setSupplierName();
|
||||
}}
|
||||
|
||||
|
||||
}
|
||||
|
||||
ProcurementContent procurementContent = procurementContentService.getById(purchaseListDetails.getProcurementContentId());
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return
|
||||
null;
|
||||
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void PurchaseRequestPrintTablePDF(PurchaseRequestPrintVO purchaseRequestPrintVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||||
//
|
||||
// System.out.println("PurchaseRequestPrintTablePDF.................");
|
||||
//
|
||||
// ReagentConsumables byId = reagentConsumablesService.getById(acceptanceRecordFormVO.getReagentConsumableId());
|
||||
//
|
||||
// String id = acceptanceRecordFormVO.getId();
|
||||
//
|
||||
// String applyFileName = null;
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
// if (byId.getCategory().equals("试剂") | byId.getCategory().equals("耗材")) {
|
||||
//
|
||||
// ossFile.fileGet("template" + "/" + "试剂耗材验收记录表模板.docx", bos);
|
||||
//
|
||||
// applyFileName = "试剂耗材验收记录表" + id;
|
||||
// } else {
|
||||
//
|
||||
// ossFile.fileGet("template" + "/" + "标准物质验收记录表模板.docx", bos);
|
||||
//
|
||||
// applyFileName = "标准物质验收记录表" + id;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// //-----------------------------
|
||||
// // 生成 word 版本的 验收记录表
|
||||
//
|
||||
// byte[] templateArray = bos.toByteArray();
|
||||
//
|
||||
// ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
||||
// bos.close();
|
||||
//
|
||||
// LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
//
|
||||
// Configure config = Configure.builder().
|
||||
// bind("voList", policy).build();
|
||||
// /**
|
||||
// * 循环表格
|
||||
// */
|
||||
// XWPFTemplate template = XWPFTemplate.compile(bis, config).render(
|
||||
// new HashMap<String, Object>() {{
|
||||
// put("theSameBrandAndModel", acceptanceRecordFormVO.getTheSameBrandAndModel());
|
||||
// }}
|
||||
// );
|
||||
// bis.close();
|
||||
//
|
||||
// ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||
// template.write(fosWord);
|
||||
// template.close();
|
||||
//
|
||||
// //------------
|
||||
// ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||
// fosWord.close();
|
||||
//
|
||||
// //MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
||||
// MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
||||
// Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||
// fisWord.close();
|
||||
//
|
||||
//
|
||||
// ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
||||
// IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||
// ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
// outPDF.close();
|
||||
//
|
||||
//
|
||||
// ossFile.fileSave("document" + "/" + "acceptanceRecordForm" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
||||
// isPDF.close();
|
||||
//
|
||||
//
|
||||
// System.out.println(String.format("转换为 PDF 结束"));
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@ import java.time.LocalDateTime;
|
||||
@ApiModel(value = "验收记录表VO")
|
||||
public class AcceptanceRecordFormVO extends AcceptanceRecordForm {
|
||||
|
||||
@ApiModelProperty(value = "(试剂耗材名称)")
|
||||
private String reagentConsumableName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "(供应商名称)")
|
||||
private String supplierName;
|
||||
@@ -38,5 +37,11 @@ public class AcceptanceRecordFormVO extends AcceptanceRecordForm {
|
||||
|
||||
private String createName;
|
||||
|
||||
private Boolean theSameBrandAndModelPrint;
|
||||
private Boolean consistentQuantityPrint;
|
||||
private Boolean packingInGoodConditionPrint;
|
||||
private Boolean validityPeriodPrint;
|
||||
private Boolean deliveryCyclePrint;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,10 @@ public class CentralizedRequestVO extends CentralizedRequest {
|
||||
|
||||
private String applicantName;
|
||||
|
||||
private String auditorName;
|
||||
|
||||
private String type = "集中采购申请";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ public class ComplianceCheckVO extends ComplianceCheck {
|
||||
@ApiModelProperty(value="(二级审核人名称)")
|
||||
private String secondaryAuditorName;
|
||||
|
||||
@ApiModelProperty(value="(试剂耗材名称)")
|
||||
private String reagentConsumableName;
|
||||
|
||||
@ApiModelProperty(value="(试剂耗材对象)")
|
||||
private ReagentConsumables reagentConsumables;
|
||||
|
||||
+1
-1
@@ -25,4 +25,4 @@ public class DeliveryRegistrationFormVO extends DeliveryRegistrationForm {
|
||||
|
||||
@ApiModelProperty(value = "出库种类")
|
||||
private Integer typeOfDelivery;
|
||||
}
|
||||
}
|
||||
@@ -13,4 +13,6 @@ public class InstructionBookVO extends InstructionBook {
|
||||
|
||||
private String createName;
|
||||
|
||||
private String number;
|
||||
|
||||
}
|
||||
|
||||
@@ -15,4 +15,11 @@ public class PeriodVerificationPlanVO extends PeriodVerificationPlan {
|
||||
|
||||
private String type = "期间核查计划";
|
||||
|
||||
@ApiModelProperty(value = "(打印标签)")
|
||||
private String P;
|
||||
private String D;
|
||||
private String F;
|
||||
|
||||
private Integer i;
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class PurchaseCatalogueVO extends PurchaseCatalogue {
|
||||
private List<CatalogueDetails> catalogueDetailsListList;
|
||||
|
||||
@ApiModelProperty(value="部门名称")
|
||||
private String orgName;
|
||||
private String department;
|
||||
|
||||
@ApiModelProperty(value="创建人名称")
|
||||
private String createName;
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package digital.laboratory.platform.reagent.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PurchaseRequestPrintVO {
|
||||
|
||||
@ApiModelProperty(value="规格型号")
|
||||
private String specificationAndModel;
|
||||
|
||||
@ApiModelProperty(value="试剂耗材名称")
|
||||
private String reagentConsumableName;
|
||||
|
||||
@ApiModelProperty(value="供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@ApiModelProperty(value="(批号)")
|
||||
private String batchNumber;
|
||||
|
||||
@ApiModelProperty(value="(数量)")
|
||||
private Integer quantity;
|
||||
|
||||
@ApiModelProperty(value="单价")
|
||||
private Double unitPrice;
|
||||
|
||||
@ApiModelProperty(value="备注")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value="申请人名称")
|
||||
private String applicantName;
|
||||
|
||||
@ApiModelProperty(value="用途/购买理由")
|
||||
private String purpose;
|
||||
|
||||
@ApiModelProperty(value="(小计)")
|
||||
private Double subtotal;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user