瀏覽代碼

成衣取消推送发票、针对报错原因为null进行重新推送

huxy 1 年之前
父節點
當前提交
30451aeb84

+ 4 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/controller/SyPackingListFabricController.java

@@ -1190,7 +1190,8 @@ public class SyPackingListFabricController implements Job {
 	 public void execute(JobExecutionContext context) throws JobExecutionException {
 
 		 QueryWrapper<SyPackingListFabric> queryWrapper=new QueryWrapper();
-		 queryWrapper.nested(i->i.ne("recording_Status","1").nested(s->s.eq("push_State","3").or().like("recording_Error","超时"))) ;//推送中
+		 queryWrapper.nested(i->i.ne("recording_Status","1").nested(s->s.eq("push_State","3").or()
+				 .like("recording_Error","超时").or().like("recording_Error","null"))) ;//推送中
 		 //queryWrapper.or();
 		 //queryWrapper.like();//超时
 	 	 List<SyPackingListFabric> syPackingListFabrics=syPackingListFabricService.list(queryWrapper);//修改调整
@@ -1201,11 +1202,12 @@ public class SyPackingListFabricController implements Job {
 		 }
 		// RedisUtil redisUtil
 
-		 if(syPackingListFabrics.size()<=0){
+		 if(syPackingListFabrics.size()==0){
 		 	return;
 		 }
 		 UpdateWrapper updateWrapper=new UpdateWrapper();
 		 updateWrapper.set("recording_Status",1);//推送中
+		 updateWrapper.set("push_State",3);//推送中
 		 updateWrapper.in("id",ids);
 		 syPackingListFabricService.update(updateWrapper);
 

+ 8 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/controller/SyPackingListTailoringController.java

@@ -1341,7 +1341,8 @@ public class SyPackingListTailoringController implements Job {
 	 @Override
 	 public void execute(JobExecutionContext context) throws JobExecutionException {
 		 QueryWrapper <SyPackingListTailoring> queryWrapper=new QueryWrapper();
-		 queryWrapper.nested(i->i.ne("recording_Status","1").nested(s->s.eq("push_State","3").or().like("recording_Error","超时"))) ;//推送中
+		 queryWrapper.nested(i->i.ne("recording_Status","1").nested(s->s.eq("push_State","3").or()
+				 .like("recording_Error","超时").or().like("recording_Error","null"))) ;//推送中
 		/* queryWrapper.eq("push_State","3");//推送中
 		 queryWrapper.or();
 		 queryWrapper.like("recording_Error","超时");//超时*/
@@ -1357,6 +1358,7 @@ public class SyPackingListTailoringController implements Job {
 		 // RedisUtil redisUtil
 		 UpdateWrapper updateWrapper=new UpdateWrapper();
 		 updateWrapper.set("recording_Status",1);//推送中
+		 updateWrapper.set("push_State",3);//推送中
 		 updateWrapper.in("id",ids);
 		 syPackingListTailoringService.update(updateWrapper);
 
@@ -1972,6 +1974,11 @@ public class SyPackingListTailoringController implements Job {
 				 }
 			 }
 			 List<SyPackingListTailoringItem> tailoringItemList=syPackingListTailoringService.getList(tailoring.getId());
+			 if(tailoring.getIsTc()!=null){
+			 	for (SyPackingListTailoringItem tailoringItem : tailoring.getSyPackingListTailoringItemList()){
+			 		tailoringItem.setIsTc(tailoring.getIsTc());
+				}
+			 }
 			 SyOrderData syOrderData=syOrderDataMapper.selectById(tailoringItemList.get(0).getSyOrderDataId());//最终客户
 			 if(syOrderData!=null){
 				 tailoring.setEndCustomer(syOrderData.getEndCustomer());

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/entity/SyPackingListTailoringItem.java

@@ -257,6 +257,11 @@ public class SyPackingListTailoringItem implements Serializable {
 	@ApiModelProperty(value = "报关品名")
 	private String declarationName;
 
+	/**是否tc功能0否1是*/
+	@Excel(name = "是否tc功能0否1是", width = 15)
+	@ApiModelProperty(value = "是否tc功能0否1是")
+	@TableField(exist = false)
+	private java.lang.String isTc;
 
 	@TableField(exist = false)
 	@ApiModelProperty(value = "报关单位")

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

@@ -1522,35 +1522,34 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 			if (maps.containsKey(account)){
 				switch (maps.get(account).get("index")){
 					case "1":	//代表已完成第一道
-						if(!account.equals("102")/*||mapt.get("CVENCODE").equals("T020001")*/){
-							//JSONObject jsonObject1=resturn1.getJSONObject(0);//采购入库单
-							String purchaseinName=maps.get(account).get("code");//获取销售发货单
-							//String purchaseinName=jsonObject1.get("U8ReceiptNo").toString();//获取销售发货单
-							List<Map<String,Object>> purchaseinMaps= syPackingListTailoringMapper.getRdRecord01(purchaseinName);
-							if(purchaseinMaps!=null){
-								for (Map map : purchaseinMaps){
-									System.out.println("mapt4\n"+map);
-									JSONObject jsonObject=mapList5.getJSONObject(0);//循环迭代
-									List<Map<String,Object>> mapItems5= (List<Map<String,Object>>) jsonObject.get("DETAILList");
-									for (Map itemMap5 :  mapItems5){
-										if(itemMap5.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap5.get("IQUANTITY").toString())
-												==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap5.containsKey("AUTOID_PO")){//根据尺码判断
-											//getcFree((JSONObject) itemMap5,map);
-											itemMap5.put("AUTOID_PO",map.get("AutoID"));
-										}
-									}
-									System.out.println("mapItems4\t"+mapItems5);
-								}
-							}
-							text(mapList5,mapt.get("ordertype")+"发票单");
-							JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
-							recording=result(main,resturn5,mapt.get("ordertype")+"发票单",((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(!account.equals("102")/*||mapt.get("CVENCODE").equals("T020001")*/){
+//							//JSONObject jsonObject1=resturn1.getJSONObject(0);//采购入库单
+//							String purchaseinName=maps.get(account).get("code");//获取销售发货单
+//							//String purchaseinName=jsonObject1.get("U8ReceiptNo").toString();//获取销售发货单
+//							List<Map<String,Object>> purchaseinMaps= syPackingListTailoringMapper.getRdRecord01(purchaseinName);
+//							if(purchaseinMaps!=null){
+//								for (Map map : purchaseinMaps){
+//									System.out.println("mapt4\n"+map);
+//									JSONObject jsonObject=mapList5.getJSONObject(0);//循环迭代
+//									List<Map<String,Object>> mapItems5= (List<Map<String,Object>>) jsonObject.get("DETAILList");
+//									for (Map itemMap5 :  mapItems5){
+//										if(itemMap5.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap5.get("IQUANTITY").toString())
+//												==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap5.containsKey("AUTOID_PO")){//根据尺码判断
+//											//getcFree((JSONObject) itemMap5,map);
+//											itemMap5.put("AUTOID_PO",map.get("AutoID"));
+//										}
+//									}
+//									System.out.println("mapItems4\t"+mapItems5);
+//								}
+//							}
+//							text(mapList5,mapt.get("ordertype")+"发票单");
+//							JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
+//							recording=result(main,resturn5,mapt.get("ordertype")+"发票单",((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":
 						text(mapList3,"销售发货单");
-
 						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());
@@ -1581,29 +1580,29 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 						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);
-					case "4":
-						String saleoutName=maps.get(account).get("code");//销售出库单
-						this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(saleoutName),"131");
-						List<Map<String,Object>> saleoutMaps= syPackingListTailoringMapper.getRdrecord32(saleoutName);
-						if(saleoutMaps!=null){
-							for (Map map : saleoutMaps){
-								JSONObject jsonObject=mapList6.getJSONObject(0);//循环迭代
-								List<Map<String,Object>> mapItems6= (List<Map<String,Object>>) jsonObject.get("DETAILList");
-								System.out.println("获取数据1\t"+saleoutMaps);
-								System.out.println("获取数据2\t"+mapItems6);
-								for (Map itemMap6 :  mapItems6){
-									itemMap6.put("DISAUTOIDCOL","AUTOID");
-									if(itemMap6.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap6.get("IQUANTITY").toString())
-											==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap6.containsKey("AUTOID_DIS")){
-										itemMap6.put("AUTOID_DIS",map.get("autoid"));
-									}
-								}
-							}
-						}
-						text(mapList6,"销售发票单");
-						JSONArray resturn6 = InterfaceConnUtils.doPost(mapList6,"saleinvoice_import");//销售发票单
-						recording=result(main,resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),"5");//销售发票单
-						recording(main,recording);
+//				 	case "4":
+//						String saleoutName=maps.get(account).get("code");//销售出库单编码
+//						this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(saleoutName),"131");
+//						List<Map<String,Object>> saleoutMaps= syPackingListTailoringMapper.getRdrecord32(saleoutName);
+//						if(saleoutMaps!=null){
+//							for (Map map : saleoutMaps){
+//								JSONObject jsonObject=mapList6.getJSONObject(0);//循环迭代
+//								List<Map<String,Object>> mapItems6= (List<Map<String,Object>>) jsonObject.get("DETAILList");
+//								System.out.println("获取数据1\t"+saleoutMaps);
+//								System.out.println("获取数据2\t"+mapItems6);
+//								for (Map itemMap6 :  mapItems6){
+//									itemMap6.put("DISAUTOIDCOL","AUTOID");
+//									if(itemMap6.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap6.get("IQUANTITY").toString())
+//											==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap6.containsKey("AUTOID_DIS")){
+//										itemMap6.put("AUTOID_DIS",map.get("autoid"));
+//									}
+//								}
+//							}
+//						}
+//						text(mapList6,"销售发票单");
+//						JSONArray resturn6 = InterfaceConnUtils.doPost(mapList6,"saleinvoice_import");//销售发票单
+//						recording=result(main,resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),"5");//销售发票单
+//						recording(main,recording);
 				}
 				return account+"账套推送成功!";
 			}
@@ -1614,31 +1613,31 @@ 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");
 
-		JSONObject jsonObject1=resturn1.getJSONObject(0);//采购入库单
-		String purchaseinName=jsonObject1.get("U8ReceiptNo").toString();//获取销售发货单
-		List<Map<String,Object>> purchaseinMaps= syPackingListTailoringMapper.getRdRecord01(purchaseinName);
-		if(purchaseinMaps!=null){
-			for (Map map : purchaseinMaps){
-				JSONObject jsonObject=mapList5.getJSONObject(0);//循环迭代
-				List<Map<String,Object>> mapItems5= (List<Map<String,Object>>) jsonObject.get("DETAILList");
-				for (Map itemMap5 :  mapItems5){
-					if(itemMap5.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap5.get("IQUANTITY").toString())
-							==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap5.containsKey("AUTOID_SO")){//根据尺码判断
-						//getcFree((JSONObject) itemMap5,map);
-						itemMap5.put("AUTOID_PO",map.get("AutoID"));
-					}
-				}
-				System.out.println("mapItems4\t"+mapItems5);
-			}
-		}
+//		JSONObject jsonObject1=resturn1.getJSONObject(0);//采购入库单
+//		String purchaseinName=jsonObject1.get("U8ReceiptNo").toString();//获取销售发货单
+//		List<Map<String,Object>> purchaseinMaps= syPackingListTailoringMapper.getRdRecord01(purchaseinName);
+//		if(purchaseinMaps!=null){
+//			for (Map map : purchaseinMaps){
+//				JSONObject jsonObject=mapList5.getJSONObject(0);//循环迭代
+//				List<Map<String,Object>> mapItems5= (List<Map<String,Object>>) jsonObject.get("DETAILList");
+//				for (Map itemMap5 :  mapItems5){
+//					if(itemMap5.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap5.get("IQUANTITY").toString())
+//							==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap5.containsKey("AUTOID_SO")){//根据尺码判断
+//						//getcFree((JSONObject) itemMap5,map);
+//						itemMap5.put("AUTOID_PO",map.get("AutoID"));
+//					}
+//				}
+//				System.out.println("mapItems4\t"+mapItems5);
+//			}
+//		}
 
-		if(!((Map) mapList.get(0)).get("CACCID").toString().equals("102")/*||mapt.get("CVENCODE").equals("T020001")*/){
-			text(mapList5,mapt.get("ordertype")+"发票单");
-			JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
-			recording=result(main,resturn5,mapt.get("ordertype")+"发票单",((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("102")*//*||mapt.get("CVENCODE").equals("T020001")*//*){
+//			text(mapList5,mapt.get("ordertype")+"发票单");
+//			JSONArray resturn5 = InterfaceConnUtils.doPost(mapList5,"purinvoice_import");//采购发票单
+//			recording=result(main,resturn5,mapt.get("ordertype")+"发票单",((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");
+//		}
 
 		text(mapList3,"销售发货单");
 		JSONArray resturn3 = InterfaceConnUtils.doPost(mapList3,"consignment_import");//销售发货单
@@ -1677,7 +1676,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 
 		this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(saleoutName),"131");
 
-		List<Map<String,Object>> saleoutMaps= syPackingListTailoringMapper.getRdrecord32(saleoutName);
+		/*List<Map<String,Object>> saleoutMaps= syPackingListTailoringMapper.getRdrecord32(saleoutName);
 		if(saleoutMaps!=null){
 			for (Map map : saleoutMaps){
 				JSONObject jsonObject=mapList6.getJSONObject(0);//循环迭代
@@ -1694,7 +1693,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		text(mapList6,"销售发票单");
 		JSONArray resturn6 = InterfaceConnUtils.doPost(mapList6,"saleinvoice_import");//销售发票单
 		recording=result(main,resturn6,"销售发票单",((Map) mapList.get(0)).get("CACCID").toString(),"5");//销售发票单
-		recording(main,recording);
+		recording(main,recording);*/
 		//this.purchaseWarehousingMapper.updateVoucherHistoryCNumber(org.jeecg.modules.system.util.oConvertUtils.maxNumber(resturn6.getJSONObject(0).get("U8ReceiptNo").toString()),"120");
 		return mapList.getJSONObject(0).get("CACCID").toString()+"账套推送成功!";
 	}
@@ -2033,7 +2032,17 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 				jsonObject.put("CINVCODE",item.getInventoryCode());//存货编码
 				jsonObject.put("CDEFINE28",item.getSmallPo());//小po
 				jsonObject.put("POAUTOIDCOL","Autoid");//对应类型
-				jsonObject.put("CBMEMO",syPackingListTailoring.getMemo());//备注
+
+				String istc2=item.getIsTc();
+				if (istc2!=null&&istc2.equals("1")){
+					if(item.getMemo()!=null){
+						item.setMemo(item.getMemo()+"TC证书");
+					}else{
+						item.setMemo("TC证书");
+					}
+				}
+				jsonObject.put("CBMEMO",item.getMemo());//备注
+
 				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())
@@ -2181,7 +2190,15 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 				jsonObject.put("size",item.getSize());
 				jsonObject.put("CINVCODE",item.getInventoryCode());//存货编码
 				jsonObject.put("DISAUTOIDCOL","AUTOID");//对应类型
-				jsonObject.put("CBMEMO",syPackingListTailoring.getMemo());//备注
+				String istc2=item.getIsTc();
+				if (istc2!=null&&istc2.equals("1")){
+					if(item.getMemo()!=null){
+						item.setMemo(item.getMemo()+"TC证书");
+					}else{
+						item.setMemo("TC证书");
+					}
+				}
+				jsonObject.put("CBMEMO",item.getMemo());//备注
 				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()) &&jsonObject.get("size").equals(item.getSize())