|
@@ -685,23 +685,33 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
for(String id:ids){
|
|
|
num++;
|
|
|
QueryWrapper queryWrapper=new QueryWrapper();
|
|
|
- queryWrapper.select("sum(net_Weight) net_Weight,sum(gross_Weight) grossWeight,rolls rolls");
|
|
|
+ queryWrapper.select("sum(net_Weight) net_Weight,sum(gross_Weight) grossWeight,sum(rolls) rolls,inventory_code");
|
|
|
queryWrapper.eq("sy_Packing_List_Fabric_Id",id);
|
|
|
- SyPackingListFabricItem fabricItem=syPackingListFabricItemService.getOne(queryWrapper);
|
|
|
- if(fabricItem.getNetWeight()==null||fabricItem.getNetWeight().doubleValue()==0){
|
|
|
- message+="第"+num+"条提交失败,净重未填或净重为0";
|
|
|
- }
|
|
|
- else if(fabricItem.getGrossWeight()==null||fabricItem.getGrossWeight().doubleValue()==0){
|
|
|
- message+="第"+num+"条提交失败,毛重未填或毛重为0";
|
|
|
- }
|
|
|
- else if(fabricItem.getNetWeight()==null||fabricItem.getNetWeight().doubleValue()==0){
|
|
|
- message+="第"+num+"条提交失败,匹数(箱数)未填或匹数(箱数)为0";
|
|
|
+ queryWrapper.groupBy("inventory_code");
|
|
|
+ List<SyPackingListFabricItem> fabricItems=syPackingListFabricItemService.list(queryWrapper);
|
|
|
+ boolean bool=true;
|
|
|
+ for (SyPackingListFabricItem fabricItem : fabricItems){
|
|
|
+ if(fabricItem.getNetWeight()==null||fabricItem.getNetWeight().doubleValue()==0){
|
|
|
+ message+="第"+num+"条提交失败,物料"+fabricItem.getInventoryCode()+"净重合计为0;\n";
|
|
|
+ bool=false;
|
|
|
+ }
|
|
|
+ else if(fabricItem.getGrossWeight()==null||fabricItem.getGrossWeight().doubleValue()==0){
|
|
|
+ message+="第"+num+"条提交失败,物料"+fabricItem.getInventoryCode()+"毛重合计为0;\n";
|
|
|
+ bool=false;
|
|
|
+ }
|
|
|
+ else if(fabricItem.getRolls()==null||fabricItem.getRolls().doubleValue()==0){
|
|
|
+ message+="第"+num+"条提交失败,物料"+fabricItem.getInventoryCode()+"匹数(箱数)合计为0;\n";
|
|
|
+ bool=false;
|
|
|
+ }
|
|
|
+ if (bool=false){
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- else{
|
|
|
+ if (bool){
|
|
|
SyPackingListFabric syPackingListFabric=syPackingListFabricMapper.selectById(id);
|
|
|
syPackingListFabric.setStatus("1");
|
|
|
syPackingListFabricMapper.updateById(syPackingListFabric);
|
|
|
- message+="第"+num+"条提交成功";
|
|
|
+ message+="第"+num+"条提交成功;\n";
|
|
|
}
|
|
|
}
|
|
|
if(message.indexOf("失败")<0&&message.indexOf("成功")>0){
|