|
|
@@ -88,6 +88,314 @@ public class ScheduleTaskNew {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 客户数据清洗
|
|
|
+ */
|
|
|
+// @Scheduled(cron = "0 7 9 * * ?")
|
|
|
+ public void cleanCustomerData20260428() {
|
|
|
+ /*
|
|
|
+ 查询(易思达)客户名册所有记录
|
|
|
+ */
|
|
|
+ log.info("查询(易思达)客户名册所有记录");
|
|
|
+ List<Map> ltcCustomerData = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ ltcCustomerData = yidaService.queryLtcAllCustomerData();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询(易思达)客户名册异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 更新字段:
|
|
|
+ 客户当前分级、客户潜在等级、上一年分级、AI表格映射ID
|
|
|
+ */
|
|
|
+ String formInstId;
|
|
|
+ String customerLevel; //客户当前分级
|
|
|
+ String customerPotentialLevel; //客户潜在等级
|
|
|
+ for (Map ltcCustomerRecord : ltcCustomerData){
|
|
|
+ formInstId = UtilMap.getString(ltcCustomerRecord, "formInstId");
|
|
|
+ customerPotentialLevel = UtilMap.getString(ltcCustomerRecord, "customerPotentialLevel");
|
|
|
+ if(
|
|
|
+ "A".equals(customerPotentialLevel)
|
|
|
+ ||"B".equals(customerPotentialLevel)
|
|
|
+ ||"C".equals(customerPotentialLevel)
|
|
|
+ ||"D".equals(customerPotentialLevel)
|
|
|
+ ){
|
|
|
+ customerPotentialLevel = "潜"+customerPotentialLevel;
|
|
|
+ }else if("E".equals(customerPotentialLevel)){
|
|
|
+ customerPotentialLevel = "保稳E";
|
|
|
+ }else if(
|
|
|
+ "潜A".equals(customerPotentialLevel)
|
|
|
+ ||"潜B".equals(customerPotentialLevel)
|
|
|
+ ||"潜C".equals(customerPotentialLevel)
|
|
|
+ ||"潜D".equals(customerPotentialLevel)
|
|
|
+ ||"保稳E".equals(customerPotentialLevel)
|
|
|
+ ){
|
|
|
+ //不变
|
|
|
+ }else{
|
|
|
+ customerPotentialLevel = "";
|
|
|
+ }
|
|
|
+ customerLevel = customerPotentialLevel;
|
|
|
+ try {
|
|
|
+ yidaService.updateLtcCustomerBasicInfo7(formInstId,customerLevel,customerPotentialLevel);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("更新易思达系统客户记录异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ log.info("客户数据清洗完成");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 客户数据清洗
|
|
|
+ */
|
|
|
+// @Scheduled(cron = "0 45 16 * * ?")
|
|
|
+ public void cleanCustomerData20260427() {
|
|
|
+ /*
|
|
|
+ 查询(易思达)客户名册所有记录
|
|
|
+ */
|
|
|
+ log.info("查询(易思达)客户名册所有记录");
|
|
|
+ List<Map> ltcCustomerData = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ ltcCustomerData = yidaService.queryLtcAllCustomerData();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询(易思达)客户名册异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 更新字段:
|
|
|
+ 客户当前分级、客户潜在等级、上一年分级、AI表格映射ID
|
|
|
+ */
|
|
|
+ String formInstId;
|
|
|
+// for (Map ltcCustomerRecord : ltcCustomerData){
|
|
|
+// formInstId = UtilMap.getString(ltcCustomerRecord, "formInstId");
|
|
|
+// if(ltcCustomerRecord.get("aiTableId")!=null && !ltcCustomerRecord.get("aiTableId").toString().isEmpty()){
|
|
|
+// try {
|
|
|
+// yidaService.updateLtcCustomerBasicInfo5(formInstId,"","","","");
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("更新易思达系统客户记录异常",e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ 新老客户信息
|
|
|
+ */
|
|
|
+ Map<String,String> ltcCustomerNewOrOldMap = new HashMap<>();
|
|
|
+ String ltcCustomeNameUpper;
|
|
|
+ String ltcNewOrOld;
|
|
|
+ for (Map ltcCustomerRecord : ltcCustomerData){
|
|
|
+ ltcCustomeNameUpper = ltcCustomerRecord.get("customerName").toString().replaceAll(" ","").toUpperCase();
|
|
|
+ if(ltcCustomerRecord.get("newOrOld")==null){
|
|
|
+ ltcNewOrOld = "";
|
|
|
+ }else{
|
|
|
+ ltcNewOrOld = ltcCustomerRecord.get("newOrOld").toString();
|
|
|
+ }
|
|
|
+ ltcCustomerNewOrOldMap.put(ltcCustomeNameUpper, ltcNewOrOld);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 从项目总表(系统1)获取客户数据
|
|
|
+ */
|
|
|
+ List<Map> sys1CustomerData = new ArrayList<>(); // 项目总表客户数据
|
|
|
+ try {
|
|
|
+ sys1CustomerData = aitableService.querySys1CustomerData();
|
|
|
+ log.info("项目总表客户数量="+sys1CustomerData.size());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询项目总表客户数据异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 获取项目总表客户数据,按大写客户名称分组
|
|
|
+ */
|
|
|
+ Map<String,List<Map>> customerNameUpperCaseMap = new HashMap<>();
|
|
|
+ String customerName1;
|
|
|
+ String customerName1UpperCase;
|
|
|
+ List<Map> maplist;
|
|
|
+ for (Map sys1CustomerRecord : sys1CustomerData){
|
|
|
+ if(sys1CustomerRecord.get("customerName")!= null){
|
|
|
+ customerName1 = sys1CustomerRecord.get("customerName").toString();
|
|
|
+ if(!customerName1.isEmpty()){
|
|
|
+ /*
|
|
|
+ 按大写客户名称归类
|
|
|
+ */
|
|
|
+ customerName1UpperCase = customerName1.replaceAll(" ","").toUpperCase();
|
|
|
+ if(customerNameUpperCaseMap.containsKey(customerName1UpperCase)){
|
|
|
+ maplist = customerNameUpperCaseMap.get(customerName1UpperCase);
|
|
|
+ }else{
|
|
|
+ maplist = new ArrayList<>();
|
|
|
+ }
|
|
|
+ maplist.add(sys1CustomerRecord);
|
|
|
+ customerNameUpperCaseMap.put(customerName1UpperCase,maplist);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("大写客户名称数量="+customerNameUpperCaseMap.keySet().size());
|
|
|
+
|
|
|
+ /*
|
|
|
+ 遍历易思达客户数据
|
|
|
+ */
|
|
|
+ String customerName2;
|
|
|
+ String customerName2UpperCase;
|
|
|
+ String customerNames;
|
|
|
+ String customerLevel; //客户当前分级
|
|
|
+ String customerNewOrOld; //新老客户
|
|
|
+ String aiTableId; //AI表格映射ID
|
|
|
+ for (Map ltcCustomerRecord : ltcCustomerData){
|
|
|
+ customerName2 = ltcCustomerRecord.get("customerName").toString();
|
|
|
+ customerName2UpperCase = customerName2.replaceAll(" ","").toUpperCase();
|
|
|
+ if(customerNameUpperCaseMap.containsKey(customerName2UpperCase)){
|
|
|
+ /*
|
|
|
+ 获取新系统和项目总表共有的客户(可能匹配到多个)
|
|
|
+ */
|
|
|
+ maplist = customerNameUpperCaseMap.get(customerName2UpperCase);
|
|
|
+ if(maplist!=null && !maplist.isEmpty()){
|
|
|
+ if(maplist.size()==1){
|
|
|
+ formInstId = UtilMap.getString(ltcCustomerRecord, "formInstId");
|
|
|
+ aiTableId = maplist.get(0).get("aiTableId").toString();
|
|
|
+ customerLevel = maplist.get(0).get("customerLevel").toString();
|
|
|
+ customerNewOrOld = maplist.get(0).get("newOrOld").toString();
|
|
|
+ if(!customerNewOrOld.equals(ltcCustomerNewOrOldMap.get(customerName2UpperCase))){
|
|
|
+ if(!"不合作".equals(ltcCustomerNewOrOldMap.get(customerName2UpperCase))){
|
|
|
+ System.out.println("易思达客户["+customerName2+"]:"+ltcCustomerNewOrOldMap.get(customerName2UpperCase)+",项目总表客户["+maplist.get(0).get("customerName").toString()+"]:"+customerNewOrOld);
|
|
|
+ }else{
|
|
|
+ customerNewOrOld = "不合作";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ yidaService.updateLtcCustomerBasicInfo6(formInstId,"保稳E",customerLevel,customerNewOrOld,aiTableId);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("更新易思达系统客户记录异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ customerNames = maplist.get(0).get("customerName").toString();
|
|
|
+ for(int i=1; i<maplist.size(); i++){
|
|
|
+ customerNames += ","+maplist.get(0).get("customerName").toString();
|
|
|
+ }
|
|
|
+ System.out.println(customerName2UpperCase+"匹配到多条项目总表记录:"+customerNames);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ log.info("客户数据清洗完成");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 客户数据清洗
|
|
|
+ */
|
|
|
+// @Scheduled(cron = "0 57 16 * * ?")
|
|
|
+ public void cleanCustomerData20260424() {
|
|
|
+ /*
|
|
|
+ 查询(易思达)客户名册所有记录
|
|
|
+ */
|
|
|
+ log.info("查询(易思达)客户名册所有记录");
|
|
|
+ List<Map> ltcCustomerData = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ ltcCustomerData = yidaService.queryLtcAllCustomerData();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询(易思达)客户名册异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 查询业务小组档案中的成员信息
|
|
|
+ */
|
|
|
+ List<Map> ltcBusinessUserData = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ ltcBusinessUserData = yidaService.queryLtcAllBusinessUserData();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询业务小组档案中的成员信息异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 获取业务userId与名称、业务部门映射
|
|
|
+ */
|
|
|
+ Map<String,String> businessUserIdDeptIdMap = new HashMap<>();
|
|
|
+ Map<String,String> businessUserIdNameMap = new HashMap<>();
|
|
|
+ String businessUserId;
|
|
|
+ for (Map ltcCustomerRecord : ltcCustomerData){
|
|
|
+ businessUserId = UtilMap.getString(ltcCustomerRecord, "userId");
|
|
|
+ if(!businessUserId.isEmpty()){
|
|
|
+ if(!businessUserIdDeptIdMap.containsKey(businessUserId)){
|
|
|
+ businessUserIdDeptIdMap.put(businessUserId,"");
|
|
|
+ }
|
|
|
+ if(!businessUserIdNameMap.containsKey(businessUserId)){
|
|
|
+ businessUserIdNameMap.put(businessUserId,"");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List deptIdList;
|
|
|
+ for (String userId : businessUserIdDeptIdMap.keySet()) {
|
|
|
+ try {
|
|
|
+ deptIdList = ddCoreClient.getDeptIdListByUserId(userId);
|
|
|
+ if(!deptIdList.isEmpty()){
|
|
|
+ businessUserIdDeptIdMap.put(userId, String.valueOf(deptIdList.get(0)));
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+// log.error("获取业务userId与业务部门映射异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ for (String userId : businessUserIdNameMap.keySet()) {
|
|
|
+ try {
|
|
|
+ businessUserIdNameMap.put(userId,ddCoreClient.getNameByUserId(userId));
|
|
|
+ } catch (Exception e) {
|
|
|
+// log.error("获取业务userId与名称映射异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 更新字段:
|
|
|
+ 业务userId、负责人文本、业务组长、业务部门
|
|
|
+ */
|
|
|
+ String formInstId;
|
|
|
+ String testUseFlag;
|
|
|
+ String userId;
|
|
|
+ String businessName;
|
|
|
+ String businessLeaderUserId;
|
|
|
+ String businessDepartment;
|
|
|
+ for (Map ltcCustomerRecord : ltcCustomerData){
|
|
|
+ testUseFlag = UtilMap.getString(ltcCustomerRecord, "testUseFlag");
|
|
|
+ if(testUseFlag.equals("否")){
|
|
|
+ formInstId = UtilMap.getString(ltcCustomerRecord, "formInstId");
|
|
|
+ userId = UtilMap.getString(ltcCustomerRecord, "userId");
|
|
|
+ if(userId != null && !userId.isEmpty()){
|
|
|
+ businessName = businessUserIdNameMap.get(userId);
|
|
|
+ businessLeaderUserId = null;
|
|
|
+ for (int i = 0; i < ltcBusinessUserData.size(); i++) {
|
|
|
+ if(UtilMap.getString(ltcBusinessUserData.get(i), "userId").equals(userId)){
|
|
|
+ businessLeaderUserId = UtilMap.getString(ltcBusinessUserData.get(i), "businessLeaderUserId");
|
|
|
+ if(businessLeaderUserId.isEmpty()){
|
|
|
+ businessLeaderUserId = null;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ businessDepartment = businessUserIdDeptIdMap.get(userId);
|
|
|
+ if(businessDepartment.isEmpty()){
|
|
|
+ businessDepartment = null;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ userId = "";
|
|
|
+ businessName = "";
|
|
|
+ businessLeaderUserId = null;
|
|
|
+ businessDepartment = null;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ yidaService.updateLtcCustomerBasicInfo4(formInstId,userId,businessName,businessLeaderUserId,businessDepartment);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("更新易思达系统客户记录异常",e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ log.info("客户数据清洗完成");
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 客户数据清洗
|
|
|
@@ -301,10 +609,10 @@ public class ScheduleTaskNew {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 同步客户数据
|
|
|
+ * 更新客户测试使用标识
|
|
|
*/
|
|
|
// @Scheduled(cron = "0 35 10 * * ?")
|
|
|
- public void syncCustomerData() {
|
|
|
+ public void updateCustomerTestFlag() {
|
|
|
/*
|
|
|
查询所有已离职的员工
|
|
|
*/
|
|
|
@@ -334,7 +642,7 @@ public class ScheduleTaskNew {
|
|
|
try {
|
|
|
ltcCustomerData = yidaService.queryLtcAllCustomerData();
|
|
|
} catch (Exception e) {
|
|
|
- log.error("查询(客户数据清洗)客户名册all所有记录异常",e);
|
|
|
+ log.error("查询(易思达)客户名册所有记录异常",e);
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
@@ -373,7 +681,394 @@ public class ScheduleTaskNew {
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
- log.info("同步客户数据完成");
|
|
|
+ log.info("更新客户测试使用标识完成");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 同步客户与业务
|
|
|
+ */
|
|
|
+// @Scheduled(cron = "0 51 16 * * ?")
|
|
|
+ public void syncCustomerAndBusinessUser() {
|
|
|
+ /*
|
|
|
+ 查询(易思达)客户名册所有记录
|
|
|
+ */
|
|
|
+ log.info("查询(易思达)客户名册所有记录");
|
|
|
+ List<Map> ltcCustomerData = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ ltcCustomerData = yidaService.queryLtcAllCustomerData();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询(易思达)客户名册异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 查询(客户数据清洗)私海客户所有记录
|
|
|
+ */
|
|
|
+// log.info("查询(客户数据清洗)私海客户所有记录");
|
|
|
+// List<Map> privateSeaCustomerData = new ArrayList<>();
|
|
|
+// try {
|
|
|
+// privateSeaCustomerData = yidaService.querySys1Sys2PrivateCustomerData();
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("查询(客户数据清洗)私海客户所有记录异常",e);
|
|
|
+// }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 查询(客户数据清洗)公海客户所有记录
|
|
|
+ */
|
|
|
+// log.info("查询(客户数据清洗)公海客户所有记录");
|
|
|
+// List<Map> publicSeaCustomerData = new ArrayList<>();
|
|
|
+// try {
|
|
|
+// publicSeaCustomerData = yidaService.querySys1Sys2PublicCustomerData();
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("查询(客户数据清洗)公海客户所有记录异常",e);
|
|
|
+// }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 查询(客户数据清洗)不合作客户所有记录
|
|
|
+ */
|
|
|
+// log.info("查询(客户数据清洗)不合作客户所有记录");
|
|
|
+// List<Map> uncooperativeSeaCustomerData = new ArrayList<>();
|
|
|
+// try {
|
|
|
+// uncooperativeSeaCustomerData = yidaService.querySys1Sys2UncooperativeCustomerData();
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("查询(客户数据清洗)不合作客户所有记录异常",e);
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ 比对私海客户(客户名称去空格后转大写)
|
|
|
+ 匹配成功则更新
|
|
|
+ */
|
|
|
+// String customerName1;
|
|
|
+// String customerName1UpperCase;
|
|
|
+// String businessUserId;
|
|
|
+// String customerName2;
|
|
|
+// String customerName2UpperCase;
|
|
|
+// String businessUserId2;
|
|
|
+// String formInstId;
|
|
|
+// for(Map privateSeaCustomerRecord : privateSeaCustomerData){
|
|
|
+// customerName1 = UtilMap.getString(privateSeaCustomerRecord, "customerName");
|
|
|
+// customerName1UpperCase = customerName1.replaceAll(" ","").toUpperCase();
|
|
|
+// businessUserId = UtilMap.getString(privateSeaCustomerRecord, "businessUserId");
|
|
|
+// for (int i = 0; i < ltcCustomerData.size(); i++) {
|
|
|
+// customerName2 = UtilMap.getString(ltcCustomerData.get(i), "customerName");
|
|
|
+// customerName2UpperCase = customerName2.replaceAll(" ","").toUpperCase();
|
|
|
+// businessUserId2 = UtilMap.getString(ltcCustomerData.get(i), "userId");
|
|
|
+//// formInstId = UtilMap.getString(ltcCustomerData.get(i), "formInstId");
|
|
|
+// if(customerName1UpperCase.equals(customerName2UpperCase)){
|
|
|
+// /*
|
|
|
+// 客户名称(大写)一致,更新易思达系统客户基本信息(客户公司名、业务、公海/私海、测试使用)
|
|
|
+// */
|
|
|
+//// try {
|
|
|
+//// yidaService.updateLtcCustomerBasicInfo(formInstId,customerName1,businessUserId,"私","否");
|
|
|
+//// } catch (Exception e) {
|
|
|
+//// log.error("更新易思达系统客户基本信息异常",e);
|
|
|
+//// }
|
|
|
+//
|
|
|
+// if(businessUserId==null || businessUserId.isEmpty()){
|
|
|
+// if(businessUserId2==null || businessUserId2.isEmpty()){
|
|
|
+// //两边一致
|
|
|
+// }else{
|
|
|
+// System.out.println("两边不一致:"+customerName1);
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// if(businessUserId2==null || businessUserId2.isEmpty()){
|
|
|
+// System.out.println("两边不一致:"+customerName1);
|
|
|
+// }else{
|
|
|
+// if(businessUserId.equals(businessUserId2)){
|
|
|
+// //两边一致
|
|
|
+// }else{
|
|
|
+// System.out.println("两边不一致:"+customerName1);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 比对私海客户(客户名称去空格后转大写)
|
|
|
+ 未匹配到则新增
|
|
|
+ */
|
|
|
+// String customerName1;
|
|
|
+// String customerName1UpperCase;
|
|
|
+// String customerName2;
|
|
|
+// String customerName2UpperCase;
|
|
|
+// boolean isNew;
|
|
|
+// for (Map privateSeaCustomerRecord : privateSeaCustomerData){
|
|
|
+// isNew = true;
|
|
|
+// customerName1 = UtilMap.getString(privateSeaCustomerRecord, "customerName");
|
|
|
+// customerName1UpperCase = customerName1.replaceAll(" ","").toUpperCase();
|
|
|
+// for (int i = 0; i < ltcCustomerData.size(); i++){
|
|
|
+// customerName2 = UtilMap.getString(ltcCustomerData.get(i), "customerName");
|
|
|
+// customerName2UpperCase = customerName2.replaceAll(" ","").toUpperCase();
|
|
|
+// if(customerName1UpperCase.equals(customerName2UpperCase)){
|
|
|
+// isNew = false;
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if(isNew){
|
|
|
+// /*
|
|
|
+// 是新客户,新增易思达系统客户记录
|
|
|
+// */
|
|
|
+// privateSeaCustomerRecord.put("seaType","私");
|
|
|
+// privateSeaCustomerRecord.put("newOrOld","新");
|
|
|
+// privateSeaCustomerRecord.put("testUseFlag","否");
|
|
|
+// try {
|
|
|
+// yidaService.insertCustomerData(privateSeaCustomerRecord);
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("新增易思达系统客户记录异常",e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ 比对公海客户(客户名称去空格后转大写)
|
|
|
+ */
|
|
|
+// String customerName1;
|
|
|
+// String customerName1UpperCase;
|
|
|
+// String businessUserId;
|
|
|
+// String customerName2;
|
|
|
+// String customerName2UpperCase;
|
|
|
+// String businessUserId2;
|
|
|
+// String formInstId;
|
|
|
+// for(Map publicSeaCustomerRecord : publicSeaCustomerData){
|
|
|
+// customerName1 = UtilMap.getString(publicSeaCustomerRecord, "customerName");
|
|
|
+// customerName1UpperCase = customerName1.replaceAll(" ","").toUpperCase();
|
|
|
+// businessUserId = UtilMap.getString(publicSeaCustomerRecord, "businessUserId");
|
|
|
+// for (int i = 0; i < ltcCustomerData.size(); i++) {
|
|
|
+// customerName2 = UtilMap.getString(ltcCustomerData.get(i), "customerName");
|
|
|
+// customerName2UpperCase = customerName2.replaceAll(" ","").toUpperCase();
|
|
|
+// businessUserId2 = UtilMap.getString(ltcCustomerData.get(i), "userId");
|
|
|
+//// formInstId = UtilMap.getString(ltcCustomerData.get(i), "formInstId");
|
|
|
+// if(customerName1UpperCase.equals(customerName2UpperCase)){
|
|
|
+// /*
|
|
|
+// 客户名称(大写)一致,更新易思达系统客户基本信息(客户公司名、业务、公海/私海、测试使用)
|
|
|
+// */
|
|
|
+//// try {
|
|
|
+//// yidaService.updateLtcCustomerBasicInfo(formInstId,customerName1,null,"公","否");
|
|
|
+//// } catch (Exception e) {
|
|
|
+//// log.error("更新易思达系统客户基本信息异常",e);
|
|
|
+//// }
|
|
|
+// if(businessUserId==null || businessUserId.isEmpty()){
|
|
|
+// if(businessUserId2==null || businessUserId2.isEmpty()){
|
|
|
+// //两边一致
|
|
|
+// }else{
|
|
|
+// System.out.println("两边不一致:"+customerName1);
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// if(businessUserId2==null || businessUserId2.isEmpty()){
|
|
|
+// System.out.println("两边不一致:"+customerName1);
|
|
|
+// }else{
|
|
|
+// if(businessUserId.equals(businessUserId2)){
|
|
|
+// //两边一致
|
|
|
+// }else{
|
|
|
+// System.out.println("两边不一致:"+customerName1);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 比对公海客户(客户名称去空格后转大写)
|
|
|
+ 未匹配到则新增
|
|
|
+ */
|
|
|
+// String customerName1;
|
|
|
+// String customerName1UpperCase;
|
|
|
+// String customerName2;
|
|
|
+// String customerName2UpperCase;
|
|
|
+// boolean isNew;
|
|
|
+// for (Map publicSeaCustomerRecord : publicSeaCustomerData){
|
|
|
+// isNew = true;
|
|
|
+// customerName1 = UtilMap.getString(publicSeaCustomerRecord, "customerName");
|
|
|
+// customerName1UpperCase = customerName1.replaceAll(" ","").toUpperCase();
|
|
|
+// for (int i = 0; i < ltcCustomerData.size(); i++){
|
|
|
+// customerName2 = UtilMap.getString(ltcCustomerData.get(i), "customerName");
|
|
|
+// customerName2UpperCase = customerName2.replaceAll(" ","").toUpperCase();
|
|
|
+// if(customerName1UpperCase.equals(customerName2UpperCase)){
|
|
|
+// isNew = false;
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if(isNew){
|
|
|
+// /*
|
|
|
+// 是新客户,新增易思达系统客户记录
|
|
|
+// */
|
|
|
+// publicSeaCustomerRecord.put("seaType","公");
|
|
|
+// publicSeaCustomerRecord.put("businessUserId",null);
|
|
|
+// publicSeaCustomerRecord.put("newOrOld","新");
|
|
|
+// publicSeaCustomerRecord.put("testUseFlag","否");
|
|
|
+// try {
|
|
|
+// yidaService.insertCustomerData(publicSeaCustomerRecord);
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("新增易思达系统客户记录异常",e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 比对不合作客户(客户名称去空格后转大写)
|
|
|
+ */
|
|
|
+// String customerName1;
|
|
|
+// String customerName1UpperCase;
|
|
|
+// String businessUserId;
|
|
|
+// String customerName2;
|
|
|
+// String customerName2UpperCase;
|
|
|
+// String businessUserId2;
|
|
|
+// String formInstId;
|
|
|
+// for(Map uncooperativeSeaCustomerRecord : uncooperativeSeaCustomerData){
|
|
|
+// customerName1 = UtilMap.getString(uncooperativeSeaCustomerRecord, "customerName");
|
|
|
+// customerName1UpperCase = customerName1.replaceAll(" ","").toUpperCase();
|
|
|
+// businessUserId = UtilMap.getString(uncooperativeSeaCustomerRecord, "businessUserId");
|
|
|
+// for (int i = 0; i < ltcCustomerData.size(); i++) {
|
|
|
+// customerName2 = UtilMap.getString(ltcCustomerData.get(i), "customerName");
|
|
|
+// customerName2UpperCase = customerName2.replaceAll(" ","").toUpperCase();
|
|
|
+// businessUserId2 = UtilMap.getString(ltcCustomerData.get(i), "userId");
|
|
|
+//// formInstId = UtilMap.getString(ltcCustomerData.get(i), "formInstId");
|
|
|
+// if(customerName1UpperCase.equals(customerName2UpperCase)){
|
|
|
+// /*
|
|
|
+// 客户名称(大写)一致,更新易思达系统客户基本信息(客户公司名、业务、公海/私海、测试使用)
|
|
|
+// */
|
|
|
+//// try {
|
|
|
+//// yidaService.updateLtcCustomerBasicInfo2(formInstId,customerName1,null,"公","不合作","否");
|
|
|
+//// } catch (Exception e) {
|
|
|
+//// log.error("更新易思达系统客户基本信息异常",e);
|
|
|
+//// }
|
|
|
+// if(businessUserId==null || businessUserId.isEmpty()){
|
|
|
+// if(businessUserId2==null || businessUserId2.isEmpty()){
|
|
|
+// //两边一致
|
|
|
+// }else{
|
|
|
+// System.out.println("两边不一致:"+customerName1);
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// if(businessUserId2==null || businessUserId2.isEmpty()){
|
|
|
+// System.out.println("两边不一致:"+customerName1);
|
|
|
+// }else{
|
|
|
+// if(businessUserId.equals(businessUserId2)){
|
|
|
+// //两边一致
|
|
|
+// }else{
|
|
|
+// System.out.println("两边不一致:"+customerName1);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ 比对不合作客户(客户名称去空格后转大写)
|
|
|
+ 未匹配到则新增
|
|
|
+ */
|
|
|
+// String customerName1;
|
|
|
+// String customerName1UpperCase;
|
|
|
+// String customerName2;
|
|
|
+// String customerName2UpperCase;
|
|
|
+// boolean isNew;
|
|
|
+// for (Map uncooperativeSeaCustomerRecord : uncooperativeSeaCustomerData){
|
|
|
+// isNew = true;
|
|
|
+// customerName1 = UtilMap.getString(uncooperativeSeaCustomerRecord, "customerName");
|
|
|
+// customerName1UpperCase = customerName1.replaceAll(" ","").toUpperCase();
|
|
|
+// for (int i = 0; i < ltcCustomerData.size(); i++){
|
|
|
+// customerName2 = UtilMap.getString(ltcCustomerData.get(i), "customerName");
|
|
|
+// customerName2UpperCase = customerName2.replaceAll(" ","").toUpperCase();
|
|
|
+// if(customerName1UpperCase.equals(customerName2UpperCase)){
|
|
|
+// isNew = false;
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if(isNew){
|
|
|
+// /*
|
|
|
+// 是新客户,新增易思达系统客户记录
|
|
|
+// */
|
|
|
+// uncooperativeSeaCustomerRecord.put("seaType","公");
|
|
|
+// uncooperativeSeaCustomerRecord.put("businessUserId",null);
|
|
|
+// uncooperativeSeaCustomerRecord.put("newOrOld","不合作");
|
|
|
+// uncooperativeSeaCustomerRecord.put("testUseFlag","否");
|
|
|
+// try {
|
|
|
+// yidaService.insertCustomerData(uncooperativeSeaCustomerRecord);
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("新增易思达系统客户记录异常",e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ log.info("同步客户与业务完成");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 补充客户基本信息
|
|
|
+ */
|
|
|
+// @Scheduled(cron = "0 30 11 * * ?")
|
|
|
+ public void supplementTheCustomerData() {
|
|
|
+ /*
|
|
|
+ 查询(易思达)客户名册所有记录
|
|
|
+ */
|
|
|
+ log.info("查询(易思达)客户名册所有记录");
|
|
|
+ List<Map> ltcCustomerData = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ ltcCustomerData = yidaService.queryLtcAllCustomerData();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询(易思达)客户名册异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 查询业务小组档案中的成员信息
|
|
|
+ */
|
|
|
+ List<Map> ltcBusinessUserData = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ ltcBusinessUserData = yidaService.queryLtcAllBusinessUserData();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询业务小组档案中的成员信息异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 更新字段:
|
|
|
+ 客户验重
|
|
|
+ 业务userId
|
|
|
+ 业务组长
|
|
|
+ 是否大客户
|
|
|
+ */
|
|
|
+ String formInstId;
|
|
|
+ String customerName;
|
|
|
+ String customerNameUpperCase;
|
|
|
+ String userId;
|
|
|
+ String userIdText;
|
|
|
+ String businessLeaderUserId;
|
|
|
+ for(Map ltcCustomerRecord : ltcCustomerData){
|
|
|
+ customerName = UtilMap.getString(ltcCustomerRecord, "customerName");
|
|
|
+ customerNameUpperCase = customerName.replaceAll(" ","").toUpperCase();
|
|
|
+ userId = UtilMap.getString(ltcCustomerRecord, "userId");
|
|
|
+ userIdText = UtilMap.getString(ltcCustomerRecord, "userIdText");
|
|
|
+ businessLeaderUserId = null;
|
|
|
+// for (int i = 0; i < ltcBusinessUserData.size(); i++) {
|
|
|
+// if(UtilMap.getString(ltcBusinessUserData.get(i), "userId").equals(userId)){
|
|
|
+// businessLeaderUserId = UtilMap.getString(ltcBusinessUserData.get(i), "businessLeaderUserId");
|
|
|
+// if(businessLeaderUserId.isEmpty()){
|
|
|
+// businessLeaderUserId = null;
|
|
|
+// }
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+ try {
|
|
|
+ System.out.println(customerName);
|
|
|
+ formInstId = UtilMap.getString(ltcCustomerRecord, "formInstId");
|
|
|
+// yidaService.updateLtcCustomerBasicInfo3(formInstId,customerNameUpperCase,userId,businessLeaderUserId,"否");
|
|
|
+ yidaService.updateLtcCustomerBasicInfo4(formInstId,"","",null,null);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("更新易思达系统客户记录异常",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ log.info("补充客户基本信息完成");
|
|
|
}
|
|
|
|
|
|
}
|