客户接口分类标准处理
This commit is contained in:
		
							parent
							
								
									b287b619e0
								
							
						
					
					
						commit
						ee2781bac8
					
				|  | @ -21,7 +21,9 @@ import kd.bos.openapi.common.result.CustomApiResult; | |||
| import kd.bos.orm.query.QFilter; | ||||
| import kd.bos.servicehelper.BusinessDataServiceHelper; | ||||
| import kd.bos.servicehelper.operation.OperationServiceHelper; | ||||
| 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.CustomerModel; | ||||
| 
 | ||||
| import javax.validation.Valid; | ||||
|  | @ -34,7 +36,7 @@ public class CustomerControler { | |||
|     private static final String entityName = "bd_customer";//系统库 表名 T_BD_Customer | ||||
| 
 | ||||
|     private static final String cusTypeName = "bd_customergroup";//系统库 表名 t_bd_customergroup | ||||
| //    private static final String gdName = "bd_customergroupdetail";//系统库 客户分组 表名 t_bd_customergroupdetail | ||||
|     private static final String gdName = "bd_customergroupdetail";//系统库 客户分组 表名 t_bd_customergroupdetail | ||||
|     private static final String bebankName = "bd_bebank";//系统库 行名行号 表名 t_bd_bebank | ||||
|     private static final Log log = LogFactory.getLog(CustomerControler.class); | ||||
|     private static final String apimenthod = "/customer_sync"; | ||||
|  | @ -73,8 +75,8 @@ public class CustomerControler { | |||
|         DynamicObject currentCus; | ||||
|         DynamicObject custype; | ||||
|         JSONObject json_body; | ||||
|         Long currentSupId; | ||||
| //        DynamicObject custgroupdetail; | ||||
|         Long currentCustId; | ||||
|         DynamicObject custgroupdetail; | ||||
|         Map<String, Long> cusids = new HashMap<>();//客户编号和ID对应关系 | ||||
|         OperateOption oop = OperateOption.create(); | ||||
|         DynamicObject grouporginfo = EsbUtils.getGroupOrg(); | ||||
|  | @ -120,7 +122,7 @@ public class CustomerControler { | |||
|                 currentCus.set("createorg", grouporginfo);//创建组织 默认为集团 | ||||
|                 currentCus.set("org", grouporginfo);//管理组织 默认为集团 | ||||
|                 currentCus.set("ctrlstrategy","1");//控制策略 默认逐级分配1 自由分配2 | ||||
|                 currentCus.set("group",custype.getLong("id"));//客户分组 | ||||
|                 currentCus.set("group",custype);//客户分组 | ||||
| //                currentCus.set("bitindex",1);//位图-保存自动填充 | ||||
| //                currentCus.set("customerstatus",EsbUtils.CUSTOMERSTATUS);//客户状态-保存自动填充 | ||||
|                 currentCus.set("name",cusname);//客户名称 | ||||
|  | @ -129,9 +131,9 @@ public class CustomerControler { | |||
|                 currentCus.set("linkman",json_body.getString("contacts"));//联系人 | ||||
|                 currentCus.set("bizpartner_phone",json_body.getString("telnum"));//联系电话 | ||||
|                 //设置id和masterid 不然不能进行分配动作 | ||||
|                 currentSupId = ID.genLongId(); | ||||
|                 currentCus.set("id", currentSupId); | ||||
|                 currentCus.set("masterid",currentSupId); | ||||
|                 currentCustId = ID.genLongId(); | ||||
|                 currentCus.set("id", currentCustId); | ||||
|                 currentCus.set("masterid",currentCustId); | ||||
|                 //处理银行-新增-员工类客户不需要处理 | ||||
|                 if(!"M400".equals(type)){ | ||||
|                     handleBank(banksJson,currentCus.getDynamicObjectCollection("entry_bank"),cusnumber,cusname,rmbinfo); | ||||
|  | @ -142,6 +144,14 @@ public class CustomerControler { | |||
|                 //处理 客户组5 | ||||
|                 handleFive(customerfivesJson,currentCus.getDynamicObjectCollection("shjh_entry_five"),cusnumber); | ||||
| 
 | ||||
|                 //处理分类 | ||||
|                 custgroupdetail = BusinessDataServiceHelper.newDynamicObject(gdName); | ||||
|                 custgroupdetail.set("createorg", JhzjUtils.GROUPID);//创建组织 | ||||
|                 custgroupdetail.set("standard",EsbUtils.CUSTOMERSTAND);//客户分类标准 | ||||
|                 custgroupdetail.set("group",custype);//具体分类 | ||||
|                 custgroupdetail.set("customer",currentCustId);//客户 | ||||
|                 SaveServiceHelper.save(new DynamicObject[]{custgroupdetail}); | ||||
| 
 | ||||
|                 //保存客户-必须调用保存操作,否则不符合受控基础资料开发规范 | ||||
| //                SaveServiceHelper.save(new DynamicObject[]{currentCus}); | ||||
|                 operResult = OperationServiceHelper.executeOperate("save", entityName, new DynamicObject[]{currentCus}, oop); | ||||
|  | @ -152,16 +162,9 @@ public class CustomerControler { | |||
|                     itemInfo.put("error","客户保存失败"+operResult.getMessage()); | ||||
|                     itemsJson.add(itemInfo); | ||||
|                 } | ||||
|                 //处理分类 | ||||
| //                custgroupdetail = BusinessDataServiceHelper.newDynamicObject(gdName); | ||||
| //                custgroupdetail.set("createorg",JhzjUtils.GROUPID);//创建组织 | ||||
| //                custgroupdetail.set("standard",EsbUtils.CUSTOMERSTAND);//客户分类标准 | ||||
| //                custgroupdetail.set("group",custype.getLong("id"));//具体分类 | ||||
| //                custgroupdetail.set("customer",currentSupId);//客户 | ||||
| //                SaveServiceHelper.save(new DynamicObject[]{custgroupdetail}); | ||||
|             }else{ | ||||
|                 //修改客户 名称 税务登记号 联系人 联系电话 银行信息 客户组5 | ||||
|                 currentSupId = currentCus.getLong("id"); | ||||
|                 currentCustId = currentCus.getLong("id"); | ||||
|                 currentCus.set("name",cusname);//客户名称 | ||||
|                 currentCus.set("tx_register_no",taxno);//税务登记号 | ||||
|                 currentCus.set("societycreditcode",taxno);//统一社会信用代码 | ||||
|  | @ -182,7 +185,7 @@ public class CustomerControler { | |||
|                     itemsJson.add(itemInfo); | ||||
|                 } | ||||
|             } | ||||
|             cusids.put(cusnumber,currentSupId); | ||||
|             cusids.put(cusnumber,currentCustId); | ||||
|         } | ||||
|         //处理客户分配 | ||||
|         EsbUtils.handleAssignNew(companysJson, cusids, entityName); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue