|
|
@ -1,28 +1,40 @@ |
|
|
|
package digital.laboratory.platform.reagent.service.impl; |
|
|
|
package digital.laboratory.platform.reagent.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.io.IoUtil; |
|
|
|
import cn.hutool.core.util.PageUtil; |
|
|
|
import cn.hutool.core.util.PageUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
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.IdWorker; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
|
|
|
import com.deepoove.poi.XWPFTemplate; |
|
|
|
|
|
|
|
import com.deepoove.poi.config.Configure; |
|
|
|
|
|
|
|
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; |
|
|
|
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; |
|
|
|
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; |
|
|
|
import digital.laboratory.platform.reagent.config.PageUtils; |
|
|
|
import digital.laboratory.platform.reagent.config.PageUtils; |
|
|
|
import digital.laboratory.platform.reagent.dto.WarehousingRecordFormDTO; |
|
|
|
import digital.laboratory.platform.reagent.dto.WarehousingRecordFormDTO; |
|
|
|
import digital.laboratory.platform.reagent.entity.*; |
|
|
|
import digital.laboratory.platform.reagent.entity.*; |
|
|
|
import digital.laboratory.platform.reagent.mapper.WarehousingRecordFormMapper; |
|
|
|
import digital.laboratory.platform.reagent.mapper.WarehousingRecordFormMapper; |
|
|
|
import digital.laboratory.platform.reagent.service.*; |
|
|
|
import digital.laboratory.platform.reagent.service.*; |
|
|
|
import digital.laboratory.platform.reagent.vo.WarehousingContentVO; |
|
|
|
import digital.laboratory.platform.reagent.vo.*; |
|
|
|
import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO; |
|
|
|
import feign.Response; |
|
|
|
|
|
|
|
import org.apache.commons.io.output.ByteArrayOutputStream; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
import org.springframework.mock.web.MockMultipartFile; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
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.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Calendar; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -76,6 +88,30 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private SupplierInformationService supplierInformationService; |
|
|
|
private SupplierInformationService supplierInformationService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private PurchaseListDetailsService purchaseListDetailsService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private ProcurementContentService procurementContentService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private DetailsOfCentralizedService detailsOfCentralizedService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DecentralizeDetailsService decentralizeDetailsService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private PurchasingPlanService purchasingPlanService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private CentralizedRequestService centralizedRequestService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DecentralizedRequestService decentralizedRequestService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private PurchaseListService purchaseListService; |
|
|
|
|
|
|
|
|
|
|
|
@Override//查看采购入库
|
|
|
|
@Override//查看采购入库
|
|
|
|
public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) { |
|
|
|
public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) { |
|
|
|
|
|
|
|
|
|
|
@ -97,6 +133,14 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
@Override//录入入库明细
|
|
|
|
@Override//录入入库明细
|
|
|
|
public WarehousingRecordFormVO addFormById(List<WarehousingRecordFormDTO> warehousingRecordFormDTOList, DLPUser dlpUser) { |
|
|
|
public WarehousingRecordFormVO addFormById(List<WarehousingRecordFormDTO> warehousingRecordFormDTOList, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (WarehousingRecordFormDTO warehousingRecordFormDTO : warehousingRecordFormDTOList) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (warehousingRecordFormDTO.getLatticeId().isEmpty()&warehousingRecordFormDTO.getLocation().isEmpty()){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throw new RuntimeException(String.format("请选择存放位置后再进行提交")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
boolean flag = true; |
|
|
|
boolean flag = true; |
|
|
|
|
|
|
|
|
|
|
|
int i = 0; |
|
|
|
int i = 0; |
|
|
@ -181,7 +225,11 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
batchDetails.setSupplierId(byId.getSupplierId()); |
|
|
|
batchDetails.setSupplierId(byId.getSupplierId()); |
|
|
|
batchDetails.setBatch(1); |
|
|
|
batchDetails.setBatch(1); |
|
|
|
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate()); |
|
|
|
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate()); |
|
|
|
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*reagentConsumables.getPackagedCopies()); |
|
|
|
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*Integer.valueOf(reagentConsumables.getPackagedCopies())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (batchDetails.getQuantity()==null){ |
|
|
|
|
|
|
|
batchDetails.setQuantity(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reagentConsumables.getCategory().equals("试剂")|reagentConsumables.getCategory().equals("耗材")){ |
|
|
|
if (reagentConsumables.getCategory().equals("试剂")|reagentConsumables.getCategory().equals("耗材")){ |
|
|
@ -193,9 +241,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
|
|
|
|
|
|
|
reagentConsumableInventory.setTotalQuantity(0); |
|
|
|
reagentConsumableInventory.setTotalQuantity(0); |
|
|
|
} |
|
|
|
} |
|
|
|
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + batchDetails.getQuantity() * Integer.valueOf(reagentConsumableInventory.getPackagedCopies())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + batchDetails.getQuantity()); |
|
|
|
reagentConsumableInventory.setTotalQuantity(reagentConsumableInventory.getTotalQuantity() + batchDetails.getQuantity()); |
|
|
|
|
|
|
|
|
|
|
|
//如果是标准物质,则赋值编号
|
|
|
|
//如果是标准物质,则赋值编号
|
|
|
|
if (reagentConsumables.getCategory().equals("标准物质")) { |
|
|
|
if (reagentConsumables.getCategory().equals("标准物质")) { |
|
|
|
|
|
|
|
|
|
|
@ -209,18 +257,15 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
referenceMaterial.setStatus(0); |
|
|
|
referenceMaterial.setStatus(0); |
|
|
|
referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation()); |
|
|
|
referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation()); |
|
|
|
referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId()); |
|
|
|
referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId()); |
|
|
|
|
|
|
|
referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName()); |
|
|
|
|
|
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
|
|
|
|
|
|
|
int year = calendar.get(Calendar.YEAR); |
|
|
|
int year = calendar.get(Calendar.YEAR); |
|
|
|
|
|
|
|
|
|
|
|
LatticeForm latticeForm = latticeFormService.getById(warehousingRecordFormDTO.getLatticeId()); |
|
|
|
String location = warehousingRecordFormDTO.getLocation(); |
|
|
|
|
|
|
|
|
|
|
|
CabinetForm cabinetForm = cabinetFormService.getById(latticeForm.getCabinetFormId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StorageRoomForm storageRoomForm = storageRoomFormService.getById(cabinetForm.getStorageRoomFormId()); |
|
|
|
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(2) + "-"; |
|
|
|
|
|
|
|
|
|
|
|
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + storageRoomForm.getFloor() + "-"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() |
|
|
|
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() |
|
|
|
.likeRight("number", prefix) |
|
|
|
.likeRight("number", prefix) |
|
|
@ -268,7 +313,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
batchDetails.setSupplierId(byId.getSupplierId()); |
|
|
|
batchDetails.setSupplierId(byId.getSupplierId()); |
|
|
|
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate()); |
|
|
|
batchDetails.setExpirationDate(warehousingRecordFormDTO.getExpirationDate()); |
|
|
|
batchDetails.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); |
|
|
|
batchDetails.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); |
|
|
|
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*one.getPackagedCopies()); |
|
|
|
batchDetails.setQuantity(warehousingRecordFormDTO.getQuantity()*Integer.valueOf(one.getPackagedCopies())); |
|
|
|
|
|
|
|
|
|
|
|
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId()) |
|
|
|
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())); |
|
|
@ -298,18 +343,15 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
referenceMaterial.setStatus(0); |
|
|
|
referenceMaterial.setStatus(0); |
|
|
|
referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation()); |
|
|
|
referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation()); |
|
|
|
referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId()); |
|
|
|
referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId()); |
|
|
|
|
|
|
|
referenceMaterial.setCustodianName(warehousingRecordFormDTO.getCustodianName()); |
|
|
|
|
|
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
|
|
|
|
|
|
|
int year = calendar.get(Calendar.YEAR); |
|
|
|
int year = calendar.get(Calendar.YEAR); |
|
|
|
|
|
|
|
|
|
|
|
LatticeForm latticeForm = latticeFormService.getById(warehousingRecordFormDTO.getLatticeId()); |
|
|
|
String location = warehousingRecordFormDTO.getLocation(); |
|
|
|
|
|
|
|
|
|
|
|
CabinetForm cabinetForm = cabinetFormService.getById(latticeForm.getCabinetFormId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StorageRoomForm storageRoomForm = storageRoomFormService.getById(cabinetForm.getStorageRoomFormId()); |
|
|
|
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(2) + "-"; |
|
|
|
|
|
|
|
|
|
|
|
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + storageRoomForm.getFloor() + "-"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() |
|
|
|
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query() |
|
|
|
.likeRight("number", prefix) |
|
|
|
.likeRight("number", prefix) |
|
|
@ -355,12 +397,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
|
|
|
|
|
|
|
|
if (warehousingContent.getWarehousingQuantity() == warehousingContent.getTotalQuantity()) { |
|
|
|
if (warehousingContent.getWarehousingQuantity() == warehousingContent.getTotalQuantity()) { |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<WarehousingBatchList> warehousingBatchListLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
warehousingContent.setStatus(1); |
|
|
|
|
|
|
|
|
|
|
|
warehousingBatchListLambdaQueryWrapper.eq(WarehousingBatchList::getWarehousingContentId, warehousingContent.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<WarehousingBatchList> list1 = warehousingBatchListService.list(warehousingBatchListLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
warehousingContentService.updateById(warehousingContent); |
|
|
|
if (warehousingContent.getAcceptanceRecordFormId() == null) { |
|
|
|
if (warehousingContent.getAcceptanceRecordFormId() == null) { |
|
|
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.addForm(warehousingContent.getReagentConsumableId(), warehousingContent.getSupplierId()); |
|
|
|
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.addForm(warehousingContent.getReagentConsumableId(), warehousingContent.getSupplierId()); |
|
|
@ -419,45 +458,173 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Page<WarehousingRecordFormVO> getWarehousingRecordFormVOList(Page page) { |
|
|
|
public IPage<WarehousingRecordFormVO> getWarehousingRecordFormVOPage(Page<WarehousingRecordForm> page, QueryWrapper<WarehousingRecordForm> qw) { |
|
|
|
|
|
|
|
|
|
|
|
List<WarehousingRecordFormVO> warehousingRecordFormVOList = baseMapper.getWarehousingRecordFormVOList(); |
|
|
|
IPage<WarehousingRecordFormVO> warehousingRecordFormVOPage = baseMapper.getWarehousingRecordFormVOPage(page,qw); |
|
|
|
|
|
|
|
|
|
|
|
for (WarehousingRecordFormVO warehousingRecordFormVO : warehousingRecordFormVOList) { |
|
|
|
List<WarehousingRecordFormVO> records = warehousingRecordFormVOPage.getRecords(); |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<WarehousingContent> warehousingContentLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
for (WarehousingRecordFormVO record : records) { |
|
|
|
|
|
|
|
|
|
|
|
warehousingContentLambdaQueryWrapper.eq(WarehousingContent::getWarehousingRecordFormId, warehousingRecordFormVO.getId()); |
|
|
|
List<WarehousingContent> warehousingContents = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", record.getId())); |
|
|
|
|
|
|
|
|
|
|
|
List<WarehousingContent> list = warehousingContentService.list(warehousingContentLambdaQueryWrapper); |
|
|
|
for (WarehousingContent warehousingContent : warehousingContents) { |
|
|
|
|
|
|
|
|
|
|
|
Integer x = 0; |
|
|
|
Integer warehousingQuantity = warehousingContent.getWarehousingQuantity(); |
|
|
|
Integer y = 0; |
|
|
|
|
|
|
|
for (WarehousingContent warehousingContent : list) { |
|
|
|
|
|
|
|
Integer totalQuantity = warehousingContent.getTotalQuantity(); |
|
|
|
Integer totalQuantity = warehousingContent.getTotalQuantity(); |
|
|
|
|
|
|
|
if (record.getWarehousingQuantity()==null&record.getQuantityPurchased()==null){ |
|
|
|
if (totalQuantity != null) { |
|
|
|
record.setWarehousingQuantity(0); |
|
|
|
x = x + totalQuantity; |
|
|
|
record.setQuantityPurchased(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
record.setWarehousingQuantity(record.getWarehousingQuantity()+warehousingQuantity); |
|
|
|
|
|
|
|
record.setQuantityPurchased(record.getQuantityPurchased()+totalQuantity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Integer warehousingQuantity = warehousingContent.getWarehousingQuantity(); |
|
|
|
|
|
|
|
if (warehousingQuantity != null) { |
|
|
|
|
|
|
|
y = y + warehousingContent.getWarehousingQuantity(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return warehousingRecordFormVOPage; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<PurchaseRequestPrintVO> getPurchaseRequestPrint(String id){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WarehousingRecordForm byId = warehousingRecordFormService.getById(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<WarehousingContent> warehousingContentList = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", id)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PurchaseListDetails purchaseListDetails1 = purchaseListDetailsService.getById(warehousingContentList.get(0).getPurchaseListDetailsId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DecentralizedRequest request = decentralizedRequestService.getOne(Wrappers.<DecentralizedRequest>query().eq("purchase_list_id", purchaseListDetails1.getPurchaseListId())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (request!=null){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(request.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DecentralizeDetails> decentralizeDetailsVOList = requestById.getDecentralizeDetailsVOList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
warehousingRecordFormVO.setWarehousingQuantity(y); |
|
|
|
|
|
|
|
warehousingRecordFormVO.setQuantityPurchased(x); |
|
|
|
|
|
|
|
|
|
|
|
for (WarehousingContent warehousingContent : warehousingContentList) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PurchaseListDetails purchaseListDetails = purchaseListDetailsService.getById(warehousingContent.getPurchaseListDetailsId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String purchaseListId = purchaseListDetails.getPurchaseListId(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<WarehousingBatchList> batchListList = warehousingBatchListService.list(Wrappers.<WarehousingBatchList>query().eq("warehousing_content_id", warehousingContent.getId())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DecentralizedRequest request = decentralizedRequestService.getOne(Wrappers.<DecentralizedRequest>query().eq("purchase_list_id", purchaseListId));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (request!=null){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(request.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DecentralizeDetails> decentralizeDetailsVOList = requestById.getDecentralizeDetailsVOList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (DecentralizeDetails decentralizeDetail : decentralizeDetailsVOList) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (decentralizeDetail.getCategory().equals("标准物质")){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
purchaseRequestPrintVO.setRemarks(decentralizeDetail.getRemarks()); |
|
|
|
|
|
|
|
purchaseRequestPrintVO.setQuantity(decentralizeDetail.getQuantity()); |
|
|
|
|
|
|
|
purchaseRequestPrintVO.setPurpose(decentralizeDetail.getPurpose()); |
|
|
|
|
|
|
|
purchaseRequestPrintVO.setSubtotal(decentralizeDetail.getUnitPrice()*decentralizeDetail.getQuantity()); |
|
|
|
|
|
|
|
purchaseRequestPrintVO.setApplicantName(requestById.getApplicantName()); |
|
|
|
|
|
|
|
purchaseRequestPrintVO.setReagentConsumableName(decentralizeDetail.getReagentConsumableName()); |
|
|
|
|
|
|
|
// purchaseRequestPrintVO.setSupplierName();
|
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (warehousingRecordFormVOList.size() != 0) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PageUtils pageUtils = new PageUtils(); |
|
|
|
ProcurementContent procurementContent = procurementContentService.getById(purchaseListDetails.getProcurementContentId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Page pages = pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), warehousingRecordFormVOList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return pages; |
|
|
|
|
|
|
|
} else return null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 结束"));
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|