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

修改考勤汇总

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