应付单跳转旗舰版按钮-后端代码

This commit is contained in:
mzr 2025-11-28 19:24:56 +08:00
parent 1142d1d628
commit 3cd1db2e54
4 changed files with 128 additions and 0 deletions

View File

@ -0,0 +1,59 @@
package nccloud.web.arap.arappub.action;
import nc.bs.framework.common.InvocationInfoProxy;
import nc.bs.framework.common.NCLocator;
import nc.itf.scmpub.reference.uap.rbac.UserManageQuery;
import nc.itf.uif.pub.IUifService;
import nc.vo.bc.pub.util.SysParaInitQuery;
import nc.vo.bd.psn.PsndocVO;
import nccloud.baseapp.core.log.NCCForUAPLogger;
import nccloud.framework.web.container.IRequest;
import nccloud.web.action.NCCAction;
import nccloud.web.uapbd.commons.web.ParamUtils;
public class LinkBipAction extends NCCAction {
private IUifService uifservice = NCLocator.getInstance().lookup(IUifService.class);
// JwtUtil util = new JwtUtil();
@Override
public <T> Object execute(IRequest request, T para) throws Exception {
ParamUtils param = new ParamUtils(request);
String bip_pk = param.getString("bip_pk", null);
String bip_no = param.getString("bip_no", null);
// String pk_group = param.getString("pk_group", null);
String redirctCode = "purinv";
String userid = InvocationInfoProxy.getInstance().getUserId();
String psnid = UserManageQuery.queryPsndocByUserid(userid);
// String linkbipurl = SysParaInitQuery.getParaString("GLOBLE00000000000000", "LinkBIPUrl");
String linkbipurl = "";
linkbipurl = "https://www.tkkfbip.com/c-kk-lszz-znpt/commontthirdLogin";
// if (psnid == null || psnid.isEmpty()) {
// throw new RuntimeException("当前用户无人员信息,请检查");
// }
try {
// PsndocVO vo = (PsndocVO) uifservice.queryByPrimaryKey(PsndocVO.class, psnid);
// String key = SysParaInitQuery.getParaString("GLOBLE00000000000000", "LinkBIPKey");// 密钥
// String[] bipkey = key.split("/");
// if (bipkey == null || bipkey.length != 2) {
// throw new RuntimeException("LinkBIPKey格式不对请检查");
// }
// String userCode = util.encrypt(vo.getCode(), bipkey[0]);
// Map<String, Object> map = new HashMap<>();
// map.put("userCode", userCode);
// map.put("secretKey", bipkey[1]);
// map.put("ttlMillis", 60000 * 1);// 设置过期时间1分钟
// String token = util.createJWT(map);
// String url = "?token=" + token + "&redirctCode=" + redirctCode + "&billId=" + bip_pk;
// bip_pk = "2385789401874563081";// 测试环境
bip_pk = "2414583154678431746";//开发环境
String url = "?redirctCode=" + redirctCode + "&billId=" + bip_pk;
linkbipurl = linkbipurl + url;
NCCForUAPLogger.debug("LinkBipAction-linkbipurl = " + linkbipurl);
return linkbipurl;
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}
}

View File

@ -0,0 +1,61 @@
package nccloud.web.arap.arappub.action;
import com.alibaba.fastjson.JSONObject;
import nc.bs.dao.BaseDAO;
import nc.itf.arap.pub.IArapBillService;
import nc.jdbc.framework.processor.MapProcessor;
import nc.util.mmf.framework.base.MMValueCheck;
import nc.vo.arap.basebill.BaseAggVO;
import nc.vo.arap.basebill.BaseItemVO;
import nc.vo.pub.BusinessException;
import nccloud.baseapp.core.log.NCCForUAPLogger;
import nccloud.framework.core.exception.ExceptionUtils;
import nccloud.framework.core.json.IJson;
import nccloud.framework.service.ServiceLocator;
import nccloud.framework.web.action.itf.ICommonAction;
import nccloud.framework.web.container.IRequest;
import nccloud.framework.web.json.JsonFactory;
import nccloud.web.arap.arappub.info.CommonInfo;
import nccloud.web.arap.arappub.util.BillActionUtils;
import java.util.Map;
public class LinkOtherPurInvoiceAction implements ICommonAction {
public LinkOtherPurInvoiceAction() {
}
public Object doAction(IRequest request) {
String str = request.read();
(new BillActionUtils()).setBusiInfoParm(str);
IJson json = JsonFactory.create();
CommonInfo info = json.fromJson(str, CommonInfo.class);
try {
String pkBill = info.getPk_bill();
String billType = info.getBillType();
NCCForUAPLogger.debug("pkBill:" + pkBill + " billType:" + billType);
BaseAggVO[] vos = ServiceLocator.find(IArapBillService.class).queryArapBillByPKs(new String[]{pkBill}, billType);
if (MMValueCheck.isEmpty(vos)) {
ExceptionUtils.wrapBusinessException("δÕÒµ½µ¥¾Ý");
}
BaseAggVO vo = vos[0];
BaseItemVO[] itemVOS = vo.getItems();
BaseItemVO itemVO = itemVOS[0];
String topBillid = itemVO.getTop_billid();
String topTradetype = itemVO.getTop_tradetype();
NCCForUAPLogger.debug("topBillid:" + topBillid + " topTradetype:" + topTradetype);
String sql = "SELECT a.pk_invoice,a.vbillcode," +
" b.cextsrcbilltype, b.vextsrcbillcode, b.cextsrcid, b.cextsrcbid" +
" FROM po_invoice_b b" +
" LEFT JOIN po_invoice a ON a.pk_invoice = b.pk_invoice" +
" WHERE " +
" a.pk_invoice = '" + topBillid + "'";
Map<String, Object> map = (Map<String, Object>) new BaseDAO().executeQuery(sql, new MapProcessor());
JSONObject jsonObject = new JSONObject();
jsonObject.put("data", map);
return jsonObject;
} catch (BusinessException e) {
ExceptionUtils.wrapException(e);
return null;
}
}
}

View File

@ -508,6 +508,8 @@
<action>arap.confirmpayablebill.queryconferwidget</action>
<!--根据协议主键判断是否处理过质保金 -->
<action>arap.retention.qryrmcdmoney</action>
<!--跳转旗舰版采购发票 -->
<action>arap.arappub.linkBip</action>
</actions>
</authorize>
<authorize>

View File

@ -575,4 +575,10 @@
<clazz>nccloud.web.arap.arappub.action.BillSaveCheckAgainAction</clazz>
<btncode>Save</btncode>
</action>
<action>
<name>arap.arappub.linkBip</name>
<label>跳转旗舰版采购发票</label>
<clazz>nccloud.web.arap.arappub.action.LinkBipAction</clazz>
<btncode>Save</btncode>
</action>
</actions>