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

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/model/vo/PerformPerposeVo.java
#	attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformPerposeServiceImpl.java
parents c917e5f5 853d192f
......@@ -8,11 +8,10 @@ import java.util.Map;
*/
public enum CheckTypeEnum {
考勤绩效(1, "考勤绩效"),
效能绩效(2, "效能绩效"),
评价绩效(3, "评价绩效"),
办件绩效(4, "办件绩效"),
差评绩效(5, "差评绩效"),
其它绩效(6, "其它绩效"),
评价绩效(2, "评价绩效"),
办件绩效(3, "办件绩效"),
效能绩效(4, "效能绩效"),
其它绩效(5, "其它绩效"),
;
private Integer value;
private String desc;
......
package com.mortals.xhx.module.perform.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.perform.model.PerformDeptConfDetailEntity;
import com.mortals.xhx.module.perform.model.PerformDeptConfEntity;
import java.util.ArrayList;
import java.util.List;
......@@ -13,6 +14,7 @@ import lombok.Data;
@Data
public class PerformDeptConfVo extends BaseEntityLong {
/** 部门考核内容详细信息 */
List<PerformDeptConfDetailEntity> deptConfDetail;
}
\ No newline at end of file
package com.mortals.xhx.module.perform.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.perform.model.PerformStaffConfDetailEntity;
import com.mortals.xhx.module.perform.model.PerformStaffConfEntity;
import java.util.ArrayList;
import java.util.List;
......@@ -12,7 +13,7 @@ import lombok.Data;
*/
@Data
public class PerformStaffConfVo extends BaseEntityLong {
/** 人员自动考核内容详细信息 */
private List<PerformStaffConfDetailEntity> staffConfDetail;
}
\ No newline at end of file
package com.mortals.xhx.module.perform.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.perform.model.PerformDeptConfDetailEntity;
import com.mortals.xhx.module.perform.model.PerformDeptConfDetailQuery;
import com.mortals.xhx.module.perform.service.PerformDeptConfDetailService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -7,6 +16,11 @@ import com.mortals.xhx.module.perform.dao.PerformDeptConfDao;
import com.mortals.xhx.module.perform.model.PerformDeptConfEntity;
import com.mortals.xhx.module.perform.service.PerformDeptConfService;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* PerformDeptConfService
* 部门自动考核信息 service实现
......@@ -18,4 +32,70 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class PerformDeptConfServiceImpl extends AbstractCRUDServiceImpl<PerformDeptConfDao, PerformDeptConfEntity, Long> implements PerformDeptConfService {
@Autowired
private PerformDeptConfDetailService performDeptConfDetailService;
@Autowired
private DeptService deptService;
@Override
protected void findAfter(PerformDeptConfEntity params, PageInfo pageInfo, Context context, List<PerformDeptConfEntity> list) throws AppException {
if(CollectionUtils.isNotEmpty(list)){
for (PerformDeptConfEntity item:list){
List<PerformDeptConfDetailEntity> detailEntityList = performDeptConfDetailService.find(new PerformDeptConfDetailQuery().deptConfId(item.getId()));
item.setDeptConfDetail(detailEntityList);
}
}
}
@Override
protected void saveBefore(PerformDeptConfEntity entity, Context context) throws AppException {
super.saveBefore(entity,context);
DeptEntity deptEntity = deptService.get(entity.getDeptId());
if(deptEntity!=null){
entity.setDeptName(deptEntity.getDeptName());
}
if(CollectionUtils.isNotEmpty(entity.getDeptConfDetail())){
Map<Integer,List<PerformDeptConfDetailEntity>> groupMap = entity.getDeptConfDetail().stream().collect(Collectors.groupingBy(PerformDeptConfDetailEntity::getType));
if(groupMap.containsKey(CheckTypeEnum.考勤绩效.getValue())) {
entity.setAttendCount(groupMap.get(CheckTypeEnum.考勤绩效.getValue()).size());
}else {
entity.setAttendCount(0);
}
if(groupMap.containsKey(CheckTypeEnum.评价绩效.getValue())) {
entity.setAssessCount(groupMap.get(CheckTypeEnum.评价绩效.getValue()).size());
}else {
entity.setAssessCount(0);
}
if(groupMap.containsKey(CheckTypeEnum.办件绩效.getValue())) {
entity.setWorkCount(groupMap.get(CheckTypeEnum.办件绩效.getValue()).size());
}else {
entity.setWorkCount(0);
}
if(groupMap.containsKey(CheckTypeEnum.效能绩效.getValue())) {
entity.setEffectCount(groupMap.get(CheckTypeEnum.效能绩效.getValue()).size());
}else {
entity.setEffectCount(0);
}
if(groupMap.containsKey(CheckTypeEnum.其它绩效.getValue())) {
entity.setOtherCount(groupMap.get(CheckTypeEnum.其它绩效.getValue()).size());
}else {
entity.setOtherCount(0);
}
}
}
@Override
protected void saveAfter(PerformDeptConfEntity entity, Context context) throws AppException {
if(CollectionUtils.isNotEmpty(entity.getDeptConfDetail())){
for(PerformDeptConfDetailEntity item:entity.getDeptConfDetail()){
item.setDeptConfId(entity.getId());
item.setCreateTime(entity.getCreateTime());
item.setCreateUser(entity.getCreateUser());
item.setDeptId(entity.getDeptId());
item.setDeptName(entity.getDeptName());
item.setId(null);
}
performDeptConfDetailService.save(entity.getDeptConfDetail(),context);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.perform.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.module.perform.model.*;
import com.mortals.xhx.module.perform.service.PerformStaffConfDetailService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.perform.dao.PerformStaffConfDao;
import com.mortals.xhx.module.perform.model.PerformStaffConfEntity;
import com.mortals.xhx.module.perform.service.PerformStaffConfService;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* PerformStaffConfService
* 人员自动考核信息 service实现
......@@ -18,4 +28,64 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class PerformStaffConfServiceImpl extends AbstractCRUDServiceImpl<PerformStaffConfDao, PerformStaffConfEntity, Long> implements PerformStaffConfService {
@Autowired
private PerformStaffConfDetailService performStaffConfDetailService;
@Override
protected void saveBefore(PerformStaffConfEntity entity, Context context) throws AppException {
super.saveBefore(entity,context);
if(CollectionUtils.isNotEmpty(entity.getStaffConfDetail())){
// Map<Integer,List<PerformStaffConfDetailEntity>> groupMap = entity.getStaffConfDetail().stream().collect(Collectors.groupingBy(PerformStaffConfDetailEntity::getType));
// if(groupMap.containsKey(CheckTypeEnum.考勤绩效.getValue())) {
// entity.setAttendCount(groupMap.get(CheckTypeEnum.考勤绩效.getValue()).size());
// }else {
// entity.setAttendCount(0);
// }
// if(groupMap.containsKey(CheckTypeEnum.评价绩效.getValue())) {
// entity.setAssessCount(groupMap.get(CheckTypeEnum.评价绩效.getValue()).size());
// }else {
// entity.setAssessCount(0);
// }
// if(groupMap.containsKey(CheckTypeEnum.办件绩效.getValue())) {
// entity.setWorkCount(groupMap.get(CheckTypeEnum.办件绩效.getValue()).size());
// }else {
// entity.setWorkCount(0);
// }
// if(groupMap.containsKey(CheckTypeEnum.效能绩效.getValue())) {
// entity.setEffectCount(groupMap.get(CheckTypeEnum.效能绩效.getValue()).size());
// }else {
// entity.setEffectCount(0);
// }
// if(groupMap.containsKey(CheckTypeEnum.其它绩效.getValue())) {
// entity.setOtherCount(groupMap.get(CheckTypeEnum.其它绩效.getValue()).size());
// }else {
// entity.setOtherCount(0);
// }
}
}
@Override
protected void saveAfter(PerformStaffConfEntity entity, Context context) throws AppException {
if(CollectionUtils.isNotEmpty(entity.getStaffConfDetail())){
// for(PerformStaffConfDetailEntity item:entity.getStaffConfDetail()){
// item.setStaffConfId(entity.getId());
// item.setCreateTime(entity.getCreateTime());
// item.setCreateUser(entity.getCreateUser());
// item.setStaffId(entity.getStaffId());
// item.setStaffName(entity.getStaffName());
// item.setId(null);
// }
// performDeptConfDetailService.save(entity.getDeptConfDetail(),context);
}
}
@Override
protected void findAfter(PerformStaffConfEntity params, PageInfo pageInfo, Context context, List<PerformStaffConfEntity> list) throws AppException {
if(CollectionUtils.isNotEmpty(list)){
for (PerformStaffConfEntity item:list){
List<PerformStaffConfDetailEntity> detailEntityList = performStaffConfDetailService.find(new PerformStaffConfDetailQuery().staffConfId(item.getId()));
item.setStaffConfDetail(detailEntityList);
}
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.perform.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.common.code.EnableEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -42,6 +44,8 @@ public class PerformDeptConfController extends BaseCRUDJsonBodyMappingController
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "type", CheckTypeEnum.getEnumMap());
this.addDict(model, "enable", EnableEnum.getEnumMap());
super.init(model, context);
}
......
package com.mortals.xhx.module.perform.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.common.code.EnableEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -42,8 +44,8 @@ public class PerformDeptConfDetailController extends BaseCRUDJsonBodyMappingCont
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "type", paramService.getParamBySecondOrganize("PerformDeptConfDetail","type"));
this.addDict(model, "enable", paramService.getParamBySecondOrganize("PerformDeptConfDetail","enable"));
this.addDict(model, "type", CheckTypeEnum.getEnumMap());
this.addDict(model, "enable", EnableEnum.getEnumMap());
super.init(model, context);
}
......
package com.mortals.xhx.module.perform.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.common.code.EnableEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -42,6 +44,8 @@ public class PerformStaffConfController extends BaseCRUDJsonBodyMappingControlle
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "type", CheckTypeEnum.getEnumMap());
this.addDict(model, "enable", EnableEnum.getEnumMap());
super.init(model, context);
}
......
package com.mortals.xhx.module.perform.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.common.code.EnableEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -42,8 +44,8 @@ public class PerformStaffConfDetailController extends BaseCRUDJsonBodyMappingCon
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "type", paramService.getParamBySecondOrganize("PerformStaffConfDetail","type"));
this.addDict(model, "enable", paramService.getParamBySecondOrganize("PerformStaffConfDetail","enable"));
this.addDict(model, "type", CheckTypeEnum.getEnumMap());
this.addDict(model, "enable", EnableEnum.getEnumMap());
super.init(model, context);
}
......
package com.mortals.xhx.module.staff.web;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -46,5 +47,8 @@ public class StaffPerformSummaryController extends BaseCRUDJsonBodyMappingContro
super.init(model, context);
}
@Override
protected void doListBefore(StaffPerformSummaryEntity query, Map<String, Object> model, Context context) throws AppException {
}
}
......@@ -9,28 +9,12 @@
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
SUM(CASE subAddType WHEN 1 THEN score ELSE score*-1 END) as sumScore
FROM
(
SELECT
id,recordId,staffId,staffName,workNum,deptId,deptName,subAddType,score,checkTime
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>
UNION
SELECT
id,recordId,staffId,staffName,workNum,deptId,deptName,subAddType,score,checkTime
FROM
mortals_xhx_check_review_record
WHERE
checkStatus = 2
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>
) AS t
GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m')
</select>
......
......@@ -9,28 +9,12 @@
DATE_FORMAT(checkTime,'%Y') as `year`,
DATE_FORMAT(checkTime,'%m') as `month`,
SUM(CASE subAddType WHEN 1 THEN score ELSE score*-1 END) as sumScore
FROM
(
SELECT
id,recordId,staffId,staffName,workNum,deptId,deptName,subAddType,score,checkTime
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>
UNION
SELECT
id,recordId,staffId,staffName,workNum,deptId,deptName,subAddType,score,checkTime
FROM
mortals_xhx_check_review_record
WHERE
checkStatus = 2
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>
) AS t
GROUP BY
staffId,staffName,workNum,deptId,deptName,DATE_FORMAT(checkTime,'%Y-%m')
</select>
......
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