清账单反清账成功标记判断条件优化
This commit is contained in:
		
							parent
							
								
									c692f40d34
								
							
						
					
					
						commit
						8a7d8e0cf1
					
				|  | @ -45,7 +45,7 @@ public class ClearAccountBillOperation extends AbstractOperationServicePlugIn im | |||
|     private static final String hadleClearStatusByID = "update tk_shjh_clear_account set fk_shjh_changereason='手工清账',fk_shjh_clearstatus='A',fbillstatus='C' where fid=?;"; | ||||
|     private static final String updateSap = "update tk_shjh_clear_account set fk_shjh_clearstatus='A',fbillstatus='C',fk_shjh_sendsap=1,fk_shjh_pzh=?,fk_shjh_year=? where fid=?;"; | ||||
|     private static final String updateSrcClear = "update tk_shjh_clear_account set fk_shjh_iscopy=1 where fid=?;"; | ||||
|     private static final String updateUnClearStatus = "update tk_shjh_clear_account set fbillstatus='D',fk_shjh_clearstatus='C',fk_shjh_unclearpzh=? where fid=?;"; | ||||
|     private static final String updateUnClearStatus = "update tk_shjh_clear_account set fbillstatus='D',fk_shjh_clearstatus='C' where fid=?;"; | ||||
|     private static final String updateDetailStatusByBill = "update tk_shjh_clear_acctdetail set fbillstatus='D' where fk_shjh_clearbillid=?;"; | ||||
|     private static final String updateDetailAuditByBill = "update tk_shjh_clear_acctdetail set fbillstatus='C',fk_shjh_clearstatus='A' where fbillstatus='B' and fk_shjh_clearbillid=?;"; | ||||
|     private static final String updateDetailStatusByID = "update tk_shjh_clear_acctdetail set fbillstatus='D' where fid=?;"; | ||||
|  | @ -520,7 +520,7 @@ public class ClearAccountBillOperation extends AbstractOperationServicePlugIn im | |||
|             } | ||||
|             //"ZFLAG":"成功与否标记" | ||||
|             //"ZMESSAGE":"消息" | ||||
|             return resultData.getString("OBJ_KEY"); | ||||
|             return resultData.getString("ZFLAG"); | ||||
|         } | ||||
|         return null; | ||||
|     } | ||||
|  | @ -529,17 +529,18 @@ public class ClearAccountBillOperation extends AbstractOperationServicePlugIn im | |||
|         //反清账具体实现 | ||||
|         DynamicObject[] dos = e.getDataEntities(); | ||||
|         DynamicObject prinfo;//清账单 | ||||
|         String fqzpzh;//反清账凭证号 | ||||
|         String fqzpzbj;//反清账成功标记 | ||||
|         for (int i = 0; i < dos.length; i++) { | ||||
|             prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName()); | ||||
|             //调用SAP反清账接口,更新清账单中反清状态和反清凭证号。 | ||||
|             fqzpzh = sapReversalVoucher(prinfo); | ||||
|             if (JhzjUtils.isEmpty(fqzpzh)) { | ||||
|             fqzpzbj = sapReversalVoucher(prinfo); | ||||
|             //fqzpzbj等于S 代表反清账解除清账关系成功 | ||||
|             if (!"S".equalsIgnoreCase(fqzpzbj)) { | ||||
|                 addErrorInfo(prinfo,"反清账失败,原因是未获取到SAP反清结果,请查看接口日志"); | ||||
|                 continue; | ||||
|             } | ||||
|             //若SAP反清成功,清账单【单据状态】=作废,【清账状态】=反清账,反写【反清账凭证号】。 | ||||
|             DB.update(DBRoute.of("fi"), updateUnClearStatus, new Object[]{fqzpzh, prinfo.getLong("id")}); | ||||
|             DB.update(DBRoute.of("fi"), updateUnClearStatus, new Object[]{prinfo.getLong("id")}); | ||||
|             //更新下游清账明细单【单据状态】=作废;【清账状态】=反清账。 | ||||
|             DB.update(DBRoute.of("fi"), updateDetailClearStatus, new Object[]{prinfo.getString("id")}); | ||||
|             //更新上游收款单分录行【清账状态】=反清账 D | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue