فهرست منبع

Merge remote-tracking branch 'origin/master'

yusm 3 هفته پیش
والد
کامیت
ff8f0e2c07
19فایلهای تغییر یافته به همراه478 افزوده شده و 121 حذف شده
  1. 36 17
      fhKeeper/formulahousekeeper/collectdata/src/main/java/com/management/collectdata/controller/DataCollectController.java
  2. 1 1
      fhKeeper/formulahousekeeper/collectdata/src/main/java/com/management/collectdata/entity/ErpOrderInfo.java
  3. 28 1
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/index.vue
  4. 6 0
      fhKeeper/formulahousekeeper/management-platform/pom.xml
  5. 4 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java
  6. 25 23
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java
  7. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ErpOrderInfo.java
  8. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java
  9. 3 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java
  10. 33 28
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceMonthlyWorktimeServiceImpl.java
  11. 5 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  12. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  13. 4 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  14. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/MD5Util.java
  15. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ErpOrderInfoMapper.xml
  16. 4 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml
  17. 2 0
      fhKeeper/formulahousekeeper/timesheet/src/permissions.js
  18. 311 34
      fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue
  19. 9 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

+ 36 - 17
fhKeeper/formulahousekeeper/collectdata/src/main/java/com/management/collectdata/controller/DataCollectController.java

@@ -68,9 +68,9 @@ public class DataCollectController {
 //    private ErpOrderInfoMapper erpOrderInfoMapper;
 
     @RequestMapping("/checkCisData")
-    public List<TisTimeVO> checkCisData(@RequestBody List<TisTimeVO> tisList) {
-        if(!CollectionUtils.isEmpty(tisList)){
-            for (TisTimeVO tisTimeVO : tisList) {
+    public List<TisTimeVO> checkCisData(@RequestBody List<TisTimeVO> toSendList) {
+        if(!CollectionUtils.isEmpty(toSendList)){
+            for (TisTimeVO tisTimeVO : toSendList) {
                 String sqlQuery = "select top 1 iRealCOID from ca_batchmap where cMOCode = ? and iMOSubSN = ? ";
                 try (Connection connection = sqlServerDataSource.getConnection()) {
                     PreparedStatement queryStmt = connection.prepareStatement(sqlQuery);
@@ -85,32 +85,51 @@ public class DataCollectController {
                 }
             }
         }
-        return tisList;
+        return toSendList;
     }
 
     @RequestMapping("/insertCisData")
     public String insertCisData(@RequestBody List<TisTimeVO> tisList) {
         if(!CollectionUtils.isEmpty(tisList)){
-            int count = 0;
+            int insertCount = 0;
+            int updateCount = 0;
             for (TisTimeVO tisTimeVO : tisList) {
+                String sqlQuery = "select count(*) from CA_DayTiS where cPPID = ? and dDate = ? ";
                 String sqlInsert = "insert into CA_DayTiS(cPPID,iRealWkt,dDate) values(?,?,?)";
+                String sqlUpdate = "update CA_DayTiS set iRealWkt = ? where cPPID = ? and dDate = ? ";
                 try (Connection connection = sqlServerDataSource.getConnection()) {
-                    PreparedStatement insertStmt = connection.prepareStatement(sqlInsert);
-                    insertStmt.setString(1,tisTimeVO.getCoId());
-                    insertStmt.setBigDecimal(2,tisTimeVO.getWorkTime());
-                    insertStmt.setString(3,tisTimeVO.getDateStr());
-                    int i = insertStmt.executeUpdate();
-                    if(i>0){
-                        count++;
-//                        System.out.println("执行成功");
+                    PreparedStatement queryStmt = connection.prepareStatement(sqlQuery);
+                    queryStmt.setString(1, tisTimeVO.getCoId());
+                    queryStmt.setString(2, tisTimeVO.getDateStr());
+                    ResultSet queryRs = queryStmt.executeQuery();
+                    if(queryRs.next() && queryRs.getInt(1) > 0){
+                        //更新
+                        PreparedStatement updateStmt = connection.prepareStatement(sqlUpdate);
+                        queryStmt.setString(1, tisTimeVO.getCoId());
+                        queryStmt.setString(2, tisTimeVO.getDateStr());
+                        int i = updateStmt.executeUpdate();
+                        if(i>0){
+                            updateCount++;
+                        }else{
+                            System.out.println(tisTimeVO.getCoId()+"执行失败");
+                        }
                     }else{
-                        System.out.println(tisTimeVO.getCoId()+"执行失败");
+                        PreparedStatement insertStmt = connection.prepareStatement(sqlInsert);
+                        insertStmt.setString(1,tisTimeVO.getCoId());
+                        insertStmt.setBigDecimal(2,tisTimeVO.getWorkTime());
+                        insertStmt.setString(3,tisTimeVO.getDateStr());
+                        int i = insertStmt.executeUpdate();
+                        if(i>0){
+                            insertCount++;
+                        }else{
+                            System.out.println(tisTimeVO.getCoId()+"执行失败");
+                        }
                     }
                 } catch (SQLException e) {
                     System.err.println("数据库操作错误: " + e.getMessage());
                 }
             }
-            System.out.println("本批次总数量:"+tisList.size()+",成功插入条数:"+count);
+            System.out.println("本批次总数量:"+tisList.size()+",成功插入条数:"+insertCount+",成功更新条数:"+updateCount);
         }
 //        List<TisTimeVO> tisTimeVOS = JSONArray.parseArray(jsonarray, TisTimeVO.class);
 //        if(!CollectionUtils.isEmpty(tisList)){
@@ -265,7 +284,7 @@ public class DataCollectController {
 //                " from mom_orderdetail " +
 //                " where status in (3,4) "
 //                +" ORDER BY MoDId OFFSET ? ROWS FETCH NEXT ? ROWS ONLY ";
-        String sqlQuery = "select mo.cbSysBarCode,SUBSTRING(mo.cbSysBarCode, 8, 15) as orderId,mo.Define24,mo.Define25 " +
+        String sqlQuery = "select mo.cbSysBarCode,SUBSTRING(mo.cbSysBarCode, 8, 15) as orderId,mo.Define24  as projectId,mo.Define25  as projectName,mo.relsdate" +
                 "     ,RIGHT(mo.cbSysBarCode,1) as line,mo.Status,cb.cDeptID,cb.cDepName,mo.MoDId " +
                 " from mom_orderdetail mo " +
                 " left join ca_batchmap cb on SUBSTRING(mo.cbSysBarCode, 8, 15) = cb.cMOCode and RIGHT(mo.cbSysBarCode,1) = cb.iMOSubSN " +
@@ -287,7 +306,7 @@ public class DataCollectController {
                     erpOrderInfo.setProjectId(resultSet.getString("projectId"));
                     erpOrderInfo.setProjectName(resultSet.getString("projectName"));
                     erpOrderInfo.setLine(resultSet.getInt("line"));
-                    erpOrderInfo.setStatus(resultSet.getInt("status"));
+                    erpOrderInfo.setStatus(resultSet.getInt("Status"));
                     erpOrderInfo.setRelsDate(resultSet.getDate("relsdate"));
                     erpOrderInfo.setDeptId(resultSet.getString("cDeptID"));
                     erpOrderInfo.setDeptName(resultSet.getString("cDepName"));

+ 1 - 1
fhKeeper/formulahousekeeper/collectdata/src/main/java/com/management/collectdata/entity/ErpOrderInfo.java

@@ -35,7 +35,7 @@ public class ErpOrderInfo extends Model<ErpOrderInfo> {
     private Integer status;
 
     @TableField("moDId")
-    private String MoDId;
+    private String moDId;
 
     @TableField("rels_date")
     private Date relsDate;

+ 28 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/index.vue

@@ -43,7 +43,7 @@
             <el-option v-for="item in roleList" :key="item.id" :label="item.rolename" :value="item.id" />
           </el-select>
         </div>
-        <el-button type="primary" v-if="userInfo.userNameNeedTranslate == 1"
+        <!-- <el-button type="primary" v-if="userInfo.userNameNeedTranslate == 1"
           @click="transitionOperation('exportUser', '')" v-permission="['teamExport']">导出人员</el-button>
         <el-button type="primary" v-if="userInfo.userNameNeedTranslate == 1"
           @click="dialogFrom.newSyncWithCorpWxDayloadVisable = true">同步企微通讯录</el-button>
@@ -71,6 +71,33 @@
               </el-dropdown-item>
             </el-dropdown-menu>
           </template>
+        </el-dropdown> -->
+        <el-dropdown>
+          <el-button type="primary">
+            更多操作<el-icon class="el-icon--right"><arrow-down /></el-icon>
+          </el-button>
+          <template #dropdown>
+            <el-dropdown-menu>
+              <template v-if="userInfo.userNameNeedTranslate != 1">
+                <el-dropdown-item @click="addPersone(false)" v-permission="['teamAdd']">添加人员</el-dropdown-item>
+                <el-dropdown-item @click="transitionOperation('exportUser', '')" v-permission="['teamExport']">导出人员</el-dropdown-item>
+                <el-dropdown-item @click="transitionOperation('importUser', '')" v-permission="['teamImport']">批量导入</el-dropdown-item>
+              </template>
+              <template v-if="userInfo.userNameNeedTranslate == 1">
+                <el-dropdown-item @click="transitionOperation('exportUser', '')" v-permission="['teamExport']">导出人员</el-dropdown-item>
+                <el-dropdown-item @click="dialogFrom.newSyncWithCorpWxDayloadVisable = true" v-permission="['teamAdd']">同步企微通讯录</el-dropdown-item>
+              </template>
+              <el-dropdown-item @click="officialAccountSetting()">
+                {{ officialAccountInformation.id ? '修改公众号配置' : '配置公众号' }}
+              </el-dropdown-item>
+              <el-dropdown-item @click="oneClickGenerationOfQrCode()" v-if="officialAccountInformation.id">
+                一键生成员工二维码
+              </el-dropdown-item>
+              <el-dropdown-item @click="exportQrCode()" v-if="officialAccountInformation.id">
+                导出员工二维码
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </template>
         </el-dropdown>
       </div>
     </div>

+ 6 - 0
fhKeeper/formulahousekeeper/management-platform/pom.xml

@@ -15,6 +15,12 @@
 
     <dependencies>
 
+        <dependency>
+            <groupId>com.github.wechatpay-apiv3</groupId>
+            <artifactId>wechatpay-java</artifactId>
+            <version>0.2.17</version>
+        </dependency>
+
         <dependency>
             <groupId>com.microsoft.sqlserver</groupId>
             <artifactId>mssql-jdbc</artifactId>

+ 4 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -270,8 +270,8 @@ public class ProjectController {
      * 获取查询者所在公司每个项目的工时成本
      */
     @RequestMapping("/getTimeCost")
-    public HttpRespMsg getTimeCost(String startDate, String endDate, String userIds,Integer projectId,Integer type) {
-        return projectService.getTimeCost(startDate, endDate, userIds,projectId,type, request);
+    public HttpRespMsg getTimeCost(String startDate, String endDate, String userIds,Integer projectId,Integer type, @RequestParam(required = false) Integer status) {
+        return projectService.getTimeCost(startDate, endDate, userIds,projectId,type,status, request);
     }
 
     /**
@@ -294,8 +294,8 @@ public class ProjectController {
      * 导出查询者所在公司每个项目的工时成本
      */
     @RequestMapping("/exportTimeCost")
-    public HttpRespMsg exportTimeCost(@RequestParam(required = false, defaultValue = "0") Integer withMainProject, String exportContent,String startDate, String endDate, Integer projectId, String userIds, Boolean projectSum,Integer type,Integer deptId,@RequestParam(defaultValue = "1") Integer stateKey, @RequestParam(required = false, defaultValue = "0") Integer withPercent,Integer projectCategoryId) {
-        return projectService.exportTimeCost(withMainProject, exportContent,startDate, endDate, projectId, userIds, projectSum,type,deptId,stateKey, withPercent,projectCategoryId, request);
+    public HttpRespMsg exportTimeCost(@RequestParam(required = false, defaultValue = "0") Integer withMainProject, @RequestParam(required = false) Integer status,String exportContent,String startDate, String endDate, Integer projectId, String userIds, Boolean projectSum,Integer type,Integer deptId,@RequestParam(defaultValue = "1") Integer stateKey, @RequestParam(required = false, defaultValue = "0") Integer withPercent,Integer projectCategoryId) {
+        return projectService.exportTimeCost(withMainProject, exportContent,startDate, endDate, projectId, userIds, projectSum,type,deptId,stateKey, withPercent,projectCategoryId,status, request);
     }
 
     @RequestMapping("/exportTimeByProjectAndEmployee")

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

@@ -1554,32 +1554,34 @@ public class ReportController {
         }
         //针对泓浒(苏州),需要按照工单号的部门来设置工时所属部门,同时设置是否是协作工时
         if (Constant.HONG_HU_COMPANY_ID == company.getId()) {
-            List<String> collect = reportList.stream().map(Report::getExtraField4).collect(Collectors.toList());
-            List<ErpOrderInfo> orderList = erpOrderInfoMapper.selectList(new QueryWrapper<ErpOrderInfo>().in("order_id", collect));
-            for (Report report : reportList) {
-                String errorMsg = null;
-                Optional<ErpOrderInfo> first = orderList.stream().filter(order -> order.getOrderId().equals(report.getExtraField4())).findFirst();
-                if (first.isPresent()) {
-                    if (first.get().getDeptId() == null) {
-                        errorMsg = "工单号:"+report.getExtraField4()+"无部门id";
-                    } else {
-                        Department deptItem = departmentMapper.selectOne(new QueryWrapper<Department>().eq("dept_code", first.get().getDeptId()));
-                        if (deptItem != null) {
-                            if (!deptItem.getDepartmentId().equals(report.getDeptId())) {
-                                report.setDeptId(deptItem.getDepartmentId());
-                                report.setIsAssist(true);
-                            }
+            List<String> collect = reportList.stream().filter(r -> !StringUtils.isEmpty(r.getExtraField4())).map(Report::getExtraField4).collect(Collectors.toList());
+            if (collect.size() > 0) {
+                List<ErpOrderInfo> orderList = erpOrderInfoMapper.selectList(new QueryWrapper<ErpOrderInfo>().in("order_id", collect));
+                for (Report report : reportList) {
+                    String errorMsg = null;
+                    Optional<ErpOrderInfo> first = orderList.stream().filter(order -> order.getOrderId().equals(report.getExtraField4())).findFirst();
+                    if (first.isPresent()) {
+                        if (first.get().getDeptId() == null) {
+                            errorMsg = "工单号:"+report.getExtraField4()+"无部门id";
                         } else {
-                            errorMsg = "工时系统中尚未给部门:"+first.get().getDeptName()+"设置部门编号";
+                            Department deptItem = departmentMapper.selectOne(new QueryWrapper<Department>().eq("dept_code", first.get().getDeptId()));
+                            if (deptItem != null) {
+                                if (!deptItem.getDepartmentId().equals(report.getDeptId())) {
+                                    report.setDeptId(deptItem.getDepartmentId());
+                                    report.setIsAssist(true);
+                                }
+                            } else {
+                                errorMsg = "工时系统中尚未给部门:"+first.get().getDeptName()+"设置部门编号";
+                            }
                         }
+                    } else {
+                        errorMsg = "erpOrderInfo表中工单号不存在:"+report.getExtraField4();
+                    }
+                    if (errorMsg != null) {
+                        HttpRespMsg httpRespMsg = new HttpRespMsg();
+                        httpRespMsg.setError(errorMsg);
+                        return httpRespMsg;
                     }
-                } else {
-                    errorMsg = "erpOrderInfo表中工单号不存在:"+report.getExtraField4();
-                }
-                if (errorMsg != null) {
-                    HttpRespMsg httpRespMsg = new HttpRespMsg();
-                    httpRespMsg.setError(errorMsg);
-                    return httpRespMsg;
                 }
             }
         }

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ErpOrderInfo.java

@@ -35,7 +35,7 @@ public class ErpOrderInfo extends Model<ErpOrderInfo> {
     private Integer status;
 
     @TableField("moDId")
-    private String MoDId;
+    private String moDId;
 
     @TableField("rels_date")
     private Date relsDate;

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java

@@ -29,7 +29,8 @@ public interface ProjectMapper extends BaseMapper<Project> {
     List<Map<String, Object>> getTimeCost(@Param("companyId") Integer companyId, @Param("startDate") String startDate, @Param("endDate") String endDate,
                                           @Param("projectId") Integer projectId, @Param("userIdList") List<String> userIdList,
                                           @Param("deptIds")List<Integer> deptIds,@Param("filterDeptIds")List<Integer> filterDeptIds, @Param("deptRelatedProjectIds") List<Integer> deptRelatedProjectIds,
-                                          @Param("projectIds") List<Integer> projectIds, @Param("inchargeUserIds") List<String> inchargeUserIds,@Param("categoryId") Integer categoryId);
+                                          @Param("projectIds") List<Integer> projectIds, @Param("inchargeUserIds") List<String> inchargeUserIds
+            ,@Param("categoryId") Integer categoryId,@Param("status") Integer status);
 
     List<Map<String, Object>> getCustomDataSum(@Param("companyId") Integer companyId, @Param("startDate") String startDate, @Param("endDate") String endDate,
                                           @Param("projectId") Integer projectId, @Param("userId") String userId);

+ 3 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java

@@ -66,7 +66,7 @@ public interface ProjectService extends IService<Project> {
 
     HttpRespMsg deleteProject(Integer id, Integer force);
 
-    HttpRespMsg getTimeCost(String startDate, String endDate, String userIds,Integer projectId, Integer type,HttpServletRequest request);
+    HttpRespMsg getTimeCost(String startDate, String endDate, String userIds,Integer projectId, Integer type,Integer status,HttpServletRequest request);
 
     HttpRespMsg getProjectCost(String startDate, String endDate, Integer projectId,Integer stateKey, HttpServletRequest request);
 
@@ -74,7 +74,7 @@ public interface ProjectService extends IService<Project> {
 
     HttpRespMsg getAllMembCost(String startDate, String endDate, Integer projectId, HttpServletRequest request);
 
-    HttpRespMsg exportTimeCost(Integer withMainProject, String exportContent,String startDate, String endDate, Integer projectId,String userIds, Boolean projectSum,Integer type,Integer deptId,Integer stateKey, Integer withPercent,Integer projectCategoryId, HttpServletRequest request);
+    HttpRespMsg exportTimeCost(Integer withMainProject, String exportContent,String startDate, String endDate, Integer projectId,String userIds, Boolean projectSum,Integer type,Integer deptId,Integer stateKey, Integer withPercent,Integer projectCategoryId,Integer status, HttpServletRequest request);
 
     HttpRespMsg updateProgress(Integer id, Integer progress, HttpServletRequest request);
 
@@ -330,4 +330,5 @@ public interface ProjectService extends IService<Project> {
     HttpRespMsg getProjectTaskPlanFTEData(Integer pageIndex, Integer pageSize, String monthStart, String monthEnd, String area, String userId, String sortProp, Integer sortOrder, Integer departmentId, HttpServletRequest request);
 
     HttpRespMsg exportTaskPlanFTEData(String monthStart, String monthEnd, String area, String userId, Integer departmentId, HttpServletRequest request);
+
 }

+ 33 - 28
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceMonthlyWorktimeServiceImpl.java

@@ -88,9 +88,10 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
         if(!CollectionUtils.isEmpty(timeVOList)){
             HttpHeaders headers = new HttpHeaders();
             headers.setContentType(MediaType.APPLICATION_JSON);
-            Map<String, Object> requestBody = new HashMap<>();
-            requestBody.put("toSendList", timeVOList);
-            HttpEntity<Object> requestEntity = new HttpEntity<>(requestBody, headers);
+//            Map<String, Object> requestBody = new HashMap<>();
+//            requestBody.put("tisList", timeVOList);
+//            HttpEntity<Object> requestEntity = new HttpEntity<>(requestBody, headers);
+            HttpEntity<List<TisTimeVO>> requestEntity = new HttpEntity<>(timeVOList, headers);
             ResponseEntity<List<TisTimeVO>> checkResponse = restTemplate.exchange(checkUrl, HttpMethod.POST, requestEntity
                     ,new  ParameterizedTypeReference<List<TisTimeVO>>(){});
             if(checkResponse.getStatusCode() == HttpStatus.OK){
@@ -103,9 +104,10 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
                 timeVOList.forEach(t->t.setDateStr(timesheetDate));
                 HttpHeaders insertHeaders = new HttpHeaders();
                 insertHeaders.setContentType(MediaType.APPLICATION_JSON);
-                Map<String, Object> insertBody = new HashMap<>();
-                insertBody.put("tisList", resList);
-                HttpEntity<Object> insertEntity = new HttpEntity<>(insertBody, insertHeaders);
+//                Map<String, Object> insertBody = new HashMap<>();
+//                insertBody.put("tisList", resList);
+//                HttpEntity<Object> insertEntity = new HttpEntity<>(insertBody, insertHeaders);
+                HttpEntity<List<TisTimeVO>> insertEntity = new HttpEntity<>(resList, headers);
                 ResponseEntity<String> tisResponse = restTemplate.exchange(insertUrl, HttpMethod.POST, insertEntity, String.class);
                 if (tisResponse.getStatusCode() == HttpStatus.OK) {
                     System.out.println("插入成功");
@@ -129,12 +131,17 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
     @Override
     public HttpRespMsg getByMonth(Integer companyId, String ymonth, Integer reGenerate, HttpServletRequest request) throws Exception {
         //获取该月份的数据,如果没有自动生成
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
         String token = request.getHeader("token");
         User user = userMapper.selectById(token);
         FinanceMonthlyWorktime financeMonthlyWorktime = financeMonthlyWorktimeMapper.selectOne(new LambdaQueryWrapper<FinanceMonthlyWorktime>().eq(FinanceMonthlyWorktime::getCompanyId, companyId).eq(FinanceMonthlyWorktime::getYmonth, ymonth));
         Integer detailCount = 0;
         if (financeMonthlyWorktime != null) {
             if (reGenerate== 1) {
+                if (financeMonthlyWorktime.getStatus() == 1) {
+                    httpRespMsg.setError("已定稿,无法重置");
+                    return httpRespMsg;
+                }
                 //删除明细数据
                 fmwDetailMapper.delete(new LambdaQueryWrapper<FmwDetail>().eq(FmwDetail::getFmwId, financeMonthlyWorktime.getId()));
             } else {
@@ -201,10 +208,6 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
                     departmentList.stream().filter(d->d.getDepartmentId().equals(report.getDeptId())).findFirst().ifPresent(d->{
                         fmwDetail.setDeptCode(d.getDeptCode());
                         fmwDetail.setDeptName(d.getDepartmentName());
-                        //为提高可读性,从erpOrderInfo表中获取部门名称
-                        erpOrderInfoList.stream().filter(e->e.getDeptId().equals(d.getDeptCode())).findFirst().ifPresent(e->{
-                            fmwDetail.setDeptName(e.getDeptName());
-                        });
                     });
                     setFmwTime(fmwDetail, report);
                     //从assistList中获取协作工时
@@ -299,23 +302,26 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
                                         }
                                     }
                                 }
-                            }
-
-                            List<FmwDetail> fmwDetails = insertDataList.stream().filter(fmwDetail -> fmwDetail.getDeptId().equals(deptId)).collect(Collectors.toList());
-                            double assistDeptTotalTime = fmwDetails.stream().reduce(0.0, (a, b) -> a + b.getMaintanceTime() + b.getDebugTime() + b.getWaitingTime(), Double::sum);
-                            if (assistDeptTotalTime > 0) {
-                                //计算总工时: 用维修组装工时,调试工时和等料工时相加
-                                insertDataList.forEach(fmwDetail -> {
-                                    //计算每一个项目的部门内部工时占比,按比例分摊公共工时
-                                    if (fmwDetail.getProjectId().equals(publicReportDeptItem.getProjectId())) {
-                                        double curProjectTime = fmwDetail.getMaintanceTime() + fmwDetail.getDebugTime() + fmwDetail.getWaitingTime();
-                                        double assignTime = curProjectTime / assistDeptTotalTime * publicReportDeptItem.getWorkingTime();
-                                        fmwDetail.setPublicTime(assignTime);
-                                    }
-                                });
                             } else {
-                                throw new Exception("存在部门公共工时无法分配,来源deptId=="+deptId);
+                                //本部门也没有协作其他部门产生工单工时
+                                throw new Exception("公共工时无法分配,因为本部门没有协作其他部门产生工单工时,deptId=="+deptId);
                             }
+
+//                            List<FmwDetail> fmwDetails = insertDataList.stream().filter(fmwDetail -> fmwDetail.getDeptId().equals(deptId)).collect(Collectors.toList());
+//                            double assistDeptTotalTime = fmwDetails.stream().reduce(0.0, (a, b) -> a + b.getAssistTime(), Double::sum);
+//                            if (assistDeptTotalTime > 0) {
+//                                //计算总工时: 用维修组装工时,调试工时和等料工时相加
+//                                insertDataList.forEach(fmwDetail -> {
+//                                    //计算每一个项目的部门内部工时占比,按比例分摊公共工时
+//                                    if (fmwDetail.getProjectId().equals(publicReportDeptItem.getProjectId())) {
+//                                        double curProjectTime = fmwDetail.getMaintanceTime() + fmwDetail.getDebugTime() + fmwDetail.getWaitingTime();
+//                                        double assignTime = curProjectTime / assistDeptTotalTime * publicReportDeptItem.getWorkingTime();
+//                                        fmwDetail.setPublicTime(assignTime);
+//                                    }
+//                                });
+//                            } else {
+//                                throw new Exception("存在部门公共工时无法分配,来源deptId=="+deptId);
+//                            }
                         }
                     }
                 }
@@ -328,9 +334,8 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
         //查询数据
         List<FmwDetail> details = fmwDetailMapper.selectList(new QueryWrapper<FmwDetail>().eq("fmw_id", financeMonthlyWorktime.getId()));
         financeMonthlyWorktime.setDetailList(details);
-        HttpRespMsg msg = new HttpRespMsg();
-        msg.data = financeMonthlyWorktime;
-        return msg;
+        httpRespMsg.data = financeMonthlyWorktime;
+        return httpRespMsg;
     }
 
     private void setFmwTime(FmwDetail fmwDetail, Report report) {

+ 5 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -2581,7 +2581,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
 
     //获取查询者所在公司每个项目的工时成本
     @Override
-    public HttpRespMsg getTimeCost(String startDate, String endDate, String userIds,Integer projectId, Integer type,HttpServletRequest request) {
+    public HttpRespMsg getTimeCost(String startDate, String endDate, String userIds,Integer projectId, Integer type,Integer status,HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
             //根据系统配置的员工成本计算方式,按固定时薪还是固定月薪,分情况计算。
@@ -2642,7 +2642,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 String[] split = userIds.split(",");
                 userIdList = Arrays.asList(split);
             }
-            List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userIdList,deptIds,null, deptRelatedProjectIds, projectIds, inchargeUserIds,null);
+            List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userIdList,deptIds,null, deptRelatedProjectIds, projectIds, inchargeUserIds,null,status);
             BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
             for (Map<String, Object> map : list) {
                 if (!map.containsKey("cost")) {
@@ -2684,6 +2684,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         return httpRespMsg;
     }
 
+
     private HashMap fillMainProjectRowData(Integer projectMainId, Integer companyId, String startDate, String endDate, Integer stateKey, List<String> userIdList, List<Map<String, Object>> list,
                                            List<UserCustom> userCustoms, List<SysRichFunction> functionTimeList, List<SysRichFunction> functionCostList,
                                            String exportContent, List<User> userList, List<Integer> deptIds, List<Integer> deptRelatedProjectIds,
@@ -2833,7 +2834,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     //导出查询者所在公司每个项目的工时成本,包括项目人员明细统计
     @Override
     public HttpRespMsg exportTimeCost(Integer withMainProject, String exportContent,String startDate, String endDate,Integer projectId, String userIds,
-                                      Boolean projectSum,Integer type,Integer deptId, Integer stateKey, Integer withPercent,Integer projectCategoryId, HttpServletRequest request) {
+                                      Boolean projectSum,Integer type,Integer deptId, Integer stateKey, Integer withPercent,Integer projectCategoryId,Integer status, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
             User targetUser = userMapper.selectById(request.getHeader("Token"));
@@ -2914,7 +2915,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 String[] split = userIds.split(",");
                 userIdList = Arrays.asList(split);
             }
-            List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userIdList,deptIds,filterDeptIds,deptRelatedProjectIds, manProjectIds, inchargeUserIds,projectCategoryId);
+            List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userIdList,deptIds,filterDeptIds,deptRelatedProjectIds, manProjectIds, inchargeUserIds,projectCategoryId,status);
             BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
             List<List<String>> allList=null ;
             List<String> sumRow = null;

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

@@ -2125,7 +2125,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 String name = (String)a.get("name");
                 String uid = (String)a.get("userId");
                 String corpwxUserid = (String)a.get("corpwxUserid");
-
+                System.out.println("createDate=="+createDate + " name=="+name+" uid=="+uid+" corpwxUserid=="+corpwxUserid);
                 if (lastName == null || !(lastName.get("name").equals(name) && lastName.get("dateStr").equals(createDate))) {
                     lastName = new HashMap<String, Object>();
                     lastName.put("dateStr", createDate);

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

@@ -739,6 +739,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             });
             functionQueryWrapper.orderByAsc("seq");
             List<SysFunction> functionList = sysFunctionMapper.selectList(functionQueryWrapper);
+            //对于一些特定功能的权限做判断过滤
+            if (timeType.getTaskFileCharge() == 0) {
+                functionList = functionList.stream().filter(f -> !f.getName().equals("查看他人审核文件")).collect(Collectors.toList());
+            }
             functionList = functionList.stream().filter(f->functionIdList.contains(f.getId())).collect(Collectors.toList());
             user.setFunctionList(functionList);
         } else {

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/MD5Util.java

@@ -22,7 +22,7 @@ public class MD5Util {
     }
 
     public static void main(String[] args) throws ParseException {
-        System.out.println(getPassword("工时管家"));
+        System.out.println(getPassword("Dy890606@1"));
 
     }
 

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ErpOrderInfoMapper.xml

@@ -4,10 +4,10 @@
 <mapper namespace="com.management.platform.mapper.ErpOrderInfoMapper">
 
     <insert id="batchInsert">
-        insert into erp_order_info(order_id, project_id, project_name, line, status,rels_date,dept_id,dept_name)
+        insert into erp_order_info(order_id, project_id, project_name, line, status,rels_date,moDId,dept_id,dept_name)
         VALUES
             <foreach collection="resList" separator="," item="res">
-                (#{res.orderId},#{res.projectId},#{res.projectName},#{res.line},#{res.status},#{res.relsDate},#{res.deptId},#{res.deptName})
+                (#{res.orderId},#{res.projectId},#{res.projectName},#{res.line},#{res.status},#{res.relsDate},#{res.moDId},#{res.deptId},#{res.deptName})
             </foreach>
     </insert>
     <select id="getExistIds" resultType="java.lang.String">

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -161,6 +161,9 @@
         <if test="projectId != null">
             AND a.id = #{projectId}
         </if>
+        <if test="status != null">
+            AND a.status = #{status}
+        </if>
         <if test="categoryId != null">
             AND a.category = #{categoryId}
         </if>
@@ -218,6 +221,7 @@
         ORDER BY a.id ASC
     </select>
 
+
     <!--获取查询者所在公司每个子项目的工时成本-->
     <select id="getSubProjectTimeCost" resultType="java.util.Map">
         select b.project_code as projectCode,b.project_name as projectName,a.code as subProjectCode,a.name as subProjectName,SUM(c.cost) as cost,SUM(c.working_time) as workingTime

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet/src/permissions.js

@@ -113,6 +113,7 @@ const StringUtil = {
         reportProjectConsumptionFirst: false, // 分组耗用进度表 //
         reportProjectConsumptionTwo: false, // 项目耗用进度表 //
         reportStaffTaskAccomplished: false, // 员工任务完成表 //
+        reportMonthlyFinancialWorkSchedule: false, // 月度财务工时表 //
 
         // 请假模块
         leaveFil : false, // 请假填报 // 
@@ -287,6 +288,7 @@ const StringUtil = {
         arr[i] == '全部项目耗用进度表' || arr[i] == '负责部门项目耗用进度表' ? obj.reportProjectConsumptionTwo = true : ''
         arr[i] == '全部员工任务进度表' || arr[i] == '负责部门员工任务进度表' ? obj.reportStaffTaskAccomplished = true : ''
         arr[i] == '全部员工任务完成情况表' || arr[i] == '负责部门员工任务完成情况表' ? obj.takCompletedStatus = true : ''
+        arr[i] == '月度财务工时表' || arr[i] == '月度财务工时表' ? obj.reportMonthlyFinancialWorkSchedule = true : ''
 
         arr[i] == '新增立项申请'  ? obj.projectApprovalNew = true : ''
         arr[i] == '导入立项申请'  ? obj.projectApprovalImport = true : ''

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

@@ -51,6 +51,7 @@
                   <el-menu-item index="1-29" v-if="permissions.takCompletedStatus" @click="ssl(28)"><p>{{ $t('yuanGongRenWuWanChengQingKuangBiao') }}</p></el-menu-item>
                   <el-menu-item index="1-30" v-if="permissions.taskPlanCost" @click="ssl(29)"><p>{{ $t('taskPlanCostReport') }}</p></el-menu-item>
                   <el-menu-item index="1-31" v-if="permissions.reportFTEPlanAll || permissions.reportFTEPlanPart" @click="ssl(30)"><p>FTE计划报表</p></el-menu-item>
+                  <el-menu-item index="1-32" v-if="permissions.reportMonthlyFinancialWorkSchedule" @click="ssl(31)"><p>月度财务工时表</p></el-menu-item>
                 </el-submenu>
               </el-menu>
           </el-col>
@@ -231,15 +232,58 @@
           <el-select v-if="ins == 5" multiple v-model="stageNames" @visible-change="visibleSelcts" @clear="visibleSelcts(false)" clearable size="small" filterable collapse-tags :placeholder="$t('pleaseselectstage')" style="margin-left:10px;">
             <el-option v-for="item in firstStages" :key="item" :label="item" :value="item"></el-option>
           </el-select>
+
+          <!-- 月度财务报表单独筛选条件 -->
+          <template v-if="ins == 31">
+            <div class="monthlyFinance">
+              <div class="monthlyFinance-item">
+                <el-date-picker v-model="obtainMonthlyFinancialStatementsYmonth" type="month" placeholder="选择月" :clearable="false" @change="selcts()" size="small" value-format="yyyy-MM" style="width: 160px"></el-date-picker>
+                <el-button size="small" style="margin-left: 15px;" @click="resetWorkingHours()">重置工时</el-button>
+                <el-tooltip class="item" effect="dark" placement="bottom">
+                  <div slot="content">
+                    以当月人工填报工时进行统计,公共工时自动分摊 <br/><br/>
+                    部门A填报的公共工时分摊算法: <br/>
+                    1.部门A有本部门工时(车间组装/维修工时)的情况下,以本部门的各个项目工单行号为一组,按照每组的工时占比进行分摊到该组上。 注意:本部门工时不含其他部门协作的工时。<br/>
+                    2.部门A没有本部门工时的情况下,部门A有协作其他部门的工时,将部门A的公共工时按其他协作部门(可能有多个)的占比分给其他部门,再按照其他部门的每组工时占比分到该部门的各个组上。<br/>
+                  </div>
+                  <el-link type="warning" :underline="false" style="margin-left: 15px;">查看说明</el-link>
+                </el-tooltip>
+              </div>
+              <div class="monthlyFinance-item">
+                工单结算日期{{ obtainMonthlyFinancialModificationDate ? '(修改日期)' : '' }}:
+                <template v-if="!obtainMonthlyFinancialModificationDate">
+                  {{ obtainMonthlyFinancialStatementsRows.timesheetDate }}
+                  <el-link type="primary" :underline="false" style="margin-left: 15px;" @click="modificationDate()">修改日期</el-link>
+                </template>
+                <template v-else>
+                  <el-date-picker v-model="obtainMonthlyFinancialsRowsDates" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" size="small" :clearable="false" style="margin-right: 15px;width: 160px"></el-date-picker>
+                  <el-button size="small" @click="obtainMonthlyFinancialModificationDate = false">取消</el-button>
+                  <el-button type="primary" size="small" @click="modificationDateClick()">确定</el-button>
+                </template>
+              </div>
+              <div style="width: 10%;"></div>
+            </div>
+          </template>
       </div>
       <!-- <p :style="ins == 9 ? 'float: right;margin-right: 25px;width:20%' : 'float: right;margin-right: 25px;width:10%'" > -->
-      <p :style="`${ins == 9 || ins == 14 || ins == 21 ? 'width: 20%' : 'width: 10%'}`" class="tableRightBtn">
+      <p :style="`${ins == 9 || ins == 14 || ins == 21 ? 'width: 20%' : 'width: 10%'}`" class="tableRightBtn" v-if="ins != 31">
         <el-button type="primary" :loading="exportReportLoading" @click="exportExcel" size="mini">{{ $t('reporderived') }}</el-button>
         <el-button type="primary" @click="fillAll" size="mini" v-if="ins == 14">{{ $t('quanBuBuZu') }}</el-button>
         <el-button type="primary" @click="exportExcelByQuarter" size="mini" v-if="ins == 9 && user.companyId == 876">{{ $t('an-ji-du-dao-chu') }}</el-button>
         <el-button type="primary" @click="setWarning" size="mini" v-if="ins == 21">{{ $t('sheZhiYuJing') }}</el-button>
       </p>
       
+      <div v-if="ins == 31" style="width: 15%" class="tableRightBtn">
+        <template v-if="!obtainMonthlyFinancialStatementsRows.lastSendTime">
+          <el-button type="success" size="small" @click="confirmTheFinalDraft()" :disabled="obtainMonthlyFinancialStatementsRows.status">
+            {{ obtainMonthlyFinancialStatementsRows.status == 1 ? '已定稿' : '确定定稿' }}
+          </el-button>
+          <el-button type="primary" size="small" @click="immediateVisableCli()" :disabled="!obtainMonthlyFinancialStatementsRows.timesheetDate">立即发送</el-button>
+        </template>
+        <el-link type="success" :underline="false" v-else>
+          {{ obtainMonthlyFinancialStatementsRows.lastSendTime }} 已发送
+        </el-link>
+      </div>
     </div>
     <div ref="staff" style="margin: 5px 0px 0px 10px; width: 98%">
         <div class="staff" ref="tabless" :style="'width:'+(windowWidth - 430)+'px'">
@@ -1528,8 +1572,43 @@
               <el-table-column align="center" prop="planHours" label="计划工时" min-width="150"></el-table-column>
               <el-table-column align="center" prop="FTE" :label="'计划FTE(计划工时/当月计划工时基数)'" min-width="250"></el-table-column>
           </el-table>
+
+          <!-- 月度财务工时表 -->
+          <el-table v-if="ins == 31"  key="31" border :data="obtainMonthlyFinancialStatementsRows.detailList" highlight-current-row v-loading="obtainMonthlyFinancialStatementsLoading" :height="+tableHeight + 50" show-summary :summary-method="monthlyFinancialStatistics" style="width: 100%;" :max-height="+tableHeight + 50">
+            <el-table-column prop="projectCode" align="center" label="项目号"></el-table-column>
+            <el-table-column prop="extraField4" align="center" label="工单号"></el-table-column>
+            <el-table-column prop="extraField5" align="center" label="行号"></el-table-column>
+            <el-table-column label="车间组装/维修工时(h)" align="center">
+              <el-table-column prop="maintanceTime" align="center" label="组装/维修工时(h)" width="130px">
+                <template slot-scope="scope">
+                  <el-link type="primary" :underline="false" @click="adjustWorkingHours(scope.row, '组装/维修工时',scope.row.maintanceTime,'maintanceTime')">{{ scope.row.maintanceTime }}</el-link>
+                </template>
+              </el-table-column>
+              <el-table-column prop="debugTime" align="center" label="调试工时(h)" width="120px">
+                <template slot-scope="scope">
+                  <el-link type="primary" :underline="false" @click="adjustWorkingHours(scope.row, '调试工时',scope.row.debugTime,'debugTime')">{{ scope.row.debugTime }}</el-link>
+                </template>
+              </el-table-column>
+              <el-table-column prop="waitingTime" align="center" label="等料工时(h)" width="120px">
+                <template slot-scope="scope">
+                  <el-link type="primary" :underline="false" @click="adjustWorkingHours(scope.row, '等料工时',scope.row.waitingTime,'waitingTime')">{{ scope.row.waitingTime }}</el-link>
+                </template>
+              </el-table-column>
+            </el-table-column>
+            <el-table-column prop="assistTime" align="center" label="协助工时(h)" width="120px">
+              <template slot-scope="scope">
+                <el-link type="primary" :underline="false" @click="adjustWorkingHours(scope.row, '协助工时',scope.row.assistTime,'assistTime')">{{ scope.row.assistTime }}</el-link>
+              </template>
+            </el-table-column>
+            <el-table-column prop="publicTime" align="center" label="公摊工时(h)" width="120px">
+              <template slot-scope="scope">
+                <el-link type="primary" :underline="false" @click="adjustWorkingHours(scope.row, '公摊工时',scope.row.publicTime,'publicTime')">{{ scope.row.publicTime }}</el-link>
+              </template>
+            </el-table-column>
+            <el-table-column prop="totalTime" align="center" label="工时合计(h)" width="120px"></el-table-column>
+          </el-table>
         <!--工具条-->
-        <el-col :span="24" class="toolbar" v-if="ins != 6 && ins != 20 && ins != 21 && tabPosition==0 && tabsType == 'all'">
+        <el-col :span="24" class="toolbar" v-if="ins != 6 && ins != 20 && ins != 21 && tabPosition==0 && tabsType == 'all' && ins != 31">
           <el-pagination
                 v-if="ins == 12"
                 @size-change="groupSizeChange"
@@ -1873,6 +1952,34 @@
             <el-button @click="otherExpensesVisable = false">关闭</el-button>
           </span>
         </el-dialog>
+
+        <!-- 修改工时 -->
+        <el-dialog :title="adjustWorkingHoursRow.titleValue" :visible.sync="adjustWorkingHoursVisable" width="680px" top="5.6vh" :before-close="handleClose">
+          <div>
+            <div class="adjustWorkingHours">
+              <div>项目号:{{ adjustWorkingHoursRow.projectCode }}</div>
+              <div>工单号: {{ adjustWorkingHoursRow.extraField4 }}</div>
+              <div>行号: {{ adjustWorkingHoursRow.extraField5 }}</div>
+            </div>
+            <el-input-number v-model="adjustWorkingHoursRow.timeValue" controls-position="right" :min="0" style="width: 100%;margin-top:20px;" size="small"></el-input-number>
+          </div>
+          <span slot="footer" class="dialog-footer">
+            <el-button type="primary" @click="adjustWorkingHoursClick()">确定</el-button>
+          </span>
+        </el-dialog>
+
+        <!-- 立即发送 -->
+        <el-dialog title="立即发送" :visible.sync="immediateVisable" width="680px" top="5.6vh" :before-close="handleClose">
+          <div>
+            <div class="adjustWorkingHours">
+              <div>工单结算日期</div>
+              <el-date-picker v-model="immediateDateValue" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" size="small" :clearable="false" style="margin-left: 15px;"></el-date-picker>
+            </div>
+          </div>
+          <span slot="footer" class="dialog-footer">
+            <el-button type="primary" @click="immediate()">确认发送</el-button>
+          </span>
+        </el-dialog>
   </section>
 </template>
 
@@ -1901,7 +2008,7 @@ export default {
     return {
       themeColor: getThemeColor(),
       screeningCondition: { // 筛选条件的判断
-        project: [4, 8, 9, 10, 11, 14, 15, 17, 19, 20, 21, 22, 28, 30], // 项目筛选条件 (不等于)
+        project: [4, 8, 9, 10, 11, 14, 15, 17, 19, 20, 21, 22, 28, 30, 31], // 项目筛选条件 (不等于)
         months: [14, 15], // 月份筛选条件 (等于)
         monthRange: [19, 30], // 月份区间筛选条件 (等于)
         staff: [6, 8, 9, 19, 11, 14, 18, 23, 25, 26,28, 30], // 人员筛选条件 (等于)
@@ -1965,14 +2072,14 @@ export default {
       this.$t('statisticsofovertimework'),this.$t('timecostearlywarningtable'),this.$t('personneltimeallocationtable'),
       this.$t('statisticsofstafffillingintimerate'),this.$t('dailyreporttobereviewedstatistics'),this.$t('statisticsofpersonnelhours'),this.$t('taskgrouptimesheet'),this.$t('projectcostbaselinetable'),
       this.$t('ren-yuan-yue-du-gong-shi-biao'), this.$t('bumenchanyuqingkuang'), this.$t('ge-fen-zu-yu-jie-duan-gong-shi-biao'), this.$t('ziXiangMuGongShiChengBenBiao'), this.$t('renWuZhongQiBiao'), this.$t('fteBaoBiao'), this.$t('youXiaoGongShiShuaiBiao'), this.$t('xiangMuFenLeiGongShiZhanBiBiao'), this.$t('fenLeiGongShiMingXiBiao'),
-      this.$t('yuanGongXiangMuJinDuBiao'), this.$t('fenZuHaoYongJinDuBiao'), this.$t('xiangMuHaoYongJinDuBiao'), this.$t('yuanGongRenWuJinDuBiao'), this.$t('xiangMuYuGuGongShiBiao'),this.$t('yuanGongRenWuWanChengQingKuangBiao'), this.$t('taskPlanCostReport'), 'FTE计划报表'],
+      this.$t('yuanGongXiangMuJinDuBiao'), this.$t('fenZuHaoYongJinDuBiao'), this.$t('xiangMuHaoYongJinDuBiao'), this.$t('yuanGongRenWuJinDuBiao'), this.$t('xiangMuYuGuGongShiBiao'),this.$t('yuanGongRenWuWanChengQingKuangBiao'), this.$t('taskPlanCostReport'), 'FTE计划报表', '月度财务工时表'],
 
       shuzArr: [this.$t('projectreport'),this.$t('projectTaskReport'),this.$t('projectcoststatement'),
       this.$t('projectbalancesheet'),this.$t('customerprojectincomestatement'),this.$t('projectphasetimesheet'),
       this.$t('statisticsofovertimework'),this.$t('timecostearlywarningtable'),this.$t('personneltimeallocationtable'),
       this.$t('employeereporttimelinessrate'),this.$t('dailyreporttobereviewedstatistics'),this.$t('statisticsofpersonnelhours'),this.$t('taskgrouptimesheet'),this.$t('projectcostbaselinetable'),
       this.$t('ren-yuan-yue-du-gong-shi-biao'), this.$t('bumenchanyuqingkuang'), this.$t('ge-fen-zu-yu-jie-duan-gong-shi-biao'), this.$t('ziXiangMuGongShiChengBenBiao'), this.$t('renWuZhongQiBiao'), this.$t('fteBaoBiao'),this.$t('youXiaoGongShiShuaiBiao'), this.$t('xiangMuFenLeiGongShiZhanBiBiao'), this.$t('fenLeiGongShiMingXiBiao'),
-      this.$t('yuanGongXiangMuJinDuBiao'), this.$t('fenZuHaoYongJinDuBiao'), this.$t('xiangMuHaoYongJinDuBiao'), this.$t('yuanGongRenWuJinDuBiao'), this.$t('xiangMuYuGuGongShiBiao'),this.$t('yuanGongRenWuWanChengQingKuangBiao'), this.$t('taskPlanCostReport'), 'FTE计划报表'],
+      this.$t('yuanGongXiangMuJinDuBiao'), this.$t('fenZuHaoYongJinDuBiao'), this.$t('xiangMuHaoYongJinDuBiao'), this.$t('yuanGongRenWuJinDuBiao'), this.$t('xiangMuYuGuGongShiBiao'),this.$t('yuanGongRenWuWanChengQingKuangBiao'), this.$t('taskPlanCostReport'), 'FTE计划报表', '月度财务工时表'],
 
       ins: 10000,
       user: JSON.parse(sessionStorage.user),
@@ -2145,7 +2252,17 @@ export default {
       otherExpensesRow: {
         projectExpenseFeeList: []
       },
-      otherExpensesVisable: false
+      otherExpensesVisable: false,
+
+      obtainMonthlyFinancialStatementsRows: {}, // 月度财务工时表
+      obtainMonthlyFinancialStatementsYmonth: this.dayjs(new Date()).format('YYYY-MM'),
+      obtainMonthlyFinancialStatementsLoading: false,
+      obtainMonthlyFinancialModificationDate: false,
+      obtainMonthlyFinancialsRowsDates: '',
+      adjustWorkingHoursRow: {},
+      adjustWorkingHoursVisable: false,
+      immediateVisable: false,
+      immediateDateValue: '',
     };
   },
   computed: {},
@@ -2315,6 +2432,8 @@ export default {
       if(this.permissions.reportProjectEstimated) {this.ssl(27);this.reportProjectEstimated = '1-28';return} else
       if(this.permissions.takCompletedStatus) {this.ssl(28);this.takCompletedStatus = '1-29';return} else
       if(this.permissions.taskPlanCost) {this.ssl(29);this.takCompletedStatus = '1-30';return} else
+      if(this.permissions.reportFTEPlanAll || this.permissions.reportFTEPlanPart) {this.ssl(30);this.takCompletedStatus = '1-31';return} else
+      if(this.permissions.reportMonthlyFinancialWorkSchedule) {this.ssl(31);this.takCompletedStatus = '1-32';return} else
       {this.allWrong = false}
     },
     rowspan(spanArr,position,spanName,dataItem = [],fields=false){
@@ -2619,7 +2738,7 @@ export default {
                 this.getGroupWorktimeAll()
             },
             getList(e) {
-              let noUserList = [16, 17, 18, 19, 20, 21, 22, 24, 25, 26,27,29,30]
+              let noUserList = [16, 17, 18, 19, 20, 21, 22, 24, 25, 26,27,29,30,31]
               if(this.ins == 24) {
                 if(this.tabsType == 'all') {
                   this.rangeDatas = []
@@ -2719,6 +2838,9 @@ export default {
                 if (this.ins == 29) {
                   this.getTaskPlanAndRealCost();
                 }
+                if (this.ins == 31) {
+                  this.getObtainMonthlyFinancialStatements();
+                }
             },
       exportExcel() {
         var url = "/project";
@@ -4439,32 +4561,6 @@ export default {
       this.setWarningModal = true
       this.getForewarningTableList()
     },
-    // 单独封装请求
-    async postData(urls, param) {
-      return new Promise((resolve, reject) => {
-        this.http.post(urls, { ...param },
-          res => {
-            if(res.code == 'ok') {
-              resolve(res)
-            } else {
-              this.$message({
-                message: res.msg,
-                type: 'error'
-              })
-              reject(res)
-            }
-            resolve(res)
-          },
-          error => {
-            this.$message({
-              message: error,
-              type: "error"
-            });
-            reject(error)
-          }
-        )
-      });
-    },
     // 获取项目分类工时占比表
     async getProjectWoekScale() {
       let params = {
@@ -4855,7 +4951,171 @@ export default {
       this.postData('/project/getAllMainProject', {}).then((res) => {
         this.projectMainIdList = res.data || []
       })
-    }
+    },
+    // 重置工时
+    resetWorkingHours() {
+      this.$confirm('确定重置工时吗?', '重置工时', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.getObtainMonthlyFinancialStatements(1)
+      })
+    },
+    // 获取月度财务工时表
+    getObtainMonthlyFinancialStatements(reGenerate = '') {
+      this.obtainMonthlyFinancialStatementsLoading = true
+      this.postData(`/finance-monthly-worktime/getByMonth`, {
+        companyId: this.user.companyId,
+        ymonth: this.obtainMonthlyFinancialStatementsYmonth,
+        reGenerate: reGenerate
+      }).then(res => {
+        if(reGenerate) {
+          this.$message({
+            message: '重置成功',
+            type: 'success'
+          })
+        }
+        this.obtainMonthlyFinancialStatementsRows = {
+          ...res.data,
+          detailList: (res.data.detailList || []).map(item => {
+            const timeFields = ['maintanceTime', 'debugTime', 'waitingTime', 'assistTime', 'publicTime'];
+            const totalTime = timeFields.reduce((sum, key) => sum + (item[key] || 0), 0);
+            return { ...item, totalTime };
+          })
+        };
+      }).finally(() => {
+        this.obtainMonthlyFinancialStatementsLoading = false
+      })
+    },
+    modificationDate() {
+      const { timesheetDate = '' } = this.obtainMonthlyFinancialStatementsRows
+      this.obtainMonthlyFinancialsRowsDates = timesheetDate
+      this.obtainMonthlyFinancialModificationDate = true
+    },
+    modificationDateClick() {
+      this.postData(`/finance-monthly-worktime/setTimesheetDate`, {
+        id: this.obtainMonthlyFinancialStatementsRows.id,
+        timesheetDate: this.obtainMonthlyFinancialsRowsDates,
+      }).then(res => {
+        this.obtainMonthlyFinancialModificationDate = false
+        this.getObtainMonthlyFinancialStatements()
+        this.$message({
+          message: `修改成功`,
+          type: 'success'
+        })
+      })
+    },
+    confirmTheFinalDraft() {
+      this.$confirm('确定定稿吗?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.postData(`/finance-monthly-worktime/setStatusFinal`, {
+          id: this.obtainMonthlyFinancialStatementsRows.id,
+        }).then(res => {
+          this.getObtainMonthlyFinancialStatements()
+          this.$message({
+            message: `操作成功`,
+            type: 'success'
+          })
+        })
+      })
+      
+    },
+    immediateVisableCli() {
+      this.immediateDateValue = JSON.parse(JSON.stringify(this.obtainMonthlyFinancialStatementsRows.timesheetDate))
+      console.log(this.immediateDateValue, '<==== 123321')
+      this.immediateVisable = true
+    },
+    immediate() {
+      this.postData(`/finance-monthly-worktime/send`, {
+        id: this.obtainMonthlyFinancialStatementsRows.id,
+        timesheetDate: this.immediateDateValue,
+      }).then(res => {
+        this.immediateVisable = false
+        this.getObtainMonthlyFinancialStatements()
+        this.$message({
+          message: `发送成功`,
+          type: 'success'
+        })
+      })
+    },
+    // 月度财务统计
+    monthlyFinancialStatistics({ columns, data }) {
+      const timeFields = ['maintanceTime', 'debugTime', 'waitingTime', 'assistTime', 'publicTime', 'totalTime'];
+      const sums = [];
+
+      columns.forEach((column, index) => {
+        const prop = column.property;
+
+        if (index === 0) {
+          sums[index] = '合计';
+          return;
+        }
+
+        if (timeFields.includes(prop)) {
+          const total = data.reduce((sum, row) => {
+            const value = Number(row[prop]);
+            return sum + (isNaN(value) ? 0 : value);
+          }, 0);
+          sums[index] = total.toFixed(2);
+        } else {
+          sums[index] = '';
+        }
+      });
+      console.log(sums)
+      return sums;
+    },
+    adjustWorkingHours(row, title = '', value, filed) {
+      this.adjustWorkingHoursRow = {
+        ...row,
+        filed,
+        titleValue: title + "(修改)",
+        timeValue: Number(value || 0)
+      }
+      this.adjustWorkingHoursVisable = true
+    },
+    adjustWorkingHoursClick() {
+      const { id, filed = '', timeValue = 0 } = this.adjustWorkingHoursRow
+      this.postData(`/finance-monthly-worktime/changeWorktime`, {
+        id, [filed]: timeValue,
+      }).then(res => {
+        this.adjustWorkingHoursVisable = false
+        this.getObtainMonthlyFinancialStatements()
+        this.$message({
+          message: `操作成功`,
+          type: 'success'
+        })
+      })
+    },
+    // 单独封装请求
+    async postData(urls, param) {
+      return new Promise((resolve, reject) => {
+        this.http.post(urls, { ...param },
+          res => {
+            if(res.code == 'ok') {
+              resolve(res)
+            } else {
+              this.$message({
+                message: res.msg,
+                type: 'error'
+              })
+              reject(res)
+            }
+            resolve(res)
+          },
+          error => {
+            this.$message({
+              message: error,
+              type: "error"
+            });
+            reject(error)
+          }
+        )
+      });
+    },
   },
 };
 </script>
@@ -4864,6 +5124,23 @@ export default {
 .themeFontColor {
   @include font_color("color");
 }
+.monthlyFinance {
+  display: flex;
+  justify-content: space-between;
+  width: 100%;
+  .monthlyFinance-item {
+    display: flex;
+    align-items: center;
+    color: #999999;
+  }
+}
+.adjustWorkingHours {
+  display: flex;
+  align-items: center;
+  div {
+    margin-right: 20px;
+  }
+}
 .pagingTable {
   flex: 1 1 0%;
   overflow: hidden;

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

@@ -43,6 +43,13 @@
                         <el-button @click="backToParentDept" size="small">返回上级</el-button>
                     </div>
 
+                    <el-select v-model="projectStatus" placeholder="请选择项目状态" clearable @change="filterConditionSwitching" v-if="singleChoiceType == '项目'" size="small" style="margin-right: 10px">
+                        <el-option label="进行中" value="1"></el-option>
+                        <el-option label="已完成" value="2"></el-option>
+                        <el-option label="已撤销" value="3"></el-option>
+                        <el-option label="暂停" value="4"></el-option>
+                    </el-select>
+
                     <select-project v-model="chartProjectId" :size="'small'" :placeholder="'请选择项目'" clearable
                         v-if="singleChoiceType == '项目' || singleChoiceType == '设备' || singleChoiceType == namess"
                         @change="filterConditionSwitching"></select-project>
@@ -141,6 +148,7 @@ export default {
             reportExportVisable: false,
             hasReportUserList: [],
             theCustomListFlgBtnLoading: false,
+            projectStatus: '',
         }
     },
 
@@ -188,7 +196,7 @@ export default {
             const urlMap = {
                 ['项目']: {
                     url: this.port.project.listCost,
-                    extraParams: { projectId: this.chartProjectId, type: this.chartYAxisVal[this.chartYAxis] }
+                    extraParams: { projectId: this.chartProjectId, type: this.chartYAxisVal[this.chartYAxis], status: this.projectStatus ? this.projectStatus : '0' }
                 },
                 ['主项目']: { url: '/project/getTimeCostByMainProject' },
                 ['项目分类']: { url: '/project/getTimeCostByCategory' },