|
|
|
@ -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.PageUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
@ -20,7 +21,9 @@ import digital.laboratory.platform.reagent.entity.*; |
|
|
|
|
import digital.laboratory.platform.reagent.mapper.WarehousingRecordFormMapper; |
|
|
|
|
import digital.laboratory.platform.reagent.service.*; |
|
|
|
|
import digital.laboratory.platform.reagent.vo.*; |
|
|
|
|
import digital.laboratory.platform.sys.feign.RemoteCabinetService; |
|
|
|
|
import feign.Response; |
|
|
|
|
import io.seata.spring.annotation.GlobalTransactional; |
|
|
|
|
import org.apache.commons.io.output.ByteArrayOutputStream; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@ -65,14 +68,10 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
private ReagentConsumablesService reagentConsumablesService; |
|
|
|
|
@Autowired |
|
|
|
|
private ReferenceMaterialService referenceMaterialService; |
|
|
|
|
@Autowired |
|
|
|
|
private LatticeFormService latticeFormService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private StorageRoomFormService storageRoomFormService; |
|
|
|
|
private RemoteCabinetService remoteCabinetService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private CabinetFormService cabinetFormService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private BatchDetailsService batchDetailsService; |
|
|
|
@ -129,13 +128,14 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
@GlobalTransactional |
|
|
|
|
@Override//录入入库明细
|
|
|
|
|
public WarehousingRecordFormVO addFormById(List<WarehousingRecordFormDTO> warehousingRecordFormDTOList, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
for (WarehousingRecordFormDTO warehousingRecordFormDTO : warehousingRecordFormDTOList) { |
|
|
|
|
|
|
|
|
|
if (warehousingRecordFormDTO.getLatticeId().isEmpty()&warehousingRecordFormDTO.getLocation().isEmpty()){ |
|
|
|
|
if (warehousingRecordFormDTO.getLatticeId().isEmpty() & warehousingRecordFormDTO.getLocation().isEmpty() & |
|
|
|
|
warehousingRecordFormDTO.getBoxId().isEmpty()) { |
|
|
|
|
|
|
|
|
|
throw new RuntimeException(String.format("请选择存放位置后再进行提交")); |
|
|
|
|
} |
|
|
|
@ -146,6 +146,8 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
int i = 0; |
|
|
|
|
//签收内容循环
|
|
|
|
|
for (WarehousingRecordFormDTO warehousingRecordFormDTO : warehousingRecordFormDTOList) { |
|
|
|
|
|
|
|
|
|
String latticeId = warehousingRecordFormDTO.getLatticeId(); |
|
|
|
|
//录入签收批次信息
|
|
|
|
|
WarehousingBatchList warehousingBatchList = new WarehousingBatchList(); |
|
|
|
|
|
|
|
|
@ -157,6 +159,8 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
|
|
|
|
|
warehousingBatchList.setDateOfReceipt(LocalDateTime.now()); |
|
|
|
|
|
|
|
|
|
warehousingBatchList.setLocation(warehousingRecordFormDTO.getLocation()); |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<WarehousingBatchList> warehousingBatchListLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
warehousingBatchListLambdaQueryWrapper.eq(WarehousingBatchList::getWarehousingContentId, warehousingBatchList.getWarehousingContentId()); |
|
|
|
@ -165,37 +169,16 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
|
|
|
|
|
WarehousingContent byId = warehousingContentService.getById(warehousingBatchList.getWarehousingContentId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
byId.setWarehousingQuantity(byId.getWarehousingQuantity() + warehousingBatchList.getQuantity()); |
|
|
|
|
//判断采购数量与签收数量
|
|
|
|
|
if (byId.getWarehousingQuantity() > byId.getTotalQuantity()) { |
|
|
|
|
throw new RuntimeException(String.format("入库数量不能大于采购数量")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (warehousingContentService.updateById(byId) & warehousingBatchListService.save(warehousingBatchList)) { |
|
|
|
|
|
|
|
|
|
flag = true; |
|
|
|
|
} else { |
|
|
|
|
flag = false; |
|
|
|
|
} |
|
|
|
|
//入库登记表更新
|
|
|
|
|
StorageRegistrationForm storageRegistrationForm = new StorageRegistrationForm(); |
|
|
|
|
|
|
|
|
|
storageRegistrationForm.setStorageRegistrationFormId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
|
|
|
|
|
storageRegistrationForm.setReagentConsumableId(byId.getReagentConsumableId()); |
|
|
|
|
|
|
|
|
|
storageRegistrationForm.setQuantity(warehousingBatchList.getQuantity()); |
|
|
|
|
|
|
|
|
|
storageRegistrationForm.setRemarks(warehousingRecordFormDTO.getRemark()); |
|
|
|
|
warehousingContentService.updateById(byId); |
|
|
|
|
|
|
|
|
|
storageRegistrationFormService.save(storageRegistrationForm); |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, byId.getReagentConsumableId()); |
|
|
|
|
|
|
|
|
|
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); |
|
|
|
|
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(Wrappers.<ReagentConsumableInventory>query().eq("reagent_consumable_id", byId.getReagentConsumableId())); |
|
|
|
|
//录入仓库批次信息,若仓库不存在该物品,则新增该物品的库存信息
|
|
|
|
|
if (one == null) { |
|
|
|
|
|
|
|
|
@ -214,6 +197,12 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
reagentConsumableInventory.setCreateTime(LocalDateTime.now()); |
|
|
|
|
reagentConsumableInventory.setUpdateTime(LocalDateTime.now()); |
|
|
|
|
reagentConsumableInventory.setWarningValue(warehousingRecordFormDTO.getWarningValue()); |
|
|
|
|
//如果供应商未提供物品编码,则需在入库时扫描标签录入编码
|
|
|
|
|
if (warehousingRecordFormDTO.getCode() != null) { |
|
|
|
|
reagentConsumableInventory.setCode(warehousingRecordFormDTO.getCode()); |
|
|
|
|
reagentConsumables.setCode(warehousingRecordFormDTO.getCode()); |
|
|
|
|
reagentConsumablesService.updateById(reagentConsumables); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BatchDetails batchDetails = new BatchDetails(); |
|
|
|
|
|
|
|
|
@ -225,16 +214,21 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
batchDetails.setSupplierId(byId.getSupplierId()); |
|
|
|
|
batchDetails.setBatch(1); |
|
|
|
|
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate()); |
|
|
|
|
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*Integer.valueOf(reagentConsumables.getPackagedCopies())); |
|
|
|
|
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity() * Integer.valueOf(reagentConsumables.getPackagedCopies())); |
|
|
|
|
|
|
|
|
|
warehousingBatchList.setBatchId(batchDetails.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
if (batchDetails.getQuantity()==null){ |
|
|
|
|
if (batchDetails.getQuantity() == null) { |
|
|
|
|
batchDetails.setQuantity(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reagentConsumables.getCategory().equals("试剂")|reagentConsumables.getCategory().equals("耗材")){ |
|
|
|
|
if (reagentConsumables.getCategory().equals("试剂") | reagentConsumables.getCategory().equals("耗材")) { |
|
|
|
|
//更新格子信息(试剂耗材传入类ID)
|
|
|
|
|
remoteCabinetService.updateCabinet(latticeId, byId.getReagentConsumableId(), "1"); |
|
|
|
|
batchDetails.setLatticeId(warehousingRecordFormDTO.getLatticeId()); |
|
|
|
|
batchDetails.setLocation(warehousingRecordFormDTO.getLocation()); |
|
|
|
|
batchDetails.setBoxId(warehousingRecordFormDTO.getBoxId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (reagentConsumableInventory.getTotalQuantity() == null) { |
|
|
|
@ -247,6 +241,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
//如果是标准物质,则赋值编号
|
|
|
|
|
if (reagentConsumables.getCategory().equals("标准物质")) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < batchDetails.getQuantity(); j++) { |
|
|
|
|
|
|
|
|
|
ReferenceMaterial referenceMaterial = new ReferenceMaterial(); |
|
|
|
@ -258,6 +253,11 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation()); |
|
|
|
|
referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId()); |
|
|
|
|
referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName()); |
|
|
|
|
referenceMaterial.setBoxId(warehousingRecordFormDTO.getBoxId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新格子信息(标准物质传入对象ID)
|
|
|
|
|
remoteCabinetService.updateCabinet(latticeId, referenceMaterial.getId(), "1"); |
|
|
|
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
|
|
|
|
@ -265,7 +265,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
|
|
|
|
|
String location = warehousingRecordFormDTO.getLocation(); |
|
|
|
|
|
|
|
|
|
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(2) + "-"; |
|
|
|
|
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(1) + "-"; |
|
|
|
|
|
|
|
|
|
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() |
|
|
|
|
.likeRight("number", prefix) |
|
|
|
@ -297,6 +297,12 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
} else { |
|
|
|
|
//如果仓库存在该物品
|
|
|
|
|
|
|
|
|
|
if (warehousingRecordFormDTO.getCode() != null) { |
|
|
|
|
one.setCode(warehousingRecordFormDTO.getCode()); |
|
|
|
|
ReagentConsumables byId1 = reagentConsumablesService.getById(one.getReagentConsumableId()); |
|
|
|
|
byId1.setCode(one.getCode()); |
|
|
|
|
reagentConsumablesService.updateById(byId1); |
|
|
|
|
} |
|
|
|
|
LambdaQueryWrapper<ReagentConsumables> reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableId, byId.getReagentConsumableId()); |
|
|
|
@ -313,19 +319,23 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
batchDetails.setSupplierId(byId.getSupplierId()); |
|
|
|
|
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate()); |
|
|
|
|
batchDetails.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); |
|
|
|
|
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*Integer.valueOf(one.getPackagedCopies())); |
|
|
|
|
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity() * Integer.valueOf(one.getPackagedCopies())); |
|
|
|
|
warehousingBatchList.setBatchId(batchDetails.getBatchDetailsId()); |
|
|
|
|
|
|
|
|
|
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId()) |
|
|
|
|
.eq("supplier_id",byId.getSupplierId())); |
|
|
|
|
.eq("supplier_id", byId.getSupplierId())); |
|
|
|
|
|
|
|
|
|
if (batchDetailsList.size()==0){ |
|
|
|
|
if (batchDetailsList.size() == 0) { |
|
|
|
|
batchDetails.setBatch(1); |
|
|
|
|
}else { |
|
|
|
|
batchDetails.setBatch(batchDetailsList.size()+1); |
|
|
|
|
} else { |
|
|
|
|
batchDetails.setBatch(batchDetailsList.size() + 1); |
|
|
|
|
} |
|
|
|
|
if (one.getCategory().equals("试剂")|one.getCategory().equals("耗材")){ |
|
|
|
|
if (one.getCategory().equals("试剂") | one.getCategory().equals("耗材")) { |
|
|
|
|
batchDetails.setLocation(warehousingRecordFormDTO.getLocation()); |
|
|
|
|
batchDetails.setLatticeId(warehousingRecordFormDTO.getLatticeId()); |
|
|
|
|
batchDetails.setBoxId(warehousingRecordFormDTO.getBoxId()); |
|
|
|
|
//更新格子信息(试剂耗材传入类ID)
|
|
|
|
|
remoteCabinetService.updateCabinet(latticeId, byId.getReagentConsumableId(), "1"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
one.setTotalQuantity(one.getTotalQuantity() + batchDetails.getQuantity()); |
|
|
|
@ -343,15 +353,18 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
referenceMaterial.setStatus(0); |
|
|
|
|
referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation()); |
|
|
|
|
referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId()); |
|
|
|
|
referenceMaterial.setBoxId(warehousingRecordFormDTO.getBoxId()); |
|
|
|
|
referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName()); |
|
|
|
|
//更新格子信息(试剂耗材传入类ID)
|
|
|
|
|
|
|
|
|
|
remoteCabinetService.updateCabinet(latticeId, referenceMaterial.getId(), "1"); |
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
|
|
|
|
|
int year = calendar.get(Calendar.YEAR); |
|
|
|
|
|
|
|
|
|
String location = warehousingRecordFormDTO.getLocation(); |
|
|
|
|
|
|
|
|
|
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(2) + "-"; |
|
|
|
|
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(1) + "-"; |
|
|
|
|
|
|
|
|
|
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() |
|
|
|
|
.likeRight("number", prefix) |
|
|
|
@ -380,7 +393,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
|
|
|
|
|
batchDetailsService.save(batchDetails); |
|
|
|
|
} |
|
|
|
|
warehousingBatchListService.save(warehousingBatchList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<WarehousingContent> warehousingContentLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
WarehousingContent byId = warehousingContentService.getById(warehousingRecordFormDTOList.get(0).getWarehousingContentId()); |
|
|
|
@ -392,6 +407,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
List<WarehousingContent> list = warehousingContentService.list(warehousingContentLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
WarehousingRecordForm warehousingRecordForm = warehousingRecordFormService.getById(warehousingRecordFormId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//遍历采购内容,判断试剂耗材是否入库完毕
|
|
|
|
|
for (WarehousingContent warehousingContent : list) { |
|
|
|
|
|
|
|
|
@ -427,19 +445,19 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
|
|
|
|
|
SupplierInformation supplierInformation = supplierInformationService.getById(warehousingContent.getSupplierId()); |
|
|
|
|
|
|
|
|
|
if (!supplierInformations.contains(supplierInformation)){ |
|
|
|
|
if (!supplierInformations.contains(supplierInformation)) { |
|
|
|
|
supplierInformations.add(supplierInformation); |
|
|
|
|
EvaluationForm evaluationForm = evaluationFormService.addForm(supplierInformation.getId()); |
|
|
|
|
warehousingContent.setEvaluationFormId(evaluationForm.getId()); |
|
|
|
|
provideServicesOrSuppliesService.addById(evaluationForm.getId(),warehousingContent.getReagentConsumableId()); |
|
|
|
|
}else { |
|
|
|
|
provideServicesOrSuppliesService.addById(evaluationForm.getId(), warehousingContent.getReagentConsumableId()); |
|
|
|
|
} else { |
|
|
|
|
LambdaQueryWrapper<EvaluationForm> evaluationFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
evaluationFormLambdaQueryWrapper.eq(EvaluationForm::getSupplierInformationId,supplierInformation.getId()) |
|
|
|
|
evaluationFormLambdaQueryWrapper.eq(EvaluationForm::getSupplierInformationId, supplierInformation.getId()) |
|
|
|
|
.orderByDesc(EvaluationForm::getCreateTime); |
|
|
|
|
|
|
|
|
|
List<EvaluationForm> list1 = evaluationFormService.list(evaluationFormLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
provideServicesOrSuppliesService.addById(list1.get(0).getId(),warehousingContent.getReagentConsumableId()); |
|
|
|
|
provideServicesOrSuppliesService.addById(list1.get(0).getId(), warehousingContent.getReagentConsumableId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -460,7 +478,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
@Override |
|
|
|
|
public IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm> qw) { |
|
|
|
|
|
|
|
|
|
IPage<WarehousingRecordFormVO> warehousingRecordFormVOPage = baseMapper.getWarehousingRecordFormVOPage(page,qw); |
|
|
|
|
IPage<WarehousingRecordFormVO> warehousingRecordFormVOPage = baseMapper.getWarehousingRecordFormVOPage(page, qw); |
|
|
|
|
|
|
|
|
|
List<WarehousingRecordFormVO> records = warehousingRecordFormVOPage.getRecords(); |
|
|
|
|
|
|
|
|
@ -472,19 +490,19 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
|
|
|
|
|
Integer warehousingQuantity = warehousingContent.getWarehousingQuantity(); |
|
|
|
|
Integer totalQuantity = warehousingContent.getTotalQuantity(); |
|
|
|
|
if (record.getWarehousingQuantity()==null&record.getQuantityPurchased()==null){ |
|
|
|
|
if (record.getWarehousingQuantity() == null & record.getQuantityPurchased() == null) { |
|
|
|
|
record.setWarehousingQuantity(0); |
|
|
|
|
record.setQuantityPurchased(0); |
|
|
|
|
} |
|
|
|
|
record.setWarehousingQuantity(record.getWarehousingQuantity()+warehousingQuantity); |
|
|
|
|
record.setQuantityPurchased(record.getQuantityPurchased()+totalQuantity); |
|
|
|
|
record.setWarehousingQuantity(record.getWarehousingQuantity() + warehousingQuantity); |
|
|
|
|
record.setQuantityPurchased(record.getQuantityPurchased() + totalQuantity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return warehousingRecordFormVOPage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<PurchaseRequestPrintVO> getPurchaseRequestPrint(String id){ |
|
|
|
|
public List<PurchaseRequestPrintVO> getPurchaseRequestPrint(String id) { |
|
|
|
|
|
|
|
|
|
WarehousingRecordForm byId = warehousingRecordFormService.getById(id); |
|
|
|
|
|
|
|
|
@ -494,7 +512,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
|
|
|
|
|
DecentralizedRequest request = decentralizedRequestService.getOne(Wrappers.<DecentralizedRequest>query().eq("purchase_list_id", purchaseListDetails1.getPurchaseListId())); |
|
|
|
|
|
|
|
|
|
if (request!=null){ |
|
|
|
|
if (request != null) { |
|
|
|
|
|
|
|
|
|
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(request.getId()); |
|
|
|
|
|
|
|
|
@ -514,7 +532,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
|
|
|
|
|
// DecentralizedRequest request = decentralizedRequestService.getOne(Wrappers.<DecentralizedRequest>query().eq("purchase_list_id", purchaseListId));
|
|
|
|
|
|
|
|
|
|
if (request!=null){ |
|
|
|
|
if (request != null) { |
|
|
|
|
|
|
|
|
|
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(request.getId()); |
|
|
|
|
|
|
|
|
@ -524,16 +542,17 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
|
|
|
|
|
PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO(); |
|
|
|
|
|
|
|
|
|
if (decentralizeDetail.getCategory().equals("标准物质")){ |
|
|
|
|
if (decentralizeDetail.getCategory().equals("标准物质")) { |
|
|
|
|
|
|
|
|
|
purchaseRequestPrintVO.setRemarks(decentralizeDetail.getRemarks()); |
|
|
|
|
purchaseRequestPrintVO.setQuantity(decentralizeDetail.getQuantity()); |
|
|
|
|
purchaseRequestPrintVO.setPurpose(decentralizeDetail.getPurpose()); |
|
|
|
|
purchaseRequestPrintVO.setSubtotal(decentralizeDetail.getUnitPrice()*decentralizeDetail.getQuantity()); |
|
|
|
|
purchaseRequestPrintVO.setSubtotal(decentralizeDetail.getUnitPrice() * decentralizeDetail.getQuantity()); |
|
|
|
|
purchaseRequestPrintVO.setApplicantName(requestById.getApplicantName()); |
|
|
|
|
purchaseRequestPrintVO.setReagentConsumableName(decentralizeDetail.getReagentConsumableName()); |
|
|
|
|
// purchaseRequestPrintVO.setSupplierName();
|
|
|
|
|
}} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -541,89 +560,13 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
ProcurementContent procurementContent = procurementContentService.getById(purchaseListDetails.getProcurementContentId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
return |
|
|
|
|
null; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// public void PurchaseRequestPrintTablePDF(PurchaseRequestPrintVO purchaseRequestPrintVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
|
|
|
|
//
|
|
|
|
|
// System.out.println("PurchaseRequestPrintTablePDF.................");
|
|
|
|
|
//
|
|
|
|
|
// ReagentConsumables byId = reagentConsumablesService.getById(acceptanceRecordFormVO.getReagentConsumableId());
|
|
|
|
|
//
|
|
|
|
|
// String id = acceptanceRecordFormVO.getId();
|
|
|
|
|
//
|
|
|
|
|
// String applyFileName = null;
|
|
|
|
|
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
|
|
|
// if (byId.getCategory().equals("试剂") | byId.getCategory().equals("耗材")) {
|
|
|
|
|
//
|
|
|
|
|
// ossFile.fileGet("template" + "/" + "试剂耗材验收记录表模板.docx", bos);
|
|
|
|
|
//
|
|
|
|
|
// applyFileName = "试剂耗材验收记录表" + id;
|
|
|
|
|
// } else {
|
|
|
|
|
//
|
|
|
|
|
// ossFile.fileGet("template" + "/" + "标准物质验收记录表模板.docx", bos);
|
|
|
|
|
//
|
|
|
|
|
// applyFileName = "标准物质验收记录表" + id;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// //-----------------------------
|
|
|
|
|
// // 生成 word 版本的 验收记录表
|
|
|
|
|
//
|
|
|
|
|
// byte[] templateArray = bos.toByteArray();
|
|
|
|
|
//
|
|
|
|
|
// ByteArrayInputStream bis = new ByteArrayInputStream(templateArray);
|
|
|
|
|
// bos.close();
|
|
|
|
|
//
|
|
|
|
|
// LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
|
|
|
|
//
|
|
|
|
|
// Configure config = Configure.builder().
|
|
|
|
|
// bind("voList", policy).build();
|
|
|
|
|
// /**
|
|
|
|
|
// * 循环表格
|
|
|
|
|
// */
|
|
|
|
|
// XWPFTemplate template = XWPFTemplate.compile(bis, config).render(
|
|
|
|
|
// new HashMap<String, Object>() {{
|
|
|
|
|
// put("theSameBrandAndModel", acceptanceRecordFormVO.getTheSameBrandAndModel());
|
|
|
|
|
// }}
|
|
|
|
|
// );
|
|
|
|
|
// bis.close();
|
|
|
|
|
//
|
|
|
|
|
// ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
|
|
|
|
// template.write(fosWord);
|
|
|
|
|
// template.close();
|
|
|
|
|
//
|
|
|
|
|
// //------------
|
|
|
|
|
// ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
|
|
|
|
// fosWord.close();
|
|
|
|
|
//
|
|
|
|
|
// //MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord);
|
|
|
|
|
// MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord);
|
|
|
|
|
// Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
|
|
|
|
// fisWord.close();
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// ByteArrayOutputStream outPDF = new ByteArrayOutputStream();
|
|
|
|
|
// IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
|
|
|
|
// ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
|
|
|
|
// outPDF.close();
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// ossFile.fileSave("document" + "/" + "acceptanceRecordForm" + "/" + id + "/" + applyFileName + ".pdf", isPDF);
|
|
|
|
|
// isPDF.close();
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// System.out.println(String.format("转换为 PDF 结束"));
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|