fixed comments
parent
78c1d7682f
commit
79d47a66b0
|
@ -177,7 +177,7 @@ public class JobCardController {
|
|||
}
|
||||
|
||||
@GetMapping( value = "/pdf/{id}", produces = MediaType.APPLICATION_PDF_VALUE )
|
||||
public ResponseEntity<InputStreamResource> showGinReceivingPDF(@PathVariable long id, Model model ) throws Exception {
|
||||
public ResponseEntity<InputStreamResource> generateJobCardPdf(@PathVariable long id, Model model ) throws Exception {
|
||||
return jobCardService.getJobCardReceivingPdf(id,model);
|
||||
}
|
||||
|
||||
|
|
|
@ -311,30 +311,28 @@ public class JobCardService {
|
|||
public Map<Long, Long> totalFinishItem(List<Long> itemIds, long jobCardId ){
|
||||
return finishedItemDAO.findTotalFinishedItems( itemIds, jobCardId );
|
||||
}
|
||||
|
||||
/**
|
||||
* Print Job card *
|
||||
* **/
|
||||
public ResponseEntity<InputStreamResource> getJobCardReceivingPdf(long id, Model model ) throws Exception {
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMM dd,yyyy h:m a");
|
||||
List<JobCardItem> jobCardItems = this.findJobCardItemByJobCardId(id);
|
||||
List<JobCardItem> jobCardItems = findJobCardItemByJobCardId(id);
|
||||
List<Long> jobCardItemIds = jobCardItems.stream()
|
||||
.map(JobCardItem::getItemId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<Long> itemIds = jobCardItems.stream()
|
||||
.map(JobCardItem::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
model.addAttribute( "baseUrl", URLUtils.getCurrentBaseUrl() );
|
||||
model.addAttribute( "card", this.findByID(id));
|
||||
model.addAttribute( "card", findByID(id));
|
||||
model.addAttribute("jobCardItems", jobCardItems);
|
||||
model.addAttribute("cutPiece",this.findCutPieceByJobCardItemIds(itemIds));
|
||||
model.addAttribute("totalFinishItem",this.totalFinishItem(jobCardItemIds, id));
|
||||
model.addAttribute("totalStitchingItem",this.totalStitchingItem(jobCardItemIds, id));
|
||||
|
||||
|
||||
model.addAttribute("cutPiece", findCutPieceByJobCardItemIds(itemIds));
|
||||
model.addAttribute("totalFinishItem", totalFinishItem(jobCardItemIds, id));
|
||||
model.addAttribute("totalStitchingItem", totalStitchingItem(jobCardItemIds, id));
|
||||
// html str
|
||||
String htmlStr = htmlBuilder.buildHTML( "job-card-view-pdf", model );
|
||||
|
||||
// return pdf
|
||||
return pdfGenerator.generatePdf( htmlStr, "Job-Card", "inline" );
|
||||
}
|
||||
|
|
|
@ -107,10 +107,4 @@ public class PDFResponseEntityInputStreamResource {
|
|||
public ResponseEntity<InputStreamResource> generateInvoicePdf( String htmlStr, String filename, String method, long height, long width ) throws IOException {
|
||||
return this.createPDFResponseEntityInvoiceInputStreamResource( htmlStr, filename, method, height, width );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package com.utopiaindustries.util;
|
||||
|
||||
public class TemporaryDocument {
|
||||
private long id;
|
||||
private long typeId;
|
||||
private String parentDocumentType;
|
||||
private long parentDocumentId;
|
||||
private String photoBlob;
|
||||
|
||||
public TemporaryDocument() {
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId( long id ) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public long getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId( long typeId ) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public String getParentDocumentType() {
|
||||
return parentDocumentType;
|
||||
}
|
||||
|
||||
public void setParentDocumentType( String parentDocumentType ) {
|
||||
this.parentDocumentType = parentDocumentType;
|
||||
}
|
||||
|
||||
public long getParentDocumentId() {
|
||||
return parentDocumentId;
|
||||
}
|
||||
|
||||
public void setParentDocumentId( long parentDocumentId ) {
|
||||
this.parentDocumentId = parentDocumentId;
|
||||
}
|
||||
|
||||
public String getPhotoBlob() {
|
||||
return photoBlob;
|
||||
}
|
||||
|
||||
public void setPhotoBlob( String photoBlob ) {
|
||||
this.photoBlob = photoBlob;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TemporaryDocument{" +
|
||||
"id=" + id +
|
||||
", typeId=" + typeId +
|
||||
", parentDocumentType='" + parentDocumentType + '\'' +
|
||||
", parentDocumentId=" + parentDocumentId +
|
||||
", photoBlob='" + photoBlob + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -87,7 +87,6 @@
|
|||
</table>
|
||||
|
||||
<table class="bordered" style="width: 100%; margin-top: 20px; border-collapse: collapse; ">
|
||||
|
||||
<h5 class="no-margin-top no-margin-bottom" style="margin-top: 20px;">ITEMS</h5>
|
||||
<thead >
|
||||
<tr class="tr-header">
|
||||
|
@ -102,7 +101,6 @@
|
|||
<td th:text="'Cut Piece Items'"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- Table Body -->
|
||||
<tbody>
|
||||
<tr th:each="cardItem : ${jobCardItems}">
|
||||
|
@ -125,11 +123,9 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue