提交付款单的时候,供应商名称和供应商银行账号中的户名不一致,进行检验
This commit is contained in:
parent
6e5f6cae07
commit
cef7e53894
|
|
@ -0,0 +1,88 @@
|
|||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package nccloud.web.arap.arappub.action;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import nc.bs.framework.common.NCLocator;
|
||||
import nc.itf.arap.pub.IArapBillService;
|
||||
import nc.itf.bd.bankacc.cust.ICustBankaccQueryService;
|
||||
import nc.itf.bd.bankacc.subinfo.IBankAccSubInfoQueryService;
|
||||
import nc.itf.bd.supplier.baseinfo.ISupplierBaseInfoQryService;
|
||||
import nc.vo.arap.basebill.BaseAggVO;
|
||||
import nc.vo.arap.basebill.BaseItemVO;
|
||||
import nc.vo.bd.bankaccount.BankAccSubVO;
|
||||
import nc.vo.bd.bankaccount.cust.CustBankaccUnionVO;
|
||||
import nc.vo.bd.supplier.SupplierVO;
|
||||
import nc.vo.pub.BusinessException;
|
||||
import nccloud.framework.core.json.IJson;
|
||||
import nccloud.framework.service.ServiceLocator;
|
||||
import nccloud.framework.web.container.IRequest;
|
||||
import nccloud.framework.web.json.JsonFactory;
|
||||
|
||||
/**
|
||||
* 20260114 在提交付款单的时候,供应商名称和供应商银行账号中的户名不一致,进行检验。提示即可
|
||||
*/
|
||||
public class BillCheckSupplierrAction extends BillSaveAction {
|
||||
public BillCheckSupplierrAction() {
|
||||
}
|
||||
|
||||
public Object doAction(IRequest request) {
|
||||
String str = request.read();
|
||||
IJson json = JsonFactory.create();
|
||||
Map info = json.fromJson(str, Map.class);
|
||||
|
||||
try {
|
||||
List<Map> list= (List<Map>) info.get("delObjs");
|
||||
|
||||
List<String> errorList = new ArrayList<String>();
|
||||
for (Map m : list) {
|
||||
String id = (String) m.get("pk_bill") != null ? (String) m.get("pk_bill") : (String) ((Map)m.get("pk_paybill")).get("value") ;
|
||||
String[] childField = new String[]{"rowno"};
|
||||
BaseAggVO[] aggvo = ((IArapBillService)ServiceLocator.find(IArapBillService.class)).queryArapBillByPKs(new String[]{id}, "F3", (String[])null, childField);
|
||||
for (BaseAggVO vo : aggvo) {
|
||||
for (BaseItemVO itemVO:vo.getItems()){
|
||||
if(!checkSupplier(itemVO)) {
|
||||
errorList.add(vo.getHeadVO().getBillno());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (errorList.size() > 0) {
|
||||
return json.toJson(errorList);
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean checkSupplier(BaseItemVO itemVO) throws BusinessException {
|
||||
String supplier = itemVO.getSupplier();
|
||||
String recaccount = itemVO.getRecaccount();
|
||||
if(null == supplier || supplier.length() == 0 || null == recaccount || recaccount.length() == 0){
|
||||
return false;
|
||||
}
|
||||
ISupplierBaseInfoQryService qryService = (ISupplierBaseInfoQryService)ServiceLocator.find(ISupplierBaseInfoQryService.class);
|
||||
SupplierVO vo = qryService.querySupplierVOByPk(supplier);
|
||||
ICustBankaccQueryService queryService = (ICustBankaccQueryService)ServiceLocator.find(ICustBankaccQueryService.class);
|
||||
BankAccSubVO[] bankAccSubVOS = ((IBankAccSubInfoQueryService) ServiceLocator.find(IBankAccSubInfoQueryService.class)).querySubInfosByPKs(new String[]{recaccount});
|
||||
if (bankAccSubVOS != null && bankAccSubVOS.length > 0) {
|
||||
return vo.getName().equals(bankAccSubVOS[0].getAccname());
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
// String bankAccountName = queryService.queryCustBankaccUnionVOByCustBank(recaccount).getBankaccbasVO().getName();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -644,6 +644,7 @@
|
|||
<action>arap.paybill.queryconferwidget</action>
|
||||
<action>arap.confirmpaybill.queryconferwidget</action>
|
||||
<action>arap.arappub.savecheck</action>
|
||||
<action>arap.arappub.checkSupplier</action>
|
||||
</actions>
|
||||
</authorize>
|
||||
<authorize>
|
||||
|
|
|
|||
|
|
@ -586,4 +586,10 @@
|
|||
<clazz>nccloud.web.arap.arappub.action.LinkBipAction</clazz>
|
||||
<btncode>Save</btncode>
|
||||
</action>
|
||||
<action>
|
||||
<name>arap.arappub.checkSupplier</name>
|
||||
<label>跳转旗舰版采购发票</label>
|
||||
<clazz>nccloud.web.arap.arappub.action.BillCheckSupplierrAction</clazz>
|
||||
<btncode>Save</btncode>
|
||||
</action>
|
||||
</actions>
|
||||
|
|
|
|||
Loading…
Reference in New Issue