Commit 71c012ef authored by 廖旭伟's avatar 廖旭伟

OtherCheck作为绩效总开关,启用时新增当月绩效初始值,关闭时删除当月绩效数据

parent 063db303
...@@ -42,13 +42,12 @@ import com.mortals.xhx.module.hik.staff.service.IHikStaffService; ...@@ -42,13 +42,12 @@ import com.mortals.xhx.module.hik.staff.service.IHikStaffService;
import com.mortals.xhx.module.staff.dao.StaffDao; import com.mortals.xhx.module.staff.dao.StaffDao;
import com.mortals.xhx.module.staff.dao.ibatis.StaffDaoImpl; import com.mortals.xhx.module.staff.dao.ibatis.StaffDaoImpl;
import com.mortals.xhx.module.staff.dao.ibatis.StaffLeaveDaoImpl; import com.mortals.xhx.module.staff.dao.ibatis.StaffLeaveDaoImpl;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.model.StaffLeaveEntity;
import com.mortals.xhx.module.staff.model.StaffLeaveQuery;
import com.mortals.xhx.module.staff.model.StaffQuery;
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.StaffPerformStatService;
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;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -58,6 +57,7 @@ import org.springframework.util.ObjectUtils; ...@@ -58,6 +57,7 @@ import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -105,6 +105,8 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -105,6 +105,8 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
private UploadService uploadService; private UploadService uploadService;
@Autowired @Autowired
private IHikFaceService hikFaceService; private IHikFaceService hikFaceService;
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Override @Override
protected String getExtKey(StaffEntity data) { protected String getExtKey(StaffEntity data) {
...@@ -495,6 +497,37 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -495,6 +497,37 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
if (context.getUser() != null) { if (context.getUser() != null) {
update.setUpdateUserId(context.getUser().getId()); update.setUpdateUserId(context.getUser().getId());
} }
//OtherCheck作为绩效总开关,启用时新增当月绩效初始值,关闭时删除当月绩效数据
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH)+1;
StaffPerformSummaryQuery summaryQuery = new StaffPerformSummaryQuery();
summaryQuery.setStaffId(temp.getId());
summaryQuery.setYear(year);
summaryQuery.setMonth(month);
StaffPerformSummaryEntity tempSummary = staffPerformSummaryService.selectOne(summaryQuery);
if(update.getOtherCheck() == 1){
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue();
staffPerformSummaryEntity.setStaffId(temp.getId());
staffPerformSummaryEntity.setStaffName(temp.getName());
staffPerformSummaryEntity.setDeptId(temp.getDeptId());
staffPerformSummaryEntity.setDeptName(temp.getDeptName());
staffPerformSummaryEntity.setSalaId(temp.getSalaId());
staffPerformSummaryEntity.setSalaName(temp.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);
}
}
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