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

绩效授权修改

parent 8c556983
......@@ -126,6 +126,41 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
}
}
@Override
protected void updateAfter(StaffEntity entity, Context context) throws AppException {
//OtherCheck作为绩效总开关,启用时新增当月绩效初始值,关闭时删除当月绩效数据
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH)+1;
StaffPerformSummaryQuery summaryQuery = new StaffPerformSummaryQuery();
summaryQuery.setStaffId(entity.getId());
summaryQuery.setYear(year);
summaryQuery.setMonth(month);
StaffPerformSummaryEntity tempSummary = staffPerformSummaryService.selectOne(summaryQuery);
if(entity.getOtherCheck() == 1){
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue();
staffPerformSummaryEntity.setStaffId(entity.getId());
staffPerformSummaryEntity.setStaffName(entity.getName());
staffPerformSummaryEntity.setDeptId(entity.getDeptId());
staffPerformSummaryEntity.setDeptName(entity.getDeptName());
staffPerformSummaryEntity.setSalaId(entity.getSalaId());
staffPerformSummaryEntity.setSalaName(entity.getSalaName());
staffPerformSummaryEntity.setYear(year);
staffPerformSummaryEntity.setMonth(month);
staffPerformSummaryEntity.setTotalScore(new BigDecimal(100));
staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date());
if (tempSummary == null) {
staffPerformSummaryService.save(staffPerformSummaryEntity);
}
}else {
if (tempSummary != null) {
staffPerformSummaryService.remove(tempSummary.getId(),null);
}
}
}
@Override
protected void saveBefore(StaffEntity entity, Context context) throws AppException {
int count = this.count(new StaffQuery().workNum(entity.getWorkNum()), 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