清账单反清账成功标记判断条件优化

This commit is contained in:
yuxueliang0813 2025-09-16 09:12:53 +08:00
parent c692f40d34
commit 8a7d8e0cf1
1 changed files with 7 additions and 6 deletions

View File

@ -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 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 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 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 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 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=?;"; 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":"成功与否标记" //"ZFLAG":"成功与否标记"
//"ZMESSAGE":"消息" //"ZMESSAGE":"消息"
return resultData.getString("OBJ_KEY"); return resultData.getString("ZFLAG");
} }
return null; return null;
} }
@ -529,17 +529,18 @@ public class ClearAccountBillOperation extends AbstractOperationServicePlugIn im
//反清账具体实现 //反清账具体实现
DynamicObject[] dos = e.getDataEntities(); DynamicObject[] dos = e.getDataEntities();
DynamicObject prinfo;//清账单 DynamicObject prinfo;//清账单
String fqzpzh;//反清账凭证号 String fqzpzbj;//反清账成功标记
for (int i = 0; i < dos.length; i++) { for (int i = 0; i < dos.length; i++) {
prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName()); prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName());
//调用SAP反清账接口更新清账单中反清状态和反清凭证号 //调用SAP反清账接口更新清账单中反清状态和反清凭证号
fqzpzh = sapReversalVoucher(prinfo); fqzpzbj = sapReversalVoucher(prinfo);
if (JhzjUtils.isEmpty(fqzpzh)) { //fqzpzbj等于S 代表反清账解除清账关系成功
if (!"S".equalsIgnoreCase(fqzpzbj)) {
addErrorInfo(prinfo,"反清账失败原因是未获取到SAP反清结果请查看接口日志"); addErrorInfo(prinfo,"反清账失败原因是未获取到SAP反清结果请查看接口日志");
continue; continue;
} }
//若SAP反清成功清账单单据状态=作废清账状态=反清账反写反清账凭证号 //若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")}); DB.update(DBRoute.of("fi"), updateDetailClearStatus, new Object[]{prinfo.getString("id")});
//更新上游收款单分录行清账状态=反清账 D //更新上游收款单分录行清账状态=反清账 D