|
|
|
@ -18,11 +18,9 @@ import com.glxp.api.req.basic.FilterUdiRelRequest;
|
|
|
|
|
import com.glxp.api.req.inv.*;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
|
|
|
|
import com.glxp.api.res.inv.InvCountOrderDetailResponse;
|
|
|
|
|
import com.glxp.api.res.inv.innerOrderPrintRequest;
|
|
|
|
|
import com.glxp.api.res.inv.InnerOrderPrintResponse;
|
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
|
|
import com.glxp.api.service.basic.UdiProductService;
|
|
|
|
|
import com.glxp.api.service.basic.UdiRelevanceService;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderDetailBizService;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderService;
|
|
|
|
|
import com.glxp.api.service.inv.InnerOrderDetailService;
|
|
|
|
@ -35,7 +33,6 @@ import com.glxp.api.util.CustomUtil;
|
|
|
|
|
import com.glxp.api.util.FileUtils;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
@ -133,7 +130,7 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<innerOrderPrintRequest> filterJoinInnerPrint(FilterinnerOrderprintRequest filterinnerOrderprintRequest) {
|
|
|
|
|
public List<InnerOrderPrintResponse> filterJoinInnerPrint(FilterinnerOrderprintRequest filterinnerOrderprintRequest) {
|
|
|
|
|
if (filterinnerOrderprintRequest == null) {
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
|
|
|
@ -142,7 +139,7 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService
|
|
|
|
|
PageHelper.offsetPage(offset, filterinnerOrderprintRequest.getLimit());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<innerOrderPrintRequest> data = invInnerOrderPrintDao.filterJoinInnerPrint(filterinnerOrderprintRequest);
|
|
|
|
|
List<InnerOrderPrintResponse> data = invInnerOrderPrintDao.filterJoinInnerPrint(filterinnerOrderprintRequest);
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -161,8 +158,8 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService
|
|
|
|
|
SystemPDFTemplateEntity systemPDFTemplateEntity =
|
|
|
|
|
systemPDFTemplateService.selectById(String.valueOf(systemPDFModuleEntity.getTemplateId()));
|
|
|
|
|
if (systemPDFTemplateEntity == null) return null;
|
|
|
|
|
List<innerOrderPrintRequest> printEntities = new ArrayList<>();
|
|
|
|
|
List<innerOrderPrintRequest> mStockPrintEntities = new ArrayList<>();
|
|
|
|
|
List<InnerOrderPrintResponse> printEntities = new ArrayList<>();
|
|
|
|
|
List<InnerOrderPrintResponse> mStockPrintEntities = new ArrayList<>();
|
|
|
|
|
FilterinnerOrderprintRequest filterStockprintRequest = new FilterinnerOrderprintRequest();
|
|
|
|
|
DeleteStPrintTempRequest deleteStPrintTempRequest = new DeleteStPrintTempRequest();
|
|
|
|
|
if (innerOrderQRCodeTextPDFTemplateRequest.getOrderId() != null) {
|
|
|
|
@ -175,27 +172,27 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
innerOrderPdfTempService.delete(deleteStPrintTempRequest);
|
|
|
|
|
List<innerOrderPrintRequest> stockPrintEntities = invInnerOrderPrintService.filterJoinInnerPrint(filterStockprintRequest);
|
|
|
|
|
List<InnerOrderPrintResponse> stockPrintEntities = invInnerOrderPrintService.filterJoinInnerPrint(filterStockprintRequest);
|
|
|
|
|
if (stockPrintEntities != null && stockPrintEntities.size() > 0) {
|
|
|
|
|
mStockPrintEntities.addAll(stockPrintEntities);
|
|
|
|
|
}
|
|
|
|
|
for (innerOrderPrintRequest innerOrderPrintRequest : mStockPrintEntities) {
|
|
|
|
|
PdfPrintCountEntity pdfPrintCount = getCount(innerOrderQRCodeTextPDFTemplateRequest.getCountList(), innerOrderPrintRequest);
|
|
|
|
|
for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) {
|
|
|
|
|
PdfPrintCountEntity pdfPrintCount = getCount(innerOrderQRCodeTextPDFTemplateRequest.getCountList(), InnerOrderPrintResponse);
|
|
|
|
|
if (pdfPrintCount != null && pdfPrintCount.getRowCount() > 0) {
|
|
|
|
|
for (int i = 0; i < pdfPrintCount.getRowCount(); i++) {
|
|
|
|
|
innerOrderPrintRequest clone = new innerOrderPrintRequest();
|
|
|
|
|
BeanUtils.copyProperties(innerOrderPrintRequest, clone);
|
|
|
|
|
InnerOrderPrintResponse clone = new InnerOrderPrintResponse();
|
|
|
|
|
BeanUtils.copyProperties(InnerOrderPrintResponse, clone);
|
|
|
|
|
printEntities.add(clone);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
printEntities.add(innerOrderPrintRequest);
|
|
|
|
|
printEntities.add(InnerOrderPrintResponse);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!FileUtils.isFileExist(dirPath + "/pdfprint")) {
|
|
|
|
|
new File(dirPath + "/pdfprint").mkdirs();
|
|
|
|
|
}
|
|
|
|
|
List<List<innerOrderPrintRequest>> splits = CustomUtil.splitList(printEntities, 100);
|
|
|
|
|
List<List<InnerOrderPrintResponse>> splits = CustomUtil.splitList(printEntities, 100);
|
|
|
|
|
int index = 0;
|
|
|
|
|
List<InvInnerOrderPdfTempEntity> stockPrintTempEntities = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < splits.size(); i++) {
|
|
|
|
@ -222,10 +219,10 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService
|
|
|
|
|
|
|
|
|
|
innerOrderPdfTempService.insertStockPrintTempList(stockPrintTempEntities);
|
|
|
|
|
|
|
|
|
|
for (innerOrderPrintRequest innerOrderPrintRequest : mStockPrintEntities) {
|
|
|
|
|
for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) {
|
|
|
|
|
InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity();
|
|
|
|
|
innerOrderPrintEntity.setStatus(ConstantStatus.PRINT_SUCCESS);
|
|
|
|
|
innerOrderPrintEntity.setId(innerOrderPrintRequest.getId());
|
|
|
|
|
innerOrderPrintEntity.setId(InnerOrderPrintResponse.getId());
|
|
|
|
|
invInnerOrderPrintService.updateOrder(innerOrderPrintEntity);
|
|
|
|
|
}
|
|
|
|
|
PageInfo<InvInnerOrderPdfTempEntity> pageInfo;
|
|
|
|
@ -237,9 +234,9 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService
|
|
|
|
|
return pageSimpleResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PdfPrintCountEntity getCount(List<PdfPrintCountEntity> countList, innerOrderPrintRequest innerOrderPrintRequest) {
|
|
|
|
|
public PdfPrintCountEntity getCount(List<PdfPrintCountEntity> countList, InnerOrderPrintResponse InnerOrderPrintResponse) {
|
|
|
|
|
for (PdfPrintCountEntity pdfPrintCount : countList) {
|
|
|
|
|
if (pdfPrintCount.getQueryId().equals(innerOrderPrintRequest.getId() + "")) {
|
|
|
|
|
if (pdfPrintCount.getQueryId().equals(InnerOrderPrintResponse.getId() + "")) {
|
|
|
|
|
return pdfPrintCount;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -293,7 +290,7 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService
|
|
|
|
|
innerOrderPrintEntity.setUdiCode(udiCode);
|
|
|
|
|
invInnerOrderPrintDao.insert(innerOrderPrintEntity);
|
|
|
|
|
}
|
|
|
|
|
orderEntity.setInCodeStatus(1);//
|
|
|
|
|
orderEntity.setInCodeStatus(0);//
|
|
|
|
|
orderService.update(orderEntity);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|