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

人员绩效开关打开关闭后恢复删除窗口人员汇总表数据

parent 3629bc69
...@@ -44,6 +44,7 @@ import com.mortals.xhx.module.staff.model.*; ...@@ -44,6 +44,7 @@ import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.model.vo.StaffCheckAuthorizePdu; import com.mortals.xhx.module.staff.model.vo.StaffCheckAuthorizePdu;
import com.mortals.xhx.module.staff.model.vo.StaffInfoVo; import com.mortals.xhx.module.staff.model.vo.StaffInfoVo;
import com.mortals.xhx.module.staff.service.StaffLeaveService; import com.mortals.xhx.module.staff.service.StaffLeaveService;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryEditService;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -96,6 +97,8 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -96,6 +97,8 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
private StaffPerformSummaryService staffPerformSummaryService; private StaffPerformSummaryService staffPerformSummaryService;
@Autowired @Autowired
private IDingPersonService dingPersonService; private IDingPersonService dingPersonService;
@Autowired
private StaffPerformSummaryEditService staffPerformSummaryEditService;
@Override @Override
protected String getExtKey(StaffEntity data) { protected String getExtKey(StaffEntity data) {
...@@ -440,6 +443,11 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -440,6 +443,11 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
summaryQuery.setYear(year); summaryQuery.setYear(year);
summaryQuery.setMonth(month); summaryQuery.setMonth(month);
StaffPerformSummaryEntity tempSummary = staffPerformSummaryService.selectOne(summaryQuery); StaffPerformSummaryEntity tempSummary = staffPerformSummaryService.selectOne(summaryQuery);
StaffPerformSummaryEditQuery staffPerformSummaryEditQuery = new StaffPerformSummaryEditQuery();
staffPerformSummaryEditQuery.setStaffId(temp.getId());
staffPerformSummaryEditQuery.setYear(year);
staffPerformSummaryEditQuery.setMonth(month);
StaffPerformSummaryEditEntity tempSummaryEdit = staffPerformSummaryEditService.selectOne(staffPerformSummaryEditQuery);
if (update.getOtherCheck() == 1) { if (update.getOtherCheck() == 1) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity(); StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue(); staffPerformSummaryEntity.initAttrValue();
...@@ -457,10 +465,29 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -457,10 +465,29 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
if (tempSummary == null) { if (tempSummary == null) {
staffPerformSummaryService.save(staffPerformSummaryEntity); staffPerformSummaryService.save(staffPerformSummaryEntity);
} }
StaffPerformSummaryEditEntity summaryEditEntity = new StaffPerformSummaryEditEntity();
summaryEditEntity.initAttrValue();
summaryEditEntity.setStaffId(temp.getId());
summaryEditEntity.setStaffName(temp.getName());
summaryEditEntity.setDeptId(temp.getDeptId());
summaryEditEntity.setDeptName(temp.getDeptName());
summaryEditEntity.setSalaId(temp.getSalaId());
summaryEditEntity.setSalaName(temp.getSalaName());
summaryEditEntity.setYear(year);
summaryEditEntity.setMonth(month);
summaryEditEntity.setTotalScore(new BigDecimal(100));
summaryEditEntity.setCreateUserId(1l);
summaryEditEntity.setCreateTime(new Date());
if (tempSummaryEdit == null) {
staffPerformSummaryEditService.save(summaryEditEntity);
}
} else { } else {
if (tempSummary != null) { if (tempSummary != null) {
staffPerformSummaryService.remove(tempSummary.getId(), null); staffPerformSummaryService.remove(tempSummary.getId(), null);
} }
if (tempSummaryEdit != null) {
staffPerformSummaryEditService.remove(tempSummaryEdit.getId(), null);
}
} }
return dao.update(update); return dao.update(update);
} }
......
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