- [ ] 上划处理,下拨处理(新增操作推送SAP凭证)

- [ ] 凭证审核/反审核新增(上划处理,下拨处理逻辑)
--s
This commit is contained in:
weiyunlong 2025-06-13 17:47:13 +08:00
parent 580b6a17c9
commit cb0c7fd50e
4 changed files with 425 additions and 5 deletions

View File

@ -0,0 +1,207 @@
package shjh.jhzj7.fi.fi.plugin.operate;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sap.db.jdbc.packet.ErrorLevel;
import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.db.DB;
import kd.bos.db.DBRoute;
import kd.bos.entity.operate.result.OperateErrorInfo;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.AfterOperationArgs;
import kd.bos.entity.plugin.args.BeforeOperationArgs;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.QueryServiceHelper;
import kd.sdk.plugin.Plugin;
import shjh.jhzj7.fi.fi.utils.ApiUtils;
import shjh.jhzj7.fi.fi.utils.JhzjUtils;
import shjh.jhzj7.fi.fi.utils.SapUtils;
import shjh.jhzj7.fi.fi.utils.domin.ResponseData;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 下拨处理
* shjh_fca_transdownbil_ext
*/
public class TransdownbillOperation extends AbstractOperationServicePlugIn implements Plugin {
private static final String updateVoucherFlag = "update t_fca_transdownbill set fk_shjh_sendsap=1,fk_shjh_sappzh=?,fk_shjh_sapyear=? where fid=?;";
private static final String userName = "bos_user";//用户
private static final String voucherName = "gl_voucher";//凭证
private static final String pcName = "shjh_pc";//利润中心
private static final String ccName = "bos_costcenter";//成本中心
private static final String glbdName = "gl_assist_bd";//核算项目组合纵表
private final static Log logger = LogFactory.getLog(TransdownbillOperation.class);
@Override
public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
super.beforeExecuteOperationTransaction(e);
String eok = e.getOperationKey();
if("sendvoucher".equals(eok)){
DynamicObject[] dos = e.getDataEntities();
DynamicObject prinfo;
for (int i = 0; i < dos.length; i++) {
prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName());
//判断预提记账处理单是否已生成金蝶凭证
if(!prinfo.getBoolean("isvoucher")){
e.setCancelMessage(prinfo.getString("billno") + "未生成金蝶凭证无法推送SAP");
e.setCancel(true);
}else if(prinfo.getBoolean("shjh_sendsap")){
e.setCancelMessage(prinfo.getString("billno") + "已推送SAP无需再次推送");
e.setCancel(true);
}
}
}
}
@Override
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
super.afterExecuteOperationTransaction(e);
String eok = e.getOperationKey();
if("sendvoucher".equals(eok)){
//推送sap凭证接口
DynamicObject[] dos = e.getDataEntities();
DynamicObject prinfo;//预提记账处理单
JSONObject sapReturnData;
ResponseData respdata;
for (int i = 0; i < dos.length; i++) {
prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName());
if(prinfo.getBoolean("shjh_needvoucher") && !prinfo.getBoolean("shjh_sendsap")){
//如果预提记账处理单需要生成凭证且未推送sap的才推送sap
sapReturnData = sendBlueVoucher(prinfo);//蓝单
if(sapReturnData != null && "0".equals(sapReturnData.getString("code"))){
//解析sap凭证接口返回值
respdata = ApiUtils.getResponseData(sapReturnData);
if(respdata == null){
addErrorInfo(prinfo,"SAP凭证接口返回值为空详见接口日志");
continue;
}
//推送sap成功后反写已推送标记和sap凭证号和年度至预提单中
DB.update(DBRoute.of("fi"), updateVoucherFlag, new Object[]{respdata.getNumber(),respdata.getYear(),prinfo.getPkValue()});
this.operationResult.addSuccessPkId(prinfo.getPkValue());
}else if(sapReturnData != null){
addErrorInfo(prinfo,"推送SAP接口失败"+sapReturnData.getString("msg"));
}else{
addErrorInfo(prinfo,"推送SAP接口失败SAP返回值为空或者金蝶凭证未审核请检查");
}
}
}
}
}
private JSONObject sendBlueVoucher(DynamicObject prinfo){
//SAP预提收益凭证接口入参组装和调用
JSONObject IS_HEADER = new JSONObject();//抬头
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//日期格式化工具
String companyCode = prinfo.getDynamicObject("org").getString("number");
IS_HEADER.put("BUKRS",companyCode);//公司代码
IS_HEADER.put("BLART","SA");//凭证类型-总账类凭证
IS_HEADER.put("BLDAT",sdf.format(prinfo.getDate("bizdate")));//凭证日期-业务日期
IS_HEADER.put("BUDAT",sdf.format(prinfo.getDate("expiredate")));//过账日期-预提日期
String isoCode = prinfo.getDynamicObject("currency").getString("number");
IS_HEADER.put("WAERS", JhzjUtils.getCurrencyCode(isoCode));//币种
IS_HEADER.put("XBLNR",prinfo.getString("billno"));//参考凭证号-单据编号 固定长度16位
IS_HEADER.put("BKTXT",prinfo.getString("productname"));//凭证抬头文本 产品名称
//添加用户名过滤条件-操作审核按钮的用户OA用户名
DynamicObject userinfo = BusinessDataServiceHelper.loadSingleFromCache(RequestContext.get().getCurrUserId(), userName);
String oauser = userinfo.getString("shjh_oauser");
if(JhzjUtils.isEmpty(oauser)){
IS_HEADER.put("USNAM","资金系统");//用户名
}else{
IS_HEADER.put("USNAM",oauser);//用户名
}
//----------------处理详细入参--获取对应金蝶凭证--------------------
JSONArray IT_ITEM = new JSONArray();//详细
QFilter voucherFilters = new QFilter("sourcebill", QCP.equals, prinfo.getPkValue());//凭证源单ID为预提单
voucherFilters.and(new QFilter("billstatus",QCP.equals,"C"));//凭证状态已审核
DynamicObject gl_voucher = BusinessDataServiceHelper.loadSingle(voucherName,
"id,description,shjh_fjz,sourcebill,entries,entries.account,entries.assgrp,entries.debitlocal,entries.creditlocal,entries.entrydc,entries.edescription,vouchertype",
voucherFilters.toArray());
if (null != gl_voucher) {
IS_HEADER.put("BLART", gl_voucher.getString("vouchertype.number"));//根据金蝶凭证类型设置
if(!JhzjUtils.isEmpty(gl_voucher.getString("description"))){
IS_HEADER.put("BKTXT", gl_voucher.getString("description"));//凭证抬头文本-从金蝶凭证中获取
}
DynamicObjectCollection entries = gl_voucher.getDynamicObjectCollection("entries");
JSONObject item;
DynamicObject account;
BigDecimal creditlocal;
DynamicObject assgrpinfo;
String asstype;
DynamicObject glassistbd;
DynamicObject hsxminfo;
for (DynamicObject entry : entries) {
item = new JSONObject();
account = entry.getDynamicObject("account");//科目
if (null != account) {
item.put("HKONT", account.getString("number")); //总账科目_科目(凭证分录account)
item.put("UMSKZ", JhzjUtils.getUMSKZ(account.getString("number")));//特殊总账标识
}
item.put("SGTXT", entry.getString("edescription"));//凭证行摘要
//凭证反记账标识判断,如果凭证上已勾选则传X给sap
if(gl_voucher.getBoolean("shjh_fjz")){
item.put("XNEGP", "X");
}
//获取贷方金额
creditlocal = entry.getBigDecimal("creditlocal");//贷方
//获取分录借贷方向
String entrydc = (String) entry.get("entrydc");//分录方向(1.借方,-1.贷方)
if ("1".equals(entrydc)) {
//设置sap凭证借方金额
item.put("DMBTR", String.valueOf(entry.getBigDecimal("debitlocal")));
} else if ("-1".equals(entrydc)) {
//设置sap凭证贷方金额 sap通过负数体现贷方
item.put("DMBTR", String.valueOf(creditlocal.negate()));
}
assgrpinfo = entry.getDynamicObject("assgrp");//核算维度(弹性域)
if(assgrpinfo != null){
DynamicObjectCollection gl_assist_bd = QueryServiceHelper.query(glbdName, "asstype,assval",
new QFilter[]{new QFilter("hg.id", QCP.equals, assgrpinfo.getPkValue())});
for (int j = 0; j < gl_assist_bd.size(); j++) {
glassistbd = gl_assist_bd.get(j);
asstype = glassistbd.getString("asstype");//核算项目类型-对应核算维度的字段名
if("f000012".equals(asstype)){
//利润中心 f000012
hsxminfo = QueryServiceHelper.queryOne(pcName, "id,name,number",
new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值
item.put("PRCTR",hsxminfo.getString("number"));//利润中心_利润中心
}else if("f000011".equals(asstype)){
//成本中心 f000011
hsxminfo = QueryServiceHelper.queryOne(ccName, "id,name,number",
new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值
item.put("KOSTL",hsxminfo.getString("number"));//成本中心_成本中心
}
}
}
// item.put("RSTGR", "014");//原因代码_原因码
// item.put("SGTXT", SGTXT);//行项目文本_SAP会计科目行项目号
IT_ITEM.add(item);
}
}else{
String billNo = prinfo.getString("billno");
logger.error("无法获取预提记账处理单[" + billNo + "]关联的凭证信息,凭证不存在或未审核");
return null;
}
//组装参数调用推送sap凭证接口
JSONObject sapReturnData = SapUtils.sapTransactionAPI(IS_HEADER,IT_ITEM,null,prinfo.getString("billno"));
return sapReturnData;
}
private void addErrorInfo(DynamicObject bill, String errorMsg) {
OperateErrorInfo operateErrorInfo = new OperateErrorInfo();
operateErrorInfo.setMessage(bill.getString("billno") + errorMsg);
operateErrorInfo.setErrorLevel(ErrorLevel.Error.name());
operateErrorInfo.setPkValue(bill.getPkValue());
this.operationResult.addErrorInfo(operateErrorInfo);
}
}

View File

@ -0,0 +1,207 @@
package shjh.jhzj7.fi.fi.plugin.operate;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sap.db.jdbc.packet.ErrorLevel;
import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.db.DB;
import kd.bos.db.DBRoute;
import kd.bos.entity.operate.result.OperateErrorInfo;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.AfterOperationArgs;
import kd.bos.entity.plugin.args.BeforeOperationArgs;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.QueryServiceHelper;
import kd.sdk.plugin.Plugin;
import shjh.jhzj7.fi.fi.utils.ApiUtils;
import shjh.jhzj7.fi.fi.utils.JhzjUtils;
import shjh.jhzj7.fi.fi.utils.SapUtils;
import shjh.jhzj7.fi.fi.utils.domin.ResponseData;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 上划处理
* shjh_fca_transupbill_ext
*/
public class TransupbillOperation extends AbstractOperationServicePlugIn implements Plugin {
private static final String updateVoucherFlag = "update t_fca_transupbill set fk_shjh_sendsap=1,fk_shjh_sappzh=?,fk_shjh_sapyear=? where fid=?;";
private static final String userName = "bos_user";//用户
private static final String voucherName = "gl_voucher";//凭证
private static final String pcName = "shjh_pc";//利润中心
private static final String ccName = "bos_costcenter";//成本中心
private static final String glbdName = "gl_assist_bd";//核算项目组合纵表
private final static Log logger = LogFactory.getLog(TransdownbillOperation.class);
@Override
public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
super.beforeExecuteOperationTransaction(e);
String eok = e.getOperationKey();
if("sendvoucher".equals(eok)){
DynamicObject[] dos = e.getDataEntities();
DynamicObject prinfo;
for (int i = 0; i < dos.length; i++) {
prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName());
//判断预提记账处理单是否已生成金蝶凭证
if(!prinfo.getBoolean("isvoucher")){
e.setCancelMessage(prinfo.getString("billno") + "未生成金蝶凭证无法推送SAP");
e.setCancel(true);
}else if(prinfo.getBoolean("shjh_sendsap")){
e.setCancelMessage(prinfo.getString("billno") + "已推送SAP无需再次推送");
e.setCancel(true);
}
}
}
}
@Override
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
super.afterExecuteOperationTransaction(e);
String eok = e.getOperationKey();
if("sendvoucher".equals(eok)){
//推送sap凭证接口
DynamicObject[] dos = e.getDataEntities();
DynamicObject prinfo;//预提记账处理单
JSONObject sapReturnData;
ResponseData respdata;
for (int i = 0; i < dos.length; i++) {
prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName());
if(prinfo.getBoolean("shjh_needvoucher") && !prinfo.getBoolean("shjh_sendsap")){
//如果预提记账处理单需要生成凭证且未推送sap的才推送sap
sapReturnData = sendBlueVoucher(prinfo);//蓝单
if(sapReturnData != null && "0".equals(sapReturnData.getString("code"))){
//解析sap凭证接口返回值
respdata = ApiUtils.getResponseData(sapReturnData);
if(respdata == null){
addErrorInfo(prinfo,"SAP凭证接口返回值为空详见接口日志");
continue;
}
//推送sap成功后反写已推送标记和sap凭证号和年度至预提单中
DB.update(DBRoute.of("fi"), updateVoucherFlag, new Object[]{respdata.getNumber(),respdata.getYear(),prinfo.getPkValue()});
this.operationResult.addSuccessPkId(prinfo.getPkValue());
}else if(sapReturnData != null){
addErrorInfo(prinfo,"推送SAP接口失败"+sapReturnData.getString("msg"));
}else{
addErrorInfo(prinfo,"推送SAP接口失败SAP返回值为空或者金蝶凭证未审核请检查");
}
}
}
}
}
private JSONObject sendBlueVoucher(DynamicObject prinfo){
//SAP预提收益凭证接口入参组装和调用
JSONObject IS_HEADER = new JSONObject();//抬头
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//日期格式化工具
String companyCode = prinfo.getDynamicObject("org").getString("number");
IS_HEADER.put("BUKRS",companyCode);//公司代码
IS_HEADER.put("BLART","SA");//凭证类型-总账类凭证
IS_HEADER.put("BLDAT",sdf.format(prinfo.getDate("bizdate")));//凭证日期-业务日期
IS_HEADER.put("BUDAT",sdf.format(prinfo.getDate("expiredate")));//过账日期-预提日期
String isoCode = prinfo.getDynamicObject("currency").getString("number");
IS_HEADER.put("WAERS", JhzjUtils.getCurrencyCode(isoCode));//币种
IS_HEADER.put("XBLNR",prinfo.getString("billno"));//参考凭证号-单据编号 固定长度16位
IS_HEADER.put("BKTXT",prinfo.getString("productname"));//凭证抬头文本 产品名称
//添加用户名过滤条件-操作审核按钮的用户OA用户名
DynamicObject userinfo = BusinessDataServiceHelper.loadSingleFromCache(RequestContext.get().getCurrUserId(), userName);
String oauser = userinfo.getString("shjh_oauser");
if(JhzjUtils.isEmpty(oauser)){
IS_HEADER.put("USNAM","资金系统");//用户名
}else{
IS_HEADER.put("USNAM",oauser);//用户名
}
//----------------处理详细入参--获取对应金蝶凭证--------------------
JSONArray IT_ITEM = new JSONArray();//详细
QFilter voucherFilters = new QFilter("sourcebill", QCP.equals, prinfo.getPkValue());//凭证源单ID为预提单
voucherFilters.and(new QFilter("billstatus",QCP.equals,"C"));//凭证状态已审核
DynamicObject gl_voucher = BusinessDataServiceHelper.loadSingle(voucherName,
"id,description,shjh_fjz,sourcebill,entries,entries.account,entries.assgrp,entries.debitlocal,entries.creditlocal,entries.entrydc,entries.edescription,vouchertype",
voucherFilters.toArray());
if (null != gl_voucher) {
IS_HEADER.put("BLART", gl_voucher.getString("vouchertype.number"));//根据金蝶凭证类型设置
if(!JhzjUtils.isEmpty(gl_voucher.getString("description"))){
IS_HEADER.put("BKTXT", gl_voucher.getString("description"));//凭证抬头文本-从金蝶凭证中获取
}
DynamicObjectCollection entries = gl_voucher.getDynamicObjectCollection("entries");
JSONObject item;
DynamicObject account;
BigDecimal creditlocal;
DynamicObject assgrpinfo;
String asstype;
DynamicObject glassistbd;
DynamicObject hsxminfo;
for (DynamicObject entry : entries) {
item = new JSONObject();
account = entry.getDynamicObject("account");//科目
if (null != account) {
item.put("HKONT", account.getString("number")); //总账科目_科目(凭证分录account)
item.put("UMSKZ", JhzjUtils.getUMSKZ(account.getString("number")));//特殊总账标识
}
item.put("SGTXT", entry.getString("edescription"));//凭证行摘要
//凭证反记账标识判断,如果凭证上已勾选则传X给sap
if(gl_voucher.getBoolean("shjh_fjz")){
item.put("XNEGP", "X");
}
//获取贷方金额
creditlocal = entry.getBigDecimal("creditlocal");//贷方
//获取分录借贷方向
String entrydc = (String) entry.get("entrydc");//分录方向(1.借方,-1.贷方)
if ("1".equals(entrydc)) {
//设置sap凭证借方金额
item.put("DMBTR", String.valueOf(entry.getBigDecimal("debitlocal")));
} else if ("-1".equals(entrydc)) {
//设置sap凭证贷方金额 sap通过负数体现贷方
item.put("DMBTR", String.valueOf(creditlocal.negate()));
}
assgrpinfo = entry.getDynamicObject("assgrp");//核算维度(弹性域)
if(assgrpinfo != null){
DynamicObjectCollection gl_assist_bd = QueryServiceHelper.query(glbdName, "asstype,assval",
new QFilter[]{new QFilter("hg.id", QCP.equals, assgrpinfo.getPkValue())});
for (int j = 0; j < gl_assist_bd.size(); j++) {
glassistbd = gl_assist_bd.get(j);
asstype = glassistbd.getString("asstype");//核算项目类型-对应核算维度的字段名
if("f000012".equals(asstype)){
//利润中心 f000012
hsxminfo = QueryServiceHelper.queryOne(pcName, "id,name,number",
new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值
item.put("PRCTR",hsxminfo.getString("number"));//利润中心_利润中心
}else if("f000011".equals(asstype)){
//成本中心 f000011
hsxminfo = QueryServiceHelper.queryOne(ccName, "id,name,number",
new QFilter[]{new QFilter("id", QCP.equals, glassistbd.getLong("assval"))});//维度值
item.put("KOSTL",hsxminfo.getString("number"));//成本中心_成本中心
}
}
}
// item.put("RSTGR", "014");//原因代码_原因码
// item.put("SGTXT", SGTXT);//行项目文本_SAP会计科目行项目号
IT_ITEM.add(item);
}
}else{
String billNo = prinfo.getString("billno");
logger.error("无法获取预提记账处理单[" + billNo + "]关联的凭证信息,凭证不存在或未审核");
return null;
}
//组装参数调用推送sap凭证接口
JSONObject sapReturnData = SapUtils.sapTransactionAPI(IS_HEADER,IT_ITEM,null,prinfo.getString("billno"));
return sapReturnData;
}
private void addErrorInfo(DynamicObject bill, String errorMsg) {
OperateErrorInfo operateErrorInfo = new OperateErrorInfo();
operateErrorInfo.setMessage(bill.getString("billno") + errorMsg);
operateErrorInfo.setErrorLevel(ErrorLevel.Error.name());
operateErrorInfo.setPkValue(bill.getPkValue());
this.operationResult.addErrorInfo(operateErrorInfo);
}
}

View File

@ -28,6 +28,8 @@ public class VoucherAuditOperation extends AbstractOperationServicePlugIn implem
private static final String recbillName = "cas_recbill";//收款单 private static final String recbillName = "cas_recbill";//收款单
private static final String paybillName = "cas_paybill";//付款单 private static final String paybillName = "cas_paybill";//付款单
private static final String transdownbillName = "fca_transdownbill";//下拨处理
private static final String transupbillName = "fca_transupbill";//上划处理
private static final String intbillName = "cim_intbill_revenue";//理财预提记账处理单 private static final String intbillName = "cim_intbill_revenue";//理财预提记账处理单
private static final String depositpreintName = "cim_depositpreint";//定期预提记账处理单 private static final String depositpreintName = "cim_depositpreint";//定期预提记账处理单
@ -114,13 +116,14 @@ public class VoucherAuditOperation extends AbstractOperationServicePlugIn implem
this.operationResult.addErrorInfo(errorInfo); this.operationResult.addErrorInfo(errorInfo);
} }
} }
}else if(intbillName.equals(sourcebilltype) || depositpreintName.equals(sourcebilltype)){ }else if(intbillName.equals(sourcebilltype) || depositpreintName.equals(sourcebilltype)
||transdownbillName.equals(sourcebilltype) || transupbillName.equals(sourcebilltype)){
bizbillinfo = BusinessDataServiceHelper.loadSingle(sourcebillid,sourcebilltype); bizbillinfo = BusinessDataServiceHelper.loadSingle(sourcebillid,sourcebilltype);
//执行理财和定期预提记账处理单推送sap操作并反馈操作执行结果 //执行理财和定期预提记账处理单,下拨处理推送sap操作并反馈操作执行结果
operResult = OperationServiceHelper.executeOperate("sendvoucher", sourcebilltype, new DynamicObject[]{bizbillinfo}, operateOption); operResult = OperationServiceHelper.executeOperate("sendvoucher", sourcebilltype, new DynamicObject[]{bizbillinfo}, operateOption);
// 可以根据需要处理 operationResult例如检查是否成功获取返回值等 // 可以根据需要处理 operationResult例如检查是否成功获取返回值等
if (operResult.isSuccess()) { if (operResult.isSuccess()) {
logger.info("执行理财或定期预提记账处理单 sendvoucher 成功,单据编号:" + bizbillinfo.getString("billno")); logger.info("执行理财或定期预提记账或下拨处理或上划处理单 sendvoucher 成功,单据编号:" + bizbillinfo.getString("billno"));
bizbillinfo = BusinessDataServiceHelper.loadSingle(sourcebillid,sourcebilltype,"id,shjh_sappzh"); bizbillinfo = BusinessDataServiceHelper.loadSingle(sourcebillid,sourcebilltype,"id,shjh_sappzh");
operateErrorInfo = new OperateErrorInfo(); operateErrorInfo = new OperateErrorInfo();
operateErrorInfo.setMessage("SAP凭证号:" + bizbillinfo.getString("shjh_sappzh")); operateErrorInfo.setMessage("SAP凭证号:" + bizbillinfo.getString("shjh_sappzh"));

View File

@ -14,6 +14,8 @@ public class VoucherBillOperation extends AbstractOperationServicePlugIn impleme
private static final String recbillName = "cas_recbill";//收款单 private static final String recbillName = "cas_recbill";//收款单
private static final String paybillName = "cas_paybill";//付款单 private static final String paybillName = "cas_paybill";//付款单
private static final String transdownbillName = "fca_transdownbill";//下拨处理
private static final String transupbillName = "fca_transupbill";//上划处理
private static final String intbillName = "cim_intbill_revenue";//理财预提记账处理单 private static final String intbillName = "cim_intbill_revenue";//理财预提记账处理单
private static final String depositpreintName = "cim_depositpreint";//定期预提记账处理单 private static final String depositpreintName = "cim_depositpreint";//定期预提记账处理单
@ -44,10 +46,11 @@ public class VoucherBillOperation extends AbstractOperationServicePlugIn impleme
e.setCancel(true); e.setCancel(true);
} }
}else if(intbillName.equals(sourcebilltype) || depositpreintName.equals(sourcebilltype)){ }else if(intbillName.equals(sourcebilltype) || depositpreintName.equals(sourcebilltype)
|| transdownbillName.equals(sourcebilltype) ||transupbillName.equals(sourcebilltype)){
bizbillinfo = BusinessDataServiceHelper.loadSingle(sourcebillid,sourcebilltype,"id,billno,shjh_sendsap"); bizbillinfo = BusinessDataServiceHelper.loadSingle(sourcebillid,sourcebilltype,"id,billno,shjh_sendsap");
if(bizbillinfo.getBoolean("shjh_sendsap")){ if(bizbillinfo.getBoolean("shjh_sendsap")){
e.setCancelMessage(pzinfo.getString("billno")+"对应的预提记账处理单"+bizbillinfo.getString("billno")+"已推送SAP不允许反审核"); e.setCancelMessage(pzinfo.getString("billno")+"对应的预提记账处理单/下拨处理单/理财预提记账处理单/上划处理单"+bizbillinfo.getString("billno")+"已推送SAP不允许反审核");
e.setCancel(true); e.setCancel(true);
} }
} }