|
|
@ -40,8 +40,23 @@ public class BdCustomerService extends FinKingDeeService { |
|
|
|
return rb.success().setData(list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 保存客户信息 批量 |
|
|
|
* 适用客户查询的批量推送财务客户数据 |
|
|
|
* @param bdCustomers |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean<String> draftBdCustomers(List<BdCustomer> bdCustomers) { |
|
|
|
ResultBean rb=ResultBean.fireFail(); |
|
|
|
List<String> list_r=new ArrayList<>(); |
|
|
|
for(BdCustomer b:bdCustomers) { |
|
|
|
list_r.add(draftBdCustomer(b).getMsg()); |
|
|
|
} |
|
|
|
return rb.success().setData(JSONObject.toJSONString(list_r)); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 保存客户信息 |
|
|
|
* 适用客户查询的批量推送财务客户数据 |
|
|
|
* @param bdCustomer |
|
|
|
* @return |
|
|
|
*/ |
|
|
@ -102,14 +117,25 @@ public class BdCustomerService extends FinKingDeeService { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 批量修改客户 list |
|
|
|
* 批量修改客户 |
|
|
|
* 使用于出库单中推送财务客户数据 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean<String> saveBdCustomers(List<BdCustomer > bdCustomers) { |
|
|
|
public ResultBean<String> updateCustomers(List<BdCustomer > bdCustomers) { |
|
|
|
ResultBean<String> rb=ResultBean.fireFail(); |
|
|
|
List<String> list_r=new ArrayList<>(); |
|
|
|
for(BdCustomer b:bdCustomers) { |
|
|
|
ResultBean<String> stringResultBean = viewGetId(KingDeeBillId.BD_CUSTOMER.getID(), b.getFNumber()); |
|
|
|
list_r.add(updateSingleCustomer(b).getMsg()); |
|
|
|
} |
|
|
|
return rb.success().setData(JSONObject.toJSONString(list_r)); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 单个 销售出库单 推送客户信息 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean<String> updateSingleCustomer( BdCustomer b) { |
|
|
|
ResultBean<String> rb=ResultBean.fireFail(); |
|
|
|
ResultBean<String> stringResultBean = viewGetId(KingDeeBillId.BD_CUSTOMER.getID(), b.getOldFNumber()); |
|
|
|
if(!stringResultBean.getSuccess()&&!"0".equals(stringResultBean.getData())){ |
|
|
|
return stringResultBean; |
|
|
|
} |
|
|
@ -126,7 +152,7 @@ public class BdCustomerService extends FinKingDeeService { |
|
|
|
return rb.setMsg("反审核失败!"); |
|
|
|
} |
|
|
|
try{ |
|
|
|
ResultBean<String> save = save(b,custId); |
|
|
|
ResultBean<String> save = updateCustomer(b,custId); |
|
|
|
if(!save.getSuccess()){ |
|
|
|
log.info("客户保存失败!:{}"); |
|
|
|
return rb.setMsg("客户保存失败!"); |
|
|
@ -152,12 +178,11 @@ public class BdCustomerService extends FinKingDeeService { |
|
|
|
return rb.setMsg("客户分配失败!"); |
|
|
|
} |
|
|
|
log.info("客户分配成功!"); |
|
|
|
list_r.add(save.getData()); |
|
|
|
return rb.success().setData(save.getData()).setMsg("客户保存成功!"); |
|
|
|
}catch (Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
return rb.setMsg("客户保存失败!"); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(JSONObject.toJSONString(list_r)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -166,7 +191,7 @@ public class BdCustomerService extends FinKingDeeService { |
|
|
|
* @return |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
private ResultBean<String> save(BdCustomer b,String fcustid) { |
|
|
|
private ResultBean<String> updateCustomer(BdCustomer b, String fcustid) { |
|
|
|
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(b); |
|
|
|
|
|
|
|
Map<String, String> mapParams = createMapParams(stringObjectMap); |
|
|
|