Ver código fonte

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

zhouyy 2 meses atrás
pai
commit
2bf7cd464b

+ 41 - 22
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/index.vue

@@ -47,6 +47,8 @@
           @click="transitionOperation('exportUser', '')" v-permission="['teamExport']">导出人员</el-button>
         <el-button type="primary" v-if="userInfo.userNameNeedTranslate == 1"
           @click="dialogFrom.newSyncWithCorpWxDayloadVisable = true">同步企微通讯录</el-button>
+        <el-button type="primary" v-if="userInfo.userNameNeedTranslate == 1" @click="officialAccountSetting()">{{
+          officialAccountInformation.id ? '修改公众号配置' : '配置公众号' }}</el-button>
         <el-dropdown v-if="userInfo.userNameNeedTranslate != 1">
           <el-button type="primary">
             更多操作<el-icon class="el-icon--right"><arrow-down /></el-icon>
@@ -315,18 +317,30 @@
         </div>
       </template>
       <div class="pt-4 px-12 py-2">
-        <el-form ref="officialAccountInformationRef" style="max-width: 600px" :model="officialAccountInformationFrom"
-          status-icon :rules="officialAccountInformationFromRules" label-width="auto" class="demo-ruleForm">
+        <!-- <el-form ref="officialAccountInformationRef" :model="officialAccountInformationFrom"
+          :rules="officialAccountInformationFromRules" label-width="auto" class="demo-ruleForm">
           <el-form-item label="名称:" prop="companyName">
-            <el-input v-model.trim="officialAccountInformationFrom.companyName" placeholder="请输入" />
+            <el-input v-model="officialAccountInformationFrom.companyName" placeholder="请输入" />
           </el-form-item>
           <el-form-item label="appId:" prop="appId">
-            <el-input v-model.trim="officialAccountInformationFrom.appId" placeholder="请输入" />
+            <el-input v-model="officialAccountInformationFrom.appId" placeholder="请输入" />
           </el-form-item>
           <el-form-item label="appSecret:" prop="appSecret">
-            <el-input v-model.trim="officialAccountInformationFrom.appSecret" placeholder="请输入" />
+            <el-input v-model="officialAccountInformationFrom.appSecret" placeholder="请输入" />
           </el-form-item>
-        </el-form>
+        </el-form> -->
+        <div class="flex items-center mb-4">
+          <div class="w-[80px] text-right mr-3">名称</div>
+          <el-input v-model="officialAccountInformationFrom.companyName" placeholder="请输入" />
+        </div>
+        <div class="flex items-center mb-4">
+          <div class="w-[80px] text-right mr-3">appId</div>
+          <el-input v-model="officialAccountInformationFrom.appId" placeholder="请输入" />
+        </div>
+        <div class="flex items-center mb-4">
+          <div class="w-[80px] text-right mr-3">appSecret</div>
+          <el-input v-model="officialAccountInformationFrom.appSecret" placeholder="请输入" />
+        </div>
         <el-text class="mx-1" type="warning">请联系客服, 获取ip白名单参数, 配置后方可生效</el-text>
       </div>
     </el-dialog>
@@ -344,13 +358,8 @@
       :popup="visibleType" :batchOperationVisible="dialogFrom.batchOperationVisible" @close="closeModal" />
 
     <!-- 图片预览 -->
-    <el-image-viewer
-      v-if="showPreview"
-      :url-list="previewSrcList"
-      show-progress
-      :initial-index="0"
-      @close="showPreview = false"
-    />
+    <el-image-viewer v-if="showPreview" :url-list="previewSrcList" show-progress :initial-index="0"
+      @close="showPreview = false" />
   </div>
 </template>
 
@@ -467,7 +476,7 @@ const officialAccountInformation = ref<officialAccountInformationInterface>({
   appSecret: '',
 })
 
-const officialAccountInformationFrom = ref<officialAccountInformationInterface>({
+const officialAccountInformationFrom = reactive<officialAccountInformationInterface>({
   id: '',
   companyName: '',
   appId: '',
@@ -577,13 +586,18 @@ function oneClickGenerationOfQrCode() {
   })
 }
 
-async function configureOfficialAccountInformation(formEl: FormInstance | undefined) {
-  if (!formEl) return
-  await formEl.validate((valid) => {
-    if (valid) {
+async function configureOfficialAccountInformation(_formEl: FormInstance | undefined) {
+  // if (!formEl) return
+  // await formEl.validate((valid) => {
+  //   if (valid) {
+      const { companyName, appId, appSecret  } = officialAccountInformationFrom
+      if(!companyName || !appId || !appSecret) {
+        globalPopup?.showError('请填写完整')
+        return
+      }
       confirmAction('确定保存当前公众号的配置吗?', '公众号配置', 'warning').then(() => {
         loadingFrom.officialAccountSettingLoading = true
-        post(SAVE_OR_UPDATE, getFromValue(officialAccountInformationFrom.value)).then(() => {
+        post(SAVE_OR_UPDATE, getFromValue(officialAccountInformationFrom)).then(() => {
           globalPopup?.showSuccess('配置成功')
           closeModal('officialAccountSettingVisable')
           getCompanyWeiXin()
@@ -591,8 +605,8 @@ async function configureOfficialAccountInformation(formEl: FormInstance | undefi
           loadingFrom.officialAccountSettingLoading = false
         })
       })
-    }
-  })
+  //   }
+  // })
 }
 
 function closeOfficialAccountInformation(formEl: FormInstance | undefined) {
@@ -601,7 +615,12 @@ function closeOfficialAccountInformation(formEl: FormInstance | undefined) {
 }
 
 function officialAccountSetting() {
-  officialAccountInformationFrom.value = JSON.parse(JSON.stringify(officialAccountInformation.value))
+  Object.assign(officialAccountInformationFrom, officialAccountInformation.value || {
+    id: '',
+    companyName: '',
+    appId: '',
+    appSecret: ''
+  })
   dialogFrom.officialAccountSettingVisable = true
 }
 

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/TaskMapper.java

@@ -72,5 +72,5 @@ public interface TaskMapper extends BaseMapper<Task> {
 
     List<TaskDto> getTaskListByStartAndEnd(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate, @Param("departmentId") Integer departmentId, @Param("executor") String executor, @Param("companyId")Integer companyId);
 
-    List<TaskDto> selectListByIds(@Param("list") List<Integer> list);
+    List<TaskDto> selectListByIds(@Param("list") List<Integer> list,@Param("companyId") Integer companyId);
 }

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

@@ -2544,7 +2544,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     .map(TaskRemind::getTaskId)
                     .collect(Collectors.toList());
 
-            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect);
+            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect,companyId);
 
             ArrayList<TaskDto> taskDtos = new ArrayList<>();
             for (TaskRemind remind : remindList) {

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

@@ -17,6 +17,7 @@ import com.management.platform.mapper.*;
 import com.management.platform.service.*;
 import com.management.platform.task.SFTPAsyncUploader;
 import com.management.platform.util.*;
+import lombok.extern.slf4j.Slf4j;
 import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
 import me.chanjar.weixin.mp.api.WxMpService;
 import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
@@ -62,6 +63,7 @@ import java.util.stream.Collectors;
  * @since 2019-12-31
  */
 @Service
+@Slf4j
 public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
 
     @Value(value = "${upload.path}")
@@ -289,29 +291,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 
                     }
                 }*/
-                if (company.getIsSimple()==1){
-                    List<SysModule> collect = userVO.getModuleList().stream().filter(m -> !"联系人".equals(m.getName()) && !"销售订单".equals(m.getName())).collect(Collectors.toList());
-                    userVO.setModuleList(collect);
-                }
-                if (company.getIsExistBusiness()==0) {
-                    List<SysModule> moduleList = userVO.getModuleList();
-                    for (SysModule sysModule : moduleList) {
-                        sysModule.setName(sysModule.getName().replaceAll("商机","项目"));
-
-                        List<SysFunction> sysFunctionList = sysModule.getFunctionList();
-                        for (SysFunction function : sysFunctionList) {
-                            function.setName(function.getName().replaceAll("商机","项目"));
-                        }
-                        sysModule.setFunctionList(sysFunctionList);
-                    }
-                    userVO.setModuleList(moduleList);
-
-                    List<SysFunction> list = userVO.getFunctionList();
-                    for (SysFunction function : list) {
-                        function.setName(function.getName().replaceAll("商机","项目"));
-                    }
-                    userVO.setFunctionList(list);
-                }
                 httpRespMsg.data = userVO;
             }else {
                 httpRespMsg.setError(MessageUtils.message("user.pwdError"));
@@ -320,6 +299,33 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         return httpRespMsg;
     }
 
+    private static void replaceShowNameByField(Company company, UserVO userVO) {
+        log.info("根据公司配置的字段,控制返回展示");
+        if (company.getIsSimple()==1){
+            List<SysModule> collect = userVO.getModuleList().stream().filter(m -> !"联系人".equals(m.getName()) && !"销售订单".equals(m.getName())).collect(Collectors.toList());
+            userVO.setModuleList(collect);
+        }
+        if (company.getIsExistBusiness()==0) {
+            List<SysModule> moduleList = userVO.getModuleList();
+            for (SysModule sysModule : moduleList) {
+                sysModule.setName(sysModule.getName().replaceAll("商机","项目"));
+
+                List<SysFunction> sysFunctionList = sysModule.getFunctionList();
+                for (SysFunction function : sysFunctionList) {
+                    function.setName(function.getName().replaceAll("商机","项目"));
+                }
+                sysModule.setFunctionList(sysFunctionList);
+            }
+            userVO.setModuleList(moduleList);
+
+            List<SysFunction> list = userVO.getFunctionList();
+            for (SysFunction function : list) {
+                function.setName(function.getName().replaceAll("商机","项目"));
+            }
+            userVO.setFunctionList(list);
+        }
+    }
+
     public String getSuperSonicToken(){
         String token = "";
         String apiUrl = "http://"+superSonicConfig.getSupersonicIP()+":"+superSonicConfig.getSupersonicPort()+"/api/auth/user/login";
@@ -744,6 +750,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         }
 
         user.setModuleList(menuList);
+        //根据公司配置的字段,控制返回展示
+        replaceShowNameByField(company, user);
     }
 
     private boolean judgeIsLeader(String userId) {

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

@@ -408,7 +408,7 @@ public class VisitPlanServiceImpl extends ServiceImpl<VisitPlanMapper, VisitPlan
                     .map(TaskRemind::getTaskId)
                     .collect(Collectors.toList());
 
-            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect);
+            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect,companyId);
 
             ArrayList<TaskDto> taskDtos = new ArrayList<>();
             for (TaskRemind remind : remindList) {
@@ -543,7 +543,7 @@ public class VisitPlanServiceImpl extends ServiceImpl<VisitPlanMapper, VisitPlan
                     .map(TaskRemind::getTaskId)
                     .collect(Collectors.toList());
 
-            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect);
+            List<TaskDto> taskDtoListCollect = taskMapper.selectListByIds(collect,companyId);
 
             ArrayList<TaskDto> taskDtos = new ArrayList<>();
             for (TaskRemind remind : remindList) {

+ 3 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskMapper.xml

@@ -559,6 +559,9 @@
                    #{item}
                 </foreach>
             </if>
+            <if test="companyId!=null">
+                AND task.company_id = #{companyId}
+            </if>
         </where>
 
     </select>

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

@@ -1283,7 +1283,7 @@ public class TimingTask {
                     }else if(task.getEndDate().isEqual(now.plusDays(1))){
                         msg.append("一天后");
                     }
-                    msg.append("截止,请抓紧时间完成!");
+                    msg.append("截止,请督促员工完成!");
                     wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,sendWxIds,msg.toString(),"task",null);
                 }
 

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

@@ -386,7 +386,7 @@
                           <span style="float: right; color: #8492a6; font-size: 13px">{{ item.jobNumber }}</span>
                         </el-option>
                     </el-select>
-                    <selectCat :size="'medium'" :filterable="true" :clearable="true" :widthStr="'300'" v-if="user.userNameNeedTranslate == '1'" :subject="users" :subjectId="depForm.managerId" :distinction="'3'" @selectCal="selectCal"></selectCat>
+                    <selectCat :size="'medium'" :filterable="true" :clearable="true" :widthStr="'430'" v-if="user.userNameNeedTranslate == '1'" :subject="users" :subjectId="depForm.managerId" :distinction="'3'" @selectCal="selectCal"></selectCat>
                 </el-form-item>
 
                 <!-- 其他负责人 --> 
@@ -397,7 +397,7 @@
                           <span style="float: right; color: #8492a6; font-size: 13px">{{ item.jobNumber }}</span>
                         </el-option>
                     </el-select>
-                    <selectCat :subject="users" :subjectId="depForm.otherManagerIds" :size="'medium'" :filterable="true" :widthStr="'300'" :multiSelect="true" v-if="user.userNameNeedTranslate == '1' && departmentVisible"  :distinction="'4'" :clearable="true" @selectCal="selectCal"></selectCat>
+                    <selectCat :subject="users" :subjectId="depForm.otherManagerIds" :size="'medium'" :filterable="true" :widthStr="'430'" :multiSelect="true" v-if="user.userNameNeedTranslate == '1' && departmentVisible"  :distinction="'4'" :clearable="true" @selectCal="selectCal"></selectCat>
                 </el-form-item>
                 <!-- 直属领导 -->
                 <el-form-item :label="$t('leadership')" prop="reportAuditUserid" v-if="user.timeType.needDeptAudit">