|
|
@ -25,53 +25,45 @@ public class OtherReceivableBillService extends FinKingDeeService { |
|
|
|
public ResultBean otherReceivableBillService(OtherReceivable otherReceivable) { |
|
|
|
ResultBean rb=ResultBean.fireFail(); |
|
|
|
//业务表的主表数据集合
|
|
|
|
/*Map<String,String> map_fEntityModel_=new HashMap<>(); |
|
|
|
Map<String,String> map_fEntityModel_=new HashMap<>(); |
|
|
|
//物料的数组集合
|
|
|
|
if(aRReceivable.getApplicationDate()==null){ |
|
|
|
return rb.setMsg("业务日期 不能为空"); |
|
|
|
if(otherReceivable.getBussDate()==null){ |
|
|
|
return rb.setMsg("业务日期不能为空"); |
|
|
|
} |
|
|
|
//业务日期
|
|
|
|
map_fEntityModel_.put("FDATE",aRReceivable.getApplicationDate()); |
|
|
|
map_fEntityModel_.put("FCUSTOMERID",aRReceivable.getFcustomerid()); |
|
|
|
//供应商:FSUPPLIERID (必填项)
|
|
|
|
if(aRReceivable.getApplicationDate()==null){ |
|
|
|
return rb.setMsg("供应商 不能为空"); |
|
|
|
} |
|
|
|
// map_fEntityModel_.put("FSUPPLIERID","010001");
|
|
|
|
List<ARReceivable.ScmApplyInboundVehicleDto> vehicleList = aRReceivable.getVehicleList()==null?new ArrayList<>(): aRReceivable.getVehicleList(); |
|
|
|
map_fEntityModel_.put("FDATE",otherReceivable.getBussDate()); |
|
|
|
|
|
|
|
List<OtherReceivable.CollectionDetailDto> collectionDetails = otherReceivable.getCollectionDetails()==null?new ArrayList<>(): otherReceivable.getCollectionDetails(); |
|
|
|
//准备 物料列表的数据
|
|
|
|
ResultBean<List<Map<String, String>>> vehicleListMap = createVehicleListsForReceivableBill(vehicleList); |
|
|
|
ResultBean<List<Map<String, String>>> vehicleListMap = createVehicleListsForReceivableBill(collectionDetails); |
|
|
|
if(!vehicleListMap.getSuccess()){ |
|
|
|
return rb.setMsg(vehicleListMap.getMsg()); |
|
|
|
} |
|
|
|
String kingDeeData = OtherReceivableBillCastToKingDeeBillFields.getKingDeeData(map_fEntityModel_,vehicleListMap.getData()); |
|
|
|
try { |
|
|
|
return accessKingDeeInterface(KingDeeBillId.AP_PAYABLE.getID(),kingDeeData, KingDeeBillUrl.DRAFT_URL.getURL()); |
|
|
|
return accessKingDeeInterface(KingDeeBillId.AR_OTHERRECEIVABLE.getID(),kingDeeData, KingDeeBillUrl.DRAFT_URL.getURL()); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
}*/ |
|
|
|
} |
|
|
|
return rb; |
|
|
|
} |
|
|
|
/** |
|
|
|
* 准备 物料列表的数据 ForReceivableBill |
|
|
|
*/ |
|
|
|
public ResultBean<List<Map<String, String>>> createVehicleListsForReceivableBill(List<ARReceivable.ScmApplyInboundVehicleDto> vehicleList) { |
|
|
|
|
|
|
|
public ResultBean<List<Map<String, String>>> createVehicleListsForReceivableBill(List<OtherReceivable.CollectionDetailDto> collectionDetails) { |
|
|
|
ResultBean<List<Map<String, String>>> rb=ResultBean.fireFail(); |
|
|
|
List<Map<String,String>> vehicleListMap=new ArrayList<>(); |
|
|
|
for(int i = 0; i< vehicleList.size(); i++){ |
|
|
|
ARReceivable.ScmApplyInboundVehicleDto f= vehicleList.get(i); |
|
|
|
List<Map<String,String>> collectionDetailMap=new ArrayList<>(); |
|
|
|
for(int i = 0; i< collectionDetails.size(); i++){ |
|
|
|
OtherReceivable.CollectionDetailDto c = collectionDetails.get(i); |
|
|
|
Map<String,String> m=new HashMap<>(); |
|
|
|
if(StringUtils.isBlank(f.getVinNo())){ |
|
|
|
return rb.setMsg("物料编码 不能为空"); |
|
|
|
if(StringUtils.isBlank(c.getDearDept())){ |
|
|
|
return rb.setMsg("承担部门不能为空"); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(f.getRemarks())){ |
|
|
|
return rb.setMsg("物料名称 不能为空"); |
|
|
|
if(StringUtils.isBlank(c.getExTaxMoney())){ |
|
|
|
return rb.setMsg("不含税金额不能为空"); |
|
|
|
} |
|
|
|
m.put("FMATERIALID",f.getVinNo()); |
|
|
|
m.put("FMaterialDesc",f.getRemarks()); |
|
|
|
m.put("FPRICEUNITID","liang"); |
|
|
|
vehicleListMap.add(m); |
|
|
|
m.put("FCOSTDEPARTMENTID",c.getDearDept()); |
|
|
|
m.put("FNOTAXAMOUNTFOR",c.getExTaxMoney()); |
|
|
|
collectionDetailMap.add(m); |
|
|
|
} |
|
|
|
return rb.success().setData(vehicleListMap); |
|
|
|
return rb.success().setData(collectionDetailMap); |
|
|
|
} |
|
|
|
} |
|
|
|