浏览代码

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

QuYueTing 6 月之前
父节点
当前提交
03c17335b2
共有 39 个文件被更改,包括 484 次插入100 次删除
  1. 二进制
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/chongqi.png
  2. 二进制
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/lianxir.png
  3. 二进制
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/module/contract.png
  4. 二进制
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/module/min_contract.png
  5. 二进制
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/wanc.png
  6. 二进制
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/yanqi.png
  7. 2 1
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/formForm/formItem.vue
  8. 10 1
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/formForm/formView.vue
  9. 7 1
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/moduleList/moduleList.vue
  10. 3 3
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/business/addEditor.vue
  11. 2 2
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/product/newAndModifiedRelatedProducts.vue
  12. 57 9
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/visitorProgram/visitorDetails.vue
  13. 2 2
      fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/utility/generalVariables.js
  14. 34 5
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ContactsController.java
  15. 5 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java
  16. 6 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/UserController.java
  17. 2 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/CustomService.java
  18. 2 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/UserService.java
  19. 55 3
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java
  20. 3 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SalesOrderServiceImpl.java
  21. 66 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  22. 1 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectApprovalController.java
  23. 32 5
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java
  24. 56 23
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskFilesController.java
  25. 3 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ProjectApproval.java
  26. 5 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Task.java
  27. 13 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TaskFiles.java
  28. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/bo/QueryTaskChargePage.java
  29. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/TaskChargePageVO.java
  30. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/TaskService.java
  31. 2 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectApprovalServiceImpl.java
  32. 42 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  33. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml
  34. 24 24
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml
  35. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/components/taskComponent.vue
  36. 1 0
      fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json
  37. 6 1
      fhKeeper/formulahousekeeper/timesheet/src/permissions.js
  38. 26 2
      fhKeeper/formulahousekeeper/timesheet/src/views/projectApproval/projectApproval.vue
  39. 9 7
      fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

二进制
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/chongqi.png


二进制
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/lianxir.png


二进制
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/module/contract.png


二进制
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/module/min_contract.png


二进制
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/wanc.png


二进制
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/assets/image/yanqi.png


+ 2 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/formForm/formItem.vue

@@ -50,7 +50,7 @@
       is-link
       :class="element.options?.rules?.required ? '' : 'resetStyles'"
     >
-      <template #input v-if="element.options.defaultValue || element.options.defaultValue == 0">
+      <template #input v-if="element.options.defaultValue || element.options.defaultValue === '0' || element.options.defaultValue === 0">
         {{ selectedLabel }}
       </template>
     </van-field>
@@ -212,6 +212,7 @@ function selectChange(value, label) {
   showSelect.value = false;
   value && errorMessageForResettingTheCurrentOption();
   const cascade = relatedField[props.element.model];
+  console.log(cascade, '<=== cascade')
   if (cascade) {
     emit("cascadeProcessing", cascade);
   }

+ 10 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/formForm/formView.vue

@@ -10,7 +10,7 @@
 import { ref, reactive, toRefs, watch, nextTick, onMounted } from "vue";
 import requests from "@common/requests";
 import FormItem from "./formItem.vue";
-import { resetListData, itemFormSetValue } from "./formCorrespondenceProcessing"
+import { resetListData, itemFormSetValue, relatedField } from "./formCorrespondenceProcessing"
 
 const list = ref([]);
 const formRef = ref(null);
@@ -32,6 +32,15 @@ watch(() => props.formJson, (newValue) => {
 
 watch(() => props.formValue, (newValue) => {
   list.value = itemFormSetValue(props.formJson.list, newValue);
+  const fileds = Object.keys(newValue);
+  setTimeout(() => {
+    fileds.forEach(item => {
+      const cascade = relatedField[item];
+      if (cascade) {
+        cascadeProcessing(cascade)
+      }
+    });
+  }, 800)
 });
 
 function getJsonData() {

+ 7 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/moduleList/moduleList.vue

@@ -315,7 +315,13 @@ function confirmTransfer() {
   }
   const { id } = excessiveData.value
   const { value } = dialogSelection.value
-  requests.post(queryParameters?.value.transferInterface, { ids: id, inchargerId: value }).then((res) => {
+  let formVal = {}
+  if(queryParameters?.value.key == 'contacts') {
+    formVal = { id, inchargerId: value, ownerId: value }
+  } else {
+    formVal = { ids: id, inchargerId: value, }
+  }
+  requests.post(queryParameters?.value.transferInterface, { ...formVal }).then((res) => {
     toastSuccess('转移成功')
     onRefresh(true)
     showDialog.value = false

+ 3 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/business/addEditor.vue

@@ -96,7 +96,9 @@ function judgmentaAmounteEqual(mob, arr) {
   }
   let flag = false;
   const amounte = +mob.amountOfMoney || 0;
-  const totalAmounte = arr.reduce((pre, cur) => pre + (cur.totalPrice || 0), 0);
+  const totalAmounte = arr.reduce((pre, cur) => pre + (+cur.totalPrice || 0), 0);
+
+  console.log(amounte, totalAmounte)
 
   if (amounte != totalAmounte) {
     toastText(`商机金额${amounte > totalAmounte ? '大于' : '小于'}产品总金额,${amounte > totalAmounte ? '保存中...' : '请修改'}`)
@@ -135,12 +137,10 @@ useLifecycle({
   load: () => {
     formVal.value = props.formValue
     getBusinessOpportunityDetails(formVal.value)
-    console.log(formVal.value, '<==== formVal.value')
   },
   init: () => {
     formVal.value = props.formValue
     getBusinessOpportunityDetails(formVal.value)
-    console.log(formVal.value, '<==== formVal.value')
   }
 });
 

+ 2 - 2
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/pageComponents/product/newAndModifiedRelatedProducts.vue

@@ -163,8 +163,8 @@ function selectChange(value, label) {
 
 function inputNumberChange(field) {
     const { sellingPrice, quantity, discount, price } = props.form
-    props.form.discount = field == 'sellingPrice' ? Math.round(sellingPrice / price * 100) : props.form.discount
-    props.form.sellingPrice = field == 'discount' ? Math.round(price * discount / 100) : props.form.sellingPrice
+    // props.form.discount = field == 'sellingPrice' ? Math.round(sellingPrice / price * 100) : props.form.discount
+    // props.form.sellingPrice = field == 'discount' ? Math.round(price * discount / 100) : props.form.sellingPrice
     if (sellingPrice && quantity && price && discount) {
         props.form.totalPrice = Math.round(Math.round(price * discount / 100) * quantity)
     }

+ 57 - 9
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/visitorProgram/visitorDetails.vue

@@ -55,7 +55,7 @@
 
       <van-popup v-model:show="showDelay" closeable position="bottom" round>
         <div class="newModuleAdded relative">
-          <div class="text-size-large text-[#474A56] absolute topTitle">延期时间</div>
+          <div class="text-size-large text-[#474A56] absolute topTitle">{{ delayRestartText }}时间</div>
           <div class="flex flex-col overflow-y-auto h-52">
             <div class="flex-1">
               <div class="px-6 py-4 bg-[#F8F8FA] flex justify-between items-center mt-2" @click="showDatePicker = true">
@@ -83,20 +83,43 @@
     <template v-slot:footer v-if="detailedData.finishState == 0">
       <div class="w-full flex justify-between layout">
         <div class="footerBtnLeft layouts" @click="showContactsCli()">
-          <div class="imgClss"></div>
+          <div class="imgClss">
+            <img src="/src/assets/image/lianxir.png" alt="">
+          </div>
           联系人
         </div>
-        <div class="footerBtnRight layouts" @click="showDelay = true, showDelayData = ''">
-          <div class="imgClss"></div>
+        <div class="footerBtnRight layouts" @click="delayRestart('DELAY')">
+          <div class="imgClss">
+            <img src="/src/assets/image/yanqi.png" alt="">
+          </div>
           延期
         </div>
         <div class="coverWithWhite"></div>
         <div class="bigCircle" @click="completeThePlan()">
-          <div class="imgClss"></div>
+          <div class="imgClss">
+            <img src="/src/assets/image/wanc.png" alt="">
+          </div>
           完成
         </div>
       </div>
     </template>
+
+    <template v-slot:footer v-if="detailedData.finishState != 0">
+      <div class="w-full flex justify-between layout">
+        <div class="footerBtnTwoLeft layoutsTwo" @click="showContactsCli()">
+          <div class="imgClss">
+            <img src="/src/assets/image/lianxir.png" alt="">
+          </div>
+          联系人
+        </div>
+        <div class="footerBtnTwoLeft layoutsTwo" @click="delayRestart('RESTART')">
+          <div class="imgClss">
+            <img src="/src/assets/image/chongqi.png" alt="">
+          </div>
+          重启
+        </div>
+      </div>
+    </template>
   </Page>
 </template>
 
@@ -124,6 +147,14 @@ const showDatePickerVal = ref(dayjs().format("YYYY-MM-DD").split('-'))
 const showDelayData = ref('')
 const currentTime = ref('')
 const contactList = ref([]);
+const delayRestartText = ref('')
+
+function delayRestart(type = 'DELAY') {
+  const textType = { 'DELAY': '延期', 'RESTART': '重启' }
+  delayRestartText.value = textType[type]
+  showDelay.value = true
+  showDelayData.value = ''
+}
 
 function visitorEditor() {
   router.navigateTo({
@@ -153,7 +184,7 @@ function jumpToCustomerDetails() {
 }
 
 function showContactsCli() {
-  if(!((contactList.value || []).length)) {
+  if (!((contactList.value || []).length)) {
     toastText('该联系人无号码')
     return
   }
@@ -266,13 +297,32 @@ useLifecycle({
     justify-content: center;
   }
 
+  .layoutsTwo {
+    width: 40%;
+    height: 100%;
+    background: #fff;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+  }
+
   .footerBtnLeft {
     border-top-right-radius: 25px;
 
     .imgClss {
       width: 30px;
       height: 30px;
-      background-color: #000;
+      margin-bottom: 6px;
+    }
+  }
+
+  .footerBtnTwoLeft {
+    width: 50%;
+
+    .imgClss {
+      width: 30px;
+      height: 30px;
       margin-bottom: 6px;
     }
   }
@@ -283,7 +333,6 @@ useLifecycle({
     .imgClss {
       width: 26px;
       height: 24px;
-      background-color: #000;
       margin-bottom: 9px;
     }
   }
@@ -321,7 +370,6 @@ useLifecycle({
       width: 25.5px;
       height: 25.5px;
       margin-bottom: 4px;
-      background: #000;
     }
   }
 }

文件差异内容过多而无法显示
+ 2 - 2
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/utility/generalVariables.js


+ 34 - 5
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ContactsController.java

@@ -2,17 +2,21 @@ package com.management.platform.controller;
 
 
 import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.management.platform.entity.Contacts;
-import com.management.platform.entity.Custom;
-import com.management.platform.entity.User;
+import com.management.platform.entity.*;
+import com.management.platform.mapper.BusinessOpportunityMapper;
 import com.management.platform.mapper.ContactsMapper;
+import com.management.platform.mapper.TaskMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.ContactsService;
 import com.management.platform.util.HttpRespMsg;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+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.multipart.MultipartFile;
 
 import javax.annotation.Resource;
@@ -43,6 +47,12 @@ public class ContactsController {
     @Autowired
     private ContactsMapper contactsMapper;
 
+    @Resource
+    private BusinessOpportunityMapper businessOpportunityMapper;
+
+    @Resource
+    private TaskMapper taskMapper;
+
 
     /***
      * 置顶联系人
@@ -138,12 +148,31 @@ public class ContactsController {
      */
     @RequestMapping("deleteContacts")
     public HttpRespMsg deleteContacts( String ids){
+        HttpRespMsg msg = new HttpRespMsg();
         if (!StringUtils.isEmpty(ids)) {
             ids="["+ids+"]";
             List<Integer> array = JSONArray.parseArray(ids, Integer.class);
+            Integer bCount = businessOpportunityMapper.selectCount(new LambdaQueryWrapper<BusinessOpportunity>()
+                    .eq(BusinessOpportunity::getIsDelete, 0)
+                    .in(BusinessOpportunity::getContactsId, array)
+            );
+            if(bCount>0){
+                msg.setError("选中联系人中存在相关绑定商机,无法删除");
+                return msg;
+            }
+
+            Integer taskCount = taskMapper.selectCount(new LambdaQueryWrapper<Task>()
+                    .eq(Task::getIsDelete, 0)
+                    .in(Task::getContactsId, array)
+            );
+            if(taskCount>0){
+                msg.setError("选中联系人中存在相关绑定任务,无法删除");
+                return msg;
+            }
+
             return contactsService.deleteContacts(array,request);
         }
-        HttpRespMsg msg = new HttpRespMsg();
+
         msg.setError("参数不能为空");
         return msg;
     }

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

@@ -85,6 +85,11 @@ public class CustomController {
         return customService.pinCutom(custom,request);
     }
 
+    @RequestMapping("getPrivilegedCustom")
+    public HttpRespMsg getPrivilegedCustom(HttpServletRequest request) {
+        return customService.getPrivilegedCustom(request);
+    }
+
     @RequestMapping("getAllCustom")
     public HttpRespMsg getAllCustom(HttpServletRequest request) {
         return customService.getAllCustom(request);

+ 6 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/UserController.java

@@ -112,6 +112,12 @@ public class UserController {
         return userService.loginByUserId(userId, request);
     }
 
+    @RequestMapping("/uploadImage")
+    public HttpRespMsg uploadImage(MultipartFile multipartFile) {
+        return userService.uploadImage(multipartFile, request);
+    }
+
+
     /**
      * 根据id获取用户信息
      * userId 用户id

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/CustomService.java

@@ -66,4 +66,6 @@ public interface CustomService extends IService<Custom> {
     HttpRespMsg pinCutom(Custom custom, HttpServletRequest request);
 
     HttpRespMsg undoPin(Custom custom, HttpServletRequest request);
+
+    HttpRespMsg getPrivilegedCustom(HttpServletRequest request);
 }

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/UserService.java

@@ -109,4 +109,6 @@ public interface UserService extends IService<User> {
     HttpRespMsg deleteUserSalaryById(String id);
 
     HttpRespMsg getSimpleActiveUserListNew(Integer departmentId, HttpServletRequest request, String keyword, String cursor) throws Exception;
+
+    HttpRespMsg uploadImage(MultipartFile multipartFile, HttpServletRequest request);
 }

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

@@ -544,10 +544,34 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
 
     @Override
     public HttpRespMsg getAllCustom(HttpServletRequest request) {
-        User user = userMapper.selectById(request.getHeader("token"));
-        Integer companyId = user.getCompanyId();
+//        User user = userMapper.selectById(request.getHeader("token"));
+//        Integer companyId = user.getCompanyId();
+//        HttpRespMsg msg = new HttpRespMsg();
+//        msg.setData(customMapper.selectList(new QueryWrapper<Custom>().eq("company_id", companyId)));
+//        return msg;
         HttpRespMsg msg = new HttpRespMsg();
-        msg.setData(customMapper.selectList(new QueryWrapper<Custom>().eq("company_id", companyId)));
+        User user = userMapper.selectById(request.getHeader("Token"));
+        boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部客户");
+        boolean isNotAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看负责部门客户");
+        List<Custom> list = new ArrayList<>();
+        Custom custom = new Custom();
+        custom.setCompanyId(user.getCompanyId());
+        custom.setIsDelete(0);
+        custom.setUserId(user.getId());
+        if (isAll) {
+            //查看全部客户
+            list = customMapper.getList(custom);
+//            i = customMapper.getTotal(custom);
+        } else if (isNotAll) {
+            //查看负责部门线索 找出所处部门下所有的负责人
+            list = customMapper.getList1(custom);
+//            i = customMapper.getTotal1(custom);
+        } else {
+            // 查看负责人为 自己 和 null的数据
+            list = customMapper.getList2(custom);
+//            i = customMapper.getTotal2(custom);
+        }
+        msg.data = list;
         return msg;
     }
 
@@ -931,6 +955,34 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
         return respMsg;
     }
 
+    @Override
+    public HttpRespMsg getPrivilegedCustom(HttpServletRequest request) {
+        HttpRespMsg msg = new HttpRespMsg();
+        User user = userMapper.selectById(request.getHeader("Token"));
+        boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部客户");
+        boolean isNotAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看负责部门客户");
+        List<Custom> list = new ArrayList<>();
+        Custom custom = new Custom();
+        custom.setCompanyId(user.getCompanyId());
+        custom.setIsDelete(0);
+        custom.setUserId(user.getId());
+        if (isAll) {
+            //查看全部客户
+            list = customMapper.getList(custom);
+//            i = customMapper.getTotal(custom);
+        } else if (isNotAll) {
+            //查看负责部门线索 找出所处部门下所有的负责人
+            list = customMapper.getList1(custom);
+//            i = customMapper.getTotal1(custom);
+        } else {
+            // 查看负责人为 自己 和 null的数据
+            list = customMapper.getList2(custom);
+//            i = customMapper.getTotal2(custom);
+        }
+        msg.data = list;
+        return msg;
+    }
+
 
     private Custom setNull(Custom clue) {
         if (clue.getPlate1() == "") {

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

@@ -1250,6 +1250,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
                     List<Integer> deptIds = departmentList.stream().map(Department::getDepartmentId).distinct().collect(Collectors.toList());
                     deptIds.add(-1);
                     List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().in(User::getDepartmentId, deptIds));
+                    userList.add(user);
                     List<String> userIds = userList.stream().map(User::getId).distinct().collect(Collectors.toList());
                     targetUserIds=userIds;
                     break;
@@ -1257,6 +1258,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
                     //本部门
                     Integer targetDeptId1 = user.getDepartmentId();
                     List<User> users1 = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getDepartmentId, targetDeptId1));
+                    users1.add(user);
                     List<String> targetUserIds1 = users1.stream().map(User::getId).distinct().collect(Collectors.toList());
                     targetUserIds=targetUserIds1;
                     break;
@@ -1264,6 +1266,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
                     Integer targetDeptId2 = user.getDepartmentId();
                     List<Integer> branchDepartment = getBranchDepartment(targetDeptId2, allDeptList);
                     List<User> users2 = userMapper.selectList(new LambdaQueryWrapper<User>().in(User::getDepartmentId, branchDepartment));
+                    users2.add(user);
                     List<String> targetUserIds2 = users2.stream().map(User::getId).distinct().collect(Collectors.toList());
                     targetUserIds=targetUserIds2;
             }

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

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.constant.Constant;
@@ -14,6 +15,7 @@ import com.management.platform.entity.vo.SysRichFunction;
 import com.management.platform.entity.vo.UserVO;
 import com.management.platform.mapper.*;
 import com.management.platform.service.*;
+import com.management.platform.task.SFTPAsyncUploader;
 import com.management.platform.util.*;
 import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
 import me.chanjar.weixin.mp.api.WxMpService;
@@ -22,6 +24,8 @@ import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
 import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
 import org.apache.commons.collections4.Put;
 import org.apache.commons.io.FileUtils;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.*;
@@ -101,6 +105,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     @Value("${configEnv.isPrivateDeploy}")
     private boolean isPrivateDeploy;
 
+    Logger logger = LogManager.getLogger(org.apache.logging.log4j.LogManager.ROOT_LOGGER_NAME);
+    @Autowired
+    public SFTPAsyncUploader sftpAsyncUploader;
+
     public static final String GET_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
     public static final String GET_USERINFO_URL = "https://api.weixin.qq.com/sns/userinfo?access_token=accessToken&openid=openId&lang=zh_CN";
     public static final String[] MATCHING_FILED = {"corpwx_userid","phone","job_number"};
@@ -1967,6 +1975,64 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             return msg;
         }
     }
+
+    @Override
+    public HttpRespMsg uploadImage(MultipartFile multipartFile, HttpServletRequest request) {
+        HttpRespMsg msg = new HttpRespMsg();
+        // 处理文件
+        String fileName = multipartFile.getOriginalFilename();
+        String[] split = fileName.split("\\.");
+        String fileExtension = split.length > 1 ? split[split.length - 1].toLowerCase() : ""; // 获取文件扩展名
+        String[] allowedExtensions = {"jpg", "jpeg", "png", "gif"}; // 允许的图片扩展名
+
+        // 检查扩展名是否有效
+        boolean isValidImage = Arrays.stream(allowedExtensions).anyMatch(fileExtension::equals);
+        if (!isValidImage) {
+            msg.setError("只允许上传图片格式的文件!");
+            return msg; // 返回错误信息
+        }
+
+        String serverName = UUID.randomUUID().toString().replaceAll("-", "") + "." + fileExtension;
+
+        // 检查目录
+        File dir = new File(path);
+        if (!dir.exists()) {
+            dir.mkdir();
+        }
+        File file = new File(dir, serverName);
+        InputStream inputStream = null;
+        OutputStream outputStream = null;
+        try {
+            inputStream = multipartFile.getInputStream();
+            outputStream = new FileOutputStream(file);
+            byte[] buffer = new byte[4096];
+            int temp;
+            while ((temp = inputStream.read(buffer)) != -1) {
+                outputStream.write(buffer, 0, temp);
+            }
+
+            // 关闭流
+            inputStream.close();
+            outputStream.close();
+
+            msg.data = serverName;
+
+            // 更新用户头像 URL
+            userMapper.update(null, new UpdateWrapper<User>()
+                    .eq("id", request.getHeader("token"))
+                    .set("portrait_url", serverName));
+
+            // 上传到 SFTP 服务器
+            sftpAsyncUploader.uploadFileAsync(file);
+
+        } catch (Exception exception) {
+            exception.printStackTrace();
+            logger.error(exception.getMessage());
+            msg.data = "文件上传失败!";
+        }
+
+        return msg;
+    }
 //
 //    private String getAccessToken(String code) {
 //        String accessToken = "";

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectApprovalController.java

@@ -90,6 +90,7 @@ public class ProjectApprovalController {
         List<ProjectCategory> categoryList = projectCategoryService.list(new LambdaQueryWrapper<ProjectCategory>().eq(ProjectCategory::getCompanyId, companyId));
         //编辑重新提交修改状态为待审核
         projectApproval.setStatus(0);
+        projectApproval.setRejectInfo("");
         if(projectApproval.getId()==null){
             projectApproval.setCompanyId(companyId);
             projectApproval.setCreateDate(LocalDate.now());

+ 32 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -123,6 +123,8 @@ public class TaskController {
 
     @Resource
     private DepartmentMapper departmentMapper;
+    @Autowired
+    private TaskFilesMapper taskFilesMapper;
 
     @PostMapping("/getTaskChargePage")
     public HttpRespMsg getTaskChargePage(
@@ -150,7 +152,7 @@ public class TaskController {
      * @return
      */
     @PostMapping("/auditFile")
-    public HttpRespMsg auditFile(@RequestParam("taskId")String taskId
+    public HttpRespMsg auditFile(@RequestParam("taskId")Integer taskId
             ,@RequestParam("projectId")String projectId
             ,@RequestParam("auditStatus")Integer auditStatus
             ,@RequestParam(value = "reason",required = false)String reason
@@ -327,6 +329,15 @@ public class TaskController {
                 needRecalculateProgress = true;
             }
         } else {
+            task.setChargeOneId(null);
+            task.setChargeStage(null);
+            task.setChargeOneStatus(null);
+            task.setChargeOneTime(null);
+            task.setChargeTwoId(null);
+            task.setChargeTwoStatus(null);
+            task.setChargeTwoTime(null);
+            task.setFinalChargeStatus(null);
+            task.setFileRejectReason(null);
             //更新的情况,需要对比是否修改了任务标题,更新子任务的parentTname
             Task oldTask = taskService.getById(task.getId());
             if (!oldTask.getName().equals(task.getName())) {
@@ -1312,10 +1323,16 @@ public class TaskController {
         if(dateType!=null){
             switch (dateType){
                 case 0:
-                    queryWrapper.ge("start_date",startDate).le("start_date",endDate);
+                    if(null != startDate && null != endDate){
+                        queryWrapper.ge("start_date",startDate).le("start_date",endDate);
+                    }
+
                     break;
                 case 1:
-                    queryWrapper.ge("task.end_date",startDate).le("task.end_date",endDate);
+                    if(null != startDate && null != endDate){
+                        queryWrapper.ge("task.end_date",startDate).le("task.end_date",endDate);
+                    }
+
                     break;
             }
         }
@@ -1348,6 +1365,7 @@ public class TaskController {
         List<Integer> collect = list.stream().map(l -> l.getId()).distinct().collect(Collectors.toList());
         collect.add(-1);
         List<TaskExecutor> taskExecutorList = taskExecutorMapper.selectList(new QueryWrapper<TaskExecutor>().in("task_id", collect));
+        List<TaskFiles> taskFilesList = taskFilesMapper.selectList(new LambdaQueryWrapper<TaskFiles>().in(TaskFiles::getTaskId, collect));
         List<Integer> pids = list.stream().map(Task::getProjectId).collect(Collectors.toList());
         pids.add(-1);
         List<Project> projectList = projectService.list(new QueryWrapper<Project>().in("id", pids));
@@ -1370,12 +1388,21 @@ public class TaskController {
                 );
                 userIdNameMap = users.stream().collect(Collectors.toMap(User::getId, User::getName));
             }
+            Map<Integer, List<TaskFiles>> taskFilesMap = new HashMap<>();
+            if(CollectionUtils.isNotEmpty(taskFilesList)){
+                taskFilesMap  = taskFilesList.stream().collect(Collectors.groupingBy(TaskFiles::getTaskId));
+            }
             for (Task task : list) {
+                List<TaskFiles> tmp = taskFilesMap.get(task.getId());
+                if(CollectionUtils.isEmpty(tmp)){
+                    continue;
+                }
                 if(org.apache.commons.lang3.StringUtils.isBlank(task.getChargeOneId()) || org.apache.commons.lang3.StringUtils.isBlank(task.getChargeTwoId())){
                     continue;
                 }
                 if(1 == task.getFinalChargeStatus()){
                     task.setFinalChargeStatusText("审核通过");
+                    task.setFileChargeStatus(1);
                 } else if (0 == task.getFinalChargeStatus()) {
                     String name = "";
                     String statusText = "";
@@ -1384,9 +1411,9 @@ public class TaskController {
                     name = userIdNameMap.getOrDefault(tmpUserId,"");
                     switch (finalStatus)
                     {
-                        case 0:  statusText = "待审核";break;
+                        case 0:  statusText = "待审核"; task.setFileChargeStatus(0);break;
                         case 1:  statusText = "通过";break;
-                        case 2:  statusText = "驳回";break;
+                        case 2:  statusText = "驳回"; task.setFileChargeStatus(2);break;
                     }
                     task.setFinalChargeStatusText(statusText+"("+name+")");
                 }

+ 56 - 23
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskFilesController.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.management.platform.entity.*;
 import com.management.platform.mapper.*;
+import com.management.platform.service.CompanyDingdingService;
 import com.management.platform.service.ProjectDocumentService;
 import com.management.platform.service.WxCorpInfoService;
 import com.management.platform.task.SFTPAsyncUploader;
@@ -13,6 +14,7 @@ import com.management.platform.util.DocumentTypeUtil;
 import com.management.platform.util.FileUtil;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.util.StringUtils;
@@ -27,7 +29,6 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.IOException;
 import java.time.LocalDateTime;
-import java.util.HashMap;
 import java.util.List;
 import java.util.UUID;
 
@@ -71,6 +72,9 @@ public class TaskFilesController {
     @Resource
     private WxCorpInfoMapper wxCorpInfoMapper;
 
+    @Resource
+    private CompanyDingdingService companyDingdingService;
+
     /**
      * 获取该项目下的所有有效的文件列表
      * @param keyword
@@ -273,7 +277,13 @@ public class TaskFilesController {
 
     @RequestMapping(value="delete")
     public HttpRespMsg delFile(@RequestParam Integer id,HttpServletRequest request) {
+        HttpRespMsg msg = new HttpRespMsg();
         TaskFiles taskFiles = taskFilesMapper.selectById(id);
+        User user = userMapper.selectById(request.getHeader("Token"));
+        if(!taskFiles.getCreatorId().equals(user.getId())){
+            msg.setError("您非文件上传人,无法删除");
+            return msg;
+        }
         if (taskFiles.getDocumentId() == null) {
             //仅当前任务上传的,需要把文件删掉
             File dir = new File(uploadPath);
@@ -285,7 +295,7 @@ public class TaskFilesController {
         taskFilesMapper.deleteById(id);
 
         //判断文件阶段做回退处理
-        User user = userMapper.selectById(request.getHeader("Token"));
+
         TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
         if(1 == timeType.getTaskFileCharge()){
             this.resetTaskChargeStatus(taskFiles.getTaskId());
@@ -312,7 +322,7 @@ public class TaskFilesController {
 //            wxCorpInfoService.sendWXCorpMsg(info,tmpUser.getCorpwxUserid(),content+",请及时审核",null, WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_FILE_UPDATE);
 //        }
 
-        HttpRespMsg msg = new HttpRespMsg();
+
         msg.data=MessageUtils.message("file.deleteSuc");
         return msg;
     }
@@ -341,35 +351,58 @@ public class TaskFilesController {
     public HttpRespMsg getTaskFiles(Integer taskId,HttpServletRequest request) {
         User user = userMapper.selectById(request.getHeader("Token"));
         Task task = taskMapper.selectById(taskId);
-        HashMap<String,Object> map = new HashMap<>();
         TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
+        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",user.getCompanyId()));
+        CompanyDingding dingding = companyDingdingService.getOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, user.getCompanyId()));
+        String fileChargeStatusText = "";
+        int fileChargeStatus = 0;
         if(1 == timeType.getTaskFileCharge()){
-            if(1 == task.getFinalChargeStatus()){
-                map.put("fileChargeStatusText","审核通过");
-            } else if (0 == task.getFinalChargeStatus()) {
-                String name = "";
-                String statusText = "";
-                int finalStatus = 1==task.getChargeStage()?task.getChargeOneStatus():task.getChargeTwoStatus();
-                String userId = 1==task.getChargeStage()?task.getChargeOneId():task.getChargeTwoId();
-                User chargeUser = userMapper.selectById(userId);
-                if(null != chargeUser){
-                    name = chargeUser.getName();
-                }
-                switch (finalStatus)
-                {
-                    case 0:  statusText = "待审核";break;
-                    case 1:  statusText = "通过";break;
-                    case 2:  statusText = "驳回";break;
+            if(org.apache.commons.lang3.StringUtils.isNotBlank(task.getChargeOneId())
+                    &&org.apache.commons.lang3.StringUtils.isNotBlank(task.getChargeTwoId())){
+                if(1 == task.getFinalChargeStatus()){
+                    fileChargeStatusText = "审核通过";
+                    fileChargeStatus = 1;
+                } else if (0 == task.getFinalChargeStatus()) {
+                    String name = "";
+                    String statusText = "";
+                    String userWxId = "";
+                    int finalStatus = 1==task.getChargeStage()?task.getChargeOneStatus():task.getChargeTwoStatus();
+                    String userId = 1==task.getChargeStage()?task.getChargeOneId():task.getChargeTwoId();
+                    User chargeUser = userMapper.selectById(userId);
+                    if(null != chargeUser){
+                        if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                            userWxId = chargeUser.getCorpwxRealUserid();
+                        }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
+                            userWxId = chargeUser.getDingdingUserid();
+                        }
+                        name = chargeUser.getName();
+                    }
+                    switch (finalStatus)
+                    {
+                        case 0:  statusText = "待审核";fileChargeStatus = 0;break;
+                        case 1:  statusText = "通过";break;
+                        case 2:  statusText = "驳回";fileChargeStatus = 2;break;
+                    }
+                    if(org.apache.commons.lang3.StringUtils.isBlank(userWxId)){
+                        fileChargeStatusText = statusText+"("+name+")";
+                    }else{
+                        fileChargeStatusText = statusText+"("+("$userName=" + userWxId + "$")+")";
+                    }
+
                 }
-                map.put("fileChargeStatusText",statusText+"("+name+")");
             }
         }
         List<TaskFiles> list = taskFilesMapper.selectList(new LambdaQueryWrapper<TaskFiles>()
                 .eq(TaskFiles::getTaskId,taskId)
         );
-        map.put("fileList",list);
+        if(CollectionUtils.isNotEmpty(list)){
+            for (TaskFiles taskFiles : list) {
+                taskFiles.setFileChargeStatusText(fileChargeStatusText);
+                taskFiles.setFileChargeStatus(fileChargeStatus);
+            }
+        }
         HttpRespMsg msg = new HttpRespMsg();
-        msg.data = map;
+        msg.data = list;
         return msg;
     }
 

+ 3 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ProjectApproval.java

@@ -277,6 +277,9 @@ public class ProjectApproval extends Model<ProjectApproval> {
     @TableField(exist = false)
     private Boolean isCheckedUser;
 
+    @TableField(exist = false)
+    private String auditStr;
+
 
     @Override
     protected Serializable pkVal() {

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

@@ -243,7 +243,7 @@ public class Task extends Model<Task> {
     @TableField("sap_task_code")
     private String sapTaskCode;
 
-    /**文件审核人一id*/
+    /**文件审核人一[部门负责人]id*/
     @TableField("charge_one_id")
     private String chargeOneId;
 
@@ -262,7 +262,7 @@ public class Task extends Model<Task> {
 //    @TableField("charge_one_reason")
 //    private String chargeOneReason;
 
-    /**文件审核人二id*/
+    /**文件审核人二[项目审核人]id*/
     @TableField("charge_two_id")
     private String chargeTwoId;
 
@@ -300,6 +300,9 @@ public class Task extends Model<Task> {
     @TableField(exist = false)
     private List<User> userList;
 
+    @TableField(exist = false)
+    /**0 待审核 1通过 2驳回*/
+    private int fileChargeStatus;
     @Override
     protected Serializable pkVal() {
         return this.id;

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

@@ -4,12 +4,14 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
-import java.time.LocalDateTime;
+import java.util.Date;
 
 /**
  * <p>
@@ -45,7 +47,9 @@ public class TaskFiles extends Model<TaskFiles> {
     private String url;
 
     @TableField("indate")
-    private LocalDateTime indate;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date indate;
 
     @TableField("size")
     private String size;
@@ -71,6 +75,13 @@ public class TaskFiles extends Model<TaskFiles> {
     @TableField("document_id")
     private Integer documentId;
 
+    @TableField(exist = false)
+    private String fileChargeStatusText;
+
+    /**0 待审核 1通过 2驳回*/
+    @TableField(exist = false)
+    private Integer fileChargeStatus;
+
 
     @Override
     protected Serializable pkVal() {

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/bo/QueryTaskChargePage.java

@@ -6,7 +6,8 @@ import lombok.Data;
 public class QueryTaskChargePage {
     private Integer deptId;
     private Integer projectId;
-    private Integer taskId;
+//    private Integer taskId;
+    private String taskName;
     private Integer pageIndex = 1;
     private Integer pageSize;
     private String userId;

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/TaskChargePageVO.java

@@ -11,7 +11,7 @@ public class TaskChargePageVO {
     private String taskName;
     private Integer projectId;
     private String projectName;
-    private String creatorId;
+    private String createrId;
     private Integer chargeStage;
     private String chargeOneId;
     private Integer chargeOneStatus;
@@ -21,4 +21,6 @@ public class TaskChargePageVO {
     private String finalChargeName;
     private String executorId;
     private List<TaskExecutor> executorList;
+    private int fileChargeStatus;
+    private Integer groupId;
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/TaskService.java

@@ -55,7 +55,7 @@ public interface TaskService extends IService<Task> {
 
     HttpRespMsg getTaskByUserId(String startDate, String endDate, String userId, Integer pageIndex, Integer pageSize);
 
-    HttpRespMsg auditFile(String taskId, String projectId, Integer auditStatus, String reason, HttpServletRequest request);
+    HttpRespMsg auditFile(Integer taskId, String projectId, Integer auditStatus, String reason, HttpServletRequest request);
 
     HttpRespMsg getFileRejectReason(String taskId, HttpServletRequest request);
 

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectApprovalServiceImpl.java

@@ -171,6 +171,8 @@ public class ProjectApprovalServiceImpl extends ServiceImpl<ProjectApprovalMappe
                 }else {
                     r.setIsFirstCheckUser(false);
                 }
+                Optional<User> userOptional = userList.stream().filter(u -> u.getId().equals(first1.get().getUserId())).findFirst();
+                userOptional.ifPresent(value -> r.setAuditStr(value.getName()));
             }else r.setIsFirstCheckUser(false);
 
             if (first2.isPresent()){

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

@@ -36,6 +36,7 @@ import java.io.*;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -96,6 +97,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
     @Resource
     private TaskExecutorMapper taskExecutorMapper;
 
+    @Resource
+    private TaskCommentMapper taskCommentMapper;
+
     @Override
     public HttpRespMsg getExecutorPanel(Integer projectId) {
         HttpRespMsg msg = new HttpRespMsg();
@@ -779,7 +783,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
 
     @Override
     @Transactional
-    public HttpRespMsg auditFile(String taskId, String projectId, Integer auditStatus, String reason, HttpServletRequest request) {
+    public HttpRespMsg auditFile(Integer taskId, String projectId, Integer auditStatus, String reason, HttpServletRequest request) {
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("Token"));
         //获取该任务的文件审核阶段
@@ -803,6 +807,17 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                         .eq(Task::getId,taskId)
                 );
             }
+            //添加动态消息
+            String content = user.getName()+"审核通过了任务:"+task.getName();
+            TaskComment comment =  new TaskComment();
+            comment.setTaskId(taskId);
+            comment.setUserId(user.getId());
+            comment.setContent(content);
+            comment.setCreateTime(LocalDateTime.now());
+            comment.setUserColor(user.getColor());
+            comment.setUserName(user.getName());
+            taskCommentMapper.insert(comment);
+
         } else if (2 == auditStatus) {
             //驳回
             WxCorpInfo info = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
@@ -842,7 +857,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     }
                 }
             }
-
+            String content = user.getName()+"审核驳回了任务:"+task.getName();
+            TaskComment comment =  new TaskComment();
+            comment.setTaskId(taskId);
+            comment.setUserId(user.getId());
+            comment.setContent(content);
+            comment.setCreateTime(LocalDateTime.now());
+            comment.setUserColor(user.getColor());
+            comment.setUserName(user.getName());
+            taskCommentMapper.insert(comment);
         }
 
         return msg;
@@ -881,6 +904,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         }
 
         List<TaskChargePageVO> taskChargePage = taskMapper.getTaskChargePage(queryBO, branchDepartment);
+        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",user.getCompanyId()));
+        CompanyDingding dingding = companyDingdingService.getOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, user.getCompanyId()));
+        List<User> users = userMapper.selectList(new QueryWrapper<User>().eq("company_id",user.getCompanyId()));
+        Map<String, User> companyUserMap = users.stream().collect(Collectors.toMap(User::getId, t -> t));
+
         if(CollectionUtils.isNotEmpty(taskChargePage)){
             List<Integer> collect = taskChargePage.stream()
                     .map(TaskChargePageVO::getTaskId).distinct().collect(Collectors.toList());
@@ -891,6 +919,18 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 List<TaskExecutor> executorList = taskExecutorList.stream()
                         .filter(te -> te.getTaskId().equals(t.getTaskId())&&te.getExecutorId()!=null).collect(Collectors.toList());
                 t.setExecutorList(executorList);
+                String userWxId = "";
+                User tmpUser = companyUserMap.get(t.getFinalChargeId());
+                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                    userWxId = tmpUser.getCorpwxRealUserid();
+                }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
+                    userWxId = tmpUser.getDingdingUserid();
+                }
+                if(StringUtils.isNotBlank(userWxId)){
+                    t.setFinalChargeName("$userName=" + userWxId + "$");
+                }
+                int finalStatus = 1==t.getChargeStage()?t.getChargeOneStatus():t.getChargeTwoStatus();
+                t.setFileChargeStatus(finalStatus);
             });
         }
 

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml

@@ -15,7 +15,7 @@ spring:
       location: C:/upload/
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://47.101.180.183:17089/man_hour_manager?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
+    url: jdbc:mysql://47.101.180.183:17089/man_dev?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
     username: root
     password: P011430@Huoshi*
     hikari:

+ 24 - 24
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml

@@ -413,8 +413,8 @@
         select tmp1.*,user.name as finalChargeName
         from
             (
-                select tf.task_id,tf.creator_id,task.name as taskName,task.charge_stage
-                     ,task.charge_one_id,task.charge_one_status,task.executor_id
+                select tf.task_id,task.creater_id,task.name as taskName,task.charge_stage
+                     ,task.charge_one_id,task.charge_one_status,task.executor_id,task.group_id
                      ,task.charge_two_id,task.charge_two_status,p.id as projectId,p.project_name,
                     case task.charge_stage
                         when 1 then task.charge_one_id
@@ -427,14 +427,14 @@
                 <where>
                     task.task_status = 0 and task.final_charge_status = 0
                     and case task.charge_stage
-                    when 1 then p.incharger_id = task.charge_one_id
-                    when 2 then p.incharger_id = task.charge_two_id
+                    when 1 then (p.incharger_id = task.charge_one_id and task.charge_one_status != 2)
+                    when 2 then (p.incharger_id = task.charge_two_id and task.charge_two_status != 2)
                     end
                     <if test="queryBO.projectId != null">
                         and tf.project_id = #{queryBO.projectId}
                     </if>
-                    <if test="queryBO.taskId != null">
-                        and tf.task_id = #{queryBO.taskId}
+                    <if test="queryBO.taskName != null and queryBO.taskName != ''">
+                        and task.name like concat('%',#{queryBO.taskName},'%')
                     </if>
                     <if test="deptIds!=null and deptIds.size()>0">
                         and p.dept_id in
@@ -451,8 +451,8 @@
         select tmp1.*,user.name as finalChargeName
         from
             (
-                select tf.task_id,tf.creator_id,task.name as taskName,task.charge_stage
-                     ,task.charge_one_id,task.charge_one_status,task.executor_id
+                select tf.task_id,task.creater_id,task.name as taskName,task.charge_stage
+                     ,task.charge_one_id,task.charge_one_status,task.executor_id,task.group_id
                      ,task.charge_two_id,task.charge_two_status,project.id as projectId,project.project_name,
                     case task.charge_stage
                         when 1 then task.charge_one_id
@@ -462,19 +462,19 @@
                     task_files tf
                         left join task on tf.task_id = task.id
                         left join project on task.project_id = project.id
-                        left join user on tf.creator_id = user.id
+                        left join user on task.creater_id = user.id
                         left join department d on user.department_id = d.department_id
                 <where>
                     task.task_status = 0 and task.final_charge_status = 0
                     and case task.charge_stage
-                    when 1 then d.manager_id = task.charge_one_id
-                    when 2 then d.manager_id = task.charge_two_id
+                    when 1 then (d.manager_id = task.charge_one_id and task.charge_one_status != 2)
+                    when 2 then (d.manager_id = task.charge_two_id and task.charge_two_status != 2)
                     end
                     <if test="queryBO.projectId != null">
                         and tf.project_id = #{queryBO.projectId}
                     </if>
-                    <if test="queryBO.taskId != null">
-                        and tf.task_id = #{queryBO.taskId}
+                    <if test="queryBO.taskName != null and queryBO.taskName != ''">
+                        and task.name like concat('%',#{queryBO.taskName},'%')
                     </if>
                     <if test="deptIds!=null and deptIds.size()>0">
                         and project.dept_id in
@@ -498,7 +498,7 @@
         select tmp1.*,user.name as finalChargeName
         from
         (
-        select tf.task_id,tf.creator_id,task.name,task.charge_stage
+        select tf.task_id,task.creater_id,task.name,task.charge_stage
         ,task.charge_one_id,task.charge_one_status,task.executor_id
         ,task.charge_two_id,task.charge_two_status,p.id,p.project_name,
         case task.charge_stage
@@ -512,14 +512,14 @@
         <where>
             task.task_status = 0 and task.final_charge_status = 0
             and case task.charge_stage
-            when 1 then p.incharger_id = task.charge_one_id
-            when 2 then p.incharger_id = task.charge_two_id
+            when 1 then (p.incharger_id = task.charge_one_id and task.charge_one_status != 2)
+            when 2 then (p.incharger_id = task.charge_two_id and task.charge_two_status != 2)
             end
             <if test="queryBO.projectId != null">
                 and tf.project_id = #{queryBO.projectId}
             </if>
-            <if test="queryBO.taskId != null">
-                and tf.task_id = #{queryBO.taskId}
+            <if test="queryBO.taskName != null and queryBO.taskName != ''">
+                and task.task_name like concat('%',#{queryBO.taskName},'%')
             </if>
             <if test="deptIds!=null and deptIds.size()>0">
                 and p.dept_id in
@@ -536,7 +536,7 @@
         select tmp1.*,user.name as finalChargeName
         from
         (
-        select tf.task_id,tf.creator_id,task.name,task.charge_stage
+        select tf.task_id,task.creater_id,task.name,task.charge_stage
         ,task.charge_one_id,task.charge_one_status,task.executor_id
         ,task.charge_two_id,task.charge_two_status,project.id,project.project_name,
         case task.charge_stage
@@ -547,19 +547,19 @@
         task_files tf
         left join task on tf.task_id = task.id
         left join project on task.project_id = project.id
-        left join user on tf.creator_id = user.id
+        left join user on task.creater_id = user.id
         left join department d on user.department_id = d.department_id
         <where>
             task.task_status = 0 and task.final_charge_status = 0
             and case task.charge_stage
-            when 1 then d.manager_id = task.charge_one_id
-            when 2 then d.manager_id = task.charge_two_id
+            when 1 then (d.manager_id = task.charge_one_id and task.charge_one_status != 2)
+            when 2 then (d.manager_id = task.charge_two_id and task.charge_two_status != 2)
             end
             <if test="queryBO.projectId != null">
                 and tf.project_id = #{queryBO.projectId}
             </if>
-            <if test="queryBO.taskId != null">
-                and tf.task_id = #{queryBO.taskId}
+            <if test="queryBO.taskName != null and queryBO.taskName != ''">
+                and task.task_name like concat('%',#{queryBO.taskName},'%')
             </if>
             <if test="deptIds!=null and deptIds.size()>0">
                 and project.dept_id in

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/components/taskComponent.vue

@@ -363,7 +363,7 @@
                 </el-table-column>
                 <el-table-column :label="$t('creationtime')" prop="indate" min-width="140" align="center">
                     <template slot-scope="scope">
-                        <span>{{scope.row.indate[0] + '-' + scope.row.indate[1] + '-' + scope.row.indate[2] + '\u0020\u0020' + scope.row.indate[3] + ':' + scope.row.indate[4] + ':' + scope.row.indate[5]}}</span>
+                        <span>{{scope.row.indate}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column :label="$t('operation')" min-width="90" fixed="right">

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

@@ -693,6 +693,7 @@
   "find": "查找",
   "ticketnumber": "票据编号",
   "dismissreason": "驳回原因",
+  "auditStr": "待审核人",
   "cha-kan": "查看",
   "detailsofReimbursementvoucher": "报销凭证详情",
   "nodocuments": "暂无单据",

+ 6 - 1
fhKeeper/formulahousekeeper/timesheet/src/permissions.js

@@ -152,7 +152,10 @@ const StringUtil = {
 
         // 设备管理
         equipmentInformationManagement: false,
-        equipmentCostManagement: false
+        equipmentCostManagement: false,
+
+        // 任务
+        tasksReviewTaskFile: false
         
     }
     // console.log(arr);
@@ -291,6 +294,8 @@ const StringUtil = {
         arr[i] == '设备信息管理' ? obj.equipmentInformationManagement = true : ''
         arr[i] == '设备成本管理' ? obj.equipmentCostManagement = true : ''
         arr[i] == '奖金明细' ? obj.financialBonusDetails = true : ''
+
+        arr[i] == '审核任务文件' ? obj.tasksReviewTaskFile = true : ''
     }
     return obj
   }

+ 26 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/projectApproval/projectApproval.vue

@@ -88,9 +88,10 @@
                             </template>
                         </el-table-column>
                         <el-table-column prop="rejectInfo" :label="$t('dismissreason')" min-width="250" ></el-table-column>
+                        <el-table-column prop="auditStr" :label="$t('auditStr')" min-width="100" ></el-table-column>
                         <el-table-column :label="$t('operation')" :width="300" align="left" fixed="right">
                             <template slot-scope="scope">
-                                <el-button size="mini" type="primary" v-if="(permissions.projectApprovalEdit||permissions.projectApprovalCheck)&&scope.row.status!=1" :disabled="scope.row.status!==-1&& scope.row.status!==2 "  @click="handleAdd(scope.$index, scope.row)">{{'编辑'}}</el-button>
+                                <el-button size="mini" type="primary" v-if="(permissions.projectApprovalEdit||permissions.projectApprovalCheck)&&scope.row.status!=1" :disabled="(scope.row.status!==-1&& scope.row.status!==2) || user.id!== scope.row.creatorId"    @click="handleAdd(scope.$index, scope.row)">{{'编辑'}}</el-button>
                                 <el-button size="mini" type="success" v-if="(permissions.projectApprovalEdit||permissions.projectApprovalCheck) && scope.row.status==0" :disabled="!scope.row.isFirstCheckUser"  @click="check(scope.row,1)" >{{'通过'}}</el-button>
                                 <el-button size="mini" v-if="(permissions.projectApprovalEdit||permissions.projectApprovalCheck) && scope.row.status==0" :disabled="!scope.row.isFirstCheckUser"  @click="showDenyDialog(scope.row,2)">{{'驳回'}}</el-button>
                                 <!-- <el-button size="mini" v-if="(permissions.projectApprovalEdit ||permissions.projectApprovalCheck) && scope.row.status==-1" @click="check(scope.row,3)">{{'撤销'}}</el-button> -->
@@ -274,7 +275,7 @@
                         <div slot="footer" class="dialog-footer;">
                             <el-button @click.native="deletePro(1, addForm)" v-if="(permissions.projectApprovalEdit) && addForm.id" style="float:left">{{ $t('btn.delete') }}</el-button>
                             <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
-                            <el-button type="primary" :disabled="addForm.status != -1" @click="tempSave" :loading="addLoading">{{ $t('btn.temporaryStorage') }}</el-button>
+                            <el-button type="primary" :disabled="addForm.status != -1 && addForm.status != 2 " @click="tempSave" :loading="addLoading">{{ $t('btn.temporaryStorage') }}</el-button>
                             <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
                         </div>
                     </el-dialog>
@@ -599,6 +600,17 @@ methods: {
     submitInsert() {
         this.$refs.form1.validate(valid => {
             if (valid) {
+                // 在提交前检查审核人
+                for (let i = 0; i < this.pointList.length; i++) {
+                    // 在提交前检查审核人
+                    if (this.pointList[i].userId === "") {
+                        this.$message({
+                            message: "审核人不能为空", // 提示信息
+                            type: "warning" // 提示类型
+                        });
+                        return; // 终止后续操作
+                    }
+                }
                 this.addLoading = true;
                 let targetData = {};
                 targetData.projectName= this.addForm.name
@@ -710,6 +722,18 @@ methods: {
     tempSave() {
         this.$refs.form1.validate(valid => {
             if (valid) {
+                // 在提交前检查审核人
+                for (let i = 0; i < this.pointList.length; i++) {
+                    // 在提交前检查审核人
+                    if (this.pointList[i].userId === "") {
+                        this.$message({
+                            message: "审核人不能为空", // 提示信息
+                            type: "warning" // 提示类型
+                        });
+                        return; // 终止后续操作
+                    }
+                }
+
                 this.addLoading = true;
                 let targetData = {};
                 targetData.projectName= this.addForm.name

+ 9 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -96,8 +96,8 @@
                     </div>
                 </el-form-item>
                 <el-form-item style="float: right;" v-if="user.companyId != '3092'">
-                     <el-link type="primary" icon="el-icon-circle-plus-outline" :underline="false" @click="addTask()">{{ $t('xinJianRenWu') }}</el-link>
-                     <el-link type="primary" :underline="false" @click="exportTaskList()" style="margin-left: 20px;" v-loading="exportTaskLoading">{{ $t('export.export') }}</el-link>
+                     <el-link type="primary" icon="el-icon-circle-plus-outline" :underline="false" @click="addTask()" v-if="idx != 3">{{ $t('xinJianRenWu') }}</el-link>
+                     <el-link type="primary" :underline="false" @click="exportTaskList()" style="margin-left: 20px;" v-loading="exportTaskLoading" v-if="idx != 3">{{ $t('export.export') }}</el-link>
                 </el-form-item>
             </el-form>
         </el-col>
@@ -107,7 +107,7 @@
                     <p :class="idx == 0 ? 'on' : ''" @click="switchs(0)" v-if="permissions.projectView || permissions.projectManagement || permissions.projectViewAllTasks">{{ $t('alltaskss') }}</p>
                     <p :class="idx == 1 ? 'on' : ''" @click="switchs(1)">{{ $t('perform') }}</p>
                     <p :class="idx == 2 ? 'on' : ''" @click="switchs(2)">{{ $t('created') }}</p>
-                    <p :class="idx == 3 ? 'on' : ''" @click="switchs(3)" v-if="user.timeType.taskFileCharge == 1">待审核文件</p>
+                    <p :class="idx == 3 ? 'on' : ''" @click="switchs(3)" v-if="user.timeType.taskFileCharge == 1 && permissions.tasksReviewTaskFile">待审核文件</p>
                 </div>
             </div>
             <div style="max-width: 94%;min-width: 90%">
@@ -156,9 +156,9 @@
                             </div>
                         </template>
                     </el-table-column>
-                    <el-table-column prop="finalChargeStatusText" label="文件审核状态" width="210" sortable v-if="user.timeType.taskFileCharge == 1 && [0, 2].includes(idx)">
+                    <el-table-column prop="finalChargeStatusText" label="文件审核状态" width="210" sortable v-if="user.timeType.taskFileCharge == 1 && [0, 1, 2].includes(idx)">
                         <template slot-scope="scope">
-                            <template v-if="scope.row.finalChargeStatus != 2">
+                            <template v-if="scope.row.fileChargeStatus != 2">
                                 <el-link :type="{'0': 'warning', '1': 'info', '2': 'danger'}[scope.row.fileChargeStatus]" :underline="false">
                                     {{ scope.row.finalChargeStatusTextList[0] || '' }}
                                     <template v-if="(scope.row.finalChargeStatusTextList || []).length > 1">
@@ -387,7 +387,7 @@
 
         <!-- 文件审核 -->
         <el-dialog title="文件审核" :visible.sync="viewFilesAndReviewThemVisable" width="800px">
-            <el-table :data="viewFilesAndReviewThemRejectList" style="width: 100%" height="500px">
+            <el-table :data="viewFilesAndReviewThemRejectList" style="width: 100%" height="500px" :key="viewFilesAndReviewThemkey">
                 <el-table-column :label="$t('headerTop.serialNumber')" prop="documentType" min-width="60" align="center">
                     <template slot-scope="scope">
                         {{scope.$index + 1}}
@@ -407,7 +407,7 @@
                 </el-table-column>
                 <el-table-column :label="$t('creationtime')" prop="indate" min-width="140" align="center">
                     <template slot-scope="scope">
-                        <span>{{scope.row.indate[0] + '-' + scope.row.indate[1] + '-' + scope.row.indate[2] + '\u0020\u0020' + scope.row.indate[3] + ':' + scope.row.indate[4] + ':' + scope.row.indate[5]}}</span>
+                        <span>{{scope.row.indate}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column :label="$t('operation')" min-width="90" fixed="right">
@@ -793,6 +793,7 @@ import { error } from 'dingtalk-jsapi';
                 viewFilesAndReviewThemRejectValLoading: false,
                 viewFilesAndReviewThemRejectRow: {},
                 viewFilesAndReviewThemAdoptLoading: false,
+                viewFilesAndReviewThemkey: 902,
 
                 tablesKey: 1,
                 tablesTwoKey: 300
@@ -862,6 +863,7 @@ import { error } from 'dingtalk-jsapi';
                 this.http.post('/task-files/getTaskFiles',{taskId:this.viewFilesAndReviewThemRejectRow.id},
                 res => {
                     if (res.code == "ok") {
+                        this.viewFilesAndReviewThemkey++
                         this.viewFilesAndReviewThemRejectList = res.data || []
                     } else {
                         this.$message({