Min 1 سال پیش
والد
کامیت
1919d73000

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

@@ -2554,8 +2554,8 @@ public class ReportController {
     }
 
     @RequestMapping("/changeReminder")
-    public HttpRespMsg changeReminder() throws Exception {
-        return reportService.changeReminder(request);
+    public HttpRespMsg changeReminder(String createDate,String userId) throws Exception {
+        return reportService.changeReminder(request,createDate,userId);
     }
 }
 

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

@@ -213,6 +213,6 @@ public interface ReportMapper extends BaseMapper<Report> {
     @Select("SELECT report.id,report.creator_id,  report.`create_date`, report.`create_time`, group_id, task_group.`name`,report.project_id, task_group.`project_id` AS error_pid FROM report LEFT JOIN task_group ON task_group.id = report.`group_id` WHERE report.`company_id`=#{companyId} AND report.project_id <> task_group.`project_id`  AND create_date BETWEEN #{startDate} AND #{endDate} ORDER BY report.id DESC")
     List<Map<String, Object>> selectErrorGroupData(Integer companyId, String startDate, String endDate);
 
-    @Update("update report set state=2 where create_date=#{createDate} and creator_id=#{userId}")
+    @Update("update report set state=2,reject_reason='提醒工时变更' where create_date=#{createDate} and creator_id=#{userId}")
     void denyReportWithUserAndCreateDate(String userId, String createDate);
 }

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

@@ -152,7 +152,7 @@ public interface ReportService extends IService<Report> {
 
     HttpRespMsg getDetailReportById(Integer reportId, HttpServletRequest request);
 
-    HttpRespMsg changeReminder(HttpServletRequest request) throws Exception;
+    HttpRespMsg changeReminder(HttpServletRequest request,String createDate,String userId) throws Exception;
 
     HttpRespMsg getUserDailyWorkTimeReminder(HttpServletRequest request, String startDate, String endDate) throws Exception;
 

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

@@ -4399,14 +4399,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             String date = new SimpleDateFormat("yyyy-MM-dd").format((Date)data.get("createDate"));
             map.put("workingTime", data.get("workingTime"));
             map.put("createDate", date);
-            map.put("cardTime", 0);
             //针对景昱 5978 校验填报工时是否超过考勤
             if(user.getCompanyId().equals(5978)){
                 map.put("exceedCardTime",0);
                 Optional<UserFvTime> first = userFvTimeList.stream().filter(u -> u.getWorkDate().isEqual(LocalDate.parse(date, df)) && u.getUserId().equals(id)).findFirst();
                 if(first.isPresent()){
-                    map.put("cardTime",first.get().getWorkHours());
                     if(first.get().getWorkHours()!=null){
+                        map.put("cardTime",first.get().getWorkHours());
                         Optional<User> optional = userList.stream().filter(u -> u.getId().equals(id)).findFirst();
                         User targetUser = optional.get();
                         List<String> customList = userCustomList.stream().map(UserCustom::getName).collect(Collectors.toList());
@@ -8964,7 +8963,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg changeReminder(HttpServletRequest request) throws Exception {
+    public HttpRespMsg changeReminder(HttpServletRequest request,String createDate,String userId) throws Exception {
         HttpRespMsg msg=new HttpRespMsg();
         DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
@@ -8973,11 +8972,17 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         HttpRespMsg userDailyWorkTime = getUserDailyWorkTime(request, now.with(TemporalAdjusters.firstDayOfMonth()).format(df), now.with(TemporalAdjusters.lastDayOfMonth()).format(df));
         Map<String, Object> map = (Map<String, Object>) userDailyWorkTime.getData();
         List<UserMonthWork> userDailyWorkTimeData = (List<UserMonthWork>) map.get("list");
+        if(!StringUtils.isEmpty(userId)){
+            userDailyWorkTimeData=userDailyWorkTimeData.stream().filter(u->u.userId.equals(userId)).collect(Collectors.toList());
+        }
         List<Information> informationList=new ArrayList<>();
         userDailyWorkTimeData.forEach(u-> {
             List<Map<String, Object>> worktimeList = u.worktimeList;
             List<Map<String, Object>> exceedCardTimeList = worktimeList.stream().filter(w -> Integer.valueOf(String.valueOf(w.get("exceedCardTime"))).equals(1)).collect(Collectors.toList());
             if(exceedCardTimeList.size()>0){
+                if(!StringUtils.isEmpty(createDate)){
+                    exceedCardTimeList=exceedCardTimeList.stream().filter(e->String.valueOf(e.get("createDate")).equals(createDate)).collect(Collectors.toList());
+                }
                 exceedCardTimeList.forEach(e->{
                     Information information=new Information();
                     information.setUserId(u.userId);
@@ -8995,10 +9000,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
         });
         if(informationList.size()>0){
-            if(!informationService.saveBatch(informationList)){
-                msg.setError("验证失败");
-            }
+            informationService.saveBatch(informationList);
         }
+        msg.setMsg("变更提醒发送成功");
         return msg;
     }
 
@@ -9015,22 +9019,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         mapList.forEach(m->{
             List<Map<String, Object>> worktimeList = (List<Map<String, Object>>) m.worktimeList;
             for (LocalDate date : days) {
-                boolean match = worktimeList.stream().anyMatch(www -> www.get("createDate").equals(date.format(df)));
+                boolean match = worktimeList.stream().anyMatch(www -> String.valueOf(www.get("createDate")).equals(date.format(df)));
                 if(!match){
                     Map<String,Object> ww=new HashMap<>();
                     ww.put("createDate",date.format(df));
                     ww.put("exceedCardTime",0);
                     ww.put("workingTime",0);
-//                    ww.put("name",m.name);
-//                    ww.put("corpwxDeptId",m.corpwxDeptId);
-//                    ww.put("corpwxUserId",m.corpwxUserId);
-//                    ww.put("departmentName",m.departmentName);
-//                    ww.put("userId",m.userId);
                     worktimeList.add(ww);
                 }
                 if(worktimeList.size()>0){
                     worktimeList.forEach(w->{
-                        w.put("cardTime",0);
                         Optional<UserFvTime> first = userFvTimeList.stream().filter(u -> u.getWorkDate().isEqual(date) && u.getUserId().equals(m.userId)).findFirst();
                         if(first.isPresent()){
                             w.put("cardTime",first.get().getWorkHours());
@@ -9066,7 +9064,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         titleList.add("填报工时");
         titleList.add("考勤工时");
         titleList.add("是否异常");
-        titleList.add("催办");
         dataList.add(titleList);
         for (Map<String, Object> map : mapList) {
             List<String> item=new ArrayList<>();
@@ -9081,7 +9078,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             item.add(String.valueOf(map.get("workingTime")));
             item.add(String.valueOf(map.get("cardTime")));
             item.add(Integer.valueOf(String.valueOf(map.get("exceedCardTime")))==0?"否":"是");
-            item.add(Integer.valueOf(String.valueOf(map.get("exceedCardTime")))==0?"":"变更提醒");
             dataList.add(item);
         }
         String fileName="工时异常表"+System.currentTimeMillis();

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

@@ -1657,8 +1657,7 @@
                 <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true"  :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
             </div>
             <div style="float: right; vertical-align: middle;height:32px">
-              <el-link 
-              v-if="user.companyId==5978"
+              <el-link
               type="primary"
               @click="changeReminder()"
               >{{'变更提醒'}}</el-link
@@ -1722,7 +1721,7 @@
 
             <el-table-column width="160" type="index" fixed="left" :label="'催办'">
               <template slot-scope="scope">
-                {{ scope.row.exceedCardTime==0?'':'变更提醒'}}
+                <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{'变更提醒'}}</el-link>
               </template>
             </el-table-column>
 
@@ -8231,11 +8230,21 @@
                 })
             },
             //景昱变更提醒
-            changeReminder(){
-                this.http.post('/report/changeReminder',{
-                },res => {
+            changeReminder(item){
+                console.log("============",item)
+                let parameter={}
+                if(item){
+                    parameter={
+                        createDate:item.createDate,
+                        userId:item.userId,
+                    }
+                }
+                this.http.post('/report/changeReminder',parameter,res => {
                     if(res.code == 'ok'){
-                        
+                        this.$message({
+                            message: res.msg,
+                            type: 'success'
+                        })
                     }else{
                         this.$message({
                             message: res.msg,