Commit 339f0bf6 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 91cb2ef1 699777a6
......@@ -47,22 +47,46 @@ public class StaffPerformUtil {
BigDecimal summary = new BigDecimal(0);
if(staffEntity.getReviewCheck()==1) {
summary = summary.add(reviewScore);
}else {
summary = summary.add(weightPdu.reviewWeight());
staffPerformSummaryEntity.setErrorScore(staffPerformSummaryEntity.getErrorScore().subtract(staffPerformSummaryEntity.getReviewScore()));
staffPerformSummaryEntity.setReviewScore(BigDecimal.ZERO);
}
if(staffEntity.getAttendCheck()==1) {
summary = summary.add(attendScore);
}else {
summary = summary.add(weightPdu.attendWeight());
staffPerformSummaryEntity.setErrorScore(staffPerformSummaryEntity.getErrorScore().subtract(staffPerformSummaryEntity.getAttendScore()));
staffPerformSummaryEntity.setAttendScore(BigDecimal.ZERO);
}
summary = summary.add(otherScore);
if(staffEntity.getEffectCheck()==1){
summary = summary.add(effectScore);
}else {
summary = summary.add(weightPdu.effectWeight());
staffPerformSummaryEntity.setErrorScore(staffPerformSummaryEntity.getErrorScore().subtract(staffPerformSummaryEntity.getEffectScore()));
staffPerformSummaryEntity.setEffectScore(BigDecimal.ZERO);
}
if(staffEntity.getGoworkCheck()==1) {
summary = summary.add(goworkScore);
}else {
summary = summary.add(weightPdu.goworkWeight());
staffPerformSummaryEntity.setErrorScore(staffPerformSummaryEntity.getErrorScore().subtract(staffPerformSummaryEntity.getGoworkScore()));
staffPerformSummaryEntity.setGoworkScore(BigDecimal.ZERO);
}
if(staffEntity.getComplainCheck()==1){
summary = summary.add(complainScore);
}else {
summary = summary.add(weightPdu.selfWeight());
BigDecimal complainScoreErro = SCORE100.subtract(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(staffPerformSummaryEntity.getErrorScore().subtract(BigDecimal.ZERO.subtract(complainScoreErro)));
staffPerformSummaryEntity.setComplainScore(BigDecimal.ZERO);
}
staffPerformSummaryEntity.setTotalScore(summary);
if(staffPerformSummaryEntity.getAddTotalScore()!=null){
staffPerformSummaryEntity.setSumScore(staffPerformSummaryEntity.getTotalScore().add(staffPerformSummaryEntity.getAddTotalScore()));
}
}
}
......@@ -41,6 +41,7 @@ public class AttendSummaryService implements IApplicationStartedService {
try {
AttendanceSummaryQuery query = cacheService.brpop(KEY_ATTENDANCE_STAT_CACHE, 60,AttendanceSummaryQuery.class);
if(!ObjectUtils.isEmpty(query)){
Thread.sleep(2000);
if (StringUtils.isNotEmpty(query.getSummaryTimeStart()) && StringUtils.isNotEmpty(query.getSummaryTimeEnd())) {
List<String> dateList = getDatesBetween(query.getSummaryTimeStart(), query.getSummaryTimeEnd());
for (String day : dateList) {
......
......@@ -7,15 +7,21 @@ import com.mortals.framework.springcloud.service.IApplicationStartedService;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.common.utils.StaffPerformUtil;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import static com.mortals.xhx.common.key.RedisKey.KEY_CHECK_SUMMARY_CACHE;
import static com.mortals.xhx.common.key.RedisKey.STAFF_PERFORM_SUMMARY;
......@@ -45,6 +51,8 @@ public class StaffCheckSummaryService implements IApplicationStartedService {
private CheckWindowWorkmanPerformService checkWindowWorkmanPerformService;
@Autowired
private CheckOtherRecordService checkOtherRecordService;
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Override
public void start() {
......@@ -74,6 +82,32 @@ public class StaffCheckSummaryService implements IApplicationStartedService {
}
}
//汇总前初始化绩效避免之前有扣分但被全部撤销的情况
Date date = DateUtils.StrToDateTime(query.getCheckTimeStart());
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.setReviewScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setOtherScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setGoworkScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setEffectScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setComplainScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setAttendScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setTotalScore(StaffPerformUtil.SCORE100);
//staffPerformSummaryEntity.setAddTotalScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setErrorScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setSumScore(StaffPerformUtil.SCORE100);
staffPerformSummaryEntity.setUpdateTime(new Date());
Map<String,Object> condition = new HashMap<>();
condition.put("year",year);
condition.put("month",month);
if(query.getStaffId()!=null){
condition.put("staffId",query.getStaffId());
}
staffPerformSummaryService.getDao().update(staffPerformSummaryEntity,condition);
if(query.getCheckType() == CheckTypeEnum.考勤绩效.getValue()){
checkAttendRecordService.summaryCheck(query);
}
......
......@@ -91,6 +91,25 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
});
}
@Override
protected void updateBefore(AttendanceRecordErrorEntity entity, Context context) throws AppException {
AttendanceRecordErrorEntity temp = this.get(entity.getId());
if(temp==null){
throw new AppException("考勤异常数据不存在");
}
if(temp.getErrorStatus().intValue()!=DataUtil.converStr2Int(entity.getProcessResult(),0)){
//异常处理结果与原来不符合时先删除已生成的考勤绩效
PerformAttendRecordQuery query = new PerformAttendRecordQuery();
query.setStaffId(temp.getStaffId());
query.setErrorTime(temp.getErrorDateTime());
List<PerformAttendRecordEntity> delAttendRecords = performAttendRecordService.find(query, context);
if (!ObjectUtils.isEmpty(delAttendRecords)) {
Long[] delIds = delAttendRecords.stream().map(i -> i.getId()).toArray(Long[]::new);
performAttendRecordService.remove(delIds, context);
}
}
}
@Override
protected void updateAfter(AttendanceRecordErrorEntity entity, Context context) throws AppException {
if (YesNoEnum.YES.getValue() == entity.getProcessStatus()) {
......
......@@ -363,6 +363,8 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
//汇总当前日期异常考勤
List<ErrorSummaryVo> errorSummaryVoList = attendanceSummaryDao.getErrorSummary(query);
if (CollectionUtils.isNotEmpty(errorSummaryVoList)) {
log.info("考勤异常查询条件:"+JSON.toJSONString(query));
log.info("当前日期考勤异常人数"+errorSummaryVoList.size());
List<AttendanceStatEntity> updateList = new ArrayList<>();
List<AttendanceStaffStatEntity> addStaffStat = new ArrayList<>();
List<AttendanceStaffStatEntity> updateStaffStat = new ArrayList<>();
......@@ -444,11 +446,13 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
staffStat.setId(staffStatTemp.getId());
staffStat.setUpdateTime(new Date());
//attendanceStaffStatService.update(staffStat);
//log.info(JSON.toJSONString(staffStat));
updateStaffStat.add(staffStat);
} else {
staffStat.setCreateTime(DateUtils.StrToDate(query.getSummaryTime()));
staffStat.setCreateUserId(1l);
//attendanceStaffStatService.save(staffStat);
//log.info(JSON.toJSONString(staffStat));
addStaffStat.add(staffStat);
}
}
......@@ -457,9 +461,11 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
}
if(addStaffStat.size()>0){
attendanceStaffStatService.save(addStaffStat);
//log.info("attendanceStaffStatService新增数据:"+u);
}
if(updateStaffStat.size()>0){
attendanceStaffStatService.update(updateStaffStat);
//log.info("attendanceStaffStatService更新数据:"+u);
}
}
log.info("完成汇总当前日期异常考勤.....");
......
......@@ -312,6 +312,8 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
summaryQuery.setMonth(vo.getMonth());
StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery);
if (temp != null) {
staffPerformSummaryEntity.setRemarkAdd(temp.getRemarkAdd());
staffPerformSummaryEntity.setAddTotalScore(temp.getAddTotalScore());
if (temp.getReviewScore() != null) {
staffPerformSummaryEntity.setReviewScore(temp.getReviewScore());
}
......@@ -340,6 +342,7 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
StaffPerformUtil.computeSummary(staffPerformSummaryEntity,weightPdu,staffEntity);
staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity);
} else {
staffPerformSummaryEntity.setReviewScore(BigDecimal.ZERO);
......
......@@ -306,6 +306,8 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
summaryQuery.setMonth(vo.getMonth());
StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery);
if (temp != null) {
staffPerformSummaryEntity.setRemarkAdd(temp.getRemarkAdd());
staffPerformSummaryEntity.setAddTotalScore(temp.getAddTotalScore());
if (temp.getAttendScore() != null) {
staffPerformSummaryEntity.setAttendScore(temp.getAttendScore());
}
......
......@@ -295,6 +295,8 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
summaryQuery.setMonth(vo.getMonth());
StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery);
if(temp!=null){
staffPerformSummaryEntity.setRemarkAdd(temp.getRemarkAdd());
staffPerformSummaryEntity.setAddTotalScore(temp.getAddTotalScore());
if(temp.getReviewScore()!=null){
staffPerformSummaryEntity.setReviewScore(temp.getReviewScore());
}
......
......@@ -294,6 +294,8 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
summaryQuery.setMonth(vo.getMonth());
StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery);
if(temp!=null){
staffPerformSummaryEntity.setRemarkAdd(temp.getRemarkAdd());
staffPerformSummaryEntity.setAddTotalScore(temp.getAddTotalScore());
if(temp.getReviewScore()!=null){
staffPerformSummaryEntity.setReviewScore(temp.getReviewScore());
}
......
......@@ -299,6 +299,8 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
summaryQuery.setMonth(vo.getMonth());
StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery);
if (temp != null) {
staffPerformSummaryEntity.setRemarkAdd(temp.getRemarkAdd());
staffPerformSummaryEntity.setAddTotalScore(temp.getAddTotalScore());
if (temp.getReviewScore() != null) {
staffPerformSummaryEntity.setReviewScore(temp.getReviewScore());
}
......
......@@ -303,6 +303,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
summaryQuery.setMonth(vo.getMonth());
StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery);
if (temp != null) {
staffPerformSummaryEntity.setRemarkAdd(temp.getRemarkAdd());
staffPerformSummaryEntity.setAddTotalScore(temp.getAddTotalScore());
if (temp.getAttendScore() != null) {
staffPerformSummaryEntity.setAttendScore(temp.getAttendScore());
}
......
......@@ -282,7 +282,7 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
private PerformRulesEntity getRule(String ruleCode) {
PerformRulesEntity rule = rulesService.getCache(ruleCode);
if (ObjectUtils.isEmpty(rule))
throw new AppException(String.format("当前手机号码未找到匹配的员工!rule:%s", ruleCode));
throw new AppException(String.format("当前绩效规则编码没有匹配到正确的规则!rule:%s", ruleCode));
return rule;
}
......
......@@ -7,9 +7,7 @@ import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.perform.model.PerformDeptConfDetailEntity;
import com.mortals.xhx.module.perform.model.PerformDeptConfDetailQuery;
import com.mortals.xhx.module.perform.model.PerformRulesCategoryEntity;
import com.mortals.xhx.module.perform.model.*;
import com.mortals.xhx.module.perform.service.PerformDeptConfDetailService;
import com.mortals.xhx.module.perform.service.PerformRulesCategoryService;
import org.apache.commons.collections4.CollectionUtils;
......@@ -19,7 +17,6 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.perform.dao.PerformDeptConfDao;
import com.mortals.xhx.module.perform.model.PerformDeptConfEntity;
import com.mortals.xhx.module.perform.service.PerformDeptConfService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
......@@ -92,6 +89,12 @@ public class PerformDeptConfServiceImpl extends AbstractCRUDServiceImpl<PerformD
item.setId(null);
}
performDeptConfDetailService.save(entity.getDeptConfDetail(), context);
}else {
List<PerformDeptConfDetailEntity> list = performDeptConfDetailService.find(new PerformDeptConfDetailQuery().deptConfId(entity.getId()));
if(CollectionUtils.isNotEmpty(list)){
Long[] ids = list.stream().map(PerformDeptConfDetailEntity::getId).toArray(Long[]::new);
performDeptConfDetailService.remove(ids,context);
}
}
}
......@@ -133,6 +136,12 @@ public class PerformDeptConfServiceImpl extends AbstractCRUDServiceImpl<PerformD
} else {
entity.setOtherCount(0);
}
}else {
entity.setAttendCount(0);
entity.setAssessCount(0);
entity.setWorkCount(0);
entity.setOtherCount(0);
entity.setEffectCount(0);
}
}
......@@ -152,6 +161,12 @@ public class PerformDeptConfServiceImpl extends AbstractCRUDServiceImpl<PerformD
item.setId(null);
}
performDeptConfDetailService.save(entity.getDeptConfDetail(), context);
}else {
List<PerformDeptConfDetailEntity> list = performDeptConfDetailService.find(new PerformDeptConfDetailQuery().deptConfId(entity.getId()));
if(CollectionUtils.isNotEmpty(list)){
Long[] ids = list.stream().map(PerformDeptConfDetailEntity::getId).toArray(Long[]::new);
performDeptConfDetailService.remove(ids,context);
}
}
}
......
......@@ -102,6 +102,12 @@ public class PerformStaffConfServiceImpl extends AbstractCRUDServiceImpl<Perform
} else {
entity.setOtherCount(0);
}
}else {
entity.setAttendCount(0);
entity.setAssessCount(0);
entity.setWorkCount(0);
entity.setOtherCount(0);
entity.setEffectCount(0);
}
}
......@@ -123,6 +129,12 @@ public class PerformStaffConfServiceImpl extends AbstractCRUDServiceImpl<Perform
}
}
performStaffConfDetailService.save(entity.getStaffConfDetail(), context);
}else {
List<PerformStaffConfDetailEntity> list = performStaffConfDetailService.find(new PerformStaffConfDetailQuery().staffConfId(entity.getId()));
if(CollectionUtils.isNotEmpty(list)){
Long[] ids = list.stream().map(PerformStaffConfDetailEntity::getId).toArray(Long[]::new);
performStaffConfDetailService.remove(ids,context);
}
}
}
......@@ -164,6 +176,12 @@ public class PerformStaffConfServiceImpl extends AbstractCRUDServiceImpl<Perform
}
}
performStaffConfDetailService.save(entity.getStaffConfDetail(), context);
}else {
List<PerformStaffConfDetailEntity> list = performStaffConfDetailService.find(new PerformStaffConfDetailQuery().staffConfId(entity.getId()));
if(CollectionUtils.isNotEmpty(list)){
Long[] ids = list.stream().map(PerformStaffConfDetailEntity::getId).toArray(Long[]::new);
performStaffConfDetailService.remove(ids,context);
}
}
}
......
package com.mortals.xhx.module.staff.model;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.module.staff.model.vo.StaffPerformSummaryVo;
import com.mortals.xhx.utils.SpringUtils;
import lombok.Data;
/**
* 员工绩效统计实体对象
*
* @author zxfei
* @date 2023-07-18
* @date 2024-07-22
*/
@Data
public class StaffPerformSummaryEntity extends StaffPerformSummaryVo {
......@@ -98,23 +97,38 @@ public class StaffPerformSummaryEntity extends StaffPerformSummaryVo {
/**
* 当月得分数
*/
@Excel(name = "本月得分数",sort = 12)
@Excel(name = "本月绩效得分数",sort = 12)
private BigDecimal totalScore;
/**
* 备注
*/
@Excel(name = "备注",sort = 15)
@Excel(name = "备注1",sort = 19)
private String remark;
/**
* 年
*/
@Excel(name = "年",sort = 13)
@Excel(name = "年",sort = 15)
private Integer year;
/**
* 月
*/
@Excel(name = "月",sort = 14)
@Excel(name = "月",sort = 16)
private Integer month;
/**
* 加分备注
*/
private String remarkAdd;
/**
* 加分合计
*/
@Excel(name = "加分",sort = 13)
private BigDecimal addTotalScore;
/**
* 合计得分
*/
@Excel(name = "合计得分",sort = 14)
private BigDecimal sumScore;
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -132,7 +146,6 @@ public class StaffPerformSummaryEntity extends StaffPerformSummaryVo {
}
public void initAttrValue(){
this.staffId = 0L;
this.workNum = "";
......@@ -157,7 +170,7 @@ public class StaffPerformSummaryEntity extends StaffPerformSummaryVo {
this.errorScore = new BigDecimal(0);
this.totalScore = new BigDecimal(0);
this.totalScore = new BigDecimal(100);
this.remark = "";
......@@ -173,5 +186,11 @@ public class StaffPerformSummaryEntity extends StaffPerformSummaryVo {
this.salaId = null;
this.salaName = "";
this.remarkAdd = "";
this.addTotalScore = BigDecimal.ZERO;
this.sumScore = new BigDecimal(100);;
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity;
* 员工绩效统计查询对象
*
* @author zxfei
* @date 2024-03-12
* @date 2024-07-22
*/
public class StaffPerformSummaryQuery extends StaffPerformSummaryEntity {
/** 开始 主键ID,主键,自增长 */
......@@ -292,6 +292,41 @@ public class StaffPerformSummaryQuery extends StaffPerformSummaryEntity {
/** 所属大厅名称排除列表 */
private List <String> salaNameNotList;
/** 加分备注 */
private List<String> remarkAddList;
/** 加分备注排除列表 */
private List <String> remarkAddNotList;
/** 开始 加分合计 */
private BigDecimal addTotalScoreStart;
/** 结束 加分合计 */
private BigDecimal addTotalScoreEnd;
/** 增加 加分合计 */
private BigDecimal addTotalScoreIncrement;
/** 加分合计列表 */
private List <BigDecimal> addTotalScoreList;
/** 加分合计排除列表 */
private List <BigDecimal> addTotalScoreNotList;
/** 开始 合计得分 */
private BigDecimal sumScoreStart;
/** 结束 合计得分 */
private BigDecimal sumScoreEnd;
/** 增加 合计得分 */
private BigDecimal sumScoreIncrement;
/** 合计得分列表 */
private List <BigDecimal> sumScoreList;
/** 合计得分排除列表 */
private List <BigDecimal> sumScoreNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<StaffPerformSummaryQuery> orConditionList;
......@@ -1852,6 +1887,200 @@ public class StaffPerformSummaryQuery extends StaffPerformSummaryEntity {
this.salaNameNotList = salaNameNotList;
}
/**
* 获取 加分备注
* @return remarkAddList
*/
public List<String> getRemarkAddList(){
return this.remarkAddList;
}
/**
* 设置 加分备注
* @param remarkAddList
*/
public void setRemarkAddList(List<String> remarkAddList){
this.remarkAddList = remarkAddList;
}
/**
* 获取 加分备注
* @return remarkAddNotList
*/
public List<String> getRemarkAddNotList(){
return this.remarkAddNotList;
}
/**
* 设置 加分备注
* @param remarkAddNotList
*/
public void setRemarkAddNotList(List<String> remarkAddNotList){
this.remarkAddNotList = remarkAddNotList;
}
/**
* 获取 开始 加分合计
* @return addTotalScoreStart
*/
public BigDecimal getAddTotalScoreStart(){
return this.addTotalScoreStart;
}
/**
* 设置 开始 加分合计
* @param addTotalScoreStart
*/
public void setAddTotalScoreStart(BigDecimal addTotalScoreStart){
this.addTotalScoreStart = addTotalScoreStart;
}
/**
* 获取 结束 加分合计
* @return $addTotalScoreEnd
*/
public BigDecimal getAddTotalScoreEnd(){
return this.addTotalScoreEnd;
}
/**
* 设置 结束 加分合计
* @param addTotalScoreEnd
*/
public void setAddTotalScoreEnd(BigDecimal addTotalScoreEnd){
this.addTotalScoreEnd = addTotalScoreEnd;
}
/**
* 获取 增加 加分合计
* @return addTotalScoreIncrement
*/
public BigDecimal getAddTotalScoreIncrement(){
return this.addTotalScoreIncrement;
}
/**
* 设置 增加 加分合计
* @param addTotalScoreIncrement
*/
public void setAddTotalScoreIncrement(BigDecimal addTotalScoreIncrement){
this.addTotalScoreIncrement = addTotalScoreIncrement;
}
/**
* 获取 加分合计
* @return addTotalScoreList
*/
public List<BigDecimal> getAddTotalScoreList(){
return this.addTotalScoreList;
}
/**
* 设置 加分合计
* @param addTotalScoreList
*/
public void setAddTotalScoreList(List<BigDecimal> addTotalScoreList){
this.addTotalScoreList = addTotalScoreList;
}
/**
* 获取 加分合计
* @return addTotalScoreNotList
*/
public List<BigDecimal> getAddTotalScoreNotList(){
return this.addTotalScoreNotList;
}
/**
* 设置 加分合计
* @param addTotalScoreNotList
*/
public void setAddTotalScoreNotList(List<BigDecimal> addTotalScoreNotList){
this.addTotalScoreNotList = addTotalScoreNotList;
}
/**
* 获取 开始 合计得分
* @return sumScoreStart
*/
public BigDecimal getSumScoreStart(){
return this.sumScoreStart;
}
/**
* 设置 开始 合计得分
* @param sumScoreStart
*/
public void setSumScoreStart(BigDecimal sumScoreStart){
this.sumScoreStart = sumScoreStart;
}
/**
* 获取 结束 合计得分
* @return $sumScoreEnd
*/
public BigDecimal getSumScoreEnd(){
return this.sumScoreEnd;
}
/**
* 设置 结束 合计得分
* @param sumScoreEnd
*/
public void setSumScoreEnd(BigDecimal sumScoreEnd){
this.sumScoreEnd = sumScoreEnd;
}
/**
* 获取 增加 合计得分
* @return sumScoreIncrement
*/
public BigDecimal getSumScoreIncrement(){
return this.sumScoreIncrement;
}
/**
* 设置 增加 合计得分
* @param sumScoreIncrement
*/
public void setSumScoreIncrement(BigDecimal sumScoreIncrement){
this.sumScoreIncrement = sumScoreIncrement;
}
/**
* 获取 合计得分
* @return sumScoreList
*/
public List<BigDecimal> getSumScoreList(){
return this.sumScoreList;
}
/**
* 设置 合计得分
* @param sumScoreList
*/
public void setSumScoreList(List<BigDecimal> sumScoreList){
this.sumScoreList = sumScoreList;
}
/**
* 获取 合计得分
* @return sumScoreNotList
*/
public List<BigDecimal> getSumScoreNotList(){
return this.sumScoreNotList;
}
/**
* 设置 合计得分
* @param sumScoreNotList
*/
public void setSumScoreNotList(List<BigDecimal> sumScoreNotList){
this.sumScoreNotList = sumScoreNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param id
......@@ -2832,6 +3061,133 @@ public class StaffPerformSummaryQuery extends StaffPerformSummaryEntity {
return this;
}
/**
* 设置 加分备注
* @param remarkAdd
*/
public StaffPerformSummaryQuery remarkAdd(String remarkAdd){
setRemarkAdd(remarkAdd);
return this;
}
/**
* 设置 加分备注
* @param remarkAddList
*/
public StaffPerformSummaryQuery remarkAddList(List<String> remarkAddList){
this.remarkAddList = remarkAddList;
return this;
}
/**
* 设置 加分合计
* @param addTotalScore
*/
public StaffPerformSummaryQuery addTotalScore(BigDecimal addTotalScore){
setAddTotalScore(addTotalScore);
return this;
}
/**
* 设置 开始 加分合计
* @param addTotalScoreStart
*/
public StaffPerformSummaryQuery addTotalScoreStart(BigDecimal addTotalScoreStart){
this.addTotalScoreStart = addTotalScoreStart;
return this;
}
/**
* 设置 结束 加分合计
* @param addTotalScoreEnd
*/
public StaffPerformSummaryQuery addTotalScoreEnd(BigDecimal addTotalScoreEnd){
this.addTotalScoreEnd = addTotalScoreEnd;
return this;
}
/**
* 设置 增加 加分合计
* @param addTotalScoreIncrement
*/
public StaffPerformSummaryQuery addTotalScoreIncrement(BigDecimal addTotalScoreIncrement){
this.addTotalScoreIncrement = addTotalScoreIncrement;
return this;
}
/**
* 设置 加分合计
* @param addTotalScoreList
*/
public StaffPerformSummaryQuery addTotalScoreList(List<BigDecimal> addTotalScoreList){
this.addTotalScoreList = addTotalScoreList;
return this;
}
/**
* 设置 加分合计
* @param addTotalScoreNotList
*/
public StaffPerformSummaryQuery addTotalScoreNotList(List<BigDecimal> addTotalScoreNotList){
this.addTotalScoreNotList = addTotalScoreNotList;
return this;
}
/**
* 设置 合计得分
* @param sumScore
*/
public StaffPerformSummaryQuery sumScore(BigDecimal sumScore){
setSumScore(sumScore);
return this;
}
/**
* 设置 开始 合计得分
* @param sumScoreStart
*/
public StaffPerformSummaryQuery sumScoreStart(BigDecimal sumScoreStart){
this.sumScoreStart = sumScoreStart;
return this;
}
/**
* 设置 结束 合计得分
* @param sumScoreEnd
*/
public StaffPerformSummaryQuery sumScoreEnd(BigDecimal sumScoreEnd){
this.sumScoreEnd = sumScoreEnd;
return this;
}
/**
* 设置 增加 合计得分
* @param sumScoreIncrement
*/
public StaffPerformSummaryQuery sumScoreIncrement(BigDecimal sumScoreIncrement){
this.sumScoreIncrement = sumScoreIncrement;
return this;
}
/**
* 设置 合计得分
* @param sumScoreList
*/
public StaffPerformSummaryQuery sumScoreList(List<BigDecimal> sumScoreList){
this.sumScoreList = sumScoreList;
return this;
}
/**
* 设置 合计得分
* @param sumScoreNotList
*/
public StaffPerformSummaryQuery sumScoreNotList(List<BigDecimal> sumScoreNotList){
this.sumScoreNotList = sumScoreNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
......@@ -22,4 +22,13 @@ public class StaffPerformSummaryVo extends BaseEntityLong {
private String phoneNumber;
private Integer sortKind;
@Excel(name = "备注2",sort = 20)
private String remarkAddDesc;
@Excel(name = "政务服务管理科审核等次(“好”等次比例40%) ",sort = 17)
private String beiyong1;
@Excel(name = "服务明星推荐 (“好”等次20%)",sort = 18)
private String beiyong2;
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.staff.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.common.utils.StaffPerformUtil;
......@@ -72,6 +74,14 @@ public class StaffPerformSummaryServiceImpl extends AbstractCRUDServiceImpl<Staf
item.setPhoneNumber(staffEntity.getPhoneNumber());
}
computeSummary(item,weightPdu);
if(StringUtils.isNotEmpty(item.getRemarkAdd())){
List<JSONObject> jList = JSONArray.parseArray(item.getRemarkAdd(),JSONObject.class);
String desc = "";
for (JSONObject jsonObject:jList){
desc+=jsonObject.getString("name")+"("+jsonObject.getString("score")+");";
}
item.setRemarkAddDesc(desc);
}
}
}
}
......@@ -106,4 +116,12 @@ public class StaffPerformSummaryServiceImpl extends AbstractCRUDServiceImpl<Staf
staffPerformSummaryEntity.setEffectScore(effectScore.setScale(2,BigDecimal.ROUND_DOWN));
}
@Override
protected void updateBefore(StaffPerformSummaryEntity entity, Context context) throws AppException {
super.updateBefore(entity,context);
if(entity.getAddTotalScore()!=null){
entity.setSumScore(entity.getTotalScore().add(entity.getAddTotalScore()));
}
}
}
......@@ -87,8 +87,11 @@ public class StaffPerformSummaryController extends BaseCRUDJsonBodyMappingContro
List<OrderCol> orderColList = new ArrayList();
if(query.getSortKind()!=null && query.getSortKind()==1){
orderColList.add(new OrderCol("totalScore",OrderCol.DESCENDING));
}else {
}else if(query.getSortKind()!=null && query.getSortKind()==2) {
orderColList.add(new OrderCol("totalScore",OrderCol.ASCENDING));
}else {
orderColList.add(new OrderCol("salaName",OrderCol.ASCENDING));
orderColList.add(new OrderCol("deptName",OrderCol.ASCENDING));
}
query.setOrderColList(orderColList);
}
......@@ -138,30 +141,30 @@ public class StaffPerformSummaryController extends BaseCRUDJsonBodyMappingContro
if(StringUtils.isNotEmpty(verify)&&verify.equals("true")){
throw new AppException("汇总任务正在执行,请勿重复操作");
}
if(StringUtils.isNotEmpty(query.getCheckTimeStart())){
Date date = DateUtils.StrToDateTime(query.getCheckTimeStart());
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.setReviewScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setOtherScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setGoworkScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setEffectScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setComplainScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setAttendScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setTotalScore(StaffPerformUtil.SCORE100);
staffPerformSummaryEntity.setErrorScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setUpdateTime(new Date());
Map<String,Object> condition = new HashMap<>();
condition.put("year",year);
condition.put("month",month);
if(query.getStaffId()!=null){
condition.put("staffId",query.getStaffId());
}
this.service.getDao().update(staffPerformSummaryEntity,condition);
}
// if(StringUtils.isNotEmpty(query.getCheckTimeStart())){
// Date date = DateUtils.StrToDateTime(query.getCheckTimeStart());
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(date);
// int year = calendar.get(Calendar.YEAR);
// int month = calendar.get(Calendar.MONTH) + 1;
// StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
// staffPerformSummaryEntity.setReviewScore(BigDecimal.ZERO);
// staffPerformSummaryEntity.setOtherScore(BigDecimal.ZERO);
// staffPerformSummaryEntity.setGoworkScore(BigDecimal.ZERO);
// staffPerformSummaryEntity.setEffectScore(BigDecimal.ZERO);
// staffPerformSummaryEntity.setComplainScore(BigDecimal.ZERO);
// staffPerformSummaryEntity.setAttendScore(BigDecimal.ZERO);
// staffPerformSummaryEntity.setTotalScore(StaffPerformUtil.SCORE100);
// staffPerformSummaryEntity.setErrorScore(BigDecimal.ZERO);
// staffPerformSummaryEntity.setUpdateTime(new Date());
// Map<String,Object> condition = new HashMap<>();
// condition.put("year",year);
// condition.put("month",month);
// if(query.getStaffId()!=null){
// condition.put("staffId",query.getStaffId());
// }
// this.service.getDao().update(staffPerformSummaryEntity,condition);
// }
cacheService.lpush(KEY_CHECK_SUMMARY_CACHE,query);
cacheService.set(SUMMARY_TASK_KEY,"true",900); //15分钟过期
model.put("message_info", "开始执行绩效汇总,请稍后查看");
......
......@@ -1333,3 +1333,14 @@ ADD KEY `appealPerson` (`appealPerson`) USING BTREE;
-- ----------------------------
INSERT INTO `mortals_xhx_perform_rules` (`ruleCode`, `categoryId`, `categoryName`, `name`, `content`, `subAddType`, `score`, `assoOwner`, `ownerScore`, `remark`, `type`, `createUserId`, `createTime`, `updateUserId`, `updateTime`) VALUES ('ATTEND1010', '1', '', '事假半天', '事假半天', '2', '0.5', '0', '0.00', '', '1', '1', NOW(), NULL, NULL);
INSERT INTO `mortals_xhx_perform_rules` (`ruleCode`, `categoryId`, `categoryName`, `name`, `content`, `subAddType`, `score`, `assoOwner`, `ownerScore`, `remark`, `type`, `createUserId`, `createTime`, `updateUserId`, `updateTime`) VALUES ('ATTEND1011', '1', '', '事假全天', '事假全天', '2', '1', '0', '0.00', '', '1', '1', NOW(), NULL, NULL);
-- ----------------------------
2024-07-22
-- ----------------------------
ALTER TABLE `mortals_xhx_staff_perform_summary`
ADD COLUMN `remarkAdd` VARCHAR (2048) DEFAULT NULL COMMENT '加分备注' AFTER `month`,
ADD COLUMN `addTotalScore` DECIMAL (10, 2) DEFAULT NULL COMMENT '加分合计' AFTER `remarkAdd`,
ADD COLUMN `sumScore` DECIMAL (10, 2) DEFAULT NULL COMMENT '合计得分' AFTER `addTotalScore`;
UPDATE `mortals_xhx_staff_perform_summary` SET sumScore=totalScore,addTotalScore=0;
\ No newline at end of file
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