增加修改试剂耗材位置信息日志功能

main
杨海航 1 year ago
parent 2ba2ad0219
commit 459296d64d
  1. 12
      pom.xml
  2. 69
      src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java
  3. 3
      src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java
  4. 10
      src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java
  5. 6
      src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java
  6. 14
      src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java
  7. 9
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java
  8. 381
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java
  9. 2
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardReserveSolutionServiceImpl.java
  10. 21
      src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java
  11. 20
      src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryFullVO.java
  12. 2
      src/main/resources/bootstrap.yml
  13. 27
      src/main/resources/mapper/ReagentConsumableInventoryMapper.xml

@ -143,12 +143,7 @@
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<!-- poi-tl word 模板处理器 http://deepoove.com/poi-tl -->
<dependency>
<groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId>
<version>1.12.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
@ -201,13 +196,16 @@
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
<!-- poi-tl word 模板处理器 http://deepoove.com/poi-tl -->
<dependency>
<groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId>
<version>1.12.0</version>
</dependency>
</dependencies>
<build>

@ -1,6 +1,7 @@
package digital.laboratory.platform.reagent.controller;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -153,6 +154,12 @@ public class ReagentConsumableInventoryController {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryREVOList(page, Wrappers.<ReagentConsumableInventory>query()
// .like(StrUtil.isNotBlank(category), "category", category)
// .ne("category", "标准物质")
// .ne("category", "标准储备溶液")
// .and(qw -> qw.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
// .or().like(StrUtil.isNotBlank(reagentConsumableName), "remark", reagentConsumableName))
// .like(warning != null && warning == 1, "warning_information", "库存不足"), warning);
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.like(StrUtil.isNotBlank(category), "category", category)
@ -196,22 +203,7 @@ public class ReagentConsumableInventoryController {
@GetMapping("/MList")
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
public R<IPage<ReagentConsumableInventoryFullVO>> getReagentConsumablePage(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
QueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryQueryWrapper = new QueryWrapper<>();
IPage reagentConsumablePage = reagentConsumableInventoryMapper.getReagentConsumablePage(page, reagentConsumableName);
// IPage<ReagentConsumableInventoryFullVO> allRM = reagentConsumableInventoryService.getAllRM(page, reagentConsumableInventoryQueryWrapper
// .eq("category", "试剂")
// .like(!StrUtil.isEmpty(reagentConsumableName), "reagent_consumable_name", reagentConsumableName).or()
// .eq("category", "试剂")
// .like(!StrUtil.isEmpty(reagentConsumableName), "species", reagentConsumableName).or()
// .eq("category", "耗材")
// .like(!StrUtil.isEmpty(reagentConsumableName), "reagent_consumable_name", reagentConsumableName).or()
// .eq("category", "耗材")
// .like(!StrUtil.isEmpty(reagentConsumableName), "species", reagentConsumableName));
return R.ok(reagentConsumablePage);
}
@ -257,7 +249,6 @@ public class ReagentConsumableInventoryController {
throw new RuntimeException("未查询到相关信息");
}
String applyFileName = "标准物质一览表-" + id;
String pdfFilePath = "document" + "/" + "referenceMaterial" + "/" + id + "/" + applyFileName + ".pdf";
@ -283,7 +274,6 @@ public class ReagentConsumableInventoryController {
// @PreAuthorize("@pms.hasAnyPermission('reagent_reagent_consumable_inventory_get')")
public String getBarCodeImageBase64(String code, HttpServletResponse httpServletResponse) throws IOException {
return reagentConsumableInventoryService.buildCodeLabelContent(code);
}
@ -297,7 +287,6 @@ public class ReagentConsumableInventoryController {
// @PreAuthorize("@pms.hasAnyPermission('reagent_reagent_consumable_inventory_get')")
public String printSolutionTag(String code, HttpServletResponse httpServletResponse) throws IOException {
return reagentConsumableInventoryService.printSolutionTag(code);
@ -312,9 +301,7 @@ public class ReagentConsumableInventoryController {
@PutMapping("/code")
@PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
public R<String> setCode(String id, String code, HttpServletResponse httpServletResponse) {
reagentConsumableInventoryService.setCode(id, code);
return R.ok("录入成功");
}
@ -328,9 +315,7 @@ public class ReagentConsumableInventoryController {
@PutMapping("/RMCode")
@PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
public R<String> setRMCode(String id, String code, HttpServletResponse httpServletResponse) {
reagentConsumableInventoryService.setRMCode(id, code);
return R.ok("录入成功");
}
@ -343,16 +328,11 @@ public class ReagentConsumableInventoryController {
@GetMapping("/getByCode")
@PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get_by_code')")
public R<ReagentConsumableInventoryFullVO> getByCode(String id, String number, HttpServletResponse httpServletResponse) {
if (StrUtil.isNotBlank(number)) {
ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(Wrappers.<ReferenceMaterial>query().eq("number", number));
if (referenceMaterial != null) {
return R.ok(reagentConsumableInventoryService.getByCode(referenceMaterial.getId()));
} else {
return R.failed("未能查询到该标准物质的详细信息");
}
}
@ -382,24 +362,19 @@ public class ReagentConsumableInventoryController {
@GetMapping("/userList")
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_add')")
public R<List<UserVO>> getUserList(HttpServletResponse httpServletResponse) {
return R.ok(reagentConsumableInventoryService.getUserList());
}
@PostMapping("inventory/entry")
public R<String> inventoryEntry(@RequestBody List<ReagentConsumableInventoryDTO> reagentConsumableInventoryDTOList, HttpServletResponse httpServletResponse) {
reagentConsumableInventoryService.inventoryEntry(reagentConsumableInventoryDTOList);
return R.ok("导入成功");
}
@PostMapping("org")
public R<List<OrgFullVO>> getOrgList(HttpServletResponse httpServletResponse) {
List<OrgFullVO> orgList = reagentConsumableInventoryService.getOrgList();
return R.ok(orgList);
}
@ -420,4 +395,34 @@ public class ReagentConsumableInventoryController {
public R<Map> getBatch(@PathVariable String batchDetailsId) {
return R.ok(reagentConsumableInventoryService.getBatchVO(batchDetailsId));
}
@PostMapping("/getExcel")
@ApiOperation(value = "导出试剂耗材库存表")
public R<String> getExcel(HttpServletResponse httpServletResponse) throws Exception {
String fileName = reagentConsumableInventoryService.getExcel();
String ossPath = "document" + "/" + "reagentConsumableInventory" + "/" + fileName;
if (StrUtil.isNotBlank(fileName)) {
ossFile.fileGet(ossPath, httpServletResponse.getOutputStream());
httpServletResponse.setContentType(fileName);
return R.ok(fileName);
} else {
return R.failed("导出失败");
}
}
@PostMapping("/check/any")
@ApiOperation(value = "导入盘点库存表",
notes = "根据Excel需要传入的对象的参数映射:" + "\n" +
"1.批次ID:batchDetailsId" + "\n" +
"2.实际房间:practicalRoomNo" + "\n" +
"3.实际位置:practicalLocation" + "\n" +
"4..实际数量(数字类型,不能小数):practicalQuantity")
public R<String> checkAny(@RequestBody List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList) {
boolean b = reagentConsumableInventoryService.checkObj(reagentConsumableInventoryFullVOList);
if (b) {
return R.ok("导入成功");
} else {
return R.failed("导出失败");
}
}
}

@ -87,7 +87,7 @@ public class StandardReserveSolutionController {
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_page')")
public R<IPage<StandardReserveSolutionVO>> getStandardReserveSolutionPage(Page<StandardReserveSolution> page, String rid, String solutionName, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) throws ParseException {
public R<IPage<StandardReserveSolutionVO>> getStandardReserveSolutionPage(Page<StandardReserveSolution> page, String rid, String solutionName, String status, @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();
@ -95,6 +95,7 @@ public class StandardReserveSolutionController {
.like(StrUtil.isNotBlank(solutionName), "solution_name", solutionName)
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
.eq(StrUtil.isNotBlank(status), "status", status)
.orderByDesc("create_time")
.eq(StrUtil.isNotBlank(rid), "reference_material_id", rid));
return R.ok(standardReserveSolutionSList);

@ -22,13 +22,21 @@ import java.util.List;
public interface ReagentConsumableInventoryMapper extends BaseMapper<ReagentConsumableInventory> {
IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryVOPage(IPage<ReagentConsumableInventory> page, @Param(Constants.WRAPPER) QueryWrapper<ReagentConsumableInventory> qw);
IPage<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFullVOPage(IPage<ReagentConsumableInventory> page, @Param(Constants.WRAPPER) QueryWrapper<ReagentConsumableInventory> qw);
IPage<ReagentConsumableInventoryFullVO> getFullVOPage(IPage<ReagentConsumableInventory> page, @Param("name") String name, @Param("category") String category);
List<UserVO> getUserList();
List<OrgVO> getOrgList();
IPage<ReferenceMaterialFullVO> getReferenceMaterialPage(IPage<ReagentConsumableInventory> page, @Param(Constants.WRAPPER) QueryWrapper<ReferenceMaterial> qw);
IPage<ReferenceMaterialFullVO> getReagentConsumablePage (IPage<ReagentConsumableInventory>page, @Param("name") String name );
IPage<ReagentConsumableInventoryFullVO> getReagentConsumablePage(IPage<ReagentConsumableInventory> page, @Param("name") String name);
List<ReagentConsumableInventoryFullVO> getReagentConsumableList();
String getCellName(String id);
}

@ -13,6 +13,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@ -69,5 +70,10 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
Map<String, Object> getBatchVO(String id);
String getExcel() throws IOException;
@Transactional
boolean checkObj(List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList);
// List<OrgFullVO> getOrgList();
}

@ -40,26 +40,15 @@ public class BatchDetailsServiceImpl extends ServiceImpl<BatchDetailsMapper, Bat
public List<BatchDetailsVO> getBatchDetailsList(String reagentConsumableInventoryId) {
LambdaQueryWrapper<BatchDetails> batchDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
batchDetailsLambdaQueryWrapper.eq(BatchDetails::getReagentConsumableInventoryId, reagentConsumableInventoryId)
.eq(BatchDetails::getServiceStatus, 1);
List<BatchDetails> list = this.list(batchDetailsLambdaQueryWrapper);
ReagentConsumableInventory byId = reagentConsumableInventoryService.getById(reagentConsumableInventoryId);
List<BatchDetailsVO> batchDetailsVOS = new ArrayList<>();
for (BatchDetails batchDetails : list) {
SupplierInformation byId1 = supplierInformationService.getById(batchDetails.getSupplierId());
BatchDetailsVO batchDetailsVO = new BatchDetailsVO();
BeanUtils.copyProperties(batchDetails, batchDetailsVO);
batchDetailsVO.setSupplierName(byId1.getSupplierName());
batchDetailsVOS.add(batchDetailsVO);
}
return batchDetailsVOS;
@ -94,9 +83,6 @@ public class BatchDetailsServiceImpl extends ServiceImpl<BatchDetailsMapper, Bat
for (BatchDetails batchDetails : list) {
String latticeId = batchDetails.getLatticeId();
reagentConsumableInventoryService.updateCabinet(latticeId, batchDetails.getReagentConsumableInventoryId(), 1);
System.out.println("已成功更新" + batchDetails.getReagentConsumableName() + "的柜子信息");
System.out.println("已成功更新" + x + "条记录");
x++;
}
}
}

@ -61,23 +61,14 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
Integer i = 1;
for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) {
CatalogueDetails catalogueDetails = new CatalogueDetails();
BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails);
catalogueDetails.setCatalogueDetailsId(IdWorker.get32UUID().toUpperCase());
catalogueDetails.setPurchaseCatalogueId(purchaseCatalogue.getPurchaseCatalogueId());
String yyyy = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy");
catalogueDetails.setPurchaseCatalogueNumber(yyyy + "-" + i.toString());
i++;
catalogueDetailsList.add(catalogueDetails);
typeTableService.addSpecies(catalogueDetails.getCategory(), catalogueDetails.getSpecies());
}

@ -1,5 +1,6 @@
package digital.laboratory.platform.reagent.service.impl;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -28,16 +29,28 @@ import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData;
import digital.laboratory.platform.sys.feign.RemoteCabinetService;
import feign.Response;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import javax.swing.*;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
@ -103,11 +116,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
List<ReagentConsumableInventoryVO> reagentConsumableInventoryVOList = new ArrayList<>();
List<BatchDetails> list = batchDetailsService.list(Wrappers.<BatchDetails>query()
.eq("warning_information", "即将过期").or()
.eq("warning_information", "已过期").or()
.eq("warning_information", "即将到达存储期限").or()
.eq("warning_information", "已超过存储期限"));
List<BatchDetails> list = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("warning_information", "即将过期").or().eq("warning_information", "已过期").or().eq("warning_information", "即将到达存储期限").or().eq("warning_information", "已超过存储期限"));
if (list.size() != 0) {
for (BatchDetails batchDetails : list) {
@ -146,46 +155,27 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Override//试剂耗材管理列表
public IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryREVOList(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw, Integer warning) {
if (warning != null) {
if (warning == 2) {
if (warning != null && warning == 2) {
List<ReagentConsumableInventoryVO> reagentConsumableInventoryVOList = new ArrayList<>();
List<BatchDetails> list = batchDetailsService.list(Wrappers.<BatchDetails>query()
.eq("warning_information", "即将过期").or()
.eq("warning_information", "已过期").or()
.eq("warning_information", "即将到达存储期限").or()
.eq("warning_information", "已超过存储期限"));
List<BatchDetails> list = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("warning_information", "即将过期").or().eq("warning_information", "已过期").or().eq("warning_information", "即将到达存储期限").or().eq("warning_information", "已超过存储期限"));
//查找具有到期批次物品的试剂耗材类信息
if (list.size() != 0) {
if (list != null && list.size() != 0) {
for (BatchDetails batchDetails : list) {
ReagentConsumableInventory byId = this.getById(batchDetails.getReagentConsumableInventoryId());
ReagentConsumableInventory reagentConsumableInventory = this.getOne(new LambdaQueryWrapper<ReagentConsumableInventory>().eq(ReagentConsumableInventory::getReagentConsumableInventoryId, batchDetails.getReagentConsumableInventoryId()).ne(ReagentConsumableInventory::getCategory, "标准物质").ne(ReagentConsumableInventory::getCategory, "标准储备溶液"));
if (reagentConsumableInventory != null) {
ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO();
BeanUtils.copyProperties(byId, reagentConsumableInventoryVO);
BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryVO);
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId()));
if (!reagentConsumableInventoryVOList.contains(reagentConsumableInventoryVO)) {
if (reagentConsumableInventoryVO.getCategory().equals("试剂") || reagentConsumableInventoryVO.getCategory().equals("耗材")) {
reagentConsumableInventoryVOList.add(reagentConsumableInventoryVO);
}
}
}
}
PageUtils pageUtils = new PageUtils();
return pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), reagentConsumableInventoryVOList);
}
}
IPage<ReagentConsumableInventoryVO> reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, qw);
List<ReagentConsumableInventoryVO> records = reagentConsumableInventoryVOPage.getRecords();
for (ReagentConsumableInventoryVO reagentConsumableInventoryVO : records) {
List<BatchDetailsVO> batchDetailsVOList = batchDetailsService.getBatchDetailsList(reagentConsumableInventoryVO.getReagentConsumableInventoryId());
//赋值试剂耗材批次明细
reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsVOList);
@ -262,24 +252,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
IPage<ReferenceMaterialFullVO> referenceMaterialPage = baseMapper.getReferenceMaterialPage(page, qw);
// List<ReferenceMaterialFullVO> referenceMaterialPageRecords = referenceMaterialPage.getRecords();
//
// LambdaQueryWrapper<StandardReserveSolution> standardReserveSolutionQueryWrapper = new LambdaQueryWrapper<>();
//
// for (ReferenceMaterialFullVO referenceMaterialPageRecord : referenceMaterialPageRecords) {
// standardReserveSolutionQueryWrapper.eq(StandardReserveSolution::getReferenceMaterialId,referenceMaterialPageRecord.getReferenceMaterialId());
// StandardReserveSolution standardReserveSolution = standardReserveSolutionService.getOne(standardReserveSolutionQueryWrapper);
//
// if (standardReserveSolution != null) {
//
//
// referenceMaterialPageRecord.setConfigurationConcentration(standardReserveSolution.getConfigurationConcentration());
// referenceMaterialPageRecord.setConfigurationDate(standardReserveSolution.getConfigurationDate());
// referenceMaterialPageRecord.setSolutionNumbering(standardReserveSolution.getSolutionNumbering());
// referenceMaterialPageRecord.setValidityPeriod(standardReserveSolution.getValidityPeriod());
// }
// }
return referenceMaterialPage;
}
@ -331,7 +303,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
return reagentConsumableInventoryFullVO;
}
//分页查询试剂耗材
@Override
public IPage<ReagentConsumableInventoryFullVO> getAllRM(IPage<ReagentConsumableInventory> page, QueryWrapper<ReagentConsumableInventory> qw) {
@ -342,9 +313,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
for (ReagentConsumableInventory reagentConsumableInventory : list) {
List<BatchDetails> list1 = batchDetailsService.list(Wrappers.<BatchDetails>query()
.eq("reagent_consumable_inventory_id", reagentConsumableInventory.getReagentConsumableInventoryId())
.eq("service_status", 1));
List<BatchDetails> list1 = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", reagentConsumableInventory.getReagentConsumableInventoryId()).eq("service_status", 1));
//将不同批次的物品展示出来
for (BatchDetails batchDetails : list1) {
@ -383,8 +352,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
LambdaQueryWrapper<BatchDetails> batchDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
batchDetailsLambdaQueryWrapper.eq(BatchDetails::getReagentConsumableInventoryId, reagentConsumableInventory.getReagentConsumableInventoryId())
.or().eq(BatchDetails::getServiceStatus, 1);
batchDetailsLambdaQueryWrapper.eq(BatchDetails::getReagentConsumableInventoryId, reagentConsumableInventory.getReagentConsumableInventoryId()).or().eq(BatchDetails::getServiceStatus, 1);
List<BatchDetails> list1 = batchDetailsService.list(batchDetailsLambdaQueryWrapper);
//将不同批次的物品展示出来
@ -444,12 +412,10 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
/**
* 循环表格
*/
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(
new HashMap<String, Object>() {{
XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render(new HashMap<String, Object>() {{
put("voList", voList);
put("year", year);
}}
);
}});
bis.close();
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
@ -486,8 +452,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
ReagentConsumables byId = reagentConsumablesService.getById(id);
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query()
.eq("reagent_consumable_id", id));
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query().eq("reagent_consumable_id", id));
if (byId != null & one != null) {
byId.setCode(code);
@ -568,10 +533,11 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
for (ReagentConsumableInventoryDTO reagentConsumableInventoryDTO : reagentConsumableInventoryDTOList) {
Integer quantity = reagentConsumableInventoryDTO.getTotalQuantity() * reagentConsumableInventoryDTO.getPackagedCopies();
SupplierInformation supplier = supplierInformationService.getOne(Wrappers.<SupplierInformation>query().eq("supplier_name", reagentConsumableInventoryDTO.getSupplierName()));
String location = "F" + reagentConsumableInventoryDTO.getRoomNo().charAt(0) + "-" + reagentConsumableInventoryDTO.getRoomNo() + "_试剂柜-" + reagentConsumableInventoryDTO
.getLocation().charAt(0) + "_" + reagentConsumableInventoryDTO.getLocation();
R<CabinetCell> cabinetCellR = remoteCabinetService.queryCellByRoomNoAndLocation(reagentConsumableInventoryDTO.getRoomNo(), reagentConsumableInventoryDTO.getLocation());
CabinetCell cabinetCell = cabinetCellR.getData();
String cabinetId = cabinetCellR.getData().getCabinetId();
String cellName = baseMapper.getCellName(cabinetId);
String location = "F" + reagentConsumableInventoryDTO.getRoomNo().charAt(0) + "-" + reagentConsumableInventoryDTO.getRoomNo() + "_" + cellName + "_" + reagentConsumableInventoryDTO.getLocation();
if (!StrUtil.isNotBlank(reagentConsumableInventoryDTO.getStandardValueOrPurity())) {
reagentConsumableInventoryDTO.setStandardValueOrPurity("");
}
@ -597,22 +563,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
reagentConsumableInventoryDTO.setAlias("");
}
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query()
.eq("reagent_consumable_name", reagentConsumableInventoryDTO.getReagentConsumableName())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getBrand()), "brand", reagentConsumableInventoryDTO.getBrand())
.eq("category", reagentConsumableInventoryDTO.getCategory())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecificationAndModel()), "specification_and_model", reagentConsumableInventoryDTO.getSpecificationAndModel())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getStandardValueOrPurity()), "standard_value_or_purity", reagentConsumableInventoryDTO.getStandardValueOrPurity())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getCasNumber()), "cas_number", reagentConsumableInventoryDTO.getCasNumber())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecies()), "species", reagentConsumableInventoryDTO.getSpecies())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getEnglishName()), "english_name", reagentConsumableInventoryDTO.getEnglishName())
.eq(reagentConsumableInventoryDTO.getPackagedCopies() != null, "packaged_copies", reagentConsumableInventoryDTO.getPackagedCopies())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getAlias()), "alias", reagentConsumableInventoryDTO.getAlias())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getPurityGrade()), "purity_grade", reagentConsumableInventoryDTO.getPurityGrade())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getDeviationOrUncertainty()), "deviation_or_uncertainty", reagentConsumableInventoryDTO.getDeviationOrUncertainty())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getMinimumUnit()), "minimum_unit", reagentConsumableInventoryDTO.getMinimumUnit())
);
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query().eq("reagent_consumable_name", reagentConsumableInventoryDTO.getReagentConsumableName()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getBrand()), "brand", reagentConsumableInventoryDTO.getBrand()).eq("category", reagentConsumableInventoryDTO.getCategory()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecificationAndModel()), "specification_and_model", reagentConsumableInventoryDTO.getSpecificationAndModel()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getStandardValueOrPurity()), "standard_value_or_purity", reagentConsumableInventoryDTO.getStandardValueOrPurity()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getCasNumber()), "cas_number", reagentConsumableInventoryDTO.getCasNumber()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecies()), "species", reagentConsumableInventoryDTO.getSpecies()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getEnglishName()), "english_name", reagentConsumableInventoryDTO.getEnglishName()).eq(reagentConsumableInventoryDTO.getPackagedCopies() != null, "packaged_copies", reagentConsumableInventoryDTO.getPackagedCopies()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getAlias()), "alias", reagentConsumableInventoryDTO.getAlias()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getPurityGrade()), "purity_grade", reagentConsumableInventoryDTO.getPurityGrade()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getDeviationOrUncertainty()), "deviation_or_uncertainty", reagentConsumableInventoryDTO.getDeviationOrUncertainty()).eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getMinimumUnit()), "minimum_unit", reagentConsumableInventoryDTO.getMinimumUnit()));
BatchDetails batchDetails = new BatchDetails();
batchDetails.setServiceStatus(1);
batchDetails.setQuantity(quantity);
@ -639,8 +590,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
} else {
batchDetails.setExpirationDate(LocalDate.now().plusYears(99));
}
R<CabinetCell> cabinetCellR = remoteCabinetService.queryCellByRoomNoAndLocation(reagentConsumableInventoryDTO.getRoomNo(), reagentConsumableInventoryDTO.getLocation());
CabinetCell cabinetCell = cabinetCellR.getData();
batchDetails.setLatticeId(cabinetCell.getId());
batchDetails.setBoxId(cabinetCell.getCabinetId());
batchDetails.setLocation(location);
@ -659,9 +608,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
batchDetails.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId());
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(one.getReagentConsumableId());
if (!one.getCategory().equals("标准物质")) {
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query()
.eq("room_no", reagentConsumableInventoryDTO.getRoomNo())
.eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId()));
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query().eq("room_no", reagentConsumableInventoryDTO.getRoomNo()).eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId()));
if (reagentConsumableStash != null) {
reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + quantity);
batchDetails.setReagentConsumableStashId(reagentConsumableStash.getId());
@ -717,9 +664,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1);
if (!reagentConsumableInventory.getCategory().equals("标准物质")) {
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query()
.eq("room_no", reagentConsumableInventoryDTO.getRoomNo())
.eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId()));
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query().eq("room_no", reagentConsumableInventoryDTO.getRoomNo()).eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId()));
if (reagentConsumableStash != null) {
reagentConsumableStash.setTotalQuantity(reagentConsumableStash.getTotalQuantity() + quantity);
batchDetails.setReagentConsumableStashId(reagentConsumableStash.getId());
@ -801,16 +746,19 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
BatchDetails oldBatchDetails = batchDetailsService.getById(batchDetails.getBatchDetailsId());
String oldLocation = oldBatchDetails.getLocation();
this.updateCabinet(oldBatchDetails.getLatticeId(), oldBatchDetails.getReagentConsumableInventoryId(), -1);//清除原来位置信息ID
//需同步至试剂耗材仓库库存表
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getById(oldBatchDetails.getReagentConsumableStashId());
oldBatchDetails.setLocation(batchDetails.getLocation());
oldBatchDetails.setBoxId(batchDetails.getBoxId());
oldBatchDetails.setLatticeId(batchDetails.getLatticeId());
String[] split = batchDetails.getLocation().split("_");
String roomNo = split[1];
oldBatchDetails.setRoomNo(roomNo);
reagentConsumableStash.setRoomNo(roomNo);
if (batchDetailsService.updateById(oldBatchDetails)) {
this.updateCabinet(oldBatchDetails.getLatticeId(), oldBatchDetails.getReagentConsumableInventoryId(), 1);
reagentConsumableStashService.updateById(reagentConsumableStash);
locationInfoService.addInfo(oldBatchDetails.getBatchDetailsId(), oldLocation, batchDetails.getLocation());
return true;
} else return false;
@ -839,4 +787,257 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
}
@Override
public String getExcel() throws IOException {
String Path = "C:\\tmp\\upload\\";
List<ReagentConsumableInventoryFullVO> reagentConsumableList = baseMapper.getReagentConsumableList();
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFCellStyle cellStyle = workbook.createCellStyle();
HSSFCellStyle cellStyle1 = workbook.createCellStyle();
cellStyle1.setAlignment(HorizontalAlignment.CENTER);
HSSFFont font1 = workbook.createFont();
font1.setFontHeightInPoints((short) 15);
cellStyle1.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
cellStyle1.setFillPattern(FillPatternType.SOLID_FOREGROUND);
cellStyle1.setFont(font1);
HSSFCellStyle cellStyle2 = workbook.createCellStyle();
cellStyle2.setAlignment(HorizontalAlignment.CENTER);
HSSFFont font2 = workbook.createFont();
font2.setFontName("微软雅黑");
cellStyle2.setFont(font2);
// cellStyle2.setWrapText(true);
HSSFSheet workbookSheet = workbook.createSheet("试剂耗材库存表");
workbookSheet.setColumnWidth(0, 15000);
workbookSheet.setColumnWidth(1, 3500);
workbookSheet.setColumnWidth(2, 4000);
workbookSheet.setColumnWidth(3, 15000);
workbookSheet.setColumnWidth(4, 3500);
workbookSheet.setColumnWidth(5, 3500);
workbookSheet.setColumnWidth(6, 3500);
workbookSheet.setColumnWidth(7, 3500);
workbookSheet.setColumnWidth(8, 3500);
workbookSheet.setColumnWidth(9, 3500);
workbookSheet.setColumnWidth(10, 3500);
workbookSheet.setColumnWidth(11, 3500);
workbookSheet.setColumnWidth(12, 10000);
HSSFFont font = workbook.createFont();
HSSFRow row0 = workbookSheet.createRow(0);
cellStyle.setAlignment(HorizontalAlignment.CENTER);
row0.setRowStyle(cellStyle);
for (int i = 0; i < 13; i++) {
HSSFCell cell = row0.createCell(i);
if (i == 0) {
LocalDateTime dateTime = LocalDateTime.now();
cell.setCellValue(LocalDateTimeUtil.format(dateTime, "yyyy 年 MM 月 dd 日") + "试剂耗材实时库存报表");
font.setFontHeightInPoints((short) 28);
font.setColor((short) 25);
// font.setBoldweight((short) 1);
//设置字体斜体
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
cellStyle.setFillForegroundColor(IndexedColors.TAN.getIndex());
font.setItalic(true);
cellStyle.setFont(font);
cell.setCellStyle(cellStyle);
}
}
CellRangeAddress cellRangeAddress = new CellRangeAddress(0, 0, 0, 12);
workbookSheet.addMergedRegion(cellRangeAddress);
HSSFRow row = workbookSheet.createRow(1);
HSSFCell cell0 = row.createCell(0);
cell0.setCellValue("试剂耗材名称");
HSSFCell cell1 = row.createCell(1);
cell1.setCellValue("类型");
HSSFCell cell2 = row.createCell(2);
cell2.setCellValue("品牌");
cell2.setCellStyle(cellStyle1);
HSSFCell cell3 = row.createCell(3);
cell3.setCellValue("规格型号");
HSSFCell cell4 = row.createCell(4);
cell4.setCellValue("批次");
HSSFCell cell5 = row.createCell(5);
cell5.setCellValue("房间号");
HSSFCell cell6 = row.createCell(6);
cell6.setCellValue("位置信息");
HSSFCell cell7 = row.createCell(7);
cell7.setCellValue("入库时间");
HSSFCell cell8 = row.createCell(8);
cell8.setCellValue("数量");
HSSFCell cell9 = row.createCell(9);
cell9.setCellValue("实际房间");
HSSFCell cell10 = row.createCell(10);
cell10.setCellValue("实际位置");
HSSFCell cell111 = row.createCell(11);
cell111.setCellValue("实际数量");
HSSFCell cell12 = row.createCell(12);
cell12.setCellValue("批次ID(请勿修改)");
cell0.setCellStyle(cellStyle1);
cell1.setCellStyle(cellStyle1);
cell2.setCellStyle(cellStyle1);
cell3.setCellStyle(cellStyle1);
cell4.setCellStyle(cellStyle1);
cell5.setCellStyle(cellStyle1);
cell6.setCellStyle(cellStyle1);
cell7.setCellStyle(cellStyle1);
cell8.setCellStyle(cellStyle1);
cell9.setCellStyle(cellStyle1);
cell10.setCellStyle(cellStyle1);
cell111.setCellStyle(cellStyle1);
cell12.setCellStyle(cellStyle1);
int index = 2;
for (ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO : reagentConsumableList) {
HSSFRow row1 = workbookSheet.createRow(index);
HSSFCell cell00 = row1.createCell(0);
cell00.setCellStyle(cellStyle2);
cell00.setCellValue(reagentConsumableInventoryFullVO.getReagentConsumableName());
HSSFCell cell11 = row1.createCell(1);
cell11.setCellValue(reagentConsumableInventoryFullVO.getCategory());
HSSFCell cell22 = row1.createCell(2);
cell22.setCellValue(reagentConsumableInventoryFullVO.getBrand());
HSSFCell cell33 = row1.createCell(3);
cell33.setCellValue(reagentConsumableInventoryFullVO.getSpecificationAndModel());
HSSFCell cell44 = row1.createCell(4);
cell44.setCellValue(reagentConsumableInventoryFullVO.getBatch());
HSSFCell cell55 = row1.createCell(5);
cell55.setCellValue(reagentConsumableInventoryFullVO.getRoomNo());
HSSFCell cell66 = row1.createCell(6);
String location = reagentConsumableInventoryFullVO.getLocation();
String substring = location.substring(location.length() - 4, location.length());
cell66.setCellValue(substring);
HSSFCell cell77 = row1.createCell(7);
cell77.setCellValue(LocalDateTimeUtil.format(reagentConsumableInventoryFullVO.getBatchPurchaseTime(), "yyyy-MM-dd"));
HSSFCell cell88 = row1.createCell(8);
cell88.setCellValue(reagentConsumableInventoryFullVO.getQuantity());
HSSFCell cell99 = row1.createCell(12);
cell99.setCellValue(reagentConsumableInventoryFullVO.getBatchDetailsId());
index++;
cell00.setCellStyle(cellStyle2);
cell11.setCellStyle(cellStyle2);
cell22.setCellStyle(cellStyle2);
cell33.setCellStyle(cellStyle2);
cell44.setCellStyle(cellStyle2);
cell55.setCellStyle(cellStyle2);
cell66.setCellStyle(cellStyle2);
cell77.setCellStyle(cellStyle2);
cell88.setCellStyle(cellStyle2);
cell99.setCellStyle(cellStyle2);
}
LocalDateTime now = LocalDateTime.now();
String format = LocalDateTimeUtil.format(now, "yyyy-MM-dd");
String fileName = format + "试剂耗材库存表.xls";
FileOutputStream fileOutputStream = new FileOutputStream(Path + fileName);
workbook.write(fileOutputStream);
fileOutputStream.close();
File file = new File(Path + fileName);
FileItem fileItem = this.getMultipartFile(file, file.getName());
MultipartFile multipartFile = new CommonsMultipartFile(fileItem);
String ossPath = "document" + "/" + "reagentConsumableInventory";
boolean ret = ossFile.fileUpload(multipartFile, ossPath);
if (ret) {
Files.delete(Paths.get(Path + fileName));
return fileName;
}
return null;
}
private FileItem getMultipartFile(File file, String fieldName) {
FileItemFactory factory = new DiskFileItemFactory(16, null);
FileItem item = factory.createItem(fieldName, "text/plain", true, file.getName());
int bytesRead = 0;
byte[] buffer = new byte[8192];
try {
FileInputStream fis = new FileInputStream(file);
OutputStream os = item.getOutputStream();
while ((bytesRead = fis.read(buffer, 0, 8192)) != -1) {
os.write(buffer, 0, bytesRead);
}
os.close();
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
return item;
}
@Transactional
@Override
public boolean checkObj(List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList) {
ArrayList<ReagentConsumableInventory> reagentConsumableInventoryArrayList = new ArrayList<>();
ArrayList<ReagentConsumableStash> reagentConsumableStashArrayList = new ArrayList<>();
ArrayList<BatchDetails> batchDetailsArrayList = new ArrayList<>();
int index = 1;
long s = System.currentTimeMillis();
for (ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO : reagentConsumableInventoryFullVOList) {
long start = System.currentTimeMillis();
boolean loop = false;
String practicalRoomNo = reagentConsumableInventoryFullVO.getPracticalRoomNo();
String practicalLocation = reagentConsumableInventoryFullVO.getPracticalLocation();
Integer practicalQuantity = reagentConsumableInventoryFullVO.getPracticalQuantity();
//若没修改,则无需操作数据库,下面的判断是为了减轻查询压力
if (practicalQuantity != null || StrUtil.isNotBlank(practicalLocation) || StrUtil.isNotBlank(practicalRoomNo)) {
BatchDetails batchDetails = batchDetailsService.getById(reagentConsumableInventoryFullVO.getBatchDetailsId());
ReagentConsumableInventory reagentConsumableInventory = this.getById(batchDetails.getReagentConsumableInventoryId());
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getById(batchDetails.getReagentConsumableStashId());
if (practicalQuantity != null) {//修改数量
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() - batchDetails.getQuantity() + practicalQuantity);
batchDetails.setQuantity(practicalQuantity);
reagentConsumableStash.setTotalQuantity(practicalQuantity);
if (practicalQuantity == 0) {
batchDetails.setServiceStatus(-1);
}
}
if (StrUtil.isNotBlank(practicalRoomNo)) {
loop = true;//证明修改了位置,就要进行处理
}
if (StrUtil.isNotBlank(practicalLocation)) {
loop = true;
}
if (loop) {
// String location = practicalLocation;
// String substring = location.substring(location.length() - 4, location.length());
//修改位置,需清除原有位置信息,且需同步试剂耗材仓库库存信息表
R<CabinetCell> cabinetCellR = remoteCabinetService.queryCellByRoomNoAndLocation(practicalRoomNo, practicalLocation);
if (cabinetCellR == null) {
throw new RuntimeException(String.format("没有查询到你输入的房间与位置对应的柜子信息,是不是输错了呢?"));
}
CabinetCell cell = cabinetCellR.getData();
String cabinetId = cell.getCabinetId();
String cellName = baseMapper.getCellName(cabinetId);
String latticeId = cell.getId();
String boxId = cell.getCabinetId();
batchDetails.setRoomNo(practicalRoomNo);
reagentConsumableStash.setRoomNo(practicalRoomNo);
this.updateCabinet(batchDetails.getLatticeId(), batchDetails.getReagentConsumableInventoryId(), -1);//清除原来位置信息
batchDetails.setLatticeId(latticeId);
batchDetails.setBoxId(boxId);
String newLocation = "F" + batchDetails.getRoomNo().charAt(0) + "-" + batchDetails.getRoomNo() + "_" + cellName + "_" + practicalLocation;
batchDetails.setLocation(newLocation);
this.updateCabinet(latticeId, batchDetails.getReagentConsumableInventoryId(), 1);
}
reagentConsumableInventoryArrayList.add(reagentConsumableInventory);
batchDetailsArrayList.add(batchDetails);
reagentConsumableStashArrayList.add(reagentConsumableStash);
long end = System.currentTimeMillis();
System.out.println("消耗了" + (end - start) + "毫秒,修改了第" + index + "个试剂耗材");
index++;
}
}
if (this.updateBatchById(reagentConsumableInventoryArrayList) && batchDetailsService.updateBatchById(batchDetailsArrayList) && reagentConsumableStashService.updateBatchById(reagentConsumableStashArrayList)) {
long e = System.currentTimeMillis();
System.out.println("~~~~~~~~~~~~~~~~~消耗了" + (e - s) + "毫秒,共修改了" + index + "个试剂耗材");
return true;
}
return false;
}
}

@ -437,7 +437,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
put("solutionName", standardReserveSolutionVO.getSolutionName());
put("solutionNumbering", standardReserveSolutionVO.getSolutionNumbering());
put("referenceMaterialNumber", standardReserveSolutionVO.getReferenceMaterialNumber());
put("referenceMaterialScale", standardReserveSolutionVO.getReferenceMaterialScale());
put("referenceMaterialScale", standardReserveSolutionVO.getReferenceMaterialScale().toString());
put("useOfSolvent", standardReserveSolutionVO.getUseOfSolvent());
put("constantVolume", standardReserveSolutionVO.getConstantVolume());
put("configurationConcentration", String.format("%.4f", standardReserveSolutionVO.getConfigurationConcentration()));

@ -166,22 +166,15 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(Wrappers.<ReagentConsumableInventory>query().eq("reagent_consumable_id", warehousingContent.getReagentConsumableId()));
//录入仓库批次信息,若仓库不存在该物品,则新增该物品的库存信息
if (one == null) {
ReagentConsumableInventory reagentConsumableInventory = new ReagentConsumableInventory();//创建库存对象
BeanUtils.copyProperties(reagentConsumables, reagentConsumableInventory);//拷贝信息
if (!StrUtil.isNotBlank(warehousingRecordFormDTO.getBatchNumber())){
}
reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase());
reagentConsumableInventory.setStatus(1);//状态 1为正常
reagentConsumableInventory.setCreateTime(LocalDateTime.now());
reagentConsumableInventory.setUpdateTime(LocalDateTime.now());
reagentConsumableInventory.setWarningValue(warehousingRecordFormDTO.getWarningValue());//预警值
//如果供应商未提供物品编码,则需在入库时扫描标签录入编码
if (warehousingRecordFormDTO.getCode() != null) {
if (StrUtil.isNotBlank(warehousingRecordFormDTO.getCode())) {
reagentConsumableInventory.setCode(warehousingRecordFormDTO.getCode());
reagentConsumables.setCode(warehousingRecordFormDTO.getCode());
} else {
@ -189,9 +182,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
reagentConsumables.setCode("");
}
reagentConsumablesService.updateById(reagentConsumables);
BatchDetails batchDetails = new BatchDetails();//创建批次信息
int year = Calendar.getInstance().get(Calendar.YEAR);//获取当前年
BeanUtils.copyProperties(warehousingRecordFormDTO, batchDetails);//拷贝批次信息
@ -212,7 +203,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
} else {
batchDetails.setExpirationDate(LocalDate.now().plusYears(99));
}
batchDetails.setQuantity(quantity); //录入数量
batchDetails.setWarehousingBatchListId(warehousingBatchList.getId());//关联签收批次
@ -227,9 +217,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
reagentConsumableStash.setTotalQuantity(quantity);
reagentConsumableStashService.save(reagentConsumableStash);
}
warehousingBatchList.setBatchId(batchDetails.getBatchDetailsId());//关联签收批次
if (reagentConsumables.getCategory().equals("试剂") | reagentConsumables.getCategory().equals("耗材")) {
//更新格子信息(试剂耗材传入类ID)
reagentConsumableInventoryService.updateCabinet(batchDetails.getLatticeId(), reagentConsumableInventory.getReagentConsumableInventoryId(), 1);
@ -307,7 +295,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
batchDetails.setReagentConsumableName(reagentConsumables.getReagentConsumableName());
if (!reagentConsumables.getCategory().equals("标准物质")) {
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query()
.eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId())
.eq("room_no", roomNo));
@ -326,7 +313,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
}
}
int year = Calendar.getInstance().get(Calendar.YEAR);
Integer years = Integer.valueOf(year);//进行包装,方便运算
//查询相同年份相同供应商相同物品的所有批次信息
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId())
@ -463,17 +449,12 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
warehousingRecordForm.setStatus(1);
}
this.updateById(warehousingRecordForm);
}
@Override
public IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm> qw) {
IPage<WarehousingRecordFormVO> warehousingRecordFormVOPage = baseMapper.getWarehousingRecordFormVOPage(page, qw);//查询签收单列表
List<WarehousingRecordFormVO> records = warehousingRecordFormVOPage.getRecords();
for (WarehousingRecordFormVO record : records) {
List<WarehousingContent> warehousingContents = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", record.getId()));
//计算签收(购买)物品总数与已签收数量
for (WarehousingContent warehousingContent : warehousingContents) {

@ -62,6 +62,26 @@ public class ReagentConsumableInventoryFullVO extends ReagentConsumableInventory
@ApiModelProperty(value = "(打印序号)")
private Integer i;
@ApiModelProperty(value = "房间号")
private String roomNo;
@ApiModelProperty(value = "位置信息")
private String location;
@ApiModelProperty(value = "批次数量")
private Integer quantity;
@ApiModelProperty(value = "入库时间")
private LocalDateTime batchPurchaseTime;
@ApiModelProperty("实际房间")
private String practicalRoomNo;
@ApiModelProperty(value = "实际位置")
private String practicalLocation;
@ApiModelProperty(value = "实际数量")
private Integer practicalQuantity;

@ -58,7 +58,7 @@ spring:
# 文件上传相关 支持阿里云、华为云、腾讯、minio
oss:
endpoint: http://127.0.0.1:9000
endpoint: http://192.168.5.106:9000
accessKey: dlp
secretKey: 87990016
bucket-name: dlpfiles

@ -192,4 +192,31 @@
reagent_consumable_inventory WHERE reagent_consumable_name like concat('%',#{name},'%'))
</if>
</select>
<select id="getReagentConsumableList"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO">
SELECT b1.batch,
b1.purchase_time as batch_purchase_time,
b1.batch_details_id,
b1.quantity,
b1.room_no,
b1.location,
r1.*,
(SELECT si.supplier_name
FROM supplier_information si
WHERE si.id = b1.supplier_id) as supplier_name
FROM batch_details b1,
reagent_consumable_inventory r1
WHERE (r1.category = '试剂' or r1.category = '耗材')
and b1.reagent_consumable_inventory_id =
r1.reagent_consumable_inventory_id
and b1.service_status = '1'
order by b1.room_no, b1.location asc
</select>
<select id="getCellName" resultType="String">
select c.cabinet_name as name
from dlp_cabinet.b_cabinet c
where id = #{id}
</select>
</mapper>

Loading…
Cancel
Save