Commit ca3a158d authored by “yiyousong”'s avatar “yiyousong”
parents 8f9c00c1 4993bfc7
......@@ -137,9 +137,9 @@
<el-row>
<el-form-item label="加分/扣除分值:">
<p v-if="form.view == '查看'">
{{ form.score ? form.score : "--" }}
{{form.subAddType==1?'+':'-'}} {{ form.score ? form.score : "--" }}
</p>
<p v-else>{{ form.score }}</p>
<p v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -368,10 +368,12 @@ export default {
kaoqinCateArr: [],
kaoqinArr: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
urls:{saveUrl:'/check/attend/record/examine'}//重写核查地址
};
},
computed: {},
methods: {
// 审核
radioChange(val) {
console.log(val);
this.form.checkResult = val;
......
......@@ -153,9 +153,9 @@
<el-row>
<el-form-item label="加分/扣除分值:">
<p v-if="form.view == '查看'">
{{ form.score ? form.score : "--" }}
{{form.subAddType==1?'+':'-'}} {{ form.score ? form.score : "--" }}
</p>
<p v-else>{{ form.score }}</p>
<p v-else>{{form.subAddType==1?'+':'-'}} {{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -404,6 +404,7 @@ export default {
kaoqinCateArr: [],
kaoqinArr: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
urls:{saveUrl:'/check/complain/record/examine'}//重写核查地址
};
},
......
......@@ -132,9 +132,9 @@
<el-row>
<el-form-item label="加分/扣除分值:">
<p v-if="form.view == '查看'">
{{ form.score ? form.score : "--" }}
{{form.subAddType==1?'+':'-'}} {{ form.score ? form.score : "--" }}
</p>
<p v-else>{{ form.score }}</p>
<p v-else>{{form.subAddType==1?'+':'-'}} {{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -377,6 +377,7 @@ export default {
kaoqinCateArr: [],
kaoqinArr: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
urls:{saveUrl:'/check/effect/record/examine'}//重写核查地址
};
},
......
......@@ -134,9 +134,9 @@
<el-row>
<el-form-item label="加分/扣除分值:">
<p v-if="form.view == '查看'">
{{ form.score ? form.score : "--" }}
{{form.subAddType==1?'+':'-'}}{{ form.score ? form.score : "--" }}
</p>
<p v-else>{{ form.score }}</p>
<p v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -372,6 +372,7 @@ export default {
kaoqinCateArr: [],
kaoqinArr: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
urls:{saveUrl:'/check/gowork/record/examine'}//重写核查地址
};
},
......
......@@ -128,9 +128,9 @@
<el-row>
<el-form-item label="加分/扣除分值:">
<p v-if="form.view == '查看'">
{{ form.score ? form.score : "--" }}
{{form.subAddType==1?'+':'-'}}{{ form.score ? form.score : "--" }}
</p>
<p v-else>{{ form.score }}</p>
<p v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -367,6 +367,7 @@ export default {
kaoqinCateArr: [],
kaoqinArr: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
urls:{saveUrl:'/check/other/record/examine'}//重写核查地址
};
},
......
......@@ -135,9 +135,9 @@
<el-row>
<el-form-item label="加分/扣除分值:">
<p v-if="form.view == '查看'">
{{ form.score ? form.score : "--" }}
{{form.subAddType==1?'+':'-'}}{{ form.score ? form.score : "--" }}
</p>
<p v-else>{{ form.score }}</p>
<p v-else>{{form.subAddType==1?'+':'-'}}{{ form.score }}</p>
</el-form-item>
</el-row>
</div>
......@@ -374,6 +374,7 @@ export default {
form: {},
kaoqinCateArr: [],
kaoqinArr: [],
urls:{saveUrl:'/check/review/record/examine'}//重写核查地址
};
},
......
package com.mortals.xhx.busiz.dingtalk.api;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.*;
import com.dingtalk.api.response.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.xhx.busiz.dingtalk.config.TalkConfiguration;
import com.mortals.xhx.busiz.dingtalk.req.DingTalkBaseReq;
import com.mortals.xhx.busiz.dingtalk.req.UserPageReq;
import com.mortals.xhx.busiz.req.CodeReq;
import com.mortals.xhx.busiz.req.LinkMessageReq;
import com.mortals.xhx.busiz.req.MobileReq;
import com.mortals.xhx.busiz.req.ReviewSaveReq;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.busiz.dingtalk.req.CodeReq;
import com.mortals.xhx.busiz.dingtalk.req.LinkMessageReq;
import com.mortals.xhx.busiz.dingtalk.req.MobileReq;
import com.mortals.xhx.common.pdu.ApiRespPdu;
import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import sun.security.krb5.internal.APOptions;
import java.util.List;
......
package com.mortals.xhx.busiz.req;
package com.mortals.xhx.busiz.h5.req;
import com.mortals.framework.annotation.Excel;
import com.mortals.xhx.busiz.BaseReq;
......
package com.mortals.xhx.busiz.req;
package com.mortals.xhx.busiz.h5.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.xhx.busiz.BaseReq;
......
package com.mortals.xhx.busiz.req;
package com.mortals.xhx.busiz.h5.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.xhx.busiz.BaseReq;
......
package com.mortals.xhx.busiz.req;
package com.mortals.xhx.busiz.h5.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
......
package com.mortals.xhx.busiz.req;
package com.mortals.xhx.busiz.h5.req;
import com.mortals.xhx.busiz.BaseReq;
import lombok.Data;
......
package com.mortals.xhx.busiz.req;
package com.mortals.xhx.busiz.h5.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.xhx.busiz.BaseReq;
......
package com.mortals.xhx.busiz.req;
package com.mortals.xhx.busiz.h5.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.xhx.busiz.BaseReq;
......
package com.mortals.xhx.busiz.req;
package com.mortals.xhx.busiz.h5.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.xhx.busiz.BaseReq;
......
package com.mortals.xhx.busiz.req;
package com.mortals.xhx.busiz.h5.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.xhx.busiz.BaseReq;
......
package com.mortals.xhx.busiz.req;
package com.mortals.xhx.busiz.h5.req;
import com.mortals.xhx.busiz.BaseReq;
import lombok.Data;
......
package com.mortals.xhx.busiz.req;
package com.mortals.xhx.busiz.h5.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.xhx.busiz.BaseReq;
......
package com.mortals.xhx.busiz.rsp;
package com.mortals.xhx.busiz.h5.rsp;
import lombok.Data;
import lombok.NoArgsConstructor;
......
package com.mortals.xhx.busiz.rsp;
package com.mortals.xhx.busiz.h5.rsp;
import com.mortals.framework.annotation.Excel;
import lombok.Data;
......
package com.mortals.xhx.busiz.web;
package com.mortals.xhx.busiz.h5.web;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.busiz.BaseReq;
import com.mortals.xhx.busiz.req.PerformReq;
import org.springframework.util.ObjectUtils;
import java.util.Map;
......
package com.mortals.xhx.busiz.web;
package com.mortals.xhx.busiz.h5.web;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject;
......
package com.mortals.xhx.busiz.web;
package com.mortals.xhx.busiz.h5.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.xhx.base.framework.annotation.ApiUserAuth;
import com.mortals.xhx.busiz.req.*;
import com.mortals.xhx.busiz.rsp.ApiResp;
import com.mortals.xhx.common.code.ApiRespCodeEnum;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.busiz.h5.req.*;
import com.mortals.xhx.module.perform.model.*;
import com.mortals.xhx.module.perform.service.*;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService;
import javafx.scene.effect.Effect;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -25,7 +19,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
@RestController
......
package com.mortals.xhx.busiz.web;
package com.mortals.xhx.busiz.h5.web;
import java.math.BigDecimal;
......@@ -10,9 +10,9 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.busiz.req.AppealReq;
import com.mortals.xhx.busiz.req.PerformReq;
import com.mortals.xhx.busiz.rsp.AppealStatInfo;
import com.mortals.xhx.busiz.h5.req.AppealReq;
import com.mortals.xhx.busiz.h5.req.PerformReq;
import com.mortals.xhx.busiz.h5.rsp.AppealStatInfo;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.ProcessStatusEnum;
import com.mortals.xhx.common.utils.BeanUtil;
......
package com.mortals.xhx.busiz.web;
package com.mortals.xhx.busiz.h5.web;
import cn.hutool.core.date.DateUtil;
......@@ -7,8 +7,8 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.busiz.req.FeedbackReq;
import com.mortals.xhx.busiz.req.FeedbackSaveReq;
import com.mortals.xhx.busiz.h5.req.FeedbackReq;
import com.mortals.xhx.busiz.h5.req.FeedbackSaveReq;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.feedback.model.*;
import com.mortals.xhx.module.feedback.service.FeedbackAnswerService;
......
package com.mortals.xhx.busiz.web;
package com.mortals.xhx.busiz.h5.web;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
......@@ -6,12 +6,12 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.busiz.req.*;
import com.mortals.xhx.busiz.rsp.*;
import com.mortals.xhx.busiz.h5.req.InspectSaveReq;
import com.mortals.xhx.busiz.h5.req.PerformReq;
import com.mortals.xhx.busiz.h5.rsp.InspectStatInfo;
import com.mortals.xhx.busiz.h5.rsp.PerformDetailInfo;
import com.mortals.xhx.busiz.h5.rsp.PerformInfo;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.ProcessStatusEnum;
import com.mortals.xhx.common.code.SubAddTypeEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.*;
......@@ -20,7 +20,6 @@ import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.perform.model.*;
import com.mortals.xhx.module.perform.service.*;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
......@@ -31,7 +30,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -177,7 +175,7 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
parsePageInfo(model, pageAllInfo);
}
if(!ObjectUtils.isEmpty(performReq.getScoreType())){
query.setSubMethod(performReq.getScoreType());
query.setSubAddType(performReq.getScoreType());
List<CheckAllRecordVo> allCheckRecord = checkAllRecordService.getAllCheckRecord(query);
List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
PerformInfo performInfo = new PerformInfo();
......
package com.mortals.xhx.busiz.web;
package com.mortals.xhx.busiz.h5.web;
import java.math.BigDecimal;
......@@ -10,20 +10,15 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.busiz.req.AppealReq;
import com.mortals.xhx.busiz.req.PerformReq;
import com.mortals.xhx.busiz.rsp.PerformDetailInfo;
import com.mortals.xhx.busiz.rsp.PerformInfo;
import com.mortals.xhx.busiz.rsp.PerformStatInfo;
import com.mortals.xhx.busiz.h5.req.PerformReq;
import com.mortals.xhx.busiz.h5.rsp.PerformDetailInfo;
import com.mortals.xhx.busiz.h5.rsp.PerformInfo;
import com.mortals.xhx.busiz.h5.rsp.PerformStatInfo;
import com.mortals.xhx.common.code.AppealResultEnum;
import com.mortals.xhx.common.code.AppealStatusEnum;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.ProcessStatusEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.attendance.model.AttendanceRecordEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordQuery;
import com.mortals.xhx.module.attendance.service.AttendanceRecordService;
import com.mortals.xhx.module.check.model.*;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.service.*;
......@@ -31,7 +26,6 @@ import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.model.PerformAttendAppealQuery;
import com.mortals.xhx.module.perform.service.PerformAttendAppealService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
......@@ -44,7 +38,6 @@ import java.util.Map;
import java.util.stream.Collectors;
import static com.mortals.framework.ap.SysConstains.*;
import static com.mortals.framework.ap.SysConstains.LAST_PAGE;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT;
......
package com.mortals.xhx.busiz.web;
package com.mortals.xhx.busiz.h5.web;
import com.mortals.xhx.base.system.idgenerator.service.IdgeneratorService;
......
package com.mortals.xhx.busiz.req;
import lombok.Data;
/**
* 工作流请求头信息
*
* @author: zxfei
* @date: 2021/8/25 9:50
*/
@Data
public class ApiReq<T> {
/**
* 业务平台标识(唯一)
*/
private String tenantId;
/**
* 实体数据()
*/
private T entity;
}
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/***
* 绩效排行榜汇总方式
*/
public enum SummaryTopTypeEnum {
(1, "年"),
(2, "月"),
(3, "日"),
;
private Integer value;
private String desc;
SummaryTopTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static SummaryTopTypeEnum getByValue(Integer value) {
for (SummaryTopTypeEnum item : SummaryTopTypeEnum.values()) {
if (item.getValue() == value) {
return item;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (SummaryTopTypeEnum item : SummaryTopTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
package com.mortals.xhx.daemon.task;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.xhx.busiz.rsp.DeptHikData;
import com.mortals.xhx.busiz.rsp.ListDept;
import com.mortals.xhx.busiz.rsp.ListItem;
import com.mortals.xhx.busiz.rsp.PersonHikData;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.attendance.dao.AttendanceStatDao;
import com.mortals.xhx.module.attendance.dao.AttendanceVacationBalanceDao;
import com.mortals.xhx.module.attendance.dao.ibatis.*;
import com.mortals.xhx.module.attendance.model.AttendanceStatEntity;
import com.mortals.xhx.module.attendance.model.AttendanceStatQuery;
import com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceEntity;
import com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceQuery;
import com.mortals.xhx.module.attendance.service.AttendanceStatService;
import com.mortals.xhx.module.attendance.service.AttendanceVacationBalanceService;
import com.mortals.xhx.module.dept.dao.DeptDao;
import com.mortals.xhx.module.dept.dao.ibatis.DeptDaoImpl;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
......@@ -33,8 +20,6 @@ import com.mortals.xhx.module.hik.person.model.rsp.org.OrgInfo;
import com.mortals.xhx.module.hik.person.model.rsp.person.PersonDataInfo;
import com.mortals.xhx.module.hik.person.model.rsp.person.PersonInfo;
import com.mortals.xhx.module.hik.person.service.IHikPersonService;
import com.mortals.xhx.module.staff.dao.StaffDao;
import com.mortals.xhx.module.staff.dao.ibatis.StaffDaoImpl;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
......
package com.mortals.xhx.module.check.model;
import lombok.Data;
@Data
public class CheckAllRecordQuery {
/**
* 员工ID
......@@ -21,51 +24,10 @@ public class CheckAllRecordQuery {
*/
private Integer subMethod;
public Long getStaffId() {
return staffId;
}
public void setStaffId(Long staffId) {
this.staffId = staffId;
}
public Integer getCheckStatus() {
return checkStatus;
}
public void setCheckStatus(Integer checkStatus) {
this.checkStatus = checkStatus;
}
public String getCheckTimeStart() {
return checkTimeStart;
}
public void setCheckTimeStart(String checkTimeStart) {
this.checkTimeStart = checkTimeStart;
}
public String getCheckTimeEnd() {
return checkTimeEnd;
}
public void setCheckTimeEnd(String checkTimeEnd) {
this.checkTimeEnd = checkTimeEnd;
}
public Long getCreateUserId() {
return createUserId;
}
public void setCreateUserId(Long createUserId) {
this.createUserId = createUserId;
}
/**
* 增减类型(1.增加,2.扣除)
*/
private Integer subAddType;
public Integer getSubMethod() {
return subMethod;
}
public void setSubMethod(Integer subMethod) {
this.subMethod = subMethod;
}
}
package com.mortals.xhx.module.check.service.impl;
import com.mortals.framework.common.Rest;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Link;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.Msg;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -20,6 +30,7 @@ import com.mortals.xhx.module.check.dao.CheckReviewRecordDao;
import com.mortals.xhx.module.check.model.CheckReviewRecordEntity;
import com.mortals.xhx.module.check.service.CheckReviewRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
......@@ -28,38 +39,81 @@ import java.util.Date;
import java.util.List;
/**
* CheckReviewRecordService
* 评价差评绩效核查信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
* CheckReviewRecordService
* 评价差评绩效核查信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
@Service("checkReviewRecordService")
@Slf4j
public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckReviewRecordDao, CheckReviewRecordEntity, Long> implements CheckReviewRecordService {
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private IDingPersonService dingPersonService;
@Autowired
private StaffService staffService;
@Override
protected void saveAfter(CheckReviewRecordEntity entity, Context context) throws AppException {
try{
try {
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId());
query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
query.setCheckTimeEnd(query.getCheckTimeStart());
summaryCheck(query);
}catch (Exception e){
log.error("汇总已审核的核查记录出错",e);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
}
//发送钉钉通知信息
if (SubMethodEnum.系统自动.getValue() == entity.getSubMethod()) {
//绩效核查通知
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
if (!ObjectUtils.isEmpty(staffCache)) {
Rest<String> personRest = dingPersonService.getPersonByMobile(staffCache.getPhoneNumber());
if (YesNoEnum.YES.getValue() == personRest.getCode()) {
WorkMsgReq workMsgReq = new WorkMsgReq();
Msg msg = new Msg();
msg.setMsgtype("link");
Link link = new Link();
link.setPicUrl("测试图片链接");
link.setMessageUrl("测试消息链接");
link.setText("测试文本");
link.setTitle("测试标题");
msg.setLink(link);
workMsgReq.setUseridList(personRest.getMsg());
Rest<String> sendWorkRest = dingPersonService.sendWorkMsg(workMsgReq);
if (YesNoEnum.YES.getValue() == sendWorkRest.getCode()) {
String requestId = sendWorkRest.getData();
} else {
log.error("发送工作消息失败,msg:{}", sendWorkRest.getMsg());
}
} else {
log.error("根据手机号码获取人员错误,msg:{}", personRest.getMsg());
}
} else {
log.error("员工未找到,staffId:{}", entity.getStaffId());
}
}
}
@Override
public void examine(CheckReviewRecordEntity entity, Context context) throws AppException {
if(entity.getId()==null){
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
if (context != null && context.getUser()!=null) {
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
entity.setCheckPerson(user.getRealName());
......@@ -68,23 +122,23 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
try{
try {
CheckReviewRecordEntity temp = this.get(entity.getId());
if(temp!=null) {
if (temp != null) {
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}
}catch (Exception e){
log.error("汇总已审核的核查记录出错",e);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
}
}
@Override
public List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query) throws AppException {
if(StringUtils.isEmpty(query.getCheckTimeStart())||StringUtils.isEmpty(query.getCheckTimeStart())){
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
if (StringUtils.isEmpty(query.getCheckTimeStart()) || StringUtils.isEmpty(query.getCheckTimeStart())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
......@@ -93,27 +147,27 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
query.setCheckTimeEnd(endTime);
}
List<StaffCheckSummaryVo> summaryVoList = dao.summaryCheck(query);
if(CollectionUtils.isNotEmpty(summaryVoList)){
for(StaffCheckSummaryVo vo:summaryVoList){
if (CollectionUtils.isNotEmpty(summaryVoList)) {
for (StaffCheckSummaryVo vo : summaryVoList) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
BeanUtils.copyProperties(vo,staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo));
BeanUtils.copyProperties(vo, staffPerformSummaryEntity, BeanUtil.getNullPropertyNames(vo));
staffPerformSummaryEntity.setReviewScore(vo.getSumScore());
StaffPerformSummaryQuery summaryQuery = new StaffPerformSummaryQuery();
summaryQuery.setStaffId(vo.getStaffId());
summaryQuery.setYear(vo.getYear());
summaryQuery.setMonth(vo.getMonth());
StaffPerformSummaryEntity temp = staffPerformSummaryService.selectOne(summaryQuery);
if(temp!=null){
if(temp.getAttendScore()==null){
if (temp != null) {
if (temp.getAttendScore() == null) {
staffPerformSummaryEntity.setAttendScore(new BigDecimal(0));
}
if(temp.getOtherScore()==null){
if (temp.getOtherScore() == null) {
staffPerformSummaryEntity.setOtherScore(new BigDecimal(0));
}
if(temp.getGoworkScore()==null){
if (temp.getGoworkScore() == null) {
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
}
if(temp.getEffectScore()==null){
if (temp.getEffectScore() == null) {
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
}
BigDecimal erro = new BigDecimal(0);
......@@ -131,7 +185,7 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
staffPerformSummaryEntity.setId(temp.getId());
staffPerformSummaryEntity.setUpdateTime(new Date());
staffPerformSummaryService.update(staffPerformSummaryEntity);
}else {
} else {
staffPerformSummaryEntity.setAttendScore(new BigDecimal(0));
staffPerformSummaryEntity.setOtherScore(new BigDecimal(0));
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
......
......@@ -2,6 +2,8 @@ package com.mortals.xhx.module.dept.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.dept.model.DeptPerformStatEntity;
import com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery;
import java.util.List;
/**
* 部门绩效分数统计Dao
......@@ -13,5 +15,22 @@ import java.util.List;
public interface DeptPerformStatDao extends ICRUDDao<DeptPerformStatEntity,Long>{
/**
* 按天top10
* @param query
* @return
*/
List<DeptPerformStatEntity> getDaySummaryList(DeptSummaryTopQuery query);
/**
* 按月top10
* @param query
* @return
*/
List<DeptPerformStatEntity> getMonthSummaryList(DeptSummaryTopQuery query);
/**
* 按年top10
* @param query
* @return
*/
List<DeptPerformStatEntity> getYearSummaryList(DeptSummaryTopQuery query);
}
package com.mortals.xhx.module.dept.dao.ibatis;
import com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.dept.dao.DeptPerformStatDao;
import com.mortals.xhx.module.dept.model.DeptPerformStatEntity;
......@@ -17,5 +18,18 @@ import java.util.List;
public class DeptPerformStatDaoImpl extends BaseCRUDDaoMybatis<DeptPerformStatEntity,Long> implements DeptPerformStatDao {
@Override
public List<DeptPerformStatEntity> getDaySummaryList(DeptSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getDaySummaryList"), query);
}
@Override
public List<DeptPerformStatEntity> getMonthSummaryList(DeptSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getMonthSummaryList"), query);
}
@Override
public List<DeptPerformStatEntity> getYearSummaryList(DeptSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getYearSummaryList"), query);
}
}
......@@ -7,4 +7,18 @@ import lombok.Data;
*/
@Data
public class DeptSummaryTopQuery {
/** 汇总方式 1按年,2按月,3按天*/
private Integer summaryType;
/**
* 年
*/
private Integer year;
/**
* 月
*/
private Integer month;
/**
* 日
*/
private Integer day;
}
package com.mortals.xhx.module.dept.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.dept.model.DeptPerformStatEntity;
import com.mortals.xhx.module.dept.dao.DeptPerformStatDao;
import com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery;
import java.util.List;
/**
* DeptPerformStatService
*
......@@ -13,4 +18,12 @@ import com.mortals.xhx.module.dept.dao.DeptPerformStatDao;
public interface DeptPerformStatService extends ICRUDService<DeptPerformStatEntity,Long>{
DeptPerformStatDao getDao();
/**
* 获取部门绩效排行榜
* @param query
* @return
*/
List<DeptPerformStatEntity> getSummaryTopList(DeptSummaryTopQuery query) throws AppException;
}
\ No newline at end of file
package com.mortals.xhx.module.dept.service.impl;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.common.code.SummaryTopTypeEnum;
import com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -7,6 +10,10 @@ import com.mortals.xhx.module.dept.dao.DeptPerformStatDao;
import com.mortals.xhx.module.dept.model.DeptPerformStatEntity;
import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import lombok.extern.slf4j.Slf4j;
import java.time.LocalDate;
import java.util.List;
/**
* DeptPerformStatService
* 部门绩效分数统计 service实现
......@@ -17,5 +24,43 @@ import lombok.extern.slf4j.Slf4j;
@Service("deptPerformStatService")
@Slf4j
public class DeptPerformStatServiceImpl extends AbstractCRUDServiceImpl<DeptPerformStatDao, DeptPerformStatEntity, Long> implements DeptPerformStatService {
@Override
public List<DeptPerformStatEntity> getSummaryTopList(DeptSummaryTopQuery query) throws AppException {
LocalDate now = LocalDate.now();
List<DeptPerformStatEntity> result = null;
if(query == null){
query = new DeptSummaryTopQuery();
query.setSummaryType(SummaryTopTypeEnum..getValue());
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
result = dao.getYearSummaryList(query);
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
if(query.getMonth()==null){
query.setMonth(now.getMonthValue());
}
result = dao.getMonthSummaryList(query);
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
if(query.getMonth()==null){
query.setMonth(now.getMonthValue());
}
if(query.getDay()==null){
query.setDay(now.getDayOfMonth());
}
result = dao.getDaySummaryList(query);
}
return result;
}
}
\ No newline at end of file
package com.mortals.xhx.module.dept.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
......@@ -47,5 +53,35 @@ public class DeptPerformStatController extends BaseCRUDJsonBodyMappingController
super.init(model, context);
}
/**
* 部门绩效排行榜
* @param query
* @return
*/
@PostMapping({"summary/top"})
@UnAuth
public Rest<Object> getSummaryTopList(@RequestBody DeptSummaryTopQuery query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询部门绩效排行榜";
int code = 1;
try {
List<DeptPerformStatEntity> result = this.getService().getSummaryTopList(query);
model.put("data", result);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model.get("data"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
}
\ No newline at end of file
package com.mortals.xhx.module.dingding;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiGettokenRequest;
import com.dingtalk.api.response.OapiGettokenResponse;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.xhx.common.pdu.ApiRespPdu;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.Map;
/**
* 钉钉访问抽象服务类
*
* @author:
* @date: 2023/7/14 13:49
*/
@Slf4j
public abstract class AbstractDingTalkService implements IDingPersonService {
/**
* AgentId
*/
@Value("${dingtalk.agentId:0}")
protected Long agentId;
/**
* AgentId
*/
@Value("${dingtalk.domain:https://oapi.dingtalk.com}")
protected String domain;
/**
* appKey
*/
@Value("${dingtalk.AppKey:''}")
protected String appKey;
/**
* AppSecret
*/
@Value("${dingtalk.AppSecret:''}")
protected String appSecret;
/**
* getToken
*/
@Value("${dingtalk.gettoken:https://oapi.dingtalk.com/gettoken}")
protected String getTokneUrl;
protected String dingToken;
protected DingTalkClient getDingTalkClient(String path) {
DingTalkClient client = new DefaultDingTalkClient(domain + path);
return client;
}
protected void checkToken() {
if (ObjectUtils.isEmpty(dingToken)) {
dingToken = getToken().getData();
}
}
@Override
public Rest<String> getToken() {
try {
DingTalkClient client = getDingTalkClient("/gettoken");
OapiGettokenRequest req = new OapiGettokenRequest();
req.setAppkey(appKey);
req.setAppsecret(appSecret);
OapiGettokenResponse rsp = client.execute(req);
log.info("OapiGettokenResponse:{}",rsp.getBody());
if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getAccessToken());
} else {
throw new AppException(rsp.getMessage());
}
} catch (Exception e) {
log.error("获取TOKEN异常", e);
return Rest.fail(e.getMessage());
}
}
}
package com.mortals.xhx.module.dingding;
import com.mortals.framework.common.Rest;
public interface IDingTalkService {
Rest<String> getToken();
}
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class ActionCard {
@JSONField(name = "btn_json_list")
private BtnJsonList btnJsonList;
@JSONField(name = "single_url")
private String singleUrl;
@JSONField(name = "btn_orientation")
private String btnOrientation;
@JSONField(name = "single_title")
private String singleTitle;
@JSONField(name = "markdown")
private String markdown;
@JSONField(name = "title")
private String title;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Body{
@JSONField(name="file_count")
private String fileCount;
@JSONField(name="image")
private String image;
@JSONField(name="form")
private Form form;
@JSONField(name="author")
private String author;
@JSONField(name="rich")
private Rich rich;
@JSONField(name="title")
private String title;
@JSONField(name="content")
private String content;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class BtnJsonList{
@JSONField(name="action_url")
private String actionUrl;
@JSONField(name="title")
private String title;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class File{
@JSONField(name="media_id")
private String mediaId;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Form{
@JSONField(name="value")
private String value;
@JSONField(name="key")
private String key;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Head{
@JSONField(name="bgcolor")
private String bgcolor;
@JSONField(name="text")
private String text;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Image{
@JSONField(name="media_id")
private String mediaId;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Link{
@JSONField(name="picUrl")
private String picUrl;
@JSONField(name="messageUrl")
private String messageUrl;
@JSONField(name="text")
private String text;
@JSONField(name="title")
private String title;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Markdown{
@JSONField(name="text")
private String text;
@JSONField(name="title")
private String title;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Msg{
@JSONField(name="voice")
private Voice voice;
@JSONField(name="image")
private Image image;
@JSONField(name="oa")
private Oa oa;
@JSONField(name="file")
private File file;
@JSONField(name="action_card")
private ActionCard actionCard;
@JSONField(name="link")
private Link link;
@JSONField(name="markdown")
private Markdown markdown;
@JSONField(name="text")
private Text text;
@JSONField(name="msgtype")
private String msgtype;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Oa{
@JSONField(name="head")
private Head head;
@JSONField(name="pc_message_url")
private String pcMessageUrl;
@JSONField(name="status_bar")
private StatusBar statusBar;
@JSONField(name="body")
private Body body;
@JSONField(name="message_url")
private String messageUrl;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Rich{
@JSONField(name="unit")
private String unit;
@JSONField(name="num")
private String num;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class StatusBar{
@JSONField(name="status_value")
private String statusValue;
@JSONField(name="status_bg")
private String statusBg;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Text{
@JSONField(name="content")
private String content;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class Voice{
@JSONField(name="duration")
private String duration;
@JSONField(name="media_id")
private String mediaId;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.model.req.workmsg;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class WorkMsgReq {
@JSONField(name="msg")
private Msg msg;
@JSONField(name="to_all_user")
private String toAllUser;
@JSONField(name="agent_id")
private String agentId;
@JSONField(name="dept_id_list")
private String deptIdList;
@JSONField(name="userid_list")
private String useridList;
}
\ No newline at end of file
package com.mortals.xhx.module.dingding.personal.service;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.dingding.IDingTalkService;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
import com.mortals.xhx.module.hik.person.model.req.org.OrgListReq;
import com.mortals.xhx.module.hik.person.model.req.person.PersonReq;
import com.mortals.xhx.module.hik.person.model.rsp.org.OrgDataInfo;
import com.mortals.xhx.module.hik.person.model.rsp.person.PersonDataInfo;
/**
* 钉钉人事相关服务类
*
* @author:
* @date: 2023/7/14 13:54
*/
public interface IDingPersonService extends IDingTalkService {
/**
* 根据电话获取钉钉用户id
*
* @param mobile
* @return
*/
Rest<String> getPersonByMobile(String mobile);
/**
* 发送工作消息
* @param workMsgReq
* @return
*/
Rest<String> sendWorkMsg(WorkMsgReq workMsgReq);
}
package com.mortals.xhx.module.dingding.personal.service.impl;
import com.alibaba.fastjson.JSON;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request;
import com.dingtalk.api.request.OapiV2UserGetbymobileRequest;
import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response;
import com.dingtalk.api.response.OapiV2UserGetbymobileResponse;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.dingding.AbstractDingTalkService;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.taobao.api.ApiException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Service("dingPersonService")
@Slf4j
public class DingPersonServiceImpl extends AbstractDingTalkService implements IDingPersonService {
@Override
public Rest<String> getPersonByMobile(String mobile) {
try {
DingTalkClient client = getDingTalkClient("/topapi/v2/user/getbymobile");
checkToken();
OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest();
req.setMobile(mobile);
log.info("getPersonByMobile:{}",mobile);
OapiV2UserGetbymobileResponse rsp = client.execute(req, dingToken);
log.info("OapiV2UserGetbymobileResponse:{}",rsp.getBody());
if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getResult().getUserid());
} else {
return Rest.fail(String.format("code:%s,msg:%s", rsp.getErrcode(), rsp.getErrmsg()));
}
} catch (ApiException e) {
log.info("根据手机号码查询人员异常", e);
return Rest.fail(e.getMessage());
}
}
@Override
public Rest<String> sendWorkMsg(WorkMsgReq workMsgReq) {
try {
DingTalkClient client = getDingTalkClient("/topapi/message/corpconversation/asyncsend_v2");
checkToken();
OapiMessageCorpconversationAsyncsendV2Request req = new OapiMessageCorpconversationAsyncsendV2Request();
req.setAgentId(agentId);
req.setUseridList(workMsgReq.getUseridList());
req.setMsg(JSON.toJSONString(workMsgReq.getMsg()));
log.info("sendWorkMsg:{}", JSON.toJSONString(workMsgReq));
OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(req, dingToken);
log.info("OapiMessageResponse:{}",rsp.getBody());
if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getMsg(), rsp.getRequestId());
} else {
return Rest.fail(String.format("code:%s,msg:%s", rsp.getErrcode(), rsp.getErrmsg()));
}
} catch (ApiException e) {
log.info("根据用户id发送工作消息异常", e);
return Rest.fail(e.getMessage());
}
}
}
......@@ -10,6 +10,7 @@ import com.mortals.xhx.module.feedback.model.vo.OptionSummaryVo;
import com.mortals.xhx.module.feedback.model.vo.QuestionAnswerVo;
import java.util.List;
import java.util.Map;
/**
* FeedbackService
......@@ -44,4 +45,11 @@ public interface FeedbackService extends ICRUDService<FeedbackEntity,Long>{
* @return
*/
Result<QuestionAnswerVo> getQuestionAnswerList(Long questionId, PageInfo pageInfo) throws AppException;
/**
* 问卷反馈统计
* @return
* @throws AppException
*/
Map<String,Integer> summaryFeedback() throws AppException;
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import com.mortals.xhx.module.feedback.model.vo.FeedbackStaffInfoVo;
import com.mortals.xhx.module.feedback.model.vo.OptionSummaryVo;
import com.mortals.xhx.module.feedback.model.vo.QuestionAnswerVo;
import com.mortals.xhx.module.feedback.service.FeedbackStaffService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -16,10 +17,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import com.mortals.xhx.module.feedback.service.FeedbackQuestionService;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.Arrays;
import java.util.List;
import java.util.*;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
/**
* FeedbackService
......@@ -142,4 +143,30 @@ public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, Fe
}
return dao.getQuestionAnswerList(questionId,pageInfo);
}
@Override
public Map<String, Integer> summaryFeedback() throws AppException {
Map<String,Integer> resultMap = new HashMap<>();
resultMap.put("total",0);
resultMap.put("notStart",0);
resultMap.put("progress",0);
resultMap.put("ended",0);
List<FeedbackEntity> allList = this.getAllList();
if(CollectionUtils.isNotEmpty(allList)) {
resultMap.put("total", allList.size());
Map<Integer, List<FeedbackEntity>> groupMap = allList.stream().collect(Collectors.groupingBy(FeedbackEntity::getProcessStatus));
for (Map.Entry<Integer, List<FeedbackEntity>> entry : groupMap.entrySet()) {
if (entry.getKey() == 0) {
resultMap.put("notStart", entry.getValue().size());
}
if (entry.getKey() == 1) {
resultMap.put("progress", entry.getValue().size());
}
if (entry.getKey() == 2) {
resultMap.put("ended", entry.getValue().size());
}
}
}
return resultMap;
}
}
\ No newline at end of file
......@@ -209,4 +209,36 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
return ret;
}
/**
* 反馈记录整体情况统计
* @return
*/
@PostMapping({"summary"})
@UnAuth
public Rest<Object> summary() {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询反馈记录整体情况统计";
int code = 1;
try {
Map<String,Integer> result = this.getService().summaryFeedback();
model.put("data", result);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model.get("data"));
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.mortals.framework.dao.ICRUDDao;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery;
import java.util.List;
/**
......@@ -19,4 +20,11 @@ public interface PerformAttendAppealDao extends ICRUDDao<PerformAttendAppealEnt
String SQLID_GET_STATLIST = "getStatList";
List<AppealInfo> getStatList(PerformAttendAppealEntity query, PageInfo pageInfo);
/**
* 申述分布情况统计
* @param query
* @return
*/
List<PerformAttendAppealEntity> getAppealSummaryList(AppealSummaryQuery query);
}
......@@ -4,6 +4,7 @@ package com.mortals.xhx.module.perform.dao.ibatis;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto;
import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.perform.dao.PerformAttendAppealDao;
......@@ -31,4 +32,9 @@ public class PerformAttendAppealDaoImpl extends BaseCRUDDaoMybatis<PerformAttend
return getSqlSession().selectList(SQLID_GET_STATLIST, queryParam, rowBounds);
}
}
@Override
public List<PerformAttendAppealEntity> getAppealSummaryList(AppealSummaryQuery query) {
return getSqlSession().selectList(getSqlId("getAppealSummaryList"),query);
}
}
package com.mortals.xhx.module.perform.model.vo;
import lombok.Data;
/**
* 申述分布情况统计
*/
@Data
public class AppealSummaryQuery {
/** 汇总方式 1按年,2按月,3按天*/
private Integer summaryType;
/** 开始 核查时间 */
private String checkTimeStart;
/** 结束 核查时间 */
private String checkTimeEnd;
}
......@@ -6,6 +6,7 @@ import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.dao.PerformAttendAppealDao;
import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery;
import java.util.List;
......@@ -26,4 +27,10 @@ public interface PerformAttendAppealService extends ICRUDService<PerformAttendAp
Rest<List<AppealInfo>> stat(PerformAttendAppealEntity appeal, Context context);
/**
* 申述分布情况统计
* @param query
* @return
*/
List<PerformAttendAppealEntity> getAppealSummaryList(AppealSummaryQuery query);
}
\ No newline at end of file
......@@ -2,34 +2,34 @@ package com.mortals.xhx.module.perform.service.impl;
import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.*;
import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.perform.model.PerformAttendAppealQuery;
import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import org.springframework.beans.BeanUtils;
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.PerformAttendAppealDao;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.service.PerformAttendAppealService;
import org.springframework.beans.factory.annotation.Autowired;
import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesEntity;
import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesQuery;
import com.mortals.xhx.module.perform.model.PerformAttendAppealQuery;
import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery;
import com.mortals.xhx.module.perform.service.PerformAttendAppealFilesService;
import com.mortals.xhx.module.perform.service.PerformAttendAppealService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
/**
* PerformAttendAppealService
* 绩效记录申诉信息 service实现
......@@ -176,6 +176,25 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
return Rest.ok(statList);
}
@Override
public List<PerformAttendAppealEntity> getAppealSummaryList(AppealSummaryQuery query) {
if (query == null) {
query = new AppealSummaryQuery();
query.setSummaryType(SummaryTopTypeEnum..getValue());
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrDateTime("yyyy")+"-01-01");
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrDateTime("yyyy-MM")+"-01");
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrStrDate());
}
query.setCheckTimeEnd(DateUtils.getCurrStrDate());
return dao.getAppealSummaryList(query);
}
@Override
protected void saveAfter(PerformAttendAppealEntity entity, Context context) throws AppException {
......
package com.mortals.xhx.module.perform.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.EnabledEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -125,5 +129,44 @@ public class PerformAttendAppealController extends BaseCRUDJsonBodyMappingContro
return jsonObject.toJSONString();
}
/**
* 申述分布情况统计
* @param query
* @return
*/
@PostMapping({"perform/summary"})
@UnAuth
public Rest<Object> getAppealSummaryList(@RequestBody AppealSummaryQuery query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询申述分布情况统计";
int code = 1;
try {
List<PerformAttendAppealEntity> result = this.getService().getAppealSummaryList(query);
Map<String,String> dict = new HashMap<>();
//attend:考勤绩效,review:评价差评绩效,complain:评价投诉绩效,gowork:办件绩效,effect:效能绩效,other:其它绩效
dict.put("attend","考勤绩效");
dict.put("review","评价差评绩效");
dict.put("complain","评价投诉绩效");
dict.put("gowork","办件绩效");
dict.put("effect","效能绩效");
dict.put("other","其它绩效");
this.addDict(model,"performType",dict);
model.put("data", result);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setData(model);
ret.setDict(model.remove("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
}
\ No newline at end of file
......@@ -2,6 +2,8 @@ package com.mortals.xhx.module.staff.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery;
import java.util.List;
/**
* 员工绩效统计Dao
......@@ -13,5 +15,40 @@ import java.util.List;
public interface StaffPerformStatDao extends ICRUDDao<StaffPerformStatEntity,Long>{
/**
* 按天top10
* @param query
* @return
*/
List<StaffPerformStatEntity> getDaySummaryList(StaffSummaryTopQuery query);
/**
* 按月top10
* @param query
* @return
*/
List<StaffPerformStatEntity> getMonthSummaryList(StaffSummaryTopQuery query);
/**
* 按年top10
* @param query
* @return
*/
List<StaffPerformStatEntity> getYearSummaryList(StaffSummaryTopQuery query);
/**
* 按天异常分值统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getDayExceptionList(StaffSummaryTopQuery query);
/**
* 按月异常分值统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getMonthExceptionList(StaffSummaryTopQuery query);
/**
* 按年异常分值统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getYearExceptionList(StaffSummaryTopQuery query);
}
package com.mortals.xhx.module.staff.dao.ibatis;
import com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.staff.dao.StaffPerformStatDao;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
......@@ -17,5 +18,33 @@ import java.util.List;
public class StaffPerformStatDaoImpl extends BaseCRUDDaoMybatis<StaffPerformStatEntity,Long> implements StaffPerformStatDao {
@Override
public List<StaffPerformStatEntity> getDaySummaryList(StaffSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getDaySummaryList"), query);
}
@Override
public List<StaffPerformStatEntity> getMonthSummaryList(StaffSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getMonthSummaryList"), query);
}
@Override
public List<StaffPerformStatEntity> getYearSummaryList(StaffSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getYearSummaryList"), query);
}
@Override
public List<StaffPerformStatEntity> getDayExceptionList(StaffSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getDayExceptionList"), query);
}
@Override
public List<StaffPerformStatEntity> getMonthExceptionList(StaffSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getMonthExceptionList"), query);
}
@Override
public List<StaffPerformStatEntity> getYearExceptionList(StaffSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getYearExceptionList"), query);
}
}
package com.mortals.xhx.module.staff.model.vo;
import lombok.Data;
/**
* 个人绩效总分排名统计查询条件
*/
@Data
public class StaffSummaryTopQuery {
/** 汇总方式 1按年,2按月,3按天*/
private Integer summaryType;
/**
* 年
*/
private Integer year;
/**
* 月
*/
private Integer month;
/**
* 日
*/
private Integer day;
}
package com.mortals.xhx.module.staff.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import com.mortals.xhx.module.staff.dao.StaffPerformStatDao;
import com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery;
import java.util.List;
/**
* StaffPerformStatService
*
......@@ -13,4 +18,18 @@ import com.mortals.xhx.module.staff.dao.StaffPerformStatDao;
public interface StaffPerformStatService extends ICRUDService<StaffPerformStatEntity,Long>{
StaffPerformStatDao getDao();
/**
* 获取部门个人绩效排行榜
* @param query
* @return
*/
List<StaffPerformStatEntity> getSummaryTopList(StaffSummaryTopQuery query) throws AppException;
/**
* 获取异常分值统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getExceptionList(StaffSummaryTopQuery query) throws AppException;
}
\ No newline at end of file
package com.mortals.xhx.module.staff.service.impl;
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.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.common.code.SummaryTopTypeEnum;
import com.mortals.xhx.module.staff.dao.StaffPerformStatDao;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.List;
/**
* StaffPerformStatService
* 员工绩效统计 service实现
......@@ -17,5 +23,81 @@ import lombok.extern.slf4j.Slf4j;
@Service("staffPerformStatService")
@Slf4j
public class StaffPerformStatServiceImpl extends AbstractCRUDServiceImpl<StaffPerformStatDao, StaffPerformStatEntity, Long> implements StaffPerformStatService {
@Override
public List<StaffPerformStatEntity> getSummaryTopList(StaffSummaryTopQuery query) throws AppException {
LocalDate now = LocalDate.now();
List<StaffPerformStatEntity> result = null;
if(query == null){
query = new StaffSummaryTopQuery();
query.setSummaryType(SummaryTopTypeEnum..getValue());
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
result = dao.getYearSummaryList(query);
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
if(query.getMonth()==null){
query.setMonth(now.getMonthValue());
}
result = dao.getMonthSummaryList(query);
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
if(query.getMonth()==null){
query.setMonth(now.getMonthValue());
}
if(query.getDay()==null){
query.setDay(now.getDayOfMonth());
}
result = dao.getDaySummaryList(query);
}
return result;
}
@Override
public List<StaffPerformStatEntity> getExceptionList(StaffSummaryTopQuery query) throws AppException {
LocalDate now = LocalDate.now();
List<StaffPerformStatEntity> result = null;
if(query == null){
query = new StaffSummaryTopQuery();
query.setSummaryType(SummaryTopTypeEnum..getValue());
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
result = dao.getYearExceptionList(query);
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
if(query.getMonth()==null){
query.setMonth(now.getMonthValue());
}
result = dao.getMonthExceptionList(query);
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
if(query.getMonth()==null){
query.setMonth(now.getMonthValue());
}
if(query.getDay()==null){
query.setDay(now.getDayOfMonth());
}
result = dao.getDayExceptionList(query);
}
return result;
}
}
\ No newline at end of file
package com.mortals.xhx.module.staff.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 员工绩效统计
......@@ -47,5 +46,100 @@ public class StaffPerformStatController extends BaseCRUDJsonBodyMappingControlle
super.init(model, context);
}
/**
* 个人绩效排行榜
* @param query
* @return
*/
@PostMapping({"summary/top"})
@UnAuth
public Rest<Object> getSummaryTopList(@RequestBody StaffSummaryTopQuery query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询个人绩效排行榜";
int code = 1;
try {
List<StaffPerformStatEntity> result = this.getService().getSummaryTopList(query);
model.put("data", result);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model.get("data"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
/**
* 异常分值统计
* @param query
* @return
*/
@PostMapping({"summary/exception"})
@UnAuth
public Rest<Object> getExceptionList(@RequestBody StaffSummaryTopQuery query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询异常分值统计";
int code = 1;
try {
List<StaffPerformStatEntity> result = this.getService().getExceptionList(query);
List<JSONObject> data = new ArrayList<>();
if(CollectionUtils.isNotEmpty(result)) {
StaffPerformStatEntity entity = result.get(0);
JSONObject jsonObject1 = new JSONObject();
jsonObject1.put("name", "考勤绩效");
jsonObject1.put("add", entity.getAttendScoreAdd());
jsonObject1.put("sub", entity.getAttendScoreSub());
data.add(jsonObject1);
JSONObject jsonObject2 = new JSONObject();
jsonObject2.put("name", "评价绩效");
jsonObject2.put("add", entity.getReviewScoreAdd());
jsonObject2.put("sub", entity.getReviewScoreSub());
data.add(jsonObject2);
JSONObject jsonObject3 = new JSONObject();
jsonObject3.put("name", "投诉绩效");
jsonObject3.put("add", entity.getComplainScoreAdd());
jsonObject3.put("sub", entity.getComplainScoreSub());
data.add(jsonObject3);
JSONObject jsonObject4 = new JSONObject();
jsonObject4.put("name", "办件绩效");
jsonObject4.put("add", entity.getGoworkScoreAdd());
jsonObject4.put("sub", entity.getGoworkScoreSub());
data.add(jsonObject4);
JSONObject jsonObject5 = new JSONObject();
jsonObject5.put("name", "效能绩效");
jsonObject5.put("add", entity.getEffectScoreAdd());
jsonObject5.put("sub", entity.getEffectScoreSub());
data.add(jsonObject5);
JSONObject jsonObject6 = new JSONObject();
jsonObject6.put("name", "其它绩效");
jsonObject6.put("add", entity.getOtherScoreAdd());
jsonObject6.put("sub", entity.getOtherScoreSub());
data.add(jsonObject6);
}
model.put("data", data);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model.get("data"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
}
\ No newline at end of file
......@@ -61,8 +61,15 @@ hik:
appKey: @profiles.hik.appKey@
protocol: @profiles.hik.protocol@
appSecret: @profiles.hik.appSecret@
#dingtalk:
# agentId: 2652674890
# AppKey: dingpqzradgfr4efdi2j
# AppSecret: bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd
# domain: https://oapi.dingtalk.com
dingtalk:
agentId: 2652674890
AppKey: dingpqzradgfr4efdi2j
AppSecret: bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd
agentId: 2625340030
AppKey: dingjcqjqjh1j82ho5zx
AppSecret: _wNw2J6sxTYcu3ddNkFlG3U-3UlQ-P_7ufLSJ4wRxgdUflm3lPf8LIODCQOGkydy
domain: https://oapi.dingtalk.com
......@@ -7,6 +7,7 @@
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,1 AS checkType ,'attend' AS performType FROM mortals_xhx_check_attend_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<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>
......@@ -15,6 +16,7 @@
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,4 AS checkType ,'effect' AS performType FROM mortals_xhx_check_effect_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<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>
......@@ -23,6 +25,7 @@
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,6 AS checkType ,'complain' AS performType FROM mortals_xhx_check_complain_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<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>
......@@ -31,6 +34,7 @@
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,3 AS checkType ,'gowork' AS performType FROM mortals_xhx_check_gowork_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<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>
......@@ -39,6 +43,7 @@
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,2 AS checkType ,'review' AS performType FROM mortals_xhx_check_review_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<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>
......@@ -47,6 +52,7 @@
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,5 AS checkType ,'other' AS performType FROM mortals_xhx_check_other_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<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>
......
......@@ -3,7 +3,7 @@
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.dept.dao.ibatis.DeptPerformStatDaoImpl">
<!-- 按天top10 -->
<select id="getSummaryCheckList" parameterType="com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
<select id="getDaySummaryList" parameterType="com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT * FROM (
SELECT
`year`,
......@@ -31,4 +31,56 @@
`day`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
<!-- 按月top10 -->
<select id="getMonthSummaryList" parameterType="com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT * FROM (
SELECT
`year`,
`month`,
deptId,
deptName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_dept_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
<if test="month != null">
AND `month` = #{month}
</if>
GROUP BY
deptId,
`year`,
`month`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
<!-- 按年top10 -->
<select id="getYearSummaryList" parameterType="com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT * FROM (
SELECT
`year`,
deptId,
deptName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_dept_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
<if test="month != null">
AND `month` = #{month}
</if>
<if test="day != null">
AND `day` = #{day}
</if>
GROUP BY
deptId,
`year`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.perform.dao.ibatis.PerformAttendAppealDaoImpl">
<!-- 申述分布情况统计 -->
<select id="getAppealSummaryList" parameterType="com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery" resultType="com.mortals.xhx.module.perform.model.PerformAttendAppealEntity">
SELECT
performType,
SUM(score) AS score
FROM
mortals_xhx_perform_attend_appeal
WHERE
processStatus = 2
AND appealResult = 1
<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
performType
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.staff.dao.ibatis.StaffPerformStatDaoImpl">
<!-- 按天top10 -->
<select id="getDaySummaryList" parameterType="com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT * FROM (
SELECT
`year`,
`month`,
`day`,
staffId,
staffName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
<if test="month != null">
AND `month` = #{month}
</if>
<if test="day != null">
AND `day` = #{day}
</if>
GROUP BY
staffId,
`year`,
`month`,
`day`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
<!-- 按月top10 -->
<select id="getMonthSummaryList" parameterType="com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT * FROM (
SELECT
`year`,
`month`,
staffId,
staffName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
<if test="month != null">
AND `month` = #{month}
</if>
GROUP BY
staffId,
`year`,
`month`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
<!-- 按年top10 -->
<select id="getYearSummaryList" parameterType="com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT * FROM (
SELECT
`year`,
staffId,
staffName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
GROUP BY
staffId,
`year`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
<!-- 按天异常分值统计 -->
<select id="getDayExceptionList" parameterType="com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
`year`,
`month`,
`day`,
SUM(attendScoreAdd) AS attendScoreAdd,
SUM(attendScoreSub) AS attendScoreSub,
SUM(reviewScoreAdd) AS reviewScoreAdd,
SUM(reviewScoreSub) AS reviewScoreSub,
SUM(complainScoreAdd) AS complainScoreAdd,
SUM(complainScoreSub) AS complainScoreSub,
SUM(goworkScoreAdd) AS goworkScoreAdd,
SUM(goworkScoreSub) AS goworkScoreSub,
SUM(effectScoreAdd) AS effectScoreAdd,
SUM(effectScoreSub) AS effectScoreSub,
SUM(otherScoreAdd) AS otherScoreAdd,
SUM(otherScoreSub) AS otherScoreSub
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
<if test="month != null">
AND `month` = #{month}
</if>
<if test="day != null">
AND `day` = #{day}
</if>
GROUP BY
`year`,
`month`,
`day`
</select>
<!-- 按月异常分值统计 -->
<select id="getMonthExceptionList" parameterType="com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
`year`,
`month`,
SUM(attendScoreAdd) AS attendScoreAdd,
SUM(attendScoreSub) AS attendScoreSub,
SUM(reviewScoreAdd) AS reviewScoreAdd,
SUM(reviewScoreSub) AS reviewScoreSub,
SUM(complainScoreAdd) AS complainScoreAdd,
SUM(complainScoreSub) AS complainScoreSub,
SUM(goworkScoreAdd) AS goworkScoreAdd,
SUM(goworkScoreSub) AS goworkScoreSub,
SUM(effectScoreAdd) AS effectScoreAdd,
SUM(effectScoreSub) AS effectScoreSub,
SUM(otherScoreAdd) AS otherScoreAdd,
SUM(otherScoreSub) AS otherScoreSub
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
<if test="month != null">
AND `month` = #{month}
</if>
GROUP BY
`year`,
`month`
</select>
<!-- 按年异常分值统计 -->
<select id="getYearExceptionList" parameterType="com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
`year`,
SUM(attendScoreAdd) AS attendScoreAdd,
SUM(attendScoreSub) AS attendScoreSub,
SUM(reviewScoreAdd) AS reviewScoreAdd,
SUM(reviewScoreSub) AS reviewScoreSub,
SUM(complainScoreAdd) AS complainScoreAdd,
SUM(complainScoreSub) AS complainScoreSub,
SUM(goworkScoreAdd) AS goworkScoreAdd,
SUM(goworkScoreSub) AS goworkScoreSub,
SUM(effectScoreAdd) AS effectScoreAdd,
SUM(effectScoreSub) AS effectScoreSub,
SUM(otherScoreAdd) AS otherScoreAdd,
SUM(otherScoreSub) AS otherScoreSub
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
GROUP BY
`year`
</select>
</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