Explorar el Código

bug单修改,日志记录

zhouyy hace 4 meses
padre
commit
459009863c

+ 3 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java

@@ -187,13 +187,13 @@ public class CustomController {
                 }
 
                 if(model.equals("clueSourceId")){
-                    value = String.valueOf(aClass.getMethod("getClueSourceValue").invoke(data));
+                    value = String.valueOf(null == aClass.getMethod("getClueSourceValue").invoke(data)?"":aClass.getMethod("getClueSourceValue").invoke(data));
                 }
                 if(model.equals("customerLevelId")){
-                    value = String.valueOf(aClass.getMethod("getCustomerLevelValue").invoke(data));
+                    value = String.valueOf(null == aClass.getMethod("getCustomerLevelValue").invoke(data)?"":aClass.getMethod("getCustomerLevelValue").invoke(data));
                 }
                 if(model.equals("customerIndustryId")){
-                    value = String.valueOf(aClass.getMethod("getCustomerIndustryValue").invoke(data));
+                    value = String.valueOf(null == aClass.getMethod("getCustomerIndustryValue").invoke(data)?"":aClass.getMethod("getCustomerIndustryValue").invoke(data));
                 }
                 item.add(value);
             }

+ 6 - 5
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessOpportunityServiceImpl.java

@@ -451,6 +451,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
     private CustomMapper customMapper;
     @Override
     public HttpRespMsg importData(MultipartFile multipartFile) {
+        System.out.println("=====开始进行商机导入=====");
         HttpRespMsg msg=new HttpRespMsg();
         if(!multipartFile.getOriginalFilename().endsWith(".xlsx")){
             msg.setError("文件格式错误,请使用.xlsx格式的Excel文件进行导入");
@@ -590,7 +591,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
                         }
                     }
                     if(modelName.equals("inchargerId")){
-                        if(!org.springframework.util.StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(null != cell && !org.springframework.util.StringUtils.isEmpty(cell.getStringCellValue())){
                             String userName = cell.getStringCellValue();
                             Optional<User> first;
                             if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
@@ -607,7 +608,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
                             }
                         }
                     }else if(modelName.equals("stageId")){
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(null != cell && !StringUtils.isEmpty(cell.getStringCellValue())){
                             Optional<Stage> first = stage.stream().filter(s -> s.getName().equals(cell.getStringCellValue())).findFirst();
                             if(first.isPresent()){
                                 product.setStageId(first.get().getId());
@@ -617,12 +618,12 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
                             }
                         }
                     }else if(modelName.equals("contactsId")){
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(null != cell && !StringUtils.isEmpty(cell.getStringCellValue())){
                             Optional<Contacts> first = contacts.stream().filter(s -> s.getName().equals(cell.getStringCellValue())).findFirst();
                             product.setContactsId(first.map(Contacts::getId).orElse(null));
                         }
                     }else if(modelName.equals("customerId")){
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(null != cell && !StringUtils.isEmpty(cell.getStringCellValue())){
                             Optional<Custom> first = customs.stream().filter(s -> s.getCustomName().equals(cell.getStringCellValue())).findFirst();
                             product.setCustomerId(first.map(Custom::getId).orElse(null));
                         }
@@ -646,7 +647,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
                             }
                         }
                     }else {
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(null != cell && !StringUtils.isEmpty(cell.getStringCellValue())){
                             Class<BusinessOpportunity> productClass = BusinessOpportunity.class;
                             Method method = productClass.getMethod(setter,String.class);
                             method.invoke(product,cell.getStringCellValue());

+ 13 - 10
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java

@@ -821,7 +821,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
                         }
                     }
                     if(modelName.equals("inchargerId")){
-                        if(!org.springframework.util.StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(null != cell && !org.springframework.util.StringUtils.isEmpty(cell.getStringCellValue())){
                             String userName = cell.getStringCellValue();
                             Optional<User> first;
                             if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
@@ -838,7 +838,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
                             }
                         }
                     }else if(modelName.equals("customSourceId")){
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(null != cell && !StringUtils.isEmpty(cell.getStringCellValue())){
                             Optional<SysDict> first = sysSources.stream().filter(s -> s.getName().equals(cell.getStringCellValue())).findFirst();
                             if(first.isPresent()){
                                 product.setCustomSourceId(first.get().getId());
@@ -848,7 +848,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
                             }
                         }
                     }else if(modelName.equals("customerIndustryId")){
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(null != cell && !StringUtils.isEmpty(cell.getStringCellValue())){
                             Optional<SysDict> first = sysIndutryId.stream().filter(s -> s.getName().equals(cell.getStringCellValue())).findFirst();
                             if(first.isPresent()){
                                 product.setCustomerIndustryId(first.get().getId());
@@ -858,7 +858,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
                             }
                         }
                     }else if(modelName.equals("customerLevelId")){
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(null != cell && !StringUtils.isEmpty(cell.getStringCellValue())){
                             Optional<SysDict> first = levels.stream().filter(s -> s.getName().equals(cell.getStringCellValue())).findFirst();
                             if(first.isPresent()){
                                 product.setCustomerLevelId(first.get().getId());
@@ -868,13 +868,16 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
                             }
                         }
                     }else {
-                        String stringCellValue = cell.getStringCellValue();
-                        System.out.println(stringCellValue+"=============");
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
-                            Class<Custom> productClass = Custom.class;
-                            Method method = productClass.getMethod(setter,String.class);
-                            method.invoke(product,cell.getStringCellValue());
+                        if(null != cell){
+                            String stringCellValue = cell.getStringCellValue();
+                            System.out.println(stringCellValue+"=============");
+                            if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                                Class<Custom> productClass = Custom.class;
+                                Method method = productClass.getMethod(setter,String.class);
+                                method.invoke(product,cell.getStringCellValue());
+                            }
                         }
+
                     }
 
                 }

+ 14 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SalesOrderServiceImpl.java

@@ -936,10 +936,22 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
                                 value = String.valueOf(aClass.getMethod("getBusinessOpportunityName").invoke(salesOrder));
                             }
                             if(model.equals("customSigner")){
-                                value = String.valueOf(aClass.getMethod("getCustomSignerName").invoke(salesOrder)==null?"":aClass.getMethod("getCustomSignerName").invoke(salesOrder));
+                                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                                    String tmpStr = String.valueOf(aClass.getMethod("getCustomSignerName").invoke(salesOrder) == null ? "" : aClass.getMethod("getCustomSignerName").invoke(salesOrder));
+                                    value = org.apache.commons.lang3.StringUtils.isNotBlank(tmpStr)?"$userName="+tmpStr+"$":"";
+                                }else {
+                                    value = String.valueOf(aClass.getMethod("getCustomSignerName").invoke(salesOrder)==null?"":aClass.getMethod("getCustomSignerName").invoke(salesOrder));
+                                }
+//                                value = String.valueOf(aClass.getMethod("getCustomSignerName").invoke(salesOrder)==null?"":aClass.getMethod("getCustomSignerName").invoke(salesOrder));
                             }
                             if(model.equals("companySigner")){
-                                value = String.valueOf(aClass.getMethod("getCompanySignerName").invoke(salesOrder)==null?"":aClass.getMethod("getCompanySignerName").invoke(salesOrder));
+                                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                                    String tmpStr = String.valueOf(aClass.getMethod("getCompanySignerName").invoke(salesOrder) == null ? "" : aClass.getMethod("getCompanySignerName").invoke(salesOrder));
+                                    value = org.apache.commons.lang3.StringUtils.isNotBlank(tmpStr)?"$userName="+tmpStr+"$":"";
+                                }else {
+                                    value = String.valueOf(aClass.getMethod("getCompanySignerName").invoke(salesOrder)==null?"":aClass.getMethod("getCompanySignerName").invoke(salesOrder));
+                                }
+//                                value = String.valueOf(aClass.getMethod("getCompanySignerName").invoke(salesOrder)==null?"":aClass.getMethod("getCompanySignerName").invoke(salesOrder));
                             }
                             if(model.equals("type")){
                                 value = String.valueOf(aClass.getMethod("getTypeName").invoke(salesOrder));