Browse Source

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

zhouyy 3 tuần trước cách đây
mục cha
commit
c7b8038f9b

+ 10 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/FmwDetail.java

@@ -15,7 +15,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2025-04-16
+ * @since 2025-04-25
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -73,10 +73,16 @@ public class FmwDetail extends Model<FmwDetail> {
     private String extraField5;
 
     /**
-     * 组装维修工时
+     * 组装工时
      */
-    @TableField("maintance_time")
-    private Double maintanceTime;
+    @TableField("compose_time")
+    private Double composeTime;
+
+    /**
+     * 维修工时
+     */
+    @TableField("repair_time")
+    private Double repairTime;
 
     /**
      * 调试工时

+ 25 - 14
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceMonthlyWorktimeServiceImpl.java

@@ -37,6 +37,17 @@ import java.util.stream.Collectors;
  */
 @Service
 public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthlyWorktimeMapper, FinanceMonthlyWorktime> implements FinanceMonthlyWorktimeService {
+    public static final String TIME_TYPE_COMPOSE = "组装工时(车间)";
+    public static final String TIME_TYPE_REPAIR = "维修工时(车间)";
+    public static final String TIME_TYPE_DEBUG = "调试工时(车间)";
+    public static final String TIME_TYPE_WAIT = "等料工时(车间)";
+    static List<String> groupNameList = new ArrayList<>();
+    {
+        groupNameList.add(TIME_TYPE_COMPOSE);
+        groupNameList.add(TIME_TYPE_REPAIR);
+        groupNameList.add(TIME_TYPE_DEBUG);
+        groupNameList.add(TIME_TYPE_WAIT);
+    }
 
     @Resource
     private FinanceMonthlyWorktimeMapper financeMonthlyWorktimeMapper;
@@ -173,12 +184,8 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
             List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, user.getCompanyId()));
             List<Project> projectList = projectMapper.selectList(new LambdaQueryWrapper<Project>().eq(Project::getCompanyId, user.getCompanyId()));
             List<Project> publicProjectList = projectList.stream().filter(p -> p.getIsPublic() == 1).collect(Collectors.toList());
-            List<ErpOrderInfo> erpOrderInfoList = erpOrderInfoMapper.selectList(new LambdaQueryWrapper<ErpOrderInfo>());
             List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().select(User::getId, User::getName, User::getDepartmentId).eq(User::getCompanyId, user.getCompanyId()));
-            List<String> groupNameList = new ArrayList<>();
-            groupNameList.add("组装/维修工时");
-            groupNameList.add("调试工时");
-            groupNameList.add("等料工时");
+
             List<Report> reportList = reportMapper.getReportProjectGroupDetailList(user.getCompanyId(), firstDayOfMonth, lastDayOfMonth, groupNameList);
             List<Report> assistList = reportMapper.getReportProjectAssistTime(user.getCompanyId(), firstDayOfMonth, lastDayOfMonth, groupNameList);
 
@@ -192,7 +199,8 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
                     setFmwTime(fmwDetail, report);
                 } else {
                     FmwDetail fmwDetail = new FmwDetail();
-                    fmwDetail.setMaintanceTime(0.0);
+                    fmwDetail.setComposeTime(0.0);
+                    fmwDetail.setRepairTime(0.0);
                     fmwDetail.setDebugTime(0.0);
                     fmwDetail.setWaitingTime(0.0);
                     fmwDetail.setAssistTime(0.0);
@@ -254,14 +262,14 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
                     for (Report publicReportDeptItem : publicReportList) {
                         Integer deptId = publicReportDeptItem.getDeptId();
                         List<FmwDetail> deptAllReportList = insertDataList.stream().filter(r -> r.getDeptId().equals(deptId)).collect(Collectors.toList());
-                        double totalDeptTime = deptAllReportList.stream().reduce(0.0, (a, b) -> a + b.getMaintanceTime() + b.getDebugTime() + b.getWaitingTime(), Double::sum);
+                        double totalDeptTime = deptAllReportList.stream().reduce(0.0, (a, b) -> a + b.getComposeTime() + b.getRepairTime() + b.getDebugTime() + b.getWaitingTime(), Double::sum);
                         System.out.println("处理公共工时分摊,总工时=="+totalDeptTime);
                         if (totalDeptTime > 0) {
                             //计算总工时: 用维修组装工时,调试工时和等料工时相加
                             insertDataList.forEach(fmwDetail -> {
                                 //计算每一个项目的部门内部工时占比,按比例分摊公共工时
                                 if (fmwDetail.getDeptId().equals(deptId)) {
-                                    double curProjectTime = fmwDetail.getMaintanceTime() + fmwDetail.getDebugTime() + fmwDetail.getWaitingTime();
+                                    double curProjectTime = fmwDetail.getComposeTime() + fmwDetail.getRepairTime() + fmwDetail.getDebugTime() + fmwDetail.getWaitingTime();
                                     double assignTime = curProjectTime / totalDeptTime * publicReportDeptItem.getWorkingTime();
                                     //理论上不会出现fmwDetail.getPublicTime()有值的情况,但是为了保险起见做个叠加计算吧
                                     fmwDetail.setPublicTime(fmwDetail.getPublicTime() == null ? assignTime : fmwDetail.getPublicTime() + assignTime);
@@ -285,13 +293,13 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
                                         //按目标部门的部门内部工时占比进行二次分配
                                         Integer assignToDeptId = assistDeptItem.getDeptId();
                                         List<FmwDetail> targetDeptReportList = insertDataList.stream().filter(r -> r.getDeptId().equals(assignToDeptId)).collect(Collectors.toList());
-                                        double totalTargetDeptTime = targetDeptReportList.stream().reduce(0.0, (a, b) -> a + b.getMaintanceTime() + b.getDebugTime() + b.getWaitingTime(), Double::sum);
+                                        double totalTargetDeptTime = targetDeptReportList.stream().reduce(0.0, (a, b) -> a + b.getComposeTime() + b.getRepairTime() + b.getDebugTime() + b.getWaitingTime(), Double::sum);
                                         if (totalTargetDeptTime > 0) {
                                             //计算总工时: 用维修组装工时,调试工时和等料工时相加
                                             insertDataList.forEach(fmwDetail -> {
                                                 //计算每一个项目的部门内部工时占比,按比例分摊公共工时
                                                 if (fmwDetail.getDeptId().equals(assignToDeptId)) {
-                                                    double curProjectTime = fmwDetail.getMaintanceTime() + fmwDetail.getDebugTime() + fmwDetail.getWaitingTime();
+                                                    double curProjectTime = fmwDetail.getComposeTime() + fmwDetail.getRepairTime() + fmwDetail.getDebugTime() + fmwDetail.getWaitingTime();
                                                     double assignTime = curProjectTime / totalTargetDeptTime * assignToDeptTime;
                                                     //可能之前已经有其他部门的分摊过来了,需要叠加
                                                     fmwDetail.setPublicTime(fmwDetail.getPublicTime() == null ? assignTime : fmwDetail.getPublicTime() +assignTime);
@@ -326,13 +334,16 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
 
     private void setFmwTime(FmwDetail fmwDetail, Report report) {
         switch (report.getGroupName()) {
-            case "组装/维修工时":
-                fmwDetail.setMaintanceTime(report.getWorkingTime());
+            case TIME_TYPE_COMPOSE:
+                fmwDetail.setComposeTime(report.getWorkingTime());
+                break;
+            case TIME_TYPE_REPAIR:
+                fmwDetail.setRepairTime(report.getWorkingTime());
                 break;
-            case "调试工时":
+            case TIME_TYPE_DEBUG:
                 fmwDetail.setDebugTime(report.getWorkingTime());
                 break;
-            case "等料工时":
+            case TIME_TYPE_WAIT:
                 fmwDetail.setWaitingTime(report.getWorkingTime());
                 break;
         }

+ 4 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/PermissionServiceImpl.java

@@ -356,6 +356,7 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
     public HttpRespMsg savePermission(Integer role, String moduleList) {
         User user = userMapper.selectById(request.getHeader("token"));
         HttpRespMsg authority = getAuthority(role,user.getCompanyId(), request);
+        SysRole sysRole = sysRoleMapper.selectById(role);
         List<SysModule> sysModuleList= (List<SysModule>) authority.data;
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         JSONArray array = JSONArray.parseArray(moduleList);
@@ -400,12 +401,12 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
             sysRoleFunctions.add(fun);
         }
         sysRoleFunctionService.saveBatch(sysRoleFunctions);
-        permissionModificationRecord(sysModuleList,moduleList,user);
+        permissionModificationRecord(sysModuleList,moduleList,user,sysRole);
         return httpRespMsg;
     }
 
     @Async("taskExecutor")
-    public void permissionModificationRecord(List<SysModule> oldSysModuleList,String newModuleList,User user){
+    public void permissionModificationRecord(List<SysModule> oldSysModuleList,String newModuleList,User user,SysRole sysRole){
         JSONArray array = JSONArray.parseArray(newModuleList);
         StringBuilder message=new StringBuilder();
         for (int i = 0; i < array.size(); i++) {
@@ -444,6 +445,7 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
         }
         System.out.println(message.toString());
         if(message.length()>0){
+            message.insert(0,"针对角色["+sysRole.getRolename()+"]的权限做了以下操作\n");
             OperationRecord operationRecord=new OperationRecord();
             operationRecord.setOperationTime(LocalDateTime.now());
             operationRecord.setContent(message.toString());

+ 8 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/FmwDetailMapper.xml

@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.management.platform.mapper.FmwDetailMapper">
+
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.management.platform.entity.FmwDetail">
         <id column="id" property="id" />
@@ -13,7 +13,8 @@
         <result column="project_code" property="projectCode" />
         <result column="extra_field4" property="extraField4" />
         <result column="extra_field5" property="extraField5" />
-        <result column="maintance_time" property="maintanceTime" />
+        <result column="compose_time" property="composeTime" />
+        <result column="repair_time" property="repairTime" />
         <result column="debug_time" property="debugTime" />
         <result column="waiting_time" property="waitingTime" />
         <result column="assist_time" property="assistTime" />
@@ -22,18 +23,18 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, fmw_id, dept_id, dept_name, dept_code, project_id, project_code, extra_field4, extra_field5, maintance_time, debug_time, waiting_time, assist_time, public_time
+        id, fmw_id, dept_id, dept_name, dept_code, project_id, project_code, extra_field4, extra_field5, compose_time, repair_time, debug_time, waiting_time, assist_time, public_time
     </sql>
     <select id="getTisTime" resultType="com.management.platform.entity.vo.TisTimeVO">
         select extra_field4 as orderId,extra_field5 as line
-             ,sum(maintance_time+debug_time+waiting_time+assist_time+public_time) as workTime
+             ,sum(compose_time+repair_time+debug_time+waiting_time+assist_time+public_time) as workTime
         from fmw_detail
         where fmw_id = #{fmwId}
         group by extra_field4,extra_field5
     </select>
     <select id="getTisTimeByFmwId" resultType="com.management.platform.entity.vo.TisTimeVO">
         select extra_field4 as orderId,extra_field5 as line
-             ,sum(maintance_time+debug_time+waiting_time+assist_time+public_time) as workTime
+             ,sum(compose_time+repair_time+waiting_time+assist_time+public_time) as workTime
         from fmw_detail
         where fmw_id = #{fmwId}
     </select>

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

@@ -1579,10 +1579,20 @@
             <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">
+              <!-- <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="composeTime" align="center" label="组装工时(h)" width="120px">
+                <template slot-scope="scope">
+                  <el-link type="primary" :underline="false" @click="adjustWorkingHours(scope.row, '组装工时',scope.row.composeTime,'composeTime')">{{ scope.row.composeTime }}</el-link>
+                </template>
+              </el-table-column>
+              <el-table-column prop="repairTime" align="center" label="维修工时(h)" width="120px">
+                <template slot-scope="scope">
+                  <el-link type="primary" :underline="false" @click="adjustWorkingHours(scope.row, '维修工时',scope.row.repairTime,'repairTime')">{{ scope.row.repairTime }}</el-link>
+                </template>
               </el-table-column>
               <el-table-column prop="debugTime" align="center" label="调试工时(h)" width="120px">
                 <template slot-scope="scope">

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

@@ -25,7 +25,7 @@
       </div>
     </di>
     <div class="qrCodeManagement-con">
-      <el-table :data="tableData" style="width: 100%;height: 100%" border @selection-change="handleSelectionChange" :loading="tableLoading">
+      <el-table :data="tableData" style="width: 100%" height="58vh" border @selection-change="handleSelectionChange" :loading="tableLoading">
         <el-table-column type="selection" width="55" />
         <el-table-column prop="projectId" label="项目号" />
         <el-table-column prop="projectName" label="项目名" />

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

@@ -4984,6 +4984,9 @@
                             this.workForm.domains[index].extraField4 = ''
                             this.workForm.domains[index].extraField5 = ''
                         }
+                        if((res.data.orderIds || []).length > 0) {
+                            this.workForm.domains[index].extraField4 = res.data.orderIds[0]
+                        }
                         this.workForm.domains[index].reportExtraField4List = res.data.orderIds || []
                         this.workForm.domains[index].reportExtraField5List = res.data.lines || []
                         this.$forceUpdate();
@@ -6902,6 +6905,9 @@
                     if (res.code == "ok") {
                         this.zhoBao.reportExtraField4List = res.data.orderIds || []
                         this.zhoBao.reportExtraField5List = res.data.lines || []
+                        if((res.data.orderIds || []).length > 0) {
+                            this.zhoBao.extraField4 = res.data.orderIds[0]
+                        }
                         console.log(this.zhoBao, '<===== this.zhoBao')
                         this.$forceUpdate();
                     } 

+ 26 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -505,7 +505,7 @@
                 </van-cell-group>
 
             </div>
-            <div style="text-align:center;" v-if="canEdit">
+            <div style="text-align:center;" v-if="showAddMore">
                 <van-tag size="large"
                     style="text-align:center;margin:10px;padding:12px;margin-bottom:120px;border: 1px solid #20a0ff;"
                     @click="addNewPro" icon="plus" color="#ffffff"><span
@@ -729,7 +729,9 @@ export default {
             }, //  代填人员信息
 
             userReportDeptList: [], // 可选部门
-            showSelectDeptPopup: false
+            showSelectDeptPopup: false,
+
+            showAddMore: false
         };
     },
 
@@ -1178,6 +1180,9 @@ export default {
                             this.form.domains[index == null ? this.clickIndex : index].extraField4 = ''
                             this.form.domains[index == null ? this.clickIndex : index].extraField5 = ''
                         }
+                        if((res.data.orderIds || []).length > 0) {
+                            this.form.domains[index == null ? this.clickIndex : index].extraField4 = res.data.orderIds[0]
+                        }
                         this.form.domains[index == null ? this.clickIndex : index].reportExtraField4List = res.data.orderIds || []
                         this.form.domains[index == null ? this.clickIndex : index].reportExtraField5List = res.data.lines || []
                     }
@@ -1583,6 +1588,9 @@ export default {
                     if (res.code == "ok") {
                         var t = res.data;
                         this.reportTimeType = t;
+                        if (this.reportTimeType.type > 0) {
+                            this.showAddMore = true;
+                        }
                         //转化时间格式
                         if (t.allday != null) {
                             this.timeType.push({ value: 0, label: '全天 - ' + t.allday + '小时', hours: t.allday });
@@ -2424,6 +2432,14 @@ export default {
             }
 
             this.form.domains.push(item)
+            if (this.reportTimeType.type == 0) {
+                //全天上下午模式下,检测时间段数量,达到2个,不能再加了
+                var length =  this.form.domains.length;
+                if (length == 2) {
+                    this.showAddMore = false;
+                }
+            }
+
             //重新计算总时长
             this.setTotalReportHours();
             this.canEdit = true
@@ -2437,6 +2453,14 @@ export default {
                 message: '是否移除当前项目'
             }).then(() => {
                 this.form.domains.splice(i, 1);
+                //检测当前剩下的一个,时间类型是否是全天
+                if (this.reportTimeType.type == 0) {
+                    if (this.form.domains[0].timeType == 0) {
+                        this.showAddMore = false;
+                    } else {
+                        this.showAddMore = true;
+                    }
+                }
                 //重新计算总时长
                 this.setTotalReportHours();
             }).catch(() => {