|
@@ -548,6 +548,7 @@ public class SyPackingListFabricController implements Job {
|
|
|
String message="";
|
|
|
try {
|
|
|
List<SyPackingListFabric> listFabrics=syPackingListFabricService.queryByList(id);
|
|
|
+ List<SyPackingListFabric> listFabrics1=new ArrayList<>();
|
|
|
if(listFabrics.size()==0){
|
|
|
codeMaps.put("error","未在装箱单找到对应单据");//失败信息
|
|
|
return "未在装箱单找到对应单据";
|
|
@@ -558,6 +559,9 @@ public class SyPackingListFabricController implements Job {
|
|
|
codeMaps.put("error","需要装箱单全部推送成功,才能推送发票");//失败信息
|
|
|
return "需要装箱单全部推送成功,才能推送发票";
|
|
|
}
|
|
|
+ if (fabric.getPushState().equals("1")||fabric.getDocumentNo().substring(0,3).equals("103")){
|
|
|
+ listFabrics1.add(fabric);
|
|
|
+ }
|
|
|
fabric.setSaleInvoiceError("");
|
|
|
//System.out.println("madate\t"+mapdate);
|
|
|
if(mapdate!=null){
|
|
@@ -587,26 +591,26 @@ public class SyPackingListFabricController implements Job {
|
|
|
fabric.setSyPackingListFabricItem(fabricItemList);*/
|
|
|
}
|
|
|
try {
|
|
|
- message = syPackingListFabricService.pushInvoice(listFabrics);
|
|
|
+ message = syPackingListFabricService.pushInvoice(listFabrics1);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
List<String> msgs=new ArrayList<>();
|
|
|
List<String> errors=new ArrayList<>();
|
|
|
- for (SyPackingListFabric tailoring : listFabrics){
|
|
|
- if(tailoring.getSaleInvoiceError()!=null&&tailoring.getSaleInvoiceError().length()>1){
|
|
|
- tailoring.setTimeStuta(3);
|
|
|
- errors.add(tailoring.getSaleInvoiceError());
|
|
|
+ for (SyPackingListFabric fabric : listFabrics1){
|
|
|
+ if(fabric.getSaleInvoiceError()!=null&&fabric.getSaleInvoiceError().length()>1){
|
|
|
+ fabric.setTimeStuta(3);
|
|
|
+ errors.add(fabric.getSaleInvoiceError());
|
|
|
}else{
|
|
|
- tailoring.setTimeStuta(2);
|
|
|
+ fabric.setTimeStuta(2);
|
|
|
}
|
|
|
- if(tailoring.getSaleInvoiceCode()!=null){
|
|
|
- if(!msgs.contains(tailoring.getSaleInvoiceCode())){
|
|
|
- msgs.add(tailoring.getSaleInvoiceCode());
|
|
|
+ if(fabric.getSaleInvoiceCode()!=null){
|
|
|
+ if(!msgs.contains(fabric.getSaleInvoiceCode())){
|
|
|
+ msgs.add(fabric.getSaleInvoiceCode());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- syPackingListFabricService.updateBatchById(listFabrics);
|
|
|
+ syPackingListFabricService.updateBatchById(listFabrics1);
|
|
|
codeMaps.put("message",msgs.stream().distinct().collect(Collectors.toList()));//推送成功消息
|
|
|
codeMaps.put("error",errors.stream().distinct().collect(Collectors.toList()));//失败信息
|
|
|
if(errors.size()==0){
|