Commit beba6113 authored by 赵啸非's avatar 赵啸非

修改考勤汇总

parent 7b738ddf
......@@ -28,6 +28,9 @@ import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.perform.model.PerformReviewRecordEntity;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
......@@ -71,6 +74,32 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
@Autowired
private DeptService deptService;
@Autowired
private PerformRulesService rulesService;
@Override
protected void saveBefore(CheckAttendRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(CheckAttendRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(CheckAttendRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(CheckAttendRecordEntity entity, Context context) throws AppException {
//发送钉钉通知信息
......
......@@ -15,6 +15,7 @@ import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.dao.CheckComplainRecordDao;
import com.mortals.xhx.module.check.model.CheckAttendRecordEntity;
import com.mortals.xhx.module.check.model.CheckComplainRecordEntity;
import com.mortals.xhx.module.check.model.CheckEffectRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
......@@ -27,6 +28,8 @@ import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
......@@ -45,12 +48,12 @@ import java.util.Date;
import java.util.List;
/**
* CheckComplainRecordService
* 评价绩效投诉核查信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
* CheckComplainRecordService
* 评价绩效投诉核查信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
@Service("checkComplainRecordService")
@Slf4j
public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<CheckComplainRecordDao, CheckComplainRecordEntity, Long> implements CheckComplainRecordService {
......@@ -70,6 +73,33 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
@Autowired
private DeptService deptService;
@Autowired
private PerformRulesService rulesService;
@Override
protected void saveBefore(CheckComplainRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(CheckComplainRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(CheckComplainRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(CheckComplainRecordEntity entity, Context context) throws AppException {
......@@ -77,19 +107,18 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
sendCheckDingTalk(entity);
}
try{
try {
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId());
query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
query.setCheckTimeEnd(query.getCheckTimeStart());
summaryCheck(query);
}catch (Exception e){
log.error("汇总已审核的核查记录出错",e);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
}
}
private void sendCheckDingTalk(CheckComplainRecordEntity entity) {
String ruleStr = String.format("%s/%s/%s", PerformTypeEnum.评价投诉绩效.getDesc(), entity.getCategoryName(), entity.getRuleName());
//绩效核查通知
......@@ -116,10 +145,10 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
@Override
public void examine(CheckComplainRecordEntity entity, Context context) throws AppException {
if(entity.getId()==null){
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
if (context != null && context.getUser()!=null) {
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
entity.setCheckPerson(user.getRealName());
......@@ -129,23 +158,23 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
sendCheckDingTalk(entity);
try{
try {
CheckComplainRecordEntity temp = this.get(entity.getId());
if(temp!=null) {
if (temp != null) {
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}
}catch (Exception e){
log.error("汇总已审核的核查记录出错",e);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
}
}
@Override
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException {
if(StringUtils.isEmpty(query.getCheckTimeStart())||StringUtils.isEmpty(query.getCheckTimeStart())){
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
......@@ -154,31 +183,31 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
query.setCheckTimeEnd(endTime);
}
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if(CollectionUtils.isNotEmpty(summaryVoList)){
for(StaffCheckSummaryVo vo:summaryVoList){
if (CollectionUtils.isNotEmpty(summaryVoList)) {
for (StaffCheckSummaryVo vo : summaryVoList) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue();
BeanUtils.copyProperties(vo,staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo));
BeanUtils.copyProperties(vo, staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo));
staffPerformSummaryEntity.setComplainScore(vo.getSumScore());
StaffPerformSummaryQuery summaryQuery = new StaffPerformSummaryQuery();
summaryQuery.setStaffId(vo.getStaffId());
summaryQuery.setYear(vo.getYear());
summaryQuery.setMonth(vo.getMonth());
StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery);
if(temp!=null){
if(temp.getAttendScore()!=null){
if (temp != null) {
if (temp.getAttendScore() != null) {
staffPerformSummaryEntity.setAttendScore(temp.getAttendScore());
}
if(temp.getOtherScore()!=null){
if (temp.getOtherScore() != null) {
staffPerformSummaryEntity.setOtherScore(temp.getOtherScore());
}
if(temp.getGoworkScore()!=null){
if (temp.getGoworkScore() != null) {
staffPerformSummaryEntity.setGoworkScore(temp.getGoworkScore());
}
if(temp.getEffectScore()!=null){
if (temp.getEffectScore() != null) {
staffPerformSummaryEntity.setEffectScore(temp.getEffectScore());
}
if(temp.getReviewScore()!=null){
if (temp.getReviewScore() != null) {
staffPerformSummaryEntity.setReviewScore(temp.getReviewScore());
}
BigDecimal erro = new BigDecimal(0);
......@@ -197,7 +226,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity);
}else {
} else {
staffPerformSummaryEntity.setAttendScore(new BigDecimal(0));
staffPerformSummaryEntity.setOtherScore(new BigDecimal(0));
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
......@@ -230,8 +259,8 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
query.setCheckTimeEnd(endTime);
}
List<StaffPerformStatEntity> performStatList = dao.getStaffPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(StaffPerformStatEntity entity:performStatList) {
if (CollectionUtils.isNotEmpty(performStatList)) {
for (StaffPerformStatEntity entity : performStatList) {
StaffPerformStatQuery tempQuery = new StaffPerformStatQuery();
tempQuery.setStaffId(entity.getStaffId());
tempQuery.setYear(entity.getYear());
......@@ -248,7 +277,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
statEntity.setComplainScoreSub(entity.getComplainScoreSub());
computeStaff(statEntity);
staffPerformStatService.update(statEntity);
}else {
} else {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
......@@ -275,8 +304,8 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
query.setCheckTimeEnd(endTime);
}
List<DeptPerformStatEntity> performStatList = dao.getDeptPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(DeptPerformStatEntity entity:performStatList) {
if (CollectionUtils.isNotEmpty(performStatList)) {
for (DeptPerformStatEntity entity : performStatList) {
DeptPerformStatQuery tempQuery = new DeptPerformStatQuery();
tempQuery.setDeptId(entity.getDeptId());
tempQuery.setYear(entity.getYear());
......@@ -293,7 +322,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
statEntity.setComplainScoreSub(entity.getComplainScoreSub());
computeDept(statEntity);
deptPerformStatService.update(statEntity);
}else {
} else {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
......@@ -307,7 +336,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
}
}
private void computeStaff(StaffPerformStatEntity statEntity){
private void computeStaff(StaffPerformStatEntity statEntity) {
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
......@@ -330,14 +359,14 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
statEntity.setTotalScore(totalScore);
}
private void computeDept(DeptPerformStatEntity statEntity){
private void computeDept(DeptPerformStatEntity statEntity) {
DeptEntity deptEntity = deptService.get(statEntity.getDeptId());
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
if(deptEntity!=null){
if (deptEntity != null) {
totalScore = totalScore.multiply(new BigDecimal(deptEntity.getPersonNum()));
}else {
} else {
totalScore = totalScore.multiply(new BigDecimal(10));
}
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
......
......@@ -15,6 +15,7 @@ import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.dao.CheckEffectRecordDao;
import com.mortals.xhx.module.check.model.CheckComplainRecordEntity;
import com.mortals.xhx.module.check.model.CheckEffectRecordEntity;
import com.mortals.xhx.module.check.model.CheckGoworkRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
......@@ -27,6 +28,8 @@ import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
......@@ -70,6 +73,33 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
@Autowired
private DeptService deptService;
@Autowired
private PerformRulesService rulesService;
@Override
protected void saveBefore(CheckEffectRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(CheckEffectRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(CheckEffectRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(CheckEffectRecordEntity entity, Context context) throws AppException {
//发送钉钉通知信息
......
......@@ -15,6 +15,7 @@ import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.dao.CheckGoworkRecordDao;
import com.mortals.xhx.module.check.model.CheckEffectRecordEntity;
import com.mortals.xhx.module.check.model.CheckGoworkRecordEntity;
import com.mortals.xhx.module.check.model.CheckOtherRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
......@@ -27,6 +28,8 @@ import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
......@@ -70,6 +73,33 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
@Autowired
private DeptService deptService;
@Autowired
private PerformRulesService rulesService;
@Override
protected void saveBefore(CheckGoworkRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(CheckGoworkRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(CheckGoworkRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(CheckGoworkRecordEntity entity, Context context) throws AppException {
//发送钉钉通知信息
......
......@@ -11,6 +11,7 @@ import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckGoworkRecordEntity;
import com.mortals.xhx.module.check.model.CheckReviewRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
......@@ -21,6 +22,8 @@ import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
......@@ -71,6 +74,32 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
@Autowired
private DeptService deptService;
@Autowired
private PerformRulesService rulesService;
@Override
protected void saveBefore(CheckOtherRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(CheckOtherRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(CheckOtherRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(CheckOtherRecordEntity entity, Context context) throws AppException {
......
......@@ -11,6 +11,7 @@ import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckOtherRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.dept.model.DeptEntity;
......@@ -23,6 +24,8 @@ import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Link;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Msg;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
......@@ -73,6 +76,33 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
private DeptService deptService;
@Autowired
private PerformRulesService rulesService;
@Override
protected void saveBefore(CheckReviewRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(CheckReviewRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(CheckReviewRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(CheckReviewRecordEntity entity, Context context) throws AppException {
try {
......@@ -235,8 +265,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
query.setCheckTimeEnd(endTime);
}
List<StaffPerformStatEntity> performStatList = dao.getStaffPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(StaffPerformStatEntity entity:performStatList) {
if (CollectionUtils.isNotEmpty(performStatList)) {
for (StaffPerformStatEntity entity : performStatList) {
StaffPerformStatQuery tempQuery = new StaffPerformStatQuery();
tempQuery.setStaffId(entity.getStaffId());
tempQuery.setYear(entity.getYear());
......@@ -253,7 +283,7 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
statEntity.setReviewScoreSub(entity.getReviewScoreSub());
computeStaff(statEntity);
staffPerformStatService.update(statEntity);
}else {
} else {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
......@@ -280,8 +310,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
query.setCheckTimeEnd(endTime);
}
List<DeptPerformStatEntity> performStatList = dao.getDeptPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(DeptPerformStatEntity entity:performStatList) {
if (CollectionUtils.isNotEmpty(performStatList)) {
for (DeptPerformStatEntity entity : performStatList) {
DeptPerformStatQuery tempQuery = new DeptPerformStatQuery();
tempQuery.setDeptId(entity.getDeptId());
tempQuery.setYear(entity.getYear());
......@@ -298,7 +328,7 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
statEntity.setReviewScoreSub(entity.getReviewScoreSub());
computeDept(statEntity);
deptPerformStatService.update(statEntity);
}else {
} else {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
......@@ -312,7 +342,7 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
}
}
private void computeStaff(StaffPerformStatEntity statEntity){
private void computeStaff(StaffPerformStatEntity statEntity) {
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
......@@ -335,14 +365,14 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
statEntity.setTotalScore(totalScore);
}
private void computeDept(DeptPerformStatEntity statEntity){
private void computeDept(DeptPerformStatEntity statEntity) {
DeptEntity deptEntity = deptService.get(statEntity.getDeptId());
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
if(deptEntity!=null){
if (deptEntity != null) {
totalScore = totalScore.multiply(new BigDecimal(deptEntity.getPersonNum()));
}else {
} else {
totalScore = totalScore.multiply(new BigDecimal(10));
}
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
......
......@@ -5,6 +5,12 @@ import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckAttendRecordEntity;
import com.mortals.xhx.module.check.service.CheckAttendRecordService;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -15,6 +21,7 @@ import com.mortals.xhx.module.perform.dao.PerformAttendRecordDao;
import com.mortals.xhx.module.perform.model.PerformAttendRecordEntity;
import com.mortals.xhx.module.perform.service.PerformAttendRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.Date;
......@@ -31,6 +38,35 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
@Autowired
private CheckAttendRecordService checkAttendRecordService;
@Autowired
private DeptService deptService;
@Autowired
private PerformRulesService rulesService;
@Autowired
private StaffService staffService;
@Override
protected void saveBefore(PerformAttendRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(PerformAttendRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(PerformAttendRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(PerformAttendRecordEntity entity, Context context) throws AppException {
......
......@@ -4,6 +4,11 @@ import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckComplainRecordEntity;
import com.mortals.xhx.module.check.service.CheckComplainRecordService;
import com.mortals.xhx.module.perform.model.PerformAttendRecordEntity;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -14,6 +19,7 @@ import com.mortals.xhx.module.perform.dao.PerformComplainRecordDao;
import com.mortals.xhx.module.perform.model.PerformComplainRecordEntity;
import com.mortals.xhx.module.perform.service.PerformComplainRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.Date;
......@@ -31,6 +37,35 @@ public class PerformComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Pe
@Autowired
private CheckComplainRecordService checkComplainRecordService;
@Autowired
private PerformRulesService rulesService;
@Autowired
private StaffService staffService;
@Override
protected void saveBefore(PerformComplainRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(PerformComplainRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(PerformComplainRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(PerformComplainRecordEntity entity, Context context) throws AppException {
CheckComplainRecordEntity checkComplainRecordEntity = new CheckComplainRecordEntity();
......
package com.mortals.xhx.module.perform.service.impl;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckEffectRecordEntity;
import com.mortals.xhx.module.check.service.CheckEffectRecordService;
import com.mortals.xhx.module.perform.model.PerformComplainRecordEntity;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -14,16 +20,17 @@ import com.mortals.xhx.module.perform.dao.PerformEffectRecordDao;
import com.mortals.xhx.module.perform.model.PerformEffectRecordEntity;
import com.mortals.xhx.module.perform.service.PerformEffectRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.Date;
/**
* PerformEffectRecordService
* 效能绩效记录信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
* PerformEffectRecordService
* 效能绩效记录信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
@Service("performEffectRecordService")
@Slf4j
public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<PerformEffectRecordDao, PerformEffectRecordEntity, Long> implements PerformEffectRecordService {
......@@ -31,33 +38,61 @@ public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
@Autowired
private CheckEffectRecordService checkEffectRecordService;
@Autowired
private PerformRulesService rulesService;
@Autowired
private StaffService staffService;
@Override
protected void saveBefore(PerformEffectRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(PerformEffectRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(PerformEffectRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(PerformEffectRecordEntity entity, Context context) throws AppException {
CheckEffectRecordEntity checkEffectRecordEntity = new CheckEffectRecordEntity();
checkEffectRecordEntity.initAttrValue();
BeanUtils.copyProperties(entity,checkEffectRecordEntity, BeanUtil.getNullPropertyNames(entity));
BeanUtils.copyProperties(entity, checkEffectRecordEntity, BeanUtil.getNullPropertyNames(entity));
checkEffectRecordEntity.setId(null);
checkEffectRecordEntity.setRecordId(entity.getId());
if(entity.getSubMethod()== SubMethodEnum.系统自动.getValue()){
if (entity.getSubMethod() == SubMethodEnum.系统自动.getValue()) {
checkEffectRecordEntity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //自动扣分相设置为已处理
checkEffectRecordEntity.setCheckTime(new Date());
}else {
} else {
checkEffectRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkEffectRecordService.save(checkEffectRecordEntity,context);
checkEffectRecordService.save(checkEffectRecordEntity, context);
}
@Override
public void updateProcessStatus(Long id, Integer status) throws AppException {
if(id==null){
if (id == null) {
throw new AppException("效能绩效记录Id不能为空");
}
PerformEffectRecordEntity entity = this.get(id);
if(entity==null){
if (entity == null) {
throw new AppException("无效的效能绩效记录Id");
}
if(status==null){
status=1; //处理状态(1.未核查,2.已核查)
if (status == null) {
status = 1; //处理状态(1.未核查,2.已核查)
}
PerformEffectRecordEntity update = new PerformEffectRecordEntity();
update.setId(id);
......
......@@ -4,6 +4,11 @@ import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckGoworkRecordEntity;
import com.mortals.xhx.module.check.service.CheckGoworkRecordService;
import com.mortals.xhx.module.perform.model.PerformEffectRecordEntity;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -14,6 +19,7 @@ import com.mortals.xhx.module.perform.dao.PerformGoworkRecordDao;
import com.mortals.xhx.module.perform.model.PerformGoworkRecordEntity;
import com.mortals.xhx.module.perform.service.PerformGoworkRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.Date;
......@@ -31,6 +37,34 @@ public class PerformGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
@Autowired
private CheckGoworkRecordService checkGoworkRecordService;
@Autowired
private PerformRulesService rulesService;
@Autowired
private StaffService staffService;
@Override
protected void saveBefore(PerformGoworkRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(PerformGoworkRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(PerformGoworkRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(PerformGoworkRecordEntity entity, Context context) throws AppException {
CheckGoworkRecordEntity checkGoworkRecordEntity = new CheckGoworkRecordEntity();
......
......@@ -4,6 +4,11 @@ import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckOtherRecordEntity;
import com.mortals.xhx.module.check.service.CheckOtherRecordService;
import com.mortals.xhx.module.perform.model.PerformGoworkRecordEntity;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -14,6 +19,7 @@ import com.mortals.xhx.module.perform.dao.PerformOtherRecordDao;
import com.mortals.xhx.module.perform.model.PerformOtherRecordEntity;
import com.mortals.xhx.module.perform.service.PerformOtherRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.Date;
......@@ -31,6 +37,34 @@ public class PerformOtherRecordServiceImpl extends AbstractCRUDServiceImpl<Perfo
@Autowired
private CheckOtherRecordService checkOtherRecordService;
@Autowired
private PerformRulesService rulesService;
@Autowired
private StaffService staffService;
@Override
protected void saveBefore(PerformOtherRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(PerformOtherRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(PerformOtherRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(PerformOtherRecordEntity entity, Context context) throws AppException {
CheckOtherRecordEntity checkOtherRecordEntity = new CheckOtherRecordEntity();
......
package com.mortals.xhx.module.perform.service.impl;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckReviewRecordEntity;
import com.mortals.xhx.module.check.service.CheckReviewRecordService;
import com.mortals.xhx.module.perform.model.PerformOtherRecordEntity;
import com.mortals.xhx.module.perform.model.PerformRulesEntity;
import com.mortals.xhx.module.perform.service.PerformRulesService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -14,16 +20,17 @@ import com.mortals.xhx.module.perform.dao.PerformReviewRecordDao;
import com.mortals.xhx.module.perform.model.PerformReviewRecordEntity;
import com.mortals.xhx.module.perform.service.PerformReviewRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.Date;
/**
* PerformReviewRecordService
* 评价差评绩效记录信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
* PerformReviewRecordService
* 评价差评绩效记录信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
@Service("performReviewRecordService")
@Slf4j
public class PerformReviewRecordServiceImpl extends AbstractCRUDServiceImpl<PerformReviewRecordDao, PerformReviewRecordEntity, Long> implements PerformReviewRecordService {
......@@ -31,33 +38,61 @@ public class PerformReviewRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
@Autowired
private CheckReviewRecordService checkReviewRecordService;
@Autowired
private PerformRulesService rulesService;
@Autowired
private StaffService staffService;
@Override
protected void saveBefore(PerformReviewRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
@Override
protected void updateBefore(PerformReviewRecordEntity entity, Context context) throws AppException {
updateStaffRuleNames(entity);
}
private void updateStaffRuleNames(PerformReviewRecordEntity entity) {
if (!ObjectUtils.isEmpty(entity.getRuleId())) {
PerformRulesEntity rulesEntity = rulesService.getCache(entity.getRuleId().toString());
entity.setRuleName(rulesEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
}
@Override
protected void saveAfter(PerformReviewRecordEntity entity, Context context) throws AppException {
CheckReviewRecordEntity checkReviewRecordEntity = new CheckReviewRecordEntity();
BeanUtils.copyProperties(entity,checkReviewRecordEntity, BeanUtil.getNullPropertyNames(entity));
BeanUtils.copyProperties(entity, checkReviewRecordEntity, BeanUtil.getNullPropertyNames(entity));
checkReviewRecordEntity.setId(null);
checkReviewRecordEntity.setRecordId(entity.getId());
if(entity.getSubMethod()== SubMethodEnum.系统自动.getValue()){
if (entity.getSubMethod() == SubMethodEnum.系统自动.getValue()) {
checkReviewRecordEntity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //自动扣分相设置为已处理
checkReviewRecordEntity.setCheckTime(new Date());
}else {
} else {
checkReviewRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkReviewRecordService.save(checkReviewRecordEntity,context);
checkReviewRecordService.save(checkReviewRecordEntity, context);
}
@Override
public void updateProcessStatus(Long id, Integer status) throws AppException {
if(id==null){
if (id == null) {
throw new AppException("评价差评绩效记录Id不能为空");
}
PerformReviewRecordEntity entity = this.get(id);
if(entity==null){
if (entity == null) {
throw new AppException("无效的评价差评绩效记录Id");
}
if(status==null){
status=1; //处理状态(1.未核查,2.已核查)
if (status == null) {
status = 1; //处理状态(1.未核查,2.已核查)
}
PerformReviewRecordEntity update = new PerformReviewRecordEntity();
update.setId(id);
......
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