|
|
@ -24,6 +24,7 @@ import jnpf.poundlist.service.PoundlistService;
|
|
|
|
import jnpf.purchaseback.entity.PurchaseorderEntity;
|
|
|
|
import jnpf.purchaseback.entity.PurchaseorderEntity;
|
|
|
|
import jnpf.purchaseback.service.PurchaseorderService;
|
|
|
|
import jnpf.purchaseback.service.PurchaseorderService;
|
|
|
|
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
|
|
|
|
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
|
|
|
|
|
|
|
|
import jnpf.purchaseorder.service.Purchaseorder_item0Service;
|
|
|
|
import jnpf.purchaseorder.service.PurchaseorderitemService;
|
|
|
|
import jnpf.purchaseorder.service.PurchaseorderitemService;
|
|
|
|
import jnpf.supplier.entity.SupplierEntity;
|
|
|
|
import jnpf.supplier.entity.SupplierEntity;
|
|
|
|
import jnpf.supplier.service.SupplierService;
|
|
|
|
import jnpf.supplier.service.SupplierService;
|
|
|
@ -57,6 +58,7 @@ import jnpf.util.GeneraterSwapUtil;
|
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
import jnpf.util.file.UploadUtil;
|
|
|
|
import jnpf.util.file.UploadUtil;
|
|
|
|
import jnpf.util.enums.FileTypeEnum;
|
|
|
|
import jnpf.util.enums.FileTypeEnum;
|
|
|
@ -103,6 +105,8 @@ public class InvoicesController {
|
|
|
|
private ContractFileService contractFileService;
|
|
|
|
private ContractFileService contractFileService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private SupplierService supplierService;
|
|
|
|
private SupplierService supplierService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private Purchaseorder_item0Service purchaseorder_item0Service;
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 列表
|
|
|
|
* 列表
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -167,8 +171,16 @@ public class InvoicesController {
|
|
|
|
purchaseorderEntity.setInvoiceAmount(entity.getInvoiceAmount());
|
|
|
|
purchaseorderEntity.setInvoiceAmount(entity.getInvoiceAmount());
|
|
|
|
purchaseorderEntity.setInvoiceNum(entity.getInvoiceQuantity());
|
|
|
|
purchaseorderEntity.setInvoiceNum(entity.getInvoiceQuantity());
|
|
|
|
purchaseorderService.updateById(purchaseorderEntity);
|
|
|
|
purchaseorderService.updateById(purchaseorderEntity);
|
|
|
|
|
|
|
|
|
|
|
|
List<Purchaseorder_item0Entity> Purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(entity.getPurchaseorderId());
|
|
|
|
List<Purchaseorder_item0Entity> Purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(entity.getPurchaseorderId());
|
|
|
|
List<PoundlistEntity> poundlistEntityList = purchaseorderitemService.getPoundList(entity.getPurchaseorderId());
|
|
|
|
List<PoundlistEntity> poundlistEntityList = purchaseorderitemService.getPoundList(entity.getPurchaseorderId());
|
|
|
|
|
|
|
|
if (purchaseorderEntity.getAmount().compareTo(entity.getInvoiceAmount()) == 0) {
|
|
|
|
|
|
|
|
for (PoundlistEntity poundlistEntity: poundlistEntityList) {
|
|
|
|
|
|
|
|
poundlistEntity.setIsInvoicing("1");
|
|
|
|
|
|
|
|
poundlistEntity.setInputDate(new Date());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
poundlistService.updateBatchById(poundlistEntityList);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
Purchaseorder_item0Entity orderItem = Purchaseorder_item0List.stream().filter(item0 -> ObjectUtil.equals(item0.getPoundlistId(), poundlistEntityList.get(0).getId())).findAny().get();
|
|
|
|
Purchaseorder_item0Entity orderItem = Purchaseorder_item0List.stream().filter(item0 -> ObjectUtil.equals(item0.getPoundlistId(), poundlistEntityList.get(0).getId())).findAny().get();
|
|
|
|
BigDecimal total = orderItem.getAmount();
|
|
|
|
BigDecimal total = orderItem.getAmount();
|
|
|
|
int i = 0;
|
|
|
|
int i = 0;
|
|
|
@ -190,6 +202,7 @@ public class InvoicesController {
|
|
|
|
poundlistEntityList.get(j).setPurchaseStatus("1");
|
|
|
|
poundlistEntityList.get(j).setPurchaseStatus("1");
|
|
|
|
poundlistService.updateById(poundlistEntityList.get(j));
|
|
|
|
poundlistService.updateById(poundlistEntityList.get(j));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return ActionResult.success("创建成功");
|
|
|
|
return ActionResult.success("创建成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|