Explorar el Código

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

QuYueTing hace 4 meses
padre
commit
7a78894b7e

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/pullDownSelector.vue

@@ -183,7 +183,7 @@ onMounted(() => {
     obtainPersonnelData();
   }
   if(props.value) {
-    selectChecked.value = props.multipleChoice ? props.value.split(',') : props.value
+    selectChecked.value = props.multipleChoice ? Array.isArray(props.value) ? props.value :  props.value.split(',') : props.value
   }
 });
 </script>

+ 2 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/hooks/useApi.js

@@ -41,7 +41,8 @@ export const NEW_BUSINESS_OPPORTUNITY_EDITING = `/business-opportunity/insertAnd
 export const NEW_CLUE_EDITING = `/clue/insertAndUpdate` // 线索新增编辑
 export const CUSTOMER_ADDED_EDITOR = `/custom/insertAndUpdate` // 客户新增编辑
 export const CONTACT_PERSON_ADDITION_EDITOR = `/contacts/addContacts` // 联系人新增编辑
-export const TASK_ADD_EDIT = `/tasks/addTask` // 任务新增编辑
+export const TASK_ADD_EDIT = `/tasks/addTask` // 任务新增
+export const MODIFY_TASK = `/tasks/updateTask` // 任务编辑
 export const PRODUCT_ADD_EDITOR = `/product/addOrUpdate` // 产品新增编辑
 export const CONTRACT_ADDITION_EDITING = `/contract/addContract` // 合同新增编辑
 export const ORDER_ADDITION_EDITING = `/order/addOrUpdate` // 订单新增编辑

+ 137 - 21
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/moduleList/moduleList.vue

@@ -18,40 +18,151 @@
               <van-list v-model:loading="isLoading" :finished="finished" finished-text="没有更多了" @load="onLoad">
                 <div v-for="item in listData.records" :key="item.id" @click="toDetail(item)">
                   <van-swipe-cell>
-                    <div :class="`${item.needPin ? 'bg-slate-50' : 'bg-white'} px-5 py-5 flex items-center flex-row w-full listContent`">
+                    <div
+                      :class="`${item.needPin ? 'bg-slate-50' : 'bg-white'} px-5 py-5 flex items-center flex-row w-full listContent`">
                       <div class="listOfImages items-justify-center rounded-full overflow-hidden bg-[#FFEEEC]">
                         <img :src="queryParameters.homeImage" class="w-full h-full">
                       </div>
                       <div class="flex-1 h-full">
                         <!-- 商机 -->
-                        <template v-if="queryParameters?.key == 'business'">{{ item.name }}</template>
+                        <template v-if="queryParameters?.key == 'business'">
+                          <div>
+                            <div class="flex items-center flex-row">
+                              <div class="flex-1 truncate mr-8 titles relative">{{ item.name }}</div>
+                              <div><van-tag type="primary">{{ item.stageValue }}</van-tag></div>
+                            </div>
+                            <div class="flex items-center flex-row mt-1">
+                              <van-text-ellipsis :content="item.customerName"
+                                class="flex-1 text-[#B9B9B9] text-size-small" />
+                              <div class="text-[#B9B9B9] text-size-small" v-if="item.inchargerName">负责人:{{
+                                item.inchargerName }}</div>
+                            </div>
+                          </div>
+                        </template>
                         <!-- 线索 -->
-                        <template v-if="queryParameters?.key == 'thread'">{{ item.clueName }}</template>
+                        <template v-if="queryParameters?.key == 'thread'">
+                          <div>
+                            <div class="flex items-center flex-row">
+                              <div class="flex-1 truncate mr-8 titles relative">{{ item.clueName }}</div>
+                              <div class="text-[#B9B9B9]">{{ item.customerLevelValue }}</div>
+                            </div>
+                            <div class="flex items-center flex-row mt-1">
+                              <div class="text-[#B9B9B9] text-size-small" v-if="item.inchargerName">负责人:{{
+                                item.inchargerName }}</div>
+                              <div></div>
+                            </div>
+                          </div>
+                        </template>
                         <!-- 客户 -->
-                        <template v-if="queryParameters?.key == 'customer'">{{ item.customName }}</template>
+                        <template v-if="queryParameters?.key == 'customer'">
+                          <div>
+                            <div class="flex items-center flex-row">
+                              <div class="flex-1 truncate mr-8 titles relative">{{ item.customName }}</div>
+                              <div class="text-[#B9B9B9]">{{ item.customerLevelValue }}</div>
+                            </div>
+                            <div class="flex items-center flex-row mt-1">
+                              <div class="text-[#B9B9B9] text-size-small" v-if="item.inchargerName">负责人:{{
+                                item.inchargerName }}</div>
+                              <div></div>
+                            </div>
+                          </div>
+                        </template>
                         <!-- 联系人 -->
-                        <template v-if="queryParameters?.key == 'contacts'">{{ item.name }}</template>
+                        <template v-if="queryParameters?.key == 'contacts'">
+                          <div>
+                            <div class="flex items-center flex-row">
+                              <div class="flex-1 truncate mr-8 titles relative">{{ item.name }}</div>
+                              <div class="text-[#B9B9B9]">{{ item.position }}</div>
+                            </div>
+                            <div class="flex items-center justify-between flex-row mt-1">
+                              <div class="text-[#B9B9B9] text-size-small w-2/5 truncate" v-if="item.ownerName">客户:{{
+                                item.customName }}</div>
+                              <div class="text-[#B9B9B9] text-size-small w-2/5 truncate text-right" v-if="item.ownerName">负责人:{{
+                                item.ownerName }}</div>
+                            </div>
+                          </div>
+                        </template>
                         <!-- 任务 -->
-                        <template v-if="queryParameters?.key == 'tasks'">{{ item.taskName }}</template>
+                        <template v-if="queryParameters?.key == 'tasks'">
+                          <div>
+                            <div class="flex items-center flex-row">
+                              <div class="flex-1 truncate mr-8 titles relative">{{ item.taskName }}</div>
+                              <div class="text-[#B9B9B9]">
+                                {{ fixedFieldTaskStatus.find(subItem => subItem.value == item.status)?.label || '' }}
+                              </div>
+                            </div>
+                            <div class="flex items-center justify-between flex-row mt-1">
+                              <div class="text-[#B9B9B9] text-size-small w-2/5 truncate">
+                                {{ item.businessName || item.orderName || item.clueName || item.customName }}
+                              </div>
+                              <div class="text-[#B9B9B9] text-size-small w-2/5 truncate text-right">优先级:
+                                {{ fixedFieldPriority.find(subItem => subItem.value == item.priority)?.label || '' }}
+                              </div>
+                            </div>
+                          </div>
+                        </template>
                         <!-- 产品 -->
-                        <template v-if="queryParameters?.key == 'product'">{{ item.productName }}</template>
+                        <template v-if="queryParameters?.key == 'product'">
+                          <div>
+                            <div class="flex items-center flex-row">
+                              <div class="flex-1 truncate mr-8 titles relative">{{ item.productName }}</div>
+                              <div class="text-[#B9B9B9]">{{ item.status ? '上架' : '下架' }}</div>
+                            </div>
+                            <div class="flex items-center justify-between flex-row mt-1">
+                              <div class="text-[#B9B9B9] text-size-small w-2/5 truncate">负责人:{{
+                                item.inchargerName }}</div>
+                              <div class="text-[#B9B9B9] text-size-small w-2/5 truncate text-right">库存:{{
+                                item.unit || 0 }}</div>
+                            </div>
+                          </div>
+                        </template>
                         <!-- 合同 -->
-                        <template v-if="queryParameters?.key == 'contract'">{{ item.name }}</template>
+                        <template v-if="queryParameters?.key == 'contract'">
+                          <div>
+                            <div class="flex items-center flex-row">
+                              <div class="flex-1 truncate mr-8 titles relative">{{ item.name }}</div>
+                              <div class="text-[#B9B9B9]">
+                                <span :style="fixedFieldStatusArray[item.status].color">
+                                  {{ fixedFieldStatusArray[item.status].label }}
+                                </span>
+                              </div>
+                            </div>
+                            <div class="flex items-center justify-between flex-row mt-1">
+                              <div class="text-[#B9B9B9] text-size-small w-2/6 truncate">{{ item.number }}</div>
+                              <div class="text-[#B9B9B9] text-size-small w-2/3 truncate text-right">
+                                合同金额¥{{ item.amounts }} / 回款进度 {{ item.payment ? (100 * item.payment / item.amounts).toFixed(1) + '%' : '0%' }}
+                              </div>
+                            </div>
+                          </div>
+                        </template>
                         <!-- 销售 -->
-                        <template v-if="queryParameters?.key == 'order'">{{ item.orderName }}</template>
+                        <template v-if="queryParameters?.key == 'order'">
+                          <div>
+                            <div class="flex items-center flex-row">
+                              <div class="flex-1 truncate mr-8 titles relative">{{ item.orderName }}</div>
+                              <div class="text-[#B9B9B9]">{{ fixedFieldPaymentStatus.find(subItem => subItem.value == item.receivedStatus)?.label || '' }}</div>
+                            </div>
+                            <div class="flex items-center justify-between flex-row mt-1">
+                              <div class="text-[#B9B9B9] text-size-small w-2/6 truncate">{{ item.customName }}</div>
+                              <div class="text-[#B9B9B9] text-size-small w-2/3 truncate text-right">
+                                订单金额¥{{ item.price }} / 已回款¥ {{ item.receivedPayment }}
+                              </div>
+                            </div>
+                          </div>
+                        </template>
                       </div>
                     </div>
                     <template #right>
                       <div class="flex items-center h-full bg-white">
                         <template v-if="!item.inchargerName">
-                          <div class="buttonCircle rounded-full" @click="claimAndClaim(item)" v-if="['business', 'thread', 
-                          'customer'].includes(queryParameters?.key)">
+                          <div class="buttonCircle rounded-full" @click="claimAndClaim(item)" v-if="['business', 'thread',
+                            'customer'].includes(queryParameters?.key)">
                             <img src="/src/assets/image/claimAndClaim.png" class="w-full h-full">
                           </div>
                         </template>
                         <template v-if="item.inchargerName || item.ownerName">
-                          <div class="buttonCircle rounded-full" @click="transfer(item)" v-if="['business', 'thread', 
-                          'customer', 'contacts'].includes(queryParameters?.key)">
+                          <div class="buttonCircle rounded-full" @click="transfer(item)" v-if="['business', 'thread',
+                            'customer', 'contacts'].includes(queryParameters?.key)">
                             <img src="/src/assets/image/transfer.png" class="w-full h-full">
                           </div>
                         </template>
@@ -65,12 +176,16 @@
                             <img src="/src/assets/image/noTopMounted.png" class="w-full h-full">
                           </div>
                         </template>
-                        <div class="buttonCircle rounded-full" @click="edit(item)">
-                          <img src="/src/assets/image/edit.png" class="w-full h-full">
-                        </div>
-                        <div class="buttonCircle rounded-full" @click="deleteRow(item)">
-                          <img src="/src/assets/image/delete.png" class="w-full h-full">
-                        </div>
+                        <template v-permission="[queryParameters?.jurisdiction?.edit]">
+                          <div class="buttonCircle rounded-full" @click="edit(item)" >
+                            <img src="/src/assets/image/edit.png" class="w-full h-full">
+                          </div>
+                        </template>
+                        <template v-permission="[queryParameters?.jurisdiction?.delete]">
+                          <div class="buttonCircle rounded-full" @click="deleteRow(item)" >
+                            <img src="/src/assets/image/delete.png" class="w-full h-full">
+                          </div>
+                        </template>
                       </div>
                     </template>
                   </van-swipe-cell>
@@ -86,7 +201,7 @@
 
       <!-- 可拖拽添加 -->
       <DragBox>
-        <div class="addButton" @click="toAddEditor()">
+        <div class="addButton" @click="toAddEditor()" v-permission="[queryParameters?.jurisdiction?.newlyAdded]">
           <img src="/src/assets/image/add.png" class="w-full h-full" />
         </div>
       </DragBox>
@@ -117,6 +232,7 @@ import { useLifecycle } from '@hooks/useCommon.js';
 import { resetListData, getListFieldKey } from '@components/common/formForm/formCorrespondenceProcessing'
 import useShowToast from '@hooks/useToast'
 import { GET_CUSTOM_FORM_JSON } from '@hooks/useApi'
+import { fixedFieldPaymentStatus, fixedFieldPriority, fixedFieldTaskStatus, fixedFieldStatusArray } from "@utility/defaultData" 
 import requests from "@common/requests";
 import useRouterStore from "@store/useRouterStore.js";
 import useFixedData from "@store/useFixedData.js"
@@ -257,7 +373,7 @@ function noTopMounted(row) {
 }
 
 function toDetail(item) {
-  if(queryParameters.value?.key == 'tasks') {
+  if (queryParameters.value?.key == 'tasks') {
     return
   }
   router.navigateTo({

+ 6 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/order/orderInfo.vue

@@ -10,7 +10,11 @@
           <span class="text-[#FF8B32]" v-if="info.price">¥ {{ info.price }}</span>
         </template>
       </van-cell>
-      <van-cell title="回款状态" :value="info.receivedStatus" />
+      <van-cell title="回款状态" :value="info.receivedStatus">
+        <template #default>
+          <span class="text-[#FF8B32]">{{ fixedFieldPaymentStatus.find(item => item.value == info.receivedStatus)?.label || '' }}</span>
+        </template>
+      </van-cell>
       <van-cell title="已回款金额" :value="info.receivedPayment">
         <template #default>
           <span class="text-[#FF8B32]" v-if="info.receivedPayment">¥ {{ info.receivedPayment }}</span>
@@ -48,6 +52,7 @@
 <script setup>
 import { ref } from 'vue';
 import { useLifecycle } from '@hooks/useCommon.js';
+import { fixedFieldPaymentStatus } from "@utility/defaultData" 
 
 const props = defineProps({
   info: {

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/product/productInfo.vue

@@ -11,7 +11,7 @@
         </template>
       </van-cell>
       <van-cell title="库存" :value="info.unit" />
-      <van-cell title="状态" :value="info.status == 1 ? '上' : '下架'" />
+      <van-cell title="状态" :value="info.status == 1 ? '上' : '下架'" />
       <van-cell title="负责人">
         <template #default>
           <TranslationComponent :openId="info.inchargerName" />

+ 7 - 4
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/tasks/addEditor.vue

@@ -186,7 +186,7 @@
 import { ref, onActivated, computed } from 'vue';
 import { useLifecycle } from '@hooks/useCommon.js';
 import { fixedFieldTaskType, fixedFieldPriority, fixedFieldRepetitiveType } from '@utility/defaultData.js';
-import { GET_ALL_CUSTOMERSLIST, GET_ALL_BUSINESS_OPPORTUNITIES, GET_SALES_ORDER_LIST, GET_OBTAIN_ALL_CLUES, GET_CONTACTS_WITH_MORE_I_DS, TASK_ADD_EDIT } from "@hooks/useApi";
+import { GET_ALL_CUSTOMERSLIST, GET_ALL_BUSINESS_OPPORTUNITIES, GET_SALES_ORDER_LIST, GET_OBTAIN_ALL_CLUES, GET_CONTACTS_WITH_MORE_I_DS, TASK_ADD_EDIT, MODIFY_TASK } from "@hooks/useApi";
 import requests from "@common/requests";
 import useToast from "@hooks/useToast"
 import dayjs from 'dayjs';
@@ -248,8 +248,8 @@ const contactDisabled = computed(() => {
 function onSubmit() {
   formFormRef.value.getJsonData().then((res) => {
     const formValue = {
-      ...vantFormVal.value,
       ...formVal.value,
+      ...vantFormVal.value,
       ...res.data,
       repeatDesignDay: customeDate.value.map(item => item.value).join(','),
       executorId: vantFormVal.value.executorId,
@@ -257,7 +257,8 @@ function onSubmit() {
     }
     console.log('formValue', formValue)
     toastLoading('保存中')
-    requests.post(TASK_ADD_EDIT, { ...formValue }).then(() => {
+    const url = formValue.id ? MODIFY_TASK : TASK_ADD_EDIT
+    requests.post(url, { ...formValue }).then(() => {
       toastSuccess('保存成功')
       setTimeout(() => {
         router.navigateBack({
@@ -285,6 +286,7 @@ function showDatePickerBox(filed) {
 }
 
 function selectChange(value, label) {
+  console.log(value, label)
   if (taskTypeFiled.includes(showSelectionFiled.value)) {
     const item = fixedFieldTaskType.find(item => item.value == vantFormVal.value.taskType)
     console.log(item, value,)
@@ -301,9 +303,10 @@ function selectChange(value, label) {
     }
     customeDate.value = []
   }
-  vantFormVal.value[showSelectionFiled.value] = value
+  vantFormVal.value[showSelectionFiled.value] = Array.isArray(value) ? value.join(',') : value
   vantFormVal.value[`${showSelectionFiled.value}Name`] = label
   showSelectionFlag.value = false
+  showSelectionToFlag.value = false
 }
 
 function showSelectionToBox(filed) {

+ 3 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/tabbar/home/component/workbench.vue

@@ -98,7 +98,7 @@
     </div>
 
     <!-- 常用联系人 -->
-    <div class="mt-3">
+    <div class="mt-3" v-if="displayFrequentlyUsedContacts">
       <div class="text-size-large text-[#000] pl16">常用联系人</div>
       <div class="p16 pt-0 pb-0">
         <template v-for="item in topContactsList">
@@ -183,6 +183,7 @@ const showCommonForms = ref(false)
 const commonExpressionsHaveBeenAdded = ref([])
 const commonExpressionsHaveBeenNodded = ref([])
 const areYouRequesting = ref(false)
+const displayFrequentlyUsedContacts = ref(false)
 
 function toContactDetails(item) {
   router.navigateTo({
@@ -325,6 +326,7 @@ function getAllData() {
   if (areYouRequesting.value) {
     return
   }
+  displayFrequentlyUsedContacts.value = useInfo.modularList.filter(item => item.path === 'contacts').length
   areYouRequesting.value = true
   Promise.all([
     getVisitorPlan(),

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/tabbar/my/index.vue

@@ -43,6 +43,7 @@ function signOut() {
     success: () => {
       localStorage.clear()
       sessionStorage.clear()
+      window.location.reload();
     }
   })
 }

+ 7 - 0
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/utility/defaultData.js

@@ -50,4 +50,11 @@ export const fixedFieldRepetitiveType = [
   { label: "每月", value: 2 },
   { label: "自定义周期", value: 3 },
   { label: "自定义日期", value: 4 },
+]
+
+// 回款状态
+export const fixedFieldPaymentStatus = [
+  { value: 0, label: '未回款' },
+  { value: 1, label: '已回款' },
+  { value: 2, label: '已完全回款' },
 ]

+ 40 - 0
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/utility/generalVariables.js

@@ -16,6 +16,11 @@ export const routingInfos = {
     moduleImage: '/src/assets/image/module/business.png', // 模块图片
     searchFiled: { search: 'name' }, // 搜索字段
     image: '', // 图片
+    jurisdiction: { // 权限
+      newlyAdded: 'businessAddAnEdit',
+      edit: 'businessAddAnEdit',
+      delete: 'businessDelete'
+    }
   },
   'thread': {
     name: '线索',
@@ -32,6 +37,11 @@ export const routingInfos = {
     moduleImage: '/src/assets/image/module/thread.png',
     searchFiled: { search: 'clueName' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'threadAdd',
+      edit: 'threadEdit',
+      delete: 'threadDelete'
+    }
   },
   'customer': {
     name: '客户',
@@ -48,6 +58,11 @@ export const routingInfos = {
     moduleImage: '/src/assets/image/module/customer.png',
     searchFiled: { search: 'customName' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'customerAdd',
+      edit: 'customerEdit',
+      delete: 'customerDelete'
+    }
   },
   'contacts': {
     name: '联系人',
@@ -64,6 +79,11 @@ export const routingInfos = {
     moduleImage: '/src/assets/image/module/contacts.png',
     searchFiled: { search: 'name' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'contactsAdd',
+      edit: 'contactsEdit',
+      delete: 'contactsDelete'
+    }
   },
   'tasks': {
     name: '任务',
@@ -80,6 +100,11 @@ export const routingInfos = {
     moduleImage: '/src/assets/image/module/tasks.png',
     searchFiled: { search: 'taskName' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'tasksAdd',
+      edit: 'tasksEdit',
+      delete: 'tasksDelete'
+    }
   },
   'product': {
     name: '产品',
@@ -96,6 +121,11 @@ export const routingInfos = {
     moduleImage: '/src/assets/image/module/product.png',
     searchFiled: { search: 'productName' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'productAdd',
+      edit: 'productEdit',
+      delete: 'productDelete'
+    }
   },
   'contract': {
     name: '合同',
@@ -112,6 +142,11 @@ export const routingInfos = {
     moduleImage: '/src/assets/image/module/contract.png',
     searchFiled: { search: 'name' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'contractAdd',
+      edit: 'contractAdd',
+      delete: 'contractAdd'
+    }
   },
   'order': {
     name: '销售订单',
@@ -128,5 +163,10 @@ export const routingInfos = {
     moduleImage: '/src/assets/image/module/order.png',
     searchFiled: { search: 'orderName' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'orderAdd',
+      edit: 'orderEdit',
+      delete: 'orderDelete'
+    }
   }
 }

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

@@ -137,8 +137,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
             task.setStatus(0);
         }else if (taskDto.getEndDate()!=null&&taskDto.getEndDate().isBefore(LocalDate.now())){
             task.setStatus(3);
-        } else if (taskDto.getStartDate()!=null&&taskDto.getStartDate().isBefore(LocalDate.now())&&taskDto.getEndDate()!=null&&taskDto.getEndDate().isAfter(LocalDate.now()))
-        {
+        } else if (taskDto.getStartDate()!=null&&(taskDto.getStartDate().isBefore(LocalDate.now())||taskDto.getStartDate().isEqual(LocalDate.now()))&&taskDto.getEndDate()!=null&&(taskDto.getEndDate().isAfter(LocalDate.now())||taskDto.getEndDate().isEqual(LocalDate.now()))) {
             task.setStatus(1);
         }
         task.setCreaterName(user.getName());

+ 17 - 8
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UserCommonModuleServiceImpl.java

@@ -1,17 +1,12 @@
 package com.management.platform.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.config.DefaultCommonModuleConfig;
-import com.management.platform.entity.SysModule;
-import com.management.platform.entity.SysRoleModule;
-import com.management.platform.entity.User;
-import com.management.platform.entity.UserCommonModule;
+import com.management.platform.entity.*;
 import com.management.platform.entity.vo.UserCommonModuleVO;
-import com.management.platform.mapper.SysModuleMapper;
-import com.management.platform.mapper.SysRoleModuleMapper;
-import com.management.platform.mapper.UserCommonModuleMapper;
-import com.management.platform.mapper.UserMapper;
+import com.management.platform.mapper.*;
 import com.management.platform.service.UserCommonModuleService;
 import com.management.platform.util.HttpRespMsg;
 import org.apache.commons.collections.CollectionUtils;
@@ -42,6 +37,12 @@ public class UserCommonModuleServiceImpl extends ServiceImpl<UserCommonModuleMap
     @Resource
     private SysModuleMapper sysModuleMapper;
 
+    @Resource
+    private CompanyMapper companyMapper;
+
+    @Resource
+    private TimeTypeMapper timeTypeMapper;
+
     @Resource
     private DefaultCommonModuleConfig defaultCommonModuleConfig;
 
@@ -87,6 +88,14 @@ public class UserCommonModuleServiceImpl extends ServiceImpl<UserCommonModuleMap
                 }
             }
         }
+
+        //角色赋有的module
+        List<Integer> modelIds = sysRoleModuleMapper.selectList(new QueryWrapper<SysRoleModule>().eq("role_id", user.getRoleId()))
+                .stream().map(sr -> sr.getModuleId()).collect(Collectors.toList());
+        if(CollectionUtils.isNotEmpty(modelIds)){
+            commonModules = commonModules.stream().filter(t -> modelIds.contains(t.getModuleId())).collect(Collectors.toList());
+        }
+
         httpRespMsg.setData(commonModules);
         return httpRespMsg;
     }