Explorar el Código

推送u8调整

huxy hace 2 años
padre
commit
23393914a4

+ 15 - 14
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/controller/SyPreAssembledPackingListController.java

@@ -1538,23 +1538,24 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
     public Result<?> importExcel3(HttpServletRequest request, HttpServletResponse response) throws IOException {
         MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
         Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
-        try{
-            String str="";
-            for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
-                MultipartFile file = entity.getValue();// 获取上传文件对象
-                InputStream inputStream=file.getInputStream();
-                ImportParams params = new ImportParams();
-                Workbook workbook=new XSSFWorkbook(inputStream);
-                str+=refreshSheet1(workbook);
-                params.setTitleRows(2);
-                params.setHeadRows(1);
-                params.setNeedSave(true);
-            }
-            return Result.ok(str);
+        String str="";
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();// 获取上传文件对象
+            InputStream inputStream=file.getInputStream();
+            ImportParams params = new ImportParams();
+            Workbook workbook=new XSSFWorkbook(inputStream);
+            str+=refreshSheet1(workbook);
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+        }
+        return Result.ok(str);
+        /*try{
+
         }catch (Exception e){
             e.printStackTrace();
             return Result.error("文件导入失败"+e.getMessage());
-        }
+        }*/
     }
 
 

+ 2 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/service/impl/SyPreAssembledPackingListServiceImpl.java

@@ -650,10 +650,8 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 			BigDecimal total1=new BigDecimal("0");
 			BigDecimal total2=new BigDecimal("0");
 			BigDecimal total3=new BigDecimal("0");
-			System.out.println("size\t"+main.getSyPreAssembledPackingListItemList().size());
 			String name="";
 			for (SyPreAssembledPackingListItem item :main.getSyPreAssembledPackingListItemList()){
-				System.out.println("total\t"+item.getTotal());
 				total3=total3.add(item.getTotal());
 				String ids="";
 				int num2=0;
@@ -669,7 +667,6 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 
 					}
 				}
-				System.out.println("ids\t"+ids);
 				if(!ids.equals("")){
 					ids=ids.substring(0,ids.length()-1);
 					QueryWrapper queryWrapper=new QueryWrapper();
@@ -686,9 +683,9 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 					queryWrapper.eq("del_flag","0");
 					queryWrapper.select("sum(total) as total");
 					SyPreAssembledPackingListItem sypre=syPreAssembledPackingListItemMapper.selectOne(queryWrapper);
-					if(sypre!=null){
-						System.out.println("sypre的total为\t"+sypre.getTotal());
+					if(sypre!=null){;
 						total2=sypre.getTotal();
+						throw new JeecgBootException("该单据已被参照,请勿重复提交");
 					}
 				}
 			}

+ 19 - 15
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/impl/SyPackingListFabricServiceImpl.java

@@ -676,6 +676,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				for(SyPackingListFabricItem item :items){
 					SyShippingDetailsItem syShippingDetailsItem=syShippingDetailsItemMapper.selectById(item.getSyShippingDetailsItemId());//itemid
 					if(syShippingDetailsItem==null){
+						System.out.println("ids\t"+item.getSyShippingDetailsItemId());
 						throw new JeecgBootException("出运明细未找到对应数据");
 					}
 					syPackingListFabric.setAccount(syShippingDetailsItem.getAccount());//获取账套号
@@ -833,7 +834,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				queryWrapper.select("sum(shipment_Quantity) as shipment_Quantity");
 				SyShippingDetailsItem syShippingDetails=syShippingDetailsItemMapper.selectOne(queryWrapper);
 				if(syShippingDetails==null){
-				//	throw new JeecgBootException("该单据在上游未找到");
+					throw new JeecgBootException("该单据在上游未找到");
 				}else{
 					total1=syShippingDetails.getShipmentQuantity();
 				}
@@ -1243,7 +1244,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn7.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
 
 			JSONArray resturn2 = InterfaceConnUtils.doPost(mapList2,"materialout_import");//材料出库单
-			isSucceed=result(main,restu rn2,"材料出库单",((Map) mapList2.get(0)).get("CACCID").toString(),"2");//采购入库单
+			isSucceed=result(main,resturn2,"材料出库单",((Map) mapList2.get(0)).get("CACCID").toString(),"2");//采购入库单
 			isSucceed(main,isSucceed);
 			this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn2.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
 		}
@@ -1262,30 +1263,32 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			if (maps.containsKey(account)){
 				switch (maps.get(account).get("index")){
 					case "1":	//代表已完成第一道
-						JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");//销售发货单
-						recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//销售发货单
-						maps.get(account).put("code",resturn3.getJSONObject(0).get("U8ReceiptNo").toString());
-						recording(main,recording);
-						String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
-						this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");
-					case "2":
 						JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
-						recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//采购发票单
+						recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//采购发票单
 						recording(main,recording);
 						this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
 						if(((Map) mapList.get(0)).get("CACCID").toString().equals("901")){
 							return account+"账套推送成功!";
 						}
+					case "2":
+						JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");//销售发货单
+						recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//销售发货单
+						maps.get(account).put("code",resturn3.getJSONObject(0).get("U8ReceiptNo").toString());
+						recording(main,recording);
+						String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
+						this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");
 					case "3":
 						String consignmentName=maps.get(account).get("code");//获取销售发货单
+						System.out.println("consignmentName\t"+consignmentName);
 						List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
 						if(consignmentMaps!=null){
 							for (Map map : consignmentMaps){
 								JSONObject jsonObject=mapList4.getJSONObject(0);//循环迭代
 								List<Map<String,Object>> mapItems4= (List<Map<String,Object>>) jsonObject.get("DETAILList");
 								for (Map itemMap4 :  mapItems4){
-									if(itemMap4.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap4.get("IQUANTITY").toString())
-											==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap4.containsKey("AUTOID_SO")){//根据尺码判断
+									/*itemMap4.get("size").equals(map.get("cFree2"))&& */
+									if((Double.parseDouble( itemMap4.get("IQUANTITY").toString())==Double.parseDouble( map.get("iQuantity").toString()))
+									&& !itemMap4.containsKey("AUTOID_SO")){
 										getcFree((JSONObject) itemMap4,map);
 										itemMap4.put("AUTOID_SO",map.get("iDLsID"));
 									}
@@ -1294,7 +1297,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 							}
 						}
 						text(mapList4,"销售出库单");
-						JSONArray resturn4 = InterfaceConnUtils.doPost(mapList4,"saleout_import");//
+						//return null;//提示报错测试数据
+						JSONArray resturn4 = InterfaceConnUtils.doPost(mapList4,"saleout_import");
 						recording=result(main,resturn4,"销售出库单",((Map) mapList.get(0)).get("CACCID").toString(),"4");//销售出库单
 						maps.get(account).put("code",resturn4.getJSONObject(0).get("U8ReceiptNo").toString());
 						recording(main,recording);
@@ -1332,7 +1336,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn1.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
 
 		JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
-		recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//采购发票单
+		recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//采购发票单
 		recording(main,recording);
 		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
 
@@ -1341,7 +1345,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		}
 
 		JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");//销售发货单
-		recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//销售发货单
+		recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//销售发货单
 		recording(main,recording);
 		String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
 		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");

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

@@ -1035,18 +1035,18 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 			if (maps.containsKey(account)){
 				switch (maps.get(account).get("index")){
 					case "1":	//代表已完成第一道
+						JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
+						recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//采购发票单
+						recording(main,recording);
+						this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
+					case "2":
 						JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");//销售发货单
-						recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//销售发货单
+						recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//销售发货单
 						maps.get(account).put("code",resturn3.getJSONObject(0).get("U8ReceiptNo").toString());
 						recording(main,recording);
 						String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
 						this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");
-					case "2":
-						JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
-						recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//采购发票单
-						recording(main,recording);
-						this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
-					case "3":
+				case "3":
 						String consignmentName=maps.get(account).get("code");//获取销售发货单
 						List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
 						if(consignmentMaps!=null){
@@ -1101,17 +1101,19 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		recording(main,recording);
 		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn1.getJSONObject(0).get("U8ReceiptNo").toString()),"107");
 
-		JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");//销售发货单
-		recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//销售发货单
-		recording(main,recording);
-		String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
-		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");
 
 		JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
-		recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//采购发票单
+		recording=result(main,resturn5,"采购发票单",((Map) mapList.get(0)).get("CACCID").toString(),"2");//采购发票单
 		recording(main,recording);
 		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn5.getJSONObject(0).get("U8ReceiptNo").toString()),"109");
 
+
+		JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");//销售发货单
+		recording=result(main,resturn3,"销售发货单",((Map) mapList.get(0)).get("CACCID").toString(),"3");//销售发货单
+		recording(main,recording);
+		String u8ReceiptNo103= resturn3.getJSONObject(0).get("U8ReceiptNo").toString();
+		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(u8ReceiptNo103.substring(u8ReceiptNo103.length()-4 ) ),"108");
+
 		JSONObject jsonObject3=resturn3.getJSONObject(0);//销售发货单
 		String consignmentName=jsonObject3.get("U8ReceiptNo").toString();//获取销售发货单
 		List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);