Commit 562da3b7 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 5e443f53 7e650ea6
...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao; ...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.check.model.CheckAttendRecordEntity; import com.mortals.xhx.module.check.model.CheckAttendRecordEntity;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import java.util.List; import java.util.List;
/** /**
...@@ -22,4 +24,18 @@ public interface CheckAttendRecordDao extends ICRUDDao<CheckAttendRecordEntity, ...@@ -22,4 +24,18 @@ public interface CheckAttendRecordDao extends ICRUDDao<CheckAttendRecordEntity,
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query); List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query);
/**
* 个人绩效统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query);
} }
...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao; ...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.check.model.CheckComplainRecordEntity; import com.mortals.xhx.module.check.model.CheckComplainRecordEntity;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import java.util.List; import java.util.List;
/** /**
...@@ -22,4 +24,18 @@ public interface CheckComplainRecordDao extends ICRUDDao<CheckComplainRecordEnt ...@@ -22,4 +24,18 @@ public interface CheckComplainRecordDao extends ICRUDDao<CheckComplainRecordEnt
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query); List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query);
/**
* 个人绩效统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query);
} }
...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao; ...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao;
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;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import java.util.List; import java.util.List;
/** /**
...@@ -22,4 +24,18 @@ public interface CheckEffectRecordDao extends ICRUDDao<CheckEffectRecordEntity, ...@@ -22,4 +24,18 @@ public interface CheckEffectRecordDao extends ICRUDDao<CheckEffectRecordEntity,
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query); List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query);
/**
* 个人绩效统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query);
} }
...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao; ...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao;
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;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import java.util.List; import java.util.List;
/** /**
...@@ -22,4 +24,18 @@ public interface CheckGoworkRecordDao extends ICRUDDao<CheckGoworkRecordEntity, ...@@ -22,4 +24,18 @@ public interface CheckGoworkRecordDao extends ICRUDDao<CheckGoworkRecordEntity,
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query); List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query);
/**
* 个人绩效统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query);
} }
...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao; ...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao;
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;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import java.util.List; import java.util.List;
/** /**
...@@ -22,4 +24,18 @@ public interface CheckOtherRecordDao extends ICRUDDao<CheckOtherRecordEntity,Lo ...@@ -22,4 +24,18 @@ public interface CheckOtherRecordDao extends ICRUDDao<CheckOtherRecordEntity,Lo
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query); List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query);
/**
* 个人绩效统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query);
} }
...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao; ...@@ -4,6 +4,8 @@ import com.mortals.framework.dao.ICRUDDao;
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;
import com.mortals.xhx.module.dept.model.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import java.util.List; import java.util.List;
/** /**
...@@ -22,4 +24,18 @@ public interface CheckReviewRecordDao extends ICRUDDao<CheckReviewRecordEntity, ...@@ -22,4 +24,18 @@ public interface CheckReviewRecordDao extends ICRUDDao<CheckReviewRecordEntity,
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query); List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query);
/**
* 个人绩效统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query);
} }
...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis; ...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.check.dao.CheckAttendRecordDao; import com.mortals.xhx.module.check.dao.CheckAttendRecordDao;
import com.mortals.xhx.module.check.model.CheckAttendRecordEntity; import com.mortals.xhx.module.check.model.CheckAttendRecordEntity;
...@@ -23,4 +25,14 @@ public class CheckAttendRecordDaoImpl extends BaseCRUDDaoMybatis<CheckAttendReco ...@@ -23,4 +25,14 @@ public class CheckAttendRecordDaoImpl extends BaseCRUDDaoMybatis<CheckAttendReco
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) { public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query); return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query);
} }
@Override
public List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getStaffPerformStat"), query);
}
@Override
public List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getDeptPerformStat"), query);
}
} }
...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis; ...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.check.dao.CheckComplainRecordDao; import com.mortals.xhx.module.check.dao.CheckComplainRecordDao;
import com.mortals.xhx.module.check.model.CheckComplainRecordEntity; import com.mortals.xhx.module.check.model.CheckComplainRecordEntity;
...@@ -23,4 +25,14 @@ public class CheckComplainRecordDaoImpl extends BaseCRUDDaoMybatis<CheckComplain ...@@ -23,4 +25,14 @@ public class CheckComplainRecordDaoImpl extends BaseCRUDDaoMybatis<CheckComplain
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) { public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query); return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query);
} }
@Override
public List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getStaffPerformStat"), query);
}
@Override
public List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getDeptPerformStat"), query);
}
} }
...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis; ...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.check.dao.CheckEffectRecordDao; import com.mortals.xhx.module.check.dao.CheckEffectRecordDao;
import com.mortals.xhx.module.check.model.CheckEffectRecordEntity; import com.mortals.xhx.module.check.model.CheckEffectRecordEntity;
...@@ -23,4 +25,14 @@ public class CheckEffectRecordDaoImpl extends BaseCRUDDaoMybatis<CheckEffectReco ...@@ -23,4 +25,14 @@ public class CheckEffectRecordDaoImpl extends BaseCRUDDaoMybatis<CheckEffectReco
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) { public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query); return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query);
} }
@Override
public List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getStaffPerformStat"), query);
}
@Override
public List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getDeptPerformStat"), query);
}
} }
...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis; ...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.check.dao.CheckGoworkRecordDao; import com.mortals.xhx.module.check.dao.CheckGoworkRecordDao;
import com.mortals.xhx.module.check.model.CheckGoworkRecordEntity; import com.mortals.xhx.module.check.model.CheckGoworkRecordEntity;
...@@ -23,4 +25,14 @@ public class CheckGoworkRecordDaoImpl extends BaseCRUDDaoMybatis<CheckGoworkReco ...@@ -23,4 +25,14 @@ public class CheckGoworkRecordDaoImpl extends BaseCRUDDaoMybatis<CheckGoworkReco
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) { public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query); return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query);
} }
@Override
public List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getStaffPerformStat"), query);
}
@Override
public List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getDeptPerformStat"), query);
}
} }
...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis; ...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.check.dao.CheckOtherRecordDao; import com.mortals.xhx.module.check.dao.CheckOtherRecordDao;
import com.mortals.xhx.module.check.model.CheckOtherRecordEntity; import com.mortals.xhx.module.check.model.CheckOtherRecordEntity;
...@@ -23,4 +25,14 @@ public class CheckOtherRecordDaoImpl extends BaseCRUDDaoMybatis<CheckOtherRecord ...@@ -23,4 +25,14 @@ public class CheckOtherRecordDaoImpl extends BaseCRUDDaoMybatis<CheckOtherRecord
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) { public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query); return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query);
} }
@Override
public List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getStaffPerformStat"), query);
}
@Override
public List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getDeptPerformStat"), query);
}
} }
...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis; ...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.dao.ibatis;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.check.dao.CheckReviewRecordDao; import com.mortals.xhx.module.check.dao.CheckReviewRecordDao;
import com.mortals.xhx.module.check.model.CheckReviewRecordEntity; import com.mortals.xhx.module.check.model.CheckReviewRecordEntity;
...@@ -23,4 +25,14 @@ public class CheckReviewRecordDaoImpl extends BaseCRUDDaoMybatis<CheckReviewReco ...@@ -23,4 +25,14 @@ public class CheckReviewRecordDaoImpl extends BaseCRUDDaoMybatis<CheckReviewReco
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) { public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query); return this.getSqlSession().selectList(this.getSqlId("getSummaryCheckList"), query);
} }
@Override
public List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getStaffPerformStat"), query);
}
@Override
public List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getDeptPerformStat"), query);
}
} }
...@@ -6,6 +6,8 @@ import com.mortals.xhx.module.check.model.CheckAttendRecordEntity; ...@@ -6,6 +6,8 @@ import com.mortals.xhx.module.check.model.CheckAttendRecordEntity;
import com.mortals.xhx.module.check.dao.CheckAttendRecordDao; import com.mortals.xhx.module.check.dao.CheckAttendRecordDao;
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.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import java.util.List; import java.util.List;
...@@ -35,4 +37,18 @@ public interface CheckAttendRecordService extends ICRUDService<CheckAttendRecord ...@@ -35,4 +37,18 @@ public interface CheckAttendRecordService extends ICRUDService<CheckAttendRecord
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException; List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException;
/**
* 个人绩效统计
* @param query
* @return
*/
void doSaveStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
void doSaveDeptPerformStat(StaffCheckSummaryQuery query);
} }
\ No newline at end of file
...@@ -35,4 +35,18 @@ public interface CheckComplainRecordService extends ICRUDService<CheckComplainRe ...@@ -35,4 +35,18 @@ public interface CheckComplainRecordService extends ICRUDService<CheckComplainRe
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException; List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException;
/**
* 个人绩效统计
* @param query
* @return
*/
void doSaveStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
void doSaveDeptPerformStat(StaffCheckSummaryQuery query);
} }
\ No newline at end of file
...@@ -35,4 +35,18 @@ public interface CheckEffectRecordService extends ICRUDService<CheckEffectRecord ...@@ -35,4 +35,18 @@ public interface CheckEffectRecordService extends ICRUDService<CheckEffectRecord
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException; List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException;
/**
* 个人绩效统计
* @param query
* @return
*/
void doSaveStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
void doSaveDeptPerformStat(StaffCheckSummaryQuery query);
} }
\ No newline at end of file
...@@ -35,4 +35,18 @@ public interface CheckGoworkRecordService extends ICRUDService<CheckGoworkRecord ...@@ -35,4 +35,18 @@ public interface CheckGoworkRecordService extends ICRUDService<CheckGoworkRecord
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException; List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException;
/**
* 个人绩效统计
* @param query
* @return
*/
void doSaveStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
void doSaveDeptPerformStat(StaffCheckSummaryQuery query);
} }
\ No newline at end of file
...@@ -35,4 +35,18 @@ public interface CheckOtherRecordService extends ICRUDService<CheckOtherRecordEn ...@@ -35,4 +35,18 @@ public interface CheckOtherRecordService extends ICRUDService<CheckOtherRecordEn
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException; List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException;
/**
* 个人绩效统计
* @param query
* @return
*/
void doSaveStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
void doSaveDeptPerformStat(StaffCheckSummaryQuery query);
} }
\ No newline at end of file
...@@ -35,4 +35,18 @@ public interface CheckReviewRecordService extends ICRUDService<CheckReviewRecord ...@@ -35,4 +35,18 @@ public interface CheckReviewRecordService extends ICRUDService<CheckReviewRecord
* @return * @return
*/ */
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException; List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException;
/**
* 个人绩效统计
* @param query
* @return
*/
void doSaveStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
void doSaveDeptPerformStat(StaffCheckSummaryQuery query);
} }
\ No newline at end of file
...@@ -20,11 +20,15 @@ import com.mortals.xhx.module.check.model.CheckComplainRecordEntity; ...@@ -20,11 +20,15 @@ import com.mortals.xhx.module.check.model.CheckComplainRecordEntity;
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.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.model.DeptPerformStatEntity;
import com.mortals.xhx.module.dept.model.DeptPerformStatQuery;
import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.CheckDingMsg; import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService; import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity; import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -59,6 +63,12 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -59,6 +63,12 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
private StaffService staffService; private StaffService staffService;
@Autowired @Autowired
private MessageService messageService; private MessageService messageService;
@Autowired
private StaffPerformStatService staffPerformStatService;
@Autowired
private DeptPerformStatService deptPerformStatService;
@Autowired
private DeptService deptService;
@Override @Override
protected void saveAfter(CheckAttendRecordEntity entity, Context context) throws AppException { protected void saveAfter(CheckAttendRecordEntity entity, Context context) throws AppException {
...@@ -165,12 +175,16 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -165,12 +175,16 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
if (temp.getEffectScore() == null) { if (temp.getEffectScore() == null) {
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
} }
if (temp.getComplainScore() == null) {
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
}
BigDecimal erro = new BigDecimal(0); BigDecimal erro = new BigDecimal(0);
erro.add(staffPerformSummaryEntity.getReviewScore()); erro = erro.add(staffPerformSummaryEntity.getReviewScore());
erro.add(staffPerformSummaryEntity.getAttendScore()); erro = erro.add(staffPerformSummaryEntity.getAttendScore());
erro.add(staffPerformSummaryEntity.getOtherScore()); erro = erro.add(staffPerformSummaryEntity.getOtherScore());
erro.add(staffPerformSummaryEntity.getGoworkScore()); erro = erro.add(staffPerformSummaryEntity.getGoworkScore());
erro.add(staffPerformSummaryEntity.getEffectScore()); erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.subtract(erro));
...@@ -192,6 +206,150 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -192,6 +206,150 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
} }
} }
doSaveStaffPerformStat(query);
doSaveDeptPerformStat(query);
return summaryVoList; return summaryVoList;
} }
@Override
public void doSaveStaffPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<StaffPerformStatEntity> performStatList = dao.getStaffPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(StaffPerformStatEntity entity:performStatList) {
StaffPerformStatQuery tempQuery = new StaffPerformStatQuery();
tempQuery.setStaffId(entity.getStaffId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
StaffPerformStatEntity temp = staffPerformStatService.selectOne(tempQuery);
if (temp != null) {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setAttendScoreAdd(entity.getAttendScoreAdd());
statEntity.setAttendScoreSub(entity.getAttendScoreSub());
computeStaff(statEntity);
staffPerformStatService.update(statEntity);
}else {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeStaff(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
staffPerformStatService.save(statEntity);
}
}
}
}
@Override
public void doSaveDeptPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<DeptPerformStatEntity> performStatList = dao.getDeptPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(DeptPerformStatEntity entity:performStatList) {
DeptPerformStatQuery tempQuery = new DeptPerformStatQuery();
tempQuery.setDeptId(entity.getDeptId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
DeptPerformStatEntity temp = deptPerformStatService.selectOne(tempQuery);
if (temp != null) {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setAttendScoreAdd(entity.getAttendScoreAdd());
statEntity.setAttendScoreSub(entity.getAttendScoreSub());
computeDept(statEntity);
deptPerformStatService.update(statEntity);
}else {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeDept(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
deptPerformStatService.save(statEntity);
}
}
}
}
private void computeStaff(StaffPerformStatEntity statEntity){
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
private void computeDept(DeptPerformStatEntity statEntity){
DeptEntity deptEntity = deptService.get(statEntity.getDeptId());
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
if(deptEntity!=null){
totalScore = totalScore.multiply(new BigDecimal(deptEntity.getPersonNum()));
}else {
totalScore = totalScore.multiply(new BigDecimal(10));
}
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
} }
\ No newline at end of file
...@@ -20,11 +20,15 @@ import com.mortals.xhx.module.check.model.CheckEffectRecordEntity; ...@@ -20,11 +20,15 @@ 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;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.check.service.CheckComplainRecordService; import com.mortals.xhx.module.check.service.CheckComplainRecordService;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptPerformStatEntity;
import com.mortals.xhx.module.dept.model.DeptPerformStatQuery;
import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.CheckDingMsg; import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService; import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity; import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -59,6 +63,12 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec ...@@ -59,6 +63,12 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
private StaffService staffService; private StaffService staffService;
@Autowired @Autowired
private MessageService messageService; private MessageService messageService;
@Autowired
private StaffPerformStatService staffPerformStatService;
@Autowired
private DeptPerformStatService deptPerformStatService;
@Autowired
private DeptService deptService;
@Override @Override
protected void saveAfter(CheckComplainRecordEntity entity, Context context) throws AppException { protected void saveAfter(CheckComplainRecordEntity entity, Context context) throws AppException {
...@@ -148,7 +158,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec ...@@ -148,7 +158,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
for(StaffCheckSummaryVo vo:summaryVoList){ for(StaffCheckSummaryVo vo:summaryVoList){
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity(); StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
BeanUtils.copyProperties(vo,staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo)); BeanUtils.copyProperties(vo,staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo));
staffPerformSummaryEntity.setReviewScore(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());
...@@ -167,12 +177,16 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec ...@@ -167,12 +177,16 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
if(temp.getEffectScore()==null){ if(temp.getEffectScore()==null){
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
} }
if(temp.getReviewScore()==null){
staffPerformSummaryEntity.setReviewScore(new BigDecimal(0));
}
BigDecimal erro = new BigDecimal(0); BigDecimal erro = new BigDecimal(0);
erro.add(staffPerformSummaryEntity.getReviewScore()); erro = erro.add(staffPerformSummaryEntity.getReviewScore());
erro.add(staffPerformSummaryEntity.getAttendScore()); erro = erro.add(staffPerformSummaryEntity.getAttendScore());
erro.add(staffPerformSummaryEntity.getOtherScore()); erro = erro.add(staffPerformSummaryEntity.getOtherScore());
erro.add(staffPerformSummaryEntity.getGoworkScore()); erro = erro.add(staffPerformSummaryEntity.getGoworkScore());
erro.add(staffPerformSummaryEntity.getEffectScore()); erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.subtract(erro));
...@@ -197,6 +211,150 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec ...@@ -197,6 +211,150 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
} }
} }
doSaveStaffPerformStat(query);
doSaveDeptPerformStat(query);
return summaryVoList; return summaryVoList;
} }
@Override
public void doSaveStaffPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<StaffPerformStatEntity> performStatList = dao.getStaffPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(StaffPerformStatEntity entity:performStatList) {
StaffPerformStatQuery tempQuery = new StaffPerformStatQuery();
tempQuery.setStaffId(entity.getStaffId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
StaffPerformStatEntity temp = staffPerformStatService.selectOne(tempQuery);
if (temp != null) {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setComplainScoreAdd(entity.getComplainScoreAdd());
statEntity.setComplainScoreSub(entity.getComplainScoreSub());
computeStaff(statEntity);
staffPerformStatService.update(statEntity);
}else {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeStaff(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
staffPerformStatService.save(statEntity);
}
}
}
}
@Override
public void doSaveDeptPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<DeptPerformStatEntity> performStatList = dao.getDeptPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(DeptPerformStatEntity entity:performStatList) {
DeptPerformStatQuery tempQuery = new DeptPerformStatQuery();
tempQuery.setDeptId(entity.getDeptId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
DeptPerformStatEntity temp = deptPerformStatService.selectOne(tempQuery);
if (temp != null) {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setComplainScoreAdd(entity.getComplainScoreAdd());
statEntity.setComplainScoreSub(entity.getComplainScoreSub());
computeDept(statEntity);
deptPerformStatService.update(statEntity);
}else {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeDept(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
deptPerformStatService.save(statEntity);
}
}
}
}
private void computeStaff(StaffPerformStatEntity statEntity){
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
private void computeDept(DeptPerformStatEntity statEntity){
DeptEntity deptEntity = deptService.get(statEntity.getDeptId());
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
if(deptEntity!=null){
totalScore = totalScore.multiply(new BigDecimal(deptEntity.getPersonNum()));
}else {
totalScore = totalScore.multiply(new BigDecimal(10));
}
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
} }
\ No newline at end of file
...@@ -20,11 +20,15 @@ import com.mortals.xhx.module.check.model.CheckGoworkRecordEntity; ...@@ -20,11 +20,15 @@ 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;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo; import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.check.service.CheckEffectRecordService; import com.mortals.xhx.module.check.service.CheckEffectRecordService;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptPerformStatEntity;
import com.mortals.xhx.module.dept.model.DeptPerformStatQuery;
import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.CheckDingMsg; import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService; import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity; import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -59,6 +63,12 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -59,6 +63,12 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
private StaffService staffService; private StaffService staffService;
@Autowired @Autowired
private MessageService messageService; private MessageService messageService;
@Autowired
private StaffPerformStatService staffPerformStatService;
@Autowired
private DeptPerformStatService deptPerformStatService;
@Autowired
private DeptService deptService;
@Override @Override
protected void saveAfter(CheckEffectRecordEntity entity, Context context) throws AppException { protected void saveAfter(CheckEffectRecordEntity entity, Context context) throws AppException {
...@@ -167,12 +177,16 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -167,12 +177,16 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
if(temp.getAttendScore()==null){ if(temp.getAttendScore()==null){
staffPerformSummaryEntity.setAttendScore(new BigDecimal(0)); staffPerformSummaryEntity.setAttendScore(new BigDecimal(0));
} }
if (temp.getComplainScore() == null) {
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
}
BigDecimal erro = new BigDecimal(0); BigDecimal erro = new BigDecimal(0);
erro.add(staffPerformSummaryEntity.getReviewScore()); erro = erro.add(staffPerformSummaryEntity.getReviewScore());
erro.add(staffPerformSummaryEntity.getAttendScore()); erro = erro.add(staffPerformSummaryEntity.getAttendScore());
erro.add(staffPerformSummaryEntity.getOtherScore()); erro = erro.add(staffPerformSummaryEntity.getOtherScore());
erro.add(staffPerformSummaryEntity.getGoworkScore()); erro = erro.add(staffPerformSummaryEntity.getGoworkScore());
erro.add(staffPerformSummaryEntity.getEffectScore()); erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.subtract(erro));
...@@ -197,6 +211,150 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -197,6 +211,150 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
} }
} }
doSaveStaffPerformStat(query);
doSaveDeptPerformStat(query);
return summaryVoList; return summaryVoList;
} }
@Override
public void doSaveStaffPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<StaffPerformStatEntity> performStatList = dao.getStaffPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(StaffPerformStatEntity entity:performStatList) {
StaffPerformStatQuery tempQuery = new StaffPerformStatQuery();
tempQuery.setStaffId(entity.getStaffId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
StaffPerformStatEntity temp = staffPerformStatService.selectOne(tempQuery);
if (temp != null) {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setEffectScoreAdd(entity.getEffectScoreAdd());
statEntity.setEffectScoreSub(entity.getEffectScoreSub());
computeStaff(statEntity);
staffPerformStatService.update(statEntity);
}else {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeStaff(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
staffPerformStatService.save(statEntity);
}
}
}
}
@Override
public void doSaveDeptPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<DeptPerformStatEntity> performStatList = dao.getDeptPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(DeptPerformStatEntity entity:performStatList) {
DeptPerformStatQuery tempQuery = new DeptPerformStatQuery();
tempQuery.setDeptId(entity.getDeptId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
DeptPerformStatEntity temp = deptPerformStatService.selectOne(tempQuery);
if (temp != null) {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setEffectScoreAdd(entity.getEffectScoreAdd());
statEntity.setEffectScoreSub(entity.getEffectScoreSub());
computeDept(statEntity);
deptPerformStatService.update(statEntity);
}else {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeDept(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
deptPerformStatService.save(statEntity);
}
}
}
}
private void computeStaff(StaffPerformStatEntity statEntity){
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
private void computeDept(DeptPerformStatEntity statEntity){
DeptEntity deptEntity = deptService.get(statEntity.getDeptId());
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
if(deptEntity!=null){
totalScore = totalScore.multiply(new BigDecimal(deptEntity.getPersonNum()));
}else {
totalScore = totalScore.multiply(new BigDecimal(10));
}
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
} }
\ No newline at end of file
...@@ -20,11 +20,15 @@ import com.mortals.xhx.module.check.model.CheckOtherRecordEntity; ...@@ -20,11 +20,15 @@ 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.check.service.CheckGoworkRecordService; import com.mortals.xhx.module.check.service.CheckGoworkRecordService;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptPerformStatEntity;
import com.mortals.xhx.module.dept.model.DeptPerformStatQuery;
import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.CheckDingMsg; import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService; import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity; import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -59,6 +63,12 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -59,6 +63,12 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
private StaffService staffService; private StaffService staffService;
@Autowired @Autowired
private MessageService messageService; private MessageService messageService;
@Autowired
private StaffPerformStatService staffPerformStatService;
@Autowired
private DeptPerformStatService deptPerformStatService;
@Autowired
private DeptService deptService;
@Override @Override
protected void saveAfter(CheckGoworkRecordEntity entity, Context context) throws AppException { protected void saveAfter(CheckGoworkRecordEntity entity, Context context) throws AppException {
...@@ -166,12 +176,16 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -166,12 +176,16 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
if(temp.getEffectScore()==null){ if(temp.getEffectScore()==null){
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
} }
if (temp.getComplainScore() == null) {
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
}
BigDecimal erro = new BigDecimal(0); BigDecimal erro = new BigDecimal(0);
erro.add(staffPerformSummaryEntity.getReviewScore()); erro = erro.add(staffPerformSummaryEntity.getReviewScore());
erro.add(staffPerformSummaryEntity.getAttendScore()); erro = erro.add(staffPerformSummaryEntity.getAttendScore());
erro.add(staffPerformSummaryEntity.getOtherScore()); erro = erro.add(staffPerformSummaryEntity.getOtherScore());
erro.add(staffPerformSummaryEntity.getGoworkScore()); erro = erro.add(staffPerformSummaryEntity.getGoworkScore());
erro.add(staffPerformSummaryEntity.getEffectScore()); erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.subtract(erro));
...@@ -196,7 +210,151 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -196,7 +210,151 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
} }
} }
doSaveStaffPerformStat(query);
doSaveDeptPerformStat(query);
return summaryVoList; return summaryVoList;
} }
@Override
public void doSaveStaffPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<StaffPerformStatEntity> performStatList = dao.getStaffPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(StaffPerformStatEntity entity:performStatList) {
StaffPerformStatQuery tempQuery = new StaffPerformStatQuery();
tempQuery.setStaffId(entity.getStaffId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
StaffPerformStatEntity temp = staffPerformStatService.selectOne(tempQuery);
if (temp != null) {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setGoworkScoreAdd(entity.getGoworkScoreAdd());
statEntity.setGoworkScoreSub(entity.getGoworkScoreSub());
computeStaff(statEntity);
staffPerformStatService.update(statEntity);
}else {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeStaff(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
staffPerformStatService.save(statEntity);
}
}
}
}
@Override
public void doSaveDeptPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<DeptPerformStatEntity> performStatList = dao.getDeptPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(DeptPerformStatEntity entity:performStatList) {
DeptPerformStatQuery tempQuery = new DeptPerformStatQuery();
tempQuery.setDeptId(entity.getDeptId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
DeptPerformStatEntity temp = deptPerformStatService.selectOne(tempQuery);
if (temp != null) {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setGoworkScoreAdd(entity.getGoworkScoreAdd());
statEntity.setGoworkScoreSub(entity.getGoworkScoreSub());
computeDept(statEntity);
deptPerformStatService.update(statEntity);
}else {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeDept(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
deptPerformStatService.save(statEntity);
}
}
}
}
private void computeStaff(StaffPerformStatEntity statEntity){
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
private void computeDept(DeptPerformStatEntity statEntity){
DeptEntity deptEntity = deptService.get(statEntity.getDeptId());
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
if(deptEntity!=null){
totalScore = totalScore.multiply(new BigDecimal(deptEntity.getPersonNum()));
}else {
totalScore = totalScore.multiply(new BigDecimal(10));
}
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
} }
\ No newline at end of file
...@@ -14,11 +14,15 @@ import com.mortals.xhx.common.utils.BeanUtil; ...@@ -14,11 +14,15 @@ 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.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.DeptPerformStatEntity;
import com.mortals.xhx.module.dept.model.DeptPerformStatQuery;
import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.CheckDingMsg; import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService; import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity; import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -60,6 +64,12 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt ...@@ -60,6 +64,12 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
private StaffService staffService; private StaffService staffService;
@Autowired @Autowired
private MessageService messageService; private MessageService messageService;
@Autowired
private StaffPerformStatService staffPerformStatService;
@Autowired
private DeptPerformStatService deptPerformStatService;
@Autowired
private DeptService deptService;
@Override @Override
protected void saveAfter(CheckOtherRecordEntity entity, Context context) throws AppException { protected void saveAfter(CheckOtherRecordEntity entity, Context context) throws AppException {
...@@ -172,12 +182,16 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt ...@@ -172,12 +182,16 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
if (temp.getEffectScore() == null) { if (temp.getEffectScore() == null) {
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
} }
if (temp.getComplainScore() == null) {
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
}
BigDecimal erro = new BigDecimal(0); BigDecimal erro = new BigDecimal(0);
erro.add(staffPerformSummaryEntity.getReviewScore()); erro = erro.add(staffPerformSummaryEntity.getReviewScore());
erro.add(staffPerformSummaryEntity.getAttendScore()); erro = erro.add(staffPerformSummaryEntity.getAttendScore());
erro.add(staffPerformSummaryEntity.getOtherScore()); erro = erro.add(staffPerformSummaryEntity.getOtherScore());
erro.add(staffPerformSummaryEntity.getGoworkScore()); erro = erro.add(staffPerformSummaryEntity.getGoworkScore());
erro.add(staffPerformSummaryEntity.getEffectScore()); erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.subtract(erro));
...@@ -202,6 +216,150 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt ...@@ -202,6 +216,150 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
} }
} }
doSaveStaffPerformStat(query);
doSaveDeptPerformStat(query);
return summaryVoList; return summaryVoList;
} }
@Override
public void doSaveStaffPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<StaffPerformStatEntity> performStatList = dao.getStaffPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(StaffPerformStatEntity entity:performStatList) {
StaffPerformStatQuery tempQuery = new StaffPerformStatQuery();
tempQuery.setStaffId(entity.getStaffId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
StaffPerformStatEntity temp = staffPerformStatService.selectOne(tempQuery);
if (temp != null) {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setOtherScoreAdd(entity.getOtherScoreAdd());
statEntity.setOtherScoreSub(entity.getOtherScoreSub());
computeStaff(statEntity);
staffPerformStatService.update(statEntity);
}else {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeStaff(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
staffPerformStatService.save(statEntity);
}
}
}
}
@Override
public void doSaveDeptPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<DeptPerformStatEntity> performStatList = dao.getDeptPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(DeptPerformStatEntity entity:performStatList) {
DeptPerformStatQuery tempQuery = new DeptPerformStatQuery();
tempQuery.setDeptId(entity.getDeptId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
DeptPerformStatEntity temp = deptPerformStatService.selectOne(tempQuery);
if (temp != null) {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setOtherScoreAdd(entity.getOtherScoreAdd());
statEntity.setOtherScoreSub(entity.getOtherScoreSub());
computeDept(statEntity);
deptPerformStatService.update(statEntity);
}else {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeDept(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
deptPerformStatService.save(statEntity);
}
}
}
}
private void computeStaff(StaffPerformStatEntity statEntity){
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
private void computeDept(DeptPerformStatEntity statEntity){
DeptEntity deptEntity = deptService.get(statEntity.getDeptId());
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
if(deptEntity!=null){
totalScore = totalScore.multiply(new BigDecimal(deptEntity.getPersonNum()));
}else {
totalScore = totalScore.multiply(new BigDecimal(10));
}
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
} }
\ No newline at end of file
...@@ -13,14 +13,18 @@ import com.mortals.xhx.common.code.YesNoEnum; ...@@ -13,14 +13,18 @@ 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.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.DeptPerformStatEntity;
import com.mortals.xhx.module.dept.model.DeptPerformStatQuery;
import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.CheckDingMsg; import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Link; 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.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity; import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -61,6 +65,12 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -61,6 +65,12 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
private StaffService staffService; private StaffService staffService;
@Autowired @Autowired
private MessageService messageService; private MessageService messageService;
@Autowired
private StaffPerformStatService staffPerformStatService;
@Autowired
private DeptPerformStatService deptPerformStatService;
@Autowired
private DeptService deptService;
@Override @Override
...@@ -172,12 +182,16 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -172,12 +182,16 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
if (temp.getEffectScore() == null) { if (temp.getEffectScore() == null) {
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
} }
if (temp.getComplainScore() == null) {
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
}
BigDecimal erro = new BigDecimal(0); BigDecimal erro = new BigDecimal(0);
erro.add(staffPerformSummaryEntity.getReviewScore()); erro = erro.add(staffPerformSummaryEntity.getReviewScore());
erro.add(staffPerformSummaryEntity.getAttendScore()); erro = erro.add(staffPerformSummaryEntity.getAttendScore());
erro.add(staffPerformSummaryEntity.getOtherScore()); erro = erro.add(staffPerformSummaryEntity.getOtherScore());
erro.add(staffPerformSummaryEntity.getGoworkScore()); erro = erro.add(staffPerformSummaryEntity.getGoworkScore());
erro.add(staffPerformSummaryEntity.getEffectScore()); erro = erro.add(staffPerformSummaryEntity.getEffectScore());
erro = erro.add(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(erro); staffPerformSummaryEntity.setErrorScore(erro);
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.subtract(erro)); staffPerformSummaryEntity.setTotalScore(total.subtract(erro));
...@@ -202,6 +216,150 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -202,6 +216,150 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
} }
} }
doSaveStaffPerformStat(query);
doSaveDeptPerformStat(query);
return summaryVoList; return summaryVoList;
} }
@Override
public void doSaveStaffPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<StaffPerformStatEntity> performStatList = dao.getStaffPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(StaffPerformStatEntity entity:performStatList) {
StaffPerformStatQuery tempQuery = new StaffPerformStatQuery();
tempQuery.setStaffId(entity.getStaffId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
StaffPerformStatEntity temp = staffPerformStatService.selectOne(tempQuery);
if (temp != null) {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setReviewScoreAdd(entity.getReviewScoreAdd());
statEntity.setReviewScoreSub(entity.getReviewScoreSub());
computeStaff(statEntity);
staffPerformStatService.update(statEntity);
}else {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeStaff(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
staffPerformStatService.save(statEntity);
}
}
}
}
@Override
public void doSaveDeptPerformStat(StaffCheckSummaryQuery query) {
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime);
}
List<DeptPerformStatEntity> performStatList = dao.getDeptPerformStat(query);
if(CollectionUtils.isNotEmpty(performStatList)){
for(DeptPerformStatEntity entity:performStatList) {
DeptPerformStatQuery tempQuery = new DeptPerformStatQuery();
tempQuery.setDeptId(entity.getDeptId());
tempQuery.setYear(entity.getYear());
tempQuery.setMonth(entity.getMonth());
tempQuery.setDay(entity.getDay());
DeptPerformStatEntity temp = deptPerformStatService.selectOne(tempQuery);
if (temp != null) {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(temp, statEntity, BeanUtil.getNullPropertyNames(temp));
statEntity.setId(temp.getId());
statEntity.setUpdateTime(new Date());
statEntity.setReviewScoreAdd(entity.getReviewScoreAdd());
statEntity.setReviewScoreSub(entity.getReviewScoreSub());
computeDept(statEntity);
deptPerformStatService.update(statEntity);
}else {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
BeanUtils.copyProperties(entity, statEntity, BeanUtil.getNullPropertyNames(entity));
statEntity.setId(null);
computeDept(statEntity);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
deptPerformStatService.save(statEntity);
}
}
}
}
private void computeStaff(StaffPerformStatEntity statEntity){
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
private void computeDept(DeptPerformStatEntity statEntity){
DeptEntity deptEntity = deptService.get(statEntity.getDeptId());
BigDecimal totalAddScore = new BigDecimal(0);
BigDecimal totalSubScore = new BigDecimal(0);
BigDecimal totalScore = new BigDecimal(100);
if(deptEntity!=null){
totalScore = totalScore.multiply(new BigDecimal(deptEntity.getPersonNum()));
}else {
totalScore = totalScore.multiply(new BigDecimal(10));
}
totalAddScore = totalAddScore.add(statEntity.getAttendScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getAttendScoreSub());
totalAddScore = totalAddScore.add(statEntity.getComplainScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getComplainScoreSub());
totalAddScore = totalAddScore.add(statEntity.getReviewScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getReviewScoreSub());
totalAddScore = totalAddScore.add(statEntity.getGoworkScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getGoworkScoreSub());
totalAddScore = totalAddScore.add(statEntity.getEffectScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getEffectScoreSub());
totalAddScore = totalAddScore.add(statEntity.getOtherScoreAdd());
totalSubScore = totalSubScore.add(statEntity.getOtherScoreSub());
statEntity.setTotalAddScore(totalAddScore);
statEntity.setTotalSubScore(totalSubScore);
totalScore = totalScore.add(totalAddScore);
totalScore = totalScore.subtract(totalSubScore);
statEntity.setTotalScore(totalScore);
}
} }
\ No newline at end of file
...@@ -18,4 +18,42 @@ ...@@ -18,4 +18,42 @@
GROUP BY GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m') staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m')
</select> </select>
<!-- 个人绩效统计 -->
<select id="getStaffPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
staffId,staffName,workNum,deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as attendScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as attendScoreSub
FROM
mortals_xhx_check_attend_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
<!-- 部门绩效统计 -->
<select id="getDeptPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT
deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as attendScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as attendScoreSub
FROM
mortals_xhx_check_attend_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -18,4 +18,42 @@ ...@@ -18,4 +18,42 @@
GROUP BY GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m') staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m')
</select> </select>
<!-- 个人绩效统计 -->
<select id="getStaffPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
staffId,staffName,workNum,deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as complainScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as complainScoreSub
FROM
mortals_xhx_check_complain_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
<!-- 部门绩效统计 -->
<select id="getDeptPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT
deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as complainScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as complainScoreSub
FROM
mortals_xhx_check_complain_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -18,4 +18,42 @@ ...@@ -18,4 +18,42 @@
GROUP BY GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m') staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m')
</select> </select>
<!-- 个人绩效统计 -->
<select id="getStaffPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
staffId,staffName,workNum,deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as effectScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as effectScoreSub
FROM
mortals_xhx_check_effect_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
<!-- 部门绩效统计 -->
<select id="getDeptPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT
deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as effectScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as effectScoreSub
FROM
mortals_xhx_check_effect_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -18,4 +18,42 @@ ...@@ -18,4 +18,42 @@
GROUP BY GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m') staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m')
</select> </select>
<!-- 个人绩效统计 -->
<select id="getStaffPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
staffId,staffName,workNum,deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as attendScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as attendScoreSub
FROM
mortals_xhx_check_gowork_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
<!-- 部门绩效统计 -->
<select id="getDeptPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT
deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as goworkScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as goworkScoreSub
FROM
mortals_xhx_check_gowork_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -18,4 +18,42 @@ ...@@ -18,4 +18,42 @@
GROUP BY GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m') staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m')
</select> </select>
<!-- 个人绩效统计 -->
<select id="getStaffPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
staffId,staffName,workNum,deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as otherScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as otherScoreSub
FROM
mortals_xhx_check_other_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
<!-- 部门绩效统计 -->
<select id="getDeptPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT
deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as otherScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as otherScoreSub
FROM
mortals_xhx_check_other_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -18,4 +18,42 @@ ...@@ -18,4 +18,42 @@
GROUP BY GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m') staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m')
</select> </select>
<!-- 个人绩效统计 -->
<select id="getStaffPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
staffId,staffName,workNum,deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as reviewScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as reviewScoreSub
FROM
mortals_xhx_check_review_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
<!-- 部门绩效统计 -->
<select id="getDeptPerformStat" parameterType="com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT
deptId,deptName,
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
DATE_FORMAT(checkTime,'%d') as `day`,
SUM(CASE subAddType WHEN 1 THEN score ELSE 0 END) as reviewScoreAdd,
SUM(CASE subAddType WHEN 2 THEN score ELSE 0 END) as reviewScoreSub
FROM
mortals_xhx_check_review_record
WHERE checkStatus = 2
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m-%d');
</select>
</mapper> </mapper>
\ 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