|
@@ -220,40 +220,41 @@ public class CustomerManagementService implements BaseService<CustomerManagement
|
|
|
model.setCreatedId(userId);
|
|
|
int result = insertWithOutId(model);
|
|
|
|
|
|
-// try {
|
|
|
-// // 给nc推送客户数据
|
|
|
-// JSONObject json = new JSONObject();
|
|
|
-// json.put("srcsystemid", id);
|
|
|
-// json.put("name", builder.toString());
|
|
|
-// json.put("pk_custclass", "02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
|
|
|
-// json.put("custprop", "0");//财务组织客户类型,必选,默认0
|
|
|
-// json.put("taxpayerid",identityCardBuilder.toString() ); //统一社会信用代码,必选
|
|
|
-// String resultJson = InvoiceUtil.customerAdd(json);
|
|
|
-// JSONObject jsonObject = JSONObject.parseObject(resultJson);
|
|
|
-// String success = jsonObject.getString("success");
|
|
|
-// if (success.equals("true")) {
|
|
|
-// JSONObject data = jsonObject.getJSONObject("data");
|
|
|
-// String code = data.getString("code");
|
|
|
-// String ncid = data.getString("ncid");
|
|
|
-// CustomerManagement record = new CustomerManagement();
|
|
|
-// record.setId(id);
|
|
|
-// record.setNcid(ncid);
|
|
|
-// record.setNcCode(code);
|
|
|
-// updateByPrimaryKeySelective(record);
|
|
|
-// }
|
|
|
-// }catch (Exception e){
|
|
|
-// log.error("推送客户失败",e);
|
|
|
-// }
|
|
|
-//
|
|
|
-// try {
|
|
|
-// // 客户分配
|
|
|
-// JSONObject json = new JSONObject();
|
|
|
-// json.put("pk_org", InvoiceUtil.pk_org);
|
|
|
-// json.put("ncid", identityCardBuilder.toString());
|
|
|
-// InvoiceUtil.customerAssign(json);
|
|
|
-// }catch (Exception e){
|
|
|
-// log.error("客户分配失败",e);
|
|
|
-// }
|
|
|
+ try {
|
|
|
+ // 给nc推送客户数据
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("srcsystemid", id);
|
|
|
+ json.put("name", builder.toString());
|
|
|
+ json.put("pk_custclass", "02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
|
|
|
+ json.put("custprop", "0");//财务组织客户类型,必选,默认0
|
|
|
+ json.put("taxpayerid",identityCardBuilder.toString() ); //统一社会信用代码,必选
|
|
|
+ log.info("推送客户详情:{}", json.toJSONString());
|
|
|
+ String resultJson = InvoiceUtil.customerAdd(json);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(resultJson);
|
|
|
+ String success = jsonObject.getString("success");
|
|
|
+ if (success.equals("true")) {
|
|
|
+ JSONObject data = jsonObject.getJSONObject("data");
|
|
|
+ String code = data.getString("code");
|
|
|
+ String ncid = data.getString("ncid");
|
|
|
+ CustomerManagement record = new CustomerManagement();
|
|
|
+ record.setId(id);
|
|
|
+ record.setNcid(ncid);
|
|
|
+ record.setNcCode(code);
|
|
|
+ updateByPrimaryKeySelective(record);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("推送客户失败",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 客户分配
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("pk_org", InvoiceUtil.pk_org);
|
|
|
+ json.put("ncid", identityCardBuilder.toString());
|
|
|
+ InvoiceUtil.customerAssign(json);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("客户分配失败",e);
|
|
|
+ }
|
|
|
|
|
|
return result;
|
|
|
|
|
@@ -319,23 +320,24 @@ public class CustomerManagementService implements BaseService<CustomerManagement
|
|
|
|
|
|
int result = updateByPrimaryKeySelective(model);
|
|
|
|
|
|
-// try {
|
|
|
-//
|
|
|
-// // 修改客户数据
|
|
|
-// JSONObject json = new JSONObject();
|
|
|
-// json.put("ncid", oldCustomer.getBuyerIdentityCard());// 客户统一信用代码,必选
|
|
|
-// json.put("name", builder.toString());
|
|
|
-// json.put("pk_custclass", "02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
|
|
|
-// json.put("custprop", "0");//财务组织客户类型,必选,默认0
|
|
|
-// json.put("taxpayerid", identityCardBuilder.toString()); //统一社会信用代码,必选
|
|
|
-// String resultJson = InvoiceUtil.customerUpdate(json);
|
|
|
-// JSONObject jsonObject = JSONObject.parseObject(resultJson);
|
|
|
-// String success = jsonObject.getString("success");
|
|
|
-// if (success.equals("true")) {
|
|
|
-// }
|
|
|
-// }catch (Exception e){
|
|
|
-// log.error("修改客户失败",e);
|
|
|
-// }
|
|
|
+ try {
|
|
|
+
|
|
|
+ // 修改客户数据
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("ncid", oldCustomer.getBuyerIdentityCard());// 客户统一信用代码,必选
|
|
|
+ json.put("name", builder.toString());
|
|
|
+ json.put("pk_custclass", "02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
|
|
|
+ json.put("custprop", "0");//财务组织客户类型,必选,默认0
|
|
|
+ json.put("taxpayerid", identityCardBuilder.toString()); //统一社会信用代码,必选
|
|
|
+ log.info("推送客户修改详情:{}", json.toJSONString());
|
|
|
+ String resultJson = InvoiceUtil.customerUpdate(json);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(resultJson);
|
|
|
+ String success = jsonObject.getString("success");
|
|
|
+ if (success.equals("true")) {
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("修改客户失败",e);
|
|
|
+ }
|
|
|
|
|
|
return result;
|
|
|
|