Commit 4e16018b authored by 廖旭伟's avatar 廖旭伟

绩效汇总任务

parent d1d53969
......@@ -59,8 +59,18 @@ public class StaffCheckSummaryService implements IApplicationStartedService {
if(query.getCheckType() == CheckTypeEnum.其它绩效.getValue()){
checkWindowWorkmanPerformService.summaryCheck(query);
}
if(query.getCheckType()!=null){
log.info("绩效分数汇总开始");
checkAttendRecordService.summaryCheck(query);
checkEffectRecordService.summaryCheck(query);
checkGoworkRecordService.summaryCheck(query);
checkReviewRecordService.summaryCheck(query);
checkWindowWorkmanPerformService.summaryCheck(query);
log.info("绩效分数汇总完成");
}
}
try {
Thread.sleep(waitTime);
} catch (InterruptedException e2) {
......
......@@ -89,6 +89,11 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
@Override
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException {
if (query.getYear()==null || query.getMonth()==null) {
Calendar calendar = Calendar.getInstance();
query.setYear(calendar.get(Calendar.YEAR));
query.setMonth(calendar.get(Calendar.MONTH) + 1);
}
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if (CollectionUtils.isNotEmpty(summaryVoList)) {
String value = paramService.getValueByKey(SYS_PARAM_WEIGHT);
......
package com.mortals.xhx.module.staff.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.attendance.model.vo.AttendanceSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.staff.model.StaffEntity;
......@@ -37,6 +42,8 @@ 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.KEY_CHECK_SUMMARY_CACHE;
/**
* 员工绩效统计
......@@ -54,6 +61,8 @@ public class StaffPerformSummaryController extends BaseCRUDJsonBodyMappingContro
private DeptService deptService;
@Autowired
private StaffService staffService;
@Autowired
private ICacheService cacheService;
public StaffPerformSummaryController() {
......@@ -84,4 +93,24 @@ public class StaffPerformSummaryController extends BaseCRUDJsonBodyMappingContro
}
return 1;
}
@PostMapping({"summary"})
@UnAuth
public Rest<Object> summary(@RequestBody StaffCheckSummaryQuery query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "执行绩效汇总任务";
int code = 1;
try {
cacheService.lpush(KEY_CHECK_SUMMARY_CACHE,query);
model.put("message_info", "开始执行绩效汇总,请稍后查看");
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
}
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