Commit 217beb63 authored by 赵啸非's avatar 赵啸非

添加员工钉钉同步userId

parent fbd5e21a
......@@ -64,22 +64,22 @@ public class StaffCheckSummaryService implements IApplicationStartedService {
int waitTime = 50;
while (!stopped) {
try {
StaffCheckSummaryQuery query = cacheService.brpop(KEY_CHECK_SUMMARY_CACHE,60, StaffCheckSummaryQuery.class);
if(!ObjectUtils.isEmpty(query)){
log.info("绩效分数汇总开始:"+ JSONObject.toJSONString(query));
if(StringUtils.isNotEmpty(query.getCheckTimeStart())){
Date date = DateUtil.parse(query.getCheckTimeStart(),"yyyy-MM-dd");
StaffCheckSummaryQuery query = cacheService.brpop(KEY_CHECK_SUMMARY_CACHE, 60, StaffCheckSummaryQuery.class);
if (!ObjectUtils.isEmpty(query)) {
log.info("绩效分数汇总开始:" + JSONObject.toJSONString(query));
if (StringUtils.isNotEmpty(query.getCheckTimeStart())) {
Date date = DateUtil.parse(query.getCheckTimeStart(), "yyyy-MM-dd");
query.setCheckTimeStart(DateUtil.beginOfMonth(date).toDateStr());
query.setCheckTimeEnd(DateUtil.endOfMonth(date).toDateStr());
query.setYear(DateUtil.year(date));
int checkMonth = DateUtil.month(date)+1;
int checkMonth = DateUtil.month(date) + 1;
query.setMonth(checkMonth);
Date now = new Date();
int nowMonth = DateUtil.month(now)+1;
if(checkMonth==nowMonth){
int nowMonth = DateUtil.month(now) + 1;
if (checkMonth == nowMonth) {
//汇总当月绩效
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-1);
calendar.add(Calendar.DAY_OF_MONTH, -1);
query.setCheckTimeEnd(DateUtils.getStrDate(calendar.getTime()));
query.setCheckTimeStart(DateUtil.beginOfMonth(calendar.getTime()).toDateStr());
}
......@@ -103,34 +103,34 @@ public class StaffCheckSummaryService implements IApplicationStartedService {
staffPerformSummaryEntity.setErrorScore(BigDecimal.ZERO);
//staffPerformSummaryEntity.setSumScore(StaffPerformUtil.SCORE100);
staffPerformSummaryEntity.setUpdateTime(new Date());
Map<String,Object> condition = new HashMap<>();
condition.put("year",year);
condition.put("month",month);
if(query.getStaffId()!=null){
condition.put("staffId",query.getStaffId());
Map<String, Object> condition = new HashMap<>();
condition.put("year", year);
condition.put("month", month);
if (query.getStaffId() != null) {
condition.put("staffId", query.getStaffId());
}
//staffPerformSummaryService.getDao().update(staffPerformSummaryEntity,condition);
staffPerformSummaryService.getDao().updateSumScore(condition);
if(query.getCheckType() == CheckTypeEnum.考勤绩效.getValue()){
if (query.getCheckType() == CheckTypeEnum.考勤绩效.getValue()) {
checkAttendRecordService.summaryCheck(query);
}
if(query.getCheckType() == CheckTypeEnum.效能绩效.getValue()){
if (query.getCheckType() == CheckTypeEnum.效能绩效.getValue()) {
checkEffectRecordService.summaryCheck(query);
}
if(query.getCheckType() == CheckTypeEnum.办件绩效.getValue()){
if (query.getCheckType() == CheckTypeEnum.办件绩效.getValue()) {
checkGoworkRecordService.summaryCheck(query);
}
if(query.getCheckType() == CheckTypeEnum.评价绩效.getValue()){
if (query.getCheckType() == CheckTypeEnum.评价绩效.getValue()) {
checkReviewRecordService.summaryCheck(query);
checkComplainRecordService.summaryCheck(query);
}
if(query.getCheckType() == CheckTypeEnum.自评绩效.getValue()){
if (query.getCheckType() == CheckTypeEnum.自评绩效.getValue()) {
checkWindowWorkmanPerformService.summaryCheck(query);
}
if(query.getCheckType() == CheckTypeEnum.其它绩效.getValue()){
if (query.getCheckType() == CheckTypeEnum.其它绩效.getValue()) {
checkOtherRecordService.summaryCheck(query);
}
if(query.getCheckType()==null){
if (query.getCheckType() == null) {
checkAttendRecordService.summaryCheck(query);
checkEffectRecordService.summaryCheck(query);
......@@ -151,12 +151,10 @@ public class StaffCheckSummaryService implements IApplicationStartedService {
} catch (InterruptedException e2) {
}
} catch (Exception e) {
if(e instanceof QueryTimeoutException){
} catch (RedisCommandTimeoutException e) {
}else {
} catch (Exception e) {
log.error("绩效分数汇总异常", e);
}
try {
Thread.sleep(waitTime);
} catch (InterruptedException e2) {
......
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