人员接口中银行账号反写至客户建设、工商银行
This commit is contained in:
		
							parent
							
								
									2b6d7ec933
								
							
						
					
					
						commit
						08bbe9463a
					
				|  | @ -41,6 +41,8 @@ public class PersonControler implements Serializable { | |||
| 
 | ||||
|     private static final String cusEntityName = "bd_customer";//系统库 表名 T_BD_Customer | ||||
|     private static final String bebankName = "bd_bebank";//系统库 行名行号 表名 t_bd_bebank | ||||
|     private static final String jsbankNumber = "105100000017";//中国建设银行总行 | ||||
|     private static final String gsbankNumber = "102100004951";//中国工商银行总行营业部 | ||||
|     private static final Log log = LogFactory.getLog(PersonControler.class); | ||||
|     private static final String apimenthod = "/person_sync"; | ||||
|     private static final String insertMmapping = "insert into t_bas_immapping(FID,FOPENID,FUSERID,FIMTYPEID) values (?,?,?,3);"; | ||||
|  | @ -199,7 +201,13 @@ public class PersonControler implements Serializable { | |||
|                 updateList.add(user); | ||||
|             } | ||||
|         } | ||||
|         DynamicObject rmbinfo = EsbUtils.getRmb(); | ||||
|         DynamicObject rmbinfo = EsbUtils.getRmb();//获取人民币币别 | ||||
|         //if收款银行=建设银行 and 详细分机银行=建设银行,then 客户-员工-开户银行=105100000017,中国建设银行总行 | ||||
|         //if收款银行=工商银行 and 详细分机银行=工商银行,then 客户-员工-开户银行=102100004951,中国工商银行总行营业部 | ||||
|         DynamicObject jsbankinfo = BusinessDataServiceHelper.loadSingleFromCache(bebankName,"id,number,name", | ||||
|                 new QFilter[]{new QFilter("number","=", jsbankNumber)}); | ||||
|         DynamicObject gsbankinfo = BusinessDataServiceHelper.loadSingleFromCache(bebankName,"id,number,name", | ||||
|                 new QFilter[]{new QFilter("number","=", gsbankNumber)}); | ||||
|         String handleResult; | ||||
|         //处理新增的用户 | ||||
|         if(!addList.isEmpty()){ | ||||
|  | @ -217,7 +225,7 @@ public class PersonControler implements Serializable { | |||
| //                    itemInfo.put("status","1"); | ||||
| //                    itemInfo.put("message",""); | ||||
|                     //更新人员对应客户的银行信息 | ||||
|                     handlePersonForCustomer(result,rmbinfo); | ||||
|                     handlePersonForCustomer(result,rmbinfo,jsbankinfo,gsbankinfo); | ||||
|                     //新增人员金蝶id和企微id的对应关系 | ||||
|                     insertPersonImmapping(result); | ||||
|                 } | ||||
|  | @ -239,7 +247,7 @@ public class PersonControler implements Serializable { | |||
| //                    itemInfo.put("status","1"); | ||||
| //                    itemInfo.put("message",""); | ||||
|                     //更新人员对应客户的银行信息 | ||||
|                     handlePersonForCustomer(result,rmbinfo); | ||||
|                     handlePersonForCustomer(result,rmbinfo,jsbankinfo,gsbankinfo); | ||||
|                     //修改人员金蝶id和企微id的对应关系 | ||||
|                     updatePersonImmapping(result); | ||||
|                 } | ||||
|  | @ -276,22 +284,30 @@ public class PersonControler implements Serializable { | |||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private void handlePersonForCustomer(UserParam ups,DynamicObject rmbinfo){ | ||||
|     private void handlePersonForCustomer(UserParam ups,DynamicObject rmbinfo,DynamicObject jsbankinfo,DynamicObject gsbankinfo){ | ||||
|         String cusnumber = (String) ups.getDataMap().get("number");//客户编号-即是 人员的编号 | ||||
|         DynamicObject currentCus = BusinessDataServiceHelper.loadSingle(cusEntityName,new QFilter[]{new QFilter("number","=",cusnumber)}); | ||||
|         if(currentCus != null){ | ||||
|             String acctnum = (String) ups.getDataMap().get("shjh_acctnum");//收款账号 | ||||
|             if(EsbUtils.isEmpty(acctnum)){ | ||||
|                 //收款账号为空不处理 | ||||
|                 return; | ||||
|             } | ||||
|             String cusname = (String) ups.getDataMap().get("name");//姓名 | ||||
| //            String skyh = (String) ups.getDataMap().get("shjh_skyh");//收款银行 | ||||
|             String skyh = (String) ups.getDataMap().get("shjh_skyh");//收款银行 | ||||
|             String xxyh = (String) ups.getDataMap().get("shjh_xxyh");//详细分机银行 | ||||
|             //根据详细分机银行 查找对应的行名行号 | ||||
|             DynamicObject bebankinfo = BusinessDataServiceHelper.loadSingleFromCache(bebankName,"id,number,name", | ||||
|                     new QFilter[]{new QFilter("name","=",xxyh)}); | ||||
|             if(bebankinfo == null){ | ||||
|                 return; | ||||
|             DynamicObject bebankinfo; | ||||
|             //建设银行的员工:开户银行统一放在:105100000017 中国建设银行总行 | ||||
|             if(xxyh != null && "建设银行".equals(xxyh.trim()) && skyh != null && "建设银行".equals(skyh.trim())){ | ||||
|                 bebankinfo = jsbankinfo; | ||||
|             }else if(xxyh != null && "工商银行".equals(xxyh.trim()) && skyh != null && "工商银行".equals(skyh.trim())){ | ||||
|                 bebankinfo = gsbankinfo; | ||||
|             }else if(xxyh != null){ | ||||
|                 bebankinfo = BusinessDataServiceHelper.loadSingleFromCache(bebankName,"id,number,name", | ||||
|                         new QFilter[]{new QFilter("name","=",xxyh)}); | ||||
|             }else{ | ||||
|                 bebankinfo = null; | ||||
|             } | ||||
|             DynamicObjectCollection doc_bank = currentCus.getDynamicObjectCollection("entry_bank"); | ||||
|             DynamicObject bankinfo; | ||||
|  |  | |||
|  | @ -189,7 +189,7 @@ public class SupplierControler { | |||
|                     bankinfo.set("bank",bebankinfo);//开户银行-行名行号 根据入参查找 | ||||
|                     bankinfo.set("currency",rmbinfo);//币别 默认人民币 | ||||
|                     bankinfo.set("shjh_banktype",json_bank.getString("banktype"));//合作银行类型 | ||||
|                     bankinfo.set("shjh_bankstatus",json_bank.getString("bankstatus"));//账户状态 | ||||
|                     bankinfo.set("shjh_bankstatus",json_bank.getString("bankstatus"));//账户状态 I插入,E删除,U更新 | ||||
|                 } | ||||
|                 if(!doc_bank.isEmpty()){ | ||||
|                     //首行账户作为默认 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue