Browse Source

装箱单推送发票

huxy 1 year ago
parent
commit
96f77be2be

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/xml/syPackingListTailoringItemMapper.xml

@@ -313,6 +313,7 @@
 		FROM  sy_packing_list_tailoring_item
 		WHERE sy_packing_list_tailoring_id =  #{id}
 		and del_flag=0
+		and total is not null
 		group by size,ompo_Id_Item
 		order by ompo_Id_Item
 	</select>

+ 14 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/service/impl/SyPackingListTailoringServiceImpl.java

@@ -1518,7 +1518,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 			return null;
 		}*/
 		String recording=null;
-		if(main.getRecording()!=null){
+		if(main.getRecording()!=null&&!main.getRecording().equals("")){
 			String[] recordings=main.getRecording().split(",");
 			Map<String,Map<String,String>> maps=new HashMap<>();
 			for (int i=0;i<recordings.length;i++){
@@ -2068,7 +2068,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 				for (Map<String,Object> map : invoices){
 					if(Double.parseDouble(map.get("iQuantity").toString())==Double.parseDouble(jsonObject.get("IQUANTITY").toString())&&
 					   map.get("cInvCode").toString().equalsIgnoreCase(item.getInventoryCode())&&map.get("cFree2").equals(item.getSize())
-							&&jsonObject.get("size").equals(item.getSize()) &&!autoIds.contains(map.get("AutoID"))){
+							&&!autoIds.contains(map.get("AutoID"))){
 						autoIds.add(map.get("AutoID"));
 						jsonObject.put("AUTOID_PO",map.get("AutoID"));
 						if(maps.get("account1").toString().equals("101")||maps.get("account").toString().equals("103")){
@@ -2218,11 +2218,18 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 			List<Object> autoIds=new ArrayList<>();
 			//String iTaxRate=syPackingListTailoringItemMapper.getItaxRate(syPackingListTailoring.getRdrecord32Code());
 			for (SyPackingListTailoringItem item : listFabricItems){
+//				System.out.println("total\t"+item.getTotal());
+//				System.out.println("size\t"+item.getSize());
+//				System.out.println("inventoryCode\t"+item.getInventoryCode());
+
+
 				JSONObject  jsonObject=new JSONObject();
 				jsonObject.put("IQUANTITY",item.getTotal());//净重
 				jsonObject.put("size",item.getSize());
 				jsonObject.put("CINVCODE",item.getInventoryCode());//存货编码
 				jsonObject.put("DISAUTOIDCOL","AUTOID");//对应类型
+//				System.out.println("IQUANTITY\t"+jsonObject.get("IQUANTITY"));
+//				System.out.println("cFree2\t"+jsonObject.get("cFree2"));
 				String istc2=item.getIsTc();
 				if (istc2!=null&&istc2.equals("1")){
 					if(item.getMemo()!=null){
@@ -2233,8 +2240,12 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 				}
 				jsonObject.put("CBMEMO",item.getMemo());//备注
 				for (Map<String,Object> map : invoices){
+
+//					System.out.println("map.get(\"iQuantity\").toString()\t"+map.get("iQuantity").toString());
+//					System.out.println("map.get(\"cInvCode\")\t"+map.get("cInvCode"));
+//					System.out.println("map.get(\"AutoID\")\t"+map.get("AutoID"));
 					if(Double.parseDouble(map.get("iQuantity").toString())==Double.parseDouble(jsonObject.get("IQUANTITY").toString())&&
-							map.get("cInvCode").toString().equalsIgnoreCase(item.getInventoryCode()) &&jsonObject.get("size").equals(item.getSize())
+							map.get("cInvCode").toString().equalsIgnoreCase(item.getInventoryCode()) &&map.get("cFree2").equals(item.getSize())
 							&&!autoIds.contains(map.get("AutoID"))){
 						autoIds.add(map.get("AutoID"));
 						jsonObject.put("AUTOID_DIS",map.get("AutoID"));