供应商接口增加字段;预提记账凭证类型
This commit is contained in:
parent
84ee631a3f
commit
03bd93b43a
|
|
@ -98,7 +98,6 @@ public class RevenueBillOperation extends AbstractOperationServicePlugIn impleme
|
|||
private JSONObject sendVoucher(DynamicObject prinfo){
|
||||
//SAP预提收益凭证接口入参组装和调用
|
||||
JSONObject IS_HEADER = new JSONObject();//抬头
|
||||
JSONArray IT_ITEM = new JSONArray();//详细
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//日期格式化工具
|
||||
String companyCode = prinfo.getDynamicObject("org").getString("number");
|
||||
IS_HEADER.put("BUKRS",companyCode);//公司代码
|
||||
|
|
@ -113,13 +112,15 @@ public class RevenueBillOperation extends AbstractOperationServicePlugIn impleme
|
|||
DynamicObject userinfo = BusinessDataServiceHelper.loadSingleFromCache(RequestContext.get().getCurrUserId(), userName);
|
||||
String oauser = userinfo.getString("shjh_oauser");
|
||||
IS_HEADER.put("USNAM",oauser);//用户名
|
||||
//----------------处理详细入参--TODO 获取对应凭证--------------------
|
||||
//----------------处理详细入参--获取对应金蝶凭证--------------------
|
||||
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,sourcebill,entries,entries.account,entries.debitlocal,entries.creditlocal,entries.entrydc",
|
||||
"id,sourcebill,entries,entries.account,entries.debitlocal,entries.creditlocal,entries.entrydc,vouchertype",
|
||||
voucherFilters.toArray());
|
||||
if (null != gl_voucher) {
|
||||
IS_HEADER.put("BLART", gl_voucher.getString("vouchertype.number"));//根据金蝶凭证类型设置
|
||||
DynamicObjectCollection entries = gl_voucher.getDynamicObjectCollection("entries");
|
||||
JSONObject item;
|
||||
DynamicObject account;
|
||||
|
|
|
|||
|
|
@ -18,14 +18,15 @@ import kd.bos.openapi.common.custom.annotation.ApiRequestBody;
|
|||
import kd.bos.openapi.common.result.CustomApiResult;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.DeleteServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
import shjh.jhzj7.fi.fi.utils.EsbUtils;
|
||||
import shjh.jhzj7.fi.fi.utils.JhzjUtils;
|
||||
import shjh.jhzj7.fi.fi.webapi.model.SupplierModel;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ApiController(value = "SupplierControler",desc = "供应商接口,自定义插件")
|
||||
public class SupplierControler {
|
||||
|
|
@ -184,11 +185,11 @@ public class SupplierControler {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//处理 sap公司信息 结算方式 统驭科目
|
||||
handleSAPCompany(companysJson,currentSup.getDynamicObjectCollection("shjh_entry_sap"),supnumber);
|
||||
//保存供应商
|
||||
SaveServiceHelper.save(new DynamicObject[]{currentSup});
|
||||
currentSupId = currentSup.getLong("id");
|
||||
cusids.put(supnumber,currentSupId);
|
||||
cusids.put(supnumber,currentSup.getLong("id"));
|
||||
//处理商务伙伴,先判断是否已经生成了伙伴,没有则新增一个伙伴
|
||||
// parterInfo = BusinessDataServiceHelper.loadSingle(parterName,new QFilter[]{new QFilter("number","=",supnumber)});
|
||||
// if(parterInfo == null){
|
||||
|
|
@ -222,4 +223,23 @@ public class SupplierControler {
|
|||
}
|
||||
}
|
||||
|
||||
private void handleSAPCompany(JSONArray companysJson,DynamicObjectCollection doc_sap,String supnumber){
|
||||
if(companysJson == null){
|
||||
return;
|
||||
}
|
||||
doc_sap.clear();
|
||||
JSONObject json_body;
|
||||
DynamicObject fiveinfo;
|
||||
for (int i = 0; i < companysJson.size(); i++) {
|
||||
json_body = companysJson.getJSONObject(i);
|
||||
if(supnumber.equals(json_body.getString("code"))){
|
||||
fiveinfo = doc_sap.addNew();
|
||||
fiveinfo.set("shjh_settlementmethod",json_body.getString("settlementmethod"));//结算方式编号
|
||||
fiveinfo.set("shjh_accountnumber",json_body.getString("accountnumber"));//统驭科目编号
|
||||
fiveinfo.set("shjh_companynum",json_body.getString("companynum"));//公司编号
|
||||
fiveinfo.set("shjh_status",EsbUtils.getStatusForBoolean(json_body.getString("companystatus")));//使用状态
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,6 +192,10 @@ public class SupplierModel implements Serializable {
|
|||
private String companynum;
|
||||
@ApiParam(value="公司层面使用状态",position=3)
|
||||
private String companystatus;
|
||||
@ApiParam(value="结算方式编号",position=4)
|
||||
private String settlementmethod;
|
||||
@ApiParam(value="统驭科目编号",position=5)
|
||||
private String accountnumber;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
|
|
@ -216,5 +220,21 @@ public class SupplierModel implements Serializable {
|
|||
public void setCompanystatus(String companystatus) {
|
||||
this.companystatus = companystatus;
|
||||
}
|
||||
|
||||
public String getSettlementmethod() {
|
||||
return settlementmethod;
|
||||
}
|
||||
|
||||
public void setSettlementmethod(String settlementmethod) {
|
||||
this.settlementmethod = settlementmethod;
|
||||
}
|
||||
|
||||
public String getAccountnumber() {
|
||||
return accountnumber;
|
||||
}
|
||||
|
||||
public void setAccountnumber(String accountnumber) {
|
||||
this.accountnumber = accountnumber;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue