Browse Source

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min 1 year ago
parent
commit
aa24d99d60
47 changed files with 1369 additions and 280 deletions
  1. 35 15
      fhKeeper/formulahousekeeper/customerBuler-crm/src/App.vue
  2. BIN
      fhKeeper/formulahousekeeper/customerBuler-crm/src/assets/defaultCover.png
  3. 11 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/analysis/index.vue
  4. 11 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/index.vue
  5. 11 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/index.vue
  6. 11 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/corpreport/index.vue
  7. 11 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/index.vue
  8. 144 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/header/header.vue
  9. 89 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/home copy.vue
  10. 19 78
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/home.vue
  11. 26 32
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/login.vue
  12. 11 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/index.vue
  13. 11 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/index.vue
  14. 7 24
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/register.vue
  15. 10 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/system/dictionary/index.vue
  16. 11 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/system/index.vue
  17. 12 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/system/role/index.vue
  18. 18 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/index.vue
  19. 11 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/index.vue
  20. 79 5
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/index.vue
  21. 31 14
      fhKeeper/formulahousekeeper/customerBuler-crm/src/router/index.ts
  22. 34 17
      fhKeeper/formulahousekeeper/customerBuler-crm/src/store/index.ts
  23. 3 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/styles/global.scss
  24. 6 6
      fhKeeper/formulahousekeeper/customerBuler-crm/src/type.d.ts
  25. 25 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ContactsController.java
  26. 13 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Contacts.java
  27. 13 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/vo/ContactsVo.java
  28. 8 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ContactsMapper.java
  29. 7 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ContactsService.java
  30. 68 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContactsServiceImpl.java
  31. 30 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ContactsMapper.xml
  32. 21 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportDeleteController.java
  33. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Department.java
  34. 347 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ReportDelete.java
  35. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportDeleteMapper.java
  36. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ReportDeleteService.java
  37. 20 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportDeleteServiceImpl.java
  38. 50 23
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  39. 28 19
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  40. 21 38
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java
  41. 66 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportDeleteMapper.xml
  42. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml
  43. 1 0
      fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json
  44. 1 0
      fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json
  45. 1 0
      fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue
  46. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue
  47. 0 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/login/index.vue

+ 35 - 15
fhKeeper/formulahousekeeper/customerBuler-crm/src/App.vue

@@ -3,9 +3,9 @@
 </template>
 </template>
 
 
 <script setup lang="ts">
 <script setup lang="ts">
-import { onMounted, ref, provide, inject } from 'vue'
+import { provide } from 'vue'
 import { useStore } from '@/store/index'
 import { useStore } from '@/store/index'
-import { ElNotification } from 'element-plus'
+import { ElNotification, NotificationParamsTyped } from 'element-plus'
 const { setAsyncRoutesMark } = useStore()
 const { setAsyncRoutesMark } = useStore()
 window.addEventListener('beforeunload', () => beforeunloadFn())
 window.addEventListener('beforeunload', () => beforeunloadFn())
 const beforeunloadFn = (() => {
 const beforeunloadFn = (() => {
@@ -13,20 +13,36 @@ const beforeunloadFn = (() => {
 })
 })
 
 
 provide<GlobalPopup>('globalPopup', {
 provide<GlobalPopup>('globalPopup', {
-  showSuccess: (msg: string, time: number, icon: string) => { notificationTiop }, //!SECTION 成功
-  showError: (msg: string, time: number, icon: string) => { notificationTiop }, //!SECTION 失败
-  showWarning: (msg: string, time: number, icon: string) => { notificationTiop }, //!SECTION 警告
-  showInfo: (msg: string, time: number, icon: string) => { notificationTiop }, //!SECTION 文本
+  showSuccess: (message?: string) => {
+    notificationTiop({
+      message: message || '成功',
+      type: 'success',
+      title: "提示",
+      duration: 2000
+    })
+  }, //!SECTION 成功
+  showError: (message?: string) => notificationTiop({
+    message: message || '失败',
+    type: 'error',
+    title: "提示",
+    duration: 2000
+  }), //!SECTION 失败
+  showWarning: (message: string) => notificationTiop({
+    message,
+    type: 'warning',
+    title: "提示",
+    duration: 2000
+  }), //!SECTION 警告
+  showInfo: (message: string) => notificationTiop({
+    message,
+    type: 'info',
+    title: "提示",
+    duration: 2000
+  }), //!SECTION 文本
 })
 })
 
 
-const notificationTiop = (msg: string, time: number, icon: string, type: string) => {
-  let obj: any = {}
-  obj.title = '提示'
-  obj.message = msg
-  time ? obj.duration = time : obj.duration = 2000
-  icon ? obj.iconClass = icon : obj.iconClass = ''
-  type ? obj.type = type : obj.type = 'success'
-  ElNotification(obj)
+const notificationTiop = (options: NotificationParamsTyped) => {
+  ElNotification(options)
 }
 }
 
 
 </script>
 </script>
@@ -38,6 +54,10 @@ body,
 .layouts {
 .layouts {
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
-  overflow: hidden;
+  /* overflow: hidden; */
+  min-width: 650px;
+}
+* {
+  font-family: '微软雅黑';
 }
 }
 </style>
 </style>

BIN
fhKeeper/formulahousekeeper/customerBuler-crm/src/assets/defaultCover.png


+ 11 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/analysis/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    analysis
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="scss" scoped></style>

+ 11 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    business
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="scss" scoped></style>

+ 11 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    contacts
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="scss" scoped></style>

+ 11 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/corpreport/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    corpreport
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="scss" scoped></style>

+ 11 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    customer
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="scss" scoped></style>

+ 144 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/header/header.vue

@@ -0,0 +1,144 @@
+<template>
+  <div class="trademark mr-8 flex items-center text-white">
+    <img :src="loginLogin" class="w-10 h-10 mr-4" />
+    <div class="text-nowrap">客户管家</div>
+  </div>
+  <div class=" flex flex-row justify-start items-center text-white flex-1 parentDiv" ref="parentDiv">
+    <div v-for="(routerItem, routerItemIdex) in routerList"
+      :class="`border-b-2 border-transparent hover:border-white p-2 mr-4 cursor-pointer multipleyHeader ${activeRouter?.path === routerItem.path ? 'border-white' : ''}`"
+      :key="routerItem.path" ref="childDivs" v-show="visibleItems.includes(routerItemIdex)">
+      <div v-if="routerItem.children && routerItem.children.length <= 0" @click="setCurrentRouter(routerItem)" class="text-nowrap">
+        {{ routerItem.name }}
+      </div>
+      <div v-else class="flex justify-center items-center">
+        <el-dropdown>
+          <div class="text-white w-full h-full headerText">
+            {{ routerItem.name }}
+            <el-icon class="el-icon--right">
+              <arrow-down />
+            </el-icon>
+          </div>
+          <template #dropdown>
+            <el-dropdown-menu>
+              <el-dropdown-item v-for="child in routerItem.children" :key="child.path" @click="setCurrentRouter(child)">
+                {{ child.name }}
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </template>
+        </el-dropdown>
+      </div>
+    </div>
+  </div>
+  <div class="flex flex-row justify-start items-center text-white header-right">
+    <el-icon :size="26" class="ml-4 cursor-pointer">
+      <Bell />
+    </el-icon>
+    <div>
+      <img class="w-8 h-8 rounded-full ml-4 cursor-pointer" :src="defaultCover" alt="" @click="logout()">
+    </div>
+    <el-icon :size="26" class="ml-4 cursor-pointer">
+      <Grid />
+    </el-icon>
+  </div>
+</template>
+  
+<script lang="ts" setup>
+import { onMounted, ref, watchEffect } from 'vue';
+import { RouteRecordRaw, useRouter } from 'vue-router';
+import { useStore } from "../../store/index"
+import defaultCover from "../../assets/defaultCover.png";
+import loginLogin from '../../assets/login/login_logo.png'
+const { routers, clearStore } = useStore()
+const router = useRouter();
+const routerList = ref<RouteRecordRaw[]>([]);
+const activeRouter = ref<RouteRecordRaw>();
+
+const visibleItems = ref<number[]>([]);
+const parentDiv = ref<HTMLElement | null>(null);
+
+const updateVisibleItems = () => {
+  const parentWidth = parentDiv.value?.offsetWidth || 10;
+  const canvas = document.createElement('canvas');
+  const context = canvas.getContext('2d');
+
+  let textWidthList: any = [] // 所有文字的宽度
+  let totalWidth = 0;
+  let temporaryIndex: any = []
+  
+  if(context) {
+    context.font = '16px 微软雅黑';
+    textWidthList = routerList.value.map((item: any) => {
+      const metrics = context.measureText(item.name);
+      return Math.ceil(metrics.width) + 32; // 32是padding和margin的宽度
+    })
+  }
+  for(let i in textWidthList) {
+    if(totalWidth + textWidthList[i] > parentWidth) {
+      break;
+    }
+    totalWidth += textWidthList[i];
+    temporaryIndex.push(+i);
+  }
+
+  // 替换最后一个元素
+  let lastIndex = textWidthList.length - 1;
+  temporaryIndex.splice(temporaryIndex.length -1, 1, lastIndex)
+
+  visibleItems.value = temporaryIndex;
+  console.log(visibleItems.value)
+};
+
+const setCurrentRouter = (item: RouteRecordRaw) => {
+  activeRouter.value = item;
+  if (item.children && item.children.length > 0) {
+    router.push({ path: item.children[0].path });
+    return
+  }
+  router.push({ path: item.path });
+};
+const logout = () => {
+  clearStore();
+  router.push({ path: '/login' });
+};
+onMounted(() => {
+  routerList.value = routers;
+  activeRouter.value = routerList.value.find((item) => item.path === router.currentRoute.value.path);
+  console.log("routerList", routerList);
+
+  window.addEventListener('resize', updateVisibleItems);
+  setTimeout(() => {
+    updateVisibleItems();
+  }, 500);
+})
+watchEffect(() => {
+  updateVisibleItems();
+});
+</script>
+  
+<style scoped lang="scss">
+.trademark {
+  font-size: 20px;
+}
+.multipleyHeader {
+  height: 96%;
+  display: flex;
+  align-items: center;
+  text-wrap: nowrap;
+
+  .headerText {
+    font-size: 16px;
+  }
+}
+.parentBox {
+  // max-width: 80%;
+  // min-width: 300px;
+  flex: 1;
+  overflow: hidden;
+}
+.header-right {
+  width: 135px;
+}
+.parentDiv {
+  width: 50%;
+}
+</style>

+ 89 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/home copy.vue

@@ -0,0 +1,89 @@
+<template>
+  <div class="w-full h-full">
+    <el-container>
+      <el-header class="bg-sky-800 leading-10 flex flex-row justify-between">
+        <div class=" flex flex-row justify-start items-center text-white flex-1">
+          <div v-for="routerItem in routerList"
+            :class="`border-b-2 border-transparent hover:border-white p-2 mr-4 multipleyHeader ${activeRouter?.path === routerItem.path ? 'border-white' : ''}`"
+            :key="routerItem.path">
+            <div v-if="!routerItem.children" @click="setCurrentRouter(routerItem)">
+              {{ routerItem.name }}
+            </div>
+            <div v-else class="flex justify-center items-center">
+              <el-dropdown>
+                <div class="text-white w-full h-full headerText">
+                  {{ routerItem.name }}
+                  <el-icon class="el-icon--right">
+                    <arrow-down />
+                  </el-icon>
+                </div>
+                <template #dropdown>
+                  <el-dropdown-menu>
+                    <el-dropdown-item v-for="child in routerItem.children"
+                      :key="child.path"
+                      @click="setCurrentRouter(child)">
+                      {{ child.name }}
+                    </el-dropdown-item>
+                  </el-dropdown-menu>
+                </template>
+              </el-dropdown>
+            </div>
+          </div>
+        </div>
+        <div class="flex flex-row justify-start items-center text-white">
+          <el-icon :size="26" class="ml-4 cursor-pointer">
+            <Bell />
+          </el-icon>
+          <div>
+            <img class="w-8 h-8 rounded-full ml-4 cursor-pointer" :src="defaultCover" alt="" @click="logout()">
+          </div>
+          <el-icon :size="26" class="ml-4 cursor-pointer">
+            <Grid />
+          </el-icon>
+        </div>
+      </el-header>
+      <el-main>
+        <router-view />
+      </el-main>
+    </el-container>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { onMounted, ref } from 'vue';
+import { RouteRecordRaw, useRouter } from 'vue-router';
+import { useStore } from "@/store"
+import defaultCover from "@/assets/defaultCover.png";
+const { getRoutersList } = useStore()
+const router = useRouter();
+const routerList = ref<RouteRecordRaw[]>([]);
+const activeRouter = ref<RouteRecordRaw>();
+const setCurrentRouter = (item: RouteRecordRaw) => {
+  activeRouter.value = item;
+  if (item.children && item.children.length > 0) {
+    router.push({ path: item.children[0].path });
+    return
+  }
+  router.push({ path: item.path });
+};
+const logout = () => {
+  router.push({ path: '/login' });
+};
+onMounted(() => {
+  routerList.value = getRoutersList;
+  activeRouter.value = routerList.value.find((item) => item.path === router.currentRoute.value.path);
+  console.log("routerList", routerList);
+})
+
+</script>
+
+<style scoped lang="scss">
+.multipleyHeader {
+  height: 96%;
+  display: flex;
+  align-items: center;
+  .headerText {
+    font-size: 16px;
+  }
+}
+</style>

+ 19 - 78
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/home.vue

@@ -1,86 +1,27 @@
 <template>
 <template>
-    <div class="common-layout layouts">
-        <el-container class="flex flex-col layouts">
-            <!-- 头部 -->
-            <el-header></el-header>
-            <!-- 左侧菜单 -->
-            <el-container class="flex-1 layouts">
-                <el-aside class="home-el-aside" width="220px">
-                    <el-menu default-active="1" class="el-menu-vertical-demo">
-                        <el-menu-item :index="(index + 1) + ''" v-for="(item, index) in 10" :key="index">
-                            <div class="relativeElem">
-                                <el-icon>
-                                    <setting />
-                                </el-icon>
-                                <span>第{{ index + 1 }}个</span>
-                            </div>
-                        </el-menu-item>
-
-                        <el-sub-menu index="11">
-                            <template #title>
-                                <el-icon>
-                                    <location />
-                                </el-icon>
-                                <span>第十一个</span>
-                            </template>
-                            <el-menu-item :index="'11'">
-                                <div class="relativeElem">
-                                    <el-icon><icon-menu /></el-icon>
-                                    <span>第11-1个</span>
-                                </div>
-                            </el-menu-item>
-                        </el-sub-menu>
-                    </el-menu>
-                </el-aside>
-                <!-- 主体 -->
-                <el-main>
-                    <router-view></router-view>
-                </el-main>
-            </el-container>
-        </el-container>
-    </div>
+  <div class="w-full h-full">
+    <el-container class="flex flex-row h-full">
+      <el-header class="bg-sky-800 leading-10 flex flex-row justify-between">
+        <Header></Header>
+      </el-header>
+      <el-main>
+        <router-view />
+      </el-main>
+    </el-container>
+  </div>
 </template>
 </template>
+
 <script lang="ts" setup>
 <script lang="ts" setup>
+import Header from '@/pages/header/header.vue'
+import { onMounted, ref } from 'vue';
 
 
 </script>
 </script>
-<style scoped lang="scss">
-.common-layout {
-    .relativeElem {
-        position: relative;
-        z-index: 2;
-        display: flex;
-        align-items: center;
-    }
-
-    .el-header {
-        background: $darkBlue;
-    }
 
 
-    .el-menu-vertical-demo {
-        height: 100%;
-        background: $ashen;
-
-        .is-active {
-            position: relative;
-            color: $modena;
-
-            &:before {
-                content: '';
-                position: absolute;
-                right: 0;
-                top: 8px;
-                width: 95%;
-                height: 40px;
-                background: $backColor;
-                border-top-left-radius: 20px;
-                border-bottom-left-radius: 20px;
-            }
-        }
-    }
-
-    .el-main {
-        padding: 0 20px;
-        background: $backColor;
-    }
+<style scoped lang="scss">
+.el-main {
+  padding: 0;
+  flex: 1;
+  overflow: hidden;
+  background: $backColor;
 }
 }
 </style>
 </style>

+ 26 - 32
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/login.vue

@@ -45,11 +45,11 @@ import { useRouter } from "vue-router";
 import loginLogo from "@/assets/login/login_logo.png";
 import loginLogo from "@/assets/login/login_logo.png";
 import qiyeweixin from "@/assets/login/qiyeweixin.png";
 import qiyeweixin from "@/assets/login/qiyeweixin.png";
 import { UserFilled, Lock } from '@element-plus/icons-vue'
 import { UserFilled, Lock } from '@element-plus/icons-vue'
-import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
+import { type FormInstance, type FormRules } from 'element-plus'
 import { useStore } from '@/store/index'
 import { useStore } from '@/store/index'
 import { post } from "@/utils/request";
 import { post } from "@/utils/request";
 import { LOGIN } from "./api";
 import { LOGIN } from "./api";
-const { setRouters } = useStore()
+const { setRouters, setValue } = useStore()
 const router = useRouter();
 const router = useRouter();
 const globalPopup = inject<GlobalPopup>('globalPopup')
 const globalPopup = inject<GlobalPopup>('globalPopup')
 const ruleFormRef = ref<FormInstance>();
 const ruleFormRef = ref<FormInstance>();
@@ -76,41 +76,35 @@ const login = (formEl: FormInstance | undefined) => {
     console.log(ruleForm.value);
     console.log(ruleForm.value);
     post(LOGIN, { ...ruleForm.value }).then(res => {
     post(LOGIN, { ...ruleForm.value }).then(res => {
       console.log(res);
       console.log(res);
-      globalPopup?.showSuccess('登录成功', 1000, '')
-      // if(res.code == 'error') {
-      //   ElMessage.error({
-      //     message: "登录失败",
-      //     type: "error",
-      //     duration: 2000,
-      //   })
-      //   loginLoading.value = false;
-      //   return
-      // }
-      // ElMessage.success({
-      //   message: "登录成功",
-      //   type: "success",
-      //   duration: 2000,
-      // })
-      // setTimeout(() => {
-      //   loginLoading.value = false;
-      // }, 1000)
-      // loginLoading.value = false;
+      if(res.code == 'error') {
+        globalPopup?.showError(res.msg)
+        loginLoading.value = false;
+        return
+      }
+      globalPopup?.showSuccess('登录成功')
+      setValue(res.data, 'userInfo')
+      setValue(res.data?.moduleList, 'routers')
+      setTimeout(() => {
+        loginLoading.value = false;
+        router.push(res.data?.moduleList[0].path);
+      }, 1000)
+      loginLoading.value = false;
     }).catch(err => {
     }).catch(err => {
       console.log(err)
       console.log(err)
       loginLoading.value = false;
       loginLoading.value = false;
     })
     })
     return
     return
-    let newRouter = [
-      {
-        path: '/thread',
-        name: 'thread'
-      }
-    ]
-    setRouters(newRouter)
-    setTimeout(() => {
-      loginLoading.value = false;
-      router.push(newRouter[0].path);
-    }, 1000);
+    // let newRouter = [
+    //   {
+    //     path: '/thread',
+    //     name: 'thread'
+    //   }
+    // ]
+    // setRouters(newRouter)
+    // setTimeout(() => {
+    //   loginLoading.value = false;
+    //   router.push(newRouter[0].path);
+    // }, 1000);
   })
   })
 
 
 };
 };

+ 11 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    order
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="scss" scoped></style>

+ 11 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    product
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="scss" scoped></style>

+ 7 - 24
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/register.vue

@@ -47,13 +47,14 @@
 </template>
 </template>
 
 
 <script lang="ts" setup>
 <script lang="ts" setup>
-import { reactive, ref } from "vue";
+import { inject, reactive, ref } from "vue";
 import { useRouter, useRoute } from "vue-router";
 import { useRouter, useRoute } from "vue-router";
 import { HomeFilled, UserFilled, Lock, Iphone, Tickets } from '@element-plus/icons-vue'
 import { HomeFilled, UserFilled, Lock, Iphone, Tickets } from '@element-plus/icons-vue'
 import { ElNotification, ElMessage, type FormInstance, type FormRules } from 'element-plus'
 import { ElNotification, ElMessage, type FormInstance, type FormRules } from 'element-plus'
 import { isValueEmpty } from "@/utils/tools";
 import { isValueEmpty } from "@/utils/tools";
 import { post } from "@/utils/request";
 import { post } from "@/utils/request";
 import { REGISTER, SENDVCODE } from "./api";
 import { REGISTER, SENDVCODE } from "./api";
+const globalPopup = inject<GlobalPopup>('globalPopup')
 const router = useRouter();
 const router = useRouter();
 const route = useRoute();
 const route = useRoute();
 const ruleFormRef = ref<FormInstance>();
 const ruleFormRef = ref<FormInstance>();
@@ -152,35 +153,17 @@ const register = (formEl: FormInstance | undefined) => {
         ...route.query
         ...route.query
       }
       }
     }
     }
-    // console.log(params);
     post(REGISTER, params).then(res => {
     post(REGISTER, params).then(res => {
       if (res.code == "ok") {
       if (res.code == "ok") {
-        ElNotification.success({
-          title: "提示",
-          message: "注册成功",
-          type: "success",
-          duration:3000,
-          onClose: () => {
-            registerLoading.value = false;
-            router.back()
-          }
-        })
+        globalPopup?.showSuccess("注册成功")
+        registerLoading.value = false;
+        router.back()
       } else {
       } else {
-        ElNotification.error({
-          title: "提示",
-          message: res.message || res.msg,
-          type: "success",
-          duration: 3000,
-        })
+        globalPopup?.showError(res.message || res.msg || "注册失败")
         registerLoading.value = false;
         registerLoading.value = false;
       }
       }
     }).catch(err => {
     }).catch(err => {
-      ElNotification.error({
-        title: "提示",
-        message: err.message || err.msg,
-        type: "success",
-        duration: 3000,
-      })
+      globalPopup?.showError(err.message || err.msg || "注册失败")
       registerLoading.value = false;
       registerLoading.value = false;
     })
     })
 
 

+ 10 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/system/dictionary/index.vue

@@ -0,0 +1,10 @@
+<template>
+<div>
+  系统字典
+</div>
+</template>
+<script lang="ts" setup>
+
+</script>
+<style lang="scss" scoped>
+</style>

+ 11 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/system/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    <router-view></router-view>
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="scss" scoped></style>

+ 12 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/system/role/index.vue

@@ -0,0 +1,12 @@
+<template>
+  <div>
+    角色权限
+    <div>左右</div>
+    <div></div>
+  </div>
+</template>
+<script lang="ts" setup>
+
+</script>
+<style lang="scss" scoped>
+</style>

+ 18 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/index.vue

@@ -0,0 +1,18 @@
+<template>
+  <div class="h-full flex">
+    <div class="p-5 w-80 pr-0">
+      <div class="bg-white w-full h-full p-3 shadow-md rounded-md">
+       1111
+      </div>
+    </div>
+    <div class="flex-1 p-5">
+      <div class="bg-white w-full h-full p-3 shadow-md rounded-md">222</div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="scss" scoped></style>

+ 11 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    团队
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="scss" scoped></style>

+ 79 - 5
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/index.vue

@@ -1,9 +1,83 @@
 <template>
 <template>
-<div id="" class="h100">
-    线索文件
-</div>
+  <div ref="parentDiv" class="parent">
+    <div v-for="(item, index) in items" :key="index" v-show="visibleItems.includes(index)" class="child">
+      {{ item.content }}
+    </div>
+  </div>
 </template>
 </template>
+
+
 <script setup lang="ts">
 <script setup lang="ts">
+import { ref, onMounted, watchEffect } from 'vue';
+
+// 假设这是你的数据
+const items = ref([
+  { content: 'Item1' },
+  { content: 'Item2' },
+  { content: 'Item3' },
+  { content: 'Item4' },
+  { content: 'Item5' },
+  { content: 'Item6' },
+  { content: 'Item7' },
+  { content: 'Item9' },
+  { content: 'Item10' },
+  { content: 'Item11' },
+  { content: 'Item12' },
+  { content: 'Item13' },
+  // 添加更多项...
+]);
+
+// 用于存储可见项的索引
+const visibleItems = ref<number[]>([]);
+
+// 父div和子div的引用
+const parentDiv = ref<HTMLElement | null>(null);
+
+// 计算并更新可见项
+const updateVisibleItems = () => {
+  if (!parentDiv.value) return;
+  
+  let totalWidth = 0;
+  const children:any = parentDiv.value.children;
+  visibleItems.value = [];
+
+  for (let i = 0; i < children.length; i++) {
+    const childWidth = children[i].offsetWidth + parseInt(getComputedStyle(children[i]).marginRight, 16);
+    
+    // console.log(parentDiv.value.offsetWidth, '<=== parentDiv.value.offsetWidth')
+    // console.log(totalWidth, childWidth, '<=== ')
+
+    if (totalWidth + childWidth > parentDiv.value.offsetWidth) break;
+    
+    totalWidth += childWidth;
+    visibleItems.value.push(i);
+    // console.log('执行语法', visibleItems.value)
+  }
+};
+
+// 组件挂载后和窗口大小改变时更新可见项
+onMounted(() => {
+  updateVisibleItems();
+  window.addEventListener('resize', updateVisibleItems);
+});
+
+watchEffect(() => {
+  updateVisibleItems();
+});
 </script>
 </script>
-<style scoped lang="scss">
-</style>
+
+
+<style scoped>
+.parent {
+  display: flex;
+  overflow: hidden;
+  width: 100%; /* 可以根据实际情况调整 */
+}
+
+.child {
+  margin-right: 10px; /* 根据实际情况调整 */
+  padding: 5px; /* 根据实际情况调整 */
+  text-wrap: nowrap;
+}
+</style>
+

+ 31 - 14
fhKeeper/formulahousekeeper/customerBuler-crm/src/router/index.ts

@@ -1,4 +1,4 @@
-import { RouteRecordRaw,createRouter, createWebHistory } from "vue-router";
+import { RouteRecordRaw, createRouter, createWebHistory } from "vue-router";
 import { useStore } from "@/store/index";
 import { useStore } from "@/store/index";
 export const routes: RouteRecordRaw[] = [
 export const routes: RouteRecordRaw[] = [
   {
   {
@@ -48,9 +48,10 @@ router.beforeEach((to, _from, next) => {
   const routerList = useStore().routers;
   const routerList = useStore().routers;
   const routers = router.getRoutes();
   const routers = router.getRoutes();
   console.log(routerList, routers);
   console.log(routerList, routers);
-  const { setAsyncRoutesMark, asyncRoutesMark } = useStore();
-  const token = true;
-  const skipPath = ['/login', '/register', '/test', '/testEcharts']
+  const { setAsyncRoutesMark, asyncRoutesMark, getToken } = useStore();
+  const token = getToken;
+  const skipPath = ["/login", "/register", "/test", "/testEcharts"];
+  console.log(token, '<==== token')
   if (skipPath.includes(to.path)) {
   if (skipPath.includes(to.path)) {
     next();
     next();
   } else {
   } else {
@@ -58,17 +59,33 @@ router.beforeEach((to, _from, next) => {
       if (asyncRoutesMark) {
       if (asyncRoutesMark) {
         next();
         next();
       } else {
       } else {
-        setAsyncRoutesMark(true)
-        const newRouters: any = routers
-        const addNewRouter = newRouters.find((item: any) => item.name == 'home')
+        setAsyncRoutesMark(true);
+        const newRouters: any = routers;
+        const addNewRouter = newRouters.find(
+          (item: any) => item.path == "/home"
+        );
         routerList.forEach((item: any) => {
         routerList.forEach((item: any) => {
-          addNewRouter?.children.push({
-            path: item.path,
-            name: item.name,
-            meta: {},
-            component: () => import(`@/pages/${item.name}/index.vue`),
-          })
-        })
+          let filePath = item.path.split("/")[1];
+          if (item.children && item.children.length > 0) {
+            item.children.forEach((child: any) => {
+              let childFilePath = child.path.split("/")[1];
+              addNewRouter?.children.push({
+                path: child.path,
+                name: child.name,
+                meta: {},
+                component: () =>
+                  import(`@/pages/${filePath}/${childFilePath}/index.vue`),
+              });
+            });
+          } else {
+            addNewRouter?.children.push({
+              path: item.path,
+              name: item.name,
+              meta: {},
+              component: () => import(`@/pages/${filePath}/index.vue`),
+            });
+          }
+        });
         router.addRoute(addNewRouter);
         router.addRoute(addNewRouter);
         next({ ...to, replace: true });
         next({ ...to, replace: true });
       }
       }

+ 34 - 17
fhKeeper/formulahousekeeper/customerBuler-crm/src/store/index.ts

@@ -1,24 +1,41 @@
 import { defineStore, acceptHMRUpdate } from "pinia";
 import { defineStore, acceptHMRUpdate } from "pinia";
+import { RouteRecordRaw } from "vue-router";
 export const useStore = defineStore({
 export const useStore = defineStore({
-    id: "index",
-    state: () => ({
-        userInfo: {}, // 当前的用户信息
-        routers: [], // 返回的所有路由
-        asyncRoutesMark: false, // 是否添加过路由
-    }),
-    getters: { // 取值
-        
+  id: "storeInfo",
+  state: () => ({
+    userInfo: { id: '' }, // 当前的用户信息
+    routers: [], // 返回的所有路由
+    asyncRoutesMark: false, // 是否添加过路由
+  }),
+  getters: {
+    getRoutersList(): RouteRecordRaw[] { // 取值
+      return this.routers;
     },
     },
-    actions: { // 方法
-        setRouters(arr: any) {
-            this.routers = arr;
-        },
-        setAsyncRoutesMark(val: boolean) {
-            this.asyncRoutesMark = val
-        }
+    getToken(): string {
+      return  this.userInfo?.id || ''
+    }
+  },
+  actions: {
+    // 方法
+    setRouters(arr: any) {
+      this.routers = arr;
     },
     },
-    persist: true, // 是否持久化
+    setAsyncRoutesMark(val: boolean) {
+      this.asyncRoutesMark = val;
+    },
+    setValue(val: any, key: 'userInfo' | 'routers' | 'asyncRoutesMark') {
+      this[key] = val;
+    },
+    clearStore() {
+      localStorage.clear();
+      sessionStorage.clear();
+      this.userInfo = { id: '' };
+      this.routers = [];
+      this.asyncRoutesMark = false;
+    }
+  },
+  persist: true, // 是否持久化
 });
 });
 if (import.meta.hot) {
 if (import.meta.hot) {
-    import.meta.hot.accept(acceptHMRUpdate(useStore, import.meta.hot))
+  import.meta.hot.accept(acceptHMRUpdate(useStore, import.meta.hot));
 }
 }

+ 3 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/styles/global.scss

@@ -11,4 +11,7 @@ $modena: #6F4AFE;
 }
 }
 .text-black {
 .text-black {
     color : $fontBlack
     color : $fontBlack
+}
+.back-dark {
+    background-color : $darkBlue
 }
 }

+ 6 - 6
fhKeeper/formulahousekeeper/customerBuler-crm/src/type.d.ts

@@ -1,6 +1,6 @@
-type GlobalPopup = {
-  showSuccess: (msg: string, time: number, icon: string) => void;
-  showError: (msg: string, time: number, icon: string) => void;
-  showWarning: (msg: string, time: number, icon: string) => void;
-  showInfo: (msg: string, time: number, icon: string) => void;
-};
+interface GlobalPopup extends Notify {
+  showSuccess: (message?: string) => void;
+  showError: (message?: string) => void;
+  showWarning: (message: string) => void;
+  showInfo: (message: string) => void;
+}

+ 25 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ContactsController.java

@@ -1,10 +1,19 @@
 package com.management.platform.controller;
 package com.management.platform.controller;
 
 
 
 
+import com.management.platform.entity.Contacts;
+import com.management.platform.service.ContactsService;
+import com.management.platform.util.HttpRespMsg;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+
 /**
 /**
  * <p>
  * <p>
  *  前端控制器
  *  前端控制器
@@ -17,5 +26,21 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/contacts")
 @RequestMapping("/contacts")
 public class ContactsController {
 public class ContactsController {
 
 
+    @Resource
+    private HttpServletRequest request;
+
+    @Autowired
+    private ContactsService contactsService;
+
+    @RequestMapping("/addContacts")
+    public HttpRespMsg addContacts(@RequestBody Contacts contacts){
+        return contactsService.addContacts(contacts, request);
+    }
+
+    @RequestMapping("/pageContacts")
+    public HttpRespMsg pageContacts(@RequestParam Integer pageIndex, @RequestParam Integer pageSize,String customName, String name, String phone, String ownerName){
+        return contactsService.pageContacts(pageIndex,pageSize,customName,name,phone,ownerName,request);
+    }
+
 }
 }
 
 

+ 13 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Contacts.java

@@ -3,11 +3,15 @@ package com.management.platform.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
 import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -15,7 +19,7 @@ import lombok.experimental.Accessors;
  * </p>
  * </p>
  *
  *
  * @author Seyason
  * @author Seyason
- * @since 2024-02-28
+ * @since 2024-03-05
  */
  */
 @Data
 @Data
 @EqualsAndHashCode(callSuper = false)
 @EqualsAndHashCode(callSuper = false)
@@ -96,6 +100,14 @@ public class Contacts extends Model<Contacts> {
     @TableField("is_delete")
     @TableField("is_delete")
     private Integer isDelete;
     private Integer isDelete;
 
 
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    private LocalDateTime createTime;
+
 
 
     @Override
     @Override
     protected Serializable pkVal() {
     protected Serializable pkVal() {

+ 13 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/vo/ContactsVo.java

@@ -0,0 +1,13 @@
+package com.management.platform.entity.vo;
+
+import com.management.platform.entity.Contacts;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+@Data
+@Accessors(chain = true)
+public class ContactsVo extends Contacts {
+    private String customName;
+    private String ownerName;
+
+}

+ 8 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ContactsMapper.java

@@ -1,7 +1,13 @@
 package com.management.platform.mapper;
 package com.management.platform.mapper;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.management.platform.entity.Contacts;
 import com.management.platform.entity.Contacts;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.management.platform.entity.vo.ContactsVo;
+import com.management.platform.util.HttpRespMsg;
+
+import java.util.Map;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -13,4 +19,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
  */
 public interface ContactsMapper extends BaseMapper<Contacts> {
 public interface ContactsMapper extends BaseMapper<Contacts> {
 
 
+
+    Page<ContactsVo> pageContacts(Page page, Map<String, Object> map);
 }
 }

+ 7 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ContactsService.java

@@ -2,6 +2,10 @@ package com.management.platform.service;
 
 
 import com.management.platform.entity.Contacts;
 import com.management.platform.entity.Contacts;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.management.platform.entity.vo.ContactsVo;
+import com.management.platform.util.HttpRespMsg;
+
+import javax.servlet.http.HttpServletRequest;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -13,4 +17,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
  */
 public interface ContactsService extends IService<Contacts> {
 public interface ContactsService extends IService<Contacts> {
 
 
+    HttpRespMsg addContacts(Contacts contacts, HttpServletRequest request);
+
+    HttpRespMsg pageContacts(Integer pageIndex, Integer pageSize, String customName, String name, String phone, String ownerName, HttpServletRequest request);
 }
 }

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

@@ -1,10 +1,28 @@
 package com.management.platform.service.impl;
 package com.management.platform.service.impl;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.management.platform.entity.Contacts;
 import com.management.platform.entity.Contacts;
+import com.management.platform.entity.User;
+import com.management.platform.entity.vo.ContactsVo;
 import com.management.platform.mapper.ContactsMapper;
 import com.management.platform.mapper.ContactsMapper;
+import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.ContactsService;
 import com.management.platform.service.ContactsService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.management.platform.util.HttpRespMsg;
+import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.time.LocalDateTime;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -16,5 +34,55 @@ import org.springframework.stereotype.Service;
  */
  */
 @Service
 @Service
 public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> implements ContactsService {
 public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> implements ContactsService {
+    @Resource
+    private ContactsMapper contactsMapper;
+    @Resource
+    private UserMapper userMapper;
+
+
+
+    @Override
+    @Transactional
+    public HttpRespMsg addContacts(Contacts contacts, HttpServletRequest request) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        String token = String.valueOf(request.getHeader("Token"));
+        User user = userMapper.selectById(token);
+        Integer companyId = user.getCompanyId();
+
+        LambdaQueryWrapper<Contacts> lqw_contacts = new LambdaQueryWrapper<>();
+        lqw_contacts.eq(Contacts::getCustomId,contacts.getCustomId()).eq(Contacts::getName,contacts.getName());
+        Contacts selectedOne = contactsMapper.selectOne(lqw_contacts);
+        if (selectedOne!=null){
+            httpRespMsg.setError("已存在该客户!");
+        }
+        contacts.setCompanyId(companyId)
+                .setOwnerId(user.getId())//添加时默认
+                .setIsDelete(0)
+                .setCreateTime(LocalDateTime.now());
+        int insert = contactsMapper.insert(contacts);
+        if (insert<=0){
+            httpRespMsg.setError("添加失败!");
+        }
+        return httpRespMsg;
+    }
+
+    @Override
+    public HttpRespMsg pageContacts(Integer pageIndex, Integer pageSize, String customName, String name, String phone, String ownerName, HttpServletRequest request) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("customName", customName);
+        map.put("name", name);
+        map.put("phone", phone);
+        map.put("ownerName", ownerName);
+        String token = String.valueOf(request.getHeader("Token"));
+        User user = userMapper.selectById(token);
+        map.put("companyId",user.getCompanyId());
+        Page<ContactsVo> pageContacts = contactsMapper.pageContacts(new Page(pageIndex, pageSize), map);
+        List<ContactsVo> contactsVoList = pageContacts.getRecords();
+
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setData(contactsVoList);
+        return msg;
+    }
+
 
 
 }
 }

+ 30 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ContactsMapper.xml

@@ -17,11 +17,40 @@
         <result column="plate4" property="plate4" />
         <result column="plate4" property="plate4" />
         <result column="plate5" property="plate5" />
         <result column="plate5" property="plate5" />
         <result column="is_delete" property="isDelete" />
         <result column="is_delete" property="isDelete" />
+        <result column="create_time" property="createTime" />
     </resultMap>
     </resultMap>
 
 
     <!-- 通用查询结果列 -->
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
-        id, company_id, name, custom_id, email, phone, owner_id, plate1, plate2, plate3, plate4, plate5, is_delete
+        id, company_id, name, custom_id, email, phone, owner_id, plate1, plate2, plate3, plate4, plate5, is_delete, create_time
     </sql>
     </sql>
+    <select id="pageContacts" parameterType="java.util.Map"  resultType="com.management.platform.entity.vo.ContactsVo">
+        SELECT c.*, cust.custom_name as customName, own.name as ownerName
+        FROM contacts c
+        LEFT JOIN custom cust ON c.custom_id = cust.id
+        LEFT JOIN user own ON c.owner_id = own.id
+        <where>
+            1=1 and c.is_delete=0
+
+            <if test="map.customName != null and map.customName != ''">
+                AND cust.custom_name LIKE CONCAT('%', #{map.customName}, '%')
+            </if>
+            <if test="map.ownerName != null and map.ownerName != ''">
+                AND own.name LIKE CONCAT('%', #{map.ownerName}, '%')
+            </if>
+            <if test="map.phone != null and map.phone != ''">
+                AND c.phone LIKE CONCAT('%', #{map.phone}, '%')
+            </if>
+            <if test="map.name != null and map.name != ''">
+                AND c.name LIKE CONCAT('%', #{map.name}, '%')
+            </if>
+            <if test="map.companyId != null">
+                AND c.company_id=#{map.companyId}
+            </if>
+        </where>
+        order by create_time desc
+
+    </select>
+
 
 
 </mapper>
 </mapper>

+ 21 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportDeleteController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-05
+ */
+@RestController
+@RequestMapping("/report-delete")
+public class ReportDeleteController {
+
+}
+

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Department.java

@@ -58,13 +58,13 @@ public class Department extends Model<Department> {
     /**
     /**
      * 部门负责人id
      * 部门负责人id
      */
      */
-    @TableField(value = "manager_id", updateStrategy = FieldStrategy.IGNORED)
+    @TableField(value = "manager_id")
     private String managerId;
     private String managerId;
 
 
     /**
     /**
      * 日报导入审核人
      * 日报导入审核人
      */
      */
-    @TableField(value = "report_audit_userid", updateStrategy = FieldStrategy.IGNORED)
+    @TableField(value = "report_audit_userid")
     private String reportAuditUserid;
     private String reportAuditUserid;
 
 
 
 

+ 347 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ReportDelete.java

@@ -0,0 +1,347 @@
+package com.management.platform.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class ReportDelete extends Model<ReportDelete> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 主键
+     */
+    @TableId("id")
+    private Integer id;
+
+    /**
+     * user表外键 报告的作者
+     */
+    @TableField("creator_id")
+    private String creatorId;
+
+    /**
+     * project表外键 相关项目
+     */
+    @TableField("project_id")
+    private Integer projectId;
+
+    /**
+     * 日期
+     */
+    @TableField("create_date")
+    private LocalDate createDate;
+
+    /**
+     * 工作时间
+     */
+    @TableField("working_time")
+    private Double workingTime;
+
+    /**
+     * 报告内容; 根据multi_worktime的取值,形式有差别
+     */
+    @TableField("content")
+    private String content;
+
+    /**
+     * 审查状态 0-未审核 1-已通过 2-未通过, -1-导入待审核, 3草稿
+     */
+    @TableField("state")
+    private Integer state;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private LocalDateTime createTime;
+
+    /**
+     * 0-全天, 1-上午,2-下午
+     */
+    @TableField("time_type")
+    private Integer timeType;
+
+    /**
+     * 成本
+     */
+    @TableField("cost")
+    private BigDecimal cost;
+
+    /**
+     * 开始时间
+     */
+    @TableField("start_time")
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    @TableField("end_time")
+    private String endTime;
+
+    /**
+     * 员工填写时长类型
+     */
+    @TableField("report_time_type")
+    private Integer reportTimeType;
+
+    /**
+     * 子项目id
+     */
+    @TableField("sub_project_id")
+    private Integer subProjectId;
+
+    /**
+     * 任务id
+     */
+    @TableField("task_id")
+    private Integer taskId;
+
+    /**
+     * 是否是加班
+     */
+    @TableField("is_overtime")
+    private Integer isOvertime;
+
+    /**
+     * 用时占比
+     */
+    @TableField("progress")
+    private Integer progress;
+
+    /**
+     * 部门审核状态: -1 专业未审核,0-部门未审核,1-已通过,2-未通过
+     */
+    @TableField("department_audit_state")
+    private Integer departmentAuditState;
+
+    /**
+     * 阶段/岗位/工序
+     */
+    @TableField("stage")
+    private String stage;
+
+    /**
+     * 图片的数组字符串
+     */
+    @TableField("pic_str")
+    private String picStr;
+
+    /**
+     * 是否是多个时间工作事项
+     */
+    @TableField("multi_worktime")
+    private Integer multiWorktime;
+
+    /**
+     * 驳回原因
+     */
+    @TableField("reject_reason")
+    private String rejectReason;
+
+    /**
+     * 驳回人姓名
+     */
+    @TableField("reject_username")
+    private String rejectUsername;
+
+    /**
+     * 驳回人id
+     */
+    @TableField("reject_userid")
+    private String rejectUserid;
+
+    /**
+     * 选择的自定义维度
+     */
+    @TableField("degree_id")
+    private Integer degreeId;
+
+    /**
+     * 公司id
+     */
+    @TableField("company_id")
+    private Integer companyId;
+
+    /**
+     * 代填或者导入的用户id
+     */
+    @TableField("fill_userid")
+    private String fillUserid;
+
+    /**
+     * 审核流程:当前审核的部门id
+     */
+    @TableField("audit_deptid")
+    private Integer auditDeptid;
+
+    /**
+     * 审核流程: 是否是部门审核
+     */
+    @TableField("is_dept_audit")
+    private Integer isDeptAudit;
+
+    /**
+     * 审核流程:当前审核的部门负责人id
+     */
+    @TableField("audit_dept_managerid")
+    private String auditDeptManagerid;
+
+    /**
+     * 是否是最后一步审核
+     */
+    @TableField("is_final_audit")
+    private Integer isFinalAudit;
+
+    /**
+     * 审核流程:审核过程中,项目的审核状态; 0-待审核,1-审核通过
+     */
+    @TableField("project_audit_state")
+    private Integer projectAuditState;
+
+    /**
+     * 任务分组id
+     */
+    @TableField("group_id")
+    private Integer groupId;
+
+    /**
+     * 自定义的数值
+     */
+    @TableField("custom_data")
+    private Double customData;
+
+    /**
+     * 项目审核人id
+     */
+    @TableField("project_auditor_id")
+    private String projectAuditorId;
+
+    /**
+     * 工时日报所属部门id
+     */
+    @TableField("dept_id")
+    private Integer deptId;
+
+    /**
+     * 加班时长
+     */
+    @TableField("overtime_hours")
+    private Double overtimeHours;
+
+    /**
+     * 加班薪资
+     */
+    @TableField("overtime_cost")
+    private BigDecimal overtimeCost;
+
+    /**
+     * 自定义文本信息内容
+     */
+    @TableField("custom_text")
+    private String customText;
+
+    /**
+     * 对应成本项的id
+     */
+    @TableField("basecost_id")
+    private Integer basecostId;
+
+    /**
+     * 项目日报审核时间
+     */
+    @TableField("project_audit_time")
+    private LocalDateTime projectAuditTime;
+
+    /**
+     * 任务分组负责人审核状态: 0-待审核,1-审核通过
+     */
+    @TableField("group_audit_state")
+    private Integer groupAuditState;
+
+    /**
+     * 评价
+     */
+    @TableField("evaluate")
+    private String evaluate;
+
+    /**
+     * 是否属于自动审核通过  0-不属于 1-属于
+     */
+    @TableField("report_auto_approve")
+    private Integer reportAutoApprove;
+
+    /**
+     * 批量填报时的report_batch表id
+     */
+    @TableField("batch_id")
+    private Integer batchId;
+
+    /**
+     * 昱众-角色类型:0-PM,1-CRC
+     */
+    @TableField("extra_field1")
+    private Integer extraField1;
+
+    /**
+     * 昱众-工作职责
+     */
+    @TableField("extra_field2")
+    private Integer extraField2;
+
+    /**
+     * 昱众-工作内容
+     */
+    @TableField("extra_field3")
+    private Integer extraField3;
+
+    /**
+     * SAP项目服务ID
+     */
+    @TableField("sap_service_id")
+    private Integer sapServiceId;
+
+    /**
+     * 多选自定义维度id
+     */
+    @TableField("multi_degr_id")
+    private String multiDegrId;
+
+    /**
+     * 删除的人员id
+     */
+    @TableField("delete_user_id")
+    private String deleteUserId;
+
+    /**
+     * 删除时间
+     */
+    @TableField("delete_time")
+    private LocalDateTime deleteTime;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportDeleteMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.ReportDelete;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-05
+ */
+public interface ReportDeleteMapper extends BaseMapper<ReportDelete> {
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ReportDeleteService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.ReportDelete;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-05
+ */
+public interface ReportDeleteService extends IService<ReportDelete> {
+
+}

+ 20 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportDeleteServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.ReportDelete;
+import com.management.platform.mapper.ReportDeleteMapper;
+import com.management.platform.service.ReportDeleteService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-05
+ */
+@Service
+public class ReportDeleteServiceImpl extends ServiceImpl<ReportDeleteMapper, ReportDelete> implements ReportDeleteService {
+
+}

+ 50 - 23
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -87,6 +87,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     public String appSecret;
     public String appSecret;
     @Resource
     @Resource
     private TaskGroupMapper taskGroupMapper;
     private TaskGroupMapper taskGroupMapper;
+    @Resource
+    private ReportDeleteService reportDeleteService;
+
     @Resource
     @Resource
     private DepartmentService departmentService;
     private DepartmentService departmentService;
     @Resource
     @Resource
@@ -1593,6 +1596,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     @Override
     @Override
     public HttpRespMsg deleteReport(String userId, String date) {
     public HttpRespMsg deleteReport(String userId, String date) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         HttpRespMsg httpRespMsg = new HttpRespMsg();
+        String delUserId = request.getHeader("TOKEN");
         Company company = companyMapper.selectById(userMapper.selectById(userId).getCompanyId());
         Company company = companyMapper.selectById(userMapper.selectById(userId).getCompanyId());
         //某人删除自己某天的全部报告
         //某人删除自己某天的全部报告
         QueryWrapper<Report> queryWrapper = new QueryWrapper<Report>().eq("creator_id", userId).eq("create_date", date);
         QueryWrapper<Report> queryWrapper = new QueryWrapper<Report>().eq("creator_id", userId).eq("create_date", date);
@@ -1610,27 +1614,18 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         } else {
         } else {
             //删除日报的日志
             //删除日报的日志
             reportLogMapper.delete(new QueryWrapper<ReportLog>().eq("creator_id", userId).eq("create_date", date));
             reportLogMapper.delete(new QueryWrapper<ReportLog>().eq("creator_id", userId).eq("create_date", date));
+            reportLogDetailMapper.delete(new QueryWrapper<ReportLogDetail>().in("report_id", collect));
+            //存入日报删除表
+            List<ReportDelete> delList = new ArrayList<>();
+            for (Report r : reportList) {
+                //从report对象中复制所有字段到report_delete对象中
+                ReportDelete delLog = new ReportDelete();
+                BeanUtils.copyProperties(r, delLog);
+                delLog.setDeleteUserId(delUserId);
+                delList.add(delLog);
+            }
+            reportDeleteService.saveBatch(delList);
         }
         }
-        //不需要调绎维的删除接口了。工时在我们这边系统内管理控制。
-//        if(company.getId()==862){
-//            String url = "http://183.194.0.98:3202/api/web-server/controlCenter/billRejected";
-//            HttpHeaders headers = new HttpHeaders();
-//            headers.setContentType(MediaType.APPLICATION_JSON);
-//            headers.add("token",getTokenOfYiWei());
-//            JSONObject body=new JSONObject();
-//            body.put("type","EXPENSE");
-//            body.put("billNo","GS"+reportList.get(0).getCreatorId()+reportList.get(0).getCreateDate());
-//            HttpEntity<String> requestEntity = new HttpEntity<String>(body.toJSONString(), headers);
-//            ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
-//                    HttpMethod.POST, requestEntity, String.class);
-//            if (responseEntity.getStatusCode() == HttpStatus.OK) {
-//                String resp = responseEntity.getBody();
-//                JSONObject json = JSONObject.parseObject(resp);
-//                if(json.getIntValue("status")==0){
-//                    JSONArray jsonArray = json.getJSONArray("data");
-//                }
-//            }
-//        }
         return httpRespMsg;
         return httpRespMsg;
     }
     }
 
 
@@ -2051,6 +2046,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             log.setUserId(user.getId());
             log.setUserId(user.getId());
             log.setUserName(user.getName());
             log.setUserName(user.getName());
             log.setProjectName(pNames);
             log.setProjectName(pNames);
+            if (pNames.length() > 2000) {
+                log.setProjectName(pNames.substring(0, 2000));
+            }
             reportAuditLogMapper.insert(log);
             reportAuditLogMapper.insert(log);
             //员工的日期
             //员工的日期
             ReportAlogMembdate membdate = new ReportAlogMembdate();
             ReportAlogMembdate membdate = new ReportAlogMembdate();
@@ -2550,6 +2548,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             log.setUserId(user.getId());
             log.setUserId(user.getId());
             log.setUserName(user.getName());
             log.setUserName(user.getName());
             log.setProjectName(pNames);
             log.setProjectName(pNames);
+            if (pNames.length() > 2000) {
+                log.setProjectName(pNames.substring(0, 2000));
+            }
             reportAuditLogMapper.insert(log);
             reportAuditLogMapper.insert(log);
             //员工的日期
             //员工的日期
             ReportAlogMembdate membdate = new ReportAlogMembdate();
             ReportAlogMembdate membdate = new ReportAlogMembdate();
@@ -2843,6 +2844,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         log.setUserId(user.getId());
         log.setUserId(user.getId());
         log.setUserName(user.getName());
         log.setUserName(user.getName());
         log.setProjectName(pNames);
         log.setProjectName(pNames);
+        if (pNames.length() > 2000) {
+            log.setProjectName(pNames.substring(0, 2000));
+        }
         reportAuditLogMapper.insert(log);
         reportAuditLogMapper.insert(log);
         //员工的日期
         //员工的日期
         ReportAlogMembdate membdate = new ReportAlogMembdate();
         ReportAlogMembdate membdate = new ReportAlogMembdate();
@@ -3772,6 +3776,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             log.setResult(MessageUtils.message("profession.batchPass"));
             log.setResult(MessageUtils.message("profession.batchPass"));
             log.setUserId(user.getId());
             log.setUserId(user.getId());
             log.setUserName(user.getName());
             log.setUserName(user.getName());
+            if (s.length()>2000) {
+                s = s.substring(0, 2000);
+            }
             log.setProjectName(s);
             log.setProjectName(s);
             reportAuditLogMapper.insert(log);
             reportAuditLogMapper.insert(log);
 
 
@@ -3886,6 +3893,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         log.setUserId(user.getId());
         log.setUserId(user.getId());
         log.setUserName(user.getName());
         log.setUserName(user.getName());
         log.setProjectName(s);
         log.setProjectName(s);
+        if (s.length() > 2000) {
+            s = s.substring(0, 2000);
+        }
         reportAuditLogMapper.insert(log);
         reportAuditLogMapper.insert(log);
         List<Report> allReports = reportMapper.selectList(new QueryWrapper<Report>().in("id", ids));
         List<Report> allReports = reportMapper.selectList(new QueryWrapper<Report>().in("id", ids));
         saveDenyReportLog(allReports, user.getId(), user.getName(), reason);
         saveDenyReportLog(allReports, user.getId(), user.getName(), reason);
@@ -6080,9 +6090,22 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     public List<Map<String, Object>> getNotFullReportUserList(Integer companyId, LocalDate localStart, LocalDate localEnd) {
     public List<Map<String, Object>> getNotFullReportUserList(Integer companyId, LocalDate localStart, LocalDate localEnd) {
         List<Report> reportList  = reportMapper.selectList(new QueryWrapper<Report>().select("id,create_date,creator_id, state").eq("company_id", companyId).between("create_date", localStart, localEnd));
         List<Report> reportList  = reportMapper.selectList(new QueryWrapper<Report>().select("id,create_date,creator_id, state").eq("company_id", companyId).between("create_date", localStart, localEnd));
         List<User> allRangeUserList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).eq("report_status",0));
         List<User> allRangeUserList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).eq("report_status",0));
-
         List<Map<String, Object>> noReportDataList = new ArrayList<Map<String, Object>>();
         List<Map<String, Object>> noReportDataList = new ArrayList<Map<String, Object>>();
         long cnt = localStart.until(localEnd, ChronoUnit.DAYS);
         long cnt = localStart.until(localEnd, ChronoUnit.DAYS);
+        //判断用户注册的平台类型
+//        int platform = 0;
+//        if (allRangeUserList.size() > 0) {
+//            User user = allRangeUserList.get(0);
+//            if (user.getCorpwxUserid() != null) {
+//                platform = 1;
+//            } else if (user.getWxOpenid() != null) {
+//                platform = 2;
+//            } else if (user.getDingdingUserid() != null) {
+//                platform = 3;
+//            } else if (user.getFeishuUserid() != null) {
+//                platform = 4;
+//            }
+//        }
         //已驳回的数据
         //已驳回的数据
         //按人员过滤
         //按人员过滤
         for (User curUser: allRangeUserList){
         for (User curUser: allRangeUserList){
@@ -6105,14 +6128,18 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 if (!reportList.stream().anyMatch(item->item.getCreatorId().equals(curUser.getId())&&item.getCreateDate().isEqual(date)&&(item.getState() == 0 || item.getState() == 1))) {
                 if (!reportList.stream().anyMatch(item->item.getCreatorId().equals(curUser.getId())&&item.getCreateDate().isEqual(date)&&(item.getState() == 0 || item.getState() == 1))) {
                     HashMap map = new HashMap();
                     HashMap map = new HashMap();
                     map.put("corpwxUserid", curUser.getCorpwxUserid());
                     map.put("corpwxUserid", curUser.getCorpwxUserid());
+                    map.put("dingdingUserid", curUser.getDingdingUserid());
+                    map.put("wxOpenid", curUser.getWxOpenid());
+                    map.put("feishuUserid", curUser.getFeishuUserid());
+                    map.put("id", curUser.getId());
                     map.put("name", curUser.getName());
                     map.put("name", curUser.getName());
                     map.put("days", 1);
                     map.put("days", 1);
                     map.put("daysTxt", date.format(DateTimeFormatter.ofPattern("MM/dd")));
                     map.put("daysTxt", date.format(DateTimeFormatter.ofPattern("MM/dd")));
-                    if (!noReportDataList.stream().anyMatch(noItem->noItem.get("corpwxUserid").equals(curUser.getCorpwxUserid()))) {
+                    if (!noReportDataList.stream().anyMatch(noItem->noItem.get("id").equals(curUser.getId()))) {
                         noReportDataList.add(map);
                         noReportDataList.add(map);
                     } else {
                     } else {
                         //已经添加过了,需要更新天数
                         //已经添加过了,需要更新天数
-                        Optional<Map<String, Object>> optional = noReportDataList.stream().filter(data -> data.get("corpwxUserid").equals(curUser.getCorpwxUserid())).findFirst();
+                        Optional<Map<String, Object>> optional = noReportDataList.stream().filter(data -> data.get("id").equals(curUser.getId())).findFirst();
                         if (optional.isPresent()) {
                         if (optional.isPresent()) {
                             Map<String, Object> findUser = optional.get();
                             Map<String, Object> findUser = optional.get();
                             Object days = findUser.get("days");
                             Object days = findUser.get("days");

+ 28 - 19
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -1630,27 +1630,36 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                         }
                         }
                         //针对赛元微电子,请半天假的情况下。重新校正打卡和工作时长
                         //针对赛元微电子,请半天假的情况下。重新校正打卡和工作时长
                         if (corpInfo.getCorpid().equals("wpy9TkCAAAgNp4jvqxKTpXrhvwFvyFHg")) {
                         if (corpInfo.getCorpid().equals("wpy9TkCAAAgNp4jvqxKTpXrhvwFvyFHg")) {
-                            if ((morningLeave && afternoonLeave) || isWholeDayLeave) {
-                                ct.setAskLeaveTime(baseMorningWorkTime + baseAfternoonWorkTime);
+                            if (dtf.format(ct.getCreateDate()).equals("2024-02-09") ) {
+                                //硬编码,这天由于特殊情况,考勤有数据但是他们没有上班,需要修正为0
                                 ct.setWorkHours(0.0);
                                 ct.setWorkHours(0.0);
                                 ct.setCardTime(0.0);
                                 ct.setCardTime(0.0);
-                                ct.setStartTime(baseMorningStart);
-                                ct.setEndTime(baseAfternoonEnd);
-                                if (showLog) System.out.println("再次校正,全天请假");
-                            } else if (morningLeave){
-                                ct.setAskLeaveTime(baseMorningWorkTime);
-                                ct.setWorkHours(baseAfternoonWorkTime);
-                                ct.setCardTime(baseAfternoonWorkTime);
-                                ct.setStartTime(baseAfternoonStart);
-                                ct.setEndTime(baseAfternoonEnd);
-                                if (showLog) System.out.println("再次校正,上午请假");
-                            } else if (afternoonLeave) {
-                                ct.setAskLeaveTime(baseAfternoonWorkTime);
-                                ct.setWorkHours(baseMorningWorkTime);
-                                ct.setCardTime(baseMorningWorkTime);
-                                ct.setStartTime(baseMorningStart);
-                                ct.setEndTime(baseMorningEnd);
-                                if (showLog) System.out.println("再次校正,下午请假");
+                                ct.setStartTime("00:00");
+                                ct.setEndTime("00:00");
+                                ct.setAskLeaveTime(0.0);
+                            } else {
+                                if ((morningLeave && afternoonLeave) || isWholeDayLeave) {
+                                    ct.setAskLeaveTime(baseMorningWorkTime + baseAfternoonWorkTime);
+                                    ct.setWorkHours(0.0);
+                                    ct.setCardTime(0.0);
+                                    ct.setStartTime(baseMorningStart);
+                                    ct.setEndTime(baseAfternoonEnd);
+                                    if (showLog) System.out.println("再次校正,全天请假");
+                                } else if (morningLeave){
+                                    ct.setAskLeaveTime(baseMorningWorkTime);
+                                    ct.setWorkHours(baseAfternoonWorkTime);
+                                    ct.setCardTime(baseAfternoonWorkTime);
+                                    ct.setStartTime(baseAfternoonStart);
+                                    ct.setEndTime(baseAfternoonEnd);
+                                    if (showLog) System.out.println("再次校正,上午请假");
+                                } else if (afternoonLeave) {
+                                    ct.setAskLeaveTime(baseAfternoonWorkTime);
+                                    ct.setWorkHours(baseMorningWorkTime);
+                                    ct.setCardTime(baseMorningWorkTime);
+                                    ct.setStartTime(baseMorningStart);
+                                    ct.setEndTime(baseMorningEnd);
+                                    if (showLog) System.out.println("再次校正,下午请假");
+                                }
                             }
                             }
                         }
                         }
                     }
                     }

+ 21 - 38
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -1400,47 +1400,16 @@ public class TimingTask {
                         LocalDate endDate = localDate.minusMonths(1).with(TemporalAdjusters.lastDayOfMonth());
                         LocalDate endDate = localDate.minusMonths(1).with(TemporalAdjusters.lastDayOfMonth());
                         userList = reportService.getNotFullReportUserList(company.getId(), startDate, endDate);
                         userList = reportService.getNotFullReportUserList(company.getId(), startDate, endDate);
                     }
                     }
+                } else if (t.getAlertType() == 4) {
+                    //4--每周提醒上周漏填
+                    LocalDate lastSunday = localDate.with(DayOfWeek.SUNDAY).minusWeeks(1);
+                    LocalDate lastMonday = lastSunday.minusDays(6);
+                    userList = reportService.getNotFullReportUserList(company.getId(), lastMonday, lastSunday);
+                    System.out.println("用户数量="+userList.size());
+                    lastWeekNotFill = true;
                 }
                 }
                 List<WxCorpInfo> cpList = wxCorpInfoMapper.selectList(new QueryWrapper<WxCorpInfo>().eq("company_id", t.getCompanyId()));
                 List<WxCorpInfo> cpList = wxCorpInfoMapper.selectList(new QueryWrapper<WxCorpInfo>().eq("company_id", t.getCompanyId()));
                 final boolean finalLastWeekNotFill = lastWeekNotFill;
                 final boolean finalLastWeekNotFill = lastWeekNotFill;
-//                userList.forEach(u->{
-//                    if (u.get("corpwxUserid") != null){
-//                        //推送到企业微信
-//                        String corpUid = (String) u.get("corpwxUserid");
-//                        JSONObject json=new JSONObject();
-//                        JSONArray dataJson = new JSONArray();
-//                        JSONObject jsonObj = new JSONObject();
-//                        jsonObj.put("key", "提示");
-//                        if (t.getAlertType() == 3) {
-//                            //每月提醒上个月的
-//                            if ((Integer)u.get("days") > 3) {
-//                                jsonObj.put("value", "您上个月有"+u.get("daysTxt")+"...共"+(Integer)u.get("days")+"天未填写工时报告,请尽快填写");
-//                            } else {
-//                                jsonObj.put("value", "您上个月有"+u.get("daysTxt")+"共"+(Integer)u.get("days")+"天未填写工时报告,请尽快填写");
-//                            }
-//                        } else {
-//                            if (finalLastWeekNotFill) {
-//                                jsonObj.put("value", "您上周有"+(Integer)u.get("days")+"天未填写工时报告,请尽快填写");
-//                            } else {
-//                                jsonObj.put("value", StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg());
-//                            }
-//                        }
-//                        dataJson.add(jsonObj);
-//                        if(isPrivateDeploy){
-//                            json.put("content",StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg()+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+suitId+"&redirect_uri="+pcUrl+"/api/corpInsideWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去填写</a>");
-//                        }else {
-//                            json.put("template_id","tty9TkCAAAYoevY-40ciWD5lDncDfR5w");
-//                            json.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
-//                            json.put("content_item",dataJson);
-//                        }
-//                        if (cpList.size() > 0) {
-////                            System.out.println("发送企业微信漏填提醒:" + LocalDateTime.now().toString() + ", corpUid=" + corpUid + ", json=" + json.toJSONString());
-//                            wxCorpInfoService.sendWXCorpTemplateMsg(cpList.get(0), corpUid, json);
-//                        }
-//                    } else if (u.get("wxOpenid") != null) {
-//                        push(u, t.getAlertMsg());
-//                    }
-//                });
                 //今天或者明天统一提醒,提醒内容大家都一样
                 //今天或者明天统一提醒,提醒内容大家都一样
                 if (t.getAlertType() == 0 || t.getAlertType() == 1) {
                 if (t.getAlertType() == 0 || t.getAlertType() == 1) {
                     //判断是企业微信用户还是微信用户
                     //判断是企业微信用户还是微信用户
@@ -1514,6 +1483,13 @@ public class TimingTask {
                             push(u, t.getAlertMsg());
                             push(u, t.getAlertMsg());
                         }
                         }
                     });
                     });
+                    //针对钉钉发送提醒
+                    if (userList.size() > 0 && userList.get(0).get("dingdingUserid") != null) {
+                        CompanyDingding compDingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", t.getCompanyId()));
+                        String idStr = userList.stream().map(u -> (String) u.get("dingdingUserid")).collect(Collectors.joining(","));
+                        //TODO: 批量发送,最大支持1000个用户Id. 多的话需要分批发送; 目前尚无这么大的数据量
+                        companyDingdingService.sendFillReportAlertMsg(t.getCompanyId(), compDingding.getAgentId(), t.getAlertMsg(), idStr);
+                    }
                 }
                 }
 
 
             }
             }
@@ -1521,6 +1497,7 @@ public class TimingTask {
         if (isDev) {
         if (isDev) {
             return;
             return;
         }
         }
+        //针对钉钉提醒类型是0或者1的情况,发送提醒。(当天提醒或者今天提醒昨天漏填)
         List<Map<String, Object>> dingdingUserList = userMapper.getPushDingdingUserList(str, date);
         List<Map<String, Object>> dingdingUserList = userMapper.getPushDingdingUserList(str, date);
         //钉钉平台的用批量发送, 每分钟5000个
         //钉钉平台的用批量发送, 每分钟5000个
         int minuteSize = 5000;
         int minuteSize = 5000;
@@ -2047,4 +2024,10 @@ public class TimingTask {
         }
         }
     }
     }
 
 
+
+
+    @Scheduled(cron = "1 1 1 1 1 ?")
+    public void cleanUselessData(){
+        //TODO: 日报删除表report_delete,需要定期清理
+    }
 }
 }

File diff suppressed because it is too large
+ 66 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportDeleteMapper.xml


+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -75,7 +75,7 @@
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id
         LEFT JOIN project_separate AS ps on b.id=ps.id
         LEFT JOIN project_separate AS ps on b.id=ps.id
         LEFT JOIN user AS c ON a.creator_id=c.id
         LEFT JOIN user AS c ON a.creator_id=c.id
-        LEFT JOIN user_with_beisen AS uwb ON c.job_number=c.job_number
+        LEFT JOIN user_with_beisen AS uwb ON uwb.job_number=c.job_number
         left join sub_project as d on d.id = a.sub_project_id
         left join sub_project as d on d.id = a.sub_project_id
         left join task on task.id = a.task_id
         left join task on task.id = a.task_id
         left join report_extra_degree on report_extra_degree.id = a.degree_id
         left join report_extra_degree on report_extra_degree.id = a.degree_id
@@ -132,7 +132,7 @@
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id
         LEFT JOIN project_separate AS ps on b.id=ps.id
         LEFT JOIN project_separate AS ps on b.id=ps.id
         LEFT JOIN user AS c ON a.creator_id=c.id
         LEFT JOIN user AS c ON a.creator_id=c.id
-        LEFT JOIN user_with_beisen AS uwb ON c.job_number=c.job_number
+        LEFT JOIN user_with_beisen AS uwb ON uwb.job_number=c.job_number
         left join sub_project as d on d.id = a.sub_project_id
         left join sub_project as d on d.id = a.sub_project_id
         left join task on task.id = a.task_id
         left join task on task.id = a.task_id
         left join report_extra_degree on report_extra_degree.id = a.degree_id
         left join report_extra_degree on report_extra_degree.id = a.degree_id

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -935,6 +935,7 @@
   "missingfill": "Daily reminder missed filling on the day",
   "missingfill": "Daily reminder missed filling on the day",
   "missingfills": "Daily reminder missed yesterday",
   "missingfills": "Daily reminder missed yesterday",
   "lastDayOfWeek": "Remind on the last day of current week",
   "lastDayOfWeek": "Remind on the last day of current week",
+  "alertLastWeek": "Remind last week's missing report",
   "monthAlert": "Remind last month's missed report on fixed day",
   "monthAlert": "Remind last month's missed report on fixed day",
   "morningtime": "morning time",
   "morningtime": "morning time",
   "owntimeframe": "Choose your own time frame",
   "owntimeframe": "Choose your own time frame",

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -945,6 +945,7 @@
   "missingfill": "每日提醒当天漏填",
   "missingfill": "每日提醒当天漏填",
   "missingfills": "每日提醒昨天漏填",
   "missingfills": "每日提醒昨天漏填",
   "lastDayOfWeek": "每周最后一个工作日",
   "lastDayOfWeek": "每周最后一个工作日",
+  "alertLastWeek": "每周提醒上周漏填",
   "monthAlert": "每月固定日期提醒上个月",
   "monthAlert": "每月固定日期提醒上个月",
   "remindertext": "提醒文本",
   "remindertext": "提醒文本",
   "personneltoset": "不提醒人员设置",
   "personneltoset": "不提醒人员设置",

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -217,6 +217,7 @@
                             <el-option :label="$t('missingfills')" :value="1"></el-option>
                             <el-option :label="$t('missingfills')" :value="1"></el-option>
                             <el-option :label="$t('lastDayOfWeek')" :value="2"></el-option>
                             <el-option :label="$t('lastDayOfWeek')" :value="2"></el-option>
                             <el-option :label="$t('monthAlert')" :value="3"></el-option>
                             <el-option :label="$t('monthAlert')" :value="3"></el-option>
+                            <el-option :label="$t('alertLastWeek')" :value="4"></el-option>
                         </el-select>
                         </el-select>
                         <span v-if="timeType.alertType == 3" style="color:#606266;">(每月
                         <span v-if="timeType.alertType == 3" style="color:#606266;">(每月
                         <el-select v-model="timeType.alertDay" style="width:80px;">
                         <el-select v-model="timeType.alertDay" style="width:80px;">

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -3764,7 +3764,7 @@ export default {
 
 
 <style scoped>
 <style scoped>
 .deteee{
 .deteee{
-  font-size: 25px;
+  font-size: 18px;
   margin-bottom: 20px;
   margin-bottom: 20px;
 }
 }
 .deteeeAce {
 .deteeeAce {

+ 0 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/login/index.vue

@@ -108,7 +108,6 @@
                         console.log('urlRight=' + urlRight);
                         console.log('urlRight=' + urlRight);
                         urlRight = urlRight.substring(0, urlRight.indexOf('#/'));
                         urlRight = urlRight.substring(0, urlRight.indexOf('#/'));
                         // window.location = urlLeft + "#/home" + urlRight;//拼接跳转
                         // window.location = urlLeft + "#/home" + urlRight;//拼接跳转
-                        alert(url);
                         //获取code
                         //获取code
                         var code = urlRight.substring('?code='.length,urlRight.indexOf('&state='));
                         var code = urlRight.substring('?code='.length,urlRight.indexOf('&state='));
                         var passUserId = urlRight.substring(urlRight.indexOf('&state=')+'&state='.length);
                         var passUserId = urlRight.substring(urlRight.indexOf('&state=')+'&state='.length);
@@ -303,7 +302,6 @@
                                 }else{
                                 }else{
                                     corpId = url.substring(url.indexOf(key)+key.length,url.indexOf('#'));
                                     corpId = url.substring(url.indexOf(key)+key.length,url.indexOf('#'));
                                 }
                                 }
-                                alert('钉钉登录==='+corpId);
                                 this.isDingding = true
                                 this.isDingding = true
                                 dd.ready(function() {
                                 dd.ready(function() {
                                     dd.runtime.permission.requestAuthCode({
                                     dd.runtime.permission.requestAuthCode({