소스 검색

开放智能填报
清除无用代码

QuYueTing 1 개월 전
부모
커밋
4145212633

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform-mld/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -4813,6 +4813,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 List<Integer> allMainManagedDeptIdList = departmentService.getAllMainManagedDeptIdList(user, departmentList);
                 List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("department_id", allMainManagedDeptIdList));
                 userIds = userList.stream().map(User::getId).collect(Collectors.toList());
+                System.out.println("管理部门的员工="+userIds.size());
             }
             //检查是否是项目负责人
             List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("incharger_id", user.getId()));

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

@@ -1682,7 +1682,7 @@ public class ReportController {
             for (Report report : reportList) {
                 report.setDepartmentAuditState(0);
                 //优先按照当前日报填写人的直属审核人审核
-                if (!report.getIsAssist() && !StringUtils.isEmpty(reportOwner.getSuperiorId())) {
+                if ((report.getIsAssist() == null || !report.getIsAssist()) && !StringUtils.isEmpty(reportOwner.getSuperiorId())) {
                     User auditor = tempAuditorUserList.stream().filter(t -> t.getId().equals(reportOwner.getSuperiorId())).findFirst().get();
                     report.setProjectAuditorId(auditor.getId());
                     report.setProjectAuditState(0);

+ 6 - 156
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -226,24 +226,6 @@ public class TaskController {
                     task.setTaskPlan(1);
                 }
             }
-//            TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
-//            Integer taskFileCharge = timeType.getTaskFileCharge();
-//            if(1 == taskFileCharge){
-//                //主管: 员工所在部门[department]的manager_id 阶段一
-//                //项目经理:project表的in_charge_id 阶段二
-//                Department department = departmentMapper.selectById(user.getDepartmentId());
-//                Project project = projectMapper.selectById(task.getProjectId());
-//                if(org.apache.commons.lang3.StringUtils.isBlank(department.getManagerId())){
-//                    msg.setError("员工所在部门无负责人,请重新设置");
-//                    return msg;
-//                }
-//                if(org.apache.commons.lang3.StringUtils.isBlank(project.getInchargerId())){
-//                    msg.setError("该项目未设置项目经理,请重新设置");
-//                    return msg;
-//                }
-//                task.setChargeOneId(department.getManagerId());
-//                task.setChargeTwoId(project.getInchargerId());
-//            }
         }
         if (!StringUtils.isEmpty(executorListStr)) {
             List<User> allUsers = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
@@ -380,15 +362,6 @@ 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())) {
@@ -478,136 +451,9 @@ public class TaskController {
             if ((oldTask.getTaskType() == 1 && task.getTaskType() != 1) || (oldTask.getTaskType() != 1 && task.getTaskType() == 1)) {
                 needRecalculateProgress = true;
             }
-            // 未驳回之前 第一审核人 修改工作计划
-            if (user.getCompanyId()==Constant.MLD_COMPANY_ID
-                    &&task.getIsTaskPlan()==1
-                    && org.apache.commons.lang3.StringUtils.isNotEmpty(task.getCheckFirstId())
-                    &&task.getCheckFirstId().equals(userId)
-                    &&task.getTaskStatus()==3){
-                isUpdate=1;
-                task.setTaskStatus(4);//待第二审核人审核
-            } else if (user.getCompanyId() == Constant.MLD_COMPANY_ID
-                    && task.getIsTaskPlan() == 1
-                    && org.apache.commons.lang3.StringUtils.isNotEmpty(task.getCheckSecondId())
-                    && task.getCheckSecondId().equals(userId)
-                    &&task.getTaskStatus()==4) {
-                isUpdate=2;
-                task.setTaskStatus(0);//变化为进行中
-                task.setIsTaskPlan(0);//不再是计划
-            }
-            // 驳回后,小组长对计划进行修改
-            if (user.getCompanyId()==Constant.MLD_COMPANY_ID
-                    &&task.getIsTaskPlan()==1
-                    &&(task.getTaskStatus()==5||task.getTaskStatus()==6)
-                    &&(!userId.equals(task.getCheckFirstId())&&!userId.equals(task.getCheckSecondId()))
-                    ){
-                isUpdate=3;
-                task.setTaskStatus(3);//待第一审核人审核
-            }
-            // 撤回后,对计划进行修改
-            if (user.getCompanyId()==Constant.MLD_COMPANY_ID
-                    &&task.getIsTaskPlan()==1
-                    &&(task.getTaskStatus()==2)
-            ){
-                if (user.getId().equals(task.getCheckFirstId())){
-                    task.setTaskStatus(4);//待第二审核人审核
-                    isUpdate=5;
-                } else if (user.getId().equals(task.getCheckSecondId())) {
-                    task.setTaskStatus(0);//变化为进行中
-                    task.setIsTaskPlan(0);//不再是计划
-                    isUpdate=6;
-                }else {
-                    task.setTaskStatus(3);//待第一审核人审核
-                    isUpdate=4;
-                }
-            }
-        }
-        if (Constant.MLD_COMPANY_ID==user.getCompanyId()&&task.getIsTaskPlan()==1) {
-            if (task.getCheckSecondId() != null && !task.getExecutorList().isEmpty()) {
-                System.out.println("===>"+task.getExecutorList());
-                List<User> userManagers = userMapper.selectList(new QueryWrapper<User>()
-                        .eq("role_name", "区域经理&PM").eq("company_id",user.getCompanyId()));
-                for (TaskExecutor taskExecutor : task.getExecutorList()) {
-                    boolean b = userManagers.stream().anyMatch(u -> u.getId().equals(taskExecutor.getExecutorId()));
-                    if (b) {
-                        msg.setError("工作计划执行人不能选择区域经理");
-                        return msg;
-                    }
-                }
-            }
         }
         boolean saved = taskService.saveOrUpdate(task);
-        //新增成功,给第一审核人发送信息提醒
-        if (saved&&isInsert==1){
-            if (user.getCompanyId()==Constant.MLD_COMPANY_ID&&task.getIsTaskPlan()==1&& org.apache.commons.lang3.StringUtils.isNotEmpty(task.getCheckFirstId())){
-                //给第一审核人发送信息提醒
-                msgRecepientList=new ArrayList<>();
-                log.info("添加工作计划,给第一审核人发送信息提醒");
-                User owner = userMapper.selectById(task.getCheckFirstId());
-                Information information = new Information();
-                Project project = projectMapper.selectById(task.getProjectId());
-                information.setMsg(project.getProjectName()+"项目有新的预计FTE计划审批任务,请您查收.");
-                information.setTaskId(task.getId());
-                information.setType(11);
-                information.setUserId(owner.getId());
-                information.setTime(LocalDateTime.now());
-                informationService.save(information);
-            }
-        } else if (saved && isUpdate > 0) {
-            msgRecepientList=new ArrayList<>();
-            //第一审核人修改后, 变成待第二审核人审核
-            if (isUpdate==1||isUpdate==5){
-                User owner = userMapper.selectById(task.getCheckSecondId());
-                Information information = new Information();
-                Project project = projectMapper.selectById(task.getProjectId());
-                information.setMsg(project.getProjectName()+"项目有新的预计FTE计划审批任务,请您查收.");
-                information.setTaskId(task.getId());
-                information.setType(11);
-                information.setUserId(owner.getId());
-                information.setTime(LocalDateTime.now());
-                informationService.save(information);
-
-            }else if(isUpdate==2||isUpdate==6){
-                List<TaskExecutor> taskExecutorList = taskExecutorMapper.selectList(new QueryWrapper<TaskExecutor>().eq("task_id", task.getId()));
-                if(CollectionUtils.isNotEmpty(taskExecutorList)){
-                    for (TaskExecutor taskExecutor : taskExecutorList) {
-                        //给任务的执行人发送信息提醒
-                        User owner = userMapper.selectById(taskExecutor.getExecutorId());
-                        Information information = new Information();
-                        information.setMsg("您有新的任务");
-                        information.setContent(taskExecutor.getProjectId()==null?null:(""+taskExecutor.getProjectId()));
-                        information.setType(1);
-                        information.setUserId(owner.getId());
-                        information.setTime(LocalDateTime.now());
-                        informationService.save(information);
-                    }
-                }
-            } else if (isUpdate==3) {
-                //给第一审核人发送信息提醒
-                log.info("驳回后小组长修改,给第一审核人发送信息提醒");
-                User owner = userMapper.selectById(task.getCheckFirstId());
-                Information information = new Information();
-                information.setType(11);
-                Project project = projectMapper.selectById(task.getProjectId());
-                information.setMsg(project.getProjectName()+"项目有新的预计FTE计划审批任务,请您查收.");
-                information.setTaskId(task.getId());
-                information.setUserId(owner.getId());
-                information.setTime(LocalDateTime.now());
-                informationService.save(information);
-            } else if (isUpdate==4) {
-                //给第一审核人发送信息提醒
-                log.info("撤销后小组长修改,给第一审核人发送信息提醒");
-                User owner = userMapper.selectById(task.getCheckFirstId());
-                Information information = new Information();
-                information.setType(11);
-                Project project = projectMapper.selectById(task.getProjectId());
-                information.setMsg(project.getProjectName()+"项目有新的预计FTE计划审批任务,请您查收.");
-                information.setTaskId(task.getId());
-                information.setUserId(owner.getId());
-                information.setTime(LocalDateTime.now());
-                informationService.save(information);
-            }
-        }
+
         if (task.getExecutorId() == null) {
             //清空执行人
             if (!isNew) {
@@ -631,7 +477,11 @@ public class TaskController {
         comment.setUserName(user.getName());
         comment.setType(isNew?1:2);
         //comment.setContent(user.getName()+(isNew?"创建":"编辑")+"了任务");
-        comment.setContent(user.getName()+(isNew?MessageUtils.message("entry.create"):MessageUtils.message("entry.editedTask"))+MessageUtils.message("entry.task")+(isNew?"":taskCommentString.toString()));
+        String content = user.getName()+(isNew?MessageUtils.message("entry.create"):MessageUtils.message("entry.editedTask"))+MessageUtils.message("entry.task")+(isNew?"":taskCommentString.toString());
+        if (content.length() > 1995) {
+            content = content.substring(0, 1995) + "...";
+        }
+        comment.setContent(content);
         taskCommentMapper.insert(comment);
 
         //需要重新计算项目进度

+ 17 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -391,7 +391,16 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         try {
             User targetUser = userMapper.selectById(request.getHeader("Token"));
             Integer companyId = targetUser.getCompanyId();
-            CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
+            CompanyDingding dingding = null;
+            WxCorpInfo wxCorpInfo = null;
+            if (companyId == 8138) {
+                //苏州正北,钉钉平台
+                dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
+            } else if (companyId == 7703) {
+                //广东正北连接,企业微信
+                wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+            }
+
             //查找该时间段内公司的所有日报数据
             List<Report> monthlyReport = reportMapper.selectList(
                     new QueryWrapper<Report>().select("project_id", "sum(working_time) as working_time", "create_date", "creator_id").between("create_date", startDate, lastDate)
@@ -406,7 +415,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             header.add("日期");
             List<User> users = userMapper.selectList(new QueryWrapper<User>().eq("company_id", targetUser.getCompanyId()));
             for (User user : users) {
-                header.add(user.getName());
+                if (wxCorpInfo != null) {
+                    header.add("$userName="+user.getName()+"$");
+                } else {
+                    header.add(user.getName());
+                }
+
             }
             DecimalFormat df = new DecimalFormat("0.0");
             //构建表体
@@ -468,7 +482,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             body.add(sumRow);
             String fileName = "月度工时明细表"+System.currentTimeMillis();
             try {
-                return excelExportService.exportGeneralExcelByTitleAndList(null,dingding,fileName , body, path);
+                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , body, path);
             } catch (Exception e) {
                 e.printStackTrace();
             }

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -681,6 +681,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         return corpInfo.getAccessToken();
     }
 
+
     @Override
     public HttpRespMsg getUserCheckInDayData(int companyId, String userId, LocalDateTime startDateTime, LocalDateTime endDateTime, boolean showLog) {
         HttpRespMsg msg = new HttpRespMsg();

+ 19 - 3
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -20,7 +20,7 @@
                     </van-field>
                     <template #right-icon>
                         <!--先开放几家,试一下-->
-                        <span style="color:#20a0ff;" @click="getAIReport()" v-if="!substitute && !hasWrittenReport && (user.companyId==10||user.companyId==7||user.companyId==7030||user.companyId==7536)">智能填报</span>
+                        <span style="color:#20a0ff;" @click="getAIReport()" v-if="!substitute && !hasWrittenReport">智能填报</span>
                     </template>
                 </van-cell>
                 
@@ -182,7 +182,7 @@
                         <van-picker show-toolbar :columns="item.stages" value-key="stagesName" @confirm="choseStage"
                             @cancel="item.showPickerStage = false; $forceUpdate();" />
                     </van-popup>
-                    <template v-if="item.projectId">
+                    <template v-if="item.projectId && doYouWantToDisplayTheWorkOrder">
                         <!-- 工单号 -->
                         <van-field readonly name="stage" :disabled="!item.canEdit"
                         v-if="user.timeType.reportExtraField4Name"
@@ -751,7 +751,8 @@ export default {
             showSelectDeptPopup: false,
 
             showAddMore: false,
-            businessTripsArray: []
+            businessTripsArray: [],
+            doYouWantToDisplayTheWorkOrder: true
         };
     },
 
@@ -2331,6 +2332,21 @@ export default {
             this.form.domains[this.clickIndex].groupName = value.name;
             this.form.domains[this.clickIndex].showPickerTaskGroup = false;
             var domainItem = this.form.domains[this.clickIndex];
+            if(this.user.companyId == '7536') {
+                const extraField4 = this.form.domains[this.clickIndex].extraField4
+                const extraField5 = this.form.domains[this.clickIndex].extraField5
+                console.log(this.form.domains[this.clickIndex])
+                if((value.name.indexOf('出差工时') != -1 || value.name.indexOf('研发工时') != -1) && (extraField4 || extraField5)) {
+                    this.form.domains[this.clickIndex].extraField4 = ''
+                    this.form.domains[this.clickIndex].extraField5 = ''
+                }
+                if(value.name.indexOf('研发工时') != -1) {
+                    this.doYouWantToDisplayTheWorkOrder = false
+                } else {
+                    this.doYouWantToDisplayTheWorkOrder = true
+                }
+            }
+            
 
             this.getGroupStages(this.form.domains[this.clickIndex], index);
 

+ 18 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -101,7 +101,7 @@
                                 @cancel="item.showPickerStage = false;$forceUpdate();" />
                         </van-popup>
 
-                        <template v-if="item.projectId">
+                        <template v-if="item.projectId && doYouWantToDisplayTheWorkOrder">
                             <!-- 工单号 -->
                             <van-field readonly name="stage" :disabled="item.state<=1"
                             v-if="user.timeType.reportExtraField4Name"
@@ -613,7 +613,8 @@
 
                 temporaryStorage: false, // 是否开启暂存
 
-                wuqiId: '1071'
+                wuqiId: '1071',
+                doYouWantToDisplayTheWorkOrder: true
             };
         },
         methods: {
@@ -1811,6 +1812,21 @@
                 
                 var domainItem = this.currentForm.domains[this.clickIndex];
 
+                if(this.user.companyId == '7536') {
+                    const extraField4 = domainItem.extraField4
+                    const extraField5 = domainItem.extraField5
+                    console.log(domainItem)
+                    if((value.name.indexOf('出差工时') != -1 || value.name.indexOf('研发工时') != -1) && (extraField4 || extraField5)) {
+                        this.currentForm.domains[this.clickIndex].extraField4 = ''
+                        this.currentForm.domains[this.clickIndex].extraField5 = ''
+                    }
+                    if(value.name.indexOf('研发工时') != -1) {
+                        this.doYouWantToDisplayTheWorkOrder = false
+                    } else {
+                        this.doYouWantToDisplayTheWorkOrder = true
+                    }
+                }
+
                 this.getGroupStages(this.currentForm.domains[this.clickIndex], index, flag);
                 
                 //检查当前的项目是否需要获取分组的负责人