Explorar el Código

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

Lijy hace 2 años
padre
commit
ebd0e4c6a6

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

@@ -3252,11 +3252,26 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             headList.add("项目级别");
             headList.add("合同金额");
         }
+        if(company.getId()==936){
+            headList.add("合同编号");
+            headList.add("质保开始时间");
+            headList.add("质保截止时间");
+            headList.add("项目类别");
+            headList.add("所属大区");
+            headList.add("所属BU");
+            headList.add("项目状态");
+            headList.add("项目阶段");
+        }
         List<List<String>> allList = new ArrayList<List<String>>();
         allList.add(headList);
         String[] levelArray = new String[]{"正常","紧急","重要","重要且紧急","低风险","中风险","高风险"};
         DateTimeFormatter sdf =DateTimeFormatter.ofPattern("yyyy-MM-dd");
         DecimalFormat df = new DecimalFormat("##0.0#");
+        //获取项目子表 数据
+        List<Integer> collect = projectVOList.stream().distinct().map(pv -> pv.getId()).collect(Collectors.toList());
+        //防止空数据
+        collect.add(-1);
+        List<ProjectSeparate> projectSeparateList= projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", collect));
         for (ProjectVO projectVO : projectVOList) {
             List<String> rowData = new ArrayList<>();
             rowData.add(projectVO.getProjectCode());
@@ -3311,6 +3326,42 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 rowData.add(levelArray[level-1]);
                 rowData.add(df.format((Double)projectVO.getContractAmount()));
             }
+            if(company.getId()==936){
+                Optional<ProjectSeparate> first = projectSeparateList.stream().filter(ps -> ps.getId().equals(projectVO.getId())).findFirst();
+                if(first.isPresent()){
+                    DateTimeFormatter dfs=DateTimeFormatter.ofPattern("yyyy-MM-dd");
+                    ProjectSeparate projectSeparate = first.get();
+                    rowData.add(projectSeparate.getContractCode()==null?"":projectSeparate.getContractCode());
+                    rowData.add(projectSeparate.getWarrantyStartDate()==null?"":dfs.format(projectSeparate.getWarrantyStartDate()));
+                    rowData.add(projectSeparate.getWarrantyEndDate()==null?"":dfs.format(projectSeparate.getWarrantyEndDate()));
+                    rowData.add(projectSeparate.getProjectCategorySub()==null?"":projectSeparate.getProjectCategorySub());
+                    rowData.add(projectSeparate.getRegion()==null?"":projectSeparate.getRegion());
+                    rowData.add(projectSeparate.getBu()==null?"":projectSeparate.getBu());
+                }else {
+                    rowData.add("");
+                    rowData.add("");
+                    rowData.add("");
+                    rowData.add("");
+                    rowData.add("");
+                    rowData.add("");
+                }
+                Integer status = projectVO.getStatus();
+                switch (status){
+                    case 0:rowData.add("全部");
+                        break;
+                    case 1:rowData.add("进行中");
+                        break;
+                    case 2:rowData.add("已完成");
+                        break;
+                    case 3:rowData.add("已撤销");
+                        break;
+                    case 4:rowData.add("暂停");
+                        break;
+                    default:rowData.add("");
+                    break;
+                }
+                rowData.add(projectVO.getCurrentStageName()==null?"":projectVO.getCurrentStageName());
+            }
             allList.add(rowData);
         }
 

+ 10 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -1301,6 +1301,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                     }
                                     upR.setIsFinalAudit(nextNode.getIsFinal());
                                     break;
+                                } else {
+                                    System.out.println("无匹配的中间审批流节点");
                                 }
                             }
                             reportMapper.update(upR,
@@ -1693,15 +1695,15 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             //指定查看某个部门下的,一个人可能负责多个部门
             List<Department> allMDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", token));
             List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", curUser.getId()));
-            if (hasDeptWorktimePriv && curUser.getDepartmentId() != null) {
-                Department ownerDept = departmentMapper.selectById(curUser.getDepartmentId());
-                List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
-                for (Integer integer : otherCollect) {
-                    Optional<Department> first = allDepartmentList.stream().filter(ad -> ad.getDepartmentId().equals(integer)).findFirst();
-                    if(first.isPresent()){
-                        allMDeptList.add(first.get());
-                    }
+            List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
+            for (Integer integer : otherCollect) {
+                Optional<Department> first = allDepartmentList.stream().filter(ad -> ad.getDepartmentId().equals(integer)).findFirst();
+                if(first.isPresent()){
+                    allMDeptList.add(first.get());
                 }
+            }
+            if (hasDeptWorktimePriv && curUser.getDepartmentId() != null&& curUser.getDepartmentId()!=0) {
+                Department ownerDept = departmentMapper.selectById(curUser.getDepartmentId());
                 //要加上自己的部门,如果没有的话
                 if (!allMDeptList.stream().anyMatch(d->d.getDepartmentId().equals(ownerDept.getDepartmentId()))) {
                     allMDeptList.add(ownerDept);

+ 9 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -346,9 +346,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             long endTime = endDateTime.toEpochSecond(ZoneOffset.of("+8"));
             System.out.println("startTime="+startTime+",endTime="+endTime);
 
-            int batchCount = 1;
+            int totalLength = corpwxUserIds.size();
             int batchSize = 100;
-            int totalLength = 1;
+            int batchCount = totalLength/batchSize+(totalLength%batchSize==0?0:1);
+
             //按批调用
             for (int i=0;i<batchCount; i++) {
                 int fromIndex = i*batchSize;
@@ -377,6 +378,11 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             List<String> collect = userList.stream().map(User::getId).collect(Collectors.toList());
 
             userMapper.delete(new QueryWrapper<User>().in("id", collect));
+            //抽取没有匹配上的人员
+            List<String> notUsefullCpIds = corpwxUserIds.stream().filter(c -> !updateUserList.stream().anyMatch(up -> up.getCorpwxUserid().equals(c))).collect(Collectors.toList());
+            if (notUsefullCpIds.size() > 0) {
+                userCorpwxTimeMapper.delete(new QueryWrapper<UserCorpwxTime>().eq("company_id", wxCorpInfo.getCompanyId()).in("corpwx_userid", notUsefullCpIds));
+            }
             if (updateUserList.size() == 0) {
                 msg.data = "处理完毕。当前无新人员需要关联企业微信身份";
             } else {
@@ -395,7 +401,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         String url = GET_CHECKIN_DAYDATA.replace("ACCESS_TOKEN", getCorpAccessToken(corpInfo));
         HttpHeaders headers = new HttpHeaders();
         headers.setContentType(MediaType.APPLICATION_JSON);
-
+        System.out.println(""+objects.toString());
         JSONObject reqParam = new JSONObject();
         reqParam.put("starttime", startTime);
         reqParam.put("endtime",  endTime);

+ 49 - 49
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -347,23 +347,24 @@
             </el-table>
 
             <!-- 任务分组工时表 -->
-            <el-table v-if="ins == 12" border :data="groupWorktimeList" key="12"
-            highlight-current-row v-loading="listLoading" :height="tableHeight" 
-             style="width: 100%;" ref="table">
-                <el-table-column label="按任务分组统计" header-align="center">
-                  <el-table-column prop="leftgroupName" label="分组名称" min-width="100"></el-table-column>
-                  <el-table-column prop="leftworkingTime" label="工时(h)" min-width="50" align="right" header-align="center">
+            <el-table v-if="ins == 12" border :data="groupWorktimeList.left" key="12_2" highlight-current-row :height="tableHeight" v-loading="groupListLoading" style="width:33%;float:left;">
+              <el-table-column label="按任务分组统计" header-align="center">
+                  <el-table-column prop="groupName" label="分组名称" min-width="100"></el-table-column>
+                  <el-table-column prop="workingTime" label="工时(h)" min-width="50" align="right" header-align="center">
                     <template slot-scope="scope">
                       <span style="margin-right:20px">{{scope.row.leftworkingTime ? scope.row.leftworkingTime.toFixed(1) + '(h)' : ''}}</span>
                     </template>
                   </el-table-column>
                 </el-table-column>
-                <el-table-column width="2" class-name="dividingLine" label-class-name="dividingLine"></el-table-column>
+            </el-table>
+            <el-table v-if="ins == 12" border :data="groupWorktimeList.right" key="12"
+            highlight-current-row v-loading="listLoading" :height="tableHeight" 
+             style="width: 66%;float:right;" ref="table">
                 <el-table-column label="按项目统计" header-align="center">
-                  <el-table-column prop="rightprojectCode" label="项目编号" min-width="75"></el-table-column>
-                  <el-table-column prop="rightprojectName" label="项目名称" min-width="125"></el-table-column>
-                  <el-table-column prop="rightgroupName" label="分组名称" min-width="100"></el-table-column>
-                  <el-table-column prop="rightworkingTime" label="工时(h)" min-width="50" align="right" header-align="center">
+                  <el-table-column prop="projectCode" label="项目编号" min-width="75"></el-table-column>
+                  <el-table-column prop="projectName" label="项目名称" min-width="125"></el-table-column>
+                  <el-table-column prop="groupName" label="分组名称" min-width="100"></el-table-column>
+                  <el-table-column prop="workingTime" label="工时(h)" min-width="50" align="right" header-align="center">
                     <template slot-scope="scope">
                       <span style="margin-right:20px">{{scope.row.rightworkingTime ? scope.row.rightworkingTime.toFixed(1) + '(h)' : ''}}</span>
                     </template>
@@ -371,6 +372,7 @@
                 </el-table-column>
             </el-table>
             
+            
 
             <!-- 项目加班情况统计报表 -->
             <div v-if="ins == 6 || ins == 8">
@@ -517,11 +519,11 @@
         <el-col :span="24" class="toolbar" v-if="ins != 6">
           <el-pagination
                 v-if="ins == 12"
-                @size-change="handleSizeChange"
+                @size-change="groupSizeChange"
                 @current-change="groupPageChange"
                 :current-page="groupPage"
                 :page-sizes="[20 , 50 , 80 , 100]"
-                :page-size="size"
+                :page-size="groupSize"
                 layout="total, sizes, prev, pager, next"
                 :total="groupTotal"
                 style="float:left;"
@@ -741,8 +743,13 @@ export default {
       defaultActive: '1-1',
 
       personnelList: [], //'人员工时统计表'
-      groupWorktimeList: [], //任务分组工时表
+      groupWorktimeList: {
+        left: [],
+        right: []
+      }, //任务分组工时表
+      groupListLoading: false,
       groupPage: 1,
+      groupSize: 20,
       groupTotal: 0
     };
   },
@@ -966,7 +973,12 @@ export default {
             //分页
             handleCurrentChange(val) {
                 this.page = val;
-                this.getList();
+                if(this.ins == 12){
+                  this.groupWorktimeList.right = []
+                  this.getGroupWorktimeList()
+                }else{
+                  this.getList();
+                }
             },
 
             handleSizeChange(val) {
@@ -974,13 +986,21 @@ export default {
                 this.page = 1
                 if(this.ins == 12){
                   this.groupPage = 1
-
+                  this.groupWorktimeList.right = []
+                  this.getGroupWorktimeList()
+                }else{
+                  this.getList();
                 }
-                this.getList();
-                
+            },
+            groupSizeChange(val){
+              this.groupSize = val
+              this.groupPage = 1
+              this.groupWorktimeList.left = []
+              this.getGroupWorktimeAll()
             },
             groupPageChange(val){
                 this.groupPage = val;
+                this.groupWorktimeList.left = []
                 this.getGroupWorktimeAll()
             },
             getList() {
@@ -1011,17 +1031,8 @@ export default {
                 } else if(this.ins == 11) {
                     this.getPersonnelList()
                 }else if(this.ins == 12){
-                  this.groupWorktimeList = []
-                  for(let i=0; i<this.size; i++){
-                    this.groupWorktimeList.push({
-                      leftgroupName:null,
-                      leftworkingTime:null,
-                      rightgroupName:null,
-                      rightworkingTime:null,
-                      rightprojectCode:null,
-                      rightprojectName:null
-                    })
-                  }
+                  this.groupWorktimeList.left = []
+                  this.groupWorktimeList.right = []
                     this.getGroupWorktimeList()
                     this.getGroupWorktimeAll()
                 }
@@ -1140,7 +1151,6 @@ export default {
       this.reportTimelyList = []
       this.auditRateList = []
       this.departmentIdArray = []
-      this.groupWorktimeList = []
       this.userId = null
       this.selUserList = this.userList
       this.getList();
@@ -1514,13 +1524,8 @@ export default {
           this.listLoading = false
           if(res.code == 'ok'){
             this.total = res.data.total
-            let list = res.data.records
-            for(let i=0; i<this.size; i++){
-              this.groupWorktimeList[i].rightgroupName = list[i] ? list[i].groupName : null
-              this.groupWorktimeList[i].rightworkingTime = list[i] ? list[i].workingTime : null
-              this.groupWorktimeList[i].rightprojectCode = list[i] ? list[i].projectCode : null
-              this.groupWorktimeList[i].rightprojectName = list[i] ? list[i].projectName : null
-            }
+            this.groupWorktimeList.right = res.data.records
+            
           }else {
             this.$message({
               message: res.msg,
@@ -1542,15 +1547,14 @@ export default {
         pageIndex: this.groupPage,
         pageSize: this.size
       }
+      this.groupListLoading = true
       this.http.post('/project/getTimeCostByGroup',parameter,
         res => {
+          this.groupListLoading = false
           if(res.code == 'ok'){
-            let list = res.data.records
               this.groupTotal = res.data.total
-              for(let i=0; i<this.size; i++){
-                this.groupWorktimeList[i].leftgroupName = list[i] ? list[i].groupName : null
-                this.groupWorktimeList[i].leftworkingTime = list[i] ? list[i].workingTime : null
-              }
+              this.groupWorktimeList.left = res.data.records
+              
           }else {
             this.$message({
               message: res.msg,
@@ -1558,6 +1562,7 @@ export default {
             })
           }
         },err => {
+          this.groupListLoading = false
           this.$message({
             message: err,
             type: 'error'
@@ -1734,8 +1739,7 @@ export default {
       }
       if(this.ins == 12){
         this.proJuctId = ''
-        this.getGroupWorktimeList()
-        this.getGroupWorktimeAll()
+        this.getList()
       }
     },
     // 日期
@@ -1751,6 +1755,7 @@ export default {
     },
     selcts(e) {
       if(this.ins == 12){
+        this.groupWorktimeList.right = []
         this.getGroupWorktimeList()
       }else{
       if(e == 9){
@@ -1806,11 +1811,6 @@ export default {
   },
 };
 </script>
-<style>
-.dividingLine{
-  background-color: #999 !important;
-}
-</style>
 <style scoped>
 .headConCon {
   position: fixed;

+ 6 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/project/info.vue

@@ -1420,12 +1420,12 @@
                         formData.append("associateDegreeNames", listName)
                         // 判断公司id是否等于 936
                         if(this.user.companyId == '936') {
-                             formData.append("contractCode", this.addForm.projectSeparate.contractCode);
-                             formData.append("warrantyStartDate", this.addForm.projectSeparate.warrantyStartDate);
-                             formData.append("warrantyEndDate", this.addForm.projectSeparate.warrantyEndDate);
-                             formData.append("projectCategorySub", this.addForm.projectSeparate.projectCategorySub);
-                             formData.append("region", this.addForm.projectSeparate.region);
-                             formData.append("bu", this.addForm.projectSeparate.bu);
+                             formData.append("contractCode", this.addForm.projectSeparate.contractCode ? this.addForm.projectSeparate.contractCode : '');
+                             formData.append("warrantyStartDate", this.addForm.projectSeparate.warrantyStartDate ? this.addForm.projectSeparate.warrantyStartDate : '');
+                             formData.append("warrantyEndDate", this.addForm.projectSeparate.warrantyEndDate ? this.addForm.projectSeparate.warrantyEndDate : '');
+                             formData.append("projectCategorySub", this.addForm.projectSeparate.projectCategorySub ? this.addForm.projectSeparate.projectCategorySub : '');
+                             formData.append("region", this.addForm.projectSeparate.region ? this.addForm.projectSeparate.region : '');
+                             formData.append("bu", this.addForm.projectSeparate.bu ? this.addForm.projectSeparate.bu : '');
                         }
                         // return
                         this.http.uploadFile(this.port.project.add,formData,

+ 6 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -3228,12 +3228,12 @@ a {
 
                         // 判断公司id是否等于 936
                         if(this.user.companyId == '936') {
-                             formData.append("contractCode", this.addForm.contractCode);
-                             formData.append("warrantyStartDate", this.addForm.warrantyStartDate);
-                             formData.append("warrantyEndDate", this.addForm.warrantyEndDate);
-                             formData.append("projectCategorySub", this.addForm.projectCategorySub);
-                             formData.append("region", this.addForm.region);
-                             formData.append("bu", this.addForm.bu);
+                             formData.append("contractCode", this.addForm.contractCode ? this.addForm.contractCode : '');
+                             formData.append("warrantyStartDate", this.addForm.warrantyStartDate ? this.addForm.warrantyStartDate : '');
+                             formData.append("warrantyEndDate", this.addForm.warrantyEndDate ? this.addForm.warrantyEndDate : '');
+                             formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
+                             formData.append("region", this.addForm.region ? this.addForm.region : '');
+                             formData.append("bu", this.addForm.bu ? this.addForm.bu : '');
                         }
 
                         // formData.append("associateDegreeNames", listName)

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -2335,7 +2335,7 @@ import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
                 this.http.post('/stages/list',{groupId: this.selectedGroup.id, projectId: this.selectedGroup.projectId, order: this.order, isDesc: this.isDesc},
                 res => {
                     if (res.code == "ok") {
-                        this.stageList = res.data;
+                        this.stageList = res.data.list;
                         this.timess() // 处理时间的方法
                     } else {
                         this.$message({

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

@@ -1613,7 +1613,7 @@ import { error } from 'dingtalk-jsapi';
                 this.http.post('/stages/list',{groupId: this.selectedGroup.id, projectId: this.selectedGroup.projectId, order: this.order, isDesc: this.isDesc},
                 res => {
                     if (res.code == "ok") {
-                        this.stageList = res.data;
+                        this.stageList = res.data.list;
                         // console.log('触发获取任务列表函数')
                         this.timess() // 处理时间的方法
                     } else {

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -3551,10 +3551,10 @@
                 this.listLoading = true;
                 let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
                 let param = {date: this.date + day};
-                if (this.deptId != null) {
+                if (this.deptId) {
                     param.deptId = this.deptId;
                 }
-                if (this.targetUid != null) {
+                if (this.targetUid) {
                     param.userId = this.targetUid;
                 }
                 this.http.post( this.port.report.list, param,