红单冲销获取日期、错误提示优化
This commit is contained in:
		
							parent
							
								
									405186b307
								
							
						
					
					
						commit
						cd8d847b80
					
				|  | @ -33,6 +33,7 @@ import java.util.Map; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * 定期预提记账处理 shjh_cim_depositprein_ext-单据推送sap操作插件 |  * 定期预提记账处理 shjh_cim_depositprein_ext-单据推送sap操作插件 | ||||||
|  |  * | ||||||
|  * @author yuxueliang |  * @author yuxueliang | ||||||
|  */ |  */ | ||||||
| public class DepositpreintSapOperation extends AbstractOperationServicePlugIn implements Plugin { | public class DepositpreintSapOperation extends AbstractOperationServicePlugIn implements Plugin { | ||||||
|  | @ -122,7 +123,7 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | ||||||
|                             } |                             } | ||||||
|                             String key = resultData.getString("OBJ_KEY"); |                             String key = resultData.getString("OBJ_KEY"); | ||||||
|                             if (JhzjUtils.isEmpty(key)) { |                             if (JhzjUtils.isEmpty(key)) { | ||||||
|                                 addErrorInfo(prinfo,"推送SAP接口失败,SAP返回值OBJ_KEY为空"); |                                 addErrorInfo(prinfo, "推送SAP接口失败:"+resultData.getString("ZMESSAGE")); | ||||||
|                                 continue; |                                 continue; | ||||||
|                             } |                             } | ||||||
|                             //推送sap成功后,反写已推送标记和sap凭证号和年度至预提单中 |                             //推送sap成功后,反写已推送标记和sap凭证号和年度至预提单中 | ||||||
|  | @ -164,9 +165,7 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | ||||||
|             iteminfo.put("UNAME", oauser);//用户名 |             iteminfo.put("UNAME", oauser);//用户名 | ||||||
|         } |         } | ||||||
|         //添加反清账日期 |         //添加反清账日期 | ||||||
|         long batchnoid = prinfo.getLong("batchnoid"); |         Date date = this.getSourceDate(prinfo, iteminfo); | ||||||
|         if (batchnoid!=0L){ |  | ||||||
|             Date date = this.getSourceDate(batchnoid,iteminfo); |  | ||||||
|         if (date != null) { |         if (date != null) { | ||||||
|             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||||||
|             String datestr = sdf.format(date); |             String datestr = sdf.format(date); | ||||||
|  | @ -176,16 +175,21 @@ public class DepositpreintSapOperation extends AbstractOperationServicePlugIn im | ||||||
|             iteminfo.put("GJAHR", datestr2); |             iteminfo.put("GJAHR", datestr2); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         } | 
 | ||||||
|         IT_LIST.add(iteminfo); |         IT_LIST.add(iteminfo); | ||||||
| 
 | 
 | ||||||
|         JSONObject sapReturnData = SapUtils.sapReversalAPI(IT_LIST, prinfo.getString("billno")); |         JSONObject sapReturnData = SapUtils.sapReversalAPI(IT_LIST, prinfo.getString("billno")); | ||||||
|         return sapReturnData; |         return sapReturnData; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private Date getSourceDate(long batchnoid,JSONObject iteminfo) { |     private Date getSourceDate(DynamicObject prinfo, JSONObject iteminfo) { | ||||||
|         //联查蓝单 |         Long pkValue = prinfo.getLong("batchnoid"); | ||||||
|         QFilter qFilter = new QFilter("batchnoid", QCP.equals, batchnoid);//批次id |         QFilter qFilter = new QFilter("batchnoid", QCP.equals, pkValue);//批次id | ||||||
|  | 
 | ||||||
|  |         if (pkValue == 0L) { | ||||||
|  |             pkValue = prinfo.getLong("writeoffpreintbillid");; | ||||||
|  |             qFilter = new QFilter("id", QCP.equals, pkValue); | ||||||
|  |         } | ||||||
|         qFilter.and("operatetype", QCP.equals, "preint");//操作类别 |         qFilter.and("operatetype", QCP.equals, "preint");//操作类别 | ||||||
|         DynamicObject depositprein = BusinessDataServiceHelper.loadSingle("cim_depositpreint", qFilter.toArray()); |         DynamicObject depositprein = BusinessDataServiceHelper.loadSingle("cim_depositpreint", qFilter.toArray()); | ||||||
|         if (depositprein != null) { |         if (depositprein != null) { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue