Browse Source

补充调休前端,调休逻辑适配转义

zhouyy 5 months ago
parent
commit
2eae11bf3f

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/LeaveSheetController.java

@@ -65,9 +65,9 @@ public class LeaveSheetController {
      * @return
      * @return
      */
      */
     @PostMapping("/getCompanyUserTime")
     @PostMapping("/getCompanyUserTime")
-    public HttpRespMsg getCompanyUserTime(@RequestParam(value = "userName",required = false) String userName,HttpServletRequest request) {
+    public HttpRespMsg getCompanyUserTime(@RequestParam(value = "userId",required = false) String userId,HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         HttpRespMsg httpRespMsg = new HttpRespMsg();
-        httpRespMsg = leaveSheetService.getCompanyUserTime(userName,request);
+        httpRespMsg = leaveSheetService.getCompanyUserTime(userId,request);
         return httpRespMsg;
         return httpRespMsg;
     }
     }
     /**
     /**

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

@@ -26,5 +26,5 @@ public interface LeaveSheetMapper extends BaseMapper<LeaveSheet> {
 
 
     List<Map<String,Object>> selectLeaveAll(Integer companyId, String startDate, String endDate,List<Integer> branchDepartment,List<Integer> deptIds);
     List<Map<String,Object>> selectLeaveAll(Integer companyId, String startDate, String endDate,List<Integer> branchDepartment,List<Integer> deptIds);
 
 
-    List<UserRestTimeVO> getCompanyUserRestTimeHours(@Param("companyId") Integer companyId,@Param("userName")String userName);
+    List<UserRestTimeVO> getCompanyUserRestTimeHours(@Param("companyId") Integer companyId,@Param("userId")String userId);
 }
 }

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

@@ -253,5 +253,5 @@ public interface ReportMapper extends BaseMapper<Report> {
 
 
     List<UserProjectBonusTimeVO> getUserProjectsByBonusBO(BonusDataBO bonusDataBO);
     List<UserProjectBonusTimeVO> getUserProjectsByBonusBO(BonusDataBO bonusDataBO);
 
 
-    List<UserRestTimeVO> getCompanyUserOverTimeHours(@Param("companyId") Integer companyId,@Param("userName") String userName);
+    List<UserRestTimeVO> getCompanyUserOverTimeHours(@Param("companyId") Integer companyId,@Param("userId") String userId);
 }
 }

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

@@ -41,5 +41,5 @@ public interface LeaveSheetService extends IService<LeaveSheet> {
 
 
     HttpRespMsg leaveDays(String startDate, String endDate);
     HttpRespMsg leaveDays(String startDate, String endDate);
 
 
-    HttpRespMsg getCompanyUserTime(String userName, HttpServletRequest request);
+    HttpRespMsg getCompanyUserTime(String userId, HttpServletRequest request);
 }
 }

+ 6 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/LeaveSheetServiceImpl.java

@@ -831,7 +831,7 @@ public class LeaveSheetServiceImpl extends ServiceImpl<LeaveSheetMapper, LeaveSh
     }
     }
 
 
     @Override
     @Override
-    public HttpRespMsg getCompanyUserTime(String userName,HttpServletRequest request) {
+    public HttpRespMsg getCompanyUserTime(String userId,HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         User user= userMapper.selectById(request.getHeader("token"));
         User user= userMapper.selectById(request.getHeader("token"));
         if(null == user){
         if(null == user){
@@ -854,22 +854,22 @@ public class LeaveSheetServiceImpl extends ServiceImpl<LeaveSheetMapper, LeaveSh
         }
         }
 
 
         //获取加班时长 creatorId overTimeHours
         //获取加班时长 creatorId overTimeHours
-        List<UserRestTimeVO> overTimeHourList = reportMapper.getCompanyUserOverTimeHours(user.getCompanyId(),userName);
+        List<UserRestTimeVO> overTimeHourList = reportMapper.getCompanyUserOverTimeHours(user.getCompanyId(),userId);
 
 
         //获取已经休息的时长
         //获取已经休息的时长
-        List<UserRestTimeVO> restTimeHourList = leaveSheetMapper.getCompanyUserRestTimeHours(user.getCompanyId(),userName);
+        List<UserRestTimeVO> restTimeHourList = leaveSheetMapper.getCompanyUserRestTimeHours(user.getCompanyId(),userId);
 
 
         if(!CollectionUtils.isEmpty(overTimeHourList)){
         if(!CollectionUtils.isEmpty(overTimeHourList)){
             Map<String, UserRestTimeVO> overTimeHourMap = overTimeHourList.stream().collect(Collectors.toMap(UserRestTimeVO::getUserId, t -> t));
             Map<String, UserRestTimeVO> overTimeHourMap = overTimeHourList.stream().collect(Collectors.toMap(UserRestTimeVO::getUserId, t -> t));
             Map<String, UserRestTimeVO> restTimeHourMap = new HashMap<>();
             Map<String, UserRestTimeVO> restTimeHourMap = new HashMap<>();
-            if(!CollectionUtils.isEmpty(restTimeHourMap)){
+            if(!CollectionUtils.isEmpty(restTimeHourList)){
                 restTimeHourMap = restTimeHourList.stream().collect(Collectors.toMap(UserRestTimeVO::getUserId, t -> t));
                 restTimeHourMap = restTimeHourList.stream().collect(Collectors.toMap(UserRestTimeVO::getUserId, t -> t));
             }
             }
 
 
             for (Map.Entry<String, UserRestTimeVO> entry : overTimeHourMap.entrySet()) {
             for (Map.Entry<String, UserRestTimeVO> entry : overTimeHourMap.entrySet()) {
-                String userId = entry.getKey();
+                String tmpUserId = entry.getKey();
                 UserRestTimeVO tmpUserTimeVO = entry.getValue();
                 UserRestTimeVO tmpUserTimeVO = entry.getValue();
-                UserRestTimeVO restTimeUserVO = restTimeHourMap.get(userId);
+                UserRestTimeVO restTimeUserVO = restTimeHourMap.get(tmpUserId);
                 if(null != restTimeUserVO){
                 if(null != restTimeUserVO){
                     BigDecimal leftTimeHour = tmpUserTimeVO.getOverTimeHour().subtract(restTimeUserVO.getRestTimeHour());
                     BigDecimal leftTimeHour = tmpUserTimeVO.getOverTimeHour().subtract(restTimeUserVO.getRestTimeHour());
                     if(0 > leftTimeHour.compareTo(new BigDecimal(0))){
                     if(0 > leftTimeHour.compareTo(new BigDecimal(0))){

+ 3 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/LeaveSheetMapper.xml

@@ -83,9 +83,9 @@
                 select id,name
                 select id,name
                 from user
                 from user
                 <where>
                 <where>
-                    company_id = #{companyId}
-                    <if test="userName != null and userName !='' ">
-                        and name like concat('%',#{userName},'%')
+                    company_id = #{companyId} and is_active = 1
+                    <if test="userId != null and userId !='' ">
+                        and id = #{userId}
                     </if>
                     </if>
                 </where>
                 </where>
             )tmp1
             )tmp1

+ 3 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -1576,9 +1576,9 @@
                 select id,name
                 select id,name
                 from user
                 from user
                 <where>
                 <where>
-                    company_id = #{companyId}
-                <if test="userName != null and userName !='' ">
-                    and name like concat('%',#{userName},'%')
+                    company_id = #{companyId} and is_active = 1
+                <if test="userId != null and userId !='' ">
+                    and id = #{userId}
                 </if>
                 </if>
                 </where>
                 </where>
             )tmp1
             )tmp1

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

@@ -801,6 +801,8 @@
   "totallengthofleave": "请假总时长",
   "totallengthofleave": "请假总时长",
   "totaldaysRest": "调休总天数",
   "totaldaysRest": "调休总天数",
   "totallengthofRest": "调休总时长",
   "totallengthofRest": "调休总时长",
+  "remaindaysRest": "剩余调休天数",
+  "remainlengthofRest": "剩余调休时长",
   "approvalprocessforleaveofdirect staff": "直属人员请假审批流程",
   "approvalprocessforleaveofdirect staff": "直属人员请假审批流程",
   "pleaseselectapprover": "请选择审批人",
   "pleaseselectapprover": "请选择审批人",
   "selectdepartmentsdesignatepersonnel": "选择部门/指定人员",
   "selectdepartmentsdesignatepersonnel": "选择部门/指定人员",

+ 10 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -407,10 +407,11 @@
         <div class="ctons" style="width: 98%;">
         <div class="ctons" style="width: 98%;">
           <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
           <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
             <div style="display: inline-block;width: 350px">
             <div style="display: inline-block;width: 350px">
-              <el-input style="float:left;" v-if="user.userNameNeedTranslate != 1" v-model="userName" class="input-with-select" @keyup.enter.native="restTime()" :placeholder="$t('pleaseenterstaffsearch')" clearable="true" size="small">
+              <!-- <el-input style="float:left;" v-if="user.userNameNeedTranslate != 1" v-model="userName" class="input-with-select" @keyup.enter.native="restTime()" :placeholder="$t('pleaseenterstaffsearch')" clearable="true" size="small">
                   <el-button slot="append" @click="restTime()" icon="el-icon-search"></el-button>
                   <el-button slot="append" @click="restTime()" icon="el-icon-search"></el-button>
               </el-input>
               </el-input>
-              <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :widthStr="'240'" :subject="users" :distinction="'11'" :disabled="false" @selectCal="selectCal" :clearable="true"></selectCat>
+              <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :widthStr="'240'" :subject="users" :distinction="'11'" :disabled="false" @selectCal="selectCal" :clearable="true"></selectCat> -->
+              <selectPersonnel v-model="userId" @change="restTime" />
             </div>
             </div>
           </div>
           </div>
           <!-- <div style="margin-top: 30px"> -->
           <!-- <div style="margin-top: 30px"> -->
@@ -427,12 +428,12 @@
                     </div>
                     </div>
                   </template>
                   </template>
               </el-table-column>
               </el-table-column>
-              <el-table-column prop="restTimeDayStr" :label="$t('totaldaysRest')" width="300">
+              <el-table-column prop="restTimeDayStr" :label="$t('remaindaysRest')" width="300">
                 <template slot-scope="scope">
                 <template slot-scope="scope">
                     {{scope.row.restTimeDayStr}} / {{ $t('time.day') }}
                     {{scope.row.restTimeDayStr}} / {{ $t('time.day') }}
                   </template>
                   </template>
               </el-table-column>
               </el-table-column>
-              <el-table-column prop="restTimeHourStr" :label="$t('totallengthofRest')">
+              <el-table-column prop="restTimeHourStr" :label="$t('remainlengthofRest')">
                 <template slot-scope="scope">
                 <template slot-scope="scope">
                     {{scope.row.restTimeHourStr}}/{{ $t('time.hour') }}
                     {{scope.row.restTimeHourStr}}/{{ $t('time.hour') }}
                   </template>
                   </template>
@@ -805,6 +806,7 @@ import { config, error } from 'dingtalk-jsapi';
 // 自定义select组件
 // 自定义select组件
 import selectCat from "@/components/select.vue"
 import selectCat from "@/components/select.vue"
 import Select from '../../components/select.vue';
 import Select from '../../components/select.vue';
+import selectPersonnel from '../../components/selectPersonnel.vue';
 
 
  // 引入自定义级联组件
  // 引入自定义级联组件
 import vueCascader from "@/components/cascader.vue"
 import vueCascader from "@/components/cascader.vue"
@@ -814,7 +816,8 @@ export default {
   components: {
   components: {
     selectCat,
     selectCat,
     Select,
     Select,
-    vueCascader
+    vueCascader,
+    selectPersonnel
   },
   },
   props: {},
   props: {},
   data() {
   data() {
@@ -894,7 +897,7 @@ export default {
       total:0,
       total:0,
       apk: false,
       apk: false,
       keyword: '',
       keyword: '',
-      userName:'',
+      userId:'',
       statData: this.getCurrentTimes(),
       statData: this.getCurrentTimes(),
       endData: this.getCurrentTime(),
       endData: this.getCurrentTime(),
       statisticalList: [],
       statisticalList: [],
@@ -2141,7 +2144,7 @@ export default {
     restTime() {
     restTime() {
       this.loading = true
       this.loading = true
       this.http.post('/leave-sheet/getCompanyUserTime', {
       this.http.post('/leave-sheet/getCompanyUserTime', {
-        userName: this.userName,
+        userId: this.userId,
       },
       },
         res => {
         res => {
             if (res.code == "ok") {
             if (res.code == "ok") {