Ver Fonte

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

seyason há 1 ano atrás
pai
commit
1f48b607f2

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

@@ -211,12 +211,15 @@ public class GroupBudgetReviewController {
     public HttpRespMsg export(String startDate,String endDate,Integer projectId,Integer status,String checkUserId){
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
-        DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        DateTimeFormatter df1=DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        LocalDateTime localDateTimesStart = LocalDate.parse(startDate, df).atTime(LocalTime.MIN);
+        LocalDateTime localDateTimesEnd = LocalDate.parse(endDate, df).atTime(LocalTime.MAX);
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
         List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, companyId));
         LambdaQueryWrapper<GroupBudgetReview> queryWrapper = new LambdaQueryWrapper<GroupBudgetReview>().eq(GroupBudgetReview::getCompanyId, companyId).orderByDesc(GroupBudgetReview::getCreateTime);
         if(startDate!=null && endDate!=null){
-            queryWrapper.between(GroupBudgetReview::getCreateTime,startDate,endDate);
+            queryWrapper.between(GroupBudgetReview::getCreateTime,localDateTimesStart.format(df1),localDateTimesEnd.format(df1));
         }
         if(projectId!=null){
             queryWrapper.eq(GroupBudgetReview::getProjectId,projectId);

+ 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);
     }
 }
 

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

@@ -499,8 +499,9 @@ public class UserController {
                 msg.setError("验证失败");
                 return msg;
             }
+        }else {
+            msg.setError("人员不存在");
         }
-        msg.setError("人员不存在");
         return msg;
     }
 

+ 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;
 

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

@@ -11544,6 +11544,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             item.add("");
             item.add("");
             item.add("");
+            item.add("");
             double workTimeSum = mapList.stream().mapToDouble(m -> Double.valueOf(String.valueOf(m.get("workTime")))).sum();
             item.add(new BigDecimal(workTimeSum).setScale(2,RoundingMode.HALF_UP)+"");
             item.add("");

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

@@ -4402,14 +4402,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());
@@ -8997,7 +8996,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();
@@ -9006,11 +9005,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);
@@ -9028,10 +9033,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;
     }
 
@@ -9048,22 +9052,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());
@@ -9099,7 +9097,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<>();
@@ -9114,7 +9111,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();

+ 4 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -2039,7 +2039,7 @@ public class TimingTask {
                                 u.setId(user.get().getId());
                                 u.setPhone(userWithBeisen.getMobilePhone());
                                 u.setJobNumber(userWithBeisen.getJobNumber());
-                                userList.add(u);
+                                needUpdateUsers.add(u);
                             }
                         }
                     }
@@ -2047,7 +2047,9 @@ public class TimingTask {
                 if(userWithBeisenList.size()>0){
                     userWithBeisenService.saveOrUpdateBatch(userWithBeisenList);
                 }
-                userService.updateBatchById(needUpdateUsers);
+                if(needUpdateUsers.size()>0){
+                    userService.updateBatchById(needUpdateUsers);
+                }
             }
         }
     }

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

@@ -1726,7 +1726,7 @@
         AND report.company_id=#{companyId}
         AND
         (
-        IF(user.induction_date is not null AND user.induction_date &gt; #{startDate} and user.inactive_date is not null AND user.inactive_date &lt; #{endDate}
+        IF(user.induction_date is not null AND user.induction_date &gt; #{startDate} and user.inactive_date is not null AND user.`is_active`=0 AND user.inactive_date &lt; #{endDate}
         ,report.create_date BETWEEN user.induction_date AND user.inactive_date
         ,report.create_date BETWEEN #{startDate} AND #{endDate} )
         and
@@ -1734,7 +1734,7 @@
         ,report.create_date BETWEEN user.induction_date AND #{endDate}
         ,report.create_date BETWEEN #{startDate} AND #{endDate} )
         and
-        IF(user.inactive_date is not null AND user.inactive_date &lt; #{endDate}
+        IF(user.inactive_date AND user.`is_active`=0 is not null AND user.inactive_date &lt; #{endDate}
         ,report.create_date BETWEEN #{startDate} AND user.inactive_date
         ,report.create_date BETWEEN #{startDate} AND #{endDate} )
         )

+ 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,

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/editPerfect/editPerfect.vue

@@ -29,7 +29,7 @@ export default {
         editPerfectJobNumber() {
             const { id } = this.user
             this.$axios.post("/user/updateUserJobNumber", {
-                id,
+                userId:id,
                 jobNumber: this.jobNumber
             })
             .then(res => {