|
@@ -311,17 +311,26 @@ public class UserCorpwxTimeController {
|
|
|
@RequestMapping("/getPunchRecordBySelf")
|
|
|
public HttpRespMsg getUserPunchRecord(String date){
|
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
|
+ User user = userMapper.selectById(request.getHeader("token"));
|
|
|
+ Map<String,Object> resultMap =new HashMap<>();
|
|
|
+ List<UserCorpwxTime> oldCorpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>()
|
|
|
+ .eq("corpwx_userid", user.getCorpwxUserid()).eq("create_date", date));
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
LocalDate localDate = LocalDate.parse(date, df);
|
|
|
+ if(!localDate.isEqual(LocalDate.now())&&oldCorpwxTimes.size()>0){
|
|
|
+ UserCorpwxTime time = oldCorpwxTimes.get(0);
|
|
|
+ resultMap.put("time", time);
|
|
|
+ msg.data=resultMap;
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
LocalDateTime start = LocalDateTime.of(localDate, LocalTime.MIN);
|
|
|
LocalDateTime end = LocalDateTime.of(localDate, LocalTime.MAX).withSecond(0).withNano(0);
|
|
|
- User user = userMapper.selectById(request.getHeader("token"));
|
|
|
wxCorpInfoService.getUserPunchRecord(user.getCompanyId(),user.getId(),start,end,false);
|
|
|
- Map<String,Object> resultMap =new HashMap<>();
|
|
|
- List<UserCorpwxTime> corpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>()
|
|
|
+ List<UserCorpwxTime> chengedCorpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>()
|
|
|
.eq("corpwx_userid", user.getCorpwxUserid()).eq("create_date", date));
|
|
|
- if (corpwxTimes.size() > 0) {
|
|
|
- UserCorpwxTime time = corpwxTimes.get(0);
|
|
|
+
|
|
|
+ if (chengedCorpwxTimes.size() > 0) {
|
|
|
+ UserCorpwxTime time = chengedCorpwxTimes.get(0);
|
|
|
resultMap.put("time", time);
|
|
|
}
|
|
|
msg.data=resultMap;
|