Преглед на файлове

crm初始化快捷添加,常用添加

yusm преди 4 седмици
родител
ревизия
3a51898665

+ 5 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/SysModuleController.java

@@ -46,7 +46,11 @@ public class SysModuleController {
     @RequestMapping("/getAllSysModule")
     public HttpRespMsg getAllSysModule() {
         HttpRespMsg msg = new HttpRespMsg();
-        msg.data = sysModuleService.list(new QueryWrapper<SysModule>().notLike("name","详情").isNull("parent_id"));
+        List<SysModule> list = sysModuleService.list(new QueryWrapper<SysModule>().notLike("name", "详情").isNull("parent_id"));
+        SysModule sysModule = new SysModule();
+        sysModule.setId(-1).setPath("/visitor").setName("访客计划");
+        list.add(sysModule);
+        msg.data =list;
         return msg;
     }
 

+ 38 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -163,6 +163,10 @@ public class WeiXinCorpController {
 
     @Resource
     private SysDictService sysDictService;
+    @Resource
+    private FastAccessService fastAccessService;
+    @Resource
+    private CommonUseService commonUseService;
 
     public static String SUITE_ACCESS_TOKEN = null;
     public static long suiteTokenExpireTime = 0L;
@@ -1481,6 +1485,14 @@ public class WeiXinCorpController {
                         List<Stage> stageList=getStageBaseList(company);
                         stageService.saveBatch(stageList);
 
+                        List<CommonUse> initCommonUseList = getInitCommonUseList();
+                        initCommonUseList.forEach(f->f.setCompanyId(finalCompany.getId()));
+                        commonUseService.saveBatch(initCommonUseList);
+
+                        List<FastAccess> initFastAccessList = getInitFastAccessList();
+                        initFastAccessList.forEach(f->f.setCompanyId(finalCompany.getId()));
+                        fastAccessService.saveBatch(initFastAccessList);
+
                         //生成工作时长
                         TimeType timeType = new TimeType();
                         timeType.setCompanyId(company.getId());
@@ -3784,6 +3796,32 @@ public class WeiXinCorpController {
         return new HttpRespMsg();
     }
 
+    private List<FastAccess> getInitFastAccessList(){
+        ArrayList<FastAccess> list = new ArrayList<>();
+        FastAccess access1 = new FastAccess().setName("客户").setRouter("/customer");
+        list.add(access1);
+        FastAccess access2 = new FastAccess().setName("商机").setRouter("/business");
+        list.add(access2);
+        FastAccess access3 = new FastAccess().setName("任务").setRouter("/tasks");
+        list.add(access3);
+        FastAccess access4 = new FastAccess().setName("联系人").setRouter("/contacts");
+        list.add(access4);
+        return list;
+    }
+
+    private List<CommonUse> getInitCommonUseList(){
+        ArrayList<CommonUse> list = new ArrayList<>();
+        CommonUse use1 = new CommonUse().setName("客户").setRouter("/customer");
+        list.add(use1);
+        CommonUse use2 = new CommonUse().setName("商机").setRouter("/business");
+        list.add(use2);
+        CommonUse use3 = new CommonUse().setName("任务").setRouter("/tasks");
+        list.add(use3);
+        CommonUse use4 = new CommonUse().setName("联系人").setRouter("/contacts");
+        list.add(use4);
+        return list;
+    }
+
     private  List<SysForm> getBaseList(){
         ArrayList<SysForm> list = new ArrayList<>();
         SysForm sysForm1 = new SysForm();

+ 38 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -197,6 +197,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     private SuperSonicConfig  superSonicConfig;
     @Resource
     private UserQrCodeService userQrCodeService;
+    @Resource
+    private FastAccessService fastAccessService;
+    @Resource
+    private CommonUseService commonUseService;
 
     private final static String prefixUrl="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=";
 
@@ -1211,6 +1215,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             List<Stage> stageList=getStageBaseList(company);
             stageService.saveBatch(stageList);
 
+            List<CommonUse> initCommonUseList = getInitCommonUseList();
+            initCommonUseList.forEach(f->f.setCompanyId(company.getId()));
+            commonUseService.saveBatch(initCommonUseList);
+
+            List<FastAccess> initFastAccessList = getInitFastAccessList();
+            initFastAccessList.forEach(f->f.setCompanyId(company.getId()));
+            fastAccessService.saveBatch(initFastAccessList);
+
             //生成工作时长
             TimeType timeType = new TimeType();
             timeType.setCompanyId(company.getId());
@@ -1430,6 +1442,32 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         return list;
     }
 
+    private List<FastAccess> getInitFastAccessList(){
+        ArrayList<FastAccess> list = new ArrayList<>();
+        FastAccess access1 = new FastAccess().setName("客户").setRouter("/customer");
+        list.add(access1);
+        FastAccess access2 = new FastAccess().setName("商机").setRouter("/business");
+        list.add(access2);
+        FastAccess access3 = new FastAccess().setName("任务").setRouter("/tasks");
+        list.add(access3);
+        FastAccess access4 = new FastAccess().setName("联系人").setRouter("/contacts");
+        list.add(access4);
+        return list;
+    }
+
+    private List<CommonUse> getInitCommonUseList(){
+        ArrayList<CommonUse> list = new ArrayList<>();
+        CommonUse use1 = new CommonUse().setName("客户").setRouter("/customer");
+        list.add(use1);
+        CommonUse use2 = new CommonUse().setName("商机").setRouter("/business");
+        list.add(use2);
+        CommonUse use3 = new CommonUse().setName("任务").setRouter("/tasks");
+        list.add(use3);
+        CommonUse use4 = new CommonUse().setName("联系人").setRouter("/contacts");
+        list.add(use4);
+        return list;
+    }
+
 
     //新增或修改用户
     @Override