mirror of https://github.com/elunez/eladmin
销售发货单单价
parent
aa4e3dc6ef
commit
e5bd305c22
|
@ -61,10 +61,14 @@ public class InvoiceProduct implements Serializable {
|
||||||
@Column(name = "actual_invoice_number",nullable = false)
|
@Column(name = "actual_invoice_number",nullable = false)
|
||||||
private Long actualInvoiceNumber;
|
private Long actualInvoiceNumber;
|
||||||
|
|
||||||
// 瘦瘦金额
|
// 销售金额
|
||||||
@Column(name = "sale_price")
|
@Column(name = "sale_price")
|
||||||
private Long salePrice;
|
private Long salePrice;
|
||||||
|
|
||||||
|
// 单价
|
||||||
|
@Column(name = "unit_price")
|
||||||
|
private Long unitPrice;
|
||||||
|
|
||||||
// 备注
|
// 备注
|
||||||
@Column(name = "remark")
|
@Column(name = "remark")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
|
@ -155,6 +155,19 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public InvoiceDetailDTO create(CreateInvoiceRequest createInvoiceRequest) {
|
public InvoiceDetailDTO create(CreateInvoiceRequest createInvoiceRequest) {
|
||||||
|
List<String> repeatProductCodeList =createInvoiceRequest.getInvoiceProductList().stream().
|
||||||
|
collect(Collectors.groupingBy(dog->dog.getProductCode() ,Collectors.counting()))
|
||||||
|
.entrySet().stream()
|
||||||
|
.filter(entry->entry.getValue()>1)
|
||||||
|
.map(entry->entry.getKey())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
if(!CollectionUtils.isEmpty(repeatProductCodeList)){
|
||||||
|
String repeatProductCodeStr = me.zhengjie.utils.StringUtils.join(repeatProductCodeList.toArray(), ",");
|
||||||
|
throw new BadRequestException("产品" + repeatProductCodeStr + "请合并为一条记录");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Invoice invoice = new Invoice();
|
Invoice invoice = new Invoice();
|
||||||
// 客户订单编号
|
// 客户订单编号
|
||||||
String customerOrderCode = createInvoiceRequest.getCustomerOrderCode();
|
String customerOrderCode = createInvoiceRequest.getCustomerOrderCode();
|
||||||
|
@ -223,6 +236,19 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(UpdateInvoiceRequest updateInvoiceRequest) {
|
public void update(UpdateInvoiceRequest updateInvoiceRequest) {
|
||||||
|
|
||||||
|
List<String> repeatProductCodeList =updateInvoiceRequest.getInvoiceProductList().stream().
|
||||||
|
collect(Collectors.groupingBy(dog->dog.getProductCode() ,Collectors.counting()))
|
||||||
|
.entrySet().stream()
|
||||||
|
.filter(entry->entry.getValue()>1)
|
||||||
|
.map(entry->entry.getKey())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
if(!CollectionUtils.isEmpty(repeatProductCodeList)){
|
||||||
|
String repeatProductCodeStr = me.zhengjie.utils.StringUtils.join(repeatProductCodeList.toArray(), ",");
|
||||||
|
throw new BadRequestException("产品" + repeatProductCodeStr + "请合并为一条记录");
|
||||||
|
}
|
||||||
|
|
||||||
Invoice invoice = new Invoice();
|
Invoice invoice = new Invoice();
|
||||||
BeanUtils.copyProperties(updateInvoiceRequest, invoice);
|
BeanUtils.copyProperties(updateInvoiceRequest, invoice);
|
||||||
// 修改发货单概要信息
|
// 修改发货单概要信息
|
||||||
|
|
Loading…
Reference in New Issue