소스 검색

面料损耗更新

fenghaifu 1 년 전
부모
커밋
895682d542
1개의 변경된 파일17개의 추가작업 그리고 1개의 파일을 삭제
  1. 17 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/FabricLossServiceImpl.java

+ 17 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/FabricLossServiceImpl.java

@@ -1793,7 +1793,23 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 		Collections.sort(allInList, new Comparator<FabricPoOrderIn>() {
 			@Override
 			public int compare(FabricPoOrderIn o1, FabricPoOrderIn o2) {
-				return (int)((o1.getIPrice() == null ?0 : o1.getIPrice())-(o2.getIPrice() == null ?0 : o2.getIPrice()));
+				if (o1.getIPrice() == null && o2.getIPrice() == null) {
+					return 0;
+				}
+				if (o1.getIPrice() == null){
+					if (o2.getIPrice()<0){
+						return 1;
+					}
+					return -1;
+				}
+				if (o2.getIPrice() == null){
+					if (o2.getIPrice()<0){
+						return -1;
+					}
+					return 1;
+				}
+
+				return (int)(o1.getIPrice()-o2.getIPrice());
 			}
 		});
 		// 转入数量有负数的,从正数扣除