Commit ba9db32e authored by 廖旭伟's avatar 廖旭伟

考勤汇总增加显示汇总时间

parent f16815c9
......@@ -25,7 +25,8 @@ public class RedisKey {
/** 考勤统计 **/
public static final String KEY_ATTENDANCE_STAT_CACHE = "attendance:stat";
/** 考勤统计时间 **/
public static final String ATTENDANCE_STAT_TIME = "attendanceSummaryTime";
public static final String KEY_HOME_STAT_CACHE = "attendance:home:stat";
......
......@@ -44,6 +44,9 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import static com.mortals.xhx.common.key.RedisKey.ATTENDANCE_STAT_TIME;
import static com.mortals.xhx.common.key.RedisKey.STAFF_PERFORM_SUMMARY;
/**
* AttendanceStatService
* 考勤汇总信息 service实现
......@@ -625,6 +628,7 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
}
}
log.info("完成汇总当前日期请假情况.....");
cacheService.set(ATTENDANCE_STAT_TIME, DateUtils.getCurrStrDateTime());
log.info("日期:" + query.getSummaryTime() + ",考勤汇总执行完成,耗时:" + (System.currentTimeMillis() - currentTime) + "毫秒....");
} catch (Exception e) {
log.error("考勤汇总出错", e);
......
......@@ -13,6 +13,7 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.utils.ReflectUtils;
import com.mortals.framework.utils.poi.ExcelUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
......@@ -57,7 +58,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import static com.mortals.xhx.common.key.RedisKey.KEY_ATTENDANCE_STAT_CACHE;
import static com.mortals.xhx.common.key.RedisKey.*;
/**
* 考勤汇总信息
......@@ -165,6 +166,15 @@ public class AttendanceStatController extends BaseCRUDJsonBodyMappingController<
model.put("pageInfo", result.getPageInfo());
this.parsePageInfo(model, result.getPageInfo());
model.put("message_info", busiDesc + "成功");
String summaryTime = cacheService.get(ATTENDANCE_STAT_TIME);
if(StringUtils.isNotEmpty(summaryTime)){
this.addDict(model,"summaryTime",summaryTime);
}else {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH,-1);
summaryTime = DateUtils.getDateTime(cal.getTime(),"yyyy-MM-dd");
this.addDict(model,"summaryTime", summaryTime+" 22:00:00");
}
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
......
......@@ -106,6 +106,11 @@ public class StaffPerformSummaryController extends BaseCRUDJsonBodyMappingContro
String summaryTime = cacheService.get(STAFF_PERFORM_SUMMARY);
if(StringUtils.isNotEmpty(summaryTime)){
this.addDict(model,"summaryTime",summaryTime);
}else {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH,-1);
summaryTime = DateUtils.getDateTime(cal.getTime(),"yyyy-MM-dd");
this.addDict(model,"summaryTime", summaryTime+" 22:00:00");
}
return super.doListAfter(query,model,context);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment