purchaseCatalogueDTOList, HttpServletRequest theHttpServletRequest) {
PurchaseCatalogueVO anImport = purchaseCatalogueService.getImport(purchaseCatalogueDTOList);
@@ -408,7 +408,7 @@ public class PurchaseCatalogueController {
@ApiOperation(value = "采购目录打印", notes = "采购目录打印")
@SysLog("采购目录打印")
@PostMapping("/print")
-// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
+ @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_print')")
public void bizGetPDFInventory(String purchaseCatalogueId, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java
index bbd8362..8d038d7 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java
@@ -1,5 +1,6 @@
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;
@@ -8,13 +9,12 @@ 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.PurchaseListDTO;
import digital.laboratory.platform.reagent.entity.PurchaseList;
import digital.laboratory.platform.reagent.entity.PurchaseListDetails;
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 digital.laboratory.platform.reagent.vo.*;
import org.joda.time.DateTime;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -38,105 +38,112 @@ import java.util.List;
*
* @author Zhang Xiaolong created at 2023-03-10
* @describe (采购清单) 前端控制器
- *
+ *
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
* 这里写什么:
- * 为前端提供数据, 接受前端的数据
- * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
- * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
+ * 为前端提供数据, 接受前端的数据
+ * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
+ * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
* 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
*/
@RestController
@RequiredArgsConstructor
-@RequestMapping("/purchase_list" )
+@RequestMapping("/purchase_list")
@Api(value = "purchase_list", tags = "(采购清单)管理")
public class PurchaseListController {
- private final PurchaseListService purchaseListService;
+ private final PurchaseListService purchaseListService;
+ private final OssFile ossFile;
- /**
- * 通过id查询(采购清单)
- * @param purchaseListId id
- * @return R
- */
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping( )
-// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_get')" )
- public R getById(String purchaseListId, HttpServletRequest theHttpServletRequest) {
+ /**
+ * 通过id查询(采购清单)
+ *
+ * @param purchaseListId id
+ * @return R
+ */
+ @ApiOperation(value = "通过id查询", notes = "通过id查询")
+ @GetMapping()
+ @PreAuthorize("@pms.hasPermission('reagent_purchase_list_get')")
+ public R getById(String purchaseListId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
+ Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+ DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- PurchaseListVO purchaseList = purchaseListService.getPurchaseList(purchaseListId);
+ PurchaseListVO purchaseList = purchaseListService.getPurchaseList(purchaseListId);
- return R.ok(purchaseList);
- }
+ return R.ok(purchaseList);
+ }
- /**
+ /**
* 分页查询
+ *
* @param page 分页对象
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
- @GetMapping("/page" )
-// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_page')" )
- public R> getPurchaseListPage(Page 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 purchaseListSList = purchaseListService.getPurchaseListVOPage(page, Wrappers.query()
- .ge(startTime!=null,"create_time",startTime)
- .le(endTime!=null,"create_time",endTime)
- .orderByDesc("create_time")
- );
- return R.ok(purchaseListSList);
+ @GetMapping("/page")
+ @PreAuthorize("@pms.hasPermission('reagent_purchase_list_page')")
+ public R> getPurchaseListPage(Page page, Integer status, @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 purchaseListSList = purchaseListService.getPurchaseListVOPage(page, Wrappers.query()
+ .eq(status != null, "status", status)
+ .ge(startTime != null, "create_time", startTime)
+ .le(endTime != null, "create_time", endTime)
+ .orderByDesc("create_time")
+ );
+ return R.ok(purchaseListSList);
// return R.ok(purchaseListService.page(page, Wrappers.query(purchaseList)));
}
/**
* 新增(采购清单)
+ *
* @param purchaseListDTO (采购清单)
* @return R
*/
@ApiOperation(value = "修改采购清单明细", notes = "修改采购清单明细")
- @SysLog("修改采购清单明细" )
+ @SysLog("修改采购清单明细")
@PutMapping
-// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_add')" )
- public R postAddObject(@RequestBody List purchaseListDTO, HttpServletRequest theHttpServletRequest) {
+ @PreAuthorize("@pms.hasPermission('reagent_purchase_list_add')")
+ public R postAddObject(@RequestBody List purchaseListDTO, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
+ Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+ DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- purchaseListService.editById(purchaseListDTO);
+ purchaseListService.editById(purchaseListDTO);
- return R.ok("添加成功");
+ return R.ok("添加成功");
}
- /**
- * 新增(采购清单)
- * @param id (采购清单)
- * @return R
- */
- @ApiOperation(value = "提交采购清单明细", notes = "提交采购清单明细")
- @SysLog("提交采购清单明细" )
- @PutMapping("/commit")
-// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_commit)" )
- public R commitById(String id, HttpServletRequest theHttpServletRequest) {
-
- Principal principal = theHttpServletRequest.getUserPrincipal();
-
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- PurchaseList purchaseList = purchaseListService.commitById(id);
-
- if (purchaseList!=null) {
- return R.ok(purchaseList, "提交成功");
- }
- else {
- return R.failed(purchaseList, "提交失败");
- }
- }
+
+ /**
+ * 新增(采购清单)
+ *
+ * @param id (采购清单)
+ * @return R
+ */
+ @ApiOperation(value = "提交采购清单明细", notes = "提交采购清单明细")
+ @SysLog("提交采购清单明细")
+ @PutMapping("/commit")
+ @PreAuthorize("@pms.hasPermission('reagent_purchase_list_commit')")
+ public R commitById(String id, HttpServletRequest theHttpServletRequest) {
+
+ Principal principal = theHttpServletRequest.getUserPrincipal();
+
+ DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+
+ PurchaseList purchaseList = purchaseListService.commitById(id);
+
+ if (purchaseList != null) {
+ return R.ok(purchaseList, "提交成功");
+ } else {
+ return R.failed(purchaseList, "提交失败");
+ }
+ }
+
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PurchasingPlanController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PurchasingPlanController.java
index 096e9eb..38c850b 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchasingPlanController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/PurchasingPlanController.java
@@ -84,7 +84,7 @@ public class PurchasingPlanController {
*/
@ApiOperation(value = "点击一行通过id查询采购计划明细", notes = "点击一行通过id查询采购计划明细")
@GetMapping()
-// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')")
+ @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')")
public R getById(String purchasingPlanId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -103,7 +103,7 @@ public class PurchasingPlanController {
*/
@ApiOperation(value = "查询换货信息", notes = "查询换货信息")
@GetMapping("/replacement")
-// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_replacemen')")
+ @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_replacemen')")
public R getReplacementVO(String id, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -122,7 +122,7 @@ public class PurchasingPlanController {
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
-// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')")
+ @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')")
public R> getPurchasingPlanPage(Page 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) {
@@ -156,7 +156,7 @@ public class PurchasingPlanController {
@ApiOperation(value = "新增(采购计划)", notes = "新增(采购计划) 参数DTO:(detailsOfCentralizedId,quantity = ,)")
@SysLog("新增(采购计划)")
@PostMapping
-// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_add')" )
+ @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_add')" )
public R postAddObject(@RequestBody List purchasingPlanDTOList, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -179,7 +179,7 @@ public class PurchasingPlanController {
@ApiOperation(value = "修改采购计划明细", notes = "修改采购计划明细")
@SysLog("修改(采购计划)")
@PutMapping
-// @PreAuthorize("@pms.hasPermission('reagent_procurement_content_edit')")
+ @PreAuthorize("@pms.hasPermission('reagent_procurement_content_edit')")
public R putUpdateById(@RequestBody PurchasingPlanDTO purchasingPlanDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -204,7 +204,7 @@ public class PurchasingPlanController {
@ApiOperation(value = "修改采购计划合并明细", notes = "修改采购计划合并明细")
@SysLog("修改(采购计划)")
@PutMapping("/details")
-// @PreAuthorize("@pms.hasPermission('reagent_procurement_content_merge')")
+ @PreAuthorize("@pms.hasPermission('reagent_procurement_content_merge')")
public R editDetails(@RequestBody PurchasingPlanDTO purchasingPlanDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -229,7 +229,7 @@ public class PurchasingPlanController {
@ApiOperation(value = "通过id删除采购计划明细", notes = "通过id删除采购计划明细")
@SysLog("通过id删除采购计划明细")
@DeleteMapping("/content")
-// @PreAuthorize("@pms.hasPermission('reagent_procurement_content_del')")
+ @PreAuthorize("@pms.hasPermission('reagent_procurement_content_del')")
public R deleteContentById(String procurementContentId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -253,7 +253,7 @@ public class PurchasingPlanController {
@ApiOperation(value = "提交采购计划", notes = "提交采购计划")
@SysLog("修改(采购计划)")
@PutMapping("/commit")
-// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_commit')")
+ @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_commit')")
public R commitById(String purchasingPlanId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -278,7 +278,7 @@ public class PurchasingPlanController {
@ApiOperation(value = "换货", notes = "换货")
@SysLog("(换货)")
@PutMapping("/replacement")
-// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_replacemen')")
+ @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_replacemen')")
public R replacementById(@RequestBody PurchasingPlanDTO purchasingPlanDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -354,7 +354,7 @@ public class PurchasingPlanController {
@ApiOperation(value = "采购计划打印", notes = "采购计划打印")
@SysLog("采购计划打印")
@PostMapping("/print")
-// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
+ @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_print')")
public void bizGetPDFInventory(String purchasingPlanId, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java
index 9507157..c79a0e7 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java
@@ -11,12 +11,13 @@ 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.config.QRCodeUtils;
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.service.ReagentConsumableInventoryService;
import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
-import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO;
-import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO;
+import digital.laboratory.platform.reagent.vo.*;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -24,11 +25,14 @@ import lombok.RequiredArgsConstructor;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.web.bind.annotation.*;
+import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import java.awt.image.BufferedImage;
import java.io.IOException;
import java.security.Principal;
import java.sql.Date;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -54,23 +58,7 @@ public class ReagentConsumableInventoryController {
private final ReferenceMaterialService referenceMaterialService;
- /**
- * 通过id查询试剂耗材库存
- *
- * @param reagentConsumableInventoryId id
- * @return R
- */
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{reagentConsumableInventoryId}")
-// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
- public R getById(@PathVariable("reagentConsumableInventoryId") String reagentConsumableInventoryId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(reagentConsumableInventoryId);
- return R.ok(reagentConsumableInventory);
- //return R.ok(reagentConsumableInventoryService.getById(reagentConsumableInventoryId));
- }
+ private final OssFile ossFile;
/**
* @param
@@ -78,7 +66,7 @@ public class ReagentConsumableInventoryController {
*/
@ApiOperation(value = "标准物质列表", notes = "标准物质列表")
@GetMapping("/RList")
-// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
public R> getReagentConsumableInventoryPage(Integer current, Integer size, String reagentConsumableName, Integer referenceMaterialStatus, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -93,20 +81,21 @@ public class ReagentConsumableInventoryController {
}
- Page allList = reagentConsumableInventoryService.getAllList(current, size, reagentConsumableInventoryQueryWrapper,referenceMaterialStatus);
+ Page allList = reagentConsumableInventoryService.getAllList(current, size, reagentConsumableInventoryQueryWrapper, referenceMaterialStatus);
return R.ok(allList);
// return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory)));
}
@ApiOperation(value = "标准物质管理列表", notes = "标准物质管理列表")
@GetMapping("/standardList")
-// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
public R> getReagentConsumableInventoryList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, Wrappers.query()
- .like(StrUtil.isNotBlank(reagentConsumableName),"reagent_consumable_name",reagentConsumableName)
+ .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.eq("category", "标准物质").or()
+ .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.eq("category", "标准储备溶液"));
return R.ok(reagentConsumableInventoryRMVOList);
// return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory)));
@@ -114,13 +103,14 @@ public class ReagentConsumableInventoryController {
@ApiOperation(value = "试剂耗材管理列表", notes = "试剂耗材管理列表")
@GetMapping("/List")
-// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
public R> getList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, Wrappers.query()
- .like(StrUtil.isNotBlank(reagentConsumableName),"reagent_consumable_name",reagentConsumableName)
+ .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.eq("category", "试剂").or()
+ .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.eq("category", "耗材"));
return R.ok(reagentConsumableInventoryRMVOList);
// return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory)));
@@ -133,12 +123,20 @@ public class ReagentConsumableInventoryController {
*/
@ApiOperation(value = "试剂耗材列表", notes = "试剂耗材列表")
@GetMapping("/MList")
-// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
- public R> getReferenceMaterialVOList(Integer current, Integer size, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
+ @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
+ public R> getReferenceMaterialVOList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- Page allRM = reagentConsumableInventoryService.getAllRM(current, size, reagentConsumableName);
+ QueryWrapper reagentConsumableInventoryQueryWrapper = new QueryWrapper<>();
+
+ IPage allRM = reagentConsumableInventoryService.getAllRM(page, reagentConsumableInventoryQueryWrapper
+ .eq("category", "试剂")
+ .like(!StrUtil.isEmpty(reagentConsumableName), "reagent_consumable_name", reagentConsumableName).or()
+ .eq("category", "耗材")
+ .like(!StrUtil.isEmpty(reagentConsumableName), "reagent_consumable_name", reagentConsumableName));
+
+
return R.ok(allRM);
}
@@ -150,93 +148,124 @@ public class ReagentConsumableInventoryController {
*/
@ApiOperation(value = "试剂耗材/标准物质集合列表", notes = "试剂耗材/标准物质集合列表")
@GetMapping("/full")
-// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
- public R> getReagentConsumableInventoryFull( String category,String name, HttpServletRequest theHttpServletRequest) {
+ @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
+ public R> getReagentConsumableInventoryFull(String category, String name, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
QueryWrapper reagentConsumableInventoryQueryWrapper = new QueryWrapper<>();
- if (category!=null){
- reagentConsumableInventoryQueryWrapper.eq("category",category);
+ if (category != null) {
+ reagentConsumableInventoryQueryWrapper.eq("category", category);
}
- if (name!=null){
- reagentConsumableInventoryQueryWrapper.like("reagent_consumable_name",name);
+ if (name != null) {
+ reagentConsumableInventoryQueryWrapper.like("reagent_consumable_name", name);
}
List reagentConsumableInventoryFull = reagentConsumableInventoryService.getReagentConsumableInventoryFull(Wrappers.query()
- .eq((StrUtil.isNotBlank(category)),"category",category)
- .like((StrUtil.isNotBlank(name)),"reagent_consumable_name",name));
+ .eq((StrUtil.isNotBlank(category)), "category", category)
+ .like((StrUtil.isNotBlank(name)), "reagent_consumable_name", name));
return R.ok(reagentConsumableInventoryFull);
}
+
+ /**-------标准物质一览表打印*/
/**
- * 新增试剂耗材库存
+ * 标准物质一览表打印
*
- * @param reagentConsumableInventory 试剂耗材库存
- * @return R
+ * @param
+ * @return
*/
- @ApiOperation(value = "新增试剂耗材库存", notes = "新增试剂耗材库存")
- @SysLog("新增试剂耗材库存")
- @PostMapping
-// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_add')" )
- public R postAddObject(@RequestBody ReagentConsumableInventory reagentConsumableInventory, HttpServletRequest theHttpServletRequest) {
+ @ApiOperation(value = "标准物质一览表打印", notes = "标准物质一览表打印")
+ @SysLog("标准物质一览表打印")
+ @PostMapping("/print")
+ @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_print')")
+ public void bizGetPDFInventory( HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
+ System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase());
- if (reagentConsumableInventoryService.save(reagentConsumableInventory)) {
- return R.ok(reagentConsumableInventory, "对象创建成功");
- } else {
- return R.failed(reagentConsumableInventory, "对象创建失败");
+ String id = IdWorker.get32UUID().toUpperCase();
+
+ List voList = referenceMaterialService.getReferenceMaterialList();
+
+ if (voList.isEmpty()) {
+ throw new RuntimeException("未查询到相关信息");
+ }
+
+
+ String applyFileName = "标准物质一览表-" + id;
+
+ String pdfFilePath = "document" + "/" + "referenceMaterial" + "/" + id + "/" + applyFileName + ".pdf";
+ try {
+ //直接调用pdf方法
+ reagentConsumableInventoryService.referenceMaterialTablePDF(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();
}
}
/**
- * 修改试剂耗材库存
+ * 生成 QRCODE 图像
*
- * @param reagentConsumableInventory 试剂耗材库存
- * @return R
+ * @param code QRCODE字符串
+ *
+ * @return R
*/
- @ApiOperation(value = "修改试剂耗材库存", notes = "修改试剂耗材库存")
- @SysLog("修改试剂耗材库存")
- @PutMapping
-// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_edit')" )
- public R putUpdateById(@RequestBody ReagentConsumableInventory reagentConsumableInventory, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- if (reagentConsumableInventoryService.updateById(reagentConsumableInventory)) {
- return R.ok(reagentConsumableInventory, "保存对象成功");
- } else {
- return R.failed(reagentConsumableInventory, "保存对象失败");
+ @ApiOperation(value = "生成 QRCODE 图像", notes = "生成 QRCODE 图像")
+ @GetMapping("/qrcode")
+ public void genQRCode(String code, HttpServletResponse httpServletResponse) throws IOException {
+ try {
+ // QR Code
+ httpServletResponse.setContentType("image/png");
+ BufferedImage qrImage = QRCodeUtils.genQRCode(code, 150, 150);
+ ImageIO.write(qrImage, "png", httpServletResponse.getOutputStream());
+ } catch (Exception e) {
+ httpServletResponse.sendError(501, e.toString());
}
}
/**
- * 通过id删除试剂耗材库存
+ * 生成 BARCODE 图像
+ *
+ * @param code QRCODE字符串
*
- * @param reagentConsumableInventoryId id
- * @return R
+ * @return R
*/
- @ApiOperation(value = "通过id删除试剂耗材库存", notes = "通过id删除试剂耗材库存")
- @SysLog("通过id删除试剂耗材库存")
- @DeleteMapping()
-// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_del')" )
- public R deleteById(String reagentConsumableInventoryId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+ @ApiOperation(value = "生成条形码", notes = "生成条形码")
+ @GetMapping("/code")
+ @PreAuthorize("@pms.hasAnyPermission('reagent_reagent_consumable_inventory_get')" )
- ReagentConsumableInventory oldReagentConsumableInventory = reagentConsumableInventoryService.getById(reagentConsumableInventoryId);
+ public String getBarCodeImageBase64( String code, HttpServletResponse httpServletResponse) throws IOException {
+
+
+ return reagentConsumableInventoryService.buildCodeLabelContent(code);
- if (reagentConsumableInventoryService.removeById(reagentConsumableInventoryId)) {
- return R.ok(oldReagentConsumableInventory, "对象删除成功");
- } else {
- return R.failed(oldReagentConsumableInventory, "对象删除失败");
- }
}
+ /**
+ * 生成 BARCODE 图像
+ *
+ * @param code QRCODE字符串
+ *
+ * @return R
+ */
+ @ApiOperation(value = "扫码录入物品编码", notes = "扫码录入物品编码")
+ @PutMapping("/code")
+ @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
+ public R setCode( String id,String code,HttpServletResponse httpServletResponse) {
+
+ reagentConsumableInventoryService.setCode(id,code);
+
+ return R.ok("录入成功");
+ }
+
+
+
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumablesController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumablesController.java
index 8f1f820..ae62ffe 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumablesController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumablesController.java
@@ -54,14 +54,16 @@ public class ReagentConsumablesController {
*/
@ApiOperation(value = "分页查询试剂耗材类(包括标准物质)", notes = "分页查询试剂耗材类(包括标准物质)")
@GetMapping("/page")
-// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumables_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_reagent_consumables_get')" )
public R> getReagentConsumablesPage(Page page, String name, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
List list = reagentConsumablesService.list(Wrappers.query()
- .eq("category", "试剂").or()
- .eq("category", "耗材").or()
+ .eq("category", "试剂")
+ .like(StrUtil.isNotBlank(name), "reagent_consumable_name", name).or()
+ .eq("category", "耗材")
+ .like(StrUtil.isNotBlank(name), "reagent_consumable_name", name).or()
.eq("category", "标准物质")
.like(StrUtil.isNotBlank(name), "reagent_consumable_name", name)
.orderByDesc("create_time")
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/RequisitionRecordController.java b/src/main/java/digital/laboratory/platform/reagent/controller/RequisitionRecordController.java
index 1a27185..2cb85ec 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/RequisitionRecordController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/RequisitionRecordController.java
@@ -52,7 +52,7 @@ public class RequisitionRecordController {
@ApiOperation(value = "试剂耗材领用记录表打印", notes = "试剂耗材领用记录表打印")
@SysLog("试剂耗材领用申请表打印")
@PostMapping("/print")
-// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
+ @PreAuthorize("@pms.hasPermission('reagent_application_for_use_print')")
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java
index f55a486..9fb881b 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java
@@ -67,7 +67,7 @@ public class StandardMaterialApprovalFormController {
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping()
-// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" )
public R getById(String id, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -86,7 +86,7 @@ public class StandardMaterialApprovalFormController {
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
-// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_page)" )
+ @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_page')" )
public R> getStandardMaterialApprovalFormPage(Page 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();
@@ -112,7 +112,7 @@ public class StandardMaterialApprovalFormController {
@ApiOperation(value = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)")
@SysLog("新增(标准物质停用/报废销毁/恢复/降级使用审批表)")
@PostMapping
-// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_add')" )
+ @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_add')" )
public R postAddObject(@RequestBody StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -198,19 +198,28 @@ public class StandardMaterialApprovalFormController {
@ApiOperation(value = "标准物质停用", notes = "标准物质停用")
@SysLog("标准物质停用")
@PostMapping("/deactivate")
-// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_deactivate')" )
+ @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_deactivate')" )
public R editById(String id, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
ReferenceMaterial byId = referenceMaterialService.getById(id);
- byId.setStatus(-1);
-
- if (referenceMaterialService.updateById(byId)) {
- return R.ok("停用成功");
+ if (byId.getStatus() == -1) {
+ byId.setStatus(0);
+ if (referenceMaterialService.updateById(byId)) {
+ return R.ok("启用成功");
+ } else {
+ return R.failed("启用失败");
+ }
} else {
- return R.failed("停用失败");
+ byId.setStatus(-1);
+
+ if (referenceMaterialService.updateById(byId)) {
+ return R.ok("停用成功");
+ } else {
+ return R.failed("停用失败");
+ }
}
}
@@ -224,7 +233,7 @@ public class StandardMaterialApprovalFormController {
@ApiOperation(value = "标准物质停用报废销毁恢复降级使用审批表打印", notes = "标准物质停用报废销毁恢复降级使用审批表打印")
@SysLog("标准物质停用报废销毁恢复降级使用审批表打印")
@PostMapping("/print")
-// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
+ @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_print')")
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java b/src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java
index c4f9b48..69f52cb 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java
@@ -67,7 +67,7 @@ public class StandardReserveSolutionController {
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping( )
-// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_get')" )
public R getById(String id, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -85,7 +85,7 @@ public class StandardReserveSolutionController {
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page" )
-// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_page')" )
public R> getStandardReserveSolutionPage(Page 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();
@@ -108,7 +108,7 @@ public class StandardReserveSolutionController {
@ApiOperation(value = "新增(标准储备溶液配制及使用记录表)", notes = "新增(标准储备溶液配制及使用记录表)")
@SysLog("新增(标准储备溶液配制及使用记录表)" )
@PostMapping
-// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_add')" )
+ @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_add')" )
public R postAddObject(@RequestBody StandardReserveSolutionDTO standardReserveSolutionDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -127,7 +127,7 @@ public class StandardReserveSolutionController {
@ApiOperation(value = "入库(标准储备溶液配制及使用记录表)", notes = "入库(标准储备溶液配制及使用记录表)")
@SysLog("入库(标准储备溶液配制及使用记录表)" )
@PostMapping("warehousing")
-// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_warehousing')" )
+ @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_warehousing')" )
public R warehousingById(@RequestBody StandardReserveSolutionFullDTO standardReserveSolutionFullDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -146,7 +146,7 @@ public class StandardReserveSolutionController {
*/
@ApiOperation(value = "通过id查询标准储备溶液入库记录", notes = "通过id查询标准储备溶液入库记录")
@GetMapping( "/full")
-// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_full')" )
+ @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_full')" )
public R getFullVOById(String id, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -168,7 +168,7 @@ public class StandardReserveSolutionController {
@ApiOperation(value = "标准储备溶液配制及使用记录表打印", notes = "标准储备溶液配制及使用记录表打印")
@SysLog("标准储备溶液配制及使用记录表打印")
@PostMapping("/print")
-// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
+ @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_print')")
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
System.out.println("bizApplyWord.................");
Principal principal = theHttpServletRequest.getUserPrincipal();
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/StandardSolutionCurveController.java b/src/main/java/digital/laboratory/platform/reagent/controller/StandardSolutionCurveController.java
index 776ebb9..86a261b 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/StandardSolutionCurveController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/StandardSolutionCurveController.java
@@ -66,7 +66,7 @@ public class StandardSolutionCurveController {
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
-// @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_get')" )
public R> getStandardSolutionCurvePage(Page page, String solutionName, @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) {
@@ -94,7 +94,7 @@ public class StandardSolutionCurveController {
@ApiOperation(value = "新增(标准工作曲线溶液配置记录表)", notes = "新增(标准工作曲线溶液配置记录表)")
@SysLog("新增(标准工作曲线溶液配置记录表)")
@PostMapping
-// @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_add')" )
+ @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_add')" )
public R postAddObject(@RequestBody StandardSolutionCurveDTO standardSolutionCurveDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -118,7 +118,7 @@ public class StandardSolutionCurveController {
@ApiOperation(value = "标准工作曲线溶液配置记录表打印", notes = "标准工作曲线溶液配置记录表打印")
@SysLog("标准工作曲线溶液配置记录表打印")
@PostMapping("/print")
-// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
+ @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_print')")
public void bizGetPDFInventory(String idList, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) {
String[] ids = idList.split(",");
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java b/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java
index 1e72f00..a78d4a6 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java
@@ -70,7 +70,7 @@ public class SupplierInformationController {
*/
@ApiOperation(value = "通过id查询(服务商/供应商信息)", notes = "通过id查询(服务商/供应商信息)")
@GetMapping()
-// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" )
public R getById(String supplierInformationId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -91,7 +91,7 @@ public class SupplierInformationController {
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
-// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_page')" )
+ @PreAuthorize("@pms.hasPermission('reagent_supplier_information_page')" )
public R> getSupplierInformationPage(Page page, String supplierName, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -116,7 +116,7 @@ public class SupplierInformationController {
@SysLog("新增服务商/供应商信息")
@PostMapping
@Transactional
-// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_add')" )
+ @PreAuthorize("@pms.hasPermission('reagent_supplier_information_add')" )
public R postAddObject(@RequestBody SupplierInformationDTO supplierInformationDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -142,7 +142,7 @@ public class SupplierInformationController {
@ApiOperation(value = "修改服务商/供应商信息", notes = "修改服务商/供应商信息")
@SysLog("修改服务商/供应商信息")
@PutMapping
-// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_edit')" )
+ @PreAuthorize("@pms.hasPermission('reagent_supplier_information_edit')" )
public R putUpdateById(@RequestBody SupplierInformationDTO supplierInformationDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -159,51 +159,11 @@ public class SupplierInformationController {
}
- /**
- * 上传供应人照片
- *
- * @param id 上传供应人照片
- * @return R
- */
- @ApiOperation(value = "上传供应人照片", notes = "上传供应人照片/供应商信息")
- @SysLog("修改服务商/供应商信息")
- @PostMapping("/upload/{id}")
-// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_add')" )
- public R putUpdateById(@PathVariable("id") String id, @RequestPart(value = "file") MultipartFile file, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
-
- Principal principal = theHttpServletRequest.getUserPrincipal();
-
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- SupplierInformation supplierInformation = supplierInformationService.getById(id);
-
- if (supplierInformation != null) {
-
- String path = "reagen_managment" + "/" + "supplierInformation" + "/" + supplierInformation.getId();
- String fileName = FileNameUtil.getName(file.getOriginalFilename());
- boolean r = ossFile.fileUpload(file, path);
- Map ResultData = new HashMap<>();
- ResultData.put("fileName", fileName);
- ResultData.put("path", path);
-
- if (r) {
- //修改数据库
- supplierInformation.setPhotographOfSupplier(path);
- supplierInformation.setPhotograph(fileName);
- supplierInformationService.updateById(supplierInformation);
- String fileNames = path + "/" + fileName;
- ossFile.fileGet(fileNames, httpServletResponse.getOutputStream());
- return R.ok(supplierInformation, "上传成功");
- } else return R.failed("上传失败");
-
- } else return null;
- }
-
@ApiOperation(value = "上传资质文件", notes = "上传资质文件")
@SysLog("上传资质文件")
@PostMapping("/uploadQd")
-// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_add')" )
+ @PreAuthorize("@pms.hasPermission('reagent_supplier_information_add')" )
public R uploadById(String id, @RequestPart(value = "file", required = false) MultipartFile file, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -233,7 +193,7 @@ public class SupplierInformationController {
@ApiOperation(value = "预览资质文件", notes = "预览资质文件")
@SysLog("预览资质文件")
@GetMapping("/downloadQd")
-// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" )
public R downloadById(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -262,7 +222,7 @@ public class SupplierInformationController {
@ApiOperation(value = "预览供应人照片", notes = "预览供应人照片")
@SysLog("预览供应人照片")
@GetMapping("/download")
-// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" )
public R download(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -303,7 +263,7 @@ public class SupplierInformationController {
notes = "上传供应商图片,使用fastjson 解析json 对象")
@SysLog("上传供应商图片,使用fastjson 解析json 对象")
@PostMapping(value = "/picture_base64/{id}")
-// @PreAuthorize("@pms.hasAnyPermission('HairJobSampleCreate')")
+ @PreAuthorize("@pms.hasAnyPermission('reagent_supplier_information_add')")
public R uploadPictureBase64(@PathVariable("id") String id, @RequestBody JSONObject jsonParam) throws Exception {
// System.out.println(String.format("uploadPhotoObj: hairSampleId=%s jsonParam.size()=%d", hairSampleId, jsonParam.size()));
SupplierInformation byId = supplierInformationService.getById(id);
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java
index 679fa35..aa68379 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java
@@ -66,7 +66,7 @@ public class WarehousingRecordFormController {
*/
@ApiOperation(value = "通过id查询入库信息", notes = "通过id查询入库信息")
@GetMapping()
-// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_get')" )
+ @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_get')" )
public R getById(String warehousingRecordFormId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -85,7 +85,7 @@ public class WarehousingRecordFormController {
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
-// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')")
+ @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')")
public R> getWarehousingRecordFormVOPage(Page 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();
@@ -108,7 +108,7 @@ public class WarehousingRecordFormController {
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/pageWC")
-// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')")
+ @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')")
public R> 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();
@@ -135,7 +135,7 @@ public class WarehousingRecordFormController {
@ApiOperation(value = "新增签收记录表", notes = "新增签收记录表")
@SysLog("新增签收记录表")
@PostMapping
-// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_add')")
+ @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_add')")
public R postAddObject(@RequestBody List warehousingRecordFormDTOList, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/ApplicationForUseDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/ApplicationForUseDTO.java
index 7500092..5caffd6 100644
--- a/src/main/java/digital/laboratory/platform/reagent/dto/ApplicationForUseDTO.java
+++ b/src/main/java/digital/laboratory/platform/reagent/dto/ApplicationForUseDTO.java
@@ -10,7 +10,7 @@ import java.util.List;
public class ApplicationForUseDTO {
@ApiModelProperty(value = "(标准物质编号)")
- private String referenceMaterialNumber;
+ private String referenceMaterialId;
@ApiModelProperty(value = "(备注)")
diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/DecentralizedRequestDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/DecentralizedRequestDTO.java
index 6254f08..4df705b 100644
--- a/src/main/java/digital/laboratory/platform/reagent/dto/DecentralizedRequestDTO.java
+++ b/src/main/java/digital/laboratory/platform/reagent/dto/DecentralizedRequestDTO.java
@@ -64,7 +64,7 @@ public class DecentralizedRequestDTO {
private String alias;
@ApiModelProperty(value="备注")
- private String remark;
+ private String remarks;
@ApiModelProperty(value="(英文名)")
private String englishName;
diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApplicationDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApplicationDTO.java
index 8d798a5..372af60 100644
--- a/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApplicationDTO.java
+++ b/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApplicationDTO.java
@@ -17,6 +17,9 @@ public class StandardMaterialApplicationDTO {
@ApiModelProperty(value = "位置信息")
private String location;
+ @ApiModelProperty(value = "柜子ID")
+ private String boxId;
+
@ApiModelProperty(value = "是否用完")
private Boolean outOfUse;
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/StandardReserveSolutionFullDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/StandardReserveSolutionFullDTO.java
index 0445460..cf5d61f 100644
--- a/src/main/java/digital/laboratory/platform/reagent/dto/StandardReserveSolutionFullDTO.java
+++ b/src/main/java/digital/laboratory/platform/reagent/dto/StandardReserveSolutionFullDTO.java
@@ -9,4 +9,6 @@ public class StandardReserveSolutionFullDTO {
private String latticeId;
private String warehousingRemarks;
private String location;
+
+ private String boxId;
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java
index 72771b4..b60bc33 100644
--- a/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java
+++ b/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java
@@ -21,6 +21,9 @@ public class WarehousingRecordFormDTO {
@ApiModelProperty(value = "批号")
private String batchNumber;
+ @ApiModelProperty(value = "物品编码")
+ private String code;
+
@JsonFormat(pattern = "yyyy-MM-dd")
@JSONField(format = "yyyy-MM-dd")
@ApiModelProperty(value = "(生产日期)")
@@ -60,5 +63,6 @@ public class WarehousingRecordFormDTO {
@ApiModelProperty(value = "(保管人名称)")
private String custodianName;
-
+ @ApiModelProperty(value="柜子ID")
+ private String boxId;
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/AppStartupRunner.java b/src/main/java/digital/laboratory/platform/reagent/entity/AppStartupRunner.java
deleted file mode 100644
index 872a1d2..0000000
--- a/src/main/java/digital/laboratory/platform/reagent/entity/AppStartupRunner.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package digital.laboratory.platform.reagent.entity;
-
-import digital.laboratory.platform.common.core.constant.CommonConstants;
-import digital.laboratory.platform.common.core.util.R;
-import digital.laboratory.platform.sys.entity.Dictionary;
-import digital.laboratory.platform.sys.feign.RemoteDictionaryService;
-import lombok.RequiredArgsConstructor;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.stereotype.Component;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-
-/**
- * App 启动类
- * 当 Spring Application 启动完成后, 会调用这个类的 run() 方法进行一些最后的初始化。
- * 我们在这个方法中从数据库加载一些全局的配置
- *
- * @author Zhang Xiaolong
- */
-
-@Component
-@RequiredArgsConstructor
-public class AppStartupRunner implements ApplicationRunner {
-
- // @Value("${dlp.entrustment.processDefinitionId}")
- // public static String processDefinitionId;
-
- //public static boolean clientChoiceCheckers;
- //public static boolean checkerChoiceApprovers;
- //public static boolean singleOperateUser;
-
- // @Value("${dlp.entrustment.temporaryPath}")
- //public static String temporaryPath;
-
- @Value("${dlp.entrustment.entrustmentLetterTemplate}")
- public static String entrustmentLetterTemplate;
-
- private final RemoteDictionaryService remoteDictionaryService;
-
- public static Map entrustmentConfig = new HashMap<>();
-
- public static String getCfg(String code) {
- return entrustmentConfig.get(code);
- }
-
- /**
- *
- * @param args 参数
- * @throws Exception 异常
- *
- * // @SysLog("委托受理模块初始化") 这里不能使用 @SysLog(), 因为 SysLog 还没有初始化
- */
- @Override
- public void run(ApplicationArguments args) throws Exception {
-// BusinessCodeUtils.removeSymbols("x-*/)——0*&……%¥#@xasdf!*&^&%^ 中文、/+)(()\n\\xx\rx");
-
- {
- // 加载 entrustment 在字典中的配置
- R> r = remoteDictionaryService.getDictionaryByType(CommonConstants.DLP_TYPE_ENTRUSTMENT);
- if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) {
- List itemList = r.getData();
- for (Dictionary item : itemList) {
- entrustmentConfig.put(item.getCode(), item.getLabel());
- }
- }
-
- for (String key : entrustmentConfig.keySet()) {
- System.out.println(String.format("entrustmentConfig[%s]=%s", key, entrustmentConfig.get(key)));
- }
- }
-
- // {
- // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_PROCESS_DEFINITION_ID);
- // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) {
- // processDefinitionId = r.getData().get("label");
- // }
- // }
- // {
- // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_CLIENT_CHOICE_CHECKERS);
- // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) {
- // clientChoiceCheckers = "1".equals(r.getData().get("label"));
- // }
- // }
- // {
- // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_CHECKER_CHOICE_APPROVERS);
- // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) {
- // checkerChoiceApprovers = "1".equals(r.getData().get("label"));
- // }
- // }
- // {
- // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_CLIENT_SINGLE_OPERATE_USER);
- // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) {
- // singleOperateUser = "1".equals(r.getData().get("label"));
- // }
- // }
- // {
- // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_TEMPORARY_PATH);
- // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) {
- // temporaryPath = r.getData().get("label");
- // }
- // if (StrUtil.isEmpty(temporaryPath)) {
- // temporaryPath =new File(System.getProperty("user.dir")+"/temp").getCanonicalPath();
- // }
- //
- // System.out.printf("临时目录是 %s%n", temporaryPath);
- // File tempPathFile = new File(temporaryPath);
- // if (! tempPathFile.exists()) {
- // System.out.printf("临时目录 %s 不存在, 创建之...%n", tempPathFile.getCanonicalPath());
- // if (!tempPathFile.mkdirs()) {
- // System.out.printf("创建临时目录 %s 失败!%n", tempPathFile.getCanonicalPath());
- // }
- // }
- // }
-
- // {
- // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_LETTER_TEMPLATE_PATH);
- // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) {
- // entrustmentLetterTemplate = r.getData().get("label");
- // }
- // }
-
- }
-
-
-}
\ No newline at end of file
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java b/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java
index c626eb0..bf3241c 100644
--- a/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java
+++ b/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java
@@ -103,7 +103,7 @@ public class BatchDetails extends BaseEntity {
/**
* (使用状态)
*/
- @ApiModelProperty(value="(使用状态)")
+ @ApiModelProperty(value="(使用状态 1 库存充足 -1 库存为0)")
private Integer serviceStatus;
/**
@@ -117,6 +117,12 @@ public class BatchDetails extends BaseEntity {
@ApiModelProperty(value = "(位置信息)")
private String location;
+ @ApiModelProperty(value="柜子ID")
+ private String boxId;
+
+ @ApiModelProperty(value="预警信息")
+ private String warningInformation;
+
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java b/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java
index f60aae8..7eded43 100644
--- a/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java
+++ b/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java
@@ -121,6 +121,8 @@ public class CatalogueDetails extends BaseEntity {
@ApiModelProperty(value = "CAS-号")
private String casNumber;
+ @ApiModelProperty(value = "物品编码")
+ private String code;
/**
* 备注
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java b/src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java
index 44ccd56..d4221fb 100644
--- a/src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java
+++ b/src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java
@@ -36,8 +36,6 @@ public class CentralizedRequest extends BaseEntity {
@ApiModelProperty(value="申请人ID")
private String applicantId;
-
-
/**
* (申请日期)
*/
@@ -53,7 +51,7 @@ public class CentralizedRequest extends BaseEntity {
/**
* (状态)
*/
- @ApiModelProperty(value="状态(0:未提交,1:已提交,2:已被制定采购计划)")
+ @ApiModelProperty(value="状态(0:未提交,1:已提交,2:已审核 3:已被制定采购计划 ,4:已被制定采购清单)")
private Integer status;
/**
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java b/src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java
index 6350e6b..bdfc781 100644
--- a/src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java
+++ b/src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java
@@ -63,6 +63,9 @@ public class OutgoingContents extends BaseEntity {
@ApiModelProperty(value = "(标准物质ID)")
private String referenceMaterialId;
+ @ApiModelProperty(value = "(出库编码)")
+ private String code;
+
@ApiModelProperty(value = "(批次ID)")
private String batchDetailsId;
@@ -72,6 +75,8 @@ public class OutgoingContents extends BaseEntity {
@ApiModelProperty(value = "(位置信息)")
private String location;
+ @ApiModelProperty(value="柜子ID")
+ private String boxId;
/**
* outgoingContentsId
*/
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ProcurementContent.java b/src/main/java/digital/laboratory/platform/reagent/entity/ProcurementContent.java
index 4a55ef3..cb4b250 100644
--- a/src/main/java/digital/laboratory/platform/reagent/entity/ProcurementContent.java
+++ b/src/main/java/digital/laboratory/platform/reagent/entity/ProcurementContent.java
@@ -26,6 +26,7 @@ import lombok.EqualsAndHashCode;
@ApiModel(value = "(采购内容)")
public class ProcurementContent extends BaseEntity {
+
/**
* (采购计划id)
*/
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java
index 4627fae..8a28ee6 100644
--- a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java
+++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java
@@ -27,6 +27,11 @@ import lombok.EqualsAndHashCode;
@ApiModel(value = "试剂耗材库存")
public class ReagentConsumableInventory extends BaseEntity {
+ @ApiModelProperty(value = "CAS-号")
+ private String casNumber;
+
+ @ApiModelProperty(value = "物品编码")
+ private String code;
/**
* 名称
*/
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java
index 6c71980..b1e6724 100644
--- a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java
+++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java
@@ -30,6 +30,11 @@ public class ReagentConsumables extends BaseEntity {
@ApiModelProperty(value="品牌")
private String brand;
+ @ApiModelProperty(value = "CAS-号")
+ private String casNumber;
+
+ @ApiModelProperty(value = "物品编码")
+ private String code;
/**
* 类别
*/
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumablesSet.java b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumablesSet.java
index 6bf4f50..63a512c 100644
--- a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumablesSet.java
+++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumablesSet.java
@@ -34,7 +34,7 @@ public class ReagentConsumablesSet extends BaseEntity {
private String applicationForUseId;
@ApiModelProperty(value = "(标准物质编号)")
- private String referenceMaterialNumber;
+ private String referenceMaterialId;
@ApiModelProperty(value = "(出库明细ID)")
private String outgoingContentId;
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java b/src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java
index d088e6f..7134f1d 100644
--- a/src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java
+++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java
@@ -27,10 +27,13 @@ public class ReferenceMaterial extends BaseEntity {
*/
@ApiModelProperty(value="标准物质编号")
private String number;
+
+ @ApiModelProperty(value="打印序列号")
+ private String code;
/**
* number
*/
- @ApiModelProperty(value="状态(0为可以使用,-1为停用,-2为降级使用、-3 已被领用")
+ @ApiModelProperty(value="状态(0为可以使用,-1为停用,-2为降级使用、-3 已被领用,-4 使用完毕,报废")
private Integer status;
/**
@@ -53,6 +56,9 @@ public class ReferenceMaterial extends BaseEntity {
@ApiModelProperty(value="位置信息")
private String location;
+ @ApiModelProperty(value="柜子ID")
+ private String boxId;
+
/**
* id
*/
@@ -63,7 +69,7 @@ public class ReferenceMaterial extends BaseEntity {
@ApiModelProperty(value="试剂耗材(含标准物质)仓库表ID")
private String reagentConsumableInventoryId;
- @ApiModelProperty(value="试剂耗材(含标准物质)仓库表ID")
+ @ApiModelProperty(value="保管人名称")
private String custodianName;
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingBatchList.java b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingBatchList.java
index 743cf05..858dacb 100644
--- a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingBatchList.java
+++ b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingBatchList.java
@@ -32,6 +32,11 @@ public class WarehousingBatchList extends BaseEntity {
*/
@ApiModelProperty(value="(批次)")
private Integer batch;
+ /**
+ * (批次)
+ */
+ @ApiModelProperty(value="(批次)")
+ private String batchId;
/**
* (批号)
diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java
index 7623715..9dde6d9 100644
--- a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java
+++ b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java
@@ -38,6 +38,8 @@ public class WarehousingContent extends BaseEntity {
@ApiModelProperty(value = "(总数量)")
private Integer totalQuantity;
+ @ApiModelProperty(value = "物品编码")
+ private String code;
/**
* (签收记录表ID)
*/
@@ -78,5 +80,8 @@ public class WarehousingContent extends BaseEntity {
@ApiModelProperty(value = "采购清单明细ID")
private String purchaseListDetailsId;
+
+ @ApiModelProperty(value = "预警值")
+ private Integer warningValue;
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/DecentralizeDetailsMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/DecentralizeDetailsMapper.java
index 3f3f3bd..fae7896 100644
--- a/src/main/java/digital/laboratory/platform/reagent/mapper/DecentralizeDetailsMapper.java
+++ b/src/main/java/digital/laboratory/platform/reagent/mapper/DecentralizeDetailsMapper.java
@@ -17,5 +17,5 @@ import java.util.List;
@Mapper
public interface DecentralizeDetailsMapper extends BaseMapper {
-
+ List getDecentralizeDetailsList(String id);
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/InstructionBookMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/InstructionBookMapper.java
index 2e2e4b4..33fe580 100644
--- a/src/main/java/digital/laboratory/platform/reagent/mapper/InstructionBookMapper.java
+++ b/src/main/java/digital/laboratory/platform/reagent/mapper/InstructionBookMapper.java
@@ -2,6 +2,7 @@ package digital.laboratory.platform.reagent.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import digital.laboratory.platform.reagent.entity.InstructionBook;
+import digital.laboratory.platform.reagent.vo.InstructionBookVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -14,4 +15,5 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public interface InstructionBookMapper extends BaseMapper {
+ InstructionBookVO getInstructionBookVO(String id);
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java
index a8c0b8a..f0706ee 100644
--- a/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java
+++ b/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java
@@ -5,10 +5,14 @@ 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.ReagentConsumableInventoryFullVO;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO;
+import digital.laboratory.platform.reagent.vo.UserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
/**
* 试剂耗材库存 Mapper 接口
*
@@ -19,5 +23,7 @@ import org.apache.ibatis.annotations.Param;
public interface ReagentConsumableInventoryMapper extends BaseMapper {
IPage getReagentConsumableInventoryVOPage (IPagepage, @Param(Constants.WRAPPER) QueryWrapper qw);
+ IPage getReagentConsumableInventoryFullVOPage (IPagepage, @Param(Constants.WRAPPER) QueryWrapper qw);
+ List getUserList();
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/ReferenceMaterialMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/ReferenceMaterialMapper.java
index a0ae96e..3803872 100644
--- a/src/main/java/digital/laboratory/platform/reagent/mapper/ReferenceMaterialMapper.java
+++ b/src/main/java/digital/laboratory/platform/reagent/mapper/ReferenceMaterialMapper.java
@@ -2,9 +2,12 @@ package digital.laboratory.platform.reagent.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
+import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
/**
* Mapper 接口
*
@@ -14,4 +17,6 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public interface ReferenceMaterialMapper extends BaseMapper {
+ List getReferenceMaterialVOList ();
+
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java b/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java
index d39b1c3..662d5fb 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java
@@ -9,7 +9,10 @@ import digital.laboratory.platform.reagent.dto.CentralizedRequestDTO;
import digital.laboratory.platform.reagent.entity.CentralizedRequest;
import digital.laboratory.platform.reagent.entity.DetailsOfCentralized;
import digital.laboratory.platform.reagent.vo.CentralizedRequestVO;
+import digital.laboratory.platform.reagent.vo.PurchaseRequestPrintVO;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@@ -38,4 +41,8 @@ public interface CentralizedRequestService extends IService
List getVOList(QueryWrapper qw);
CentralizedRequest auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
+
+ List getPurchaseRequestPrintList(String id, String type);
+
+ void purchaseRequestTablePDF(List voList, String id, String type, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/DecentralizeDetailsService.java b/src/main/java/digital/laboratory/platform/reagent/service/DecentralizeDetailsService.java
index e5cab04..2a72e9a 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/DecentralizeDetailsService.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/DecentralizeDetailsService.java
@@ -3,6 +3,7 @@ package digital.laboratory.platform.reagent.service;
import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.reagent.entity.DecentralizeDetails;
import digital.laboratory.platform.reagent.vo.DecentralizeDetailsVO;
+import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO;
import java.util.List;
@@ -16,4 +17,5 @@ public interface DecentralizeDetailsService extends IService getDecentralizeDetailsList (String decentralizedRequestId);
+ DecentralizedRequestVO getDecentralizedRequest(String id);
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/InstructionBookService.java b/src/main/java/digital/laboratory/platform/reagent/service/InstructionBookService.java
index b3e6884..381303a 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/InstructionBookService.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/InstructionBookService.java
@@ -14,7 +14,7 @@ import digital.laboratory.platform.reagent.vo.InstructionBookVO;
*/
public interface InstructionBookService extends IService {
- InstructionBook auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
+ InstructionBookVO auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
InstructionBookVO getVO(String id);
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/PurchaseListService.java b/src/main/java/digital/laboratory/platform/reagent/service/PurchaseListService.java
index 3d3d2bd..3dd1244 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/PurchaseListService.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/PurchaseListService.java
@@ -10,8 +10,11 @@ import digital.laboratory.platform.reagent.entity.PurchaseListDetails;
import digital.laboratory.platform.reagent.vo.PurchaseListDetailsVO;
import digital.laboratory.platform.reagent.vo.PurchaseListPageVO;
import digital.laboratory.platform.reagent.vo.PurchaseListVO;
+import digital.laboratory.platform.reagent.vo.PurchaseRequestPrintVO;
import org.apache.ibatis.annotations.Param;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@@ -33,4 +36,5 @@ public interface PurchaseListService extends IService {
PurchaseListDetailsVO addDetails(PurchaseListDTO purchaseListDTO);
IPage getPurchaseListVOPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw);
+
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java b/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java
index f147ec5..4d866cd 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java
@@ -8,7 +8,11 @@ import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO;
+import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO;
+import digital.laboratory.platform.reagent.vo.UserVO;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@@ -19,20 +23,23 @@ import java.util.List;
*/
public interface ReagentConsumableInventoryService extends IService {
- Page getReagentConsumableInventoryVOList(Page page,String name);
-
ReagentConsumableInventory addById(String reagentConsumableId, Integer quantity);
ReagentConsumableInventory reduceById(String reagentConsumableId, Integer quantity);
- ReferenceMaterial deactivateById(String referenceMaterialId);
-
Page getAllList(Integer current, Integer size, QueryWrapper qw,Integer status);
//分页查询试剂耗材
- Page getAllRM(Integer current, Integer size,String reagentConsumableName);
+ IPage getAllRM(IPage page, QueryWrapper qw);
IPage getReagentConsumableInventoryRMVOList(IPage page,QueryWrapperqw);
List getReagentConsumableInventoryFull(QueryWrapper qw);
+
+ void referenceMaterialTablePDF(List voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
+
+ //试剂/耗材扫描物品编码进行持久化
+ void setCode(String id, String code);
+
+ String buildCodeLabelContent(String code);
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/ReferenceMaterialService.java b/src/main/java/digital/laboratory/platform/reagent/service/ReferenceMaterialService.java
index 8edb605..c3c8a60 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/ReferenceMaterialService.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/ReferenceMaterialService.java
@@ -19,5 +19,5 @@ public interface ReferenceMaterialService extends IService {
List getReferenceMaterialVOList(String batchDetailsId);
- void standardSolutionCurveTablePDF(List voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
+ List getReferenceMaterialList();
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java
index 5ccc15f..6f9c254 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java
@@ -112,7 +112,14 @@ public class ApplicationForUseServiceImpl extends ServiceImpl reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -155,6 +162,7 @@ public class ApplicationForUseServiceImpl extends ServiceImpl applicationForUseDTOList, DLPUser dlpUser) {
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java
index 7c3cf44..44648e8 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java
@@ -17,6 +17,8 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java
index 7bc8fc5..e54bad0 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java
@@ -1,27 +1,40 @@
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.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.CentralizedRequestDTO;
-import digital.laboratory.platform.reagent.entity.CentralizedRequest;
-import digital.laboratory.platform.reagent.entity.DetailsOfCentralized;
+import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.CentralizedRequestMapper;
-import digital.laboratory.platform.reagent.service.CentralizedRequestService;
-import digital.laboratory.platform.reagent.service.DetailsOfCentralizedService;
-import digital.laboratory.platform.reagent.vo.CentralizedRequestVO;
-import digital.laboratory.platform.reagent.vo.DetailsOfCentralizedVO;
+import digital.laboratory.platform.reagent.service.*;
+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.HashMap;
import java.util.List;
/**
@@ -40,6 +53,32 @@ public class CentralizedRequestServiceImpl extends ServiceImpl centralizedRequestDTOList, DLPUser dlpUser) {
@@ -224,6 +263,171 @@ public class CentralizedRequestServiceImpl extends ServiceImpl getPurchaseRequestPrintList(String id, String type) {
+ ArrayList purchaseRequestPrintVOList = new ArrayList<>();
+
+ if(type.equals("集中采购申请")){
+
+ CentralizedRequestVO centralizedRequest = centralizedRequestService.getCentralizedRequestVO(id);
+
+ List detailsOfCentralizedVOList = centralizedRequest.getDetailsOfCentralizedVOList();
+
+
+ for (DetailsOfCentralizedVO detailsOfCentralized : detailsOfCentralizedVOList) {
+
+ ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralized.getReagentConsumableId());
+
+ if (reagentConsumables.getCategory().equals("标准物质")){
+
+ PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO();
+ purchaseRequestPrintVO.setApplicantName(centralizedRequest.getApplicantName());
+ purchaseRequestPrintVO.setPurpose(detailsOfCentralized.getPurpose());
+ purchaseRequestPrintVO.setQuantity(detailsOfCentralized.getQuantityPurchased());
+ purchaseRequestPrintVO.setRemarks(detailsOfCentralized.getRemarks());
+ purchaseRequestPrintVO.setReagentConsumableName(reagentConsumables.getReagentConsumableName());
+ purchaseRequestPrintVO.setSpecificationAndModel(reagentConsumables.getSpecificationAndModel());
+ purchaseRequestPrintVO.setUnitPrice(procurementContentService.getById(detailsOfCentralized.getProcurementContentId()).getUnitPrice());
+ purchaseRequestPrintVO.setSubtotal(procurementContentService.getById(detailsOfCentralized.getProcurementContentId()).getSubtotal());
+ purchaseRequestPrintVO.setSupplierName(supplierInformationService.getById(purchaseListDetailsService.getOne(Wrappers.query().eq("procurement_content_id", detailsOfCentralized.getProcurementContentId())).getSupplierId()).getSupplierName());
+ purchaseRequestPrintVOList.add(purchaseRequestPrintVO);}
+
+
+ }
+ }else {
+
+ DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(id);
+
+ for (DecentralizeDetails decentralizeDetails : requestById.getDecentralizeDetailsVOList()) {
+
+ if (decentralizeDetails.getCategory().equals("标准物质")){
+
+ PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO();
+
+ BeanUtils.copyProperties(decentralizeDetails, purchaseRequestPrintVO);
+
+ purchaseRequestPrintVO.setPurpose(decentralizeDetails.getPurpose());
+ purchaseRequestPrintVO.setApplicantName(requestById.getApplicantName());
+ purchaseRequestPrintVO.setRemarks(decentralizeDetails.getRemarks());
+
+ purchaseRequestPrintVO.setSubtotal(purchaseRequestPrintVO.getUnitPrice() * purchaseRequestPrintVO.getQuantity());
+ //查找出供应商名称
+ purchaseRequestPrintVO.setSupplierName(supplierInformationService.getById(purchaseListDetailsService.getById(decentralizeDetails.getPurchaseListDetailsId()).getSupplierId()).getSupplierName());
+
+ purchaseRequestPrintVOList.add(purchaseRequestPrintVO);}
+ }
+ }
+ return purchaseRequestPrintVOList;
+ }
+ @Override
+ public void purchaseRequestTablePDF(List voList, String id, String type, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
+ System.out.println("purchaseRequestTablePDF.................");
+
+ int x = 1;
+
+ double total = 0;
+
+ for (PurchaseRequestPrintVO purchaseRequestPrintVO : voList) {
+ purchaseRequestPrintVO.setI(x);
+ total = total + purchaseRequestPrintVO.getSubtotal();
+ x++;
+ }
+
+ String firstAuditName =null;
+ String secondAuditName = null;
+ String thirdAuditName = null;
+ String fourthAuditName = null;
+ String commitTime = null;
+
+ //-----------------------------
+ // 生成 word 版本的 采购目录
+
+ if (type.equals("集中采购申请")){
+
+ CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(id);
+ PurchasingPlanVO byId = purchasingPlanService.getPurchasingPlanVO(centralizedRequestVO.getPurchasingPlanId());
+ firstAuditName = centralizedRequestVO.getAuditorName();
+ secondAuditName = byId.getCreateName();
+ thirdAuditName = byId.getPrimaryAuditorName();
+ fourthAuditName = byId.getApproverName();
+ commitTime = LocalDateTimeUtil.format(centralizedRequestVO.getDateOfApplication(),"yyyy年MM月dd日");
+
+ }
+ else {
+ DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(id);
+ firstAuditName = requestById.getPrimaryAuditorName();
+ secondAuditName = requestById.getSecondaryAuditorName();
+ thirdAuditName = requestById.getThreeLevelAuditName();
+ fourthAuditName = requestById.getApproverName();
+ commitTime = LocalDateTimeUtil.format(requestById.getCommitTime(),"yyyy年MM月dd日");
+ }
+ 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();
+
+ ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false);
+ builder.bind("voList", policy).build();
+
+ /**
+ * 循环表格
+ */
+ double finalTotal = total;
+ String finalFourthAuditName = fourthAuditName;
+ String finalSecondAuditName = secondAuditName;
+ String finalThirdAuditName = thirdAuditName;
+ String finalFirstAuditName = firstAuditName;
+ String finalCommitTime = commitTime;
+ XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
+ new HashMap() {{
+ put("voList", voList);
+ put("id", id);
+ put("size", 1);
+ put("total", finalTotal);
+ put("finalFirstAuditName", finalFirstAuditName);
+ put("finalSecondAuditName", finalSecondAuditName);
+ put("finalThirdAuditName", finalThirdAuditName);
+ put("finalFourthAuditName", finalFourthAuditName);
+ put("commitTime", finalCommitTime);
+ }}
+ );
+ 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" + "/" + "purchaseRequest" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
+ isPDF.close();
+
+
+ System.out.println(String.format("转换为 PDF 结束"));
+
+ }
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizeDetailsServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizeDetailsServiceImpl.java
index ca04d03..406bfb1 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizeDetailsServiceImpl.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizeDetailsServiceImpl.java
@@ -5,7 +5,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import digital.laboratory.platform.reagent.entity.DecentralizeDetails;
import digital.laboratory.platform.reagent.mapper.DecentralizeDetailsMapper;
import digital.laboratory.platform.reagent.service.DecentralizeDetailsService;
-import digital.laboratory.platform.reagent.vo.DecentralizeDetailsVO;
+import digital.laboratory.platform.reagent.service.DecentralizedRequestService;
+import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -23,6 +24,9 @@ public class DecentralizeDetailsServiceImpl extends ServiceImpl getDecentralizeDetailsList(String decentralizedRequestId) {
@@ -34,4 +38,14 @@ public class DecentralizeDetailsServiceImpl extends ServiceImpl decentralizeDetailsList = baseMapper.getDecentralizeDetailsList(id);
+
+ DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(decentralizeDetailsList.get(0).getDecentralizedRequestId());
+
+ return requestById;
+ }
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizedRequestServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizedRequestServiceImpl.java
index 2e60cee..24df805 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizedRequestServiceImpl.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizedRequestServiceImpl.java
@@ -301,6 +301,9 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>();
- referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getNumber, reagentConsumablesSet.getReferenceMaterialNumber());
-
- ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(referenceMaterialLambdaQueryWrapper);
+ ReferenceMaterial referenceMaterial = referenceMaterialService.getById(reagentConsumablesSet.getReferenceMaterialId());
outgoingContents.setReferenceMaterialId(referenceMaterial.getId());
@@ -118,10 +116,13 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImplquery()
.eq("claim_code", claimCode));
+ if (applicationForUse==null){
+
+ return null;
+ }
+
DeliveryRegistrationFormVO deliveryRegistrationFormVOById = baseMapper.getDeliveryRegistrationFormVOById(applicationForUse.getDeliveryRegistrationFormId());
LambdaQueryWrapper outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>();
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/InstructionBookServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/InstructionBookServiceImpl.java
index 837779a..a768c50 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/impl/InstructionBookServiceImpl.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/InstructionBookServiceImpl.java
@@ -36,9 +36,9 @@ public class InstructionBookServiceImpl extends ServiceImpl instructionBookLambdaQueryWrapper = new LambdaQueryWrapper<>();
-
- instructionBookLambdaQueryWrapper.eq(InstructionBook::getReferenceMaterialTypeId,id);
-
- InstructionBook one = instructionBookService.getOne(instructionBookLambdaQueryWrapper);
-
- InstructionBookVO instructionBookVO = new InstructionBookVO();
-
-
- if (one!=null){
-
- BeanUtils.copyProperties(one,instructionBookVO);
-
- }
+ InstructionBookVO instructionBookVO = baseMapper.getInstructionBookVO(id);
ReagentConsumables byId = reagentConsumablesService.getById(id);
-
instructionBookVO.setReagentConsumables(byId);
-
return instructionBookVO;
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/PeriodVerificationImplementationServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/PeriodVerificationImplementationServiceImpl.java
index 6da2b53..dcd91ce 100644
--- a/src/main/java/digital/laboratory/platform/reagent/service/impl/PeriodVerificationImplementationServiceImpl.java
+++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/PeriodVerificationImplementationServiceImpl.java
@@ -47,6 +47,7 @@ import java.util.HashMap;
* @describe (标准物质期间核查实施情况及结果记录表) 服务实现类
*/
@Service
+@SuppressWarnings("all")
public class PeriodVerificationImplementationServiceImpl extends ServiceImpl