|
|
@@ -78,10 +78,10 @@ public class SaleDownServiceImpl implements SaleDownService{
|
|
|
main.setSa_custcode(customer.getCu_code());
|
|
|
main.setSa_custid(customer.getId());
|
|
|
}
|
|
|
- //取编号
|
|
|
- String code = maxnumberService.getMaxnumberByCompanyid(BillCodeSeq.SALEDOWN.getCaller(), true, companyId).getData();
|
|
|
+ //取编号 客户采购单不需要编号
|
|
|
+ //String code = maxnumberService.getMaxnumberByCompanyid(BillCodeSeq.SALEDOWN.getCaller(), true, companyId).getData();
|
|
|
//补充必要数据
|
|
|
- main.setSa_code(code);
|
|
|
+ //main.setSa_code(code);
|
|
|
main.setCreateTime(new Date());
|
|
|
main.setCompanyId(companyId);
|
|
|
main.setSa_status(Status.UNAUDITED.getDisplay());
|
|
|
@@ -96,15 +96,22 @@ public class SaleDownServiceImpl implements SaleDownService{
|
|
|
if (!StringUtils.isEmpty(custspeccode)) {
|
|
|
Product product = saledownMapper.findProductBySpec(custspeccode, companyId);
|
|
|
if (product != null) {
|
|
|
- detail.setSd_said(main.getId());
|
|
|
detail.setSd_prodcode(product.getPr_code());
|
|
|
detail.setSd_prodid(product.getId());
|
|
|
detail.setSd_prodspec(product.getPr_spec());
|
|
|
detail.setSd_produnit(product.getPr_unit());
|
|
|
detail.setSd_orispeccode(product.getPr_orispeccode());
|
|
|
- detail.setCompanyId(companyId);
|
|
|
- insertDetail.add(detail);
|
|
|
+ } else {
|
|
|
+ //为空时 自己选择
|
|
|
+ detail.setSd_prodcode(null);
|
|
|
+ detail.setSd_prodid(null);
|
|
|
+ detail.setSd_prodspec(null);
|
|
|
+ detail.setSd_produnit(null);
|
|
|
+ detail.setSd_orispeccode(null);
|
|
|
}
|
|
|
+ detail.setSd_said(main.getId());
|
|
|
+ detail.setCompanyId(companyId);
|
|
|
+ insertDetail.add(detail);
|
|
|
}
|
|
|
}
|
|
|
//插入从表
|