Commit dca6a8b2 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents c0a96cf1 7932169f
......@@ -145,7 +145,14 @@
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>dingtalk</artifactId>
<version>2.0.19</version>
<version>2.0.22</version>
</dependency>
<!--dingdingtalk service sdk-->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>alibaba-dingtalk-service-sdk</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
......
......@@ -2,20 +2,29 @@ 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.service.ICacheService;
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.MobileReq;
import com.mortals.xhx.busiz.req.ReviewSaveReq;
import com.mortals.xhx.common.code.YesNoEnum;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import sun.security.krb5.internal.APOptions;
import java.util.List;
/**
* 钉钉相关外部接口
......@@ -29,7 +38,7 @@ public class TalkApiController {
@Autowired
private TalkConfiguration talkConfiguration;
private String dingToken;
/**
* 获取token
......@@ -37,33 +46,194 @@ public class TalkApiController {
* @return
*/
@PostMapping("/dingtalk/gettoken")
public Rest<String> getToken(@RequestBody DingTalkBaseReq dingTalkBaseReq) {
log.info("收到【getToken】请求【请求体】--> {}", JSON.toJSONString(dingTalkBaseReq));
@UnAuth
public ApiRespPdu<String> getToken() {
ApiRespPdu<String> apiRespPdu = new ApiRespPdu<>();
try {
// DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
// OapiGettokenRequest req = new OapiGettokenRequest();
// req.setHttpMethod("GET");
// OapiGettokenResponse rsp = client.execute(req);
/* DingTalkClient client = new DefaultDingTalkClient(talkConfiguration.getGetTokneUrl());
DingTalkClient client = new DefaultDingTalkClient(talkConfiguration.getGetTokneUrl());
OapiGettokenRequest req = new OapiGettokenRequest();
req.setAppkey(apiKey);
req.setAppsecret(appsecret);
req.setAppkey(talkConfiguration.getAppKey());
req.setAppsecret(talkConfiguration.getAppSecret());
req.setHttpMethod("GET");
OapiGettokenResponse rsp = client.execute(req);
log.info("gettoken rsp:" + rsp.getBody());
if (rsp.getErrcode() == 0) {
dingToken = rsp.getAccessToken();
apiRespPdu.setCode(0);
apiRespPdu.setData(rsp.getAccessToken());
apiRespPdu.setMsg(rsp.getMsg());
} else {
throw new AppException(String.format("errorCode:%s,errorMsg:%s", rsp.getErrcode(), rsp.getErrmsg()));
apiRespPdu.setCode(-1);
apiRespPdu.setData("");
apiRespPdu.setMsg(rsp.getMsg());
}
*/
} catch (Exception e) {
log.error("异常", e);
return Rest.fail(e.getMessage());
apiRespPdu.setCode(-1);
apiRespPdu.setData("");
apiRespPdu.setMsg(e.toString());
}
return apiRespPdu;
}
/**
* 获取部门列表
* @return
*/
@PostMapping("/dingtalk/getSubList")
@UnAuth
public ApiRespPdu<List<OapiV2DepartmentListsubResponse.DeptBaseResponse>> getSubList(){
ApiRespPdu<List<OapiV2DepartmentListsubResponse.DeptBaseResponse>> apiRespPdu = new ApiRespPdu<>();
try {
DingTalkClient client = new DefaultDingTalkClient(talkConfiguration.getGetSubList());
OapiV2DepartmentListsubRequest req = new OapiV2DepartmentListsubRequest();
if(dingToken == null){
dingToken = getToken().getData();
}
OapiV2DepartmentListsubResponse rsp = client.execute(req, dingToken);
if(rsp.getErrcode() == 0){
apiRespPdu.setCode(0);
apiRespPdu.setData(rsp.getResult());
apiRespPdu.setMsg(rsp.getMsg());
}else {
if(getToken().getCode() == 0){
getSubList();
}else {
apiRespPdu.setCode(-1);
apiRespPdu.setData(null);
apiRespPdu.setMsg("获取token失败");
}
}
} catch (Exception e) {
e.printStackTrace();
apiRespPdu.setCode(-1);
apiRespPdu.setData(null);
apiRespPdu.setMsg(e.toString());
}
return apiRespPdu;
}
/**
* 根据部门id查询该部门下所有用户完整信息
* @return
*/
@PostMapping("/dingtalk/getUserList")
@UnAuth
public ApiRespPdu<OapiV2UserListResponse.PageResult> getUserList(@RequestBody UserPageReq res){
ApiRespPdu<OapiV2UserListResponse.PageResult> apiRespPdu = new ApiRespPdu<>();
try {
DingTalkClient client = new DefaultDingTalkClient(talkConfiguration.getGetuserlist());
OapiV2UserListRequest req = new OapiV2UserListRequest();
if(dingToken == null){
dingToken = getToken().getData();
}
req.setDeptId(res.getDeptid());
req.setCursor(res.getCursor());
req.setSize(res.getSize());
OapiV2UserListResponse rsp = client.execute(req, dingToken);
if(rsp.getErrcode() == 0){
apiRespPdu.setCode(0);
apiRespPdu.setData(rsp.getResult());
apiRespPdu.setMsg(rsp.getMsg());
}else {
if(getToken().getCode() == 0){
getUserList(res);
}else {
apiRespPdu.setCode(-1);
apiRespPdu.setData(null);
apiRespPdu.setMsg("获取token失败");
}
}
} catch (Exception e) {
e.printStackTrace();
apiRespPdu.setCode(-1);
apiRespPdu.setData(null);
apiRespPdu.setMsg(e.toString());
}
return Rest.ok();
return apiRespPdu;
}
/**
* 根据手机号查询用户
* @return
*/
@GetMapping("/dingtalk/getByMobile")
@UnAuth
public ApiRespPdu<OapiV2UserGetResponse.UserGetResponse> getByMobile(@RequestBody MobileReq mobile){
ApiRespPdu<OapiV2UserGetResponse.UserGetResponse> apiRespPdu = new ApiRespPdu<>();
try {
DingTalkClient client = new DefaultDingTalkClient(talkConfiguration.getGetbymobile());
OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest();
if(dingToken == null){
dingToken = getToken().getData();
}
req.setMobile(mobile.getMobile());
OapiV2UserGetbymobileResponse rsp = client.execute(req, dingToken);
if(rsp.getErrcode() == 0){
//根据获取到的userid去获取用户详情
ApiRespPdu<OapiV2UserGetResponse.UserGetResponse> userRsp = getUserInfo(rsp.getResult().getUserid());
if(userRsp.getCode() == 0){
apiRespPdu.setCode(userRsp.getCode());
apiRespPdu.setData(userRsp.getData());
apiRespPdu.setMsg(userRsp.getMsg());
}else {
apiRespPdu.setCode(-1);
apiRespPdu.setData(null);
apiRespPdu.setMsg(userRsp.getMsg());
}
}else {
if(getToken().getCode() == 0){
getByMobile(mobile);
}else {
apiRespPdu.setCode(-1);
apiRespPdu.setData(null);
apiRespPdu.setMsg("获取token失败");
}
}
} catch (Exception e) {
e.printStackTrace();
apiRespPdu.setCode(-1);
apiRespPdu.setData(null);
apiRespPdu.setMsg(e.toString());
}
return apiRespPdu;
}
/**
* 根据userid查询用户详情
* @return
*/
@GetMapping("/dingtalk/getUserInfo")
@UnAuth
public ApiRespPdu<OapiV2UserGetResponse.UserGetResponse> getUserInfo(@RequestBody String userid){
ApiRespPdu<OapiV2UserGetResponse.UserGetResponse> apiRespPdu = new ApiRespPdu<>();
try {
DingTalkClient client = new DefaultDingTalkClient(talkConfiguration.getGetuserinfo());
OapiV2UserGetRequest req = new OapiV2UserGetRequest();
if(dingToken == null){
dingToken = getToken().getData();
}
req.setUserid(userid);
OapiV2UserGetResponse rsp = client.execute(req, dingToken);
apiRespPdu.setCode(0);
apiRespPdu.setData(rsp.getResult());
apiRespPdu.setMsg(rsp.getMsg());
} catch (Exception e) {
e.printStackTrace();
apiRespPdu.setCode(-1);
apiRespPdu.setData(null);
apiRespPdu.setMsg(e.toString());
}
return apiRespPdu;
}
}
......@@ -19,19 +19,47 @@ public class TalkConfiguration {
@Value("${dingtalk.agentId:''}")
private String getAgentId;
/**
* appKey
*/
@Value("${dingtalk.AppKey:''}")
private String AppKey;
/**
* AppSecret
*/
@Value("${dingtalk.AppSecret:''}")
private String AppSecret;
/**
* getToken
*/
@Value("${dingtalk.gettoken:''}")
@Value("${dingtalk.gettoken:https://oapi.dingtalk.com/gettoken}")
private String getTokneUrl;
/**
* getbymobile
* 获取部门列表
*/
@Value("${dingtalk.getbymobile:''}")
private String getbymobile;
@Value("${dingtalk.listsub:https://oapi.dingtalk.com/topapi/v2/department/listsub}")
private String getSubList;
/**
* 根据部门id获取用户详情列表
*/
@Value("${dingtalk.getUserList:https://oapi.dingtalk.com/topapi/v2/user/list}")
private String getuserlist;
/**
* 根据电话查询用户信息
*/
@Value("${dingtalk.getbymobile:https://oapi.dingtalk.com/topapi/v2/user/getbymobile}")
private String getbymobile;
/**
* 根据userid查询用户信息
*/
@Value("${dingtalk.getuserinfo:https://oapi.dingtalk.com/topapi/v2/user/get}")
private String getuserinfo;
/**
* getDeptbyUser
*/
......
package com.mortals.xhx.busiz.dingtalk.req;
/**
* @author ZYW
* @date 2023-07-12 11:38
*/
public class UserPageReq {
//部门id
private Long deptid;
//起始页码
private Long cursor;
//每页条数
private Long size;
public Long getDeptid() {
return deptid;
}
public void setDeptid(Long deptid) {
this.deptid = deptid;
}
public Long getCursor() {
return cursor;
}
public void setCursor(Long cursor) {
this.cursor = cursor;
}
public Long getSize() {
return size;
}
public void setSize(Long size) {
this.size = size;
}
}
package com.mortals.xhx.busiz.req;
import com.mortals.framework.annotation.Excel;
import com.mortals.xhx.busiz.BaseReq;
import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesEntity;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Data
......@@ -29,7 +33,22 @@ public class AppealReq extends BaseReq {
*/
private Long staffId;
/**
* 核查记录id
*/
private Long Id;
/**
* 申诉说明
*/
private String appealDesc;
/**
* 绩效记录申诉附件信息信息
*/
private List<PerformAttendAppealFilesEntity> performAttendAppealFilesList = new ArrayList<>();
;
}
package com.mortals.xhx.busiz.req;
/**
* @author ZYW
* @date 2023-07-12 13:47
*/
public class MobileReq {
String mobile;
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
}
package com.mortals.xhx.busiz.rsp;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AppealDetailInfo {
/**
* id
*/
private Long id;
/**
* 记录ID
*/
private Long recordId;
/**
* 员工ID
*/
private Long staffId;
/**
* 员工姓名
*/
private String staffName;
/**
* 工号
*/
private String workNum;
/**
* 所属部门
*/
private Long deptId;
/**
* 所属部门名称
*/
private String deptName;
/**
* 所属考勤组ID
*/
private Long attendanceGroupId;
/**
* 所属考勤组名称
*/
private String attendanceGroupName;
/**
* 考勤时间
*/
private Date attendanceDate;
/**
* 绩效规则id
*/
private Long ruleId;
/**
* 规则名称
*/
private String ruleName;
/**
* 增减类型(1.增加,2.扣除)
*/
private Integer subAddType;
/**
* 扣分或增加分值
*/
private BigDecimal score;
/**
* 上下班时间
*/
private String goOffTimeStr;
/**
* 异常时间
*/
private Date errorTime;
/**
* 实际打卡时间
*/
private Date actualAttendTime;
/**
* 异常处理结果
*/
private String errorResult;
/**
* 核查人员
*/
private String checkPerson;
/**
* 核查时间
*/
private Date checkTime;
/**
* 核查说明
*/
private String checkDesc;
/**
* 核查结果
*/
private String checkResult;
/**
* 处理状态(1.未处理,2.已处理)
*/
private Integer checkStatus;
/**
* 扣分方式(1.系统自动,2.人工添加,3.大厅巡查)
*/
private Integer subMethod;
/**
* 说明
*/
private String remark;
/**
* 评价结果(1.非常不满意,2.差评)
*/
private Integer reviewResult;
/**
* 评价时间
*/
private Date reviewTime;
/**
* 评价来源(窗口评价系统,导视系统,自助服务系统,微官网,其它)
*/
private String reviewSource;
/**
* 评价设备
*/
private String reviewDevice;
/**
* 投诉标题
*/
private String complainTitle;
/**
* 投诉内容
*/
private String complainContent;
/**
* 投诉人真实姓名
*/
private String complainRealName;
/**
* 联系电话
*/
private String contact;
/**
* 投诉时间
*/
private Date complainTime;
/**
* 投诉来源
*/
private String complainSource;
/**
* 投诉设备
*/
private String complainDevice;
/**
* 办件编码
*/
private String goworkCode;
/**
* 办件所属部门
*/
private String goworkDepts;
/**
* 事项名称
*/
private String matterlName;
/**
* 办理时间
*/
private Date goworkTime;
/**
* 违规类型(1.脱岗,2.离岗,3.玩手机,4.睡觉)
*/
private Integer irregularType;
/**
* 发生时间
*/
private Date happenTime;
/**
* 持续时间,秒
*/
private Integer duration;
/**
* 报警时间
*/
private Date alarmTime;
/**
* 图片凭证地址
*/
private String snapPath;
/**
* 窗口编号
*/
private String windowNum;
/**
* 违规类型(1.工作纪律)
*/
private Integer irregularOtherType;
/**
* 附件名称,多个逗号分割
*/
private String fileNames;
/**
* 附件下载地址,多个逗号分割
*/
private String filePaths;
}
......@@ -10,14 +10,11 @@ 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.AppealStatInfo;
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.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.ProcessStatusEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.*;
import com.mortals.xhx.module.check.service.*;
......@@ -25,7 +22,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.checkerframework.checker.units.qual.A;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
......@@ -36,9 +32,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.mortals.framework.ap.SysConstains.*;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED;
......@@ -56,7 +50,22 @@ import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT;
public class AppealApiController extends AbstractBaseController<PerformReq> {
@Autowired
private PerformAttendAppealService attendAppealService;
private CheckAttendRecordService checkAttendRecordService;
@Autowired
private CheckReviewRecordService checkReviewRecordService;
@Autowired
private CheckComplainRecordService checkComplainRecordService;
@Autowired
private CheckEffectRecordService checkEffectRecordService;
@Autowired
private CheckGoworkRecordService checkGoworkRecordService;
@Autowired
private CheckOtherRecordService checkOtherRecordService;
@Autowired
private PerformAttendAppealService appealService;
/**
* 个人申诉绩效统计
......@@ -112,7 +121,7 @@ public class AppealApiController extends AbstractBaseController<PerformReq> {
query.setAppealTimeEnd(appealReq.getAppealEndDate());
query.setStaffId(context.getUser().getCustomerId());
Result<PerformAttendAppealEntity> result = attendAppealService.find(query, pageInfo, context);
Result<PerformAttendAppealEntity> result = appealService.find(query, pageInfo, context);
model.put(KEY_RESULT_DATA, result.getList());
model.put(PAGEINFO_KEY, result.getPageInfo());
parsePageInfo(model, result.getPageInfo());
......@@ -139,7 +148,7 @@ public class AppealApiController extends AbstractBaseController<PerformReq> {
if (ObjectUtils.isEmpty(appealReq.getId())) {
throw new AppException("详细查询id不能为空!");
}
PerformAttendAppealEntity performAttendAppealEntity = attendAppealService.get(appealReq.getId(), context);
PerformAttendAppealEntity performAttendAppealEntity = appealService.get(appealReq.getId(), context);
rest.setData(performAttendAppealEntity);
recordSysLog(request, busiDesc + " 【成功】");
......@@ -155,21 +164,53 @@ public class AppealApiController extends AbstractBaseController<PerformReq> {
* 申诉新增
*/
@PostMapping(value = "save")
public Rest<PerformAttendAppealEntity> appealSave(@RequestBody PerformAttendAppealEntity appealEntity) {
public Rest<PerformAttendAppealEntity> appealSave(@RequestBody AppealReq req) {
String busiDesc = "个人申诉新增";
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(appealEntity));
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(req));
Rest<PerformAttendAppealEntity> rest = Rest.ok(busiDesc + " 【成功】");
Context context = this.getContext();
try {
//校验 去重
PerformAttendAppealEntity saveEntity = attendAppealService.save(appealEntity, context);
//根据状态 查询 当前是否已经存在正在进行的申诉
if (ObjectUtils.isEmpty(req.getId())) throw new AppException("核查记录Id不能为空!");
if (ObjectUtils.isEmpty(req.getPerformType())) throw new AppException("绩效类型不能为空!");
PerformAttendAppealEntity entity = new PerformAttendAppealEntity();
entity.initAttrValue();
if (PerformTypeEnum.考勤绩效.getValue().equals(req.getPerformType())) {
//查询当前核查是否已存在进行中的申诉记录
PerformAttendAppealEntity appealEntity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(req.getId()));
if (!ObjectUtils.isEmpty(appealEntity) && appealEntity.getProcessStatus() == ProcessStatusEnum.未处理.getValue()) {
throw new AppException("当前绩效核查已经存在正在进行中的申诉记录!");
}
CheckAttendRecordEntity checkEntity = checkAttendRecordService.get(req.getId(), context);
BeanUtils.copyProperties(checkEntity, entity, BeanUtil.getNullPropertyNames(checkEntity));
} else if (PerformTypeEnum.评价差评绩效.getValue().equals(req.getPerformType())) {
CheckReviewRecordEntity checkEntity = checkReviewRecordService.get(req.getId(), context);
} else if (PerformTypeEnum.评价投诉绩效.getValue().equals(req.getPerformType())) {
CheckComplainRecordEntity checkEntity = checkComplainRecordService.get(req.getId(), context);
} else if (PerformTypeEnum.办件绩效.getValue().equals(req.getPerformType())) {
CheckGoworkRecordEntity checkEntity = checkGoworkRecordService.get(req.getId(), context);
} else if (PerformTypeEnum.效能绩效.getValue().equals(req.getPerformType())) {
CheckEffectRecordEntity checkEntity = checkEffectRecordService.get(req.getId(), context);
} else if (PerformTypeEnum.其它绩效.getValue().equals(req.getPerformType())) {
CheckOtherRecordEntity checkEntity = checkOtherRecordService.get(req.getId(), context);
} else {
throw new AppException("不支持当前绩效类型");
}
entity.setPerformAttendAppealFilesList(req.getPerformAttendAppealFilesList());
entity.setProcessStatus(1);
PerformAttendAppealEntity saveEntity = appealService.save(entity, context);
rest.setData(saveEntity);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
log.info("【{}】【响应体】--> {}", busiDesc, JSONObject.toJSONString(appealEntity));
log.info("【{}】【响应体】--> {}", busiDesc, JSONObject.toJSONString(req));
return rest;
}
......
......@@ -4,13 +4,13 @@ import java.util.LinkedHashMap;
import java.util.Map;
/**
* 处理状态(1.未核查,2.已核查)枚举类
* 处理状态(1.未处理,2.已处理)枚举类
*
* @author zxfei
*/
public enum ProcessStatusEnum {
核查(1, "未核查"),
核查(2, "已核查");
处理(1, "未处理"),
处理(2, "已处理");
private Integer value;
private String desc;
......
......@@ -4,13 +4,14 @@ import java.util.LinkedHashMap;
import java.util.Map;
/**
* 扣分方式(1.系统自动,2.人工添加)枚举类
* 扣分方式(1.系统自动,2.人工添加,3.大厅巡查)枚举类
*
* @author zxfei
*/
public enum SubMethodEnum {
系统自动(1, "系统自动"),
人工添加(2, "人工添加");
人工添加(2, "人工添加"),
大厅巡查(3, "大厅巡查");
private Integer value;
private String desc;
......
......@@ -133,7 +133,7 @@ public class CheckAttendRecordEntity extends CheckAttendRecordVo {
*/
private Long categoryId;
/**
* 规则名称
* 规则分类名称
*/
private String categoryName;
@Override
......
......@@ -8,7 +8,7 @@ import java.util.List;
* 绩效记录申诉信息 DAO接口
*
* @author zxfei
* @date 2023-07-05
* @date 2023-07-12
*/
public interface PerformAttendAppealDao extends ICRUDDao<PerformAttendAppealEntity,Long>{
......
......@@ -11,7 +11,7 @@ import java.util.List;
* 绩效记录申诉信息DaoImpl DAO接口
*
* @author zxfei
* @date 2023-07-05
* @date 2023-07-12
*/
@Repository("performAttendAppealDao")
public class PerformAttendAppealDaoImpl extends BaseCRUDDaoMybatis<PerformAttendAppealEntity,Long> implements PerformAttendAppealDao {
......
......@@ -14,7 +14,7 @@ import lombok.Data;
* 绩效记录申诉信息实体对象
*
* @author zxfei
* @date 2023-07-05
* @date 2023-07-12
*/
@Data
public class PerformAttendAppealEntity extends PerformAttendAppealVo {
......@@ -134,10 +134,108 @@ public class PerformAttendAppealEntity extends PerformAttendAppealVo {
@Excel(name = "说明")
private String remark;
/**
* 违规类型
* 违规类型
*/
private String violationType;
/**
* 评价结果(1.非常不满意,2.差评)
*/
private Integer reviewResult;
/**
* 评价时间
*/
private Date reviewTime;
/**
* 评价来源(窗口评价系统,导视系统,自助服务系统,微官网,其它)
*/
@Excel(name = "评价来源", readConverterExp = "评价来源(窗口评价系统,导视系统,自助服务系统,微官网,其它)")
private String reviewSource;
/**
* 评价设备
*/
private String reviewDevice;
/**
* 投诉标题
*/
@Excel(name = "投诉标题")
private String complainTitle;
/**
* 投诉内容
*/
@Excel(name = "投诉内容")
private String complainContent;
/**
* 投诉人真实姓名
*/
private String complainRealName;
/**
* 联系电话
*/
@Excel(name = "联系电话")
private String contact;
/**
* 投诉时间
*/
private Date complainTime;
/**
* 投诉来源
*/
private String complainSource;
/**
* 投诉设备
*/
private String complainDevice;
/**
* 办件编码
*/
@Excel(name = "办件编码")
private String goworkCode;
/**
* 办件所属部门
*/
@Excel(name = "办件所属部门")
private String goworkDepts;
/**
* 事项名称
*/
@Excel(name = "事项名称")
private String matterlName;
/**
* 办理时间
*/
@Excel(name = "办理时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date goworkTime;
/**
* 违规类型(1.脱岗,2.离岗,3.玩手机,4.睡觉)
*/
@Excel(name = "违规类型", readConverterExp = "1=脱岗,2.离岗,3.玩手机,4.睡觉")
private Integer irregularType;
/**
* 发生时间
*/
@Excel(name = "发生时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date happenTime;
/**
* 持续时间,秒
*/
private Integer duration;
/**
* 报警时间
*/
private Date alarmTime;
/**
* 图片凭证地址
*/
private String snapPath;
/**
* 违规类型(1.工作纪律)
*/
private Integer irregularOtherType;
/**
* 绩效类型【attend:考勤绩效,review:评价差评绩效,complain:评价投诉绩效,gowork:办件绩效,effect:效能绩效,other:其它绩效】
*/
private String performType;
/**
* 绩效记录申诉附件信息信息
*/
private List<PerformAttendAppealFilesEntity> performAttendAppealFilesList=new ArrayList<>();;
......@@ -221,5 +319,49 @@ public class PerformAttendAppealEntity extends PerformAttendAppealVo {
this.remark = "";
this.violationType = "";
this.reviewResult = -1;
this.reviewTime = null;
this.reviewSource = "";
this.reviewDevice = "";
this.complainTitle = "";
this.complainContent = "";
this.complainRealName = "";
this.contact = "";
this.complainTime = null;
this.complainSource = "";
this.complainDevice = "";
this.goworkCode = "";
this.goworkDepts = "";
this.matterlName = "";
this.goworkTime = null;
this.irregularType = -1;
this.happenTime = null;
this.duration = 0;
this.alarmTime = null;
this.snapPath = "";
this.irregularOtherType = -1;
this.performType = "";
}
}
\ No newline at end of file
......@@ -11,7 +11,7 @@ import java.util.Date;
* 绩效记录申诉信息视图对象
*
* @author zxfei
* @date 2023-07-05
* @date 2023-07-12
*/
@Data
public class PerformAttendAppealVo extends BaseEntityLong {
......
package com.mortals.xhx.module.perform.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.perform.model.PerformPerposeDeptEntity;
import com.mortals.xhx.module.perform.model.PerformPerposeEntity;
import java.util.ArrayList;
import java.util.List;
import com.mortals.xhx.module.perform.model.PerformPerposeStaffEntity;
import lombok.Data;
/**
* 考核目标视图对象
*
* @author zxfei
* @date 2023-05-16
*/
* 考核目标视图对象
*
* @author zxfei
* @date 2023-05-16
*/
@Data
public class PerformPerposeVo extends BaseEntityLong {
/** 负责人姓名 */
private String leaderNames;
/**
* 员工目标
*/
private List<PerformPerposeStaffEntity> perposeStaffList;
/**
* 部门目标
*/
private List<PerformPerposeDeptEntity> perposeDeptList;
private String staffPerpose;
private String deptPerpose;
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ import com.mortals.xhx.module.perform.dao.PerformAttendAppealDao;
* 绩效记录申诉信息 service接口
*
* @author zxfei
* @date 2023-07-05
* @date 2023-07-12
*/
public interface PerformAttendAppealService extends ICRUDService<PerformAttendAppealEntity,Long>{
......
......@@ -20,7 +20,7 @@ import lombok.extern.slf4j.Slf4j;
* 绩效记录申诉信息 service实现
*
* @author zxfei
* @date 2023-07-05
* @date 2023-07-12
*/
@Service("performAttendAppealService")
@Slf4j
......
package com.mortals.xhx.module.perform.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.AssessmentScopeEnum;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.perform.model.*;
import com.mortals.xhx.module.perform.service.PerformPerposeDeptService;
import com.mortals.xhx.module.perform.service.PerformPerposeStaffService;
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 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.PerformPerposeDao;
import com.mortals.xhx.module.perform.model.PerformPerposeEntity;
import com.mortals.xhx.module.perform.service.PerformPerposeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* PerformPerposeService
* 考核目标 service实现
*
* @author zxfei
* @date 2023-05-16
*/
* PerformPerposeService
* 考核目标 service实现
*
* @author zxfei
* @date 2023-05-16
*/
@Service("performPerposeService")
@Slf4j
public class PerformPerposeServiceImpl extends AbstractCRUDServiceImpl<PerformPerposeDao, PerformPerposeEntity, Long> implements PerformPerposeService {
@Autowired
private PerformPerposeStaffService perposeStaffService;
@Autowired
private PerformPerposeDeptService perposeDeptService;
@Autowired
private DeptService deptService;
@Autowired
private StaffService staffService;
@Override
protected void findAfter(PerformPerposeEntity params, PageInfo pageInfo, Context context, List<PerformPerposeEntity> list) throws AppException {
if(CollectionUtils.isNotEmpty(list)){
for (PerformPerposeEntity perposeEntity:list){
if(StringUtils.isNotEmpty(perposeEntity.getLeaders())){
List<Long> staffIdList = StringUtils.converStr2Long(perposeEntity.getLeaders());
StaffQuery staffQuery = new StaffQuery();
staffQuery.setIdList(staffIdList);
List<StaffEntity> staffEntityList = staffService.find(staffQuery);
if(CollectionUtils.isNotEmpty(staffEntityList)){
String names = "";
for (StaffEntity item:staffEntityList){
names+=item.getName()+",";
super.findAfter(params, pageInfo, context, list);
list.stream().forEach(item->{
if(AssessmentScopeEnum.个人.getValue()==item.getAssessmentScope()){
List<PerformPerposeStaffEntity> staffEntities = perposeStaffService.find(new PerformPerposeStaffQuery().purposeConfId(item.getId()));
item.setPerposeStaffList(staffEntities);
item.setStaffPerpose(staffEntities.stream().map(item1->item1.getStaffName()).collect(Collectors.joining(",")));
}else if(AssessmentScopeEnum.部门.getValue()==item.getAssessmentScope()){
List<PerformPerposeDeptEntity> deptEntities = perposeDeptService.find(new PerformPerposeDeptQuery().purposeConfId(item.getId()));
item.setPerposeDeptList(deptEntities);
item.setDeptPerpose(deptEntities.stream().map(item1->item1.getDeptName()).collect(Collectors.joining(",")));
}
});
}
@Override
protected void saveAfter(PerformPerposeEntity entity, Context context) throws AppException {
super.saveAfter(entity, context);
if (!ObjectUtils.isEmpty(entity.getPerposeStaffList())) {
entity.getPerposeStaffList().stream().peek(item -> {
item.setPurposeConfId(entity.getId());
if (!ObjectUtils.isEmpty(item.getStaffId())) {
StaffEntity staffCache = staffService.getCache(item.getStaffId().toString());
if (!ObjectUtils.isEmpty(staffCache)) {
item.setStaffName(staffCache.getName());
item.setNumber(staffCache.getWorkNum());
}
}
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
}).count();
perposeStaffService.save(entity.getPerposeStaffList());
}
if (!ObjectUtils.isEmpty(entity.getPerposeDeptList())) {
entity.getPerposeDeptList().stream().peek(item -> {
item.setPurposeConfId(entity.getId());
if (!ObjectUtils.isEmpty(item.getDeptId())) {
DeptEntity deptEntity = deptService.get(item.getDeptId(), context);
if (!ObjectUtils.isEmpty(deptEntity)) {
item.setDeptName(deptEntity.getDeptName());
}
}
perposeEntity.setLeaderNames(names.substring(0,names.length()-1));
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
}).count();
perposeDeptService.save(entity.getPerposeDeptList(), context);
}
}
@Override
protected void updateAfter(PerformPerposeEntity entity, Context context) throws AppException {
super.updateAfter(entity, context);
if (!ObjectUtils.isEmpty(entity.getPerposeStaffList())) {
Long[] performAttendAppealFilesIds = perposeStaffService.find(new PerformPerposeStaffQuery().purposeConfId(entity.getId())).stream().map(PerformPerposeStaffEntity::getId).toArray(Long[]::new);
perposeStaffService.remove(performAttendAppealFilesIds, context);
entity.getPerposeStaffList().stream().peek(item -> {
item.setPurposeConfId(entity.getId());
if (!ObjectUtils.isEmpty(item.getStaffId())) {
StaffEntity staffCache = staffService.getCache(item.getStaffId().toString());
if (!ObjectUtils.isEmpty(staffCache)) {
item.setStaffName(staffCache.getName());
item.setNumber(staffCache.getWorkNum());
}
}
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
}).count();
perposeStaffService.save(entity.getPerposeStaffList());
}
if (!ObjectUtils.isEmpty(entity.getPerposeDeptList())) {
Long[] performAttendAppealFilesIds = perposeDeptService.find(new PerformPerposeDeptQuery().purposeConfId(entity.getId())).stream().map(PerformPerposeDeptEntity::getId).toArray(Long[]::new);
perposeDeptService.remove(performAttendAppealFilesIds, context);
entity.getPerposeDeptList().stream().peek(item -> {
item.setPurposeConfId(entity.getId());
if (!ObjectUtils.isEmpty(item.getDeptId())) {
DeptEntity deptEntity = deptService.get(item.getDeptId(), context);
if (!ObjectUtils.isEmpty(deptEntity)) {
item.setDeptName(deptEntity.getDeptName());
}
}
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
}).count();
perposeDeptService.save(entity.getPerposeDeptList(), context);
}
}
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
super.removeAfter(ids, context, result);
List<PerformPerposeStaffEntity> staffEntityList = perposeStaffService.find(new PerformPerposeStaffQuery().purposeConfIdList(Arrays.asList(ids)));
perposeStaffService.removeList(staffEntityList, context);
List<PerformPerposeDeptEntity> deptEntityList = perposeDeptService.find(new PerformPerposeDeptQuery().purposeConfIdList(Arrays.asList(ids)));
perposeDeptService.removeList(deptEntityList, context);
}
}
\ No newline at end of file
......@@ -27,7 +27,7 @@ import static com.mortals.framework.ap.SysConstains.*;
* 绩效记录申诉信息
*
* @author zxfei
* @date 2023-07-05
* @date 2023-07-12
*/
@RestController
@RequestMapping("perform/attend/appeal")
......@@ -46,6 +46,10 @@ public class PerformAttendAppealController extends BaseCRUDJsonBodyMappingContro
this.addDict(model, "subAddType", paramService.getParamBySecondOrganize("PerformAttendAppeal","subAddType"));
this.addDict(model, "processStatus", paramService.getParamBySecondOrganize("PerformAttendAppeal","processStatus"));
this.addDict(model, "appealResult", paramService.getParamBySecondOrganize("PerformAttendAppeal","appealResult"));
this.addDict(model, "reviewResult", paramService.getParamBySecondOrganize("PerformAttendAppeal","reviewResult"));
this.addDict(model, "reviewSource", paramService.getParamBySecondOrganize("PerformAttendAppeal","reviewSource"));
this.addDict(model, "irregularType", paramService.getParamBySecondOrganize("PerformAttendAppeal","irregularType"));
this.addDict(model, "irregularOtherType", paramService.getParamBySecondOrganize("PerformAttendAppeal","irregularOtherType"));
super.init(model, context);
}
......
......@@ -29,34 +29,56 @@ Authorization: {{authToken}}
Content-Type: application/json
{
"checkRecordId":387,
"staffId":305,
"staffName":"78kg5e",
"workNum":"wy77ky",
"deptId":849,
"deptName":"ry3y3a",
"attendanceGroupId":7,
"attendanceGroupName":"s7n602",
"attendanceDate":"1688486400000",
"ruleId":418,
"ruleName":"y3gz3p",
"checkRecordId":702,
"staffId":566,
"staffName":"b7xpn0",
"workNum":"ymsc43",
"deptId":975,
"deptName":"x9lhxh",
"attendanceGroupId":352,
"attendanceGroupName":"ijhjyv",
"attendanceDate":"1689091200000",
"ruleId":714,
"ruleName":"k3nou3",
"subMethod":1,
"subAddType":1,
"score":0.00,
"goOffTimeStr":"rjf27a",
"errorTime":"1688486400000",
"actualAttendTime":"1688486400000",
"errorResult":"ysfu6y",
"checkPerson":"w4rf2x",
"checkTime":"1688486400000",
"checkDesc":"30plug",
"checkResult":"lu4x9b",
"goOffTimeStr":"3tpp9v",
"errorTime":"1689091200000",
"actualAttendTime":"1689091200000",
"errorResult":"e36tyi",
"checkPerson":"brd56v",
"checkTime":"1689091200000",
"checkDesc":"dxif0b",
"checkResult":"5wz0wh",
"processStatus":1,
"appealDesc":"cumgvt",
"appealTime":"1688486400000",
"appealDesc":"bhhaf6",
"appealTime":"1689091200000",
"appealResult":2,
"remark":"n4bgtv",
"violationType":"1t3xtd"
"remark":"owbk12",
"violationType":"7tb1sj",
"reviewResult":378,
"reviewTime":"1689091200000",
"reviewSource":"hvc7j5",
"reviewDevice":"rbmr61",
"complainTitle":"tirz94",
"complainContent":"wtjqma",
"complainRealName":"v9550o",
"contact":"9lzrer",
"complainTime":"1689091200000",
"complainSource":"r8xzzy",
"complainDevice":"odwoei",
"goworkCode":"ac7kwy",
"goworkDepts":"90jn57",
"matterlName":"9e1tph",
"goworkTime":"1689091200000",
"irregularType":767,
"happenTime":"1689091200000",
"duration":0,
"alarmTime":"1689091200000",
"snapPath":"7r7qk4",
"irregularOtherType":754,
"performType":"yqp4d7"
}
> {%
......
......@@ -420,3 +420,68 @@ ALTER TABLE mortals_xhx_staff_perform_stat ADD COLUMN `totalAddScore` decimal(10
ALTER TABLE mortals_xhx_staff_perform_stat ADD COLUMN `totalSubScore` decimal(10,2) DEFAULT 0.0 COMMENT '员工绩效减分总分数汇总' AFTER totalAddScore;
ALTER TABLE mortals_xhx_staff_perform_stat ADD COLUMN `complainScoreAdd` decimal(10,2) DEFAULT 0.0 COMMENT '员工绩效指标增加分数' AFTER totalSubScore;
ALTER TABLE mortals_xhx_staff_perform_stat ADD COLUMN `complainScoreSub` decimal(10,2) DEFAULT 0.0 COMMENT '员工绩效指标扣减分数' AFTER complainScoreAdd;
-- ----------------------------
-- 绩效记录申诉信息表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_perform_attend_appeal`;
CREATE TABLE mortals_xhx_perform_attend_appeal(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`checkRecordId` bigint(20) COMMENT '核查记录Id',
`staffId` bigint(20) COMMENT '员工ID',
`staffName` varchar(64) NOT NULL COMMENT '员工姓名',
`workNum` varchar(128) COMMENT '工号',
`deptId` bigint(20) COMMENT '所属部门',
`deptName` varchar(128) COMMENT '所属部门名称',
`attendanceGroupId` bigint(20) COMMENT '所属考勤组ID',
`attendanceGroupName` varchar(128) COMMENT '所属考勤组名称',
`attendanceDate` datetime COMMENT '扣分时间',
`ruleId` bigint(20) COMMENT '绩效规则id',
`ruleName` varchar(128) COMMENT '规则名称',
`subMethod` tinyint(1) DEFAULT '1' COMMENT '扣分方式(1.系统自动,2.人工添加,3.大厅巡查)',
`subAddType` tinyint(1) DEFAULT '1' COMMENT '增减类型(1.增加,2.扣除)',
`score` decimal(10,2) DEFAULT '0.00' COMMENT '扣分或增加分值',
`goOffTimeStr` varchar(128) COMMENT '上下班时间',
`errorTime` datetime COMMENT '异常时间',
`actualAttendTime` datetime COMMENT '实际打卡时间',
`errorResult` varchar(128) COMMENT '异常处理结果',
`checkPerson` varchar(128) COMMENT '核查人员',
`checkTime` datetime COMMENT '核查时间',
`checkDesc` varchar(512) COMMENT '核查说明',
`checkResult` varchar(128) COMMENT '核查结果',
`processStatus` tinyint(1) DEFAULT '1' COMMENT '处理状态(1.未处理,2.已处理)',
`appealDesc` varchar(128) COMMENT '申诉说明',
`appealTime` datetime COMMENT '申诉时间',
`appealResult` tinyint(1) DEFAULT '2' COMMENT '申诉结果(1.通过,2.不通过)',
`remark` varchar(512) COMMENT '说明',
`violationType` varchar(64) COMMENT '违规类型,',
`reviewResult` tinyint(1) COMMENT '评价结果(1.非常不满意,2.差评)',
`reviewTime` datetime COMMENT '评价时间',
`reviewSource` varchar(64) COMMENT '评价来源(窗口评价系统,导视系统,自助服务系统,微官网,其它)',
`reviewDevice` varchar(128) COMMENT '评价设备',
`complainTitle` varchar(128) COMMENT '投诉标题',
`complainContent` varchar(512) COMMENT '投诉内容',
`complainRealName` varchar(128) COMMENT '投诉人真实姓名',
`contact` varchar(128) COMMENT '联系电话',
`complainTime` datetime COMMENT '投诉时间',
`complainSource` varchar(128) COMMENT '投诉来源',
`complainDevice` varchar(128) COMMENT '投诉设备',
`goworkCode` varchar(128) COMMENT '办件编码',
`goworkDepts` varchar(512) COMMENT '办件所属部门',
`matterlName` varchar(256) COMMENT '事项名称',
`goworkTime` datetime COMMENT '办理时间',
`irregularType` tinyint(1) COMMENT '违规类型(1.脱岗,2.离岗,3.玩手机,4.睡觉)',
`happenTime` datetime COMMENT '发生时间',
`duration` int(9) DEFAULT '0' COMMENT '持续时间,秒',
`alarmTime` datetime COMMENT '报警时间',
`snapPath` varchar(255) COMMENT '图片凭证地址',
`irregularOtherType` tinyint(1) COMMENT '违规类型(1.工作纪律)',
`performType` varchar(64) COMMENT '绩效类型【attend:考勤绩效,review:评价差评绩效,complain:评价投诉绩效,gowork:办件绩效,effect:效能绩效,other:其它绩效】',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='绩效记录申诉信息';
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